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

MarkerWithLabel: Cannot read property 'removeChild' of null #393

@awiprayitno

Description

@awiprayitno

In combination with MarkerClusterer, error happened when MarkerClusterer remove Marker
Error was:
Uncaught TypeError: Cannot read property 'removeChild' of null at MarkerLabel_.onRemove (eval at <anonymous> (markerwithlabel_packed.js:1), <anonymous>:1:5570)
Note that this error happened both on the packed and non packed version.

Solution:
I added two ifs in the following (line 307), which fixed this.
MarkerLabel_.prototype.onRemove = function () { var i; if (this.labelDiv_.parentNode) { this.labelDiv_.parentNode.removeChild(this.labelDiv_); } // Remove event listeners: if (this.listeners_) { for (i = 0; i < this.listeners_.length; i++) { google.maps.event.removeListener(this.listeners_[i]); } } };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions