UNPKG

2.19 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/BaseMapWrapper.ts"],"names":["BaseMapWrapper","TYPES","ILogService","IGlobalConfigService","config","sceneContainer","id","bind","MapConfig","toConstantValue","IMapService","to","getServiceConstructor","inSingletonScope","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;IAUqBA,c,WAClB,wBAAWC,cAAMC,WAAjB,C,UAGA,wBAAWD,cAAME,oBAAjB,C;AAKD,0BAAYC,MAAZ,EAAyC;AAAA;AAAA;AAAA;AAAA,SAF/BA,MAE+B;AACvC,SAAKA,MAAL,GAAcA,MAAd;AACD;;;;WAED,sBAAoBC,cAApB,EAA+CC,EAA/C,EAA4E;AAW1ED,MAAAA,cAAc,CAACE,IAAf,CAAyCN,cAAMO,SAA/C,EAA0DC,eAA1D,iCACK,KAAKL,MADV;AAEEE,QAAAA,EAAE,EAAFA;AAFF;AAIAD,MAAAA,cAAc,CACXE,IADH,CAC6BN,cAAMS,WADnC,EAEGC,EAFH,CAEM,KAAKC,qBAAL,EAFN,EAGGC,gBAHH;AAID;;;WAED,iCAEE;AACA,YAAM,IAAIC,KAAJ,CAAU,yBAAV,CAAN;AACD","sourcesContent":["import {\n IGlobalConfigService,\n ILogService,\n IMapConfig,\n IMapService,\n IMapWrapper,\n lazyInject,\n TYPES,\n} from '@antv/l7-core';\nimport { Container } from 'inversify';\nexport default class BaseMapWrapper<RawMap> implements IMapWrapper {\n @lazyInject(TYPES.ILogService)\n protected readonly logger: ILogService;\n\n @lazyInject(TYPES.IGlobalConfigService)\n protected readonly configService: IGlobalConfigService;\n\n protected config: Partial<IMapConfig>;\n\n constructor(config: Partial<IMapConfig>) {\n this.config = config;\n }\n\n public setContainer(sceneContainer: Container, id: string | HTMLDivElement) {\n // // 首先使用全局配置服务校验地图参数\n // const { valid, errorText } = this.configService.validateMapConfig(\n // this.config,\n // );\n\n // if (!valid) {\n // this.logger.error(errorText || '');\n // return;\n // }\n // 绑定用户传入的原始地图参数\n sceneContainer.bind<Partial<IMapConfig>>(TYPES.MapConfig).toConstantValue({\n ...this.config,\n id,\n });\n sceneContainer\n .bind<IMapService<RawMap>>(TYPES.IMapService)\n .to(this.getServiceConstructor())\n .inSingletonScope();\n }\n\n protected getServiceConstructor(): new (...args: any[]) => IMapService<\n RawMap\n > {\n throw new Error('Method not implemented.');\n }\n}\n"],"file":"BaseMapWrapper.js"}
\No newline at end of file