guilhermedeevo / gmaps-utility-library-dev

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

MarkerClusterer: addMarkers() works odd when called after clearMarkers() #173

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. load
http://artax.karlin.mff.cuni.cz/~ttel5535/WEB_development/BUGS/091216-markerclus
terer/mk_bug.html

2. click the button above the map

What is the expected output? What do you see instead?
Expected result: there should be a point in the center of the map. It is
the last added point with coordinates 49.555945572471, 16.788193586955 .

Actual result: the point is missing in the center of the map but it is not!

What version of the product are you using? On what operating system?
MarkerClusterer v1.0, Google API v2, Firefox 3.5.5, OS WinXP.

Please provide any additional information below.
If you remove the call to clearMarkers(), it works as expected - see :
http://artax.karlin.mff.cuni.cz/~ttel5535/WEB_development/BUGS/091216-markerclus
terer/mk_bug_disappear.html

It doesn't matter whether there are any markers or not when you call
clearMarkers().

Original issue reported on code.google.com by tomas.te...@gmail.com on 16 Dec 2009 at 3:20

Attachments:

GoogleCodeExporter commented 8 years ago
Also, there is another problem!!! When you zoom out so that you see the whole 
earth,
the clusters will not cluster together! And again, if you remove the call to
clearMarkers(), it works as expected - the bug disappears.

And another problem - if you set maxZoom to some value in this example, it will 
not
respect it - the cluster will remain even in the maximal zoom possible. And 
again, if
you remove the call to clearMarkers(), it works as expected - the bug 
disappears.

It seems that if you call clearMarkers() and then addMarkers(), the markers go 
into
some erroneous state in which they are no longer dynamic.

Original comment by tomas.te...@gmail.com on 12 Jan 2010 at 8:22

GoogleCodeExporter commented 8 years ago
The problem with the clearMarkers is that the function removes the GEvent 
listener so
the clusterer no longer reacts to zoom levels or changes to the GMap2 object.

Basically to fix the problem I commented out this line from the 
markerclusterer.js(146):

GEvent.removeListener(mcfn_);

Original comment by n9.adr...@gmail.com on 8 Apr 2010 at 4:40