add_path_layer {deckgl}R Documentation

Add a path layer to the deckgl widget

Description

The PathLayer takes in lists of coordinate points and renders them as extruded lines with mitering.

Usage

add_path_layer(deckgl, id = "path-layer", data = NULL,
  properties = list(), ...)

Arguments

deckgl

A deckgl widget object.

id

The unique id of the layer.

data

The url to fetch data from or a data object.

properties

A named list of properties with names corresponding to the properties defined in the deckgl-api-reference for the given layer class.

...

More properties that will be added to the properties object. This can be useful if you want to use a properties object for more than one layer.

See Also

https://deck.gl/#/documentation/deckgl-api-reference/layers/path-layer

Examples

## @knitr path-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,
  getTooltip = ~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

[Package deckgl version 0.2.7 Index]