mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Retain live flights and earthquake observations across globe switches
This commit is contained in:
1 parent
a0e5f04c30
commit
c0062c4d3d
17 files changed
+428
-66
No files matched your search
@@ -470,6 +470,36 @@ export class LayerStateCoordinator {
|
||||
return null;
|
||||
}
|
||||
|
||||
// On an in-page engine switch, an attached session model can already own
|
||||
// this exact contact. Ordinary shared links must still verify the source.
|
||||
retainedTrackingTarget() {
|
||||
const selected = this._selectedShareTrackingTarget();
|
||||
if (!selected || !this.dataManager.isEnabled(selected.layerId)) return null;
|
||||
const model = this.dataManager.layers.get(selected.layerId)?.module;
|
||||
if (
|
||||
model?.attachRenderer &&
|
||||
model.getParams?.()[selected.optionKey] === selected.targetId &&
|
||||
model.hasContact?.(selected.targetId) === true
|
||||
) return selected;
|
||||
return null;
|
||||
}
|
||||
|
||||
resumeRetainedTracking(previous) {
|
||||
const selected = this.retainedTrackingTarget();
|
||||
if (
|
||||
!selected || selected.layerId !== previous.layerId ||
|
||||
selected.targetId !== previous.targetId
|
||||
) 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 };
|
||||
this._publishTrackingRestoreStatus(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
_passivelyClearTrackingSelection(selected) {
|
||||
const current =
|
||||
this._durableState.options?.[selected.optionOwner]?.[selected.optionKey];
|
||||
|
||||
Reference in new issue
Block a user