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
@@ -13,7 +13,6 @@ import {
|
||||
findQuery,
|
||||
} from '../../render/rendererOf.js';
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import { followOnDoubleClick } from '../../data/stockFollow.js';
|
||||
import { pickRenderAltitudeM } from '../../data/renderAltitude.js';
|
||||
import { routePlausible } from '../../data/routePlausible.js';
|
||||
import {
|
||||
@@ -151,8 +150,6 @@ export function createLocalAdsbLayer({
|
||||
let tickTimer = null;
|
||||
let syncTimer = null;
|
||||
let clickSubscription = null;
|
||||
/** The follow a double-click on a marker started, while installed. */
|
||||
let stockFollow = null;
|
||||
let removePreRender = null;
|
||||
let renderHeld = false;
|
||||
let selectedId = null;
|
||||
@@ -571,9 +568,6 @@ export function createLocalAdsbLayer({
|
||||
if (ringsGone.length) sets.rings.remove(ringsGone);
|
||||
// Expired aircraft take their 3D models (and pending loads) with them.
|
||||
if (removed) models?.retain(markers);
|
||||
// An aircraft that went took the follow a double-click gave it.
|
||||
const followed = stockFollow?.following;
|
||||
if (followed && !markers.has(followed.key)) stockFollow.stop();
|
||||
if (selectedId && !live.has(selectedId))
|
||||
clearSelection({ evicted: enabled });
|
||||
removeEntityContextsForLayer(LAYER_ID, { retainIds: live });
|
||||
@@ -688,26 +682,6 @@ export function createLocalAdsbLayer({
|
||||
|
||||
function installInteraction() {
|
||||
if (clickSubscription || !viewer) return;
|
||||
// A double-click follows a local aircraft, its card shown, as the
|
||||
// default renderer followed its entity.
|
||||
stockFollow = followOnDoubleClick({
|
||||
viewer,
|
||||
inputFor,
|
||||
name: LAYER_ID,
|
||||
enabled: () => enabled,
|
||||
targetFor: (hit) => {
|
||||
const marker =
|
||||
!hit.surface &&
|
||||
(hit.set === sets?.markers.id || hit.set === sets?.rings.id) &&
|
||||
markers.get(hit.id);
|
||||
if (!marker?.carrier) return null;
|
||||
return {
|
||||
key: marker.id,
|
||||
position: () => (marker.position ? { ...marker.position } : null),
|
||||
entity: marker.carrier,
|
||||
};
|
||||
},
|
||||
});
|
||||
clickSubscription = inputFor(viewer).onClick((event) => {
|
||||
if (!enabled) return;
|
||||
const target = clickTarget(event);
|
||||
@@ -728,8 +702,6 @@ export function createLocalAdsbLayer({
|
||||
}
|
||||
|
||||
function releaseInteraction() {
|
||||
stockFollow?.destroy();
|
||||
stockFollow = null;
|
||||
clickSubscription?.();
|
||||
clickSubscription = null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user