派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-03-31 bd3572a541f3698a9ed1e45c09c37529253b26e3
工具栏BUG
2个文件已修改
30 ■■■■■ 已修改文件
src/components/panel/ToolBoxPanel.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/MapTemplate.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/panel/ToolBoxPanel.vue
@@ -1,5 +1,5 @@
<template>
  <div class="left-top-toolbox-panel">
  <div class="left-top-toolbox-panel" v-if="toolBoxPanelVisible">
    <div class="specific-tools">
      <el-button :class="selectGroup === true ?'active-button':''" class="el-button-choice"
                 @mouseover.enter.native="changeSelectMouse">
@@ -30,7 +30,7 @@
              <img :src="itemT.icon" :title="itemT.title" alt="" v-else/>
            </el-button>
            <div class="base-map-inner-panel" v-show="item.index==='2'">
              <div v-for="item in basemapList" :key="item.code" class="basemap-layer-item">
              <div v-for="item in basemapHelper.basemapList" :key="item.code" class="basemap-layer-item">
                <img class="base-map-img" width="50" height="50" :src="item.conf.icon_actived" :title="item.name"
                     @click="changeBasemap(item)" alt=""/>
                <el-checkbox class="base-map-anno" name="basemap" v-model="item.conf.annotationCheck"
@@ -101,6 +101,7 @@
      currentBaseMapCode: 'tianditu_img',
      basemapList: [],
      selectGroup: false,
      toolBoxPanelVisible: false,
      drawLayer: null,
      drawLayerArray: [],
      map: null,
@@ -262,23 +263,16 @@
      return this.$store.state.map.basemapHelper
    }
  },
  watch: {
    basemapHelper (newVal) {
      if (newVal != null) {
        this.updateBasemapList()
      }
    }
  },
  methods: {
    updateBasemapList () {
      this.basemapList = this.basemapHelper.getBasemapList()
    init (map) {
      this.map = map
      this.toolBoxPanelVisible = true
    },
    changeBasemap (itm) {
      this.active = -1
      const code = itm.code
      this.basemapList.forEach((item) => {
      this.basemapHelper.basemapList.forEach((item) => {
        if (item.code === code) {
          console.log(this.currentBaseMapCode)
          if (this.currentBaseMapCode == null || this.currentBaseMapCode !== code) {
            this.currentBaseMapCode = code
            this.basemapHelper.showBasemap(item.code, item.conf.annotationCheck, true)
@@ -286,7 +280,7 @@
            this.basemapHelper.showBasemap(item.code, item.conf.annotationCheck, false)
          }
          this.basemapHelper.getBasemapList().forEach((item) => {
          this.basemapHelper.basemapList.forEach((item) => {
            item.layer.bringToBack()
          })
        }
src/views/MapTemplate.vue
@@ -68,7 +68,8 @@
      lcServiceLayerVisible: false,
      basemapHelper: {},
      serviceLayerHelper: {},
      vectorLayerHelper: {}
      vectorLayerHelper: {},
      toolBoxVisible: false
    }
  },
  computed: {
@@ -132,7 +133,6 @@
    init () {
      const mapcontainer = this.$refs.rootmap
      this.map = Sgis.initMap(mapcontainer)
      this.$refs.toolBox.map = this.map
      window.popupComp = this.$refs.popup
      var layerFactory = new LayerFactory({
@@ -152,10 +152,10 @@
      this.vectorLayerHelper = Sgis.initVectorLayersHelper(this.map) // 初始化动态要素图层助手
      this.vectorLayerHelper.initVectorLayers(this.config)
      this.ChangeState()
      // this.ChangeState()
      // this.AddGasHelper()
      // this.ChangeWaterState()
      this.$refs.toolBox.init(this.map)
      this.saveMapStatus()
      // this.setMapObj(this.mapObj)
      // this.setBasemapHelper(this.basemapHelper)