MicheleBertoli / react-gmaps

A Google Maps component for React.js
http://react-gmaps.herokuapp.com/
MIT License
317 stars 68 forks source link

How to drop marker with a click #120

Closed thehatami closed 6 years ago

thehatami commented 6 years ago

i cant find any document about how i can drop a pin to map by user click. how can i do it?

maulberto3 commented 6 years ago

Hi. Try conditional rendering and a custom method.

MicheleBertoli commented 6 years ago

Thank you very much @thehatami @maulberto3. This is not something you'll find in the documentation as it's not specific to this package.

However, I built a simple demo to show you a potential approach to this problem.

click

Source

I hope this helps.