diff --git a/src/js/index.js b/src/js/index.js index d40b95c0..f9c1f2da 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -87,14 +87,14 @@ function app() { Globals.position.compute({ lngLat: center }).then(() => { Globals.menu.open("position"); }); + if (Globals.searchResultMarker != null) { + Globals.searchResultMarker.remove(); + Globals.searchResultMarker = null; + } + Globals.searchResultMarker = new maplibregl.Marker({element: Globals.searchResultIcon, anchor: "bottom"}) + .setLngLat(center) + .addTo(map); } - if (Globals.searchResultMarker != null) { - Globals.searchResultMarker.remove(); - Globals.searchResultMarker = null; - } - Globals.searchResultMarker = new maplibregl.Marker({element: Globals.searchResultIcon, anchor: "bottom"}) - .setLngLat(center) - .addTo(map); map.once("moveend", () => { StatusPopups.getNetworkPopup(map); StatusPopups.getEditoPopup(map); diff --git a/src/js/my-account/my-account.js b/src/js/my-account/my-account.js index e7bef7bb..9239ea5d 100644 --- a/src/js/my-account/my-account.js +++ b/src/js/my-account/my-account.js @@ -985,7 +985,7 @@ https://cartes-ign.ign.fr?lng=${landmark.geometry.coordinates[0]}&lat=${landmark */ shareCompareLandmark(compareLandmark) { let props = compareLandmark.properties; - let url = encodeURI(`https://cartes-ign.ign.fr?lng=${compareLandmark.geometry.coordinates[0]}&lat=${compareLandmark.geometry.coordinates[1]}&z=${props.zoom}&l1=${props.layer1}&l2=${props.layer2}&m=${props.mode}&title=${props.accroche}&text=${props.text}&color=${props.color}`.replace(/ /g, "%20")); + let url = encodeURI(`https://cartes-ign.ign.fr?lng=${compareLandmark.geometry.coordinates[0]}&lat=${compareLandmark.geometry.coordinates[1]}&z=${props.zoom}&l1=${props.layer1}&l2=${props.layer2}&m=${props.mode}&title=${props.accroche}&text=${props.text}&color=${props.color}`).replace(/ /g, "%20"); Share.share({ title: `${props.accroche}`, text: `${props.accroche}