mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Traffic roads come from OpenFreeMap vector tiles, or TomTom flow tiles with a key (Hybrid by default). Military areas use OpenFreeMap polygons with a bundled worldwide name index; wide views show named points. ALPR reads an hourly OpenStreetMap extract. Cockpit place context and country, state and US county outlines use bundled Natural Earth and US Census data. Overpass is used only when an operator configures their own endpoint. Also: camera arrivals no longer land below ground, keyless terrain retries on 429, bounded relation geometry for configured Overpass, one shared OpenStreetMap credit, and separate tile and API transports for embedders. Co-authored-by: theGaryLarson <[email protected]> Co-authored-by: Milan Khanal <[email protected]>
46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
import * as Cesium from 'cesium';
|
|
|
|
export function createState({ services }) {
|
|
const state = {};
|
|
|
|
state.distanceEndpointScratch = new Cesium.Cartographic();
|
|
|
|
state.distanceGeodesicScratch = new Cesium.EllipsoidGeodesic();
|
|
|
|
Object.assign(state, {
|
|
viewer: null,
|
|
dataSource: null,
|
|
enabled: false,
|
|
records: [],
|
|
recordById: new Map(),
|
|
selectedId: null,
|
|
lastUpdate: null,
|
|
error: null,
|
|
status: 'idle',
|
|
stale: false,
|
|
/** Whether the upstream truncated at its element cap for the current view. */
|
|
saturated: false,
|
|
loading: false,
|
|
abort: null,
|
|
/** Pending timed retry while status is 'unavailable' (see scheduleUnavailableRetry). */
|
|
retryTimer: null,
|
|
/** Current backoff step for that retry; 0 = next failure starts at the minimum. */
|
|
retryDelayMs: 0,
|
|
retryAt: 0,
|
|
failureReason: null,
|
|
moveEndRemove: null,
|
|
clickHandler: null,
|
|
timer: null,
|
|
googleSearchRequested: false,
|
|
/** Contacts subject position; when set, it replaces the camera viewport. */
|
|
contextAnchor: null,
|
|
/** Latest subject centre, independent of the retained tile-fetch anchor. */
|
|
contextPosition: null,
|
|
/** Coverage of the last successful load: viewport, or radius around a subject. */
|
|
coverage: { kind: 'viewport' },
|
|
/** Per-record geometry keys of the rendered entities, for in-place updates. */
|
|
renderedKeys: new Map(),
|
|
});
|
|
return state;
|
|
}
|