Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Commit

Permalink
MarkerWithLabel fix for latest maps version. Closes #393.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcd committed Feb 15, 2018
1 parent 99a385c commit 045398d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions markerwithlabel/src/markerwithlabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,15 @@ MarkerLabel_.prototype.onAdd = function () {
*/
MarkerLabel_.prototype.onRemove = function () {
var i;
this.labelDiv_.parentNode.removeChild(this.labelDiv_);
if (this.labelDiv_.parentNode) {
this.labelDiv_.parentNode.removeChild(this.labelDiv_);
}

// Remove event listeners:
for (i = 0; i < this.listeners_.length; i++) {
google.maps.event.removeListener(this.listeners_[i]);
if (this.listeners_) {
for (i = 0; i < this.listeners_.length; i++) {
google.maps.event.removeListener(this.listeners_[i]);
}
}
};

Expand Down

0 comments on commit 045398d

Please sign in to comment.