fix(drone-airspace, perimeters): yield area clicks to cards painted on top

Drone airspace and fire perimeters select a zone or incident from any
shape hit, so a quake card or magnitude label painted over one made both
layers act on a single click: the quake opened its USGS page or flew to the
quake while the area was selected too. Fire and vessel cards over an area
did the same.

The areas now stand aside when another layer's card or label is the topmost
overlay entry, the rule the quake handler already follows for cards painted
over its discs. Deselection and every other path are unchanged. Items of
layers that never act on clicks no longer matter: the quake card and labels
keep working over air-quality stations, traffic lines and OSM places.
This commit is contained in:
manjunath22466 committed 2026-11-16 21:13:42 +05:30
1 parent f6314884f7
commit 959698cff9
6 files changed
+272 -1

No files matched your search

+9
View File
@@ -230,6 +230,15 @@ export function createFirePerimetersLayer({
const picked = event.topHit;
const incidentId = picked ? pickedIncidentId(event.drawHit) : null;
if (incidentId) {
// Another layer's card or label painted over the perimeter (a
// quake's card or magnitude label, a fire card) is that layer's
// click: under it the perimeter is background, so it stays as is.
const top = overlayHost.hitTest?.(
event.screenPosition?.x,
event.screenPosition?.y,
{},
);
if (top && top.sourceId !== PERIMETER_OVERLAY_SOURCE_ID) return;
abortLinkVerification();
_selectedId = incidentId;
publishSelectedCard();