SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
551 stars 131 forks source link

Pushing new markers live #122

Open catanab opened 8 years ago

catanab commented 8 years ago

As I am in a situation where the payload from the service is too big to be swallowed by the browser at once, I was thinking to have a pagination in service that will provide the payload in multiple steps.

My question here, is it possible to add more markers on the fly? I've already noticed that the data can be already updated live.

Thanks in advance.

fungiboletus commented 8 years ago

Yes, it is possible and one of the main feature of this library. I want to mention that each time you add markers, all the markers are sorted. The native sort algorithm is fast but it might start to be problematic after 100 000 markers (less on mobile). So you shouldn't have a too small pagination. By curiosity, how many markers do you plan to display ?

Le 10 juin 2016 5:40 PM, "catanab" notifications@github.com a écrit :

As I am in a situation where the payload from the service is too big to be swallowed by the browser at once, I was thinking to have a pagination in service that will provide the payload in multiple steps.

My question here, is it possible to add more markers on the fly? I've already noticed that the data can be already updated live.

Thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

catanab commented 8 years ago

thanks @yellowiscool for the fast response. the limit that I do have at this point is exactly 100k points, but might increase in the future. Is it possible to give an example how to add those on the fly? just to make sure I'm going to use the right methods.

Thanks.

fungiboletus commented 8 years ago

Use the RegisterMarker method to register each new marker, and when you are done, call ProcessView.

kasparsklavins commented 8 years ago

I'm displaying over 200k points with a pagination step of 5k per request without many problems. There is noticeable jittering but it's bearable. The points serverside, but not entirely sure if there is any performance gain from this in the browser.