|
|
@ -518,47 +518,25 @@ function fly(viewer: any = null) { |
|
|
|
viewDistance = data.viewDistance; |
|
|
|
duration = data.duration ? data.duration : 0; |
|
|
|
// viewer.camera.flyTo(position, viewDistance, rotation, duration); |
|
|
|
console.log("data", position, viewDistance, rotation, duration); |
|
|
|
// console.log("data", position, viewDistance, rotation, duration); |
|
|
|
} else { |
|
|
|
// 总指挥中心 |
|
|
|
position = [parentData[0].lon, parentData[0].lat, parentData[0].altitude]; |
|
|
|
rotation = [parentData[0].rotationX, parentData[0].rotationY, parentData[0].rotationZ]; |
|
|
|
viewDistance = parentData[0].viewDistance; |
|
|
|
duration = parentData[0].duration; |
|
|
|
console.log("data2", position, viewDistance, rotation, duration); |
|
|
|
// console.log("data", position, viewDistance, rotation, duration); |
|
|
|
} |
|
|
|
// 根据坐标系标准,将地理坐标转换为笛卡尔坐标 |
|
|
|
// let CartesianPosition = ellipsoid.cartographicToCartesian({ |
|
|
|
// x: position[0], y: position[1], z: position[2] |
|
|
|
// }); |
|
|
|
// let CartesianPosition = ellipsoid.cartographicToCartesian(position[0],position[1],position[2]); |
|
|
|
let CartesianPosition = ellipsoid.cartographicToCartesian({ |
|
|
|
longitude: position[0], |
|
|
|
latitude: position[1], |
|
|
|
height: position[2] |
|
|
|
}); |
|
|
|
// console.log("CartesianPosition", CartesianPosition); |
|
|
|
|
|
|
|
// 先飞入到能看见红旗 |
|
|
|
// viewer.camera.flyTo(CartesianPosition, viewDistance, rotation, duration); |
|
|
|
|
|
|
|
// viewer.camera.flyTo({ |
|
|
|
// x: -990536.0465518984, |
|
|
|
// y: 5531995.514841362, |
|
|
|
// z: 3004737.189031571, |
|
|
|
// duration: 1.0, |
|
|
|
// }); |
|
|
|
// viewer.camera.position = { |
|
|
|
// x: -990536.0465518984, |
|
|
|
// y: 5531995.514841362, |
|
|
|
// z: 3004737.189031571, |
|
|
|
// } |
|
|
|
// viewer.camera.position = CartesianPosition |
|
|
|
|
|
|
|
|
|
|
|
// for (let record of data) { |
|
|
|
// if (record.sceneCode.length == 11) { |
|
|
|
// continue; |
|
|
|
// } |
|
|
|
// // 设置红旗 |
|
|
|
// this.setLoginPoint(record); |
|
|
|
// } |
|
|
|
viewer.camera.position = CartesianPosition |
|
|
|
} |
|
|
|
} else { |
|
|
|
else { |
|
|
|
// 没权限人员控制 |
|
|
|
} |
|
|
|
} |
|
|
|