From d82efd9ef7775c970d10c5c006606d2db4e74a7b Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 22 Nov 2024 16:34:14 +0100 Subject: [PATCH] Ajoute quelques liens vers d'autres cartes --- assets/controllers/map_controller.js | 15 +++++++++++++++ templates/macro.html.twig | 3 +++ 2 files changed, 18 insertions(+) diff --git a/assets/controllers/map_controller.js b/assets/controllers/map_controller.js index 3645a50..4ca17f1 100644 --- a/assets/controllers/map_controller.js +++ b/assets/controllers/map_controller.js @@ -170,6 +170,16 @@ export default class extends Controller { window.open(url, '_blank'); } + openInGeohack() { + const url = "https://geohack.toolforge.org/geohack.php?params="+this.mapInstance.getCenter().lat+"_N_"+this.mapInstance.getCenter().lng+"_E"; + window.open(url, '_blank'); + } + + openInGeoportail() { + const url = "https://www.geoportail.gouv.fr/carte?c="+this.mapInstance.getCenter().lng+","+this.mapInstance.getCenter().lat+"&z="+this.mapInstance.getZoom()+"&permalink=yes"; + window.open(url, '_blank'); + } + openInMapillary() { const url = "https://www.mapillary.com/app/?lat="+this.mapInstance.getCenter().lat+"&lng="+this.mapInstance.getCenter().lng+"&z="+this.mapInstance.getZoom(); window.open(url, '_blank'); @@ -180,4 +190,9 @@ export default class extends Controller { window.open(url, '_blank'); } + openInBing() { + const url = "https://www.bing.com/maps/?cp="+this.mapInstance.getCenter().lat+"%7E"+this.mapInstance.getCenter().lng+"&lvl="+this.mapInstance.getZoom(); + window.open(url, '_blank'); + } + } diff --git a/templates/macro.html.twig b/templates/macro.html.twig index 9645d0f..abd6969 100644 --- a/templates/macro.html.twig +++ b/templates/macro.html.twig @@ -56,8 +56,11 @@ Où : Voir sur + + +

{% endmacro %}