Optionalaltitude?: numberThe 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?: stringThe light's colour, on 3D buildings only. Default #ffffff.
Optionaldirection?: numberWhere 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?: booleanWhether 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?: numberThe light's intensity on 3D buildings, 0–1. Default 0.5.
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.terrainalone is not shaded: MapLibre never lights the 3D terrain surface, so only the hillshade shows the light.On by default: unset or
trueuses the defaults below, an object overrides individual values.falsewrites nolight, and hillshade and buildings fall back to MapLibre's own lights, which disagree. The style's rootlightis written only where 3D buildings or a visible atmosphere read it; the hillshade carries the light in its own paint properties.