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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<template>
  <mars-pannel :visible="true" right="10" top="10" width="300">
    <div class="property-content">
      <h2 class="f-mb title">瓦片底图通用参数</h2>
      <mars-gui :options="options"></mars-gui>
    </div>
  </mars-pannel>
</template>
 
<script lang="ts" setup>
import * as mapWork from "./map.js"
import type { GuiItem } from "@mars/components/mars-ui/mars-gui"
 
const options: GuiItem[] = [
  {
    type: "slider",
    field: "brightness",
    label: "亮度",
    step: 0.01,
    min: 0,
    max: 3,
    value: 1.0,
    // extra: "{brightness}",
    change(data) {
      changeOpacity("brightness", data)
    }
  },
  {
    type: "slider",
    field: "contrast",
    label: "对比度",
    step: 0.01,
    min: 0,
    max: 3,
    value: 1.16,
    // extra: "{contrast}",
    change(data) {
      changeOpacity("contrast", data)
    }
  },
  {
    type: "slider",
    field: "hue",
    label: "色彩",
    step: 0.01,
    min: 0,
    max: 3,
    value: 0.1,
    // extra: "{hue}",
    change(data) {
      changeOpacity("hue", data)
    }
  },
  {
    type: "slider",
    field: "saturation",
    label: "饱和度",
    step: 0.01,
    min: 0,
    max: 3,
    value: 1.0,
    // extra: "{saturation}",
    change(data) {
      changeOpacity("saturation", data)
    }
  },
  {
    type: "slider",
    field: "gamma",
    label: "伽马值",
    step: 0.01,
    min: 0,
    max: 3,
    value: 0.53,
    // extra: "{gamma}",
    change(data) {
      changeOpacity("gamma", data)
    }
  },
  {
    type: "slider",
    field: "opacity",
    label: "透明度",
    step: 0.01,
    min: 0,
    max: 3,
    value: 1.0,
    // extra: "{opacity}",
    change(data) {
      changeOpacity("opacity", data)
    }
  }
]
 
const changeOpacity = (attribute: string, val: number) => {
  mapWork.changeOpacity(attribute, val)
}
</script>
<style lang="less" scoped>
.title {
  color: @mars-base-color;
  font-size: 16px;
  text-align: center;
}
 
.property-content {
  width: 100%;
  overflow-x: hidden;
}
</style>