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

+6 -2
View File
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
import { NO_IMAGERY_HOST, resolveImageryHost } from './imageryHost.js';
import { bindRenderer } from '../render/rendererOf.js';
import { createStubRenderer } from '../render/stub/index.js';
import { globeMapEngine } from './globeEngine.js';
/** A scene object bound to a stub renderer, its globe shown or hidden. */
function scene({ globeShown, capabilities } = {}) {
@@ -28,15 +29,18 @@ test('a hidden globe hands imagery to the shown base tileset', () => {
assert.deepEqual(host, { collection: tileset, kind: 'tileset' });
});
test('without globe visibility, the globe hosts unless a tileset is shown', () => {
test('without globe visibility, the map engine says whether the globe is shown', () => {
const { viewer, renderer } = scene({ capabilities: [] });
assert.equal(renderer.globe.isGlobeVisible, undefined);
const tileset = { id: 'tiles' };
globeMapEngine.setGlobeShown(viewer, false);
assert.deepEqual(resolveImageryHost({ viewer, tileset }), {
collection: tileset,
kind: 'tileset',
});
assert.deepEqual(resolveImageryHost({ viewer, tileset: null }), {
// A globe stack shows the globe: a tileset kept from startup is not the host.
globeMapEngine.setGlobeShown(viewer, true);
assert.deepEqual(resolveImageryHost({ viewer, tileset }), {
collection: renderer.globe.imagery,
kind: 'globe',
});