Visualize the shortest path with Leaflet
path_leaflet.RdThe function path_leaflet visualizes the shortest path (in minutes or meters) that has been calculated with the function shortest_path_igraph() (where path = TRUE).
Internet connection is required to load the background tiles.
Arguments
- path
Object (
list) that has been created with the functionshortest_path_igraph(), wherepath = TRUE.- graph_object
The road network structured as a tidy graph (
tbl_graphobject). This can be done with the functionvegnett_to_R().
Value
Interactive Leaflet map that shows the shortest path (in minutes or meters) between a chosen from and to node in the road network.
Examples
shortest_path_igraph(from_node_ID = 25,
to_node_ID = 33,
unit = "minutes",
path = TRUE,
graph_object = graph_sampledata) %>%
path_leaflet(graph_object = graph_sampledata)