SDK JS
    Preparing search index...

    A SunConsumer that grades a MapLibre raster basemap (satellite / aerial imagery) with the sun, so the ground darkens at night and never stays daylight-bright under a night sky. Without this the basemap is the one un-lit surface in the scene — buildings, point clouds and splats all grade via SunState.gradeLinear, but raster imagery is drawn by MapLibre and can only be touched through its raster-* paint properties. Drives raster-brightness-max from the same gradeLinear the geometry uses (so the ground and the buildings dim together) and eases in desaturation at deep night for a cooler, moon-lit read. Wired by setTimeOfDay when you pass basemapLayerId.

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

    // The one-call route is setTimeOfDay({ map, basemapLayerId: 'satellite' }); by hand:
    map.on('load', () => {
    const system = new GeoSunSystem(map, {
    controllers: [new BasemapController(map, 'satellite')],
    });
    system.update(new Date()); // grade the imagery for this instant
    // system.dispose() puts the layer's original brightness + saturation back
    });

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • map: Map$1

        The MapLibre map to drive.

      • layerId: string

        Id of the raster basemap layer in the map's style.

      Returns BasemapController

    Methods

    • Restore the basemap layer's original brightness + saturation (best-effort; no-op if the layer or style is gone).

      Returns void