Skip to content

Commit c1d2c2f

Browse files
author
Nicolò Maria Mezzopera
authored
Merge pull request #276 from byWulf/master
Bugfix Icon component
2 parents ac4f076 + 5a306f9 commit c1d2c2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/LIcon.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default {
106106
107107
beforeDestroy () {
108108
if (this.parentContainer.mapObject) {
109-
this.parentContainer.mapObject.setIcon(null);
109+
this.parentContainer.mapObject.setIcon(this.parentContainer.$props.icon);
110110
}
111111
112112
this.observer.disconnect();
@@ -127,7 +127,7 @@ export default {
127127
128128
createIcon () {
129129
// If only html of a divIcon changed, we can just replace the DOM without the need of recreating the whole icon
130-
if (this.htmlSwapNeeded && !this.recreationNeeded && this.iconObject) {
130+
if (this.htmlSwapNeeded && !this.recreationNeeded && this.iconObject && this.parentContainer.mapObject.getElement()) {
131131
this.parentContainer.mapObject.getElement().innerHTML = this.$el.innerHTML;
132132
133133
this.htmlSwapNeeded = false;

0 commit comments

Comments
 (0)