mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Merge origin/main into the renderer-contract branch: the procedural fleet models drawn through the renderer's model sets
Aircraft, military, local ADS-B, vessel, transit and rail models come from the fleet model set, loaded up front and drawn life size through the draw port's models sets; no layer touches the viewer or Cesium outside src/render/cesium/. The models capability gains glTF bytes (gltf), a per-axis stretch (axisScale), a colour for tinted parts (maskColor) and a cut below the origin (clip: 'belowOrigin'), with conformance checks. Main's rail layer and Data Library are ported to the ports; the CCTV footprint probe keeps the globe-terrain clamp through the query port.
This commit is contained in:
commit
e3865f462f
533 files changed
+55738
-2518
No files matched your search
@@ -18,6 +18,7 @@ import {
|
||||
SHARE_VIEW_STYLE_PARAMS,
|
||||
decodeShareView,
|
||||
encodeShareView,
|
||||
normalizeLibraryTokens,
|
||||
} from './share/viewCodec.js';
|
||||
import {
|
||||
fromLegacyShareState,
|
||||
@@ -112,6 +113,11 @@ export class ShareLinkManager {
|
||||
this._scopeTerminusPct = null;
|
||||
this._mapStack = 'photoreal';
|
||||
this._layerStateProvider = null;
|
||||
this._libraryParamsEncoder = null;
|
||||
this._libraryShareListener = null;
|
||||
// The opening share's Data Library tokens: null when the page opened
|
||||
// without a share, [] for a share that switches no library entry on.
|
||||
this._initialLibraryTokens = null;
|
||||
this._panelStateProvider = null;
|
||||
this._styleParamStateProvider = null;
|
||||
this._initialRestorePending = false;
|
||||
@@ -165,10 +171,32 @@ export class ShareLinkManager {
|
||||
const state =
|
||||
code === null ? this._parseShareHash(hash) : this._parseShareCode(code);
|
||||
if (!state) return null;
|
||||
// A share decides which library entries are on, as it does for core
|
||||
// layers: one without `lib` switches none on.
|
||||
this._initialLibraryTokens = state.library ?? [];
|
||||
this._beginIncomingRestore(state);
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Data Library tokens of the share this page opened with, or null when
|
||||
* it opened without one. Read by the library once it knows its entries.
|
||||
* @returns {string[]|null}
|
||||
*/
|
||||
get initialLibraryTokens() {
|
||||
return this._initialLibraryTokens ? [...this._initialLibraryTokens] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the Data Library's listener for shares opened in this tab after
|
||||
* start-up. It receives the share's tokens ([] when it switches none on).
|
||||
* @param {((tokens: string[]) => void) | null} listener
|
||||
*/
|
||||
setLibraryShareListener(listener) {
|
||||
this._libraryShareListener =
|
||||
typeof listener === 'function' ? listener : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The restore state for a share code, in the long form's parsed shape plus
|
||||
* `shareView` (what the view follows, with its offset and last-known fix)
|
||||
@@ -277,6 +305,7 @@ export class ShareLinkManager {
|
||||
params.has('l') &&
|
||||
decodedLayerState === null,
|
||||
panelState: decodePanelStateParams(params),
|
||||
library: normalizeLibraryTokens(params.get('lib')),
|
||||
sharedAtMs: decodeShareCreatedAtMs(params),
|
||||
};
|
||||
return state;
|
||||
@@ -328,6 +357,11 @@ export class ShareLinkManager {
|
||||
if (!state) return;
|
||||
this._beginIncomingRestore(state);
|
||||
onNavigate(state);
|
||||
try {
|
||||
this._libraryShareListener?.(state.library ?? []);
|
||||
} catch (error) {
|
||||
console.warn('[ShareLink] library restore failed:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -475,6 +509,20 @@ export class ShareLinkManager {
|
||||
this._layerStateProvider = typeof provider === 'function' ? provider : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the Data Library's `lib=` writer. Library selections travel in
|
||||
* their own field and never touch the core layer-token ledger.
|
||||
* @param {((params: URLSearchParams) => void) | null} encoder
|
||||
*/
|
||||
setLibraryParamsEncoder(encoder) {
|
||||
this._libraryParamsEncoder = typeof encoder === 'function' ? encoder : null;
|
||||
}
|
||||
|
||||
/** Called when the Data Library selection changes. */
|
||||
onLibraryStateChange() {
|
||||
this._scheduleUpdate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the source of the entity the camera follows, used for share links:
|
||||
* `({ nowMs }) => ({ kind, id, offset, lastKnown }) | null`, in the share
|
||||
@@ -691,6 +739,7 @@ export class ShareLinkManager {
|
||||
params.set('map', this._mapStack);
|
||||
const layerState = this._layerStateProvider?.();
|
||||
if (layerState) encodeLayerStateParams(params, layerState);
|
||||
this._libraryParamsEncoder?.(params);
|
||||
this._encodePanelStateParam(params, this._panelStateProvider?.());
|
||||
encodeStyleParamState(
|
||||
params,
|
||||
@@ -723,6 +772,8 @@ export class ShareLinkManager {
|
||||
for (const off of this._cameraOffs.splice(0)) off();
|
||||
this._unwatchNavigation?.();
|
||||
this._layerStateProvider = null;
|
||||
this._libraryParamsEncoder = null;
|
||||
this._libraryShareListener = null;
|
||||
this._panelStateProvider = null;
|
||||
this._styleParamStateProvider = null;
|
||||
this._followSubjectProvider = null;
|
||||
|
||||
Reference in new issue
Block a user