1

I'd like to use Mapbox-GL-Draw in an app, but want to trigger polygon drawing from a button that exists outside the Mapbox map container, and not display the normal drawing control.

A hacky way to do this would be to simply move the button after it's created, but is there a simple, cleanish way to start the drawing process?

Steve Bennett
  • 114,604
  • 39
  • 168
  • 219

1 Answers1

5

Oh, it looks like the answer is as simple as:

drawControl.changeMode('draw_polygon');
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219