iot定位优化,解决页面报错问题

This commit is contained in:
BianLzhaoMin 2024-08-06 15:31:57 +08:00
parent 602c03cd19
commit 11f213ea1f
1 changed files with 7 additions and 2 deletions

View File

@ -188,11 +188,16 @@ export default {
},
beforeDestroy() {
console.log(this.trackAni, '轨迹实例--')
/** 组件销毁之前 先清除地图实例 */
// 1.
if (this.trackAni) {
this.trackAni.cancel()
}
// 2.
this.map.clearOverlays()
this.map.destroy()
this.map = null
console.log('地图弹框组件销毁了---', this.map)
},
methods: {