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 60 61
| /*************** variable WMTS ***************/
var resolutions = [156543.03392804103, 78271.5169640205, 39135.75848201024, 19567.879241005125, 9783.939620502562, 4891.969810251281, 2445.9849051256406, 1222.9924525628203, 611.4962262814101, 305.74811314070485, 152.87405657035254, 76.43702828517625, 38.218514142588134, 19.109257071294063, 9.554628535647034, 4.777314267823517, 2.3886571339117584, 1.1943285669558792, 0.5971642834779396, 0.29858214173896974, 0.14929107086948493, 0.07464553543474241];
var matrixIds = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"];
/*************** variable WMTS fin ***************/
/************************* Définition des cartes *************************/
const osmlayer = new ol.layer.Tile({
source: new ol.source.OSM()
})
if (osmlayer) layers.push(osmlayer);
const ignphotoaerienne = new ol.layer.Tile({
source : new ol.source.WMTS({
url: "https://wxs.ign.fr/essentiels/geoportail/wmts",
layer: "ORTHOIMAGERY.ORTHOPHOTOS",
matrixSet: "PM",
format: "image/jpeg",
style: "normal",
tileGrid : new ol.tilegrid.WMTS({
origin: [-20037508,20037508], // topLeftCorner
resolutions: resolutions, // résolutions
matrixIds: matrixIds // ids des TileMatrix
})
}),
opacity: 0.7
})
if (ignphotoaerienne) layers.push(ignphotoaerienne);
//Problème avec cette couche ci-dessous
const adlayer = new ol.layer.Tile({
source : new ol.source.TileWMS({
url: "https://wxs.ign.fr/inspire/inspire/v/wms",
layer: "AD.Address",
})
})
if (adlayer) layers.push(adlayer);
var map = new ol.Map({
layers: layers,
target: "map",
view: new ol.View({
center: ol.proj.fromLonLat([5.717932, 45.195689]),
zoom: 17,
minZoom: 3,
maxZoom: 22
})
});
/************************* Définitions des cartes Fin *************************/
/************************* ol.Map *************************/
var map = new ol.Map({
layers: layers,
target: "map",
view: new ol.View({
center: ol.proj.fromLonLat([5.717932, 45.195689]),
zoom: 17,
minZoom: 3,
maxZoom: 22
})
});
/************************* ol.map Fin *************************/ |
Partager