|
|
|
@ -45,6 +45,8 @@
|
|
|
|
|
:currentAirPoint="currentAirPoint"
|
|
|
|
|
:airPoints="airPoints"
|
|
|
|
|
@paramChagne="paramChagne"
|
|
|
|
|
@pointChange="pointChange"
|
|
|
|
|
@positionChange="positionChange"
|
|
|
|
|
></airPointConfig>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -59,7 +61,7 @@
|
|
|
|
|
import * as mars3d from 'mars3d';
|
|
|
|
|
import { EventBus } from '@/utils/eventBus';
|
|
|
|
|
import { airPortStore } from '@/store/modules/airport';
|
|
|
|
|
|
|
|
|
|
import { airPointActions } from '../waylineConfig/actionConfig'
|
|
|
|
|
import 'mars3d-space';
|
|
|
|
|
|
|
|
|
|
import * as Cesium from 'mars3d-cesium';
|
|
|
|
@ -232,7 +234,12 @@
|
|
|
|
|
() => props.editMode,
|
|
|
|
|
(newVal,oldVal)=>{
|
|
|
|
|
if(newVal == 'edit' ){
|
|
|
|
|
handlerEditPolygonAirLine();
|
|
|
|
|
// 判断航线类型进行加载编辑
|
|
|
|
|
if(props.airLineForm.airLineType == 'waypoint'){
|
|
|
|
|
handlerEditWaypointAirLine();
|
|
|
|
|
}else if(props.airLineForm.airLineType == 'mapping2d'){
|
|
|
|
|
handlerEditPolygonAirLine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
@ -386,6 +393,7 @@ const generatePreviewPoint = (placemark)=>{
|
|
|
|
|
const checkPoint = (e) => {
|
|
|
|
|
currentAirPoint.value = e;
|
|
|
|
|
airPointConfigShow.value = true;
|
|
|
|
|
handlerDrawCamera(currentAirPoint.value);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///////////////////////////////图层中心////////////////////////////////////////////
|
|
|
|
@ -731,7 +739,12 @@ const initMap = () => {
|
|
|
|
|
|
|
|
|
|
// 图层回显
|
|
|
|
|
if(props.editMode == 'edit' ){
|
|
|
|
|
handlerEditPolygonAirLine();
|
|
|
|
|
// 判断航线类型进行加载编辑
|
|
|
|
|
if(props.airLineForm.airLineType == 'waypoint'){
|
|
|
|
|
handlerEditWaypointAirLine();
|
|
|
|
|
}else if(props.airLineForm.airLineType == 'mapping2d'){
|
|
|
|
|
handlerEditPolygonAirLine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
emits('mapOnLoad',map)
|
|
|
|
@ -1370,7 +1383,7 @@ const handlerLoadtextLabelGraphicLayer = (info) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 编辑回显航线
|
|
|
|
|
// 编辑回显面状航线
|
|
|
|
|
const handlerEditPolygonAirLine =async () => {
|
|
|
|
|
|
|
|
|
|
// 解析和设置参考起飞点
|
|
|
|
@ -1591,7 +1604,7 @@ const handlerDrawPoint = (e) => {
|
|
|
|
|
}
|
|
|
|
|
// 设置航线默认高度
|
|
|
|
|
let position = mars3d.LngLatPoint.fromCartesian(e.position);
|
|
|
|
|
let uuid = buildUUID();
|
|
|
|
|
let uuid = airPoints.value.length+1;
|
|
|
|
|
|
|
|
|
|
// 获取默认航线高度
|
|
|
|
|
let globalHeight = props.templateKmlConfig.Folder.globalHeight;
|
|
|
|
@ -1858,20 +1871,17 @@ const paramChagne = (info) => {
|
|
|
|
|
console.log("info1232",info);
|
|
|
|
|
|
|
|
|
|
// 判断事件类型
|
|
|
|
|
if(info.value == 'rotateYaw'){ // 飞行器偏航角
|
|
|
|
|
|
|
|
|
|
if(info.value == 'rotateYaw'){ // 飞行器偏航角
|
|
|
|
|
// 设置参数
|
|
|
|
|
currentAirPoint.value.aircraftHorizontalAngle = info.config.actionActuatorFuncParam.aircraftHeading;
|
|
|
|
|
|
|
|
|
|
// 更新镜头
|
|
|
|
|
handlerDrawCamera(currentAirPoint.value);
|
|
|
|
|
|
|
|
|
|
// 更新航点
|
|
|
|
|
updateAirPoint(currentAirPoint.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(info.value == "gimbalRotate"){ // 云台俯仰角
|
|
|
|
|
|
|
|
|
|
// 设置参数
|
|
|
|
|
currentAirPoint.value.cameraVerticalAngle = info.config.actionActuatorFuncParam.gimbalPitchRotateAngle
|
|
|
|
|
// 更新镜头
|
|
|
|
@ -1879,6 +1889,42 @@ const paramChagne = (info) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(info.value == 'position'){ // 坐标高度改变
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 航点位置参数改变
|
|
|
|
|
const positionChange = () => {
|
|
|
|
|
|
|
|
|
|
// 更新航点
|
|
|
|
|
updateAirPoint(currentAirPoint.value);
|
|
|
|
|
|
|
|
|
|
// 更新镜头
|
|
|
|
|
handlerDrawCamera(currentAirPoint.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 切换航点
|
|
|
|
|
const pointChange = (id,type) => {
|
|
|
|
|
|
|
|
|
|
if(type == "next"){
|
|
|
|
|
if(id == airPoints.value.length){
|
|
|
|
|
currentAirPoint.value = airPoints.value[0];
|
|
|
|
|
}else{
|
|
|
|
|
currentAirPoint.value = airPoints.value[id];
|
|
|
|
|
}
|
|
|
|
|
}else if(type == "last"){
|
|
|
|
|
if(id == 1){
|
|
|
|
|
currentAirPoint.value = airPoints.value[airPoints.value.length - 1];
|
|
|
|
|
}else{
|
|
|
|
|
currentAirPoint.value = airPoints.value[id - 2];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新镜头
|
|
|
|
|
handlerDrawCamera(currentAirPoint.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 事件处理
|
|
|
|
@ -1925,6 +1971,139 @@ const deleteAirPoint = (e) => {
|
|
|
|
|
handlerDrawLine();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 编辑回显航点航线
|
|
|
|
|
const handlerEditWaypointAirLine =async () => {
|
|
|
|
|
|
|
|
|
|
// 解析和设置参考起飞点
|
|
|
|
|
let takeoffArray = props.templateKmlConfig.missionConfig.takeOffRefPoint.split(",");
|
|
|
|
|
takeOffPointPosition.value = [parseFloat(takeoffArray[1]),parseFloat(takeoffArray[0]),parseFloat(takeoffArray[2])]
|
|
|
|
|
polygonAirForm.value.startingPoint = [parseFloat(takeoffArray[1]),parseFloat(takeoffArray[0]),parseFloat(takeoffArray[2])];
|
|
|
|
|
takeOffPointGraphicLayer ? takeOffPointGraphicLayer.clear() : null;
|
|
|
|
|
let startFlyGraphic = new mars3d.graphic.BillboardEntity({
|
|
|
|
|
position:takeOffPointPosition.value,
|
|
|
|
|
style: {
|
|
|
|
|
image: '/map/start.png',
|
|
|
|
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
|
|
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
|
|
label: {
|
|
|
|
|
text: '参考起飞点',
|
|
|
|
|
font_size: 16,
|
|
|
|
|
color: '#ffffff',
|
|
|
|
|
outline: true,
|
|
|
|
|
outlineColor: '#000000',
|
|
|
|
|
pixelOffsetY: -50,
|
|
|
|
|
},
|
|
|
|
|
clampToGround: true,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
takeOffPointGraphicLayer.addGraphic(startFlyGraphic);
|
|
|
|
|
|
|
|
|
|
// 处理和加载航点
|
|
|
|
|
if(props.waylineWpmlConfig.Folder.Placemark.length > 0){
|
|
|
|
|
props.waylineWpmlConfig.Folder.Placemark?.forEach((item, index) => {
|
|
|
|
|
let coordinate = item.Point.coordinates.split(',');
|
|
|
|
|
// 处理航点
|
|
|
|
|
let airPointInfo = {
|
|
|
|
|
id: item.index+1,
|
|
|
|
|
lng: coordinate[0],
|
|
|
|
|
lat: coordinate[1],
|
|
|
|
|
alt: item.executeHeight,
|
|
|
|
|
aircraftHorizontalAngle: 0,
|
|
|
|
|
cameraHorizontalAngle: 0,
|
|
|
|
|
cameraVerticalAngle: 0,
|
|
|
|
|
focalLength: 24,
|
|
|
|
|
actions:[]
|
|
|
|
|
};
|
|
|
|
|
// 处理动作
|
|
|
|
|
item.actionGroup.action?.forEach((action,idx)=>{
|
|
|
|
|
let actionConfig = JSON.parse(JSON.stringify(airPointActions[action.actionActuatorFunc]))
|
|
|
|
|
actionConfig.config = JSON.parse(JSON.stringify(action));
|
|
|
|
|
|
|
|
|
|
console.log("123",action);
|
|
|
|
|
|
|
|
|
|
// 处理航偏角和俯仰角
|
|
|
|
|
if(action.actionActuatorFunc == 'rotateYaw'){
|
|
|
|
|
airPointInfo.aircraftHorizontalAngle = action.actionActuatorFuncParam.aircraftHeading
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(action.actionActuatorFunc == 'gimbalRotate'){
|
|
|
|
|
airPointInfo.cameraVerticalAngle = action.actionActuatorFuncParam.gimbalPitchRotateAngle
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
airPointInfo.actions.push(actionConfig);
|
|
|
|
|
})
|
|
|
|
|
airPoints.value?.push(airPointInfo);
|
|
|
|
|
// 回显航点
|
|
|
|
|
displayWaypointAirLine(airPointInfo);
|
|
|
|
|
});
|
|
|
|
|
// 更新航线
|
|
|
|
|
handlerDrawLine();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 回显航点航线信息
|
|
|
|
|
const displayWaypointAirLine = (position)=>{
|
|
|
|
|
console.log("position123",position);
|
|
|
|
|
|
|
|
|
|
// 设置航线默认高度
|
|
|
|
|
let uuid = buildUUID();
|
|
|
|
|
|
|
|
|
|
// 获取默认航线高度
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 航点三维模型
|
|
|
|
|
let uavAngleGraphic = new mars3d.graphic.ModelEntity({
|
|
|
|
|
id:position.id,
|
|
|
|
|
name: "航向",
|
|
|
|
|
position: [position.lng, position.lat, position.alt],
|
|
|
|
|
style: {
|
|
|
|
|
url: "/map/uav-angle.gltf",
|
|
|
|
|
scale: 0.1,
|
|
|
|
|
heading: position.aircraftHorizontalAngle + 90,
|
|
|
|
|
distanceDisplayCondition: true,
|
|
|
|
|
distanceDisplayCondition_near: 0,
|
|
|
|
|
distanceDisplayPoint: {
|
|
|
|
|
color: "#00ff00",
|
|
|
|
|
pixelSize: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
graphicLayer.addGraphic(uavAngleGraphic)
|
|
|
|
|
|
|
|
|
|
// 地面投影点
|
|
|
|
|
let stickGraphic = new mars3d.graphic.PointEntity({
|
|
|
|
|
id: 'stick' + position.id,
|
|
|
|
|
position: [position.lng, position.lat],
|
|
|
|
|
style: {
|
|
|
|
|
color: '#f5f5f5',
|
|
|
|
|
pixelSize: 8,
|
|
|
|
|
outline: true,
|
|
|
|
|
outlineColor: '#f5f5f5',
|
|
|
|
|
outlineWidth: 1,
|
|
|
|
|
clampToGround: true,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
stickGroundPointLayer.addGraphic(stickGraphic);
|
|
|
|
|
|
|
|
|
|
// 航点 投影点连接线
|
|
|
|
|
let lineGraphic = new mars3d.graphic.PolylineEntity({
|
|
|
|
|
id: 'line' + position.id,
|
|
|
|
|
positions: [
|
|
|
|
|
[position.lng, position.lat,position.alt],
|
|
|
|
|
[position.lng, position.lat, 0],
|
|
|
|
|
],
|
|
|
|
|
style: {
|
|
|
|
|
color: '#f5f5f5',
|
|
|
|
|
width: 1,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
lineGroundPointLayer.addGraphic(lineGraphic);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let stickGraphicLayer: mars3d.layer.GraphicLayer;
|
|
|
|
|
|
|
|
|
|
// 飞行到此处
|
|
|
|
@ -2593,7 +2772,7 @@ function addRectSensor(route) {
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////动作处理//////////////////////////////////////
|
|
|
|
|
const addAction = (action) => {
|
|
|
|
|
|
|
|
|
|
console.log('action123',action);
|
|
|
|
|
// 当前航点添加动作
|
|
|
|
|
currentAirPoint.value.actions.push(JSON.parse(JSON.stringify(action)));
|
|
|
|
|
|
|
|
|
|