add_icon_layer {deckgl} | R Documentation |
Add an icon layer to the deckgl widget
Description
The IconLayer
renders raster icons at given coordinates.
Usage
add_icon_layer(
deckgl,
data = NULL,
properties = use_default_icon_properties(),
...,
id = "icon-layer"
)
Arguments
deckgl |
A deckgl widget object. |
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. The |
... |
Named arguments that will be added to the |
id |
The unique id of the layer. |
See Also
https://deck.gl/#/documentation/deckgl-api-reference/layers/icon-layer
Examples
## @knitr icon-layer
data("bart_stations")
properties <- list(
iconAtlas = encode_icon_atlas(),
iconMapping = list(marker = use_icon_definition()),
sizeScale = 10,
getPosition = ~lng + lat,
getIcon = JS("d => 'marker'"),
getSize = 5,
getColor = JS("d => [Math.sqrt(d.exits), 140, 0]"),
getTooltip = "{{name}}<br/>{{address}}"
)
deck <- deckgl(zoom = 10, pitch = 45) %>%
add_icon_layer(data = bart_stations, properties = properties) %>%
add_control("Icon Layer") %>%
add_basemap()
if (interactive()) deck
[Package deckgl version 0.3.0 Index]