Stop Navara's memory growth on engine switches, hide polygon zones reliably, and drop the Cesium camera rig

- Navara 0.2.1 never frees pick batch ids, and the mover banks rebuilt
  their instanced meshes on each attach, leaking about 260 KiB of
  WebAssembly memory per switch. A per-view pool hands released ids back
  out; the long soak now asserts native growth of at most 32 KiB per switch.
- Navara 0.2.1 sometimes drops the first show:false update on a new
  vector layer, so a zone turned off right after a switch back stayed
  drawn. Polygon displays hide by deleting their layers and rebuild them
  when shown.
- Camera verbs drive both engines through the globe contract; the Cesium
  viewer rig and the tests of states it can no longer reach are gone.
- Flights and military tracking share src/layers/aircraft/tracking.js.
- The geo import scenario reads movers only where the engine has them.
- Add the Navara section to docs/CURRENT-STATE.md and a changelog fragment.
This commit is contained in:
German Khokhlov committed 2026-11-05 21:18:23 +04:00
1 parent 7abf74518f
commit a6c64713ee
46 files changed
+2367 -2894

No files matched your search

+7 -5
View File
@@ -30,7 +30,8 @@ function localizedValues(values) {
* and returns their disconnect.
*
* The imported files belong to the session; their drawing belongs to the
* attached globe. `attachScene({ viewer })` draws them on a Cesium viewer;
* attached globe. `attachScene({ viewer, engine })` draws them on a Cesium
* viewer (its engine flies the camera to them);
* `attachScene({ engine, draw })` on a globe engine without one (Navara),
* where `draw(dataSource)` resolves with that engine's drawing of a file
* ({ report, setShow, refresh, destroy }: src/layers/shared/render/navaraStory.js).
@@ -67,7 +68,8 @@ export function createGeoFileImport({
let hint = '';
const lifetime = new AbortController();
// The attached globe ({ viewer, engine, draw, controller }): a Cesium
// viewer, or an engine and its drawing; null while none is attached.
// viewer and its engine, or an engine and its drawing; null while none is
// attached.
let scene = null;
const listen = (target, type, listener, options) => {
@@ -186,9 +188,9 @@ export function createGeoFileImport({
}
const fly = (item) => {
if (!scene || !item.dataSource) return false;
if (!scene?.engine || !item.dataSource) return false;
if (!item.visible) setVisible(item.id, true);
flyToSource(scene.viewer ?? scene.engine, item.dataSource, { ground });
flyToSource(scene.engine, item.dataSource, { ground });
return true;
};
@@ -471,7 +473,7 @@ export function createGeoFileImport({
if (typeof offMapSource === 'function') groundRemovers.push(offMapSource);
const attached = (scene = {
viewer,
engine: viewer ? null : engine,
engine,
draw: viewer ? null : drawOnEngine,
controller: new AbortController(),
});