mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Drape recent imagery through the renderer's globe port
The two recent imagery slots now add their GIBS layers through the globe port and share their six-request budget through its admission hook. The port moves the layers between the globe and the base tileset, which the renderer now marks as a base when it is the host. The renderer stays the layer's Cesium side: it still loads the camera factory, and now the globe factory too. The weather and wind entries load the globe factory as well, and the factory check counts callers that take findGlobe as a default.
This commit is contained in:
1 parent
76880f6eae
commit
b1733fa41a
9 files changed
+243
-250
No files matched your search
@@ -114,6 +114,7 @@ function fixture({
|
||||
hostKind = 'globe',
|
||||
controller = fakeController(),
|
||||
viirs = true,
|
||||
globeOf,
|
||||
} = {}) {
|
||||
const renderer = fakeRenderer();
|
||||
const thumbnails = fakeThumbnails();
|
||||
@@ -129,6 +130,7 @@ function fixture({
|
||||
collection: collections[hostState.kind],
|
||||
kind: hostState.kind,
|
||||
}),
|
||||
...(globeOf && { globeOf }),
|
||||
now: () => NOW,
|
||||
setTimeoutImpl: timers.setTimeoutImpl,
|
||||
clearTimeoutImpl: timers.clearTimeoutImpl,
|
||||
@@ -829,6 +831,32 @@ test('without a host the drapes hide and say so; the stats poll rebinds when no
|
||||
assert.equal(f.owned().a.kind, 'tileset');
|
||||
});
|
||||
|
||||
test("the renderer is bound with the viewer's globe port, and the attached tileset while that is the host", async () => {
|
||||
const globe = { name: 'globe port' };
|
||||
const asked = [];
|
||||
const f = fixture({
|
||||
globeOf: (viewer) => {
|
||||
asked.push(viewer);
|
||||
return globe;
|
||||
},
|
||||
});
|
||||
await f.ready();
|
||||
const last = () => f.renderer.hosts.at(-1);
|
||||
assert.equal(last().globe, globe);
|
||||
assert.equal(last().tileset, null, 'a globe host carries no tileset');
|
||||
assert.ok(asked.every((viewer) => viewer === f.viewer));
|
||||
const tileset = { name: 'photoreal' };
|
||||
f.hostState.kind = 'tileset';
|
||||
f.layer.attachTileset(tileset);
|
||||
assert.equal(last().kind, 'tileset');
|
||||
assert.equal(last().globe, globe);
|
||||
assert.equal(last().tileset, tileset);
|
||||
f.hostState.kind = 'none';
|
||||
f.layer.getStats();
|
||||
assert.equal(last().globe, null, 'no host, no port');
|
||||
f.layer.destroy();
|
||||
});
|
||||
|
||||
test('a controller subscription moves the drape to the new host on every settled switch', async () => {
|
||||
const listeners = new Set();
|
||||
const controller = {
|
||||
|
||||
Reference in new issue
Block a user