From 72c7a5159423b88413ef36d3faa87d0c54f5bab1 Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Wed, 10 Jun 2026 01:10:04 +0200 Subject: [PATCH 1/4] Set max zoom according to map center --- js/map.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/js/map.js b/js/map.js index 439048d..960939f 100644 --- a/js/map.js +++ b/js/map.js @@ -49,10 +49,10 @@ export async function init(){ // Polygone définissant les limites de la carte fetch("./couches/emprise.geojson").then(res => res.json()).then(geojson => { let coordinate_list = geojson.features[0].geometry.coordinates[0] - let first_point = map.project(L.latLng([...coordinate_list[0]].reverse())) - let bounds = L.bounds(first_point, first_point) + let first_point = L.latLng([...coordinate_list[0]].reverse()) + let bounds = L.latLngBounds(first_point, first_point) for(let i = 1; i { + if(map_bounds.contains(map.getCenter())){ + map.setMaxZoom(21) + } else { + map.setMaxZoom(18) + } + }) + // La couche Openstreetmap standard L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' @@ -84,7 +92,7 @@ export async function init(){ ).addTo(map) // Parametrage de la carte initiale - map.setMaxBounds(map_bounds) + //map.setMaxBounds(map_bounds) map.setView(map_center, 19, { animate: false, }) From 9e22e38b8f19762b64280554eb643711452daaad Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Wed, 10 Jun 2026 01:12:30 +0200 Subject: [PATCH 2/4] Meilleur gestion du markeur du camp interhack --- css/style.css | 2 +- js/map.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/css/style.css b/css/style.css index 7f6fd9c..2d4d335 100644 --- a/css/style.css +++ b/css/style.css @@ -127,7 +127,7 @@ body > hr { width: min(50vw, 200px); transform: translateX(-50%) translateY(-50%); filter: drop-shadow(0 0 10px black); - opacity: clamp(0, calc( 1 - ( var(--zoom-level) - 18 ) ), 1) ; + opacity: clamp(0, calc( 1 - ( var(--zoom-level) - 12 ) ), 1) ; pointer-events: none; } diff --git a/js/map.js b/js/map.js index 960939f..57fd8e6 100644 --- a/js/map.js +++ b/js/map.js @@ -87,7 +87,6 @@ export async function init(){ className: "center-marker" }), title: "Camp Interhack 2026", - minZoom: 18, } ).addTo(map) From 0cbe9a80ecd3bd81f0950b9d228e0a10d38eda9b Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Wed, 10 Jun 2026 01:23:28 +0200 Subject: [PATCH 3/4] Amelioration de la legende --- css/style.css | 4 ++++ js/components/feature-legend.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 2d4d335..4fad220 100644 --- a/css/style.css +++ b/css/style.css @@ -131,6 +131,10 @@ body > hr { pointer-events: none; } +#map .map-hilight-area:not(.active) { + opacity: 0; +} + /* SAERCH FORM */ #search-section { diff --git a/js/components/feature-legend.js b/js/components/feature-legend.js index 03ddb78..8967d62 100644 --- a/js/components/feature-legend.js +++ b/js/components/feature-legend.js @@ -17,6 +17,8 @@ TEMPLATE.innerHTML = ` justify-content: center; align-items: center; + background-color: color-mix(in srgb, var(--background-color, transparent), transparent 50%); + box-sizing: border-box; border: solid 1px transparent; } @@ -56,7 +58,7 @@ export class FeatureLegendElement extends HTMLElement { container.hidden = !this.feature if(this.feature){ let symbol = this.feature.mapSymbol - container.style.backgroundColor = symbol.backgroundColor || "transparent" + container.style.setProperty("--background-color", symbol.backgroundColor || "transparent"); container.style.backgroundImage = symbol.backgroundUrl ? `url(${symbol.backgroundUrl})` : "none" container.style.borderColor = symbol.borderColor || "transparent" if(symbol.markerUrl){ From f06c445264dadaa0e5ffd57a0010b5c5840017a4 Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Wed, 10 Jun 2026 01:23:46 +0200 Subject: [PATCH 4/4] Desactivation de l;autocmpletion sur la recherche --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7163235..6c88e83 100644 --- a/index.html +++ b/index.html @@ -20,8 +20,8 @@

- -