ModelLayer

class ModelLayer(val layerId: String, val sourceId: String) : Layer, ModelLayerDsl

A layer to render 3D Models.

Parameters

layerId

the ID of the layer

sourceId

the ID of the source

Constructors

Link copied to clipboard
fun ModelLayer(layerId: String, sourceId: String)

Types

Link copied to clipboard
object Companion

Static variables and methods.

Functions

Link copied to clipboard
fun bindTo(delegate: MapboxStyleManager)

Bind the layer to the Style.

open override fun bindTo(delegate: MapboxStyleManager, position: LayerPosition?)

Bind the layer to the map controller.

Link copied to clipboard
open override fun filter(filter: Expression): ModelLayer

A filter is a property at the layer level that determines which features should be rendered in a style layer.

Link copied to clipboard
open override fun maxZoom(maxZoom: Double): ModelLayer

The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.

Link copied to clipboard
open override fun minZoom(minZoom: Double): ModelLayer

The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.

Link copied to clipboard
open override fun modelAmbientOcclusionIntensity(modelAmbientOcclusionIntensity: Expression): ModelLayer
open override fun modelAmbientOcclusionIntensity(modelAmbientOcclusionIntensity: Double): ModelLayer

Intensity of the ambient occlusion if present in the 3D model. Default value: 1. Value range: 0, 1

Link copied to clipboard
Link copied to clipboard
open override fun modelCastShadows(modelCastShadows: Expression): ModelLayer
open override fun modelCastShadows(modelCastShadows: Boolean): ModelLayer

Enable/Disable shadow casting for this layer Default value: true.

Link copied to clipboard
open override fun modelColor(modelColor: Expression): ModelLayer
open override fun modelColor(@ColorInt modelColor: Int): ModelLayer
open override fun modelColor(modelColor: String): ModelLayer

The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Default value: "#ffffff".

Link copied to clipboard
open override fun modelColorMixIntensity(modelColorMixIntensity: Expression): ModelLayer
open override fun modelColorMixIntensity(modelColorMixIntensity: Double): ModelLayer

Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model's colors. Higher number will present a higher model-color contribution in mix. Default value: 0. Value range: 0, 1

Link copied to clipboard

Set the ModelColorMixIntensity property transition options

Link copied to clipboard

Set the ModelColor property transition options

Link copied to clipboard
open override fun modelCutoffFadeRange(modelCutoffFadeRange: Expression): ModelLayer
open override fun modelCutoffFadeRange(modelCutoffFadeRange: Double): ModelLayer

This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled. Default value: 0. Value range: 0, 1

Link copied to clipboard
open override fun modelEmissiveStrength(modelEmissiveStrength: Expression): ModelLayer
open override fun modelEmissiveStrength(modelEmissiveStrength: Double): ModelLayer

Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source. Default value: 0. Value range: 0, 5

Link copied to clipboard

Set the ModelEmissiveStrength property transition options

Link copied to clipboard
open override fun modelFrontCutoff(modelFrontCutoff: Expression): ModelLayer
open override fun modelFrontCutoff(modelFrontCutoff: List<Double>): ModelLayer

An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled. Default value: 0,0,1. Minimum value: 0,0,0. Maximum value: 1,1,1.

open override fun modelHeightBasedEmissiveStrengthMultiplier(modelHeightBasedEmissiveStrengthMultiplier: Expression): ModelLayer
open override fun modelHeightBasedEmissiveStrengthMultiplier(modelHeightBasedEmissiveStrengthMultiplier: List<Double>): ModelLayer

Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)). Default value: 1,1,1,1,0.

Link copied to clipboard
open override fun modelId(modelId: Expression): ModelLayer
open override fun modelId(modelId: String): ModelLayer

Model to render. It can be either a string referencing an element to the models root property or an internal or external URL Default value: "".

Link copied to clipboard
open override fun modelOpacity(modelOpacity: Expression): ModelLayer
open override fun modelOpacity(modelOpacity: Double): ModelLayer

The opacity of the model layer. Default value: 1. Value range: 0, 1

Link copied to clipboard

Set the ModelOpacity property transition options

Link copied to clipboard
open override fun modelReceiveShadows(modelReceiveShadows: Expression): ModelLayer
open override fun modelReceiveShadows(modelReceiveShadows: Boolean): ModelLayer

Enable/Disable shadow receiving for this layer Default value: true.

Link copied to clipboard
open override fun modelRotation(modelRotation: Expression): ModelLayer
open override fun modelRotation(modelRotation: List<Double>): ModelLayer

The rotation of the model in euler angles lon, lat, z. Default value: 0,0,0.

Link copied to clipboard

Set the ModelRotation property transition options

Link copied to clipboard
open override fun modelRoughness(modelRoughness: Expression): ModelLayer
open override fun modelRoughness(modelRoughness: Double): ModelLayer

Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source. Default value: 1. Value range: 0, 1

Link copied to clipboard

Set the ModelRoughness property transition options

Link copied to clipboard
open override fun modelScale(modelScale: Expression): ModelLayer
open override fun modelScale(modelScale: List<Double>): ModelLayer

The scale of the model. Default value: 1,1,1.

Link copied to clipboard
open override fun modelScaleMode(modelScaleMode: Expression): ModelLayer
open override fun modelScaleMode(modelScaleMode: ModelScaleMode): ModelLayer

Defines scaling mode. Only applies to location-indicator type layers. Default value: "map".

Link copied to clipboard

Set the ModelScale property transition options

