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
<template>
  <mars-pannel :visible="true" right="10" top="10" width="320">
    <a-form>
      <a-form-item>
        <a-row :gutter="[0, 10]">
          <a-col :span="7">模型角度:</a-col>
          <a-col :span="16">
            <a-radio-group v-model:value="formState.radio">
              <a-radio value="1">自动</a-radio>
              <a-radio value="2">手动</a-radio>
            </a-radio-group>
          </a-col>
        </a-row>
      </a-form-item>
      <a-form-item v-show="formState.radio === '2'">
        <a-row :gutter="[0, 10]">
          <a-col :span="7">heading值:</a-col>
          <a-col :span="16">根据路线自动计算</a-col>
 
          <a-col :span="7">pitch值(前后):</a-col>
          <a-col :span="16">
            <mars-slider @change="updateModel" v-model:value="formState.slidePitchStep" :min="-90" :max="90" :step="0.01" />
          </a-col>
 
          <a-col :span="7">roll值(左右):</a-col>
          <a-col :span="16">
            <mars-slider @change="updateModel" v-model:value="formState.slideRollStep" :min="-90" :max="90" :step="0.01" />
          </a-col>
        </a-row>
      </a-form-item>
      <a-form-item>
        <mars-button @click="onClickClear"> 清除地面投影</mars-button>
      </a-form-item>
    </a-form>
  </mars-pannel>
  <roamline-panel />
</template>
 
<script setup lang="ts">
import { reactive } from "vue"
import roamlinePanel from "@mars/components/mars-sample/roamline-panel.vue"
import type { UnwrapRef } from "vue"
import * as mapWork from "./map.js"
 
interface FormState {
  radio: string
  slidePitchStep: number
  slideRollStep: number
}
 
const formState: UnwrapRef<FormState> = reactive({
  radio: "2",
  slidePitchStep: 0,
  slideRollStep: 10
})
 
mapWork.eventTarget.on("loadRoamLine", () => {
  mapWork.updateModel(false, formState)
})
 
const updateModel = () => {
  mapWork.updateModel(false, formState)
}
 
const onClickClear = () => {
  mapWork.clearGraphic()
}
</script>
 
<style scoped lang="less">
.roamLinePanel {
  width: 300px;
}
</style>