iot定位优化,解决页面报错问题
This commit is contained in:
parent
602c03cd19
commit
11f213ea1f
|
|
@ -188,11 +188,16 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
console.log(this.trackAni, '轨迹实例--')
|
/** 组件销毁之前 先清除地图实例 */
|
||||||
|
|
||||||
|
// 1. 判断轨迹实例是否存在 如果存在 先强制关闭动画,否则页面报错
|
||||||
|
if (this.trackAni) {
|
||||||
|
this.trackAni.cancel()
|
||||||
|
}
|
||||||
|
// 2. 清除地图上面的标点覆盖物 并清除地图实例
|
||||||
this.map.clearOverlays()
|
this.map.clearOverlays()
|
||||||
this.map.destroy()
|
this.map.destroy()
|
||||||
this.map = null
|
this.map = null
|
||||||
console.log('地图弹框组件销毁了---', this.map)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue