addVelocity | R Documentation |
Add velocity animated data to leaflet. Based on the leaflet-velocity plugin
addVelocity(
map,
layerId = NULL,
group = NULL,
content = NULL,
options = velocityOptions()
)
map |
a map widget object created from |
layerId |
the layer id |
group |
the name of the group the newly created layers should belong to
(for |
content |
the path or URL to a JSON file representing the velocity data or a data.frame which can be transformed to such a JSON file. Please see the demo files for some example data. |
options |
List of further options. See |
the new map
object
https://github.com/onaci/leaflet-velocity
Other Velocity Functions:
removeVelocity()
,
setOptionsVelocity()
,
velocityOptions()
## Not run:
library(leaflet)
library(leaflet.extras2)
content <- "https://raw.githubusercontent.com/onaci/leaflet-velocity/master/demo/water-gbr.json"
leaflet() %>%
addTiles(group = "base") %>%
setView(145, -20, 4) %>%
addVelocity(content = content, group = "velo", layerId = "veloid") %>%
addLayersControl(baseGroups = "base", overlayGroups = "velo")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.