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
@@ -174,12 +174,17 @@ export class ShareRestoration {
|
||||
this._initialShareRestoreTimeout = null;
|
||||
if (this._disposed) return;
|
||||
const generation = this._initialShareNavigationGeneration;
|
||||
const retained = engineSwitch && this._layerStateCoordinator?.retainedTrackingTarget();
|
||||
const applyCamera =
|
||||
Number.isInteger(generation) &&
|
||||
this.navigation._reassertNavigationHandoff(generation);
|
||||
this.navigation._reassertNavigationHandoff(generation, {
|
||||
trackingOrigin: engineSwitch ? 'share-restore' : 'tool',
|
||||
keepTracking: Boolean(retained),
|
||||
});
|
||||
void this._runShareRestore(savedState, {
|
||||
applyCamera,
|
||||
instant: engineSwitch,
|
||||
retained,
|
||||
navigationToken: generation,
|
||||
layersPromise: this._layerStateRestorePromise,
|
||||
settle: (result) => this._settleInitialShareRestore(result),
|
||||
@@ -238,7 +243,7 @@ export class ShareRestoration {
|
||||
*/
|
||||
async _runShareRestore(
|
||||
state,
|
||||
{ applyCamera, instant = false, navigationToken, layersPromise, settle },
|
||||
{ applyCamera, instant = false, retained, navigationToken, layersPromise, settle },
|
||||
) {
|
||||
const generation = this._shareRestoreGeneration;
|
||||
const current = () =>
|
||||
@@ -253,7 +258,8 @@ export class ShareRestoration {
|
||||
if (!current()) return;
|
||||
const tracking =
|
||||
share.camera === 'applied'
|
||||
? await this._layerStateCoordinator?.restoreShareTrackingSelection?.()
|
||||
? (retained && this._layerStateCoordinator.resumeRetainedTracking(retained)) ||
|
||||
await this._layerStateCoordinator?.restoreShareTrackingSelection?.()
|
||||
: {
|
||||
status: 'superseded',
|
||||
cleared:
|
||||
|
||||
Reference in new issue
Block a user