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 -26
View File
@@ -1,9 +1,5 @@
import { fromDegrees } from '../../geo/ellipsoid.js';
import { drawOf, findInput } from '../../render/rendererOf.js';
import {
drawnItemTarget,
followOnDoubleClick,
} from '../../data/stockFollow.js';
import { drawOf } from '../../render/rendererOf.js';
import { cssColor } from '../../render/color.js';
import { inputFor as defaultInputFor } from '../../input/dispatcher.js';
import { msg, t } from '../../i18n/index.js';
@@ -81,9 +77,6 @@ export function createDroneAirspaceLayer({
let _lastError = null;
let _stale = false;
let _enabled = false;
// Each drawn area by id, for a double-click to zoom to.
let _areaById = new Map();
let _stockFollow = null;
let _clickSubscription = null;
let _selectedId = null;
let _selectedCardId = null;
@@ -212,19 +205,6 @@ export function createDroneAirspaceLayer({
if (_fills) _fills.show = _lines.show = true;
overlayHost?.setVisible?.(DRONE_AIRSPACE_OVERLAY_SOURCE_ID, true);
installClickHandler();
// A double-click zooms to an area, as the default renderer zoomed to
// its entity (a scene that takes no input has none).
if (!_stockFollow && inputFor && findInput(_viewer))
_stockFollow = followOnDoubleClick({
viewer: _viewer,
inputFor,
name: layer.id,
enabled: () => _enabled,
targetFor: (hit) =>
_setIds?.has(hit.set)
? drawnItemTarget(hit.set, _areaById.get(hit.id))
: null,
});
},
disable() {
@@ -233,8 +213,6 @@ export function createDroneAirspaceLayer({
_enabled = false;
if (_fills) _fills.show = _lines.show = false;
removeClickHandler();
_stockFollow?.destroy();
_stockFollow = null;
clearSelection();
},
@@ -309,7 +287,6 @@ export function createDroneAirspaceLayer({
_fills.set(nextFills);
_lines.set(nextLines);
_areaById = new Map(nextFills.map((item) => [item.id, item]));
_snapshotSignature = signature;
if (_selectedId) publishSelectedCard();
_count = rows.length;
@@ -337,8 +314,6 @@ export function createDroneAirspaceLayer({
_request?.abort();
_request = null;
removeClickHandler();
_stockFollow?.destroy();
_stockFollow = null;
clearSelection();
_rowById.clear();
_snapshotSignature = null;