mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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:
1 parent
1d4e4ebe90
commit
bec83bcfce
8 files changed
+125
-73
No files matched your search
@@ -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,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user