Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Unable to remove layer from map and add again #11

Closed
bushev opened this issue Jun 15, 2018 · 1 comment
Closed

Unable to remove layer from map and add again #11

bushev opened this issue Jun 15, 2018 · 1 comment

Comments

@bushev
Copy link

bushev commented Jun 15, 2018

Hello!

On map zoom I removed a layer from a map, load data points then create and attach new layer again.

private mapZommed() {
  const markers = await this.getMarkers();

  if (this.markersLayer) {
    this.markersLayer.remove();
  }

  this.markersLayer = (L as any).canvasIconLayer({}).addTo(this.map);

  this.markersLayer.addMarkers(markers);
}

After calling to markersLayer.remove(); I'm getting this error:

TypeError: null is not an object (evaluating 'this._map.containerPointToLayerPoint')

@eJuke eJuke closed this as completed in 8cfc039 Jun 20, 2018
@eJuke
Copy link
Owner

eJuke commented Jun 20, 2018

Hello,
Fixed this
Now layer should detach unused listeners on remove

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants