派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-03-29 8792f905ede68bb1161a1c90948df937861481ad
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
/**
 * 加载业务数据图层
 */
import { logicMapper } from '@src/conf/Constants'
 
class BusiLayerService {
  constructor (config) {
    this.L = window.L
    this.map = window.map
    this.config = config
  }
 
  init (layer) {
    // 引入 关联的js,在constant.js中根据config配置的id得到处理js
    const id = this.config.code
    console.log(logicMapper)
    const file = logicMapper[id]
    if (!file) {
      console.log('找不到逻辑处理js!!!')
    } else {
      console.log('-----' + file)
      var BusiLayer = require('../logic/' + file)
      console.log(BusiLayer)
      var busiLayer = new BusiLayer()
      // 调用init
      busiLayer.init(layer)
      // 调用click事件
    }
  }
}
 
export default BusiLayerService