Light

The global light source.

Check the online documentation.

Constructors

Light
Link copied to clipboard
fun Light()

Types

Companion
Link copied to clipboard
object Companion

Static variables and methods.

Functions

anchor
Link copied to clipboard
open override fun anchor(anchor: Expression): Light
open override fun anchor(anchor: Anchor): Light

Whether extruded geometries are lit relative to the map or viewport.

bindTo
Link copied to clipboard
open override fun bindTo(delegate: StyleInterface)

Bind the light to the map controller.

castShadows
Link copied to clipboard
open override fun castShadows(castShadows: Expression): Light
open override fun castShadows(castShadows: Boolean): Light

Enable/Disable shadow casting for this light

color
Link copied to clipboard
open override fun color(color: Expression): Light
open override fun color(@ColorInt color: Int): Light
open override fun color(color: String): Light

Color tint for lighting extruded geometries.

colorTransition
Link copied to clipboard
open override fun colorTransition(options: StyleTransition): Light

Set the Color property transition options.

open override fun colorTransition(block: StyleTransition.Builder.() -> Unit): Light
intensity
Link copied to clipboard
open override fun intensity(intensity: Expression): Light
open override fun intensity(intensity: Double): Light

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

intensityTransition
Link copied to clipboard
open override fun intensityTransition(options: StyleTransition): Light

Set the Intensity property transition options.

open override fun intensityTransition(block: StyleTransition.Builder.() -> Unit): Light
position
Link copied to clipboard
open override fun position(position: Expression): Light
open override fun position(position: LightPosition): Light
open override fun position(radialCoordinate: Double, azimuthalAngle: Double, polarAngle: Double): Light

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 degree (0 degree when light.anchor is set to viewport corresponds to the top of the viewport, or 0 degree when light.anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0 degree, directly above, to 180 degree, directly below).

positionTransition
Link copied to clipboard
open override fun positionTransition(options: StyleTransition): Light

Set the Position property transition options.

open override fun positionTransition(block: StyleTransition.Builder.() -> Unit): Light
shadowIntensity
Link copied to clipboard
open override fun shadowIntensity(shadowIntensity: Expression): Light
open override fun shadowIntensity(shadowIntensity: Double): Light

Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces almost black.

shadowIntensityTransition
Link copied to clipboard
open override fun shadowIntensityTransition(options: StyleTransition): Light

Set the ShadowIntensity property transition options.

open override fun shadowIntensityTransition(block: StyleTransition.Builder.() -> Unit): Light

Properties

anchor
Link copied to clipboard
val anchor: Anchor?

Whether extruded geometries are lit relative to the map or viewport.

anchorAsExpression
Link copied to clipboard
val anchorAsExpression: Expression?

Whether extruded geometries are lit relative to the map or viewport.

castShadows
Link copied to clipboard
val castShadows: Boolean?

Enable/Disable shadow casting for this light

castShadowsAsExpression
Link copied to clipboard
val castShadowsAsExpression: Expression?

Enable/Disable shadow casting for this light

color
Link copied to clipboard
val color: String?

Color tint for lighting extruded geometries.

colorAsColorInt
Link copied to clipboard
val colorAsColorInt: Int?

Color tint for lighting extruded geometries.

colorAsExpression
Link copied to clipboard
val colorAsExpression: Expression?

Color tint for lighting extruded geometries.

colorTransition
Link copied to clipboard
val colorTransition: StyleTransition?

Color property transition options.

intensity
Link copied to clipboard
val intensity: Double?

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

intensityAsExpression
Link copied to clipboard
val intensityAsExpression: Expression?

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

intensityTransition
Link copied to clipboard
val intensityTransition: StyleTransition?

Intensity property transition options.

position
Link copied to clipboard
val position: LightPosition?

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 degree (0 degree when light.anchor is set to viewport corresponds to the top of the viewport, or 0 degree when light.anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0 degree, directly above, to 180 degree, directly below).

positionAsExpression
Link copied to clipboard
val positionAsExpression: Expression?

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 degree (0 degree when light.anchor is set to viewport corresponds to the top of the viewport, or 0 degree when light.anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0 degree, directly above, to 180 degree, directly below).

positionTransition
Link copied to clipboard
val positionTransition: StyleTransition?

Position property transition options.

shadowIntensity
Link copied to clipboard
val shadowIntensity: Double?

Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces almost black.

shadowIntensityAsExpression
Link copied to clipboard
val shadowIntensityAsExpression: Expression?

Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces almost black.

shadowIntensityTransition
Link copied to clipboard
val shadowIntensityTransition: StyleTransition?

ShadowIntensity property transition options.