Load the default renderer as the page starts, and follow through the camera port in tests

- The standalone page starts loading the default renderer as it starts
  (loadDefaultRenderer), so Cesium arrives beside the page's own setup,
  not after it; the scene takes a plugin or a promise of one.
- Where a follow target's layer has no display position yet, the followed
  position is the target's own position at the frame port's scene time.
- The globe engine's photoreal base that fails to come back is off again
  and the globe shown; a later switch tries again. The draped-imagery host
  asks the map engine whether the globe is shown where the renderer cannot
  say. The scene resizes the renderer with its container.
- Cockpit and voice tests follow through the camera port (followEntity),
  not by setting the viewer's tracked entity; the fake frame port has a
  scene time.
This commit is contained in:
Sameh Khamis committed 2026-11-10 17:44:29 -08:00
1 parent 6daf63d90c
commit ae4fbb5053
21 files changed
+328 -87

No files matched your search

+19 -6
View File
@@ -32,15 +32,28 @@ const shownGlobes = new WeakMap();
const credit = (text) => ({ text });
/** Turn a photoreal handle's base on or off, reporting a failure. */
/**
* Turn a photoreal handle's base on or off. Turning it on can fail (the
* port answers route `none`, or rejects): the handle is then off again, so
* a later switch tries again, and the globe is shown so the base is not
* left blank. Only the latest switch of a handle settles it.
*/
function applyPhotoreal(handle, shown) {
if (handle.shown === shown || released.has(handle)) return;
handle.shown = shown;
handle.globe
.setPhotoreal(shown ? handle.spec : null)
.catch((error) =>
console.warn('[MapStack] photoreal switch failed', error),
);
const switchId = (handle.switches = (handle.switches ?? 0) + 1);
const failed = (error) => {
if (handle.switches !== switchId || released.has(handle)) return;
console.warn('[MapStack] photoreal switch failed', error);
if (!shown) return;
handle.shown = false;
handle.globe.setGlobeVisible(true);
shownGlobes.set(handle.globe, true);
};
handle.globe.setPhotoreal(shown ? handle.spec : null).then((status) => {
if (shown && status?.route === 'none')
failed(status.error?.message ?? 'photoreal unavailable');
}, failed);
}
/**