nikeshydav / gmaps-samples-v3

Automatically exported from code.google.com/p/gmaps-samples-v3
0 stars 0 forks source link

Map throws errors and breaks if infoBoc.remove() is called #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create and add an InfoBox
2. execute myInfoBox.remove()
3. Zoom the map more than once.  The map no longer draws.  Firefox error 
console shows: 
"Error: a is null
Source File: http://maps.gstatic.com/intl/en_us/mapfiles/api-3/3/8/main.js
Line: 16"

Original issue reported on code.google.com by jake.puf...@gmail.com on 4 Feb 2011 at 2:33

Attachments:

GoogleCodeExporter commented 9 years ago
I had the same error. I think setting the Map to null in the remove function 
fixes this.
It worked for me.
Modified code:

InfoBox.prototype.remove = function() {
  this.setMap(null);//added to fix this issue
  if (this.div_) {
    this.div_.parentNode.removeChild(this.div_);
    this.div_ = null;
  }
};

Original comment by yosoyjav...@gmail.com on 5 Apr 2012 at 11:08