Load the Cesium SDK and its widget styles only when a Cesium globe first starts

This commit is contained in:
German Khokhlov committed 2026-11-03 22:56:24 +04:00
1 parent 9f8381ff71
commit ae13a56f6d
27 files changed
+269 -124

No files matched your search

+2 -1
View File
@@ -4,7 +4,7 @@
import * as Cesium from 'cesium';
import { bridgeEvent } from './events.js';
const scratchGregorian = new Cesium.GregorianDate();
let scratchGregorian;
// JulianDate.toDate(time).getTime() without the Date: frame events must not
// allocate. A raise without a time (not Cesium's own) reads the clock.
@@ -27,6 +27,7 @@ function unixMilliseconds(scene, time) {
* @returns {{ frames: object, destroy: () => void }}
*/
export function createCesiumFrames(viewer) {
scratchGregorian ??= new Cesium.GregorianDate();
const { scene } = viewer;
const bridges = ['preUpdate', 'preRender', 'postRender'].map((name) => [
name,