|
|
@ -5,7 +5,7 @@
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import marsMap from "@/components/marsMap";
|
|
|
|
import marsMap from "@/components/marsMap";
|
|
|
|
import PointJson from "./point.json";
|
|
|
|
import PointJson from "./point.json";
|
|
|
|
import { onMounted } from "vue";
|
|
|
|
import { onMounted,nextTick } from "vue";
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
let options = {
|
|
|
|
let options = {
|
|
|
|
scene: {
|
|
|
|
scene: {
|
|
|
@ -90,7 +90,11 @@ const mapLoad = (mapInstance) => {
|
|
|
|
mapLayer.uav = new mars3d.layer.GraphicLayer()
|
|
|
|
mapLayer.uav = new mars3d.layer.GraphicLayer()
|
|
|
|
map.addLayer(mapLayer.uav);
|
|
|
|
map.addLayer(mapLayer.uav);
|
|
|
|
|
|
|
|
|
|
|
|
boostrapUav();
|
|
|
|
map.on(mars3d.EventType.load, function (event) {
|
|
|
|
|
|
|
|
boostrapUav();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -133,12 +137,12 @@ const onAddGamepadboardListener = () => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const boostrapUav = () => {
|
|
|
|
const boostrapUav = () => {
|
|
|
|
// // 绘制停机场矩形
|
|
|
|
// 绘制停机场矩形
|
|
|
|
// initRectangle();
|
|
|
|
initRectangle();
|
|
|
|
// //渲染所有图标点
|
|
|
|
//渲染所有图标点
|
|
|
|
initMarker();
|
|
|
|
initMarker();
|
|
|
|
//渲染无人机
|
|
|
|
//渲染无人机
|
|
|
|
// initUav();
|
|
|
|
initUav();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const startgamepad = () => {
|
|
|
|
const startgamepad = () => {
|
|
|
@ -239,13 +243,9 @@ const onAdjustAttitude = () => {
|
|
|
|
|
|
|
|
|
|
|
|
const initUav = () => {
|
|
|
|
const initUav = () => {
|
|
|
|
if (list.length == 0 && !isGamepad ) {
|
|
|
|
if (list.length == 0 && !isGamepad ) {
|
|
|
|
PointJson.map((item) => {
|
|
|
|
list = PointJson.map((item) => item.wz);
|
|
|
|
const position = item.wz.split(",").map(Number)
|
|
|
|
|
|
|
|
position[2] = 100
|
|
|
|
|
|
|
|
list.push(position);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uav = new mars3d.graphic.Route({
|
|
|
|
uav = new mars3d.graphic.FixedRoute({
|
|
|
|
id: "uav1",
|
|
|
|
id: "uav1",
|
|
|
|
name: "无人机模型",
|
|
|
|
name: "无人机模型",
|
|
|
|
position: {
|
|
|
|
position: {
|
|
|
@ -253,6 +253,7 @@ const initUav = () => {
|
|
|
|
speed: 100,
|
|
|
|
speed: 100,
|
|
|
|
list: list,
|
|
|
|
list: list,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
clockLoop: true, //是否循环播放
|
|
|
|
model: {
|
|
|
|
model: {
|
|
|
|
url: "https://data.mars3d.cn/gltf/mars/wrj.glb",
|
|
|
|
url: "https://data.mars3d.cn/gltf/mars/wrj.glb",
|
|
|
|
scale: 0.1,
|
|
|
|
scale: 0.1,
|
|
|
@ -260,12 +261,19 @@ const initUav = () => {
|
|
|
|
runAnimations: true,
|
|
|
|
runAnimations: true,
|
|
|
|
// mergeOrientation: true,
|
|
|
|
// mergeOrientation: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
polyline:{
|
|
|
|
|
|
|
|
materialType: mars3d.MaterialType.PolylineDash,//虚线
|
|
|
|
|
|
|
|
materialOptions:{
|
|
|
|
|
|
|
|
color: 'rgba(34, 232, 174, 1)',
|
|
|
|
|
|
|
|
dashLength: 8.0
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
camera: {
|
|
|
|
camera: {
|
|
|
|
type: "gs",
|
|
|
|
type: "gs",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
mapLayer.uav.addGraphic(uav);
|
|
|
|
mapLayer.uav.addGraphic(uav);
|
|
|
|
|
|
|
|
uav.start()
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const initRectangle = () => {
|
|
|
|
const initRectangle = () => {
|
|
|
|