1
votes

Using Mapbox-gl-draw (https://github.com/mapbox/mapbox-gl-draw)

I am able to get the basic example up and running, and this package does everything I need. However, I am having trouble figuring out how to activate the draw functionality programatically. For example, my application has some panel overlays, and as part of a form I'd like to activate the draw ability by clicking a custom button, not the control button that shows on the map. Ideally I'd like to keep the map control button hidden (which I can do).

I've scoured the documentation with no luck. Anyone have any insight?

Demo of the functionality I am referring to here: https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/

1
Maybe provide the answer you've got on GitHub (github.com/mapbox/mapbox-gl-draw/issues/…) also here?pathmapper

1 Answers

1
votes

It's documented in the API reference

changeMode(mode: string, options?: Object): draw

Changes Draw to another mode. Returns the draw instance for chaining.