mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Stub setBase: imagery is added before photoreal is awaited
An unawaited setBase with photoreal and imagery, followed by another, added its imagery after the later call had set its own, leaving both. The imagery now goes in before anything is awaited, as the Cesium port adds it, and an overtaken call resolves settled: false.
This commit is contained in:
1 parent
ca82e23d94
commit
db80c9f141
2 files changed
+23
-2
No files matched your search
@@ -1590,10 +1590,17 @@ export function createStubRenderer(options = {}) {
|
||||
if (!current()) return superseded();
|
||||
}
|
||||
for (const layer of imageryLayers.slice()) layer.remove();
|
||||
// The imagery is added before anything is awaited, so a later call,
|
||||
// which removes it, always finds it.
|
||||
const layers = (base.imagery ?? []).map((spec) => addImagery(spec));
|
||||
if (base.photoreal !== undefined)
|
||||
await globe.setPhotoreal(base.photoreal);
|
||||
const layers = (base.imagery ?? []).map((spec) => addImagery(spec));
|
||||
return { photoreal: photorealStatus, imagery: layers, settled: true };
|
||||
// A base a later call replaced has not settled.
|
||||
return {
|
||||
photoreal: photorealStatus,
|
||||
imagery: layers,
|
||||
settled: current(),
|
||||
};
|
||||
},
|
||||
async setPhotoreal(spec) {
|
||||
log('globe', 'setPhotoreal', [spec]);
|
||||
|
||||
Reference in new issue
Block a user