派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-06 6f6696463e911e92c9fa9f4e27bfb788768c5f3f
src/components/LayerController/LayerController.vue
@@ -11,7 +11,6 @@
<script>
import '@assets/css/map/magic.min.css'
import presets from './layerControllerPresets'
import iconSetting from '@/assets/images/map-pages/icon/setting.png'
import LcServiceLayer from './modules/LcServiceLayer'
@@ -49,28 +48,9 @@
      }
    }
  },
  mounted () {
    this.$nextTick(function () {
      this.init()
    })
  },
  methods: {
    showPanel () {
      this.layerControllerVisible = !this.layerControllerVisible
    },
    init () {
      this.initPreset()
    },
    initPreset () {
      if (this.preset !== 'default') {
        const prmPreset = presets[this.preset]
        Object.assign(this.layerControllerVisible, prmPreset) // 防止预设参数与默认参数不一致导致报错,如果没有按照您的配置发生改变,请检查拼写是否正确
        if (prmPreset === 'undefined') {
          console.log('该图层控制面板的预设没有找到,请检查预设名称是否正确!')
        } else {
          this.$store.commit('updateLayerControllerVisible', this.layerControllerVisible)
        }
      }
    },
    switchPanel () {
      this.panelSwitch.main = !this.panelSwitch.main