| | |
| | | if (i == endIndex || i == factorDatas.length() - 1) { |
| | | break; |
| | | } |
| | | // 动画轨迹 |
| | | // 动画轨迹(已绘制部分) |
| | | var animationData = factorDatas.getByIndex(0, i + 1); |
| | | |
| | | // 路径点 |
| | |
| | | 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); |
| | | |
| | |
| | | } |
| | | 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); |
| | |
| | | }; |
| | | |
| | | const realTimeMapAnimation = new MapAnimation(); |
| | | // 开启动态绘制速度 |
| | | realTimeMapAnimation.setDynamicSpeed(true, 4); |
| | | // realTimeMapAnimation.clear = false; |
| | | |
| | | export { realTimeMapAnimation, MapAnimation }; |