mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +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
@@ -95,6 +95,9 @@ export function createCesiumMaps(
|
||||
// decides what the globe shows. Terrain has its own.
|
||||
const generations = { display: 0, terrain: 0 };
|
||||
let baseSource = null;
|
||||
// The source objects on screen, as passed (maps.current()).
|
||||
let currentBase = null;
|
||||
let currentTiles = null;
|
||||
let creditOwner = null;
|
||||
let destroyed = false;
|
||||
|
||||
@@ -130,6 +133,7 @@ export function createCesiumMaps(
|
||||
}
|
||||
|
||||
function showBase(source, provider) {
|
||||
currentBase = source;
|
||||
mapScene.showBaseImagery(provider);
|
||||
showCredit('imagery', imageryCredit(source));
|
||||
}
|
||||
@@ -156,6 +160,7 @@ export function createCesiumMaps(
|
||||
if (source == null) {
|
||||
mapScene.showTileset(null, tilesets());
|
||||
shownTileset = null;
|
||||
currentTiles = null;
|
||||
// The globe comes back with the last base imagery and its credit;
|
||||
// the photoreal credit goes.
|
||||
if (baseSource) {
|
||||
@@ -195,6 +200,8 @@ export function createCesiumMaps(
|
||||
// As MapSourceController activates a 3D stack: no base layer, the
|
||||
// source's credit, one tileset shown and the globe hidden.
|
||||
mapScene.removeBaseImagery();
|
||||
currentBase = null;
|
||||
currentTiles = source;
|
||||
showCredit('photoreal', source.credit);
|
||||
shownTileset = tileset;
|
||||
mapScene.showTileset(tileset, tilesets());
|
||||
@@ -205,9 +212,11 @@ export function createCesiumMaps(
|
||||
const tileset = source?.tileset;
|
||||
if (!tileset || !known.delete(tileset)) return;
|
||||
if (shownTileset === tileset) shownTileset = null;
|
||||
if (currentTiles?.tileset === tileset) currentTiles = null;
|
||||
if (added.delete(tileset)) viewer.scene.primitives.remove(tileset);
|
||||
},
|
||||
photorealActive: () => tilesets().some((tileset) => tileset.show === true),
|
||||
current: () => ({ baseImagery: currentBase, photoreal: currentTiles }),
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user