istarkov / google-map-clustering-example

clustering example for google-map-react
http://istarkov.github.io/google-map-clustering-example/
200 stars 76 forks source link

Where to pass in geo data. #10

Open gt3240 opened 7 years ago

gt3240 commented 7 years ago

Hello, First of all, nice work on the clustering. I'm just exposed to recompse and not sure where to pass in the geo data I get back, can I get some pointers?

Thank you.

gt3240 commented 7 years ago

Figured out to pass it in the withState property.

withState(
    'markers',
    'setMarkers',
    ({providers}) => providers.map((item, index)=>({
            id: index,
            lat: item.addresses[0].latitude,
            lng: item.addresses[0].longitude
        }))
),
kunokdev commented 7 years ago

Where did you get data from? How do I read that data from container's state or redux? In example it loads data from static file import, but I currently I am unsure how to pass parent data the clean way?