Skip to content

Commit

Permalink
Merge pull request #28 from mo-analameira/feature/add-layer-removal-a…
Browse files Browse the repository at this point in the history
…ll-layers

Add layer removal to disconnect callback for all layers
  • Loading branch information
andrewgryan authored Jul 17, 2024
2 parents 0924dea + be44899 commit 3d2a13e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/l-image-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ class LImageOverlay extends LLayer {
);
}

disconnectedCallback() {
this.layer?.remove();
}

attributeChangedCallback(name, _oldValue, newValue) {
if (this.layer !== null) {
if (name === "url") {
Expand Down
4 changes: 4 additions & 0 deletions src/l-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ class LLayer extends HTMLElement {
super()
this.layer = null
}

disconnectedCallback() {
this.layer?.remove();
}
}

export default LLayer

0 comments on commit 3d2a13e

Please sign in to comment.