-
-
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
chunkedLoading doesn't work on subsequent updates #76
Comments
What version of react-leaflet-markercluster do you use - |
I'm having exactly the same problem, running 1.8.1. |
I've just tested 2.0.0-rc3 and I'm seeing the same results... |
My code:
PS. sorry for spamming |
I am using 1.1.8 and react-leaflet 1.8.2 |
Another update. I noticed that addLayers (where chunkedLoading is supported) is not called when the markers are sent as new props to the already mounted map and markerclustergroup component. Not sure why. When I use a ref to manually call addLayers even if the markerclustergroup is already mounted, then it works fine. I don't know enough about the react-leaflet architecture to know if this is valid behavior or not. |
Is there any progress on the issue? |
@StazriN Did you try to use |
Yes I did. Same problem. |
I'm also having this issue on 2.0.0-rc3 |
Yep, same problem here (also 2.0.0-rc3). |
Same issue for me. After looking at the code I notice that 2.0.0-rc3 doesn't support bulk adding of markers, see https://github.com/Leaflet/Leaflet.markercluster#bulk-adding-and-removing-markers. Each time a child to MarkerClusterGroup is rendered the MapLayer from react-leaflet calls layerContainer.addLayer(). This causes severe performance issues for us when having about 2000 markers. I forked this repo and modified the addLayer function to support bulk adding of many layers/markers (see code here https://github.com/olabalboa/react-leaflet-markercluster/blob/master/src/react-leaflet-markercluster.js). Try it out if you like to see if it solves your problem. In that case I can open a pull request. Any comments or improvement suggestions are appreciated :-) |
Hi, I've tested this and it works great. I've measured performance before
and after but it makes a noticeable difference.
Thanks, Max B
…On Tue, Nov 20, 2018 at 11:53 AM olabalboa ***@***.***> wrote:
Same issue for me. After looking at the code I notice that 2.0.0-rc3
doesn't support bulk adding of markers, see
https://github.com/Leaflet/Leaflet.markercluster#bulk-adding-and-removing-markers
.
Each time a child to MarkerClusterGroup is rendered the MapLayer from
react-leaflet calls layerContainer.addLayer(). This causes severe
performance issues for us when having about 2000 markers.
I forked this repo and modified the addLayer function to support bulk
adding of many layers/markers (see code here
https://github.com/olabalboa/react-leaflet-markercluster/blob/master/src/react-leaflet-markercluster.js
).
Try it out if you like to see if it solves your problem. In that case I
can open a pull request. Any comments or improvement suggestions are
appreciated :-)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#76 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABbGQHj5WCGaorzffiREXzPvO8JJXaYxks5uw-1OgaJpZM4VcLI9>
.
|
Apologies, I've sent my last mail too soon.
I've _not_ measured performance before and after, but it makes a noticeable
difference.
Thanks, Max B
…On Tue, Nov 27, 2018 at 1:08 PM Max ***@***.***> wrote:
Hi, I've tested this and it works great. I've measured performance before
and after but it makes a noticeable difference.
Thanks, Max B
On Tue, Nov 20, 2018 at 11:53 AM olabalboa ***@***.***>
wrote:
> Same issue for me. After looking at the code I notice that 2.0.0-rc3
> doesn't support bulk adding of markers, see
> https://github.com/Leaflet/Leaflet.markercluster#bulk-adding-and-removing-markers
> .
>
> Each time a child to MarkerClusterGroup is rendered the MapLayer from
> react-leaflet calls layerContainer.addLayer(). This causes severe
> performance issues for us when having about 2000 markers.
>
> I forked this repo and modified the addLayer function to support bulk
> adding of many layers/markers (see code here
> https://github.com/olabalboa/react-leaflet-markercluster/blob/master/src/react-leaflet-markercluster.js
> ).
>
> Try it out if you like to see if it solves your problem. In that case I
> can open a pull request. Any comments or improvement suggestions are
> appreciated :-)
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#76 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABbGQHj5WCGaorzffiREXzPvO8JJXaYxks5uw-1OgaJpZM4VcLI9>
> .
>
|
I currently load the map with 0 markers while the marker data is being fetched from the backend. Once the markers are available, they are passed as children to MarkerClusterGroup. Even though I am loading quite a few data points (~10-15K) and using chunkInterval=50, I see no calls chunkProgress function.
If I don't render the map until the markers are available, then chunkedLoading works just fine. Let me know what details I could provide here to help solve this issue.
The text was updated successfully, but these errors were encountered: