From 90671325090a58b0dfc91dac6a84b1c2a09eaac7 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 27 三月 2025 17:29:27 +0800
Subject: [PATCH] 修复绘制轨迹线时,上一组数据没有清除的问题

---
 src/utils/map/animation.js |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/utils/map/animation.js b/src/utils/map/animation.js
index ed664c3..4180e7d 100644
--- a/src/utils/map/animation.js
+++ b/src/utils/map/animation.js
@@ -83,7 +83,7 @@
       if (i == endIndex || i == factorDatas.length() - 1) {
         break;
       }
-      // 鍔ㄧ敾杞ㄨ抗
+      // 鍔ㄧ敾杞ㄨ抗锛堝凡缁樺埗閮ㄥ垎锛�
       var animationData = factorDatas.getByIndex(0, i + 1);
 
       // 璺緞鐐�
@@ -105,14 +105,14 @@
       var d = distance / count;
       // 姣忎釜fps瀵瑰簲鐨勫疄闄呮椂闀�(榛樿1绉�)
       var t = 1;
-      // 涓ょ偣闂翠笉杩炵画鏃�
+      // 涓ょ偣闂翠笉杩炵画鏃讹紝浣跨敤榛樿鏃堕暱锛岄伩鍏�
       if (distance > this.maxD) {
-        count = 4 * this._fps;
+        count = this.frameAnimation.taskPeriod * this._fps;
         d = distance / count;
         t = duration / (count / this._fps);
       }
 
-      // 鐩戞祴鏁版嵁
+      // 鐩戞祴鏁版嵁锛堝緟缁樺埗鏁版嵁鐐癸紝鍦ㄥ凡缁樺埗閮ㄥ垎鍜岃鏁版嵁鐐逛箣闂达紝鎻掑叆鍔ㄧ敾甯ф暟鎹偣锛�
       // var fData1 = factorDatas.getByIndex(i, i + 1)
       var fData2 = factorDatas.getByIndex(i + 1, i + 2);
 
@@ -135,7 +135,7 @@
         }
         animationData.times.push(time);
       }
-      // factor
+      // 缁欐瘡涓洃娴嬪洜瀛愯繘琛屾彃甯�
       for (const key in animationData.factor) {
         var factor = animationData.factor[key];
         factor.insertFrame(fData2.factor[key], count, distance <= this.maxD);
@@ -419,6 +419,8 @@
 };
 
 const realTimeMapAnimation = new MapAnimation();
+// 寮�鍚姩鎬佺粯鍒堕�熷害
+realTimeMapAnimation.setDynamicSpeed(true, 4);
 // realTimeMapAnimation.clear = false;
 
 export { realTimeMapAnimation, MapAnimation };

--
Gitblit v1.9.3