1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| let Cesium = window.Cesium
| export default {
| data() {
| return {
| flyTo: undefined,
| fonts: [
| { name: '宋体', value: 'SimSun' },
| { name: '新宋体', value: 'NSimSun' },
| { name: '仿宋_GB2312', value: 'FangSong_GB2312' },
| { name: '楷体_GB2312', value: 'KaiTi_GB2312' },
| { name: '黑体', value: 'SimHei' },
| { name: '微软雅黑', value: 'Microsoft YaHei' },
| { name: 'Arial', value: 'Arial' },
| { name: 'Arial Black', value: 'Arial Black' },
| { name: 'Times New Roman', value: 'Times New Roman' },
| { name: 'Tahoma', value: 'Tahoma' },
| { name: 'Verdana', value: 'Verdana' },
| ]
| };
| },
| computed: {
| flyToPosition() {
| if (this.flyTo) {
| let flyTo = this.flyTo.split(',')
| return `经度:${flyTo[0]}\n纬度:${flyTo[1]}\n高度:${flyTo[2]}\n旋转角:${flyTo[3]}\n俯仰角:${flyTo[4]}`
| }
| }
| },
| methods: {
| getPosition() {
| let degrees = window.sgworld.Navigate.getDegrees()
| let { heading, pitch } = window.Viewer.camera
| heading = Cesium.Math.toDegrees(heading)
| pitch = Cesium.Math.toDegrees(pitch)
| this.flyTo = `${degrees.lon.toFixed(5)},${degrees.lat.toFixed(5)},${degrees.height.toFixed(2)},${heading.toFixed(1)},${pitch.toFixed(1)}`
| }
| }
| }
|
|