mapbox-gl-draw
mapbox-gl-draw copied to clipboard
Disable/Remove Controls
Hi,
I think that allowed the possibility to disable or remove controls could be interesting.
For example you want the user to create a polygon or a point but only one and still let him use update function or delete ... Actually as far as i know you can't block drawing action that mean he can create as many polygon he wants and i can't find a way to update controls.
+1 same use case here. There should be a way to update the options after initialization.
I am in need of this feature as we only allow a user to define one polygon. I'd like to be able to disable the polygon control unless they hit delete in which case I would re-enable. A simple method to update the control state would be ideal
Got around this for now by directly accessing the button via the DOM and setting disabled
when a draw
event is fired and enabling it again when the delete
event is fired.