fix(globe): tighten the Cesium engine after review

Map sources are applied through one src/maps/sceneApply.js helper shared by MapSourceController and engine.maps (live layer kept for an unchanged provider, providers cached per source). The contract gains flyTo endTransform and rectangle destinations, flyToSphere easing, drillPick width/height and pick content, with Cesium's own flyToSphere range. Input skips listeners removed during dispatch and stays inert after destroy.
This commit is contained in:
German Khokhlov committed 2026-10-15 17:55:00 +04:00
1 parent d831cbd23a
commit ab2368f3f3
18 files changed
+658 -117

No files matched your search

+5 -1
View File
@@ -39,6 +39,7 @@ export function createCesiumInput(
) {
const { scene } = viewer;
let handler = null;
let destroyed = false;
const groups = new Map();
const input = {
@@ -47,6 +48,7 @@ export function createCesiumInput(
throw new TypeError(`Unknown input type: ${type}`);
if (modifier !== undefined && !MODIFIERS.includes(modifier))
throw new TypeError(`Unknown input modifier: ${modifier}`);
if (destroyed) return () => {};
handler ??= createEventHandler(scene.canvas);
const key = `${type}:${modifier}`;
let listeners = groups.get(key);
@@ -56,7 +58,8 @@ export function createCesiumInput(
handler.setInputAction(
(event) => {
const converted = toEvent(event);
for (const entry of [...listeners]) entry.listener(converted);
for (const entry of [...listeners])
if (listeners.has(entry)) entry.listener(converted);
},
TYPES[type],
KEYS[modifier],
@@ -78,6 +81,7 @@ export function createCesiumInput(
return {
input,
destroy() {
destroyed = true;
groups.clear();
handler?.destroy();
handler = null;