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
|
|
@ -135,6 +135,10 @@ body > hr {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#map .highlight-point-icon:not(.active) {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* SAERCH FORM */
|
/* SAERCH FORM */
|
||||||
|
|
||||||
#search-section {
|
#search-section {
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,9 @@ export function unhighlight_all(){
|
||||||
for(let el of document.querySelectorAll(".map-hilight-area.active")){
|
for(let el of document.querySelectorAll(".map-hilight-area.active")){
|
||||||
el.classList.remove("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){
|
export function highlight(place_or_placeid){
|
||||||
|
|
@ -173,6 +176,12 @@ export function highlight(place_or_placeid){
|
||||||
.classList.add("active")
|
.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)
|
let centroid = turf.centroid(place)
|
||||||
map.panTo(L.latLng(
|
map.panTo(L.latLng(
|
||||||
centroid.geometry.coordinates[1],
|
centroid.geometry.coordinates[1],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue