飞行器视角滚转角和夹角调整

main
刘妍 2 weeks ago
parent 26706d1bd0
commit 37358a29b8

@ -6,10 +6,10 @@
<div class="content">
<div class="content-edit instantiate" @click="instantiateVisible = !instantiateVisible">
<div class="input-result">
<span :style="{ backgroundColor: instantiateItem.bgColor }">
{{ instantiateItem.type }}</span
<span :style="{ backgroundColor: instantiateItem.displayColor }">
{{ instantiateItem.displayScheme }}</span
>
{{ instantiateItem.label }}
{{ instantiateItem.name }}
</div>
<UpOutlined v-if="instantiateVisible" />
<DownOutlined v-else />
@ -19,8 +19,8 @@
:key="index"
@click="instantiateSelect(item)"
>
<span :style="{ backgroundColor: item.bgColor }">{{ item.type }}</span>
{{ item.label }}
<span :style="{ backgroundColor: item.displayColor }">{{ item.displayScheme }}</span>
{{ item.name }}
</div>
</div>
</div>
@ -99,6 +99,7 @@
PlusOutlined,
} from '@ant-design/icons-vue';
import { Map } from '../index';
import { GetAlgoInstanceList } from '@/api/demo/aiinstance';
const { createMessage } = useMessage();
const emits = defineEmits(['changePatrol']);
@ -108,7 +109,7 @@
code: '',
desc: '',
action: '1',
time: null,
time: 'day',
area: null,
});
const bgOptions = ref(['#6909B2', '#09B284', '#B2AA09', '#E240BD', '#E24040']);
@ -135,7 +136,7 @@
]);
const instantiateItem = ref({});
const instantiateSelect = (val) => {
data.instantiate = val.value;
data.instantiate = val.id;
instantiateItem.value = val;
};
const drawarea = ref(false);
@ -150,7 +151,18 @@
}
drawarea.value = false;
};
onMounted(() => {});
const getList = () => {
GetAlgoInstanceList({
page: 1,
limit: 999,
}).then((res) => {
console.log(res);
instantiateOptions.value = res.items;
});
};
onMounted(() => {
getList();
});
</script>
<style lang="less" scoped>
.shade-container {
@ -234,9 +246,12 @@
color: #fff;
border: none;
}
::v-deep .ant-select {
width: 100%;
}
::v-deep .ant-select-selector {
background: none;
width: 220px;
width: 100%;
border: none;
text-align: center;
color: #fff;

@ -25,7 +25,11 @@
</div>
<!-- 航面航线 -->
<div v-if="props.airLineForm.airLineType == 'mapping2d'" v-show="props.editMode != 'detail'" class="airpolygon-container">
<div
v-if="props.airLineForm.airLineType == 'mapping2d'"
v-show="props.editMode != 'detail'"
class="airpolygon-container"
>
<airPolygon
:airInfo="airInfo"
:editModel="props.editMode"
@ -55,21 +59,21 @@
<!-- 航线预览信息 -->
<div class="airline-preview-container" v-if="props.editMode == 'detail'">
<div class="info-item">
<div class="info-value">46461</div>
<div class="info-label">区域面积</div>
</div>
<div class="info-item">
<div class="info-value">46461</div>
<div class="info-label">航线长度</div>
<div class="info-item">
<div class="info-value">46461</div>
<div class="info-label">区域面积</div>
</div>
<div class="info-item">
<div class="info-value">46461</div>
<div class="info-label">航线长度</div>
</div>
<div class="info-item">
<div class="info-value">34分钟</div>
<div class="info-label">预计时间</div>
<div class="info-value">34分钟</div>
<div class="info-label">预计时间</div>
</div>
<div class="info-item">
<div class="info-value">78</div>
<div class="info-label">照片数量</div>
<div class="info-value">78</div>
<div class="info-label">照片数量</div>
</div>
<div class="info-item">
<div>
@ -82,7 +86,12 @@
</div>
<!-- 面绘制 -->
<div class="draw-polygon-patrol" title="绘制面区域" v-if="props.drawArea" @click="handlerDrawPolygonPatrol">
<div
class="draw-polygon-patrol"
title="绘制面区域"
v-if="props.drawArea"
@click="handlerDrawPolygonPatrol"
>
<EditOutlined />
</div>
</div>
@ -281,18 +290,17 @@
watch(
() => props.editMode,
(newVal,oldVal)=>{
if(newVal == 'edit' || newVal == 'detail'){
if(props.airLineForm.airLineType == 'waypoint'){
handlerEditWaypointAirLine();
}else if(props.airLineForm.airLineType == 'mapping2d'){
handlerEditPolygonAirLine();
(newVal, oldVal) => {
if (newVal == 'edit' || newVal == 'detail') {
if (props.airLineForm.airLineType == 'waypoint') {
handlerEditWaypointAirLine();
} else if (props.airLineForm.airLineType == 'mapping2d') {
handlerEditPolygonAirLine();
}
}
}
)
},
);
watch(
() => props.polygonArea,
(newVal, oldVal) => {
@ -1036,35 +1044,37 @@
//
const handlerDrawPolygon = async () => {
const graphic = await polygonGraphicLayer.startDraw({
type: 'polygon',
style: {
color: '#408eff',
opacity: 0.3,
outline: true,
outlineColor: '#408eff',
outlineWidth: 3.0,
clampToGround: true,
},
});
let coordinates = graphic.toJSON().positions;
coordinates.push(coordinates[0]);
polygonGeoJson.value = coordinates;
let polygon = turf.polygon([coordinates]);
let polygonWkt = GeojsonToWkt(polygon['geometry']);
props.airLineForm.flyToFirstPointMode = polygonWkt;
// 线
let spceing = parseFloat(polygonCalculateParams.value?.spacing) / 10000;
//
let direction = props.templateKmlConfig.Folder.Placemark.direction ? props.templateKmlConfig.Folder.Placemark.direction : 0;
// 线
let lines = generateScanLines(polygon, spceing, direction);
// 线
CalculateAreaInfo(polygon, lines);
// 线
handlerDrawPolygonLine(lines);
//
handlerGetPolygonBorderInfo(polygonGeoJson.value);
const graphic = await polygonGraphicLayer.startDraw({
type: 'polygon',
style: {
color: '#408eff',
opacity: 0.3,
outline: true,
outlineColor: '#408eff',
outlineWidth: 3.0,
clampToGround: true,
},
});
let coordinates = graphic.toJSON().positions;
coordinates.push(coordinates[0]);
polygonGeoJson.value = coordinates;
let polygon = turf.polygon([coordinates]);
let polygonWkt = GeojsonToWkt(polygon['geometry']);
props.airLineForm.flyToFirstPointMode = polygonWkt;
// 线
let spceing = parseFloat(polygonCalculateParams.value?.spacing) / 10000;
//
let direction = props.templateKmlConfig.Folder.Placemark.direction
? props.templateKmlConfig.Folder.Placemark.direction
: 0;
// 线
let lines = generateScanLines(polygon, spceing, direction);
// 线
CalculateAreaInfo(polygon, lines);
// 线
handlerDrawPolygonLine(lines);
//
handlerGetPolygonBorderInfo(polygonGeoJson.value);
};
//
const handlerDrawPolygonPatrol = async () => {
@ -1467,43 +1477,40 @@
textLabelGraphicLayer.clear();
}
//
const handlerLoadtextLabelGraphicLayer = (info) => {
if (textLabelGraphicLayer == null) {
textLabelGraphicLayer = new mars3d.layer.GraphicLayer({
isAutoEditing: false,
});
map.addLayer(textLabelGraphicLayer);
} else {
textLabelGraphicLayer.clear();
}
//
const handlerLoadtextLabelGraphicLayer = (info) => {
if(textLabelGraphicLayer == null){
textLabelGraphicLayer = new mars3d.layer.GraphicLayer({
isAutoEditing:false
})
map.addLayer(textLabelGraphicLayer);
}else{
textLabelGraphicLayer.clear();
}
info?.forEach((item,index)=>{
const graphic = new mars3d.graphic.LabelEntity({
position: [item.center[0], item.center[1], 0],
style: {
text: item.length+"m",
font_size: 15,
scale: 1,
font_family: "微软雅黑",
color: "#ffffff",
outline: true,
outlineColor: "#000000",
outlineWidth: 2,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
visibleDepth: false,
clampToGround:true,
},
attr: { remark: "示例1" }
})
textLabelGraphicLayer.addGraphic(graphic)
})
}
}
info?.forEach((item, index) => {
const graphic = new mars3d.graphic.LabelEntity({
position: [item.center[0], item.center[1], 0],
style: {
text: item.length + 'm',
font_size: 15,
scale: 1,
font_family: '微软雅黑',
color: '#ffffff',
outline: true,
outlineColor: '#000000',
outlineWidth: 2,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
visibleDepth: false,
clampToGround: true,
},
attr: { remark: '示例1' },
});
textLabelGraphicLayer.addGraphic(graphic);
});
};
};
// 线
// 线
@ -2841,9 +2848,9 @@
const rectSensor = graphicLayer.getGraphicById('uav-route-rectSensor');
rectSensor.heading = type_subtype_gimbalindex.gimbal_yaw; //0360
rectSensor.pitch = type_subtype_gimbalindex.gimbal_pitch; //0360
rectSensor.roll = type_subtype_gimbalindex.gimbal_roll + 90; //0360
rectSensor.angle1 = 10; //1 0.1-89.9
rectSensor.angle2 = 10; //2 0.1-89.9
rectSensor.roll = type_subtype_gimbalindex.gimbal_roll; //0360 + 90
rectSensor.angle1 = type_subtype_gimbalindex.zoom_factor + 10; //1 0.1-89.9
rectSensor.angle2 = type_subtype_gimbalindex.zoom_factor + 10; //2 0.1-89.9
}
}
};
@ -2906,7 +2913,7 @@
style: {
angle1: 10,
angle2: 10,
length: 10,
length: 100,
rayEllipsoid: true,
color: 'rgba(0,255,255,0.3)',
outline: true,
@ -3012,27 +3019,27 @@
z-index: 2;
}
.airline-preview-container{
width:500px;
background:rgba(0,0,0,0.6);
.airline-preview-container {
width: 500px;
background: rgba(0, 0, 0, 0.6);
position: absolute;
bottom:100px;
left:50%;
transform: translate(0%,0);
z-index:999;
bottom: 100px;
left: 50%;
transform: translate(0%, 0);
z-index: 999;
border-radius: 10px;
display: flex;
padding:20px;
font-size:18px;
color:#fff;
padding: 20px;
font-size: 18px;
color: #fff;
}
.airline-preview-container .info-item{
flex:1;
.airline-preview-container .info-item {
flex: 1;
text-align: center;
}
.airline-preview-container .info-item .info-label{
font-size:14px;
margin-top:12px;
.airline-preview-container .info-item .info-label {
font-size: 14px;
margin-top: 12px;
}
</style>

Loading…
Cancel
Save