LineLayerState
The state holder for LineLayer's layer properties.
See also
Constructors
Construct an default LineLayerState.
Properties
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.
Overrides applying of color theme for lineBorderColor if "none" is set. To follow default theme "default" should be set. Default value: "default".
Overrides applying of color theme for lineColor if "none" is set. To follow default theme "default" should be set. Default value: "default".
Defines the slope of an elevated line. A value of 0 creates a horizontal line. A value of 1 creates a vertical line. Other values are currently not supported. If undefined, the line follows the terrain slope. This is an experimental property with some known issues: - Vertical lines don't support line caps - line-join: round
is not supported with this property
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. The unit of lineDasharray is in line widths.
Defines the transition of lineDepthOcclusionFactor.
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
.
Overrides applying of color theme for lineGradient if "none" is set. To follow default theme "default" should be set. Default value: "default".
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. The unit of lineOffset is in pixels.
Overrides applying of color theme for lineTrimColor if "none" is set. To follow default theme "default" should be set. Default value: "default".
The fade range for the trim-start and trim-end points is defined by the line-trim-offset
property. The first element of the array represents the fade range from the trim-start point toward the end of the line, while the second element defines the fade range from the trim-end point toward the beginning of the line. The fade result is achieved by interpolating between line-trim-color
and the color specified by the line-color
or the line-gradient
property. Default value: 0,0. Minimum value: 0,0. Maximum value: 1,1.
Vertical offset from ground, in meters. Defaults to 0. This is an experimental property with some known issues: - Not supported for globe projection at the moment - Elevated line discontinuity is possible on tile borders with terrain enabled - Rendering artifacts can happen near line joins and line caps depending on the line styling - Rendering artifacts relating to line-opacity
and line-blur
- Elevated line visibility is determined by layer order - Z-fighting issues can happen with intersecting elevated lines - Elevated lines don't cast shadows Default value: 0.