mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
CAMERA_PRESETS and flyToPreset have no callers. Startup uses flyToAustin, which stays, and city navigation uses flyToPresetLocation from src/locations.js. Neither removed symbol is a package export.
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
import * as Cesium from 'cesium';
|
|
|
|
/**
|
|
* Set camera to Austin on load with a cinematic fly-in.
|
|
* @returns {Function} Cancels the pending or active startup flight.
|
|
*/
|
|
export function flyToAustin(viewer) {
|
|
// Start from a high altitude, then fly down
|
|
viewer.camera.setView({
|
|
destination: Cesium.Cartesian3.fromDegrees(-97.7431, 30.2672, 25000),
|
|
orientation: {
|
|
heading: Cesium.Math.toRadians(0),
|
|
pitch: Cesium.Math.toRadians(-90),
|
|
roll: 0.0,
|
|
},
|
|
});
|
|
|
|
// Cinematic fly-in after a brief pause
|
|
const timer = setTimeout(() => {
|
|
if (viewer.isDestroyed()) return;
|
|
viewer.camera.flyTo({
|
|
destination: Cesium.Cartesian3.fromDegrees(-97.7431, 30.2672, 600),
|
|
orientation: {
|
|
heading: Cesium.Math.toRadians(15),
|
|
pitch: Cesium.Math.toRadians(-30),
|
|
roll: 0.0,
|
|
},
|
|
duration: 4.0,
|
|
easingFunction: Cesium.EasingFunction.CUBIC_IN_OUT,
|
|
});
|
|
}, 500);
|
|
return () => {
|
|
clearTimeout(timer);
|
|
if (!viewer.isDestroyed()) viewer.camera.cancelFlight();
|
|
};
|
|
}
|