mapbox-gl-draw
mapbox-gl-draw copied to clipboard
allow to dynamically update the drawing controls
Exposes a new method called setControls
to dynamically toggle the
drawing controls
Example usage
const drawControl = new MapboxDraw({
displayControlsDefault: false,
controls: {
polygon: true,
trash: true,
},
});
// add the control to the map
map.addControl(drawControl, 'bottom-right');
// now show only the trash
drawControl.setControls({trash: true})
This is my first PR to this project and not sure if I missing some necessary step. I would appreciate any help to get this merged as it is a very handy feature.
fixes #824
Please merge this 👍
I'd also vote for this to be merged, would be super useful :)
I need to restrict users to only create 1 element and not multiple, and this would allow me to do that.
Hey, any update on this will be really really useful , thank you