mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
The page's engine is ?engine=cesium|navara, else localStorage gev.engine, else Cesium (src/app/engineChoice.js). Cesium mode is unchanged. In Navara mode (src/app/navaraMode.js, loaded with import() only then, and loading the Navara globe the same way) the scene builds the Navara globe on the app container with no viewer; map stacks go through engine.maps (Google 3D from the browser key, else Esri imagery); only the shell's own data credits are registered. The layer catalog is empty and the controls get empty layer stand-ins. The shell does not create its viewer-bound parts (cockpit view, celestial ring, detection, tracked readout, post-process stages); the tools install the render governor on the engine, skip the director, annotations, drawing, imagery box, scope mask, voice and embedded views, skip the first-run welcome, and show "Experimental Navara engine: layers, cockpit, director and voice are unavailable". window.__godsEyeView.viewer is null. Navara's attribution card is kept clear of the location tray. A few shell paths became null-safe for the missing viewer, layers or stages without changing Cesium behaviour. scripts/qa-engine-shell.mjs checks both modes headless: boot, viewer, console errors, map drawn, search and fly, north/tilt/zoom/reset, orbit, HUD, share link restore and map stacks.
31 lines
1008 B
JavaScript
31 lines
1008 B
JavaScript
/** The localStorage key that remembers an engine choice between visits. */
|
|
export const ENGINE_STORAGE_KEY = 'gev.engine';
|
|
|
|
const KINDS = new Set(['cesium', 'navara']);
|
|
|
|
const known = (value) => {
|
|
const kind = String(value ?? '')
|
|
.trim()
|
|
.toLowerCase();
|
|
return KINDS.has(kind) ? kind : null;
|
|
};
|
|
|
|
/**
|
|
* The globe engine for this page: `?engine=cesium|navara`, else the stored
|
|
* `gev.engine`, else Cesium. Navara is experimental; an unknown or unreadable
|
|
* value never selects it.
|
|
* @param {{ search?: string, storage?: { getItem(key: string): string | null } | null }} [where]
|
|
* @returns {'cesium' | 'navara'}
|
|
*/
|
|
export function resolveEngineKind({ search = '', storage = null } = {}) {
|
|
const fromQuery = known(new URLSearchParams(search).get('engine'));
|
|
if (fromQuery) return fromQuery;
|
|
let stored = null;
|
|
try {
|
|
stored = storage?.getItem(ENGINE_STORAGE_KEY);
|
|
} catch {
|
|
// Storage can be blocked (private mode, sandboxed frames).
|
|
}
|
|
return known(stored) ?? 'cesium';
|
|
}
|