LightOptions interface

The options for the map's lighting.

Extends

Properties

anchor

Specifies wether extruded geometries are lit relative to the map or viewport. Supported values:

`"map"`: The position of the light source is aligned to the rotation of the map.

`"viewport"`: The position fo the light source is aligned to the rotation of the viewport.

Default: `"map"`
color

Color tint for lighting extruded geometries Default: "#FFFFFF"

intensity

Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast. Default 0.5

position

Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when anchor is set to viewport corresponds to the top of the viewport, or 0° when anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).

Property Details

anchor

Specifies wether extruded geometries are lit relative to the map or viewport. Supported values:

`"map"`: The position of the light source is aligned to the rotation of the map.

`"viewport"`: The position fo the light source is aligned to the rotation of the viewport.

Default: `"map"`
anchor?: "map" | "viewport"

Property Value

"map" | "viewport"

color

Color tint for lighting extruded geometries Default: "#FFFFFF"

color?: string | Expression

Property Value

string | Expression

intensity

Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast. Default 0.5

intensity?: number | Expression

Property Value

number | Expression

position

Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when anchor is set to viewport corresponds to the top of the viewport, or 0° when anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).

position?: Object | Expression

Property Value

Object | Expression