mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 17:22: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
@@ -5,7 +5,6 @@ import { viewshedColors, cameraHue } from '../../data/cctvViewshed.js';
|
||||
import { CCTV_OVERLAY_SOURCE_ID } from '../../data/cctvCards.js';
|
||||
import { GIZMO_ID_PREFIX } from '../../data/cctvGizmo.js';
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import { followOnDoubleClick } from '../../data/stockFollow.js';
|
||||
import {
|
||||
GROUND_PRIOR_INIT_WAIT_MS,
|
||||
CALIBRATION_RANGE_FLOOR_M,
|
||||
@@ -439,21 +438,9 @@ export function createLifecycle({
|
||||
const unsubscribeHover = input.onPointer('move', (movement) =>
|
||||
parts.hover.handleHoverMove(movement?.endPosition),
|
||||
);
|
||||
// A double-click zooms to a coverage line and follows the monitor
|
||||
// plane, as the default renderer did for their entities (the camera
|
||||
// icons were billboards, which it never followed).
|
||||
layerState._stockFollow = followOnDoubleClick({
|
||||
viewer: layerState._viewer,
|
||||
inputFor: () => input,
|
||||
name: 'cctv',
|
||||
enabled: () => layerState._enabled,
|
||||
targetFor: (hit) => parts.drawSets.followTargetFor(hit),
|
||||
});
|
||||
layerState._clickSubscription = () => {
|
||||
unsubscribeClick();
|
||||
unsubscribeHover();
|
||||
layerState._stockFollow?.destroy();
|
||||
layerState._stockFollow = null;
|
||||
};
|
||||
|
||||
await parts.health.syncHealthState(true);
|
||||
|
||||
Reference in new issue
Block a user