add_line_layer {mapboxer} | R Documentation |
Add a line layer to the map
Description
Add a line layer to the map
Usage
add_line_layer(map, source = NULL, filter = NULL, line_blur = NULL,
line_cap = NULL, line_color = NULL, line_dasharray = NULL,
line_gap_width = NULL, line_gradient = NULL, line_join = NULL,
line_miter_limit = NULL, line_offset = NULL, line_opacity = NULL,
line_pattern = NULL, line_round_limit = NULL, line_sort_key = NULL,
line_translate = NULL, line_translate_anchor = NULL,
line_width = NULL, visibility = NULL, popup = NULL,
id = "line-layer")
Arguments
map |
A mapboxer object. |
source |
A Mapbox source. Uses the source from the mapboxer object if no source is supplied. |
filter |
A filter expression that is applied to the |
line_blur |
(paint) Blur applied to the line, in pixels. |
line_cap |
(layout) The display of line endings. One of "butt", "round", "square". |
line_color |
(paint) The color with which the line will be drawn. |
line_dasharray |
(paint) Specifies the lengths of the alternating dashes and gaps that form the dash pattern. |
line_gap_width |
(paint) Draws a line casing outside of a line's actual path. The value indicates the width of the inner gap. |
line_gradient |
(paint) Defines a gradient with which to color a line feature.
Can only be used with GeoJSON sources that specify |
line_join |
(layout) The display of lines when joining. One of "bevel", "round", "miter". |
line_miter_limit |
(layout) Used to automatically convert miter joins to bevel joins for sharp angles.
Requires |
line_offset |
(paint) 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. |
line_opacity |
(paint) The opacity at which the line will be drawn. |
line_pattern |
(paint) Name of image in sprite to use for drawing image lines. |
line_round_limit |
(layout) Used to automatically convert round joins to miter joins for shallow angles. |
line_sort_key |
(layout) Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key. |
line_translate |
(paint) The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. |
line_translate_anchor |
(paint) Controls the frame of reference for |
line_width |
(paint) Stroke thickness. |
visibility |
(layout) Whether the layer should be displayed. |
popup |
A mustache template in which the tags refer to the properties of the layer's data object. |
id |
The unique id of the layer. |
See Also
https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#line
Examples
map <- as_mapbox_source(geojsonsf::geo_melbourne) %>%
mapboxer(
center = c(144.9624, -37.8105),
zoom = 11,
pitch = 45
) %>%
add_navigation_control() %>%
add_line_layer(
line_color = c("get", "strokeColor"),
line_width = 2,
popup = "{{SA2_NAME}}"
)
if (interactive()) map