-
Notifications
You must be signed in to change notification settings - Fork 936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OverlayViews are added to a surrounding MarkerClusterer but not removed on unmount #301
Comments
Released v5.1.1 |
@camiel why would you need to render |
@tomchentw I needed it for custom markers for which regular markers are too limited but I still required clustering. |
@camiel Got it. Unfortunately, I removed this feature in the6.0.0 version. It would be great if you can take a look at new changes and if you like, submit a new PR with a demo page. It should be easier to do it in 6.0.0 Also, 6.0.0 is released on npm beta tag now. We also have a new demo page. Feel free to try it: |
Hi @camiel, hi @tomchentw, I'm using custom markers with I'm changing the marker's icon on click, I see in logs that Do you have any suggestion on how one can update the marker icons on clicks ? Should I use OverlayView to fake a change of icon ? Do you know why the map display doesn't update ? |
Well I eventually tried OverlayView and it works very well, even with 8000 clustered markers that are in a separate React smart component. In case anyone would be looking for it, this works to put a highlighted marker in place of a clicked one:
|
Does anyone have a working example of a clusterer with custom overlayviews for each marker? I'm struggling to find anything concrete on this. |
Please refer to Getting Help section in the README (or #469). |
I seem that if this link don't work: better you try this: |
For Markers the MarkerCreator adds the marker to the surrounding MarkerClusterer (https://github.com/tomchentw/react-google-maps/blob/master/src/creators/MarkerCreator.js#L77). In the Marker component the marker is removed from this clusterer when componentWillUnmount is called: (https://github.com/tomchentw/react-google-maps/blob/master/src/Marker.js#L98). For OverlayViews the OverlayViewCreator does add the view to the surrounding MarkerClusterer (https://github.com/tomchentw/react-google-maps/blob/master/src/creators/OverlayViewCreator.js#L189), but it is never removed. Because of this OverlayViews remain in the clusterer while they should have been removed.
To illustrate this bug with an example, which is added to the gh-pages example project in https://github.com/camiel/react-google-maps/tree/bug-marker-clusterer-overlay-view, consider this component that always renders 10 overlay views in a MarkerClusterer. Every 1 second one OverlayView is removed while a new one is added. Due to the bug the cluster will keep growing instead.
The text was updated successfully, but these errors were encountered: