diff --git a/src/js/event-listeners.js b/src/js/event-listeners.js index 69d96d9f..36e21258 100644 --- a/src/js/event-listeners.js +++ b/src/js/event-listeners.js @@ -302,9 +302,9 @@ function addListeners() { coordinates: [center.lng, center.lat], }, properties: { - accroche: urlParams.get("title"), - theme: urlParams.get("title"), - text: urlParams.get("text"), + accroche: urlParams.get("title").replace(/%20/g, " "), + theme: urlParams.get("title").replace(/%20/g, " "), + text: urlParams.get("text").replace(/%20/g, " "), zoom: zoom, color: urlParams.get("color"), icon: `compare-landmark-${urlParams.get("color")}`, diff --git a/src/js/index.js b/src/js/index.js index 493d006a..d40b95c0 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -83,9 +83,11 @@ function app() { const center = { lng: parseFloat(urlParams.get("lng")), lat: parseFloat(urlParams.get("lat")) }; map.setCenter(center); map.setZoom(parseFloat(urlParams.get("z")) || map.getZoom()); - Globals.position.compute({ lngLat: center }).then(() => { - Globals.menu.open("position"); - }); + if (!(urlParams.get("l1") && urlParams.get("l2") && urlParams.get("m") && urlParams.get("title") && urlParams.get("text") && urlParams.get("color"))) { + Globals.position.compute({ lngLat: center }).then(() => { + Globals.menu.open("position"); + }); + } if (Globals.searchResultMarker != null) { Globals.searchResultMarker.remove(); Globals.searchResultMarker = null; diff --git a/src/js/map-interactivity/interactivity-indicator.js b/src/js/map-interactivity/interactivity-indicator.js index 73c21888..bac3d0e2 100644 --- a/src/js/map-interactivity/interactivity-indicator.js +++ b/src/js/map-interactivity/interactivity-indicator.js @@ -151,7 +151,6 @@ class InteractivityIndicator { clearTimeout(this.timeoutID1); clearTimeout(this.timeoutID2); clearTimeout(this.timeoutID3); - console.log("coucou"); this.timeoutID1 = setTimeout(() => { DOM.$interactivityBtn.classList.add("backgroundGreen"); DOM.$interactivityBtn.classList.add("widthOn"); diff --git a/src/js/my-account/my-account.js b/src/js/my-account/my-account.js index 8a52d5ea..e7bef7bb 100644 --- a/src/js/my-account/my-account.js +++ b/src/js/my-account/my-account.js @@ -235,7 +235,13 @@ class MyAccount { if (DOM.$fullScreenBtn.querySelector("button").classList.contains("maplibregl-ctrl-shrink")) { return; } - const landmark = this.map.queryRenderedFeatures(e.point, {layers: [MyAccountLayers["landmark-casing"].id]})[0]; + const landmarkMap = this.map.queryRenderedFeatures(e.point, {layers: [MyAccountLayers["landmark-casing"].id]})[0]; + const landmark = { + type: "Feature", + id: landmarkMap.id, + geometry: landmarkMap.geometry, + properties: landmarkMap.properties, + }; const title = `