// Déclarer la carte var map = L.map("map", { center: new L.LatLng(48.845, 2.424), zoom: 15 }); // Fonction d'encodage de l'adresse function geopUrl (key, layer, format) { return "http://wxs.ign.fr/"+ key + "/wmts?LAYER=" + layer +"&EXCEPTIONS=text/xml&FORMAT="+(format?format:"image/jpeg") +"&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal" +"&TILEMATRIXSET=PM&TILEMATRIX={z}&TILECOL={x}&TILEROW={y}" ; } // Ajouter la couche "Carte" L.tileLayer ( geopUrl(MA_CLE,"GEOGRAPHICALGRIDSYSTEMS.MAPS"), { attribution:'© IGN-France', maxZoom:18 }).addTo(map); // et une Punaise L.marker([48.84475, 2.4237]).addTo(map) .bindPopup("C'est facile !").openPopup();