mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 16:52:20 +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
@@ -291,3 +291,23 @@ test('a stack kept after a failed switch and a failed recovery still falls back
|
||||
controller.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
test('a released imagery spec with a destroy of its own is told, once', () => {
|
||||
let destroyed = 0;
|
||||
const spec = {
|
||||
kind: 'xyz',
|
||||
url: 'https://example.com/{z}/{x}/{y}.png',
|
||||
destroy() {
|
||||
destroyed++;
|
||||
},
|
||||
isDestroyed: () => destroyed > 0,
|
||||
};
|
||||
engine.release(spec);
|
||||
engine.release(spec);
|
||||
assert.equal(destroyed, 1);
|
||||
assert.equal(engine.isDestroyed(spec), true);
|
||||
// The app's own specs are frozen and have none: released quietly.
|
||||
const own = engine.imagery.esri();
|
||||
engine.release(own);
|
||||
assert.equal(engine.isDestroyed(own), true);
|
||||
});
|
||||
Reference in new issue
Block a user