mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +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
@@ -1309,42 +1309,6 @@ test('a type change takes its belly offset with the new model, however soon it i
|
||||
models.destroy();
|
||||
});
|
||||
|
||||
test('a double-click follows a local aircraft with its card, until it goes, as its entity was', async (t) => {
|
||||
const { bindRenderer } = await import('../../render/rendererOf.js');
|
||||
const { createStubRenderer } = await import('../../render/stub/index.js');
|
||||
const { followedOf } = await import('../../data/followed.js');
|
||||
const renderer = createStubRenderer();
|
||||
const viewer = { isDestroyed: () => false };
|
||||
const unbind = bindRenderer(viewer, renderer);
|
||||
const receiver = fakeReceiver({ mode: 'adsb', connected: true });
|
||||
const clock = { now: 100_000 };
|
||||
const { layer } = await enabledLayer(receiver, clock, null, {
|
||||
viewer: { viewer, draw: renderer.draw },
|
||||
});
|
||||
t.after(() => {
|
||||
layer.destroy();
|
||||
unbind();
|
||||
renderer.destroy();
|
||||
});
|
||||
receiver.set({ aircraft: [record()] });
|
||||
await layer.update();
|
||||
const set = renderer.testing.sets().find((id) => id.endsWith(':markers'));
|
||||
renderer.testing.scriptPicks(() => [
|
||||
{ set, id: 'local-adsb:abc123', surface: false },
|
||||
]);
|
||||
renderer.testing.pointer('dblclick', 10, 10);
|
||||
const followed = followedOf(viewer);
|
||||
assert.ok(followed, 'the aircraft is followed');
|
||||
assert.equal(followed.key, 'local-adsb:abc123');
|
||||
assert.ok(followed.entity, 'its entity record shows the tracked card');
|
||||
assert.equal(typeof followed.displayPosition, 'function');
|
||||
assert.ok(followed.labelModel?.title, 'with its card');
|
||||
receiver.set({ aircraft: [] });
|
||||
clock.now += 10 * 60_000;
|
||||
await layer.update();
|
||||
assert.equal(followedOf(viewer), null, 'gone, it is no longer followed');
|
||||
});
|
||||
|
||||
test('a click on a UAT ring selects its aircraft, as the ring was a point on its entity', async (t) => {
|
||||
const receiver = fakeReceiver({ mode: 'adsb', connected: true });
|
||||
const feeds = fakeFeeds();
|
||||
|
||||
Reference in new issue
Block a user