SDK JS
    Preparing search index...

    A SunConsumer that drives a MapLibre hillshade layer's illumination from the sun, so terrain relief shades in step with the rest of the scene. illumination-anchor: 'map' makes the direction a geographic bearing, matching the sun's compass azimuth. Wired by setTimeOfDay when you pass hillshadeLayerId.

    import { GeoSunSystem, HillshadeController } from '@bitruvius/sdk-maplibre';

    // The one-call route is setTimeOfDay({ map, hillshadeLayerId: 'hills' }); by hand:
    map.on('load', () => {
    const system = new GeoSunSystem(map, {
    controllers: [new HillshadeController(map, 'hills')],
    });
    system.update(new Date()); // relief shades from this instant's sun
    });

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • map: Map$1

        The MapLibre map to drive.

      • layerId: string

        Id of the hillshade layer in the map's style.

      Returns HillshadeController

    Methods

    • Set the hillshade layer's illumination direction + altitude from the sun. No-op if the layer is not present yet.

      Parameters

      Returns void