brunorichart / gmaps-utility-library-dev

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

MarkerClusterer: cluster displays initial markers count after I removed all its markers one by one #184

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Loaded data, seeing a cluster image showing that there're 2 markers in it <= 
CORRECT
2. calling removeMarker(marker1) on Clusterer, the cluster icon dissapeared and 
original marker 
icon rendered <= CORRECT, since there's just one marker remained in the cluster
3. calling removeMarker(marker2) on Clusterer it renders the same image showing 
2 markers in it 
as it was on step 1. <= INCORRECR

What is the expected output? What do you see instead?

All icons should gone after step 3 since there's no markers left in the cluster.

- I managed to get it work well by changing the condition in Cluster's 
'redraw_' method from:

if (zoom_ >= mz || this.getTotalMarkers() === 0)

to 

if (zoom_ >= mz || this.getTotalMarkers() <= 1)

though I am not quite sure that's a good solution... Please let me know if 
you'd like to attach a 
patch though. 

Pavlo

Original issue reported on code.google.com by pavli...@gmail.com on 25 Jan 2010 at 10:04