/* eslint-disable no-undef */
|
<template>
|
<Popup
|
ref="pop"
|
:title="form.title"
|
width="410px"
|
maxHeight="430px"
|
left="calc(100% - 420px)"
|
@close="clearAll"
|
>
|
<div class="posjump">
|
<el-form ref="form" :model="form" label-width="80px">
|
<el-form-item label="经度:" prop="longitude">
|
<el-input v-model="form.longitude"></el-input>
|
</el-form-item>
|
<el-form-item label="纬度:" prop="latitude">
|
<el-input v-model="form.latitude"></el-input>
|
</el-form-item>
|
<el-form-item label="高度:" prop="viewHeight">
|
<el-input v-model="form.viewHeight"></el-input>
|
</el-form-item>
|
<el-form-item label="航向角:" prop="heading">
|
<el-input v-model="form.heading"></el-input>
|
</el-form-item>
|
<el-form-item label="俯仰角:" prop="pitch">
|
<el-input v-model="form.pitch"></el-input>
|
</el-form-item>
|
<!-- <el-form-item label="翻滚角:" prop="roll">
|
<el-input v-model="form.roll"></el-input>
|
</el-form-item> -->
|
<el-form-item>
|
<el-button @click="flyToPos" type="primary" class="posBtn">
|
飞到
|
</el-button>
|
<el-button @click="jumpToPos" type="primary" class="posBtn">
|
跳转
|
</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
</Popup>
|
</template>
|
<script>
|
import Popup from "@tools/Popup.vue";
|
export default {
|
name: "Location",
|
components: {
|
Popup,
|
},
|
data() {
|
return {
|
dialogVisible: false,
|
loading: false,
|
form: {
|
title: "飞行定位",
|
longitude: 0,
|
latitude: 0,
|
viewHeight: 0,
|
heading: 0,
|
pitch: 0,
|
|
},
|
};
|
},
|
mounted() {},
|
methods: {
|
clearAll() {},
|
flyToPos() {
|
window.Viewer.camera.flyTo({
|
destination: Cesium.Cartesian3.fromDegrees(
|
this.form.longitude,
|
this.form.latitude,
|
this.form.viewHeight
|
),
|
orientation: {
|
heading: (this.form.heading * 3.1415926) / 180,
|
pitch: (this.form.pitch * 3.1415926) / 180,
|
},
|
});
|
},
|
jumpToPos() {
|
window.sgworld.Navigate.jumpTo({
|
destination: Cesium.Cartesian3.fromDegrees(
|
this.form.longitude,
|
this.form.latitude,
|
this.form.viewHeight
|
),
|
orientation: {
|
heading: (this.form.heading * 3.1415926) / 180,
|
pitch: (this.form.pitch * 3.1415926) / 180,
|
},
|
});
|
},
|
// 打开弹窗
|
open() {
|
let cameraPosition = sgworld.Navigate.getDegrees();
|
if (cameraPosition) {
|
this.form.viewHeight = cameraPosition.height.toFixed(2);
|
this.form.longitude = cameraPosition.lon.toFixed(6);
|
this.form.latitude = cameraPosition.lat.toFixed(6);
|
this.form.heading = Cesium.Math.toDegrees(Viewer.camera.heading).toFixed(1);
|
this.form.pitch = Cesium.Math.toDegrees(Viewer.camera.pitch).toFixed(1);
|
}
|
this.$refs.pop.open();
|
},
|
},
|
};
|
</script>
|
<style lang="less">
|
.posjump {
|
margin-top: 20px;
|
.el-form-item__label {
|
color: white;
|
}
|
.jumpBtn {
|
position: relative;
|
left: 40%;
|
}
|
.el-radio {
|
width: 100px;
|
margin-right: 0px;
|
}
|
.el-input {
|
width: 300px;
|
}
|
/deep/ .el-input__inner {
|
width: 95%;
|
}
|
}
|
</style>
|