| | |
| | | <template> |
| | | <div class="inner-panel"> |
| | | <div v-for="item in basemapList" :key="item.code" class="basemap-layer-item"> |
| | | <img src="" width="40" height="40" :title="item.name"/> |
| | | <input type="checkbox" title="显示标注" /> |
| | | <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> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'LcBaseMap', |
| | | components: {}, |
| | | porps:['helper'], |
| | | data() { |
| | | data () { |
| | | return { |
| | | basemapList:[] |
| | | isShow: true, |
| | | basemapList: [] |
| | | } |
| | | }, |
| | | mounted(){ |
| | | console.log('03步骤:', this.helper) |
| | | computed: { |
| | | basemapHelper () { |
| | | return this.$store.state.map.basemapHelper |
| | | } |
| | | }, |
| | | methods:{ |
| | | |
| | | 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 scoped lang="less"> |
| | | .inner-panel{ |
| | | <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; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | .basemap-layer-item{ |
| | | width: 40px; |
| | | height: 40px; |
| | | 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> |