SDK JS
    Preparing search index...

    A SunConsumer that drives MapLibre's sky/fog tint (map.setSky) from the sun altitude — sky dome, horizon, warm fog at golden hour, and the globe atmosphere halo fading out at night. Purely visual (MapLibre's sky has no real sun disk), derived from the same SunState as everything else. Created for you by setTimeOfDay.

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

    // setTimeOfDay({ map }) wires this for you; by hand, after the style is up:
    map.on('load', () => {
    const system = new GeoSunSystem(map, { controllers: [new SkyController(map)] });
    system.update(new Date()); // paints the sky/fog for this instant
    });

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Apply the sky/fog tint for the current sun altitude (via skyForAltitude).

      Parameters

      Returns void

      Propagates from map.setSky if the map's style is not ready — call after the map's load event (the setTimeOfDay facade wires this for you).