mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(maps): map sources for the Navara engine
createDefaultMapSources takes the engine kind. On Navara, Google 3D is available from the browser key alone (Navara builds the tiles itself and has no ion route to them), so it is the default and the recovery stack when a key is set; without one the default is Esri imagery. Bing (Cesium ion imagery) has no Navara path and is unavailable with a reason. World terrain still needs an ion token and falls back to the keyless terrain. MapStackController passes the kind of the engine it is given; Cesium sources are unchanged.
This commit is contained in:
1 parent
d112ecf296
commit
72fec292d4
4 files changed
+109
-10
No files matched your search
@@ -22,3 +22,28 @@ test('the map stack controller applies its stacks through a given globe engine',
|
||||
assert.equal(engine.fake.callsOf('maps.setPhotorealTiles')[1].args[0], null);
|
||||
controller.destroy();
|
||||
});
|
||||
|
||||
test('on a Navara engine the map stack controller opens on Google 3D from the browser key alone', async (t) => {
|
||||
const previous = globalThis.window;
|
||||
globalThis.window = { __GOOGLE_MAPS_API_KEY__: 'google-test' };
|
||||
t.after(() => {
|
||||
if (previous === undefined) delete globalThis.window;
|
||||
else globalThis.window = previous;
|
||||
});
|
||||
const engine = createFakeEngine({ kind: 'navara' });
|
||||
const controller = new MapStackController(null, { engine });
|
||||
assert.equal(controller.getActiveId(), 'photoreal');
|
||||
assert.equal(controller.isStackAvailable('bing-aerial'), false);
|
||||
await controller.setStack('photoreal');
|
||||
const [photoreal] = engine.fake.callsOf('maps.setPhotorealTiles')[0].args;
|
||||
assert.equal(photoreal.kind, 'photoreal');
|
||||
assert.equal('tileset' in photoreal, false);
|
||||
controller.destroy();
|
||||
window.__GOOGLE_MAPS_API_KEY__ = '';
|
||||
const keyless = new MapStackController(null, {
|
||||
engine: createFakeEngine({ kind: 'navara' }),
|
||||
});
|
||||
assert.equal(keyless.getActiveId(), 'esri-imagery');
|
||||
assert.equal(keyless.isStackAvailable('photoreal'), false);
|
||||
keyless.destroy();
|
||||
});
|
||||
Reference in new issue
Block a user