mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Show drone airspace, OSM places, sea marks and ski pistes on Navara, and keep them across engine switches
This commit is contained in:
1 parent
43b4e9348b
commit
843c4a111d
25 files changed
+838
-295
No files matched your search
@@ -165,3 +165,33 @@ test('destroy removes owned imagery and unsubscribes from the map stack', () =>
|
||||
assert.equal(created[0].destroyed, true);
|
||||
assert.equal(mapStack.subscribers.size, 0);
|
||||
});
|
||||
|
||||
test('on Navara an overlay drapes through engine.maps and follows the globe', () => {
|
||||
const added = [];
|
||||
const engineWith = () => ({
|
||||
maps: {
|
||||
addOverlay(options) {
|
||||
const entry = { options, removed: false };
|
||||
added.push(entry);
|
||||
return () => (entry.removed = true);
|
||||
},
|
||||
},
|
||||
});
|
||||
const [seaMarks] = createOsmOverlayLayers();
|
||||
seaMarks.init(null, { engine: engineWith() });
|
||||
assert.equal(added.length, 0, 'nothing until enabled');
|
||||
seaMarks.enable();
|
||||
assert.equal(added.length, 1);
|
||||
assert.equal(added[0].options.url, OSM_OVERLAYS[0].urlTemplate);
|
||||
assert.equal(added[0].options.credit, OSM_OVERLAYS[0].credit);
|
||||
assert.equal(seaMarks.getStats().error, null);
|
||||
// An engine switch: the drape leaves with the old globe, comes back on the next.
|
||||
seaMarks.detachRenderer();
|
||||
assert.equal(added[0].removed, true);
|
||||
seaMarks.attachRenderer(null, { engine: engineWith() });
|
||||
assert.equal(added.length, 2);
|
||||
assert.equal(added[1].removed, false);
|
||||
seaMarks.disable();
|
||||
assert.equal(added[1].removed, true);
|
||||
seaMarks.destroy();
|
||||
});
|
||||
Reference in new issue
Block a user