Read what the camera follows through one module

src/data/followed.js answers what the camera follows: the camera port's
target, or the entity a layer still tracks itself, seen through the same
fields. Ownership checks, render holds, guards, voice actions, the CCTV
pacing and the navigation release paths read it instead of Cesium's
trackedEntity, so they keep working when layers follow through the port.
The release paths stop following, cancel the flight and release the
camera through the port. The rotate refusal names the followed target by
its name or label title.
This commit is contained in:
Sameh Khamis committed 2026-11-06 12:27:23 -08:00
1 parent 6c215f93a9
commit 7eec2f828c
29 files changed
+404 -97

No files matched your search

+4 -2
View File
@@ -1,3 +1,4 @@
import { followedOf, stopFollowing } from './followed.js';
import * as Cesium from 'cesium';
const STYLE = [
@@ -113,8 +114,9 @@ export function createImportedPins(dataSource, viewer) {
destroy() {
if (destroyed) return;
destroyed = true;
if (viewer.trackedEntity && pins.includes(viewer.trackedEntity))
viewer.trackedEntity = undefined;
const followedEntity = followedOf(viewer)?.entity;
if (followedEntity && pins.includes(followedEntity))
stopFollowing(viewer);
if (viewer.selectedEntity && pins.includes(viewer.selectedEntity))
viewer.selectedEntity = undefined;
if (mounted && !viewer.scene.primitives?.isDestroyed?.())