-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
[question] Caching Issue #115
Comments
Some of our code that demonstrates usage.
|
I have faced what I think is a variation of the same issue, from what I understood, from the behaviour and looking at the code, it seems once the function is initially set, the iconCreateFunction will never be updated. If you change the key on MarkerClusterGroup it will work though, as it will force react to dump the old instance and create the new one. |
I ended up just using natively built leaflet markers & using the cluster ref to append them. |
since I don't see any specific handler for iconCreateFunction, isn't this react-leaflet problem? EDIT: I'll answer this myself. No it isn't. This plugin just doesn't implement updateLeafletElement |
I've came out with following addition. It requires id prop (must be same as key) to be added to the Marker
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I need more information on this. For me, the iconCreateFunction is still not updating it still show the same cluster icon color(but the number of the marker in the cluster is showing correctly) |
Related #149 (comment) |
When changing the data in the state that gets rendered to the map our markercluster reference to .getAllChildMarkers() appears to have mixed cache & new data.
When logging the context value, it appears to be 100% correct, however, if I log the value of cluster.getAllChildMarkers() in the iconCreateFunction that I've made, I get a mix between newly added data & stale "cached" data that shouldn't be in there.
I think this is due to updateLeafletElement not being implemented. Our position may not change for some markers, however, the values will, thus resulting in this pseudo caching.
The text was updated successfully, but these errors were encountered: