plotRoute: Plot html map view of route

View source: R/plotRoute.R

plotRouteR Documentation

Plot html map view of route

Description

Uses the leaflet package to plot the route on a map.

Usage

plotRoute(
  route = NULL,
  plotOnViewer = TRUE,
  backgroundTile = providers$OpenStreetMap,
  tileOpacity = 0.8,
  routeOpacity = 0.8,
  routeColour = "blue",
  routeWeight = 2
)

Arguments

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.


ivt-baug-ethz/brouterR documentation built on Dec. 9, 2024, 8:59 p.m.