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 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-05-02 04:49:51 +00:00
commit 1bccfad22b

View file

@ -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) => {