cybersthang / gmaps-utility-library-dev

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

MarkerClusterer - removeMarker throws exception #168

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In MarkerClusterer, calls to removeMarker fail with the following error in
FireFox:
clusters_[i].remove is not a function

The error is thrown from the following code (contained in
markerclusterer.js), third line - Cluster doesn't define a remove() function:

  this.removeMarker = function (marker) {
    for (var i = 0; i < clusters_.length; ++i) {
      if (clusters_[i].remove(marker)) {
        clusters_[i].redraw_();
        return;
      }
    }
  };

Original issue reported on code.google.com by bobbysoa...@gmail.com on 6 Dec 2009 at 9:14

GoogleCodeExporter commented 8 years ago

Original comment by pamela.fox on 6 Dec 2009 at 11:11

GoogleCodeExporter commented 8 years ago
Hi, 

I have checked the source code and fixed the problem:

#249, 'clusters_[i].remove(marker)' should be 
'clusters_[i].removeMarker(marker)'
#618 - 622, remove code and add below code:

if (index == 0){
    this.url_ = "";  
    this.height_ = 0;  
    this.width_ = 0;
    this.textColor_ = "";
    this.anchor_ = "";
  } else {
    this.url_ = styles[index - 1].url;
    this.height_ = styles[index - 1].height;
    this.width_ = styles[index - 1].width;
    this.textColor_ = styles[index - 1].opt_textColor;
    this.anchor_ = styles[index - 1].opt_anchor;
  }

final revision is attached

regards,
niyazi

Original comment by mn.ya...@gmail.com on 16 Jan 2011 at 6:54

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

The MerkerClusterer in tags ( 
http://code.google.com/p/gmaps-utility-library-dev/source/browse/tags/markerclus
terer/1.0/src/markerclusterer.js ) is buggy.

It's better to get the script from trunk ( 
http://code.google.com/p/gmaps-utility-library-dev/source/browse/trunk/markerclu
sterer/src/markerclusterer.js ).
It seems to be fixed several bugs.

Original comment by and...@gmail.com on 29 Aug 2011 at 2:53