View source: R/get_route_directions.R
req_route_directions | R Documentation |
Requests route directions from 'Azure Maps' API using origin, destination, waypoints, and route parameters.
req_route_directions(
origin,
destination,
waypoints = NULL,
params,
tz = Sys.timezone(),
api_key = get_azuremaps_token(),
api_version = "2025-01-01"
)
origin |
A numeric vector of length 2 with origin coordinates (longitude, latitude), or an |
destination |
A numeric vector of length 2 with destination coordinates (longitude, latitude), or an |
waypoints |
Optional. A numeric vector, a matrix of coordinates, or an |
params |
A list of route parameters (e.g., |
tz |
A string specifying the timezone. Defaults to the system's timezone. |
api_key |
The 'Azure Maps' API key. Defaults to the value retrieved by |
api_version |
The API version to use. Defaults to "2025-01-01". |
An httr2_response
object from the 'Azure Maps' API.
## Not run:
origin <- c(-122.201399, 47.608678)
destination <- c(-122.201669, 47.615076)
waypoints <- c(-122.20687, 47.612002)
params <- list(
optimizeRoute = "fastestWithTraffic",
routeOutputOptions = "routePath",
maxRouteCount = 3,
travelMode = "driving"
)
response <- req_route_directions(origin, destination, waypoints, params)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.