From b6f8822c4f05602a7f7b7a96288829722b3988fc Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Sat, 22 Nov 2025 19:24:51 +0100
Subject: Try to debug why in prod, clicking the map doesn't work

---
 src/frontend/app/routes/map.tsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'src/frontend/app/routes/map.tsx')

diff --git a/src/frontend/app/routes/map.tsx b/src/frontend/app/routes/map.tsx
index a711a64..2af53d8 100644
--- a/src/frontend/app/routes/map.tsx
+++ b/src/frontend/app/routes/map.tsx
@@ -50,7 +50,10 @@ export default function StopMap() {
   // Handle click events on clusters and individual stops
   const onMapClick = (e: MapLayerMouseEvent) => {
     const features = e.features;
-    if (!features || features.length === 0) return;
+    if (!features || features.length === 0) {
+      console.debug("No features found on map click. Position:", e.lngLat, "Point:", e.point);
+      return;
+    }
     const feature = features[0];
     const props: any = feature.properties;
 
@@ -140,7 +143,10 @@ export default function StopMap() {
     const props: any = feature.properties;
     // fetch full stop to get lines array
     StopDataProvider.getStopById(region, props.stopId).then((stop) => {
-      if (!stop) return;
+      if (!stop) {
+        console.warn("Stop not found:", props.stopId);
+        return;
+      }
       setSelectedStop(stop);
       setIsSheetOpen(true);
     });
-- 
cgit v1.3

