addVelocity {leaflet.extras2} | R Documentation |
Add Velocity Animation
Description
Add velocity animated data to leaflet. Based on the leaflet-velocity plugin
Usage
addVelocity(
map,
layerId = NULL,
group = NULL,
content = NULL,
options = velocityOptions()
)
Arguments
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 |
Value
the new map
object
References
https://github.com/onaci/leaflet-velocity
See Also
Other Velocity Functions:
removeVelocity()
,
setOptionsVelocity()
,
velocityOptions()
Examples
## 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)