Adds a Toolbar to draw shapes/points on the map.
Removes the draw toolbar
addDrawToolbar(map, targetLayerId = NULL, targetGroup = NULL,
position = c("topleft", "topright", "bottomleft", "bottomright"),
polylineOptions = drawPolylineOptions(),
polygonOptions = drawPolygonOptions(),
circleOptions = drawCircleOptions(),
rectangleOptions = drawRectangleOptions(),
markerOptions = drawMarkerOptions(), editOptions = FALSE,
singleFeature = FALSE)removeDrawToolbar(map, clearFeatures = FALSE)
The map widget.
An optional layerId of a GeoJSON/TopoJSON layer whose features need to be editable. Used for adding a GeoJSON/TopoJSON layer and then editing the features using the draw plugin.
An optional group name of a Feature Group whose features need to be editable. Used for adding shapes(markers,lines,polygons) and then editing them using the draw plugin. You can either set layerId or group or none but not both.
The position where the toolbar should appear.
See drawPolylineOptions
(). Set to FALSE to disable polyline drawing.
See drawPolygonOptions
(). Set to FALSE to disable polygon drawing.
See drawCircleOptions
(). Set to FALSE to disable circle drawing.
See drawRectangleOptions
(). Set to FALSE to disable rectangle drawing.
See drawMarkerOptions
(). Set to FALSE to disable marker drawing.
By default editing is disable. To enable editing pass editToolbarOptions
().
When set to TRUE, only one feature can be drawn at a time, the previous ones being removed.
whether to clear the map of drawn features.