Added support for marker and area highlight

This commit is contained in:
EpicKiwi 2026-06-13 14:11:16 +02:00
parent 15e5a409c1
commit 66844d3956
Signed by: epickiwi
GPG key ID: C4B28FD2729941CE
2 changed files with 13 additions and 0 deletions

View file

@ -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],