michaeldorman / mapsapi

'sf'-Compatible Interface to Google Maps APIs
Other
50 stars 14 forks source link

Any way to include the "traffic_model" parameter? #7

Closed Camiloeortiz closed 4 years ago

Camiloeortiz commented 4 years ago

Hi, I was wondering around the documentation of the API in the developers web page (https://developers.google.com/maps/documentation/directions/intro?hl=es) and I was asking if there is way to include de traffic_model parameter in the query for the mp_directions function. My first guess is that can be something like this before the URLencode command, but I want to be sure if it's right:

if (!is.null(traffic_model)) {
  url = paste0(url, "&traffic_model =", traffic_model)

Many thanks in advance.

michaeldorman commented 4 years ago

Hi, Now added a traffic_mode parameter in mp_directions and mp_matrix. Please let me know if you encounter any issues, thanks!