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
| const resolutions = []
const matrixIds = []
const proj3857 = getProjection("EPSG:3857")
const maxResolution = getWidth(proj3857.getExtent()) / 256
for (let i = 0; i < 20; i++) {
matrixIds[i] = i.toString()
resolutions[i] = maxResolution / Math.pow(2, i)
}
const parcellaireSource = new WMTS({
url: "https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities",
layer: "CADASTRALPARCELS.PARCELLAIRE_EXPRESS",
matrixSet: "PM",
format: "image/png",
projection: "EPSG:3857",
matrixSet: "PM",
tileGrid: new WMTSTileGrid({
origin: [-20037508, 20037508],
resolutions: resolutions,
matrixIds: matrixIds,
}),
style: "normal",
})
const parcellaireWMTSCouche = new TileLayer({
title: "parcellaire",
source: parcellaireSource,
})
map.addLayer(parcellaireWMTSCouche) |
Partager