mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
fix(submarine-cables): a double-click follows a landing point or reference and zooms to a cable again
The cables, landing points and references were entities, which the default renderer's double-click followed (a point, or a reference at its tip) or zoomed to (a cable or area) until the sources were replaced or hidden. As draw-port items they took no part in it.
This commit is contained in:
1 parent
d003d9ee78
commit
94ea9cd01d
5 files changed
+92
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { toRadians } from '../../geo/vector.js';
|
||||
import { cameraOf } from '../../render/rendererOf.js';
|
||||
import { followOnDoubleClick } from '../../data/stockFollow.js';
|
||||
|
||||
export function createInteraction({ state, parts, inputFor }) {
|
||||
function beginInteraction(viewer) {
|
||||
@@ -10,6 +11,15 @@ export function createInteraction({ state, parts, inputFor }) {
|
||||
if (!record?.reference) return;
|
||||
flyToReference(viewer, record.reference);
|
||||
});
|
||||
// A double-click follows a landing point or reference and zooms to a
|
||||
// cable, as the default renderer did for their entities.
|
||||
state._stockFollow = followOnDoubleClick({
|
||||
viewer,
|
||||
inputFor,
|
||||
name: 'submarine-cables',
|
||||
enabled: () => state._enabled,
|
||||
targetFor: (hit) => parts.rendering.followTargetFor(hit),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user