Follow, drape and read the camera through the ports, not the viewer

- What the camera follows is the camera port's target only: no layer
  tracks an entity of its own any more, so followed.js stops reading and
  writing viewer.trackedEntity and the viewer's clock.
- Draped imagery's host is the globe port's imagery while the globe is
  shown (isGlobeVisible, or no shown base tileset where a renderer cannot
  say), else the shown base tileset; weather uses the same resolver.
- The World Packet reads the eye from the camera port's pose, and vessels
  ask again for the view on the camera port's moveEnd.
- The stub's canvas takes event listeners, and in a page is a real canvas
  filling the container it is given; createStubRendererPlugin makes it a
  renderer plugin.

The viewer access record is now empty.
This commit is contained in:
Sameh Khamis committed 2026-11-10 17:18:10 -08:00
1 parent ebbe006924
commit a72d4c3b1f
11 files changed
+230 -213

No files matched your search

+4 -3
View File
@@ -1,5 +1,6 @@
import { VESSEL_OVERLAY_SOURCE_ID } from '../../data/vesselLabels.js';
import { msg, t } from '../../i18n/index.js';
import { findCamera } from '../../render/rendererOf.js';
import { AIS_FIRST_CONNECT_GRACE_MS, AIS_HEALTHY_STATUSES } from './policy.js';
export function createLifecycle({
@@ -190,9 +191,9 @@ export function createLifecycle({
);
// Vessels are asked for by view, so ask again when the view moves away.
removeViewListener();
const moveEnd = activeViewer?.camera?.moveEnd;
if (typeof moveEnd?.addEventListener === 'function')
state.feed.removeViewListener = moveEnd.addEventListener(() => {
const camera = findCamera(activeViewer);
if (camera)
state.feed.removeViewListener = camera.on('moveEnd', () => {
components.ingestion.refreshIfMoved(activeViewer);
});
return components.ingestion.loadLivePositions(activeViewer);