mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(app): run gev on Navara behind ?engine=navara
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.
This commit is contained in:
1 parent
306e3e9467
commit
4ded3fbf15
21 files changed
+776
-49
No files matched your search
@@ -1,6 +1,10 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createLayerCatalog, catalogControlServices } from './catalog.js';
|
||||
import {
|
||||
absentLayerControlServices,
|
||||
createLayerCatalog,
|
||||
catalogControlServices,
|
||||
} from './catalog.js';
|
||||
import { createApplicationData } from './data.js';
|
||||
|
||||
const metadata = (layers) =>
|
||||
@@ -124,3 +128,65 @@ test('controls bind catalog instances rather than similarly named defaults', ()
|
||||
/Control layer missing/,
|
||||
);
|
||||
});
|
||||
|
||||
test('without data layers the controls get one empty stand-in per layer role', () => {
|
||||
const ids = [
|
||||
'traffic',
|
||||
'flights',
|
||||
'military',
|
||||
'satellites',
|
||||
'cctv',
|
||||
'street-level',
|
||||
'radio',
|
||||
'bikeshare',
|
||||
'transit',
|
||||
'ais-live-vessels',
|
||||
'military-awareness',
|
||||
'military-installations',
|
||||
'rocket-launches',
|
||||
'local-adsb',
|
||||
];
|
||||
const layers = ids.map((id) => ({ id }));
|
||||
const roles = Object.keys(
|
||||
catalogControlServices(createLayerCatalog(layers, metadata(layers))),
|
||||
);
|
||||
const absent = absentLayerControlServices();
|
||||
assert.deepEqual(Object.keys(absent), roles);
|
||||
for (const role of roles) {
|
||||
assert.deepEqual(Object.keys(absent[role]), [], role);
|
||||
assert.equal(absent[role].subscribe, undefined);
|
||||
}
|
||||
assert.notEqual(absent.flightsLayer, absent.trafficLayer);
|
||||
assert.notEqual(
|
||||
absentLayerControlServices().flightsLayer,
|
||||
absent.flightsLayer,
|
||||
);
|
||||
});
|
||||
|
||||
test('data setup without a viewer registers an empty catalog and no sonar scene', async (t) => {
|
||||
const previous = globalThis.document;
|
||||
globalThis.document = { getElementById: () => null };
|
||||
t.after(() => {
|
||||
if (previous === undefined) delete globalThis.document;
|
||||
else globalThis.document = previous;
|
||||
});
|
||||
const releases = [];
|
||||
let attached = null;
|
||||
const { dataManager } = createApplicationData({
|
||||
scene: { viewer: null, mapStackController: null },
|
||||
controls: {
|
||||
styleManager: {
|
||||
attachDataManager(manager) {
|
||||
attached = manager;
|
||||
},
|
||||
},
|
||||
},
|
||||
catalog: createLayerCatalog([], []),
|
||||
defer: (release) => releases.push(release),
|
||||
});
|
||||
assert.equal(attached, dataManager);
|
||||
assert.equal(dataManager.viewer, null);
|
||||
assert.equal(dataManager.layers.size, 0);
|
||||
assert.equal(dataManager.registrationsFinalized, true);
|
||||
for (const release of releases.reverse()) await release();
|
||||
});
|
||||
Reference in new issue
Block a user