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