ModelLayer

fun ModelLayer(sourceState: SourceState, layerId: String = remember { generateRandomLayerId("model") }, modelId: ModelId = ModelId.default, modelAmbientOcclusionIntensity: ModelAmbientOcclusionIntensity = ModelAmbientOcclusionIntensity.default, modelAmbientOcclusionIntensityTransition: Transition = Transition.default, modelCastShadows: ModelCastShadows = ModelCastShadows.default, modelColor: ModelColor = ModelColor.default, modelColorTransition: Transition = Transition.default, modelColorMixIntensity: ModelColorMixIntensity = ModelColorMixIntensity.default, modelColorMixIntensityTransition: Transition = Transition.default, modelCutoffFadeRange: ModelCutoffFadeRange = ModelCutoffFadeRange.default, modelEmissiveStrength: ModelEmissiveStrength = ModelEmissiveStrength.default, modelEmissiveStrengthTransition: Transition = Transition.default, modelHeightBasedEmissiveStrengthMultiplier: ModelHeightBasedEmissiveStrengthMultiplier = ModelHeightBasedEmissiveStrengthMultiplier.default, modelHeightBasedEmissiveStrengthMultiplierTransition: Transition = Transition.default, modelOpacity: ModelOpacity = ModelOpacity.default, modelOpacityTransition: Transition = Transition.default, modelReceiveShadows: ModelReceiveShadows = ModelReceiveShadows.default, modelRotation: ModelRotation = ModelRotation.default, modelRotationTransition: Transition = Transition.default, modelRoughness: ModelRoughness = ModelRoughness.default, modelRoughnessTransition: Transition = Transition.default, modelScale: ModelScale = ModelScale.default, modelScaleTransition: Transition = Transition.default, modelScaleMode: ModelScaleMode = ModelScaleMode.default, modelTranslation: ModelTranslation = ModelTranslation.default, modelTranslationTransition: Transition = Transition.default, modelType: ModelType = ModelType.default, visibility: Visibility = Visibility.default, minZoom: MinZoom = MinZoom.default, maxZoom: MaxZoom = MaxZoom.default, sourceLayer: SourceLayer = SourceLayer.default, filter: Filter = Filter.default)

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.

modelAmbientOcclusionIntensity

Intensity of the ambient occlusion if present in the 3D model.

modelCastShadows

Enable/Disable shadow casting for this layer

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.

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.

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.

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.

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

modelOpacity

The opacity of the model layer.

modelReceiveShadows

Enable/Disable shadow receiving for this layer

modelRotation

The rotation of the model in euler angles lon, lat, z.

modelRoughness

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

modelScale

The scale of the model.

modelScaleMode

Defines scaling mode. Only applies to location-indicator type layers.

modelTranslation

The translation of the model in meters in form of longitudal, latitudal, altitude offsets.

modelType

Defines rendering behavior of model in respect to other 3D scene objects.

visibility

Whether this layer is displayed.

minZoom

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

maxZoom

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

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.