From ebcc2a017f9645f04c4f6345593ad8373bf5d3f2 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Sun, 4 Feb 2024 03:43:00 +0100 Subject: [PATCH] Show zones in campground map by default if requested by query parameters This is to be able to link from the booking form, with a link under the area preferences, and show the zones layer, that is what customers most certainly want to see at that point. --- web/static/map.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/static/map.js b/web/static/map.js index 6ef4996..cf5a2ed 100644 --- a/web/static/map.js +++ b/web/static/map.js @@ -205,4 +205,9 @@ .addOverlay(zonesOverlay, zones.getAttribute('aria-label')) .addTo(map) ; + + const params = new URLSearchParams(window.location.search); + if (params.has('zones')) { + map.addLayer(zonesOverlay); + } })();