mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
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:
1 parent
f6314884f7
commit
959698cff9
6 files changed
+272
-1
No files matched your search
@@ -139,6 +139,15 @@ export function createDroneAirspaceLayer({
|
||||
const picked = event.topHit;
|
||||
const zoneId = picked ? pickedZoneId(event.drawHit) : null;
|
||||
if (zoneId) {
|
||||
// Another layer's card or label painted over the zone (a quake's
|
||||
// card or magnitude label, a fire card) is that layer's click: under
|
||||
// it the zone is background, as it is to siblings, so it stays as is.
|
||||
const top = overlayHost.hitTest?.(
|
||||
event.screenPosition?.x,
|
||||
event.screenPosition?.y,
|
||||
{},
|
||||
);
|
||||
if (top && top.sourceId !== DRONE_AIRSPACE_OVERLAY_SOURCE_ID) return;
|
||||
_selectedId = zoneId;
|
||||
publishSelectedCard();
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user