mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Format the files this branch wrote or broke with Prettier
This commit is contained in:
1 parent
227e3c2051
commit
8d7f055572
90 files changed
+1408
-640
No files matched your search
@@ -483,7 +483,7 @@ test('GERMAN: an existing untracked military billboard repaints each poll withou
|
||||
});
|
||||
flightState.records = records;
|
||||
flightState._renderer = { view: {}, surfaceExclusions: () => [] };
|
||||
const {applySnapshot: apply} = createMilitarySnapshotRenderer({
|
||||
const { applySnapshot: apply } = createMilitarySnapshotRenderer({
|
||||
flightState,
|
||||
records,
|
||||
groundFloor: { warmGroundFloor() {}, cachedGroundFloor: () => null },
|
||||
|
||||
@@ -550,12 +550,13 @@ function anchorOnScreen(viewer, engine, anchor, root) {
|
||||
);
|
||||
if (Cesium.Cartesian3.dot(delta, camera.directionWC) <= 0) return null;
|
||||
}
|
||||
const pixel = engine ? engine.projector.worldToWindow(anchor, {}) : Cesium.SceneTransforms.worldToWindowCoordinates(
|
||||
viewer.scene,
|
||||
anchor,
|
||||
);
|
||||
const pixel = engine
|
||||
? engine.projector.worldToWindow(anchor, {})
|
||||
: Cesium.SceneTransforms.worldToWindowCoordinates(viewer.scene, anchor);
|
||||
if (!pixel) return null;
|
||||
const canvasBounds = (engine?.host.canvas ?? viewer?.canvas)?.getBoundingClientRect?.();
|
||||
const canvasBounds = (
|
||||
engine?.host.canvas ?? viewer?.canvas
|
||||
)?.getBoundingClientRect?.();
|
||||
const rootBounds = root.getBoundingClientRect?.();
|
||||
if (!canvasBounds || !rootBounds) return null;
|
||||
const x = pixel.x + canvasBounds.left - rootBounds.left;
|
||||
@@ -638,7 +639,11 @@ function createRoot(documentRef, viewer) {
|
||||
const root = documentRef.createElement('div');
|
||||
root.id = 'bhote-koshi-embedded-media-root';
|
||||
root.setAttribute('aria-live', 'polite');
|
||||
(documentRef.getElementById?.('cesiumContainer') || viewer?.container || documentRef.body)?.append(root);
|
||||
(
|
||||
documentRef.getElementById?.('cesiumContainer') ||
|
||||
viewer?.container ||
|
||||
documentRef.body
|
||||
)?.append(root);
|
||||
return root;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ const SCENE_PATH_RENDER_HOLD = 'bhote-koshi-scene-path-travel';
|
||||
const SCENE_MEDIA_MIN_PLAYBACK_SECONDS = 6;
|
||||
const SCENE_MEDIA_EXIT_SECONDS = 0.65;
|
||||
const BHOTE_EVENT_ACCENT = WORLD_OVERLAY_STYLE.accent;
|
||||
const FLOOD_COLOR = () => Cesium.Color.fromCssColorString('#d8954e').withAlpha(0.68);
|
||||
const FLOOD_COLOR = () =>
|
||||
Cesium.Color.fromCssColorString('#d8954e').withAlpha(0.68);
|
||||
const SURGE_COLOR = () => Cesium.Color.fromCssColorString('#e8b47c');
|
||||
const CINEMATIC_INPUT_EVENTS = Object.freeze(['pointerdown', 'wheel']);
|
||||
const CINEMATIC_VIEW_SPECS = Object.freeze([
|
||||
|
||||
@@ -291,7 +291,10 @@ export function createBhoteKoshiLocatorLayer({
|
||||
let _pausedApproach = null;
|
||||
const cameraForScene = () => _engine?.camera ?? _viewer?.camera;
|
||||
const creditTarget = () => _engine ?? _viewer;
|
||||
const requestRender = reason => _engine?.kind === 'navara' ? _engine.render.request(reason) : requestSceneRender(reason);
|
||||
const requestRender = (reason) =>
|
||||
_engine?.kind === 'navara'
|
||||
? _engine.render.request(reason)
|
||||
: requestSceneRender(reason);
|
||||
let _dataSource = null;
|
||||
let _enabled = false;
|
||||
let _boundaryReady = false;
|
||||
@@ -651,10 +654,17 @@ export function createBhoteKoshiLocatorLayer({
|
||||
roll: Cesium.Math.toRadians(pose.roll),
|
||||
},
|
||||
duration,
|
||||
easingFunction: orbit ? Cesium.EasingFunction.SINUSOIDAL_IN_OUT : Cesium.EasingFunction.CUBIC_IN_OUT,
|
||||
easingFunction: orbit
|
||||
? Cesium.EasingFunction.SINUSOIDAL_IN_OUT
|
||||
: Cesium.EasingFunction.CUBIC_IN_OUT,
|
||||
complete: () => {
|
||||
if (_triggerApproachAttempt !== attempt) return;
|
||||
if (orbit || !_enabled || _presentation !== BHOTE_KOSHI_TRIGGER_RECORD_PRESENTATION) finish();
|
||||
if (
|
||||
orbit ||
|
||||
!_enabled ||
|
||||
_presentation !== BHOTE_KOSHI_TRIGGER_RECORD_PRESENTATION
|
||||
)
|
||||
finish();
|
||||
else flyTriggerStage(attempt, 'orbiting', TRIGGER_ORBIT_DURATION_SEC);
|
||||
},
|
||||
cancel: finish,
|
||||
@@ -1042,14 +1052,14 @@ export function createBhoteKoshiLocatorLayer({
|
||||
showOsmCredit(creditTarget(), BHOTE_KOSHI_LOCATOR_LAYER_ID);
|
||||
}
|
||||
|
||||
function attachRenderer(viewer, {engine = null} = {}) {
|
||||
function attachRenderer(viewer, { engine = null } = {}) {
|
||||
_viewer = viewer;
|
||||
_engine = engine;
|
||||
if (!_enabled) return true;
|
||||
connectDisplay();
|
||||
publishOverlayEntries({moving: _placeRevealMoving});
|
||||
publishOverlayEntries({ moving: _placeRevealMoving });
|
||||
if (_pausedApproach) {
|
||||
const {phase, remaining} = _pausedApproach;
|
||||
const { phase, remaining } = _pausedApproach;
|
||||
_pausedApproach = null;
|
||||
if (phase === 'armed') armTriggerApproach();
|
||||
else flyTriggerStage((_triggerApproachAttempt = {}), phase, remaining);
|
||||
@@ -1060,8 +1070,11 @@ export function createBhoteKoshiLocatorLayer({
|
||||
function detachRenderer() {
|
||||
const phase = _triggerApproachAttempt?.phase;
|
||||
if (phase && phase !== 'finished') {
|
||||
_pausedApproach = {phase, remaining: Math.max(0, (_triggerApproachAttempt.endsAt - now()) / 1000)};
|
||||
clearTriggerApproach({preserveCallout: true});
|
||||
_pausedApproach = {
|
||||
phase,
|
||||
remaining: Math.max(0, (_triggerApproachAttempt.endsAt - now()) / 1000),
|
||||
};
|
||||
clearTriggerApproach({ preserveCallout: true });
|
||||
}
|
||||
_native?.destroy();
|
||||
_native = null;
|
||||
|
||||
@@ -43,7 +43,11 @@ export function createApplicationDirectionsLayer({
|
||||
createNativeRenderer,
|
||||
groundFloor = ground,
|
||||
} = {}) {
|
||||
return createDirectionsLayer({ services: { ...directionsServices, ground: groundFloor }, source, createNativeRenderer });
|
||||
return createDirectionsLayer({
|
||||
services: { ...directionsServices, ground: groundFloor },
|
||||
source,
|
||||
createNativeRenderer,
|
||||
});
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
@@ -6,7 +6,10 @@ import { INFRASTRUCTURE_DATA_URLS } from '../sources/infrastructureData.js';
|
||||
* @param {object} services Caller-owned context, overlay and render operations.
|
||||
* @returns {object[]} Datacenters then dams, with stable standalone identities.
|
||||
*/
|
||||
export function createInfrastructureLayers(services, createLayer = createLocalGeoJsonLayer) {
|
||||
export function createInfrastructureLayers(
|
||||
services,
|
||||
createLayer = createLocalGeoJsonLayer,
|
||||
) {
|
||||
const datacentersUrl = INFRASTRUCTURE_DATA_URLS['local-datacenters'];
|
||||
const damsUrl = INFRASTRUCTURE_DATA_URLS['local-dams'];
|
||||
const datacenters = createLayer(
|
||||
|
||||
@@ -406,12 +406,21 @@ export class LayerStateCoordinator {
|
||||
);
|
||||
// A same-document engine choice retains operational layer intents.
|
||||
// The share still owns durable preferences and later history visits.
|
||||
if (live && this.dataManager.layers.get(entry.id) === live.entry &&
|
||||
!live.entry.lifecycleUncertain && live.entry.enabled === targetEnabled) {
|
||||
if (
|
||||
live &&
|
||||
this.dataManager.layers.get(entry.id) === live.entry &&
|
||||
!live.entry.lifecycleUncertain &&
|
||||
live.entry.enabled === targetEnabled
|
||||
) {
|
||||
return {
|
||||
layerId: entry.id, targetEnabled, origin, phase: 'retained',
|
||||
layerId: entry.id,
|
||||
targetEnabled,
|
||||
origin,
|
||||
phase: 'retained',
|
||||
...currentLayerOutcome(this.dataManager, entry.id),
|
||||
appliedOptions: {}, persistenceWrite: false, succeeded: true,
|
||||
appliedOptions: {},
|
||||
persistenceWrite: false,
|
||||
succeeded: true,
|
||||
};
|
||||
}
|
||||
const options = layerOptionsForRestore(this._durableState, entry.id);
|
||||
@@ -512,24 +521,33 @@ export class LayerStateCoordinator {
|
||||
const model = this.dataManager.layers.get(selected.layerId)?.module;
|
||||
if (
|
||||
model?.attachRenderer &&
|
||||
String(model.getParams?.()[selected.optionKey]) === String(selected.targetId) &&
|
||||
String(model.getParams?.()[selected.optionKey]) ===
|
||||
String(selected.targetId) &&
|
||||
model.hasContact?.(selected.targetId) === true
|
||||
) return selected;
|
||||
)
|
||||
return selected;
|
||||
return null;
|
||||
}
|
||||
|
||||
resumeRetainedTracking(previous) {
|
||||
const selected = this.retainedTrackingTarget();
|
||||
if (
|
||||
!selected || selected.layerId !== previous.layerId ||
|
||||
!selected ||
|
||||
selected.layerId !== previous.layerId ||
|
||||
selected.targetId !== previous.targetId
|
||||
) return null;
|
||||
)
|
||||
return null;
|
||||
const model = this.dataManager.layers.get(selected.layerId).module;
|
||||
const followed = model.trackById(selected.targetId, {
|
||||
origin: LAYER_RESTORE_ORIGINS.share,
|
||||
});
|
||||
if (!followed) return null;
|
||||
const result = { ...selected, status: 'found', classification: 'followed', cleared: false };
|
||||
const result = {
|
||||
...selected,
|
||||
status: 'found',
|
||||
classification: 'followed',
|
||||
cleared: false,
|
||||
};
|
||||
this._publishTrackingRestoreStatus(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -585,7 +585,8 @@ export function createLocalGeoJsonLayer(
|
||||
// windows (before vs after the add settles) need different cleanup.
|
||||
let addedToScene = false;
|
||||
try {
|
||||
let features = _cachedFeatures ?? (readFeatures ? await readFeatures() : null);
|
||||
let features =
|
||||
_cachedFeatures ?? (readFeatures ? await readFeatures() : null);
|
||||
if (_destroyed) return;
|
||||
if (!features) {
|
||||
const response = await fetch(url, {
|
||||
@@ -1065,7 +1066,9 @@ export function createLocalGeoJsonLayer(
|
||||
},
|
||||
|
||||
restoreFeatureSelection(viewer, featureId) {
|
||||
const entity = _dataSource?.entities.values.find((item) => String(item.id) === featureId);
|
||||
const entity = _dataSource?.entities.values.find(
|
||||
(item) => String(item.id) === featureId,
|
||||
);
|
||||
if (!entity) return false;
|
||||
viewer.selectedEntity = entity;
|
||||
selectEntityContext(entity);
|
||||
|
||||
Reference in new issue
Block a user