plotRoute | R Documentation |
Uses the leaflet package to plot the route on a map.
plotRoute(
route = NULL,
plotOnViewer = TRUE,
backgroundTile = providers$OpenStreetMap,
tileOpacity = 0.8,
routeOpacity = 0.8,
routeColour = "blue",
routeWeight = 2
)
route |
A route result from calculateRoute as an st_linestring object. |
plotOnViewer |
If the map should directly be plotted on RStudio-Viewer or not. If TRUE, nothing is returned, if FALSE, the function returns an object, which can be saved to file using the saveWidget function of the htmlwidgets package. Also, further leaflet map elements can be added by using pipes (%>%). |
backgroundTile |
A background tile of your choice (see list of options in leaflet::providers$) |
tileOpacity |
Opacity of background tiles. |
routeOpacity |
Opacity of displayed route. |
routeColour |
Colour of displayed route. |
routeWeight |
Weight of displayed route. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.