LineLayer

fun LineLayer(sourceState: SourceState, layerId: String = remember { generateRandomLayerId("line") }, lineCap: LineCapValue = LineCapValue.INITIAL, lineJoin: LineJoinValue = LineJoinValue.INITIAL, lineMiterLimit: DoubleValue = DoubleValue.INITIAL, lineRoundLimit: DoubleValue = DoubleValue.INITIAL, lineSortKey: DoubleValue = DoubleValue.INITIAL, lineZOffset: DoubleValue = DoubleValue.INITIAL, lineBlur: DoubleValue = DoubleValue.INITIAL, lineBlurTransition: Transition = Transition.INITIAL, lineBorderColor: ColorValue = ColorValue.INITIAL, lineBorderColorTransition: Transition = Transition.INITIAL, lineBorderWidth: DoubleValue = DoubleValue.INITIAL, lineBorderWidthTransition: Transition = Transition.INITIAL, lineColor: ColorValue = ColorValue.INITIAL, lineColorTransition: Transition = Transition.INITIAL, lineDasharray: DoubleListValue = DoubleListValue.INITIAL, lineDepthOcclusionFactor: DoubleValue = DoubleValue.INITIAL, lineDepthOcclusionFactorTransition: Transition = Transition.INITIAL, lineEmissiveStrength: DoubleValue = DoubleValue.INITIAL, lineEmissiveStrengthTransition: Transition = Transition.INITIAL, lineGapWidth: DoubleValue = DoubleValue.INITIAL, lineGapWidthTransition: Transition = Transition.INITIAL, lineGradient: ColorValue = ColorValue.INITIAL, lineOcclusionOpacity: DoubleValue = DoubleValue.INITIAL, lineOcclusionOpacityTransition: Transition = Transition.INITIAL, lineOffset: DoubleValue = DoubleValue.INITIAL, lineOffsetTransition: Transition = Transition.INITIAL, lineOpacity: DoubleValue = DoubleValue.INITIAL, lineOpacityTransition: Transition = Transition.INITIAL, linePattern: ImageValue = ImageValue.INITIAL, lineTranslate: DoubleListValue = DoubleListValue.INITIAL, lineTranslateTransition: Transition = Transition.INITIAL, lineTranslateAnchor: LineTranslateAnchorValue = LineTranslateAnchorValue.INITIAL, lineTrimOffset: DoubleListValue = DoubleListValue.INITIAL, lineWidth: DoubleValue = DoubleValue.INITIAL, lineWidthTransition: Transition = Transition.INITIAL, visibility: VisibilityValue = VisibilityValue.INITIAL, minZoom: LongValue = LongValue.INITIAL, maxZoom: LongValue = LongValue.INITIAL, sourceLayer: StringValue = StringValue.INITIAL, filter: Filter = Filter.INITIAL)

A stroked line.

See also

Parameters

sourceState

the source that drives this layer.

layerId

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

lineCap

The display of line endings. Default value: "butt".

lineJoin

The display of lines when joining. Default value: "miter".

lineMiterLimit

Used to automatically convert miter joins to bevel joins for sharp angles. Default value: 2.

lineRoundLimit

Used to automatically convert round joins to miter joins for shallow angles. Default value: 1.05.

lineSortKey

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

lineZOffset

Vertical offset from ground, in meters. Defaults to 0. Not supported for globe projection at the moment.

lineBlur

Blur applied to the line, in pixels. Default value: 0. Minimum value: 0.

lineBlurTransition

Defines the transition of lineBlur. Default value: 0. Minimum value: 0.

lineBorderColor

The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color. Default value: "rgba(0, 0, 0, 0)".

lineBorderColorTransition

Defines the transition of lineBorderColor. Default value: "rgba(0, 0, 0, 0)".

lineBorderWidth

The width of the line border. A value of zero means no border. Default value: 0. Minimum value: 0.

lineBorderWidthTransition

Defines the transition of lineBorderWidth. Default value: 0. Minimum value: 0.

lineColor

The color with which the line will be drawn. Default value: "#000000".

lineColorTransition

Defines the transition of lineColor. Default value: "#000000".

lineDasharray

Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with lineMetrics: true specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels. Minimum value: 0.

lineDepthOcclusionFactor

Decrease line layer opacity based on occlusion from 3D objects. Value 0 disables occlusion, value 1 means fully occluded. Default value: 1. Value range: 0, 1

lineDepthOcclusionFactorTransition

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

lineEmissiveStrength

Controls the intensity of light emitted on the source features. Default value: 0. Minimum value: 0.

lineEmissiveStrengthTransition

Defines the transition of lineEmissiveStrength. Default value: 0. Minimum value: 0.

lineGapWidth

Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. Default value: 0. Minimum value: 0.

lineGapWidthTransition

Defines the transition of lineGapWidth. Default value: 0. Minimum value: 0.

lineGradient

A gradient used to color a line feature at various distances along its length. Defined using a step or interpolate expression which outputs a color for each corresponding line-progress input value. line-progress is a percentage of the line feature's total length as measured on the webmercator projected coordinate plane (a number between 0 and 1). Can only be used with GeoJSON sources that specify "lineMetrics": true.

lineOcclusionOpacity

Opacity multiplier (multiplies line-opacity value) of the line part that is occluded by 3D objects. Value 0 hides occluded part, value 1 means the same opacity as non-occluded part. The property is not supported when line-opacity has data-driven styling. Default value: 0. Value range: 0, 1

lineOcclusionOpacityTransition

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

lineOffset

The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset. Default value: 0.

lineOffsetTransition

Defines the transition of lineOffset. Default value: 0.

lineOpacity

The opacity at which the line will be drawn. Default value: 1. Value range: 0, 1

lineOpacityTransition

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

linePattern

Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

lineTranslate

The geometry's offset. Values are x, y where negatives indicate left and up, respectively. Default value: 0,0.

lineTranslateTransition

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

lineTranslateAnchor

Controls the frame of reference for line-translate. Default value: "map".

lineTrimOffset

The line part between trim-start, trim-end will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range 0.0, 1.0. Default value: 0,0. Minimum value: 0,0. Maximum value: 1,1.

lineWidth

Stroke thickness. Default value: 1. Minimum value: 0.

lineWidthTransition

Defines the transition of lineWidth. Default value: 1. Minimum value: 0.

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.