Creating an elevation layer is a very similar process to the color layer : we initialize the
source, then create the layer and add it to the map.
The only difference is that we are going to use an
ElevationLayer
.
Contrary to the color layer, the elevation layer does not produce any color information on the
map, but it rather deforms the map to display the terrain (hence the name 2.5D map).
Let’s create a WMS source for this layer.
const demSource = new TiledImageSource({
source: new TileWMS({
url: 'https://data.geopf.fr/wms-r',
projection: 'EPSG:3946',
crossOrigin: 'anonymous',
params: {
LAYERS: ['ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES'],
FORMAT: 'image/x-bil;bits=32',
},
}),
format: new BilFormat(),
noDataValue: -1000,
});