Open ev0065 opened 5 years ago
It sounds like you're trying to hijack an existing button in order to toggle a custom mode. Can you use a new/custom button instead of reusing an existing one?
hello ev, please can you tell me how can I reroute a button to circle mode
Hi, so on my current setup I am using react-mapbox-gl with mapbox-gl-draw and mapbox-gl-draw-circle.
I am able to reroute the
draw_marker
ordraw_line_string
modes to draw circles when they are clicked, but thedraw_polygon
button remains routed todraw_circle
, no matter where I try to overwrite it. I believe this is due todraw_circle
usingdraw_polygon
to draw the circle on the map.For example, when I click the marker button, I made it draw a circle on the map. However, when I click the polygon button, it still draws a circle on the map instead of a regular polygon.
So, here's my question: Is it possible to overwrite a buttons for different drawing functionality? (EX: The marker button draws a circle and the polygon button draws a polygon, or the polygon button draws a circle and the line button draws a polygon, etc...)
Thanks!