title: Allow drawing only one shape at a time with Mapbox-GL-Draw
body: <p>I am using mapbox draw to draw a polygon. I would like it so that there can only be one drawn polygon on the screen at once. For example, the user draws a polygon and then clicks the polygon draw button again, the first polygon would be deleted. I have tried to do this using the draw.modechange but there is an error somewhere in way it is coded. When I clicked the polygon draw button, the existing polygon is deleted but when I try and draw the new polygon nothing is there. </p>
  
  <pre><code>this.map.on('draw.modechange', (e) =&gt; {
          const data = draw.getAll(); 
          console.log(draw.getMode());
          if (draw.getMode() == 'draw_polygon') {
             if (data.features.length &gt; 1) {
                 draw.deleteAll();
             }                
          } 
      }); 
  </code></pre>