map_trip: Make a Map from a Trip

Description Usage Arguments Value Examples

View source: R/valhalla.R

Description

Make a Map from a Trip

Usage

1
map_trip(trip, method = "leaflet")

Arguments

trip

A trip response from valhallr::route().

method

Which mapping service to use. Defaults to leaflet; also can use ggplot.

Value

A map object, either leaflet or ggplot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
  library(valhallr)
  # set up origin and destination data
  from <- test_data("uottawa")
  to <- test_data("cdntirecentre")

  # calculate the trip
  trip <- route(from = from, to = to)

  # show overall trip information
  print_trip(trip, all_details = FALSE)

  # make an interactive map of the trip using the leaflet package
  map_trip(trip, method = "leaflet")

## End(Not run)

valhallr documentation built on March 9, 2021, 9:09 a.m.