urbica / react-map-gl-draw

React Component for Mapbox GL Draw
https://urbica.github.io/react-map-gl-draw
MIT License
50 stars 11 forks source link

Map doesnt catch click when drawing (polygon) on map #23

Closed daniela-green closed 3 years ago

daniela-green commented 3 years ago

When i draw a polygon on map, i want to be able to also click the map. But my on click event of the map is not fired when polygon is drawn. How can i get the map (and its layers) to be interactive at this point?

Thanks!

daniela-green commented 3 years ago

Basically what i want to do is to click the circle layer inside the polygon. Until now i did it via onClick of the MapGL, but maybe theres another way to achieve that?

daniela-green commented 3 years ago

Closing this as i understood the issue by myself. The map is not interactive when mode is in EditingMode or in DrawPolygonMode. Changing the mode to null after polygon is added, makes the map interactive again.

dudio92 commented 2 years ago

Thanks for that.