3
0

Prevent map error in CMap when switching to another page

This commit is contained in:
Katrin Yordanova 2023-12-22 17:42:54 +02:00
parent e154703af1
commit 17ed47744e

View File

@ -282,13 +282,15 @@ export default {
},
onBoundsUpdate (value) {
setTimeout(() => {
this.$refs.map.mapObject.invalidateSize()
}, 100)
value = value || this.$refs.map.mapObject.getBounds()
this.$emit('on-bounds-update', value)
if (this.$refs.map) {
setTimeout(() => {
this.$refs.map.mapObject.invalidateSize()
}, 100)
value = value || this.$refs.map.mapObject.getBounds()
this.$emit('on-bounds-update', value)
}
}
},
}