Installations: a label takes a click only where nothing else is drawn

An interactive overlay entry is a card that takes every click from what is
drawn under it, so a base's label kept an aircraft or vessel under it from
being selected. The labels are no longer interactive entries. The layer
claims a click on a label box through the pick registry's click claim, as
CCTV counts do, only where nothing another layer draws is under it; over
the map or the layer's own dots and fills the label takes it, and another
layer's card painted over the label keeps its click. The label box is read
from the box the overlay painted for it (overlayHost.paintRect).
This commit is contained in:
Denis Groshev committed 2026-11-20 13:12:21 +01:00
1 parent 7b7eb2318a
commit dac8738b80
9 files changed
+229 -102

No files matched your search

+10 -8
View File
@@ -178,10 +178,10 @@ export function createControls({
},
/**
* The mapped installation whose label box the shared overlay paints on
* top at a canvas position: what a click lands on from far out, where the
* dot is 7 px. Another layer's label painted over it there wins, so this
* answers null. The dot, outline and fill themselves are query port
* The mapped installation whose label box the shared overlay paints at a
* canvas position: what a click lands on from far out, where the dot is
* 7 px. Another layer's card or label that takes clicks there wins, so
* this answers null. The dot, outline and fill themselves are query port
* hits, read with {@link findByPick}. Null for anything else.
* @param {{x: number, y: number}|null|undefined} position Canvas CSS px.
* @returns {object|null} As {@link getById}.
@@ -189,13 +189,15 @@ export function createControls({
findAt(position) {
if (!Number.isFinite(position?.x) || !Number.isFinite(position?.y))
return null;
let hit = null;
let top = null;
try {
hit = overlayHost?.hitTest?.(position.x, position.y) ?? null;
top = overlayHost?.hitTest?.(position.x, position.y) ?? null;
} catch {
hit = null;
top = null;
}
return hit?.sourceId === LAYER_ID ? methods.getById(hit.entryId) : null;
if (top) return null;
const id = parts.namedMarkers?.labelAt?.(position) ?? null;
return id ? methods.getById(id) : null;
},
/**