smithmicro / mapbox-gl-circle

A *google.maps.Circle* replacement for Mapbox GL JS
https://smithmicro.github.io/mapbox-gl-circle/
ISC License
55 stars 26 forks source link

Need dynamic options #72

Open Rajavelu opened 6 years ago

Rajavelu commented 6 years ago

Its good if support dynamic options like fillcolor / editable will change dynamically.

feature_request

fc commented 5 years ago

At the moment, it looks like this can be sometimes be achieved by removing and re-adding the circle, e.g.,

circle.remove();
circle.options.editable = false;
circle._updateCircle(); // <-- this re-initializes internal values of the circle
circle.addTo(map);

I can't say for certain if the above is always a safe approach. It is likely safer to just re-create the circle entirely instead of doing the above (e.g., create a copyCircle function).