add_reset_control | R Documentation |
This function adds a reset control to a Mapbox GL or MapLibre GL map. The reset control allows users to return to the original zoom level and center.
add_reset_control(map, position = "top-right", animate = TRUE, duration = NULL)
map |
A map object created by the |
position |
The position of the control. Can be one of "top-left", "top-right", "bottom-left", or "bottom-right". Default is "top-right". |
animate |
Whether or not to animate the transition to the original map view; defaults to |
duration |
The length of the transition from the current view to the original view, specified in milliseconds. This argument only works with |
The modified map object with the reset control added.
## Not run:
library(mapgl)
mapboxgl() |>
add_reset_control(position = "top-left")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.