asroboy / google-maps-utility-library-v3

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

MarkerClusterer.removeMarkers only removes one marker #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
var markers = [...];
markerCluster.removeMarkers(markers);

What steps will reproduce the problem?
1. Initialize a markerClusterer
2. Add some markers
3. Try to remove more than one by passing an array of markers to removeMarkers

Expected result:
All markers in the array should be removed from the markerClusterer

Actual result:
Only the first successfully removed marker is removed from the markerClusterer. 
The function is using the OR (||) operator to track the return value of 
removeMarker_, but the operator short-circuits after the first successful 
remove. Here's the line of code:

removed = removed || this.removeMarker_(marker);

Version: r207

Browser / Operating System:
Safari, Chrome / Mac OS X

Additional comments:

*********************************************************
Tip: Star this issue (next to title) to receive notifications of status
changes against this issue, also used as a gauge for how many people are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by gke...@gmail.com on 7 Oct 2010 at 12:05

GoogleCodeExporter commented 8 years ago

Original comment by lu...@google.com on 10 Oct 2010 at 10:58