From 172c2501cba4bf2e2e8004f16caa43e0793f9d9a Mon Sep 17 00:00:00 2001 From: SunTao <328867980@qq.com> Date: Thu, 2 Jan 2025 11:23:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=9C=B0?= =?UTF-8?q?=E5=9B=BEaddlayer=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B0=8F=E8=BD=A6?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/fssm-map.vue | 9 ++++++--- src/views/big-screen/index.vue | 12 ++++++------ .../components/inspection-follow.vue | 10 +++++----- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/components/map/fssm-map.vue b/src/components/map/fssm-map.vue index bcf40d3..2160b93 100644 --- a/src/components/map/fssm-map.vue +++ b/src/components/map/fssm-map.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-14 10:46:23 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-12-26 10:02:28 + * @LastEditTime: 2025-01-02 10:33:02 * @FilePath: \znxjxt-ui\src\components\map\fssm-map.vue * @Description: 公共地图 --> @@ -335,7 +335,9 @@ export default { }), visible: true, }); - map.addLayer(tianditu_cva_c, tianditu_vec_c, tianditu_img_c); + map.addLayer(tianditu_cva_c); + map.addLayer(tianditu_vec_c); + map.addLayer(tianditu_img_c); } else { // 外网 tianditu_cva_c = new TileLayer({ @@ -348,7 +350,8 @@ export default { }), visible: true, }); - map.addLayer(tianditu_cva_c, tianditu_img_c); + map.addLayer(tianditu_cva_c); + map.addLayer(tianditu_img_c); } // 图层点击事件 map.on("singleclick", (e) => { diff --git a/src/views/big-screen/index.vue b/src/views/big-screen/index.vue index f68e692..d644e03 100644 --- a/src/views/big-screen/index.vue +++ b/src/views/big-screen/index.vue @@ -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 { diff --git a/src/views/big-screen/overview-components/components/inspection-follow.vue b/src/views/big-screen/overview-components/components/inspection-follow.vue index e7768f1..90f4962 100644 --- a/src/views/big-screen/overview-components/components/inspection-follow.vue +++ b/src/views/big-screen/overview-components/components/inspection-follow.vue @@ -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 {