mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Keep globe renderers warm across live engine switches
This commit is contained in:
1 parent
f71c76c306
commit
5e658d8c9d
15 files changed
+343
-34
No files matched your search
+9
-2
@@ -333,7 +333,10 @@ export class ShareLinkManager {
|
||||
/**
|
||||
* Apply a parsed state to the camera + style manager.
|
||||
*/
|
||||
async applyState(state, { applyCamera = true, navigationToken = null } = {}) {
|
||||
async applyState(
|
||||
state,
|
||||
{ applyCamera = true, instant = false, navigationToken = null } = {},
|
||||
) {
|
||||
if (this._destroyed || !state)
|
||||
return { succeeded: false, reason: 'unavailable' };
|
||||
const view = {
|
||||
@@ -347,7 +350,11 @@ export class ShareLinkManager {
|
||||
let cameraPromise = Promise.resolve({
|
||||
status: applyCamera ? 'superseded' : 'skipped',
|
||||
});
|
||||
if (applyCamera && this._isNavigationCurrent(navigationToken)) {
|
||||
if (applyCamera && instant && this._isNavigationCurrent(navigationToken)) {
|
||||
this.engine.camera.setView(view);
|
||||
this.engine.render.request('engine-switch');
|
||||
cameraPromise = Promise.resolve({ status: 'applied' });
|
||||
} else if (applyCamera && this._isNavigationCurrent(navigationToken)) {
|
||||
const restoreGeneration = ++this._restoreGeneration;
|
||||
let settleCamera;
|
||||
cameraPromise = new Promise((resolve) => {
|
||||
|
||||
Reference in new issue
Block a user