mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
- The standalone page starts loading the default renderer as it starts (loadDefaultRenderer), so Cesium arrives beside the page's own setup, not after it; the scene takes a plugin or a promise of one. - Where a follow target's layer has no display position yet, the followed position is the target's own position at the frame port's scene time. - The globe engine's photoreal base that fails to come back is off again and the globe shown; a later switch tries again. The draped-imagery host asks the map engine whether the globe is shown where the renderer cannot say. The scene resizes the renderer with its container. - Cockpit and voice tests follow through the camera port (followEntity), not by setting the viewer's tracked entity; the fake frame port has a scene time.
40 lines
1.7 KiB
JavaScript
40 lines
1.7 KiB
JavaScript
/**
|
|
* Where draped imagery can go on the current map stack. A globe stack drapes
|
|
* on the globe port's imagery; a 3D-tiles stack hides the globe, and the
|
|
* renderer drapes that imagery onto the shown base tileset instead. When
|
|
* neither is drawn there is nowhere to drape and the caller says so.
|
|
*/
|
|
|
|
import { msg } from '../i18n/marker.js';
|
|
import { findGlobe } from '../render/rendererOf.js';
|
|
import { mapEngineFor } from './engine.js';
|
|
|
|
/** Guidance shown when the active map stack cannot host draped imagery. */
|
|
export const NO_IMAGERY_HOST = msg(
|
|
'Hidden by this map source · choose a globe map',
|
|
);
|
|
|
|
const NONE = Object.freeze({ collection: null, kind: 'none' });
|
|
|
|
/**
|
|
* Resolve the imagery host for the active map stack: the globe port's
|
|
* imagery while the globe is shown, else the shown base tileset (the map
|
|
* stack's `getImageryHostTileset()`), else none. `collection` names the host
|
|
* (one value per host, so a change of host is a change of it). A renderer
|
|
* that does not say whether its globe is shown (no `globeVisibility`) is
|
|
* answered by the scene's map engine, which shows and hides it.
|
|
* @param {{ viewer?: object, tileset?: object }} scene
|
|
* @returns {{ collection: object | null, kind: 'globe' | 'tileset' | 'none' }}
|
|
*/
|
|
export function resolveImageryHost({ viewer, tileset } = {}) {
|
|
const globe = findGlobe(viewer);
|
|
const shownTileset =
|
|
tileset && tileset.isDestroyed?.() !== true ? tileset : null;
|
|
const globeShown =
|
|
globe &&
|
|
(globe.isGlobeVisible?.() ?? mapEngineFor(viewer).globeShown(viewer));
|
|
if (globe && globeShown) return { collection: globe.imagery, kind: 'globe' };
|
|
if (shownTileset) return { collection: shownTileset, kind: 'tileset' };
|
|
return NONE;
|
|
}
|