mapbox-gl-jsmapbox-gl-draw

How to set position of mapbox-gl-draw control?


I'm using https://github.com/mapbox/mapbox-gl-draw for draw tools, and it by default sets the control position to the top right. Like so: enter image description here

It seems like it's possible to change the position of the control by setting an option, but I cannot figure out how to do so. I've been looking through the source and the documentation.


Solution

  • you can set the position in the addControl method.

    var Draw = new MapboxDraw();
    
    map.addControl(Draw, 'bottom-left');