Files
gods-eye-view/src/maps/imageryHost.js
T
German KhokhlovandClaude Opus 5.5 20f4cf3763 i18n: fix the LGTM review findings and tidy the branch texts
- i18n scanner: lastError sink, no false sinks on defaults and ternaries
- shared src/i18n/marker.js for modules that only mark strings
- wind field messages move to wind/fields.js; CITY_POIS imports from cityPois.js
- drop review IDs, change history and stale references from comments and docs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 21:00:28 +04:00

29 lines
1.1 KiB
JavaScript

/**
* Where draped imagery can go on the current map stack. A globe stack drapes
* on `viewer.imageryLayers`; a 3D-tiles stack hides the globe, and Cesium
* 1.138 drapes imagery onto the tileset's own `imageryLayers` instead. When
* neither exists there is nowhere to drape and the caller says so.
*/
import { msg } from '../i18n/marker.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',
);
/**
* Resolve the imagery layer collection for the active map stack.
* @param {{ viewer?: object, tileset?: object }} scene
* @returns {{ collection: object | null, kind: 'globe' | 'tileset' | 'none' }}
*/
export function resolveImageryHost({ viewer, tileset } = {}) {
if (viewer?.scene?.globe?.show === true && viewer.imageryLayers) {
return { collection: viewer.imageryLayers, kind: 'globe' };
}
if (tileset?.imageryLayers && !tileset.isDestroyed?.()) {
return { collection: tileset.imageryLayers, kind: 'tileset' };
}
return { collection: null, kind: 'none' };
}