GeoLeaf Core API - v3.19.0
    Preparing search index...

    Relief shading (hillshade) of a basemap: a raster-dem source drawn by a MapLibre hillshade render 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 when overlay is true, and is then drawn OVER that basemap, which stays what it is.

    interface HillshadeConfig {
        overlay?: boolean;
        onlyWithTerrain?: boolean;
        beforeLayer?: string;
        demUrl: string;
        demEncoding?: "terrarium" | "mapbox";
        demMaxZoom?: number;
        shadowColor?: string;
        highlightColor?: string;
        accentColor?: string;
        exaggeration?: number;
        illuminationDirection?: number;
        illuminationAnchor?: "map" | "viewport";
    }
    Index
    overlay?: boolean

    Draws 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.

    onlyWithTerrain?: boolean

    Overlay 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.

    beforeLayer?: string

    Vector 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.

    demUrl: string

    DEM tile URL template. Required. E.g. "https://tiles.example.com/{z}/{x}/{y}.png".

    demEncoding?: "terrarium" | "mapbox"

    Tile encoding format for the DEM source. Default: "terrarium".

    demMaxZoom?: number

    Maximum zoom level available for DEM tiles. Default: 15.

    shadowColor?: string

    Hillshade shadow color (CSS color string). Default: MapLibre default.

    highlightColor?: string

    Hillshade highlight color (CSS color string). Default: MapLibre default.

    accentColor?: string

    Hillshade accent color (CSS color string). Default: MapLibre default.

    exaggeration?: number

    Vertical exaggeration intensity (0–1). Default: MapLibre default (0.5).

    illuminationDirection?: number

    Sun illumination direction in degrees clockwise from north. Default: 335.

    illuminationAnchor?: "map" | "viewport"

    Whether illumination is relative to the viewport or fixed to the map. Default: "viewport".