mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
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:
parent
6245ecc206
commit
1bccfad22b
1 changed files with 3 additions and 0 deletions
|
|
@ -352,6 +352,9 @@ export function PlaceCard({ place, variant = "preview", expanded = true, onToggl
|
||||||
if (placeLat == null || placeLon == null) return
|
if (placeLat == null || placeLon == null) return
|
||||||
// Skip for dropped pins - they get reverse geocoded by MapView
|
// Skip for dropped pins - they get reverse geocoded by MapView
|
||||||
if (place?.source === 'map_click') return
|
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()
|
const controller = new AbortController()
|
||||||
fetchReverse(placeLat, placeLon).then((result) => {
|
fetchReverse(placeLat, placeLon).then((result) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue