This function adds the bounding box of a spatial object to a leaflet or mapview map.
Arguments
- map
A
leaflet
ormapview
map.- data
A
sf
object to be added to themap
.- ...
additional arguments passed on to
addFeatures
Examples
library(leaflet)
# Usage in leaflet
leaflet() %>%
addProviderTiles("OpenStreetMap") %>%
addExtent(gadmCHE)
leaflet(gadmCHE) %>%
addProviderTiles("OpenStreetMap") %>%
addExtent()