flaviusdemian / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
0 stars 0 forks source link

too much recursion over 300 markers #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
this.clusterer.addMarkers(this.arrayMarkerClusterer);

this.arrayMarkerClusterer contains about 600 markers with click event attached 
(onclick simply opens a shared infowindow object).

The method works fine if the array contains no more than 300 markers, 
displaying clusters and markers when zoomed in, otherwise the browser get 
blocked with a too much recursion error.

Version: 1.0

Browser / Operating System:
[e.g. FF3 / Windows XP]

Original issue reported on code.google.com by orionero...@gmail.com on 6 Jul 2010 at 7:38

GoogleCodeExporter commented 9 years ago
Can you setup a test page to look at that shows the problem?

Original comment by lu...@google.com on 31 Aug 2010 at 1:42

GoogleCodeExporter commented 9 years ago
the Clusterer is capable to handle up to 5000 markers in IE8 on my laptop which 
is not the fastest, but yea it highly depends on how fast the client machine 
is. The Clusterer has to iterate over all markers if it calculates the 
clusters, there are some recursive iterations etc which at some point may take 
some time.

I did a lot of work and research of how to get things fast enough for one of my 
projects, attached you'll see an example implementation of a map and marker 
pooled view with multiple map/tabs and over 5000markers on each map. This was 
an early implementation so please don't blame me for errors or what not, I did 
a lot more implementations like this but at the end I came to the conclusion 
that JavaScript on the Client is NOT capable to handle that amount of markers. 
That’s why I've implemented a Ajax service for my project to do all the 
clustering and marker management etc... and yes this is now very fast and can 
easily handle 100000+markers ^^
But anyway, may be the code can help you with some problems...

JavaScript has enormous performance problems when it comes to recursive 
function calls and complex calculation together with large amount of data. 
Especially Internet Explorer has big problems...

Original comment by elak....@gmail.com on 2 Sep 2010 at 11:25

Attachments:

GoogleCodeExporter commented 9 years ago
I've notice that on IE7 is very slow. Even if the zoom level is more than the 
maximum zoom and no clustering happens, the Marker drawing is slow. And I have 
less then 20 points.

Another strange thing is that the markercluster.js from the svn repository runs 
slower that the one used for the online examples (no, it's not the same in the 
example folder on svn).

I've also seen that there is a porting of ClusterMarker here: 
http://test.3dflat.com/clustermarker/index.php.
I do not like it but it seems to run smooth on IE7.

Original comment by vcausar...@gmail.com on 21 Oct 2010 at 7:00

GoogleCodeExporter commented 9 years ago
Adding
   that.redraw();
after
   that.resetViewport();
in 
MarkerClusterer constructor make everthing smoother (because to render the 
markers it doesn't need to wait 'idle').

Original comment by vcausar...@gmail.com on 22 Oct 2010 at 1:52

GoogleCodeExporter commented 9 years ago
Are you guys still seeing issues? I've done a number of updates over the last 
few months.

Original comment by lu...@google.com on 23 Mar 2011 at 10:45

GoogleCodeExporter commented 9 years ago
I'm still seeing issues on IE7/8 and on slower CPUs. When over 1000 markers on 
a map it's wise to pre-filter the markers based on whether they are in the map 
bounds and only pass them to the clusterer if they are.

Original comment by rankerss...@gmail.com on 23 Apr 2011 at 4:22