@versatiles/style
    Preparing search index...

    Type Alias LightOptions

    LightOptions:
        | boolean
        | {
            altitude?: number;
            color?: string;
            direction?: number;
            fixedToScreen?: boolean;
            intensity?: number;
        }

    The one light of the map: it shades the terrain (features.hillshade), lights 3D buildings (features.buildings: 'extruded') and, on a globe, decides which side of the atmosphere glows (sky.atmosphereBlend). Set once, all three are lit from the same side. features.terrain alone is not shaded: MapLibre never lights the 3D terrain surface, so only the hillshade shows the light.

    On by default: unset or true uses the defaults below, an object overrides individual values. false writes no light, and hillshade and buildings fall back to MapLibre's own lights, which disagree. The style's root light is written only where 3D buildings or a visible atmosphere read it; the hillshade carries the light in its own paint properties.

    Type Declaration

    • boolean
    • {
          altitude?: number;
          color?: string;
          direction?: number;
          fixedToScreen?: boolean;
          intensity?: number;
      }
      • Optionalaltitude?: number

        The light's height above the horizon, in degrees, 0–90. Default 45. A low light deepens the hillshade's shadows, a high one flattens the relief. With features.hillshade, light switches the hillshade to MapLibre's combined method, the one that takes the altitude.

      • Optionalcolor?: string

        The light's colour, on 3D buildings only. Default #ffffff.

      • Optionaldirection?: number

        Where the light comes from, in degrees clockwise: 0 = north, 90 = east (with fixedToScreen: 0 = top, 90 = right). Default 315, the north-west — the top left while the map points north, the cartographic convention, under which relief never reads inverted. Any angle is accepted and wrapped: -45 is 315.

      • OptionalfixedToScreen?: boolean

        Whether the light is fixed to the screen. Default false: the light turns with the map, so rotating the map leaves the shading as it is. true keeps direction on screen however the map is rotated, but MapLibre then relights the hillshade on every frame of a rotation, which is slow. The globe's atmosphere (sky.atmosphereBlend > 0) is always fixed to the screen; it glows from direction on screen, which matches the terrain while the map points north.

      • Optionalintensity?: number

        The light's intensity on 3D buildings, 0–1. Default 0.5.