From 66844d395640008965405f3b8cd269461afa55d9 Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Sat, 13 Jun 2026 14:11:16 +0200 Subject: [PATCH] Added support for marker and area highlight --- css/style.css | 4 ++++ js/map.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/css/style.css b/css/style.css index 4fad220..ba2565a 100644 --- a/css/style.css +++ b/css/style.css @@ -135,6 +135,10 @@ body > hr { opacity: 0; } +#map .highlight-point-icon:not(.active) { + opacity: 0; +} + /* SAERCH FORM */ #search-section { diff --git a/js/map.js b/js/map.js index 57fd8e6..5e73fb5 100644 --- a/js/map.js +++ b/js/map.js @@ -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],