mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +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
@@ -1,6 +1,5 @@
|
||||
import { isFollowing } from '../../data/followed.js';
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import { followOnDoubleClick } from '../../data/stockFollow.js';
|
||||
import { distance, fromDegrees, toLonLatH } from '../../geo/index.js';
|
||||
import {
|
||||
LAYER_ID,
|
||||
@@ -323,7 +322,6 @@ export function createAlprPresentation({ state, services, source }) {
|
||||
visibleRecords = [];
|
||||
clampedMarkers.clear();
|
||||
markers.clear();
|
||||
state.stockFollow?.stop();
|
||||
removeEntityContextsForLayer(LAYER_ID);
|
||||
}
|
||||
|
||||
@@ -378,8 +376,6 @@ export function createAlprPresentation({ state, services, source }) {
|
||||
if (!visibleIds.has(carrier.id)) gone.push(carrier.id);
|
||||
if (gone.length) {
|
||||
markers.remove(gone);
|
||||
// A camera no longer shown takes its follow with it.
|
||||
state.stockFollow?.retain((key) => Boolean(markers.get(key)));
|
||||
for (const id of gone) clampedMarkers.delete(id);
|
||||
changed = true;
|
||||
}
|
||||
@@ -598,26 +594,6 @@ export function createAlprPresentation({ state, services, source }) {
|
||||
selectRecord(id);
|
||||
else if (state.selectedId) clearSelection();
|
||||
});
|
||||
// A double-click follows a camera, its card shown, as the default
|
||||
// renderer followed its entity.
|
||||
state.stockFollow = followOnDoubleClick({
|
||||
viewer,
|
||||
inputFor,
|
||||
name: LAYER_ID,
|
||||
enabled: () => state.enabled,
|
||||
targetFor: (hit) => {
|
||||
const carrier = hit.set === markers.icons?.id && markers.get(hit.id);
|
||||
if (!carrier) return null;
|
||||
return {
|
||||
key: carrier.id,
|
||||
position: () => {
|
||||
const at = alprIconPosition(carrier);
|
||||
return at ? { ...at } : null;
|
||||
},
|
||||
entity: carrier,
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
return {
|
||||
initOverlay: () => overlay.init(),
|
||||
|
||||
Reference in new issue
Block a user