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
<template>
  <mars-pannel :visible="true" right="10" top="10">
    <a-form>
      <a-form-item label="插值数">
        <a-space>
          <mars-input-number v-model:value="txtSplitNum" :step="1" :min="1" :max="999" />
          <mars-button @click="btnDrawExtent">添加矩形</mars-button>
          <mars-button @click="btnDraw">添加多边形</mars-button>
          <mars-button @click="btnDrawPoint">添加点</mars-button>
          <mars-button @click="clearAll">清除</mars-button>
        </a-space>
      </a-form-item>
 
      <a-form-item label="地表渲染">
        <a-radio-group v-model:value="radio" @change="changeShadingType">
          <a-radio value="none">无阴影</a-radio>
          <a-radio value="slope">坡度</a-radio>
          <a-radio value="aspect">坡向</a-radio>
        </a-radio-group>
      </a-form-item>
    </a-form>
  </mars-pannel>
</template>
 
<script setup lang="ts">
import { ref, toRaw } from "vue"
import * as mapWork from "./map.js"
 
const txtSplitNum = ref(10)
const radio = ref("none")
 
// 添加矩形
const btnDrawExtent = () => {
  mapWork.btnDrawExtent(toRaw(txtSplitNum.value))
}
// 添加多边形
const btnDraw = () => {
  mapWork.btnDraw(toRaw(txtSplitNum.value))
}
// 添加点
const btnDrawPoint = () => {
  mapWork.btnDrawPoint()
}
// 清除
const clearAll = () => {
  mapWork.clearAll()
}
 
// 改变阴影
const changeShadingType = () => {
  mapWork.changeShadingType(toRaw(radio.value))
}
</script>
<style scoped lang="less">
.ant-input-number {
  width: 70px !important;
}
</style>