diff --git a/src/l-image-overlay.js b/src/l-image-overlay.js index dbb5e25..1eb7739 100644 --- a/src/l-image-overlay.js +++ b/src/l-image-overlay.js @@ -45,10 +45,6 @@ class LImageOverlay extends LLayer { ); } - disconnectedCallback() { - this.layer?.remove(); - } - attributeChangedCallback(name, _oldValue, newValue) { if (this.layer !== null) { if (name === "url") { diff --git a/src/l-layer.js b/src/l-layer.js index d94d46f..375387c 100644 --- a/src/l-layer.js +++ b/src/l-layer.js @@ -3,6 +3,10 @@ class LLayer extends HTMLElement { super() this.layer = null } + + disconnectedCallback() { + this.layer?.remove(); + } } export default LLayer