Description Usage Arguments Details
View source: R/get_distances.R
The Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations. The API returns information based on the recommended route between start and end points, as calculated by the Google Maps API, and consists of rows containing duration and distance values for each pair.
1 2 3 4 5 6 7 | get_distances(
origins,
destinations,
departure_time = "now",
.api_key,
.output_format = "json"
)
|
origins |
character vector. Origin addresses. These are compared to every value in destinations. |
destinations |
character vector. Destination addresses. These are compared to every value in origins |
departure_time |
a datetime (POSIXct) or 'now'. The desired time of departure. |
.api_key |
google cloud API key. This must be setup and enabled to use the Google distance matrix API. |
.output_format |
character. The return format from the API call. Either 'json' or 'xml' |
https://maps.googleapis.com/maps/api/distancematrix/outputFormat?parameters
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.