Amelioration de l'affichage des points

This commit is contained in:
EpicKiwi 2026-07-03 15:33:22 +02:00
parent cbab1d6eb3
commit 500a51b1fc
Signed by: epickiwi
GPG key ID: C4B28FD2729941CE
3 changed files with 31 additions and 1 deletions

View file

@ -136,6 +136,14 @@ body > hr {
margin-top: 1ex;
}
#map .highlight-point-icon.point-feature img ~ h3 {
opacity: clamp(0, calc( var(--zoom-level) - 20 ), 1) ;
}
#map .highlight-point-icon img {
opacity: clamp(0, calc( var(--zoom-level) - 17 ), 1) ;
}
#map .highlight-point-icon:not(.active) {
opacity: 0;

View file

@ -135,9 +135,15 @@ export async function init_places(places_db){
contentEl.append(nameEl)
}
let classlist = ["highlight-point-icon"]
if((!feature.parentFeature && feature.geometry.type == "Point") || feature.parentFeature?.geometry.type == "Point"){
classlist.push("point-feature")
}
return L.marker(latlng, {
icon: L.divIcon({
className: "highlight-point-icon",
className: classlist.join(" "),
html: contentEl,
iconSize: [0, 0]
})

View file

@ -76,6 +76,10 @@ function getBaseSymbolForFeature(feature){
return STAGE_SYMBOL
}
if(feature.properties["village"]){
return VILLAGE_SYMBOL
}
if(feature.properties["bar"]){
return DRINKS_SYMBOL;
}
@ -507,3 +511,15 @@ export const DRINKS_SYMBOL = new MapSymbol()
"maté"
]
}
export const VILLAGE_SYMBOL = new MapSymbol()
{
VILLAGE_SYMBOL.genericName = "Installation permanente"
VILLAGE_SYMBOL.markerUrl = new URL("../icons/default-marker.svg", import.meta.url)
VILLAGE_SYMBOL.backgroundColor = "white"
VILLAGE_SYMBOL.borderColor = "white"
VILLAGE_SYMBOL.indexSynonyms = [
"village",
"installation"
]
}