Line
A stroked line.
Paint Property
Property Name | Description | Type | Defaults |
---|---|---|---|
line-blur | Blur applied to the line, in pixels.or not the fill should be antialiased. | number | 0 |
line-color | The color with which the line will be drawn. | hex values, RGB, RGBA, HSL, HSLA, Colors Name | #000000 |
line-dasharray | Specifies the lengths of the alternating dashes and gaps that form the dash pattern. | array of numbers | [0,0] |
line-gap-width | Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. | number | 0 |
line-gradient | Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify | hex values, RGB, RGBA, HSL, HSLA, Colors Name | map |
line-offset | 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. | number | 0 |
line-opacity | The opacity at which the line will be drawn. between 0 and 1 inclusive | number | 1 |
line-translate | The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. | array of numbers | [0,0] |
line-translate-anchor | Controls the frame of reference for
The line is translated relative to the map.
The line is translated relative to the viewport. | string | map |
line-width | Stroke thickness. greater than 0 | number | 1 |
Layout Property
Property Name | Description | Type | Defaults |
---|---|---|---|
visibility | Whether this layer is displayed.
The layer is shown.
The layer is not shown. | String( visible or none) | visible |
line-cap | The display of line endings.
A cap with a squared-off end which is drawn to the exact endpoint of the line.
A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width. | String | butt |
line-join | The display of lines when joining.
A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet. | String | miter |
line-miter-limit | Used to automatically convert miter joins to bevel joins for sharp angles. | number | 2 |
line-round-limit | Used to automatically convert round joins to miter joins for shallow angles. | number | 1.05 |
Last updated