add_source | R Documentation |
Add a data source to the deckgl widget
add_source(deckgl, id, data)
deckgl |
A deckgl widget object. |
id |
The unique id of the source. |
data |
The url to fetch data from or a data object. |
data("bart_stations")
deckgl() %>%
add_source("bart-stations", bart_stations) %>%
add_scatterplot_layer(
source = "bart-stations",
getPosition = ~lng + lat,
getFillColor = "steelblue",
getRadius = 50,
radiusScale = 6
) %>%
add_text_layer(
source = "bart-stations",
getPosition = ~lng + lat,
getText = ~name,
getSize = 15,
sizeScale = 1.5,
getColor = "white"
) %>%
add_basemap()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.