【类 型】:fix
【原 因】:指点时候 会从飞机状态里拿高度 但是更进入页面 数组里没有高度信息 控制台回台出警告 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
3b4940ac4a
commit
5f711afb1d
@ -117,8 +117,16 @@ export default {
|
|||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
this.dialogItem = 'guidedBox'
|
this.dialogItem = 'guidedBox'
|
||||||
this.guidedLonLat = lonLat // 设置点击的经纬度
|
this.guidedLonLat = lonLat // 设置点击的经纬度
|
||||||
|
|
||||||
|
// 安全获取飞机当前高度
|
||||||
|
let height = 0
|
||||||
|
if (this.plane && this.plane.planeState && Array.isArray(this.plane.planeState.position)) {
|
||||||
const posLen = this.plane.planeState.position.length
|
const posLen = this.plane.planeState.position.length
|
||||||
this.guidedAlt = this.plane.planeState.position[posLen - 1][2]// 取出 点击时飞机的高度
|
if (posLen > 0 && Array.isArray(this.plane.planeState.position[posLen - 1])) {
|
||||||
|
height = this.plane.planeState.position[posLen - 1][2] || 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.guidedAlt = height
|
||||||
},
|
},
|
||||||
// 地图组件回调地图加载完成后 执行
|
// 地图组件回调地图加载完成后 执行
|
||||||
onMapReady () {
|
onMapReady () {
|
||||||
|
Loading…
Reference in New Issue
Block a user