1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| window.addEventListener("load", function() {
var createMap = function() {
var map = L.map("map", {
gestureHandling: true,
attributionControl: false
})
.setView([44.18951367, 0.59667445], 18);
var lyrOrtho = L.geoportalLayer.WMTS({
layer: "ORTHOIMAGERY.ORTHOPHOTOS",
});
var lyrMaps = L.geoportalLayer.WMTS({
layer: "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2",
}, {
opacity: 0.5
});
var lyrCadastre = L.geoportalLayer.WMTS({
layer: "CADASTRALPARCELS.PARCELLAIRE_EXPRESS"
}, {
opacity: 0.5
});
var layerOptions = {
layers: [{
layer: lyrMaps,
config: {
visibility: false
}
},
{
layer: lyrCadastre,
config: {
visibility: false
}
}
]
}
map.addLayer(lyrOrtho);
map.addLayer(lyrMaps);
map.addLayer(lyrCadastre);
var layerSwitcher = L.geoportalControl.LayerSwitcher(layerOptions);
map.addControl(layerSwitcher);
map.addControl(new L.Control.Fullscreen());
L.control.scale({
imperial: false
}).addTo(map);
var geocoder = L.geocoderBAN().addTo(map);
L.marker([44.18951367, 0.59667445], {
title: " "
}).addTo(map).bindPopup("<h3> <\/h3>");
};
Gp.Services.getConfig({
apiKey: "essentiels,ortho,cartes,administratif,decouverte",
onSuccess: createMap,
onFailure: function(e) {
console.error(e);
}
});
}); |
Partager