iamanvesh / mapbox-gl-draw-circle

Supports drawing/editing a circle on a Mapbox map.
https://iamanvesh.github.io/mapbox-gl-draw-circle-test/
MIT License
74 stars 59 forks source link

how to make it work mapbox gl-draw #34

Open Aliber009 opened 3 years ago

Aliber009 commented 3 years ago

I have implemented, circlet modes into my mapboxDraw, and I have created a button to call the circle Draw function , but I dont know how to that , what function should I put when "onClick()" any help please

owolfy commented 3 years ago

Make sure that you:

  1. Added draw to map (map.addControl(draw))
  2. Added map draw listeners, draw.create and draw.update
  3. Created a button which calls to createCircle() { draw.changeMode('draw_circle', { initialRadiusInKm: 0.5 }); }