add_draw_control {mapgl} | R Documentation |
Add a draw control to a map
Description
Add a draw control to a map
Usage
add_draw_control(
map,
position = "top-left",
freehand = FALSE,
simplify_freehand = FALSE,
orientation = "vertical",
...
)
Arguments
map |
A map object created by the |
position |
A string specifying the position of the draw control. One of "top-right", "top-left", "bottom-right", or "bottom-left". |
freehand |
Logical, whether to enable freehand drawing mode. Default is FALSE. |
simplify_freehand |
Logical, whether to apply simplification to freehand drawings. Default is FALSE. |
orientation |
A string specifying the orientation of the draw control. Either "vertical" (default) or "horizontal". |
... |
Additional named arguments. See https://github.com/mapbox/mapbox-gl-draw/blob/main/docs/API.md#options for a list of options. |
Value
The modified map object with the draw control added.
Examples
## Not run:
library(mapgl)
mapboxgl(
style = mapbox_style("streets"),
center = c(-74.50, 40),
zoom = 9
) |>
add_draw_control()
## End(Not run)
[Package mapgl version 0.1.4 Index]