mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Merge origin/main into german/navara
Main's new layers (drone airspace, OSM places, sea marks, ski pistes) are Cesium-only for now: they join the layer directory and the Cesium catalog, are built afresh for each Cesium catalog, and show as unavailable on Navara. The zoom-out guard is a scene part that attaches to Cesium globes only. The awareness range pulses and their echoes draw on Cesium through the awareness display's viewer; Navara keeps the plain range ring. Camera-input wakes go through the display, and the analyst keeps the session-owned memory with main's area presentation. A disposed voice runner aborts work in flight, and an engine switch still keeps the last answer. Modules main added that read Cesium while they load (zoomOutGuard, awarenessEcho, the ground-sampling scratch in localGeojsonCore) now build those values on first use or use src/geo, so a Navara page still starts without the SDK. The OSM view box reads the engine's view rectangle. Main grew its own main chunk by 93,873 bytes gzip-9 since the merge base, so the baseline is raised to the merged size.
This commit is contained in:
commit
db9bf64821
264 files changed
+33864
-1424
No files matched your search
@@ -1,6 +1,12 @@
|
||||
import test from 'node:test';
|
||||
import test, { after, before } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import * as Cesium from 'cesium';
|
||||
import '../testSupport/stubMgrs.mjs';
|
||||
import { installVueDom } from '../testSupport/vueDom.mjs';
|
||||
import { MAXIMUM_ZOOM_DISTANCE_M } from './zoomOutGuard.js';
|
||||
|
||||
const { createApplicationControls } = await import('./controls.js');
|
||||
|
||||
// controls.js and the shell import browser-only UI modules, so these read the
|
||||
// source: the scene engine is threaded to the shell, which hands it (not the
|
||||
@@ -32,3 +38,64 @@ test('the shell initializes the world overlay on its engine', () => {
|
||||
assert.match(shell, /initWorldOverlay\(engine\);/);
|
||||
assert.doesNotMatch(shell, /initWorldOverlay\(viewer\)/);
|
||||
});
|
||||
|
||||
let uninstallDom;
|
||||
before(() => {
|
||||
uninstallDom = installVueDom();
|
||||
});
|
||||
after(() => uninstallDom());
|
||||
|
||||
test('application controls install the zoom-out guard and remove it on teardown', async () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const controller = { maximumZoomDistance: Infinity };
|
||||
const scene = {
|
||||
mode: Cesium.SceneMode.SCENE3D,
|
||||
screenSpaceCameraController: controller,
|
||||
preRender: new Cesium.Event(),
|
||||
postUpdate: new Cesium.Event(),
|
||||
};
|
||||
const camera = {
|
||||
position: Cesium.Cartesian3.fromDegrees(0, 0, 1_000_000),
|
||||
positionCartographic: { height: 1_000_000 },
|
||||
};
|
||||
const viewer = { scene, camera, canvas };
|
||||
const handoffs = new Set();
|
||||
class Controls {
|
||||
hasShareState = true;
|
||||
orbitController = { stop() {} };
|
||||
hud = { destroy() {} };
|
||||
dispose() {}
|
||||
detachScene() {}
|
||||
subscribeCameraHandoff(listener) {
|
||||
handoffs.add(listener);
|
||||
return () => handoffs.delete(listener);
|
||||
}
|
||||
}
|
||||
const cleanups = [];
|
||||
await createApplicationControls({
|
||||
scene: {
|
||||
viewer,
|
||||
mapStackController: {},
|
||||
operations: {
|
||||
surface: { controlServices: {} },
|
||||
searchAndFlyTo() {},
|
||||
requests: { regional: {}, weather: {} },
|
||||
},
|
||||
},
|
||||
loaderStatus: {},
|
||||
Controls,
|
||||
catalog: { get: (id) => ({ id }) },
|
||||
defer: (cleanup) => cleanups.push(cleanup),
|
||||
});
|
||||
|
||||
assert.equal(controller.maximumZoomDistance, MAXIMUM_ZOOM_DISTANCE_M);
|
||||
assert.equal(scene.preRender.numberOfListeners, 1);
|
||||
assert.equal(scene.postUpdate.numberOfListeners, 1);
|
||||
assert.equal(handoffs.size, 1);
|
||||
|
||||
for (const cleanup of cleanups.reverse()) await cleanup();
|
||||
assert.equal(controller.maximumZoomDistance, Infinity);
|
||||
assert.equal(scene.preRender.numberOfListeners, 0);
|
||||
assert.equal(scene.postUpdate.numberOfListeners, 0);
|
||||
assert.equal(handoffs.size, 0);
|
||||
});
|
||||
Reference in new issue
Block a user