googlearchive / js-marker-clusterer

A marker clustering library for the Google Maps JavaScript API v3.
https://googlemaps.github.io/js-marker-clusterer/docs/reference.html
Apache License 2.0
1.28k stars 769 forks source link

crash on big data #84

Open mjheidari opened 8 years ago

mjheidari commented 8 years ago

Hi. i use only about 100,000 marker, but it's crash the browser!!

dylannz commented 8 years ago

Yep - having the same issue.

ldrrp commented 8 years ago

100,000 markers, i think its time for server side clustering. Or limit your zoom levels

Do something like so:

if bounds area is greater than X amount, then count() markers in area by however accuracy you want, like

round(latitude, 2) round(longitude, 2)

Accuracy by decimal point: http://gis.stackexchange.com/questions/8650/how-to-measure-the-accuracy-of-latitude-and-longitude

ghost commented 7 years ago

@ldrrp It's failing on only 10,000-15,000 markers for me. It's not crashing the browser though, it just refuses to display the clusters. I can try to display the 10,000 and it won't work but then right after in the same instance I try 1,000 and it works.

ffflabs commented 7 years ago

I had the same issue and it turns out it was because of redraw method. It's called each time you add a new marker, so adding 1000+ markers called 1000 redraws.

I solved it by deboucing the redraw method (using underscore's debounce, but your mileage might vary)