ModelLayer

fun ModelLayer(sourceState: SourceState, layerId: String = remember { generateRandomLayerId("model") }, modelId: ModelIdValue = ModelIdValue.INITIAL, modelAmbientOcclusionIntensity: DoubleValue = DoubleValue.INITIAL, modelAmbientOcclusionIntensityTransition: Transition = Transition.INITIAL, modelCastShadows: BooleanValue = BooleanValue.INITIAL, modelColor: ColorValue = ColorValue.INITIAL, modelColorTransition: Transition = Transition.INITIAL, modelColorMixIntensity: DoubleValue = DoubleValue.INITIAL, modelColorMixIntensityTransition: Transition = Transition.INITIAL, modelCutoffFadeRange: DoubleValue = DoubleValue.INITIAL, modelEmissiveStrength: DoubleValue = DoubleValue.INITIAL, modelEmissiveStrengthTransition: Transition = Transition.INITIAL, modelFrontCutoff: DoubleListValue = DoubleListValue.INITIAL, modelHeightBasedEmissiveStrengthMultiplier: DoubleListValue = DoubleListValue.INITIAL, modelHeightBasedEmissiveStrengthMultiplierTransition: Transition = Transition.INITIAL, modelOpacity: DoubleValue = DoubleValue.INITIAL, modelOpacityTransition: Transition = Transition.INITIAL, modelReceiveShadows: BooleanValue = BooleanValue.INITIAL, modelRotation: DoubleListValue = DoubleListValue.INITIAL, modelRotationTransition: Transition = Transition.INITIAL, modelRoughness: DoubleValue = DoubleValue.INITIAL, modelRoughnessTransition: Transition = Transition.INITIAL, modelScale: DoubleListValue = DoubleListValue.INITIAL, modelScaleTransition: Transition = Transition.INITIAL, modelScaleMode: ModelScaleModeValue = ModelScaleModeValue.INITIAL, modelTranslation: DoubleListValue = DoubleListValue.INITIAL, modelTranslationTransition: Transition = Transition.INITIAL, modelType: ModelTypeValue = ModelTypeValue.INITIAL, visibility: VisibilityValue = VisibilityValue.INITIAL, minZoom: LongValue = LongValue.INITIAL, maxZoom: LongValue = LongValue.INITIAL, sourceLayer: StringValue = StringValue.INITIAL, filter: Filter = Filter.INITIAL)

A layer to render 3D Models.

Parameters

sourceState

the source that drives this layer.

layerId

the ID of the layer, by default, a random id will be generated with UUID.

modelId

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: "".

modelAmbientOcclusionIntensity

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

modelAmbientOcclusionIntensityTransition

Defines the transition of modelAmbientOcclusionIntensity. Default value: 1. Value range: 0, 1

modelCastShadows

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

modelColor

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".

modelColorTransition

Defines the transition of modelColor. Default value: "#ffffff".

modelColorMixIntensity

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

modelColorMixIntensityTransition

Defines the transition of modelColorMixIntensity. Default value: 0. Value range: 0, 1

modelCutoffFadeRange

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

modelEmissiveStrength

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

modelEmissiveStrengthTransition

Defines the transition of modelEmissiveStrength. Default value: 0. Value range: 0, 5

modelFrontCutoff

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.

modelHeightBasedEmissiveStrengthMultiplier

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.

modelHeightBasedEmissiveStrengthMultiplierTransition

Defines the transition of modelHeightBasedEmissiveStrengthMultiplier. Default value: 1,1,1,1,0.

modelOpacity

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

modelOpacityTransition

Defines the transition of modelOpacity. Default value: 1. Value range: 0, 1

modelReceiveShadows

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

modelRotation

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

modelRotationTransition

Defines the transition of modelRotation. Default value: 0,0,0.

modelRoughness

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

modelRoughnessTransition

Defines the transition of modelRoughness. Default value: 1. Value range: 0, 1

modelScale

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

modelScaleTransition

Defines the transition of modelScale. Default value: 1,1,1.

modelScaleMode

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

modelTranslation

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

modelTranslationTransition

Defines the transition of modelTranslation. Default value: 0,0,0.

modelType

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

visibility

Whether this layer is displayed. Default value: "visible".

minZoom

The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. Value range: 0, 24

maxZoom

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

sourceLayer

Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.

filter

An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The ["feature-state", ...] expression is not supported in filter expressions. The ["pitch"] and ["distance-from-center"] expressions are supported only for filter expressions on the symbol layer.