The PathLayer
takes in lists of coordinate points and renders them as extruded lines with mitering.
add_path_layer(
deckgl,
data = NULL,
properties = list(),
...,
id = "path-layer"
)
A deckgl widget object.
The url to fetch data from or a data object.
A named list of properties with names corresponding to the properties defined
in the deckgl-api-reference
for the given layer class. The properties
parameter can also be an empty list. In this case
all props must be passed as named arguments.
Named arguments that will be added to the properties
object. Identical parameters
are overwritten.
The unique id of the layer.
sample_data <- paste0(
"https://raw.githubusercontent.com/",
"uber-common/deck.gl-data/",
"master/website/bart-lines.json"
)
properties <- list(
pickable = TRUE,
widthScale = 20,
widthMinPixels = 2,
getPath = ~path,
getColor = ~color,
getWidth = 5,
tooltip = ~name
)
deck <- deckgl(pitch = 25, zoom = 10.5) %>%
add_path_layer(data = sample_data, properties = properties) %>%
add_basemap() %>%
add_control("Path Layer")
if (interactive()) deck