The IconLayer
renders raster icons at given coordinates.
data("bart_stations")
properties <- list(
pickable = TRUE,
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 = JS("object => `${object.name}<br/>${object.address}`")
)
deck <- deckgl(zoom = 10, pitch = 45) %>%
add_icon_layer(data = bart_stations, properties = properties) %>%
add_basemap()
if (interactive()) deck
See also deckgl-api-reference-icon-layer