powered by
Add a draw control to a map
add_draw_control(map, position = "top-left", freehand = FALSE, ...)
The modified map object with the draw control added.
A map object created by the mapboxgl or maplibre functions.
mapboxgl
maplibre
A string specifying the position of the draw control. One of "top-right", "top-left", "bottom-right", or "bottom-left".
Logical, whether to enable freehand drawing mode. Default is FALSE.
Additional named arguments. See https://github.com/mapbox/mapbox-gl-draw/blob/main/docs/API.md#options for a list of options.
if (FALSE) { library(mapgl) mapboxgl( style = mapbox_style("streets"), center = c(-74.50, 40), zoom = 9 ) |> add_draw_control(position = "top-left", freehand = TRUE) }
Run the code above in your browser using DataLab