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
| <template>
| <div class="base-map-inner-panel" v-show="isShow">
| <div style="display: flex;" v-for="item in basemapList" :key="item.code" class="basemap-layer-item">
| <img class="base-map-img" :src="item.conf.icon_actived" width="50" height="50" :title="item.name"
| @click="changeBasemap(item)"/>
| <el-checkbox class="base-map-anno" name="basemap" v-model="item.conf.annotationCheck"
| label="标注" @change="changeBasemap(item)">
| </el-checkbox>
| </div>
| </div>
| </template>
| <script>
| export default {
| name: 'LcBaseMap',
| components: {},
| data () {
| return {
| isShow: true,
| basemapList: []
| }
| },
| computed: {
| basemapHelper () {
| return this.$store.state.map.basemapHelper
| }
| },
| mounted () {
| },
| methods: {
| updateBasemapList () {
| this.basemapList = this.basemapHelper.getBasemapList()
| },
| changeBasemap (itm) {
| const code = itm.code
| this.basemapList.forEach((item) => {
| if (item.code === code) {
| this.basemapHelper.showBasemap(item.code, item.conf.annotationCheck, true)
| this.basemapHelper.getBasemapList().forEach((item) => {
| item.layer.bringToBack()
| })
| }
| })
| }
| },
| watch: {
| basemapHelper (newVal) {
| if (newVal != null) {
| this.updateBasemapList()
| }
| }
| }
| }
| </script>
|
| <style lang="less">
| .base-map-inner-panel {
| display: flex;
| justify-content: center;
| align-items: center;
|
| .base-map-img{
| position: absolute;
| }
| .base-map-img:hover{
| cursor:pointer;
| }
| .base-map-anno{
| position: absolute;margin-left: 2px;background-color: rgba(0,0,0,.5);color: white;
| .el-checkbox__label{
| padding-left: 5px !important;
| }
| }
| .basemap-layer-item {
| display: flex;
| width: 50px;
| height: 50px;
| margin: 10px;
| border: 2px solid white;
| input {
| position: relative;
| left: 0;
| top: -53px;
| }
| .basemap-layer-item-name {
| position: relative;
| left: 0;
| top: -53px;
| }
| }
| }
| </style>
|
|