Remove always-true layer availability and leftover viewer paths

Every layer draws on both engines, so the per-engine availability
machinery always answered yes. The renderer manifest is now the id to
display map plus the wind flow backend; the catalog filter, the voice and
QA-probe refusals and the engine-kind checks go with it. The Navara
notice lists the same layers in the same words.

Paths that read the Cesium viewer behind an engine that is always there
are gone: the Recent Imagery viewer fallbacks, the shell's imagery-host
service (one shared host module remains), the engineless map controller,
viewer gates in voice actions, world packets and camera verbs, the
orientation controls' tracked-entity fallback, and the Bhote Koshi and
FIRMS Cesium-shaped paths. setCameraInputs, which nothing called, leaves
the contract; suspensions remain.

Smaller duplicates go too: one tracker-release helper for navigation and
location, the no-op frame latch, missing-engine guards, one name for the
injected display, flat bikeshare and installations displays, one overlay
host and binder, one name per world-overlay method, and stub-viewer
guards in the Cesium engine. Layers that still read the viewer keep the
shared init(viewer, context) entry.

Behaviour is unchanged on both engines. Viewer lines fall from 849 to
750 and engine-name literals from 32 to 27.
This commit is contained in:
German Khokhlov committed 2026-11-08 17:06:01 +04:00
1 parent 371d848eec
commit 7f478e3815
279 files changed
+1570 -3104

No files matched your search

+1 -15
View File
@@ -99,16 +99,12 @@ export function createFirmsDisplay(
engine,
{ id = 'local-firms', loadImage, createCanvas } = {},
) {
if (!engine?.movers || !engine?.ground || !engine?.imagery)
throw new TypeError('The FIRMS display needs a globe engine');
let destroyed = false,
visible = false,
cellItems = [],
cellsQueued = false,
sprites = null,
heat = null;
// The layer's visibility as the context store reads a data source's.
const dataSource = { show: false };
const clickRemovers = new Set();
const cells = engine.ground.createSet({ id: `${id}:cells`, kind: 'cell' });
cells.show(false);
@@ -116,9 +112,6 @@ export function createFirmsDisplay(
layerId: id,
isDestroyed: () => destroyed,
});
// The camera and scene events the layer's watchers listen to.
layerView.view.camera.moveEnd = engine.camera.moveEnd;
layerView.view.scene.preRender = engine.frames.preRender;
// Cells arrive one addCell at a time: one commit per batch.
const scheduleCells = () => {
if (cellsQueued || destroyed) return;
@@ -137,16 +130,11 @@ export function createFirmsDisplay(
return {
engine,
view: layerView.view,
dataSource,
project: (position, result) =>
engine.projector.worldToWindow(position, result),
visible: () => visible,
viewRectangle(result) {
const rect = engine.camera.viewRectangle();
return rect ? Object.assign(result ?? {}, rect) : null;
},
horizon: () => ({
isPointVisible: (position) => engine.projector.horizonVisible(position),
}),
/**
* Calls `handler({ position, picked })` for every click while the layer
* is shown, with the pick under it; returns the remover.
@@ -171,7 +159,6 @@ export function createFirmsDisplay(
const next = show !== false;
if (visible === next) return;
visible = next;
dataSource.show = next;
sprites?.setVisible(next);
cells.show(next);
},
@@ -230,7 +217,6 @@ export function createFirmsDisplay(
if (destroyed) return;
destroyed = true;
visible = false;
dataSource.show = false;
cellItems = [];
for (const release of [...clickRemovers]) release();
removeSprites();
+6 -6
View File
@@ -230,7 +230,7 @@ for (const make of HARNESSES) {
}
r.setVisible(false);
assert.equal(h.ground.listed(id).shown, false);
assert.equal(r.dataSource.show, false);
assert.equal(r.visible(), false);
r.clearCells();
await settle();
assert.equal(r.cellCount(), 0);
@@ -422,19 +422,19 @@ for (const make of HARNESSES) {
1e-6,
),
);
assert.equal(r.view.camera.moveEnd, h.engine.camera.moveEnd);
assert.equal(r.view.scene.preRender, h.engine.frames.preRender);
assert.equal(r.engine.camera.moveEnd, h.engine.camera.moveEnd);
assert.equal(r.engine.frames.preRender, h.engine.frames.preRender);
const near = at(FIRE.lon, FIRE.lat);
assert.deepEqual(
r.project(near, {}),
r.view.worldToWindow(near, {}),
h.engine.projector.worldToWindow(near, {}),
);
assert.deepEqual(r.viewRectangle({}), {
...h.engine.camera.viewRectangle(),
});
const far = at(FIRE.lon + 180, -FIRE.lat);
assert.equal(r.horizon().isPointVisible(near), true);
assert.equal(r.horizon().isPointVisible(far), false);
assert.equal(r.view.horizon().isPointVisible(near), true);
assert.equal(r.view.horizon().isPointVisible(far), false);
r.destroy();
} finally {
h.destroy();