urbica / react-map-gl-draw

React Component for Mapbox GL Draw
https://urbica.github.io/react-map-gl-draw
MIT License
50 stars 10 forks source link

Is there any way to limit drawing to one shape only? #14

Open AntwanSherif opened 4 years ago

AntwanSherif commented 4 years ago

I want to enable the user to draw only one polygon.

One way of doing this is to set "Polygon Control" to false when the user draws a shape and then reset it again to true if the user deletes the shape, but for some reason changing the "PolygonControl" prop values doesn't re-render and the control is always visible.

Am I doing something wrong?