google-map-react icon indicating copy to clipboard operation
google-map-react copied to clipboard

How can I set marker's location inside of Marker's component?

Open jiaming-jx opened this issue 10 years ago • 2 comments

I'm using redux and have to render an array of markers. I tried to normalize the array and only use keys of normalized array to iterate the marks and let marks render themselves in their own components. Is it possible with this library?

jiaming-jx avatar Jul 21 '16 01:07 jiaming-jx

Yes it's possible, but not easy ;-) In most cases even with redux it's better to write a selector for array items, as having lat, lng at map level will allow you to filter items, (As there is no need to render markers outside map bounds) Or create clusters http://istarkov.github.io/google-map-clustering-example/

istarkov avatar Jul 21 '16 10:07 istarkov

Thank you! Just figured out that I've over thought a little bit.

jiaming-jx avatar Jul 22 '16 00:07 jiaming-jx