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:
Sameh Khamis committed 2026-11-14 09:10:14 -08:00
1 parent bb2d22dbce
commit b86014244d
69 files changed
+94 -2797

No files matched your search

+1 -39
View File
@@ -315,7 +315,7 @@ function cameraHarness(layer = alprCamerasLayer) {
},
});
let box = { south: 30.26, west: -97.75, north: 30.28, east: -97.73 };
let click, dblclick, picked;
let click, picked;
const credits = new Set();
const viewer = {
creditDisplay: {
@@ -344,15 +344,6 @@ function cameraHarness(layer = alprCamerasLayer) {
// port follows on a tracking widget of the fake's.
trackedEntityChanged: new Cesium.Event(),
entities: {},
// The viewer's stock double-click (its follow), which the input port
// takes and runs before layers' own.
screenSpaceEventHandler: {
getInputAction: (type) =>
type === Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK
? () => {}
: undefined,
removeInputAction() {},
},
};
const ports = fakeScenePorts(viewer);
bindFakeCesiumCamera(viewer, ports);
@@ -370,11 +361,6 @@ function cameraHarness(layer = alprCamerasLayer) {
modifier === undefined
)
click = fn;
if (
type === Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK &&
modifier === undefined
)
dblclick = fn;
return setInput.call(this, fn, type, modifier);
};
try {
@@ -423,11 +409,6 @@ function cameraHarness(layer = alprCamerasLayer) {
picked = item ? { id: { set: icons().id, id: item.id } } : undefined;
click({ position: new Cesium.Cartesian2() });
},
dblclick(id) {
const item = typeof id === 'string' ? icons()?.items.get(id) : null;
picked = item ? { id: { set: icons().id, id: item.id } } : undefined;
dblclick({ position: new Cesium.Cartesian2() });
},
restore() {
layer.destroy(viewer);
Date.now = originals.now;
@@ -1566,22 +1547,3 @@ test('ALPR display tags collapse controls and cap final text without erasing Uni
assert.equal(record.cameraType, null);
assert.equal(record.zone, 'traffic zone');
});
test('a double-click follows a camera with its card until it is no longer shown, as its entity was', async () => {
const { followedOf } = await import('./followed.js');
const h = cameraHarness();
try {
await alprCamerasLayer.update();
h.dblclick('alpr:42');
const followed = followedOf(h.viewer);
assert.ok(followed, 'the camera is followed');
assert.equal(followed.key, 'alpr:42');
assert.ok(followed.entity, 'through its entity record, for its card');
h.setFetch(async () => cameraResponse([cameraNode(43)]));
h.expire();
await alprCamerasLayer.update();
assert.equal(followedOf(h.viewer), null, 'gone: no longer followed');
} finally {
h.restore();
}
});