OptionaloverlayDraws the shading as an overlay of this basemap: just above the basemap's layer when it is
an image (tiles, WMS, WMTS), inside the style when it is vector — see beforeLayer.
Without it, a hillshade block on a basemap that is not of type: "hillshade" is
ignored. Ignored on type: "hillshade", whose shading is the basemap itself.
The overlay reads a raster-dem source of its own, apart from the one of terrain: with
both on one basemap the same demUrl is requested twice, for a shading one zoom level
finer. Default: false.
OptionalonlyOverlay only: the shading is shown only while a 3D terrain is on the map, and hidden the
rest of the time. Hidden, it requests no elevation tile. With a terrain block whose
activation is "pitch", a flat map then stays exactly what it is without either block.
A basemap that declares it without a terrain block never shows its overlay. Without
it the overlay is always drawn, flat map included. Ignored without overlay.
Default: false.
OptionalbeforeVector basemap only: id of the layer of the basemap's style the overlay is inserted before — typically its first water or road layer, so that the shading covers the land fills and stays under water, roads and labels.
Absent, or naming a layer the style does not have (a warning is then logged): the overlay
goes before the first symbol layer of the style, which keeps the labels readable but
shades whatever is drawn under them, water and roads included.
DEM tile URL template. Required. E.g. "https://tiles.example.com/{z}/{x}/{y}.png".
OptionaldemTile encoding format for the DEM source. Default: "terrarium".
OptionaldemMaximum zoom level available for DEM tiles. Default: 15.
OptionalshadowHillshade shadow color (CSS color string). Default: MapLibre default.
OptionalhighlightHillshade highlight color (CSS color string). Default: MapLibre default.
OptionalaccentHillshade accent color (CSS color string). Default: MapLibre default.
OptionalexaggerationVertical exaggeration intensity (0–1). Default: MapLibre default (0.5).
OptionalilluminationSun illumination direction in degrees clockwise from north. Default: 335.
OptionalilluminationWhether illumination is relative to the viewport or fixed to the map. Default: "viewport".
Relief shading (hillshade) of a basemap: a
raster-demsource drawn by a MapLibrehillshaderender layer.Read in two ways. On a basemap of
type: "hillshade"the shading IS the basemap. On a basemap of any other type it is read only whenoverlayis true, and is then drawn OVER that basemap, which stays what it is.