【类 型】:fix
【原 因】:判断了是否 有经纬度 才往数组里面存经纬高 【过 程】: 【影 响】:导致没有经纬度得时候 也没有高度
This commit is contained in:
parent
931505e782
commit
9b1e5ffbee
@ -197,11 +197,12 @@ export default {
|
|||||||
// 如果是飞机位置信息 则不是直接刷新状态 而是累计 到数组 以便于画出飞机路径
|
// 如果是飞机位置信息 则不是直接刷新状态 而是累计 到数组 以便于画出飞机路径
|
||||||
const position = JSON.parse(jsonData.position)
|
const position = JSON.parse(jsonData.position)
|
||||||
// 检查 lon, lat, 和 alt 是否不全为零或空值
|
// 检查 lon, lat, 和 alt 是否不全为零或空值
|
||||||
if (position.lon !== 0 && position.lat !== 0 &&
|
// if (position.lon !== 0 && position.lat !== 0 &&
|
||||||
position.lon !== null && position.lat !== null &&
|
// position.lon !== null && position.lat !== null &&
|
||||||
position.lon !== '' && position.lat !== '') {
|
// position.lon !== '' && position.lat !== '') {
|
||||||
plane.planeState.position.push([position.lon / 10e6, position.lat / 10e6, Number(position.alt)])
|
// plane.planeState.position.push([position.lon / 10e6, position.lat / 10e6, Number(position.alt)])
|
||||||
}
|
// }
|
||||||
|
plane.planeState.position.push([position.lon / 10e6, position.lat / 10e6, Number(position.alt)])
|
||||||
if (plane.planeState.position.length > 1000) {
|
if (plane.planeState.position.length > 1000) {
|
||||||
plane.planeState.position.shift() // 删除最早的经纬度
|
plane.planeState.position.shift() // 删除最早的经纬度
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user