派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-06 a702aac1e6c1c9a549d3c6d78c5b5fc91d55405f
Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop
2个文件已修改
16 ■■■■■ 已修改文件
src/components/LayerController/service/LayerFactory.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/MapTemplate.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/service/LayerFactory.js
@@ -1,4 +1,3 @@
import store from '@/store'
import WfsLayerService from './WfsLayerService'
import BusiLayerService from './BusiLayerService'
import WmsLayerService from './WmsLayerService'
@@ -10,17 +9,15 @@
    this.layers = {}
  }
  init () {
  init (layerConfig) {
    // 1. 遍历layer config
    var layerConfig = store.state.map.serviceLayers.LayerSewersLine
    for (var i = 0, l = layerConfig.length; i < l; i++) {
      var config = layerConfig[i]
      var layers = config.layers
      for (var j = 0; j < layers.length; j++) {
        var childConfig = layers[j]
        var checked = childConfig.checked
        checked && this.load(childConfig)
      }
      layers && this.init(config.layers)
      var checked = config.checked
      checked && this.load(config)
    }
  }
src/views/MapTemplate.vue
@@ -90,7 +90,7 @@
        L: window.L,
        map: this.map
      })
      layerFactory.init()
      layerFactory.init(this.$store.state.map.serviceLayers.LayerSewersLine)
      window.layerFactory = layerFactory
      this.basemapHelper = Sgis.initBasemapsHelper(this.map) // 初始化基础底图助手
@@ -106,7 +106,6 @@
      // this.setBasemapHelper(this.basemapHelper)
      // this.setServiceLayerHelper(this.serviceLayerHelper)
      // this.setVectorLayerHelper(this.vectorLayerHelper)
      this.addMarker()
    },
    onLayerClick () {
      this.$refs.popup.setShow()