SDK JS
    Preparing search index...

    Interface SetTimeOfDayOptions

    Options for setTimeOfDay. Only map is required; everything else has a default.

    interface SetTimeOfDayOptions {
        basemapLayerId?: string;
        date?: Date;
        enabled?: boolean;
        gradeGround?: boolean;
        hillshadeLayerId?: string;
        layers?: SunLightable[];
        location?: LocationOption;
        map: Map$1;
        shadows?: boolean;
        syncMapLibreLight?: boolean;
    }
    Index

    Properties

    basemapLayerId?: string

    Id of a MapLibre raster basemap layer (satellite/aerial imagery) to dim with the sun, so the ground darkens at night in step with the geometry (optional).

    date?: Date

    Instant to render (a Date, interpreted in UTC for solar math). Default: SOLAR NOON today at the resolved location — the one time of day that lights any scene on Earth. Pass a date to pin a specific instant.

    enabled?: boolean

    Start with the geo-sun system enabled. When false, the map keeps its default light/sky and the layers their baseline look until setEnabled(true). Default true.

    gradeGround?: boolean

    Darken the whole map SURFACE with the sun — the basemap and, because MapLibre drapes 2D layers onto the terrain mesh, the terrain with it. Default false.

    basemapLayerId grades one RASTER layer via raster-brightness-max, which covers a satellite basemap and nothing else: a vector style is dozens of fill/line/symbol layers with no brightness property between them. On such a style the ground stays at full daylight while the 3D layers darken, and under 3D terrain that reads as the terrain ignoring the time of day.

    This inserts a world-covering fill under the first symbol layer (labels stay legible) whose opacity follows the sun. Works on any style. Additive to basemapLayerId — on raster imagery, grading the imagery itself looks better, and both can run together.

    hillshadeLayerId?: string

    Id of a MapLibre hillshade layer to drive from the sun, so terrain relief shades with the scene (optional).

    layers?: SunLightable[]

    Bitruvius 3D layers to relight — anything implementing SunLightable (mesh / point-cloud / splat layers). More can be added later with Atmosphere.addLayer.

    location?: LocationOption

    Where to evaluate the sun; see LocationOption. Default 'map-center'.

    map: Map$1

    The MapLibre map to drive. You own its lifecycle; call setTimeOfDay after the map's load event so the style is ready for setLight / setSky.

    shadows?: boolean

    Drive real cast shadows on the supplied layers (Phase 2). Default false.

    syncMapLibreLight?: boolean

    Drive map.setLight + map.setSky from the sun (the "visual sync" that lights the basemap and fill-extrusions). Default true.