From 11f213ea1f7886aea5cc80c462b4c39668486260 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 6 Aug 2024 15:31:57 +0800 Subject: [PATCH] =?UTF-8?q?iot=E5=AE=9A=E4=BD=8D=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../machinery/coding/component/MapDIalog.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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: {