From 0bb055b3915499b9335b85fd0db3d0e4f59b1e77 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 15 Jan 2026 22:15:29 +0000 Subject: [PATCH] Allow clicks on cells without sources --- htmlpage/static/js/map-aggregate.js | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/htmlpage/static/js/map-aggregate.js b/htmlpage/static/js/map-aggregate.js index 11175360..52146995 100644 --- a/htmlpage/static/js/map-aggregate.js +++ b/htmlpage/static/js/map-aggregate.js @@ -132,7 +132,7 @@ class MapAggregate extends HTMLElement { 'fill-color': '#0dcaf0' } }); - map.addInteraction("tegola-click-interaction", { + map.addInteraction("tegola-click-mosquito-source", { type: "click", target: { layerId: "mosquito_source" }, handler: (e) => { @@ -147,6 +147,36 @@ class MapAggregate extends HTMLElement { })); } }); + map.addInteraction("tegola-click-service-request", { + type: "click", + target: { layerId: "service_request" }, + handler: (e) => { + const coordinates = e.feature.geometry.coordinates.slice(); + const properties = e.feature.properties; + this.dispatchEvent(new CustomEvent("cell-click", { + bubbles: true, + composed: true, // Allows event to cross shadow DOM boundary + detail: { + cell: properties.cell + } + })); + } + }); + map.addInteraction("tegola-click-trap", { + type: "click", + target: { layerId: "trap" }, + handler: (e) => { + const coordinates = e.feature.geometry.coordinates.slice(); + const properties = e.feature.properties; + this.dispatchEvent(new CustomEvent("cell-click", { + bubbles: true, + composed: true, // Allows event to cross shadow DOM boundary + detail: { + cell: properties.cell + } + })); + } + }); }); }