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

+8 -8
View File
@@ -855,15 +855,15 @@ export function normalizeRoutePayload(payload, mode) {
* shared services are injected, which is what keeps this module's own imports
* down to the globe contract display and the pure step formatter.
* @param {{services: object, source: {getRoute: Function},
* createRenderer?: (engine: object) => object|null}} options
* `createRenderer` builds the display on an engine (render/display.js by
* rendererFactory?: (engine: object) => object|null}} options
* `rendererFactory` builds the display on an engine (render/display.js by
* default).
* @returns {object} The layer module the data manager registers.
*/
export function createDirectionsLayer({
services,
source,
createRenderer = createDirectionsDisplay,
rendererFactory = createDirectionsDisplay,
}) {
if (typeof source?.getRoute !== 'function')
throw new TypeError('Directions require a route source');
@@ -877,9 +877,9 @@ export function createDirectionsLayer({
overlays: bindOverlayHost(services.overlays, () => _engine),
};
const DEFAULT_OVERLAY_HOST = Object.freeze({
setEntries: (...args) => services.overlays.setOverlayEntries(...args),
setVisible: (...args) => services.overlays.setOverlaySourceVisible(...args),
clearSource: (...args) => services.overlays.clearOverlaySource(...args),
setEntries: (...args) => services.overlays.setEntries(...args),
setVisible: (...args) => services.overlays.setVisible(...args),
clearSource: (...args) => services.overlays.clearSource(...args),
});
let _overlayHost = DEFAULT_OVERLAY_HOST;
@@ -1486,7 +1486,7 @@ export function createDirectionsLayer({
function _installClickHandler() {
if (_listening) return;
_listening = true;
_removeClick = _display?.onClick(_onClick) ?? null;
_removeClick = _engine?.input.on('click', _onClick, { pick: true }) ?? null;
if (typeof document !== 'undefined')
document.addEventListener('keydown', _onKeyDown);
}
@@ -1521,7 +1521,7 @@ export function createDirectionsLayer({
},
attachRenderer(_scene, { engine = null } = {}) {
_engine = engine;
_display = engine ? createRenderer(engine) : null;
_display = engine ? rendererFactory(engine) : null;
_display?.show(_enabled);
_overlayHost.setVisible(DIRECTIONS_STEP_OVERLAY_SOURCE_ID, _enabled);
if (!_enabled) return;