Description Usage Arguments Value Examples
This function adds a layer of driving route to a Leaflet map widget using leaflet.
1 2 3 4 |
map |
a leaflet map widget |
origin |
a numeric vector defining the origin location, format c(longitude, latitude) |
destination |
a numeric vector defining the destination, format c(longitude, latitude) |
waypoints |
a data frame consists of two columns, where the first column is longitude and the second latitude, at most 16 rows. |
strategy |
refer to the original api http://lbs.amap.com/api/webservice/reference/direction/#t7 |
key |
access key of amap api, please register at the website if you do not have one. |
layerId |
layerId in leaflet |
group |
group in leaflet |
weight |
weight in leaflet |
opacity |
opacity in leaflet |
popup |
popup in leaflet, available attributes include status |
a leaflet map widget
1 2 3 4 | ## Not run:
leaflet() %>% addDrivingRoute(key="your key from amap website")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.