From 500a51b1fc659690e773288bc3e8ce0c59f85d91 Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Fri, 3 Jul 2026 15:33:22 +0200 Subject: [PATCH] Amelioration de l'affichage des points --- css/style.css | 8 ++++++++ js/map.js | 8 +++++++- js/symbols.js | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 63b8494..4cab853 100644 --- a/css/style.css +++ b/css/style.css @@ -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; diff --git a/js/map.js b/js/map.js index c59032c..a6afaac 100644 --- a/js/map.js +++ b/js/map.js @@ -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] }) diff --git a/js/symbols.js b/js/symbols.js index bdcb816..3499815 100644 --- a/js/symbols.js +++ b/js/symbols.js @@ -76,6 +76,10 @@ function getBaseSymbolForFeature(feature){ return STAGE_SYMBOL } + if(feature.properties["village"]){ + return VILLAGE_SYMBOL + } + if(feature.properties["bar"]){ return DRINKS_SYMBOL; } @@ -506,4 +510,16 @@ export const DRINKS_SYMBOL = new MapSymbol() "kefir", "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" + ] } \ No newline at end of file