mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
feat(map): add POI and label hover affordance
POIs, city names, and other labeled features now show a pointer cursor on hover, signaling that they are clickable. Matches the standard map-app interaction pattern (Google Maps, etc.). Implemented via MapLibre mouseenter/mouseleave handlers for interactive layers: pois, places_locality, places_region, places_country, places_subplace.
This commit is contained in:
parent
37a5eb5b1b
commit
985221e8cd
1 changed files with 13 additions and 0 deletions
|
|
@ -929,6 +929,19 @@ const MapView = forwardRef(function MapView(_, ref) {
|
|||
activeLayersRef.current.hillshade = true
|
||||
}
|
||||
} catch {}
|
||||
|
||||
// POI/label hover affordance — cursor pointer
|
||||
const interactiveLayers = ['pois', 'places_locality', 'places_region', 'places_country', 'places_subplace']
|
||||
|
||||
interactiveLayers.forEach(layerId => {
|
||||
map.on('mouseenter', layerId, () => {
|
||||
map.getCanvas().style.cursor = 'pointer'
|
||||
})
|
||||
|
||||
map.on('mouseleave', layerId, () => {
|
||||
map.getCanvas().style.cursor = ''
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
mapInstance.current = map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue