Description Usage Arguments Value Examples
Calculate travel time from coordinates via Google Maps API. Can use any coordinate system. The default is "+proj=longlat +datum=WGS84" which is the one Google Maps prefers. Requires a Google Maps dev key.
1 2 3 4 5 6 7 8 9 10 | traveltime(
x_start,
x_end,
y_start,
y_end,
crs = NULL,
mode,
key,
silent = TRUE
)
|
x_start |
numeric vector of coordinates in any coordinate format |
x_end |
numeric vector of coordinates in any coordinate format |
y_start |
numeric vector of coordinates in any coordinate format |
y_end |
numeric vector of coordinates in any coordinate format |
crs |
the coordinate system (e.g. "+proj=utm +zone=32N +datum=WGS84") |
mode |
mode in gmapdistance package, e.g. "driving". |
key |
Google API key |
data frame with travel time and distance
1 2 3 | traveltime(x_start = 10.73426, y_start = 59.95023,
x_end = 10.74455, y_end = 59.95137,
mode = "driving", key = my_key)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.