mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
fix(maps): retry the real imagery and terrain provider after a fallback
In the keyless setup a single transient failure while loading the default map layers locked in the degraded fallback until reload. _getImageryProvider cached the construction-fallback resolution (OSM) under the Esri stack id, so every later "Esri Satellite" selection showed OSM. createKeylessTerrain turns any Re:Earth failure into a flat EllipsoidTerrainProvider; the controller cached it and set _terrainMode to 'keyless', so a boot-time network blip left the globe flat. Fallbacks are still cached and shown at once, and no switch waits on a retry. One controller timer now retries the real provider behind whichever fallback is on screen (Esri's OSM stand-in, or flat terrain on a shown globe), starting at 30 seconds and doubling to a 10-minute cap while it keeps failing. A failed retry leaves the cached fallback and the installed terrain untouched. A success replaces the cache entry and applies it live: terrain is installed in place with a render request (or, behind a 3D tileset, picked up by the next globe activation), and Esri is reselected automatically, after any in-flight switch settles. A switch that read the flat fallback re-reads the terrain cache before installing, and destroy() cancels the timer and releases a provider built after it.
This commit is contained in:
1 parent
d4492d8f8c
commit
d6c1ea0f4b
6 files changed
+393
-13
No files matched your search
@@ -317,3 +317,13 @@ test('both Google 3D routes keep tiles drawing while draped imagery loads', asyn
|
||||
assert.equal(calls[1][1].asynchronouslyLoadImagery, true);
|
||||
assert.equal(calls[1][1].enableCollision, true);
|
||||
});
|
||||
|
||||
test('unreachable keyless terrain falls back to flat terrain marked as a fallback', async (t) => {
|
||||
t.mock.method(Cesium.CesiumTerrainProvider, 'fromUrl', async () => {
|
||||
throw new Error('layer.json unreachable');
|
||||
});
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
const result = await createKeylessTerrain();
|
||||
assert.ok(result.provider instanceof Cesium.EllipsoidTerrainProvider);
|
||||
assert.equal(result.fallback, true);
|
||||
});
|
||||
Reference in new issue
Block a user