powered by
This function adds a button to the map that enables zooming to a provided extent / bbox.
extent
bbox
Use removeHomeButton to remove home button
addHomeButton(map, ext, layer.name = "layer", position = "bottomright", add = TRUE)removeHomeButton(map)
removeHomeButton(map)
a mapview or leaflet object.
the extent / bbox to zoom to.
the name of the layer to be zoomed to (or any character string)
the position of the button (one of 'topleft', 'topright', 'bottomleft', 'bottomright'). Defaults to 'bottomright'.
logical. Whether to add the button to the map (mainly for internal use).
removeHomeButton: remove a homeButton from a map
removeHomeButton
library(raster) m <- leaflet() %>% addTiles() %>% addCircleMarkers(data = breweries91) %>% addHomeButton(extent(breweries91), "breweries91") m ## remove the button removeHomeButton(m)
Run the code above in your browser using DataLab