Fly the director, annotations, voice framing and local GeoJSON through the camera port

The scene director's shot flights, start pose and stops, the annotation
framings and fly-to, the voice overhead framing and the local GeoJSON
click flight now drive the renderer's camera port. The director's stops
look the camera up with findCamera: teardown can run after the viewer is
gone, and then there is no flight to stop. The local GeoJSON flight,
part of the public infrastructure export, works on a plain Cesium viewer
through the unbound camera, and looks it up before taking its input
hold. Voice zoom stays for the move slice.
This commit is contained in:
Sameh Khamis committed 2026-11-06 09:49:30 -08:00
1 parent 1d4e4ebe90
commit bec83bcfce
8 files changed
+125 -73

No files matched your search

+7
View File
@@ -186,21 +186,28 @@ test('consumer build includes only infrastructure code and resolves assets under
const entry = output.find((item) => item.type === 'chunk' && item.isEntry);
const sources = Object.keys(entry.modules).filter((id) => id.endsWith('.js'));
assert.deepEqual(sources.map((id) => id.split('/').at(-1)).sort(), [
'camera.js',
'cameraInput.js',
'celestial.js',
'common.js',
'ctrlWheelZoom.js',
'dispatcher.js',
'events.js',
'heights.js',
'infrastructure.js',
'infrastructureData.js',
'infrastructureOverlayEntry.js',
'input.js',
'inputOwnership.js',
'internals.js',
'localGeojsonCore.js',
'localGeojsonLod.js',
'pickRegistry.js',
'rendererOf.js',
'router.js',
'scenePick.js',
'sensorPick.js',
'vector.js',
]);
assert.deepEqual(
entry.imports,
+11 -6
View File
@@ -1,4 +1,5 @@
import * as Cesium from 'cesium';
import { cameraOf } from '../render/cesium/camera.js';
import {
layerTitle,
mapAnalystRecord,
@@ -820,6 +821,8 @@ export function createLocalGeoJsonLayer(
if (targetPos) {
const carto = Cesium.Cartographic.fromCartesian(targetPos);
// Before the hold: with no camera, nothing would end it.
const camera = cameraOf(viewer);
// Hold camera input so Cesium doesn't cancel the flight.
// A hold, not a flag: the flight ending must not hand input
@@ -828,16 +831,18 @@ export function createLocalGeoJsonLayer(
'local-geojson-flight',
);
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromRadians(
camera.flyTo(
Cesium.Cartesian3.fromRadians(
carto.longitude,
carto.latitude,
5000,
),
duration: 1.5,
complete: releaseCamera,
cancel: releaseCamera,
});
{
durationS: 1.5,
onComplete: releaseCamera,
onCancel: releaseCamera,
},
);
}
}
});