fix:修改地图addlayer,修改小车刷新频率

This commit is contained in:
2025-01-02 11:23:59 +08:00
parent 09e68c12fa
commit 172c2501cb
3 changed files with 17 additions and 14 deletions
+6 -6
View File
@@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com
* @Date: 2024-10-17 11:34:00
* @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-12-31 11:35:20
* @LastEditTime: 2025-01-02 10:37:46
* @FilePath: \znxjxt-ui\src\views\big-screen\index.vue
* @Description: 大屏首页
-->
@@ -1594,14 +1594,14 @@ export default {
const currentLocation = item.getGeometry().getCoordinates();
const targetLocation = itemMessage.data.location;
// 计算两点之间的差值
const dx = (targetLocation[0] * 1 - currentLocation[0] * 1) / 100;
const dy = (targetLocation[1] * 1 - currentLocation[1] * 1) / 100;
const dx = (targetLocation[0] * 1 - currentLocation[0] * 1) / 20;
const dy = (targetLocation[1] * 1 - currentLocation[1] * 1) / 20;
// 设置计数器
let count = 0;
// 创建定时器,每10ms移动一次,总共移动100次,约1秒完成
// 创建定时器,每50ms移动一次,总共移动20次,约1秒完成
const timer = setInterval(() => {
count++;
if (count >= 100) {
if (count >= 20) {
clearInterval(timer);
return;
}
@@ -1626,7 +1626,7 @@ export default {
}),
}),
]);
}, 10);
}, 50);
}
});
} else {
@@ -67,15 +67,15 @@ export default {
const targetLocation = itemMessage.data.location;
// 计算两点之间的差值
const dx =
(targetLocation[0] * 1 - currentLocation[0] * 1) / 100;
(targetLocation[0] * 1 - currentLocation[0] * 1) / 20;
const dy =
(targetLocation[1] * 1 - currentLocation[1] * 1) / 100;
(targetLocation[1] * 1 - currentLocation[1] * 1) / 20;
// 设置计数器
let count = 0;
// 创建定时器,每10ms移动一次,总共移动100次,约1秒完成
// 创建定时器,每50ms移动一次,总共移动20次,约1秒完成
const timer = setInterval(() => {
count++;
if (count >= 100) {
if (count >= 20) {
clearInterval(timer);
return;
}
@@ -100,7 +100,7 @@ export default {
}),
}),
]);
}, 10);
}, 50);
}
});
} else {