Added support for marker and area highlight
This commit is contained in:
parent
15e5a409c1
commit
66844d3956
2 changed files with 13 additions and 0 deletions
|
|
@ -155,6 +155,9 @@ export function unhighlight_all(){
|
|||
for(let el of document.querySelectorAll(".map-hilight-area.active")){
|
||||
el.classList.remove("active")
|
||||
}
|
||||
for(let el of document.querySelectorAll(".highlight-point-icon.active")){
|
||||
el.classList.remove("active")
|
||||
}
|
||||
}
|
||||
|
||||
export function highlight(place_or_placeid){
|
||||
|
|
@ -173,6 +176,12 @@ export function highlight(place_or_placeid){
|
|||
.classList.add("active")
|
||||
}
|
||||
|
||||
let point_layer = place.asPoint()?.[HIGHLIGHT_LAYER];
|
||||
if(point_layer && point_layer != place[HIGHLIGHT_LAYER]){
|
||||
point_layer.getElement()
|
||||
.classList.add("active")
|
||||
}
|
||||
|
||||
let centroid = turf.centroid(place)
|
||||
map.panTo(L.latLng(
|
||||
centroid.geometry.coordinates[1],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue