# Visualize the shortest path with Leaflet

`path_leaflet.Rd`

The 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 function`shortest_path_igraph()`

, where`path = TRUE`

.- graph_object
The road network structured as a tidy graph (

`tbl_graph`

object). This can be done with the function`vegnett_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)
```