From e6cfb81162a91a2cf76a5473a2d97883d51f39f2 Mon Sep 17 00:00:00 2001 From: tk Date: Thu, 25 Jul 2024 13:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E5=9C=A8=E7=B4=AF=E8=AE=A1=E9=A3=9E=E6=9C=BA?= =?UTF-8?q?=E7=97=95=E8=BF=B9=E5=9D=90=E6=A0=87=E6=97=B6=20=E4=B8=8D?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=BB=8F=E7=BA=AC=E9=AB=98=200=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=20=20=E9=A3=9E?= =?UTF-8?q?=E6=9C=BA=E5=8F=AF=E8=83=BD=E9=BB=98=E8=AE=A4=E6=98=AF0?= =?UTF-8?q?=E7=82=B9=E5=9D=90=E6=A0=87=20=20=E8=BF=99=E6=98=AF=E8=AF=9D?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=20=E5=B0=B1=E4=BC=9A=E4=BB=8E0=E7=82=B9?= =?UTF-8?q?=E7=94=BB=E4=B8=80=E6=9D=A1=E9=95=BF=E8=BD=A8=E8=BF=B9=20?= =?UTF-8?q?=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90?= =?UTF-8?q?=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/layout/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index 391dda2..15753ba 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -93,7 +93,12 @@ export default { } else if (key === 'position') { // 如果是飞机位置信息 则不是直接刷新状态 而是累计 到数组 以便于画出飞机路径 const position = JSON.parse(jsonData.position) - plane.planeState.position.push([position.lng / 10e6, position.lat / 10e6, Number(position.alt)]) + // 检查 lng, lat, 和 alt 是否不全为零或空值 + if (position.lng !== 0 && position.lat !== 0 && position.alt !== 0 && + position.lng !== null && position.lat !== null && position.alt !== null && + position.lng !== '' && position.lat !== '' && position.alt !== '') { + plane.planeState.position.push([position.lng / 10e6, position.lat / 10e6, Number(position.alt)]) + } if (plane.planeState.position.length > 1000) { plane.planeState.position.shift() // 删除最早的经纬度 }