add_home_button {webmap} | R Documentation |
Add home button to a web map
Description
Add a button to a Leaflet map that zooms to the provided map extent.
Usage
add_home_button(map, extent = NULL, position = "topleft")
Arguments
map |
'leaflet'. Map widget object |
extent |
'bbox', or 'numeric' vector of length four, with |
position |
'character' string. Position of the button on the web map. Possible values are "topleft", "topright", "bottomleft", and "bottomright". |
Value
A new HTML web map
with added element, an object of class 'leaflet'.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
See Also
make_map
function for creating a map widget.
Examples
make_map(maps = "Topo") |>
add_home_button(
extent = c(-124.409, -114.131, 32.534, 42.009) # California
)