mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
A photoreal base that fails to come back keeps the stack before it
- The map source controller waits for a base that loads as it is shown (the globe engine's tilesetReady) before it takes the stack before it down: one that fails throws there, so that stack and its imagery stay and the error is reported, as from any failed switch. The Cesium map engine has no tilesetReady, so its switches are unchanged. - A failed default renderer load is tried again by the next call, and the standalone page's early load does not report a failure nobody awaited yet. - The adapter ratchet's on-demand import rule refuses a default or an empty destructuring. - The stub boot check fails a layer whose manager answers false rather than throwing, or that is not on (or off) afterwards; a field drawn counts as drawn; the dev server is closed when the browser cannot start.
This commit is contained in:
1 parent
8a4867b1b7
commit
9a13aeab48
8 files changed
+108
-13
No files matched your search
+25
-6
@@ -42,18 +42,31 @@ function applyPhotoreal(handle, shown) {
|
||||
if (handle.shown === shown || released.has(handle)) return;
|
||||
handle.shown = shown;
|
||||
const switchId = (handle.switches = (handle.switches ?? 0) + 1);
|
||||
/** Whether this switch failed to show the base; false once it is off. */
|
||||
const failed = (error) => {
|
||||
if (handle.switches !== switchId || released.has(handle)) return;
|
||||
if (handle.switches !== switchId || released.has(handle)) return false;
|
||||
console.warn('[MapStack] photoreal switch failed', error);
|
||||
if (!shown) return;
|
||||
if (!shown) return false;
|
||||
handle.shown = false;
|
||||
handle.globe.setGlobeVisible(true);
|
||||
shownGlobes.set(handle.globe, true);
|
||||
return true;
|
||||
};
|
||||
handle.globe.setPhotoreal(shown ? handle.spec : null).then((status) => {
|
||||
if (shown && status?.route === 'none')
|
||||
failed(status.error?.message ?? 'photoreal unavailable');
|
||||
}, failed);
|
||||
handle.pending = handle.globe
|
||||
.setPhotoreal(shown ? handle.spec : null)
|
||||
.then(
|
||||
(status) =>
|
||||
shown && status?.route === 'none'
|
||||
? (status.error?.message ?? 'photoreal unavailable')
|
||||
: null,
|
||||
(error) => error ?? 'photoreal unavailable',
|
||||
)
|
||||
.then((error) => {
|
||||
if (error === null || !failed(error)) return;
|
||||
throw error instanceof Error ? error : new Error(String(error));
|
||||
});
|
||||
// A failure nobody waits for is reported above, not unhandled.
|
||||
handle.pending.catch(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,6 +179,12 @@ export const globeMapEngine = Object.freeze({
|
||||
showTileset(handle, shown) {
|
||||
if (handle) applyPhotoreal(handle, shown);
|
||||
},
|
||||
/**
|
||||
* Settles once `handle`'s last switch has: rejects when showing it failed
|
||||
* (the base is off again and the globe shown), so the map stack falls
|
||||
* back as from any failed switch.
|
||||
*/
|
||||
tilesetReady: (handle) => handle?.pending ?? null,
|
||||
addImageryLayer(host, handle, index) {
|
||||
const globe = findGlobe(host);
|
||||
if (!globe || released.has(handle)) return;
|
||||
|
||||
Reference in new issue
Block a user