Leaflet Géoportail Ext : couches WMTS en Lambert 93

Utilisation de L.GeoportalLayer.WMTS en Lambert 93

by Géoportail IGNF

HTML

<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css">
<script src="https://ignf.github.io/geoportal-extensions/leaflet-latest/dist/GpPluginLeaflet.js"></script>
<link rel="stylesheet" href="https://ignf.github.io/geoportal-extensions/leaflet-latest/dist/GpPluginLeaflet.css">
<div id="map"></div>

CSS

#map {
    max-width: 787px; height:767px; margin: auto;
}

#info {
    padding: 5px;
    width: 100%;
    height: 20px;
    font-family: monospace;
}

JavaScript

function go() {
    var map = L.map('map', {
        crs: L.geoportalCRS.EPSG2154,
    }).setView([45.7481787494123, 4.725191295146942], 18);
    var lyr = L.geoportalLayer.WMTS({
        layer: "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2.L93"
    },
    {
    	format:"image/png"
    });
    lyr.addTo(map); // ou map.addLayer(lyr);
}

Gp.Services.getConfig({
    apiKey: "lambert93",
    onSuccess: go
});