Em-Ant / fcc-options-app

Options Inc. web app development
Other
12 stars 7 forks source link

Clusters keep shaking as you interact with the map #35

Closed andrealonzo closed 8 years ago

andrealonzo commented 8 years ago

Not sure how to fix this. Maybe use shouldComponentUpdate and tell react not to update icon if the cluster is the same?

andrealonzo commented 8 years ago

This seems to be a known issue with google-maps react

https://github.com/tomchentw/react-google-maps/issues/172 https://github.com/tomchentw/react-google-maps/issues/210

andrealonzo commented 8 years ago

It seems like react-google-maps markerclusterer rerenders with every map event (pan, zoom, opening and close info windows). This doesn't seem like it matches the behavior of the normal markerclusterer library. Some possible ideas for fixes

  1. Debug react-google-map's markerclusterer and figure out why it keeps rerendering after a map event. It really should only rerender if something has changed.
  2. Use the normal markerclusterer library. This might work...but it means we're mixing React and non-react libraries.
  3. Limit the amount of map events. Maybe set a timeout to the marker mouseovers...?
andrealonzo commented 8 years ago

we will stop using clusters