From eece1ec099c08c00e85d7d9de407d1c7698b9214 Mon Sep 17 00:00:00 2001 From: luojie Date: Mon, 4 Dec 2023 01:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8E=86=E5=8F=B2=E8=BD=A8?= =?UTF-8?q?=E8=BF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hd-glasses-app/public/index.html | 2 +- .../pages/hd_show_equipment_move_history.vue | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hd-glasses-app/public/index.html b/hd-glasses-app/public/index.html index 31b925b..4193966 100644 --- a/hd-glasses-app/public/index.html +++ b/hd-glasses-app/public/index.html @@ -3,7 +3,7 @@ diff --git a/hd-glasses-app/src/pages/hd_show_equipment_move_history.vue b/hd-glasses-app/src/pages/hd_show_equipment_move_history.vue index c9d3251..d3d93ef 100644 --- a/hd-glasses-app/src/pages/hd_show_equipment_move_history.vue +++ b/hd-glasses-app/src/pages/hd_show_equipment_move_history.vue @@ -9,6 +9,9 @@
结束时间
+
+ {{playPath?'停止播放':'播放轨迹'}} +
下一步
@@ -188,6 +191,7 @@ export default { moveUserId: "", moveIndex: 0, pointMoveTimer:null, + playPath:false }; }, mounted() { @@ -609,7 +613,14 @@ export default { }, startAnimation() { + + this.pointMoveTimer=setInterval(()=>{ + + if(!this.playPath){ + return false; + } + this.moveIndex = this.moveIndex + 30 if(this.moveIndex>=this.routeOriginList.length){ @@ -1110,12 +1121,9 @@ export default { }, moveFromStartToEnd() { - if (Object.keys(this.vectorLayer).length == 0) { - // 创建图层 - this.vectorLayer = new VectorLayer({ - source: new VectorSource(), - }); - // 图层添加到地图上 + if (Object.keys(this.vectorLayer).length > 0) { + + // 将旧图层删掉 this.map.removeLayer(this.vectorLayer); }