派生自 wuyushui/SewerAndRainNetwork

chenyabin
2021-04-15 8f327155ec6a3d5ad1f1ff4e170ed85747439373
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
import { logicMapper } from '../../../conf/Constants'
 
class EventLayerService {
  constructor (config) {
    this.L = window.L
    this.map = window.map
    this.config = config
  }
 
  init () {
    // 引入 关联的js,在constant.js中根据config配置的id得到处理js
    const id = this.config.code
    const checked = this.config.checked
    const file = logicMapper[id]
    if (!file) {
      console.log('找不到逻辑处理js!!!' + id)
    } else {
      var BusiLayer = require('../logic/' + file)
      var busiLayer = new BusiLayer()
      checked ? busiLayer.init(this.config) : busiLayer.destory(this.config)
    }
  }
}
 
export default EventLayerService