mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
maps: the globe engine's release tells an imagery spec with a destroy of its own, as Cesium's engine destroys a provider, so a source that keeps tokens for its layer stops renewing them
This commit is contained in:
1 parent
90695db611
commit
83255f2bdb
2 files changed
+28
No files matched your search
@@ -221,10 +221,18 @@ export const globeMapEngine = Object.freeze({
|
||||
return layer.on('tileError', () => listener({}));
|
||||
},
|
||||
isDestroyed: (value) => Boolean(value) && released.has(value),
|
||||
/**
|
||||
* Never use `value` again: a photoreal handle is hidden, and an imagery
|
||||
* spec a source made with a `destroy` of its own (a source that keeps
|
||||
* tokens for its layer, say) is told, as Cesium's engine destroys a
|
||||
* provider.
|
||||
*/
|
||||
release(value) {
|
||||
if (!value || typeof value !== 'object' || released.has(value)) return;
|
||||
if (value.globe && value.spec) applyPhotoreal(value, false);
|
||||
released.add(value);
|
||||
if (typeof value.destroy === 'function' && !value.isDestroyed?.())
|
||||
value.destroy();
|
||||
},
|
||||
loadPhotoreal,
|
||||
});
|
||||
Reference in new issue
Block a user