mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
feat(globe): engine-agnostic maps checks and maps.current
The contract suite gains maps checks (opt-in with mapSources: two imagery sources and a photoreal one the engine can show): setPhotorealTiles(null) brings back the last base imagery, the last imagery or photoreal call decides what shows, and a released photoreal source no longer shows or counts. They observe the new maps.current(), the source objects on screen as passed. The fake engine follows the same semantics; qa-globe-contract runs the checks on the app engine with the startup tileset and reapplies the app's map stack afterwards. The contract documents map sources as engine-neutral descriptions whose prebuilt members only the engine kind that built them uses.
This commit is contained in:
1 parent
12c9651a67
commit
ab0acb0e09
6 files changed
+160
-14
No files matched your search
@@ -378,3 +378,21 @@ test('releasePhotorealTiles leaves a tileset the engine did not add in the scene
|
||||
maps.releasePhotorealTiles({ tileset: startup });
|
||||
assert.equal(viewer.primitiveList.includes(startup), true);
|
||||
});
|
||||
|
||||
test('current names the sources on screen as passed', async () => {
|
||||
const { maps } = setup();
|
||||
assert.deepEqual(maps.current(), { baseImagery: null, photoreal: null });
|
||||
const esri = esriSource();
|
||||
const tiles = { tileset: tileset(), credit: 'Google' };
|
||||
await maps.setBaseImagery(esri);
|
||||
assert.deepEqual(maps.current(), { baseImagery: esri, photoreal: null });
|
||||
await maps.setPhotorealTiles(tiles);
|
||||
assert.equal(maps.current().photoreal, tiles);
|
||||
assert.equal(maps.current().baseImagery, null);
|
||||
await maps.setPhotorealTiles(null);
|
||||
assert.equal(maps.current().baseImagery, esri);
|
||||
assert.equal(maps.current().photoreal, null);
|
||||
await maps.setPhotorealTiles(tiles);
|
||||
maps.releasePhotorealTiles(tiles);
|
||||
assert.equal(maps.current().photoreal, null, 'a released source is gone');
|
||||
});
|
||||
Reference in new issue
Block a user