feat(director): add authored camera directions and anchors

This commit is contained in:
Sameh Khamis committed 2026-09-15 16:53:26 -07:00
1 parent 0ea10468ea
commit 13c0b8d1bc
24 files changed
+1104 -167

No files matched your search

+11
View File
@@ -1,3 +1,4 @@
import { createStateChannel } from '../app/stateChannel.js';
import * as Cesium from 'cesium';
import {
beginDeferredNavigation,
@@ -34,6 +35,9 @@ export class NavigationController {
cancelOrientation,
});
this._navigationGeneration = 0;
this._cameraHandoffs = createStateChannel(() => ({
generation: this._navigationGeneration,
}));
this._activeLocationSearchGeneration = null;
this._disposed = false;
}
@@ -45,6 +49,7 @@ export class NavigationController {
const { flightsLayer, militaryFlightsLayer, satellitesLayer } =
this.tracking;
this._navigationGeneration += 1;
this._cameraHandoffs?.publish();
// A newer destination owns the camera, so the last free-text search is no
// longer where we are. DEFERRED navigation opts out here and clears at the
// reassert seam instead: a geocode that never resolves moves no camera, and
@@ -247,8 +252,14 @@ export class NavigationController {
},
});
}
/** Subscribe to ownership changes without claiming the camera or exposing mutable state. */
subscribeCameraHandoff(listener) {
return this._cameraHandoffs.subscribe(listener, { emitCurrent: false });
}
stop() {
this._disposed = true;
this._cameraHandoffs?.publish();
this._cameraHandoffs?.destroy();
}
destroy() {
this.stop();