Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwriting button click to draw a different object #904

Open
ev0065 opened this issue Jul 22, 2019 · 2 comments
Open

Overwriting button click to draw a different object #904

ev0065 opened this issue Jul 22, 2019 · 2 comments
Labels
needs information question ui Buttons & user interactions

Comments

@ev0065
Copy link

ev0065 commented Jul 22, 2019

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 or draw_line_string modes to draw circles when they are clicked, but the draw_polygon button remains routed to draw_circle, no matter where I try to overwrite it. I believe this is due to draw_circle using draw_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!

@kkaefer kkaefer added ui Buttons & user interactions question labels Jan 7, 2020
@kkaefer
Copy link
Contributor

kkaefer commented Jan 9, 2020

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?

@Aliber009
Copy link

hello ev,
please can you tell me how can I reroute a button to circle mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs information question ui Buttons & user interactions
Projects
None yet
Development

No branches or pull requests

3 participants