addDrivingRoute: Add a layer of driving route to a Leaflet map widget

Description Usage Arguments Value Examples

Description

This function adds a layer of driving route to a Leaflet map widget using leaflet.

Usage

1
2
3
4
addDrivingRoute(map, origin = c(116.379028, 39.865042),
  destination = c(116.427281, 39.903719), waypoints = NULL, strategy = 0,
  key, layerId = NULL, group = NULL, weight = 5, opacity = 1,
  popup = NULL)

Arguments

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

Value

a leaflet map widget

Examples

1
2
3
4
## Not run: 
leaflet() %>% addDrivingRoute(key="your key from amap website")

## End(Not run)

danzhuibing/RAmap documentation built on May 14, 2019, 6:06 p.m.