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

Add circle programmatically #9

Closed bashtian closed 5 years ago

bashtian commented 5 years ago

I would like to add a non editable circle with a specified lat/lon and radius programmatically and clicking on the circle should make it editable. Is this currently possible with this library?

iamanvesh commented 5 years ago

You'd have to pass geometry in the same format as specified in the README, and change the mode to simple_select by passing that particular feature's id in featureIds option. Please refer to this link for more information.

gyenabubakar commented 3 years ago

@iamanvesh Could you add a code example, please?