diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue index 2678dcf0..28179597 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue @@ -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: {