3
0

Properly fix mapObject undefined error in CMap when switching to another page

This commit is contained in:
Katrin Yordanova
2024-01-03 14:19:05 +02:00
parent 620583aaf7
commit db2bdf3246

View File

@@ -282,16 +282,14 @@ export default {
},
onBoundsUpdate (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)
}
}
this.$nextTick(() => {
this.$refs.map.mapObject.invalidateSize()
})
value = value || this.$refs.map.mapObject.getBounds()
this.$emit('on-bounds-update', value)
},
},
}
</script>