kkpowar / gmaps-utility-library-dev

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

LabeledMarker and MarkerManager don't worke well together (this.div_ is undefined) #92

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add a LabeledMarker which is outside of the current viewport to a
MarkerManager. Call marker.hide() on the new marker. (marker is still not
in viewport).

What is the expected output? What do you see instead?
js-error: this.div_ is undefined

What version of the product are you using? On what operating system?
MarkerManager 1.1
LabeledMarker 1.3 r933

Original issue reported on code.google.com by gerp...@gmail.com on 6 Mar 2009 at 11:55

GoogleCodeExporter commented 8 years ago
Hi gerpres-

Can you try changing your LabeledMarker applyLabelVisibility_ function to the 
following, and let me know if it fixes it?
LabeledMarker.prototype.applyLabelVisibility_ = function () {
  if ((!this.isHidden()) && this.labelVisibility_ && this.div_) {
    this.div_.style.display = 'block';
  } else {
    this.div_.style.display = 'none';
  }
};

Original comment by pamela.fox on 8 Mar 2009 at 8:36

GoogleCodeExporter commented 8 years ago
this would not work, because if the div is undefined, this code would try to 
access
the div in the else-block.

the change should look something like this:
if(this.div_){
      if ((!this.isHidden()) && this.labelVisibility_) {
            this.div_.style.display = 'block';
          } else {
            this.div_.style.display = 'none';
          }
  }

cu

Original comment by gerp...@gmail.com on 9 Mar 2009 at 7:09

GoogleCodeExporter commented 8 years ago
Thanks, good catch.

Original comment by pamela.fox on 26 Mar 2009 at 1:02

GoogleCodeExporter commented 8 years ago
Committed fix in r965.

Original comment by pamela.fox on 26 Mar 2009 at 1:03

GoogleCodeExporter commented 8 years ago

Original comment by pamela.fox on 23 Jun 2009 at 9:57