Link copied to clipboard
open override fun modelTranslation(modelTranslation: Expression): ModelLayer
open override fun modelTranslation(modelTranslation: List<Double>): ModelLayer

The translation of the model in meters in form of longitudal, latitudal, altitude offsets. Default value: 0,0,0.

Link copied to clipboard

Set the ModelTranslation property transition options

Link copied to clipboard
open override fun modelType(modelType: Expression): ModelLayer
open override fun modelType(modelType: ModelType): ModelLayer

Defines rendering behavior of model in respect to other 3D scene objects. Default value: "common-3d".

Link copied to clipboard
open override fun slot(slot: String): ModelLayer

The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.

Link copied to clipboard
open override fun sourceLayer(sourceLayer: String): ModelLayer

A source layer is an individual layer of data within a vector source. A vector source can have multiple source layers.

Link copied to clipboard
open override fun visibility(visibility: Expression): ModelLayer
open override fun visibility(visibility: Visibility): ModelLayer

Whether this layer is displayed.

Properties

Link copied to clipboard

A filter is a property at the layer level that determines which features should be rendered in a style layer.

Link copied to clipboard
open override val layerId: String
Link copied to clipboard
open override val maxZoom: Double?

The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.

Link copied to clipboard
open override val minZoom: Double?

The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.

Link copied to clipboard

Intensity of the ambient occlusion if present in the 3D model. Default value: 1. Value range: 0, 1

Intensity of the ambient occlusion if present in the 3D model. Default value: 1. Value range: 0, 1

Link copied to clipboard

Transition options for ModelAmbientOcclusionIntensity.

Link copied to clipboard

Enable/Disable shadow casting for this layer Default value: true.

Link copied to clipboard

Enable/Disable shadow casting for this layer Default value: true.

Link copied to clipboard

The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Default value: "#ffffff".

Link copied to clipboard

The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Default value: "#ffffff".

Link copied to clipboard

The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Default value: "#ffffff".

Link copied to clipboard

Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model's colors. Higher number will present a higher model-color contribution in mix. Default value: 0. Value range: 0, 1

Link copied to clipboard

Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model's colors. Higher number will present a higher model-color contribution in mix. Default value: 0. Value range: 0, 1

Link copied to clipboard

Transition options for ModelColorMixIntensity.

Link copied to clipboard

Transition options for ModelColor.

Link copied to clipboard

This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled. Default value: 0. Value range: 0, 1

Link copied to clipboard

This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled. Default value: 0. Value range: 0, 1

Link copied to clipboard

Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source. Default value: 0. Value range: 0, 5

Link copied to clipboard

Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source. Default value: 0. Value range: 0, 5

Link copied to clipboard

Transition options for ModelEmissiveStrength.

Link copied to clipboard

An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled. Default value: 0,0,1. Minimum value: 0,0,0. Maximum value: 1,1,1.

Link copied to clipboard

An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled. Default value: 0,0,1. Minimum value: 0,0,0. Maximum value: 1,1,1.

Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)). Default value: 1,1,1,1,0.

Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)). Default value: 1,1,1,1,0.

Transition options for ModelHeightBasedEmissiveStrengthMultiplier.

Link copied to clipboard

Model to render. It can be either a string referencing an element to the models root property or an internal or external URL Default value: "".

Link copied to clipboard

Model to render. It can be either a string referencing an element to the models root property or an internal or external URL Default value: "".

Link copied to clipboard

The opacity of the model layer. Default value: 1. Value range: 0, 1

Link copied to clipboard

The opacity of the model layer. Default value: 1. Value range: 0, 1

Link copied to clipboard

Transition options for ModelOpacity.

Link copied to clipboard

Enable/Disable shadow receiving for this layer Default value: true.

Link copied to clipboard

Enable/Disable shadow receiving for this layer Default value: true.

Link copied to clipboard

The rotation of the model in euler angles lon, lat, z. Default value: 0,0,0.

Link copied to clipboard

The rotation of the model in euler angles lon, lat, z. Default value: 0,0,0.

Link copied to clipboard

Transition options for ModelRotation.

Link copied to clipboard

Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source. Default value: 1. Value range: 0, 1

Link copied to clipboard

Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source. Default value: 1. Value range: 0, 1

Link copied to clipboard

Transition options for ModelRoughness.

Link copied to clipboard

The scale of the model. Default value: 1,1,1.

Link copied to clipboard

The scale of the model. Default value: 1,1,1.

Link copied to clipboard

Defines scaling mode. Only applies to location-indicator type layers. Default value: "map".

Link copied to clipboard

Defines scaling mode. Only applies to location-indicator type layers. Default value: "map".

Link copied to clipboard

Transition options for ModelScale.

Link copied to clipboard

The translation of the model in meters in form of longitudal, latitudal, altitude offsets. Default value: 0,0,0.

Link copied to clipboard

The translation of the model in meters in form of longitudal, latitudal, altitude offsets. Default value: 0,0,0.

Link copied to clipboard

Transition options for ModelTranslation.

Link copied to clipboard

Defines rendering behavior of model in respect to other 3D scene objects. Default value: "common-3d".

Link copied to clipboard

Defines rendering behavior of model in respect to other 3D scene objects. Default value: "common-3d".

Link copied to clipboard
open override val slot: String?

The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.

Link copied to clipboard
Link copied to clipboard

A source layer is an individual layer of data within a vector source. A vector source can have multiple source layers.

Link copied to clipboard
open override val visibility: Visibility?

Whether this layer is displayed.

Link copied to clipboard

Whether this layer is displayed.

Extensions

Link copied to clipboard

Get the persistent property as Boolean.