mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
fix(input): no double-click follow or zoom on the map
The globe viewer's own double-click tracked a picked entity with a position or zoomed to one without. Layers moving onto the draw port had it re-created one by one (data/stockFollow.js); following is a click in GEV, so the viewer's handler is removed where the viewer is made and every re-creation goes: earthquakes, cyclones, air quality, news, perimeters, drone airspace, ghost maps, places, radio, cables, CCTV, ALPR, launches, bikeshare, Local ADS-B, installations, directions, trails, data packs, annotations, the library's view and local GeoJSON. The Cockpit's own double-click and the draw tool's finishing double-click stay.
This commit is contained in:
1 parent
bb2d22dbce
commit
b86014244d
69 files changed
+94
-2797
No files matched your search
@@ -642,38 +642,3 @@ test('a failed refresh after a stale snapshot reads as the failure, not stale',
|
||||
assert.equal(h.layer.getStats().stale, false);
|
||||
assert.equal(h.layer.getStats().error, 'WFIGS HTTP 502');
|
||||
});
|
||||
|
||||
test('a double-click zooms to a perimeter, as the default renderer zoomed to its entity', async (t) => {
|
||||
const { bindRenderer } = await import('../../render/rendererOf.js');
|
||||
const { createStubRenderer } = await import('../../render/stub/index.js');
|
||||
const renderer = createStubRenderer();
|
||||
const viewer = { isDestroyed: () => false };
|
||||
const unbind = bindRenderer(viewer, renderer);
|
||||
const layer = createFirePerimetersLayer({
|
||||
source: { getSnapshot: async () => [row] },
|
||||
});
|
||||
t.after(() => {
|
||||
layer.destroy();
|
||||
unbind();
|
||||
renderer.destroy();
|
||||
});
|
||||
layer.init(viewer);
|
||||
layer.enable();
|
||||
await layer.update();
|
||||
for (const suffix of [':fills', ':lines']) {
|
||||
const set = renderer.testing.sets().find((id) => id.endsWith(suffix));
|
||||
renderer.testing.scriptPicks(() => [
|
||||
{ set, id: `fire-perimeter:${row.stableId}:0`, surface: false },
|
||||
]);
|
||||
renderer.camera.setView({
|
||||
destination: { lon: 0, lat: 0, height: 20_000_000 },
|
||||
});
|
||||
renderer.testing.tick();
|
||||
assert.ok(renderer.camera.pose().height > 1_000_000, 'starts far out');
|
||||
renderer.testing.pointer('dblclick', 10, 10);
|
||||
renderer.testing.tick();
|
||||
const pose = renderer.camera.pose();
|
||||
assert.equal(renderer.camera.followed, null, 'zoomed to, not followed');
|
||||
assert.ok(pose.height < 1_000_000, `${suffix}: ${pose.height}`);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user