powered by
This function adds the bounding box of a spatial object to a leaflet or mapview map.
addExtent(map, data, ...)
A leaflet or mapview map.
leaflet
mapview
A sf object to be added to the map.
sf
map
additional arguments passed on to addFeatures
addFeatures
library(leaflet) # Usage in leaflet leaflet() %>% addProviderTiles("OpenStreetMap") %>% addExtent(gadmCHE) leaflet(gadmCHE) %>% addProviderTiles("OpenStreetMap") %>% addExtent()
Run the code above in your browser using DataLab