-
Notifications
You must be signed in to change notification settings - Fork 1.1k
TypeError: Cannot read property 'removeChild' of null #2038
Comments
I am facing the same issue. @nmccready : If you can look into this issue and add check for all three lines before removing child and listener that will be helpful. "MarkerLabel_.prototype.onRemove = function () { // Remove event listeners: |
Came across this same issue. The newer version of MarkerWithLabel at https://github.com/googlemaps/v3-utility-library/tree/master/markerwithlabel fixes this issue. I ended up just removing the MarkerWithLabel included in angular-google-maps and included the new version before this script is loaded |
The state of this application is tough as it is severely outdated. I spent a decent amount of time trying to get it building so I could test out the problems. Anyway, I did not get far. I will make more attempts later but please follow @danthul suggestions. |
@danthul how did you remove the MarkerWithLabel ? |
I just removed it from the file and took it local until this gets fixed. |
For anyone hitting this issue when clustering markers, it is a result of using third-party library of MarkerWithLabel
`MarkerLabel_.prototype.onRemove = function () {
var i;
this.labelDiv_.parentNode.removeChild(this.labelDiv_);
this.eventDiv_.parentNode.removeChild(this.eventDiv_);
// Remove event listeners:
for (i = 0; i < this.listeners_.length; i++) {
google.maps.event.removeListener(this.listeners_[i]);
}
};`
needs to change this:
this.labelDiv_.parentNode.removeChild(this.labelDiv_);
to this:
if (this.labelDiv_.parentNode){ this.labelDiv_.parentNode.removeChild(this.labelDiv_); }
@nmccready
any fix for that?
The text was updated successfully, but these errors were encountered: