Skip to content

Commit a36d889

Browse files
author
Nicolò Maria Mezzopera
authored
Merge pull request #386 from anhnhoktvn/master
fix unbind tooltip
2 parents 09c46e6 + 1468c4f commit a36d889

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/components/LPopup.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ export default {
3030
},
3131
beforeDestroy () {
3232
if (this.parentContainer) {
33-
this.parentContainer.unbindPopup();
33+
if (this.parentContainer.unbindPopup) {
34+
this.parentContainer.unbindPopup();
35+
} else if (this.parentContainer.mapObject && this.parentContainer.mapObject.unbindPopup) {
36+
this.parentContainer.mapObject.unbindPopup();
37+
}
3438
}
3539
}
3640
};

src/components/LTooltip.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export default {
2121
},
2222
beforeDestroy () {
2323
if (this.parentContainer) {
24-
this.parentContainer.unbindTooltip();
24+
if (this.parentContainer.unbindTooltip) {
25+
this.parentContainer.unbindTooltip();
26+
} else if (this.parentContainer.mapObject && this.parentContainer.mapObject.unbindTooltip) {
27+
this.parentContainer.mapObject.unbindTooltip();
28+
}
2529
}
2630
}
2731
};

0 commit comments

Comments
 (0)