garnishMap | R Documentation |
This function provides a versatile interface to add components to a
leaflet or mapview map. It takes functions such as "addMouseCoordinates"
or addLayersControl
and their respective arguments and adds
them to the map. Arguments must be named. Functions can be plain or
character strings.
garnishMap(map, ...)
map |
a mapview or leaflet object. |
... |
functions and their arguments to add things to a map. |
library(leaflet)
m <- leaflet() %>% addProviderTiles("OpenStreetMap")
garnishMap(m, addMouseCoordinates)
## add more than one with named argument
library(leaflet)
m1 <- garnishMap(m, addScaleBar, addMouseCoordinates,
position = "bottomleft")
m1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.