fuchengshen
2022-07-09 3a25c05b5ab837714f30469cdcb1e2a77d8d7f6c
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<template>
  <mars-pannel :visible="true" right="10" top="10">
    <div class="f-mb">
      <a-space>
        <mars-button @click="clear">清除</mars-button>
        <a-checkbox @change="isChecked" v-model:checked="checked">仅测量模型(不拾取地形)</a-checkbox>
      </a-space>
    </div>
 
    <div class="f-mb">
      <a-space>
        <mars-button @click="measureLength">空间距离</mars-button>
        <mars-button @click="measureArea">水平面积</mars-button>
        <mars-button @click="measureHeight">高度差</mars-button>
        <mars-button @click="measurePoint">坐标测量</mars-button>
      </a-space>
    </div>
 
    <div>
      <a-space>
        <mars-button @click="measureSurfaceLength">贴地距离</mars-button>
        <mars-button @click="measureSurfaceeArea">贴地面积</mars-button>
        <mars-button @click="measureTriangleHeight">三角测量</mars-button>
        <mars-button @click="measureAngle">方位角</mars-button>
      </a-space>
    </div>
  </mars-pannel>
 
  <location-to />
</template>
 
<script setup lang="ts">
import { ref } from "vue"
import LocationTo from "@mars/components/mars-sample/location-to.vue"
import * as mapWork from "./map.js"
 
const checked = ref(false)
 
// 空间距离
const measureLength = () => {
  mapWork.measureLength()
}
// 水平面积
const measureArea = () => {
  mapWork.measureArea()
}
 
// 高度差
const measureHeight = () => {
  mapWork.measureHeight()
}
 
// 坐标测量
const measurePoint = () => {
  mapWork.measurePoint()
}
 
// 贴地距离
const measureSurfaceLength = () => {
  mapWork.measureSurfaceLength()
}
 
// 贴地面积
const measureSurfaceeArea = () => {
  mapWork.measureSurfaceeArea()
}
 
// 三角测量
const measureTriangleHeight = () => {
  mapWork.measureTriangleHeight()
}
// 方位角
const measureAngle = () => {
  mapWork.measureAngle()
}
 
const isChecked = () => {
  mapWork.onlyPickModelPosition(checked.value)
}
const clear = () => {
  mapWork.removeAll()
}
</script>