Files
gods-eye-view/src/render/baseTilesets.js
T
Sameh Khamis 04a764ed86 Draw the Recent Imagery box preview through the draw port, off the Cesium list
The box being dragged was two Cesium entities on a data source of its own.
It is now a clamped colour rectangle in a shapes set and a draped dashed
outline in a lines set, both unpickable, with the same colour, alpha,
width and dash length. The Cesium draw port now redraws a moved clamped
fill in the frame it moves, so the box shows on every frame of the drag.
The fill shows once the box has an area. The outline shows once the box
has any extent, so a drag along one axis still draws a line. The last box
is kept hidden between drags, and the next drag moves it.

markBaseTileset moves to a Cesium-free module, src/render/baseTilesets.js.
The globe port reads it and re-exports it, so a tileset a caller marks
as its base is still draped on. rendering.js no longer imports Cesium or
reaches the viewer and leaves the Cesium allow-list. The application's
tools loaded the globe factory only through it, so embed.js now loads it.
2026-11-08 21:18:56 -08:00

25 lines
953 B
JavaScript

/**
* @module render/baseTilesets
* @description Tilesets the application draws as its base outside the
* renderer's globe port, marked so the port drapes imagery on them while
* they are shown. Cesium-free: code that loads its own base, or hands
* a layer one (`recentImagery.attachTileset`), marks it here without
* reaching the renderer; the renderer's globe port reads the marks.
*/
const marked = new WeakSet();
/**
* Mark a tileset as a base the application draws outside the port, so
* imagery drapes on it while it is shown. The port's own photoreal tileset
* needs no mark.
* @param {object} tileset The renderer's tileset object.
*/
export function markBaseTileset(tileset) {
if (tileset && typeof tileset === 'object') marked.add(tileset);
}
/** Whether `tileset` was marked as a base (`markBaseTileset`). */
export const isBaseTileset = (tileset) =>
Boolean(tileset && typeof tileset === 'object' && marked.has(tileset));