A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.
JavaScript 3d-globecesiumflight-trackinggeospatialgeospatial-intelligencegisosintphotogrammetrysatellite-trackingspatial-intelligencewebglworldview
Merge current main into Nepal flood contribution
Sameh Khamis1a936ebac1a1
diff --cc CHANGELOG.mdindex 837323df9,9f86a298c..b0f90f590--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -1,14 -1,7 +1,16 @@@# Changelog+- Cancel the Nepal Upper Valley locator's pending approach and orbit on scene Stop, replacement, seek, and teardown; late camera callbacks cannot take over a newer shot.++- Keep completed flood history visible when later Nepal media-only shots arrive and reveal their source cards.+- Reconcile an already-playing Nepal video when the YouTube API attaches, so missed playback notifications cannot truncate the seven-second clip or replay an already-ended clip.++- Clamp the Nepal flood trail and surge marker to the active terrain or photoreal surface so refined 3D tiles cannot bury the path.++- Preserve Nepal shot camera and map ownership through the public layer lifecycle; passive restoration does not start standalone playback.++ - Separate transit snapshot/history acquisition from the layer and expose its bounded request service independently of Vite. Preserve feed selection, playback, cache policy and compatibility exports.+- Widen opaque sensor halos to 3 display pixels with a 30 px fleet core while retaining at least 60% opaque core coverage, adding contrast margin through thermal blur and bloom on bright roofs.- Exclude Noir's intentionally vignetted outer field from transit core measurements and add separate Boston live oblique selection/readability coverage.diff --cc docs/CURRENT-STATE.mdindex e1b14db28,9fc311be7..8fce6d8b1--- a/docs/CURRENT-STATE.md+++ b/docs/CURRENT-STATE.md@@@ -1,29 -1,7 +1,31 @@@# God's Eye View Current State+Nepal flood lines classify the active terrain or photoreal surface, and the surge marker follows that surface. Geographic route coordinates are unchanged; dynamic lines do not rely on unsupported depth-failure materials. Later media-only shots keep their completed source-path history throughout arrival and card reveal.++Scene Stop, replacement, seek, and teardown revoke the Upper Valley locator's delayed camera approach and orbit while preserving its visible callout. A revoked timer or camera callback cannot start another flight or interfere with a newer shot.++Nepal scene ownership follows the parameters prepared by the public layer manager before activation, without depending on enable-time origin metadata. Enabling a scene beat preserves its selected map and camera; passive restoration does not schedule standalone playback.++Animated scene cards sample their optional scale, opacity and leader callbacks once per projected frame. A failed callback suppresses that frame and can recover on the next one; ordinary layers keep the shared projection path without animation evaluation.++Nepal Flood Incident is accessed through Scenes. Its flood and locator components remain registered for scene playback but are hidden from the Data Layers menu. Closing the event stops the active scene, including pending loads and media. The default catalog does not install a separate reconstruction scene; existing saved scenes remain untouched.++Double-click a shot name to edit it inline. Enter or moving focus saves a nonempty name, Escape cancels, and saved names persist with the scene project.++The Nepal overview route and lake-shot trail share the river-centerline starting point nearest Debris-Dammed Lake. No earlier upstream section is included; evidence pins remain separate from the schematic river geometry.++The event panel omits the WITNESS shortcut. Shot media, source attribution, Open Original links and corridor navigation remain available.++The Mailung Bazzar, Dandaguan YouTube embed follows the provider's playback clock through 0:07, then the scene advances after its 0.65-second media exit. The controller reconciles provider state and source time when the API attaches and while waiting for playback, including missed PLAYING notifications and an already-ended clip. Startup is bounded to five seconds, and stalled playback has a bounded timeout; unavailable or blocked media cannot strand the scene. The authored estimate remains seven seconds plus the exit, replacing older saved holds at runtime without rewriting them. Stop, replacement and teardown revoke pending playback callbacks.++Persistent media-led Nepal shots preserve their completed upstream flood path during camera travel. The next reach still reveals after arrival; direct loads reconstruct the prefix and backward replay trims downstream history.++Repeated map-stack requests retain the live imagery layer when its provider is unchanged. Scene handoffs keep loaded tiles while real source changes, switch cancellation, and tile-error fallbacks retain their existing behavior.++Nepal Flood Incident is available in Scenes, with a 25-shot sequence, geographic labels, an event panel, scene scrubbing and shot playback. Comparison shots use Esri beneath Vantor imagery. Other Nepal shots use Google 3D when its tileset is available and fall back to Esri otherwise; without an ion token, the existing map stack uses Re:Earth terrain. Saved shots retain their authored camera and map preferences across keyed and keyless runtimes. The bundled pack contains historical 2021 and post-event 2026 imagery, not an isolated before/after measurement; the animated flood path is schematic, not a hazard model. Witness media opens or embeds original sources without bundled clips. See `public/events/bhote-koshi-2026/README.md` for provenance and non-commercial data terms.++ Transit snapshot and selected-history reads use an explicit source interface. The standalone source selects the existing routes; rendering, playback and selection retain their existing owners. A portable request service owns registered-feed admission, bounded decoding, cache/revalidation, backoff and history; development and preview use the same thin adapter. Compatibility exports and source attribution are preserved.+Place search accepts an explicit Nominatim provider with independently configured search and reverse endpoints. The default offline/Google/Photon/local-fallback order is unchanged when no provider is selected. Provider adapters share normalized coordinates, viewport framing and reverse labels; roads and boundary geometry remain separate services. Portable capped-response and Overpass lexical helpers are exported independently of the Node server.Reference feed construction is exported through `sources/reference`; the cable source also has a dedicated `layers/submarine-cables/source` entry. Standalone catalog compatibility remains available. Source choices, data and attribution are unchanged.diff --cc src/data/layerState.jsindex 5cfadc91a,4960a5442..d2415864d--- a/src/data/layerState.js+++ b/src/data/layerState.js@@@ -275,25 -302,76 +302,70 @@@ export const SHARE_TRACKING_RESTORE_POL* owns stable URL ordering.*/export const LAYER_STATE_REGISTRY = Object.freeze([- Object.freeze({- id: 'ais-live-vessels',- token: 'a',- disposition: 'enabled-only',- }),- Object.freeze({- id: 'alpr-cameras',- token: 'p',- disposition: 'enabled-only',- }),+ Object.freeze({ id: 'ais-live-vessels', token: 'a', disposition: 'enabled-only' }),+ Object.freeze({ id: 'alpr-cameras', token: 'p', disposition: 'enabled-only' }),+ Object.freeze({ id: 'bhote-koshi-2026', token: 'h', disposition: 'enabled-only' }),+ Object.freeze({ id: 'bhote-koshi-locator', token: 'z', disposition: 'enabled-only' }),Object.freeze({ id: 'bikeshare', token: 'b', disposition: 'enabled-only' }),- Object.freeze({ id: 'cctv', token: 'c', disposition: 'enabled+options', optionOwner: 'cctv' }),+ Object.freeze({+ id: 'cctv',+ token: 'c',+ disposition: 'enabled+options',+ optionOwner: 'cctv',+ }),Object.freeze({ id: 'directions', token: 'n', disposition: 'enabled-only' }),Object.freeze({ id: 'earthquakes', token: 'e', disposition: 'enabled-only' }),- Object.freeze({ id: 'flights', token: 'f', disposition: 'enabled+options', optionOwner: 'flights' }),+ Object.freeze({+ id: 'flights',+ token: 'f',+ disposition: 'enabled+options',+ optionOwner: 'flights',+ }),Object.freeze({ id: 'local-dams', token: 'q', disposition: 'enabled-only' }),- Object.freeze({ id: 'local-datacenters', token: 'd', disposition: 'enabled-only' }),+ Object.freeze({+ id: 'local-datacenters',+ token: 'd',+ disposition: 'enabled-only',+ }),Object.freeze({ id: 'local-firms', token: 'w', disposition: 'enabled-only' }),- Object.freeze({ id: 'military', token: 'm', disposition: 'enabled+mirrored-options', optionOwner: 'flights' }),- Object.freeze({ id: 'military-awareness', token: 'g', disposition: 'enabled-only' }),- Object.freeze({ id: 'military-installations', token: 'i', disposition: 'enabled-only' }),- Object.freeze({ id: 'radio', token: 'r', disposition: 'enabled+options', optionOwner: 'radio' }),- Object.freeze({ id: 'rocket-launches', token: 'x', disposition: 'enabled-only' }),- Object.freeze({ id: 'satellites', token: 's', disposition: 'enabled+options', optionOwner: 'satellites' }),- Object.freeze({ id: 'telegeography-submarine-cables', token: 'u', disposition: 'enabled-only' }),+ Object.freeze({+ id: 'military',+ token: 'm',+ disposition: 'enabled+mirrored-options',+ optionOwner: 'flights',+ }),+ Object.freeze({+ id: 'military-awareness',+ token: 'g',+ disposition: 'enabled-only',+ }),+ Object.freeze({+ id: 'military-installations',+ token: 'i',+ disposition: 'enabled-only',+ }),+ Object.freeze({+ id: 'radio',+ token: 'r',+ disposition: 'enabled+options',+ optionOwner: 'radio',+ }),+ Object.freeze({+ id: 'rocket-launches',+ token: 'x',+ disposition: 'enabled-only',+ }),+ Object.freeze({+ id: 'satellites',+ token: 's',+ disposition: 'enabled+options',+ optionOwner: 'satellites',+ }),+ Object.freeze({+ id: 'telegeography-submarine-cables',+ token: 'u',+ disposition: 'enabled-only',+ }),Object.freeze({ id: 'traffic', token: 't', disposition: 'enabled-only' }),Object.freeze({ id: 'transit', token: 'j', disposition: 'enabled-only' }),]);diff --cc src/overlays/worldOverlay.jsindex 8d5b6aed2,38d08af06..46c8c9035--- a/src/overlays/worldOverlay.js+++ b/src/overlays/worldOverlay.js@@@ -458,25 -497,17 +498,30 @@@ export function normalizeOverlayEntry(saltitudeFadeEnd: Number.isFinite(Number(entry.altitudeFadeEnd))? Number(entry.altitudeFadeEnd): Number.POSITIVE_INFINITY,- edgeFade: entry.edgeFade === false || entry.edgeFade === 'none' ? 'none' : 'keyhole',+ edgeFade:+ entry.edgeFade === false || entry.edgeFade === 'none'+ ? 'none'+ : 'keyhole',horizonCull: entry.horizonCull !== false,terrainOcclusion: entry.terrainOcclusion === true,- sourceAlpha: clamp01(entry.sourceAlpha ?? entry.alpha, 1),+ sourceAlpha: typeof (entry.sourceAlpha ?? entry.alpha) === 'function'+ ? (entry.sourceAlpha ?? entry.alpha)+ : clamp01(entry.sourceAlpha ?? entry.alpha, 1),+ presentationScale: typeof entry.presentationScale === 'function'+ ? entry.presentationScale+ : Math.max(0, Number(entry.presentationScale) || 1),+ leaderProgress: typeof entry.leaderProgress === 'function'+ ? entry.leaderProgress+ : clamp01(entry.leaderProgress, 1),+ contentAlpha: typeof entry.contentAlpha === 'function'+ ? entry.contentAlpha+ : clamp01(entry.contentAlpha, 1),+ anchorDot: entry.anchorDot === true,+ leaderStyle: entry.leaderStyle === 'elbow' ? 'elbow' : 'straight',temporalAlpha: clamp01(entry.temporalAlpha, 1),- gapPx: Number.isFinite(Number(entry.gapPx)) ? Math.max(0, Number(entry.gapPx)) : 12,+ gapPx: Number.isFinite(Number(entry.gapPx))+ ? Math.max(0, Number(entry.gapPx))+ : 12,leaderOffsetPx: Number.isFinite(Number(entry.leaderOffsetPx))? Math.max(0, Number(entry.leaderOffsetPx)): 0,@@@ -2118,18 -2390,15 +2429,22 @@@ function paintEntryItem(item, keyhole)// All five channels are normalized at their source. Keep the multiply on// the hot paint path so its intermediate doubles remain unboxed; the pure// `combinedOverlayAlpha` export still specifies/tests the same binding.- const finalAlpha = record.sourceAlpha * item.temporalAlpha- * record.distanceAlpha * record.altitudeAlpha * keyholeAlpha;+ const finalAlpha =+ record.sourceAlpha *+ item.temporalAlpha *+ record.distanceAlpha *+ record.altitudeAlpha *+ keyholeAlpha;if (finalAlpha <= 0.001) return;if (record.paintScale === 1) {- paintOverlayEntry(_ctx, entry, placement, finalAlpha);+ paintOverlayEntry(+ _ctx,+ entry,+ placement,+ finalAlpha,+ record.leaderProgress,+ record.contentAlpha,+ );} else {const scaled = localizeScaledPlacement(placement,diff --cc src/overlays/worldOverlayDraw.jsindex 98467babb,e315f5807..7288fe968--- a/src/overlays/worldOverlayDraw.js+++ b/src/overlays/worldOverlayDraw.js@@@ -519,15 -564,19 +615,19 @@@ function drawAnchorDot(ctx, entry, placctx.stroke();}-function drawCardChrome(ctx, entry, placement, selected = false) {+function drawCardChrome(ctx, entry, placement, selected = false, drawLeaderLine = true) {const { x, y, w, h } = placement.rect;const accent = entry.accent || WORLD_OVERLAY_STYLE.accent;- drawLeader(ctx, placement, accent);+ if (drawLeaderLine) drawLeader(ctx, placement, accent, 1, 1, entry.leaderStyle);ctx.beginPath();roundedRectPath(ctx, x, y, w, h);- ctx.fillStyle = selected ? WORLD_OVERLAY_STYLE.selectedBackground : WORLD_OVERLAY_STYLE.background;+ ctx.fillStyle = selected+ ? WORLD_OVERLAY_STYLE.selectedBackground+ : WORLD_OVERLAY_STYLE.background;ctx.fill();- ctx.strokeStyle = selected ? WORLD_OVERLAY_STYLE.selectedBorder : WORLD_OVERLAY_STYLE.border;+ ctx.strokeStyle = selected+ ? WORLD_OVERLAY_STYLE.selectedBorder+ : WORLD_OVERLAY_STYLE.border;ctx.lineWidth = selected ? 1.25 : 1;ctx.stroke();ctx.fillStyle = accent;diff --cc src/scenes/director.jsindex 5fc3116dc,278e8a442..6f62d7158--- a/src/scenes/director.js+++ b/src/scenes/director.js@@@ -254,18 -253,27 +281,29 @@@ function normalizeShot},detection: {mode: typeof detection.mode === 'string' ? detection.mode : 'OFF',- density: Math.max(0, Math.min(100, Number.isFinite(Number(detection.density)) ? Number(detection.density) : 35)),+ density: Math.max(+ 0,+ Math.min(+ 100,+ Number.isFinite(Number(detection.density))+ ? Number(detection.density)+ : 35,+ ),+ ),},- styleParams:- visual.styleParams && typeof visual.styleParams === 'object'- ? deepClone(visual.styleParams)- : {},+ ...(SCENE_MAP_STACK_IDS.has(visual.mapStack) ? { mapStack: visual.mapStack } : {}),+ styleParams: visual.styleParams && typeof visual.styleParams === 'object' ? deepClone(visual.styleParams) : {},},layers: Object.fromEntries(- Object.entries(rawShot?.layers || {}).map(([layerId, value]) => [layerId, normalizeLayerEntry(value)])+ Object.entries(rawShot?.layers || {}).map(([layerId, value]) => [+ layerId,+ normalizeLayerEntry(value),+ ]),),+ ...(typeof rawShot?.sourcePackId === 'string' ? { sourcePackId: rawShot.sourcePackId } : {}),+ ...(Number.isFinite(Number(rawShot?.sourcePackVersion))+ ? { sourcePackVersion: Number(rawShot.sourcePackVersion) }+ : {}),};}@@@ -388,32 -361,22 +429,31 @@@ export class SceneDirectorthis._project = this._loadProject();this._selectedSceneId = this._project.scenes[0]?.id || null;this._selectedShotId = this._project.scenes[0]?.shots[0]?.id || null;-- this._presentation = {- status: 'Ready',- progress: 0,- runtime: '',- playbackActive: false,- keyboardEnabled: false,- };- this._state = createStateChannel(() => ({- ...this.getPlaybackStatus(),- ...this._presentation,- hasRun: !!this._lastRunJson,- }));+ /** @type {string|null} Scene whose layer state most recently landed. */+ this._loadedSceneId = null;++ this._presentation = { status: 'Ready', progress: 0, runtime: '', playbackActive: false, keyboardEnabled: false };+ this._state = createStateChannel(() => ({ ...this.getPlaybackStatus(), ...this._presentation, hasRun: !!this._lastRunJson }));+ this._bootstrapLegacyShotPacks();+ // Upgrade only already-installed packs; unrelated Scenes are untouched.+ for (const scene of this._project.scenes) {+ for (const marker of [...(scene.appliedShotPacks || [])]) {+ const recipe = getSceneAppendRecipeById(marker.id);+ if (recipe?.expansionFromVersion && marker.version > 0+ && marker.version <= recipe.expansionFromVersion) {+ this.appendShotPack(scene.id, marker.id, { render: false, announce: false });+ }+ }+ }this._initUI();+ this._visibilityUnsubscribe = this.dataManager.subscribeVisibilityRequests?.((change) => {+ if (change.enabled !== false || !['user', 'voice', 'tool'].includes(change.origin)) return;+ const scene = this._getSelectedScene();+ if (!scene?.releaseLayerIds?.includes(change.layerId)) return;+ this.stopScene('Scene layer turned off');+ });}-_trackWork(promise) {this._pendingWork ||= new Set();this._pendingWork.add(promise);@@@ -1914,12 -1034,10 +2003,14 @@@}} catch (error) {this._updateStatus(`Error: ${error.message || 'run failed'}`);- this._logEvent('scene_run_error', { message: error.message || 'unknown error' });+ this._logEvent('scene_run_error', {+ message: error.message || 'unknown error',+ });} finally {+ if (preview) {+ await this._releaseSceneLayers(activeScene);+ if (activeScene?.id === this._loadedSceneId) this._loadedSceneId = null;+ }this._finishRun();}}@@@ -2097,13 -1202,15 +2192,15 @@@if (token?.cancelled) return abort();if (settled === false) {refused.push(id);- console.warn(`[Scenes] Layer refused: ${id} → ${enabled ? 'on' : 'off'}`);+ console.warn(+ `[Scenes] Layer refused: ${id} → ${enabled ? 'on' : 'off'}`,+ );continue;}- applied.push(id);- if (params) {- this.dataManager.setLayerParams(id, params);+ if (params && typeof this.dataManager.restoreLayerState !== 'function') {+ this.dataManager.setLayerParams(id, params, { origin: 'scene' });}+ applied.push(id);}if (refused.length) {