Fix console errors in some cases

This commit is contained in:
Fawad Mirzad
2021-04-29 02:46:52 +02:00
parent 9f3894aeb1
commit 2c027402a4

View File

@@ -103,11 +103,14 @@ export default buildComponent({
}, },
beforeUnmount() { beforeUnmount() {
/* Performance optimization when destroying a large number of markers */ /* Performance optimization when destroying a large number of markers */
if (this.$children && this.$children.length) {
this.$children.forEach((marker) => { this.$children.forEach((marker) => {
if (marker.$clusterObject === this.$clusterObject) { if (marker.$clusterObject === this.$clusterObject) {
marker.$clusterObject = null marker.$clusterObject = null
} }
}) })
}
if (this.$clusterObject) { if (this.$clusterObject) {
this.$clusterObject.clearMarkers() this.$clusterObject.clearMarkers()