Browse Source

Ajoute quelques liens vers d'autres cartes

master
vincent 2 weeks ago
parent
commit
d82efd9ef7
2 changed files with 18 additions and 0 deletions
  1. +15
    -0
      assets/controllers/map_controller.js
  2. +3
    -0
      templates/macro.html.twig

+ 15
- 0
assets/controllers/map_controller.js View File

@ -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');
}
}

+ 3
- 0
templates/macro.html.twig View File

@ -56,8 +56,11 @@ Où :
Voir sur
<button class="btn btn-sm btn-link" data-action="map#openInOsm">OSM</button>
<button class="btn btn-sm btn-link" data-action="map#openInPanoramax">Panoramax</button>
<button class="btn btn-sm btn-link" data-action="map#openInGeohack">GeoHack</button>
<button class="btn btn-sm btn-link" data-action="map#openInGeoportail">GéoPortail</button>
<button class="btn btn-sm btn-link ça-pue-c’est-pas-libre" data-action="map#openInMapillary">Mapillary</button>
<button class="btn btn-sm btn-link ça-pue-c’est-pas-libre" data-action="map#openInGoogleMaps">Google Maps</button>
<button class="btn btn-sm btn-link ça-pue-c’est-pas-libre" data-action="map#openInBing">Bing</button>
</p>
</div>
{% endmacro %}


Loading…
Cancel
Save