Load the Cesium SDK from index.html again, since engine-neutral modules read its global when they load

This reverts ae13a56f. In the production build every 'cesium' import is the global that Cesium.js defines; with the script loaded only when a Cesium globe started, modules evaluated at boot (cesiumConstants, annotationEngine) threw ReferenceError and neither engine started. A cold Navara start loading Cesium.js stays a known gap.
This commit is contained in:
German Khokhlov committed 2026-11-03 23:21:00 +04:00
1 parent 9cc108835e
commit 125fbc5a3b
27 files changed
+125 -275

No files matched your search

+12 -12
View File
@@ -144,10 +144,10 @@ const NEARBY_CITIES = Object.freeze([
placement: 'right-lower',
}),
]);
const BORDER_COLOR = () => Cesium.Color.fromCssColorString('#20e7f2');
const BORDER_COLOR = Cesium.Color.fromCssColorString('#20e7f2');
const BORDER_ACCENT = '#20e7f2';
const INCIDENT_ACCENT = '#ffad55';
const INCIDENT_COLOR = () => Cesium.Color.fromCssColorString(INCIDENT_ACCENT);
const INCIDENT_COLOR = Cesium.Color.fromCssColorString(INCIDENT_ACCENT);
const DEFAULT_OVERLAY_HOST = Object.freeze({
setEntries: setOverlayEntries,
@@ -521,7 +521,7 @@ export function createBhoteKoshiLocatorLayer({
sequenceStartedAt,
visibleAfterMs = 0,
) {
addCallout(dataSource, INCIDENT, INCIDENT_COLOR(), {
addCallout(dataSource, INCIDENT, INCIDENT_COLOR, {
sequenceStartedAt,
visibleAfterMs,
});
@@ -555,12 +555,12 @@ export function createBhoteKoshiLocatorLayer({
false,
),
color: new Cesium.CallbackProperty((_time, result) => {
const color = Cesium.Color.clone(INCIDENT_COLOR(), result);
const color = Cesium.Color.clone(INCIDENT_COLOR, result);
color.alpha = 0.16 * (1 - pulseProgress());
return color;
}, false),
outlineColor: new Cesium.CallbackProperty((_time, result) => {
const color = Cesium.Color.clone(INCIDENT_COLOR(), result);
const color = Cesium.Color.clone(INCIDENT_COLOR, result);
color.alpha = isVisible() ? 0.08 + 0.78 * (1 - pulseProgress()) : 0;
return color;
}, false),
@@ -705,7 +705,7 @@ export function createBhoteKoshiLocatorLayer({
labelPlacement = 'right',
{ showAnchor = true } = {},
) {
addCallout(dataSource, NEPAL, BORDER_COLOR(), {
addCallout(dataSource, NEPAL, BORDER_COLOR, {
labelPlacement,
sequenceStartedAt,
showAnchor,
@@ -820,12 +820,12 @@ export function createBhoteKoshiLocatorLayer({
false,
),
color: new Cesium.CallbackProperty((_time, result) => {
const color = Cesium.Color.clone(INCIDENT_COLOR(), result);
const color = Cesium.Color.clone(INCIDENT_COLOR, result);
color.alpha = 0.16 * (1 - pulseProgress());
return color;
}, false),
outlineColor: new Cesium.CallbackProperty((_time, result) => {
const color = Cesium.Color.clone(INCIDENT_COLOR(), result);
const color = Cesium.Color.clone(INCIDENT_COLOR, result);
color.alpha = 0.08 + 0.78 * (1 - pulseProgress());
return color;
}, false),
@@ -890,7 +890,7 @@ export function createBhoteKoshiLocatorLayer({
positions: animatedPositions,
width: 3.5,
clampToGround: true,
material: BORDER_COLOR().withAlpha(0.96),
material: BORDER_COLOR.withAlpha(0.96),
classificationType: Cesium.ClassificationType.BOTH,
},
});
@@ -915,7 +915,7 @@ export function createBhoteKoshiLocatorLayer({
show: new Cesium.CallbackProperty(() => now() >= drawStartedAt, false),
polygon: {
hierarchy,
material: BORDER_COLOR().withAlpha(0.055),
material: BORDER_COLOR.withAlpha(0.055),
classificationType: Cesium.ClassificationType.BOTH,
},
});
@@ -925,7 +925,7 @@ export function createBhoteKoshiLocatorLayer({
positions: animatedPositions,
width: 5,
clampToGround: true,
material: BORDER_COLOR().withAlpha(0.12),
material: BORDER_COLOR.withAlpha(0.12),
classificationType: Cesium.ClassificationType.BOTH,
},
});
@@ -935,7 +935,7 @@ export function createBhoteKoshiLocatorLayer({
positions: animatedPositions,
width: 2.5,
clampToGround: true,
material: BORDER_COLOR().withAlpha(0.96),
material: BORDER_COLOR.withAlpha(0.96),
classificationType: Cesium.ClassificationType.BOTH,
},
});