mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 22:54:42 +02:00
feat(map): polygon boundary, zoom-to-feature, Wikidata link cleanup
Three improvements:
1. When a place has a boundary polygon (from Nominatim), render its
outline on the map using a dashed accent line. Falls back to the
existing pulsing ring for places without polygons.
2. Selecting a feature now smoothly zooms the map to fit:
- With polygon: fitBounds to polygon bbox
- Without polygon: zoom level based on feature kind (city=11,
region=7, POI=16, etc.)
Terrain clicks do not change zoom.
3. Wikidata IDs render as styled 'View on Wikidata' links instead
of raw 'Wikidata: Qxxxxx' strings.
This commit is contained in:
parent
b354fd0aa0
commit
d0f89c6783
2 changed files with 128 additions and 3 deletions
|
|
@ -339,10 +339,10 @@ function EnrichmentSections({ details }) {
|
|||
href={`https://www.wikidata.org/wiki/${et.wikidata}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-2 text-xs font-mono"
|
||||
style={{ color: 'var(--text-tertiary)' }}
|
||||
className="text-[11px]"
|
||||
style={{ color: 'var(--text-tertiary)', textDecoration: 'underline' }}
|
||||
>
|
||||
Wikidata: {et.wikidata}
|
||||
View on Wikidata
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -474,6 +474,13 @@ export default function PlaceDetail() {
|
|||
fetchPlaceDetails(osmType, osmId, controller.signal).then((data) => {
|
||||
if (!controller.signal.aborted) {
|
||||
setPlaceDetails(data || null)
|
||||
// Update selectedPlace with boundary if present
|
||||
if (data?.boundary) {
|
||||
const current = useStore.getState().selectedPlace
|
||||
if (current) {
|
||||
useStore.getState().setSelectedPlace({ ...current, boundary: data.boundary })
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -503,6 +510,13 @@ export default function PlaceDetail() {
|
|||
...data.extratags,
|
||||
},
|
||||
}))
|
||||
// Update selectedPlace with boundary if present
|
||||
if (data?.boundary) {
|
||||
const current = useStore.getState().selectedPlace
|
||||
if (current) {
|
||||
useStore.getState().setSelectedPlace({ ...current, boundary: data.boundary })
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue