| | |
| | | speed: 5, |
| | | }) |
| | | |
| | | const MOCK_FLIGHT_HEIGHT = 120 |
| | | |
| | | // 角度转c3 |
| | | function degreesToC3({ longitude, latitude, height = 0 }) { |
| | | return Cesium.Cartesian3.fromDegrees(longitude, latitude, height) |
| | | } |
| | | // 渲染航线 |
| | | function drawFlightPath() { |
| | | const positions = list.value.map(p => degreesToC3(p)) |
| | | const positions = list.value.map(p => degreesToC3({ ...p, height: MOCK_FLIGHT_HEIGHT })) |
| | | if (!positions.length) return |
| | | droneLineEntity && geometricSource.entities.remove(droneLineEntity) |
| | | droneLineEntity = geometricSource.entities.add({ |
| | |
| | | width: 4, |
| | | positions: positions, |
| | | material: arrowLineMaterialProperty, |
| | | clampToGround: true, |
| | | clampToGround: false, |
| | | }, |
| | | }) |
| | | startDroneEntity && geometricSource.entities.remove(startDroneEntity) |
| | |
| | | width: 40, |
| | | height: 40, |
| | | verticalOrigin: Cesium.VerticalOrigin.CENTER, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | heightReference: Cesium.HeightReference.NONE, |
| | | }, |
| | | }) |
| | | viewer.flyTo(droneLineEntity, { duration: 0 }) |