route_map: Create a route map for a trip

View source: R/map.R

route_mapR Documentation

Create a route map for a trip

Description

A map, centered at the mean of the start and end locations, is accessed via get_map and a suitable driving route between these points is constructed using google_directions then added to the map.

Usage

route_map(start_latitude = NULL, start_longitude = NULL,
  end_latitude = NULL, end_longitude = NULL, start_address = NULL,
  end_address = NULL, key = "", zoom = 14)

Arguments

start_latitude

Initial latitude.

start_longitude

Initial longitude.

end_latitude

Final latitude.

end_longitude

Final longitude.

start_address

Initial address.

end_address

Final address.

key

Google Maps API key (optional).

zoom

Map zoom, an integer from 3 (continent) to 21 (building).

Value

A ggplot2 graphics object.

Examples

## Not run: 
route_map(start_address = "37 Beach Road, Mouille Point, Cape Town",
          end_address = "100 St Georges Mall, Cape Town City Centre, Cape Town")

## End(Not run)

DataWookie/ubeR documentation built on Jan. 31, 2024, 3:15 a.m.