LineLayer

class LineLayer(val layerId: String, val sourceId: String) : Layer, LineLayerDsl

A stroked line.

See also

Parameters

layerId

the ID of the layer

sourceId

the ID of the source

Constructors

Link copied to clipboard
fun LineLayer(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): LineLayer

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 lineBlur(lineBlur: Expression): LineLayer
open override fun lineBlur(lineBlur: Double): LineLayer

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

Link copied to clipboard
open override fun lineBlurTransition(options: StyleTransition): LineLayer

Set the LineBlur property transition options

open override fun lineBlurTransition(block: StyleTransition.Builder.() -> Unit): LineLayer
Link copied to clipboard
open override fun lineBorderColor(lineBorderColor: Expression): LineLayer
open override fun lineBorderColor(@ColorInt lineBorderColor: Int): LineLayer
open override fun lineBorderColor(lineBorderColor: String): LineLayer

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

Link copied to clipboard

Set the LineBorderColor property transition options

Link copied to clipboard
open override fun lineBorderWidth(lineBorderWidth: Expression): LineLayer
open override fun lineBorderWidth(lineBorderWidth: Double): LineLayer

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

Link copied to clipboard

Set the LineBorderWidth property transition options

Link copied to clipboard
open override fun lineCap(lineCap: Expression): LineLayer
open override fun lineCap(lineCap: LineCap): LineLayer

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

Link copied to clipboard
open override fun lineColor(lineColor: Expression): LineLayer
open override fun lineColor(@ColorInt lineColor: Int): LineLayer
open override fun lineColor(lineColor: String): LineLayer

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

Link copied to clipboard
open override fun lineColorTransition(options: StyleTransition): LineLayer

Set the LineColor property transition options

Link copied to clipboard
open override fun lineDasharray(lineDasharray: Expression): LineLayer
open override fun lineDasharray(lineDasharray: List<Double>): LineLayer

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.

Link copied to clipboard
open override fun lineDepthOcclusionFactor(lineDepthOcclusionFactor: Expression): LineLayer
open override fun lineDepthOcclusionFactor(lineDepthOcclusionFactor: Double): LineLayer

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

Link copied to clipboard

Set the LineDepthOcclusionFactor property transition options

Link copied to clipboard
open override fun lineEmissiveStrength(lineEmissiveStrength: Expression): LineLayer
open override fun lineEmissiveStrength(lineEmissiveStrength: Double): LineLayer

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

Link copied to clipboard

Set the LineEmissiveStrength property transition options

Link copied to clipboard
open override fun lineGapWidth(lineGapWidth: Expression): LineLayer
open override fun lineGapWidth(lineGapWidth: Double): LineLayer

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.

Link copied to clipboard
open override fun lineGapWidthTransition(options: StyleTransition): LineLayer

Set the LineGapWidth property transition options

Link copied to clipboard
open override fun lineGradient(lineGradient: Expression): LineLayer

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.

Link copied to clipboard
open override fun lineJoin(lineJoin: Expression): LineLayer
open override fun lineJoin(lineJoin: LineJoin): LineLayer

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

Link copied to clipboard
open override fun lineMiterLimit(lineMiterLimit: Expression): LineLayer
open override fun lineMiterLimit(lineMiterLimit: Double): LineLayer

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

Link copied to clipboard
open override fun lineOcclusionOpacity(lineOcclusionOpacity: Expression): LineLayer
open override fun lineOcclusionOpacity(lineOcclusionOpacity: Double): LineLayer

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

Link copied to clipboard

Set the LineOcclusionOpacity property transition options

Link copied to clipboard
open override fun lineOffset(lineOffset: Expression): LineLayer
open override fun lineOffset(lineOffset: Double): LineLayer

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.

Link copied to clipboard
open override fun lineOffsetTransition(options: StyleTransition): LineLayer

Set the LineOffset property transition options

Link copied to clipboard
open override fun lineOpacity(lineOpacity: Expression): LineLayer
open override fun lineOpacity(lineOpacity: Double): LineLayer

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

Link copied to clipboard
open override fun lineOpacityTransition(options: StyleTransition): LineLayer

Set the LineOpacity property transition options

Link copied to clipboard
open override fun linePattern(linePattern: Expression): LineLayer
open override fun linePattern(linePattern: String): LineLayer

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.

Link copied to clipboard
open override fun lineRoundLimit(lineRoundLimit: Expression): LineLayer
open override fun lineRoundLimit(lineRoundLimit: Double): LineLayer

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

Link copied to clipboard
open override fun lineSortKey(lineSortKey: Expression): LineLayer
open override fun lineSortKey(lineSortKey: Double): LineLayer

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

Link copied to clipboard
open override fun lineTranslate(lineTranslate: Expression): LineLayer
open override fun lineTranslate(lineTranslate: List<Double>): LineLayer

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

Link copied to clipboard
open override fun lineTranslateAnchor(lineTranslateAnchor: Expression): LineLayer
open override fun lineTranslateAnchor(lineTranslateAnchor: LineTranslateAnchor): LineLayer

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

Link copied to clipboard

Set the LineTranslate property transition options

Link copied to clipboard
open override fun lineTrimOffset(lineTrimOffset: Expression): LineLayer
open override fun lineTrimOffset(lineTrimOffset: List<Double>): LineLayer

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.

Link copied to clipboard
open override fun lineWidth(lineWidth: Expression): LineLayer
open override fun lineWidth(lineWidth: Double): LineLayer

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

Link copied to clipboard
open override fun lineWidthTransition(options: StyleTransition): LineLayer

Set the LineWidth property transition options

Link copied to clipboard
open override fun lineZOffset(lineZOffset: Expression): LineLayer
open override fun lineZOffset(lineZOffset: Double): LineLayer

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

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

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): LineLayer

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 slot(slot: String): LineLayer

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): LineLayer

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): LineLayer
open override fun visibility(visibility: Visibility): LineLayer

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

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineBlur.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineBorderColor.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineBorderWidth.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineColor.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineDepthOcclusionFactor.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineEmissiveStrength.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Transition options for LineGapWidth.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineOcclusionOpacity.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Transition options for LineOffset.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineOpacity.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineTranslate.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Transition options for LineWidth.

Link copied to clipboard

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

Link copied to clipboard

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

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