Files
gods-eye-view/src/layers/radio/state.js
T
German Khokhlov 1a1eef0e5c Merge origin/main into german/navara
Conflict resolutions:
- src/main.js: upstream's PHOTON_URL place-search setting is read once at
  module level and passed as geospatial: { endpoints: { photon } } by
  createApplication(), so every engine start of the switch flow gets it; the
  old single top-level createStandaloneApplication() call stays removed.
- src/layers/bikeshare/render/cesium/rendering.js: upstream's
  publishedCapacity fix applied with this branch's
  resolveCapacity(model, capacity, status) signature. The same fix is ported
  to src/layers/bikeshare/render/navara.js (record.publishedCapacity, status
  polls resolve from it), with a Navara regression test; upstream's
  proxyRoute test imports the moved render/cesium/rendering.js.
- src/layers/traffic/flow.js: upstream's nextTask() yield and current()
  check kept before the scene is taken from this branch's
  _trafficScene?.() ?? _viewer?.scene with its missing-scene return.
- scripts/package-boundaries.json, scripts/format-scope.json: union of both
  sides' file lists.
- src/voice/actionSchemas.test.mjs: both history comments kept, payload hash
  recomputed for the merged schemas (Sentinel-2 map stack enum plus the
  shorter layer alias hint).
- src/hudAltitudeDatum.test.mjs: this branch's engine-based IntelHUD
  construction with upstream's placeLabels summary context.
2026-11-03 15:36:06 +04:00

156 lines
3.3 KiB
JavaScript

import * as geo from '../../geo/index.js';
import {
EMPTY_ACCEPTED_CATALOG_SNAPSHOT,
DEFAULT_RADIO_FILTER,
DEFAULT_RADIO_VOLUME,
} from './policy.js';
export function createState({ services }) {
const layerState = {};
layerState._radioEarthScreenCenter = geo.cartesian2.create();
layerState._radioEarthToCenter = geo.cartesian3.create();
layerState._enabled = false;
layerState._managerLifecyclePresentation = null;
layerState._loading = false;
layerState._stale = false;
layerState._degraded = false;
layerState._rejectedStationCount = 0;
layerState._error = null;
layerState._updatedAt = null;
layerState._acceptedCatalogSnapshot = EMPTY_ACCEPTED_CATALOG_SNAPSHOT;
layerState._stations = [];
layerState._stationById = new Map();
layerState._categories = [];
layerState._categoriesLocale = null;
layerState._renderById = new Map();
layerState._filter = DEFAULT_RADIO_FILTER;
layerState._selectedId = null;
layerState._selectedPosition = null;
layerState._selectionGeneration = 0;
layerState._selectionTimer = null;
layerState._radioCameraNavigationGeneration = 0;
layerState._radioCameraFlightSequence = 0;
layerState._activeRadioCameraFlight = null;
layerState._audio = null;
layerState._audioStationId = null;
layerState._audioState = 'stopped';
layerState._audioError = null;
layerState._userVolume = DEFAULT_RADIO_VOLUME;
layerState._tuningActive = false;
layerState._tuningStatic = false;
layerState._tuningAwaitingStationId = null;
layerState._tuningPreviewId = null;
layerState._tuningStartStationId = null;
layerState._tuningResumesPlayback = false;
layerState._tuningResolutionSnapshot = EMPTY_ACCEPTED_CATALOG_SNAPSHOT;
layerState._tuningStationById = new Map();
layerState._tuningUnavailableStationId = null;
layerState._cancelledTuningPresentationStation = null;
layerState._tuningCameraNavigation = null;
layerState._tuningNoiseContext = null;
layerState._tuningNoiseSource = null;
layerState._tuningNoiseFilter = null;
layerState._tuningNoiseGain = null;
layerState._voiceDucked = false;
layerState._voiceRestoring = false;
layerState._voiceRestoreTimer = null;
layerState._volumeFadeFrame = null;
layerState._volumeTransitionGeneration = 0;
layerState._playGeneration = 0;
layerState._playAttemptSequence = 0;
layerState._activePlaybackAttempt = null;
layerState._playFallbackId = null;
layerState._playFallbackFocus = null;
layerState._playFallbackOrigin = 'programmatic';
layerState._playFallbackAttemptId = null;
layerState._clickHandler = null;
layerState._horizonTimer = null;
layerState._lastHorizonCameraPosition = null;
layerState._horizonScanCount = 0;
layerState._abortController = null;
layerState._requestGeneration = 0;
layerState._sessionGeneration = 0;
layerState._overlayPublishTimer = null;
layerState._clusterOverlayIdentitySequence = 0;
layerState._clusterOverlayIdentities = [];
layerState._overlayDiagnostics = {
entryCount: 0,
selectedCount: 0,
singletonTexts: [],
singletonIds: [],
clusterTexts: [],
clusterIds: [],
clusterMemberships: [],
};
layerState._listeners = new Set();
layerState._playbackControlListeners = new Set();
return layerState;
}