From 1bccfad22ba94c23120ad86f91711fd96f7acf98 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 2 May 2026 04:49:51 +0000 Subject: [PATCH] fix: Skip reverse geocode for basemap label clicks When clicking a basemap label (city, town, POI), we already know the entity from the label properties (name, kind, wikidata). Running fetchReverse at those coordinates would return the nearest POI which could be a different entity (e.g., clicking Portland returns Stumptown Coffee), corrupting the place identity. Now skips reverse geocode when source=basemap_label and raw.kind exists. The wikidata lookup path still handles fetching boundaries and OSM data. Co-Authored-By: Claude Opus 4.5 --- src/components/PlaceCard.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/PlaceCard.jsx b/src/components/PlaceCard.jsx index 40c4660..c1782a7 100644 --- a/src/components/PlaceCard.jsx +++ b/src/components/PlaceCard.jsx @@ -352,6 +352,9 @@ export function PlaceCard({ place, variant = "preview", expanded = true, onToggl if (placeLat == null || placeLon == null) return // Skip for dropped pins - they get reverse geocoded by MapView if (place?.source === 'map_click') return + // Don't reverse geocode if we already identified the entity from a label click + // The basemap label provides name, kind, wikidata - reverse geocode would return wrong entity + if (place?.source === 'basemap_label' && place?.raw?.kind) return const controller = new AbortController() fetchReverse(placeLat, placeLon).then((result) => {