派生自 wuyushui/SewerAndRainNetwork

YANGDL
2021-01-05 77f7281ff7cee541aaa51339512e6443b7d89e42
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
<template>
  <div class="inner-panel" v-show="isShow">
    <div v-for="item in basemapList" :key="item.code" class="basemap-layer-item">
      <div style="display: flex;">
        <el-checkbox :src="item.conf.icon_actived" style="display: flex;" name="basemap" v-model="selectedBasemap"
                     :value="item.code" label="item.code" @change="changeBasemap">标注
        </el-checkbox>
        <img style="position: absolute;" :src="item.conf.icon_actived" width="50" height="50" :title="item.name"
             @click="changeBasemap"/>
      </div>
 
 
      <!--      <input  style="position: absolute;" type="radio" name="basemap" v-model="selectedBasemap" :value="item.code" title="显示标注" @change="changeBasemap"/>标注-->
 
    </div>
  </div>
</template>
 
<script>
export default {
  name: "LcBaseMap",
  components: {},
  data() {
    return {
      isShow: true,
      basemapList: [],
      selectedBasemap: "tianditu_img",
    };
  },
  computed: {
    basemapHelper() {
      return this.$store.state.map.basemapHelper
    }
  },
  mounted() {
  },
  methods: {
    toggleShow() {
      this.isShow = !this.isShow
    },
    updateBasemapList() {
      let list = this.basemapHelper.getBasemapList();
      this.basemapList = list;
    },
    changeBasemap() {
      this.basemapHelper.showBasemap(this.selectedBasemap, true)
    },
  },
  watch: {
    basemapHelper(newVal) {
      if (newVal != null) {
        this.updateBasemapList();
      }
    },
  },
};
</script>
 
<style scoped lang="less">
.inner-panel {
  display: flex;
  justify-content: center;
  align-items: center;
}
 
.basemap-layer-item {
  display: flex;
  width: 50px;
  height: 50px;
  margin: 10px;
  border: 2px solid white;
 
  input {
    position: relative;
    left: 0px;
    top: -53px;
  }
 
  .basemap-layer-item-name {
    position: relative;
    left: 0px;
    top: -53px;
  }
}
</style>