From 5679cbbb630092a197d991cb41997a2d953261e9 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期三, 11 六月 2025 22:49:07 +0800
Subject: [PATCH] 动态溯源(待完成)

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

diff --git a/src/utils/map/animation.js b/src/utils/map/animation.js
index 40fbec8..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);
@@ -245,11 +245,11 @@
     // this.OnEachFrameCallback = undefined;
     // this.OnEachTaskEndCallback = undefined;
     this.frameAnimation.stop();
+    this._clearMap();
   },
   setOnStopCallback: function (callback) {
     this.frameAnimation.setOnStopCallback(
       function () {
-        this._clearMap();
         callback();
       }.bind(this)
     );
@@ -419,6 +419,8 @@
 };
 
 const realTimeMapAnimation = new MapAnimation();
-realTimeMapAnimation.clear = false;
+// 寮�鍚姩鎬佺粯鍒堕�熷害
+realTimeMapAnimation.setDynamicSpeed(true, 4);
+// realTimeMapAnimation.clear = false;
 
 export { realTimeMapAnimation, MapAnimation };

--
Gitblit v1.9.3