diff --git a/packages/core/src/services/layer/LayerService.ts b/packages/core/src/services/layer/LayerService.ts index 068e000678..9dafcc1356 100644 --- a/packages/core/src/services/layer/LayerService.ts +++ b/packages/core/src/services/layer/LayerService.ts @@ -24,7 +24,6 @@ export default class LayerService implements ILayerService { public add(layer: ILayer) { this.layers.push(layer); - debugger this.initPlugin(layer); layer.init(); } diff --git a/packages/core/src/services/scene/SceneService.ts b/packages/core/src/services/scene/SceneService.ts index 3e20945461..7aece4db44 100644 --- a/packages/core/src/services/scene/SceneService.ts +++ b/packages/core/src/services/scene/SceneService.ts @@ -119,6 +119,9 @@ export default class Scene extends EventEmitter implements ISceneService { // 重新绑定非首次相机更新事件 this.map.onCameraChanged(this.handleMapCameraChanged); this.logger.info('map loaded'); + + // scene 创建完成自动调用render 方法 + this.render(); }); /** @@ -161,14 +164,13 @@ export default class Scene extends EventEmitter implements ISceneService { await this.initPromise; // 初始化 marker 容器 TODO: 可以放到 map 初始化方法中? this.map.addMarkerContainer(); - this.layerService.initLayers(); - + this.logger.info(' render inited'); this.inited = true; this.emit('loaded'); } this.layerService.renderLayers(); - // this.logger.info('render'); + this.logger.info('render'); } public destroy() {