diff --git a/package.json b/package.json index 16540a6840..4bfd95b7ed 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7", - "version": "1.2.3", + "version": "1.3.0", "description": "Large-scale WebGL-powered Geospatial Data Visualization", "main": "build/L7.js", "browser": "build/L7-min.js", diff --git a/src/core/scene.js b/src/core/scene.js index a94034fd1a..0a8359aa54 100644 --- a/src/core/scene.js +++ b/src/core/scene.js @@ -28,8 +28,8 @@ export default class Scene extends Base { _initEngine(mapContainer) { this._engine = new Engine(mapContainer, this); - this.registerMapEvent(); - this._engine.run(); + this.registerMapEvent(); // 和高德地图同步状态 + // this._engine.run(); compileBuiltinModules(); } _initContoller() { @@ -53,13 +53,13 @@ export default class Scene extends Base { const Map = new MapProvider(this._attrs); Map.mixMap(this); this._container = Map.container; - this._markerContainier = Map.l7_marker_Container; Map.on('mapLoad', () => { this.map = Map.map; + this._markerContainier = Map.l7_marker_Container; this._initEngine(Map.renderDom); Map.asyncCamera(this._engine); this.initLayer(); - // this._registEvents(); + this._registEvents(); const hash = this.get('hash'); if (hash) { const Ctor = getInteraction('hash'); @@ -174,14 +174,14 @@ export default class Scene extends Base { // 地图状态变化时更新可视化渲染 registerMapEvent() { this._updateRender = () => this._engine.update(); - this.map.on('mousemove', this._updateRender); - // this.map.on('mapmove', this._updateRender); + // this.map.on('mousemove', this._updateRender); + this.map.on('mapmove', this._updateRender); this.map.on('camerachange', this._updateRender); } unRegsterMapEvent() { - this.map.off('mousemove', this._updateRender); - // this.map.off('mapmove', this._updateRender); + // this.map.off('mousemove', this._updateRender); + this.map.off('mapmove', this._updateRender); this.map.off('camerachange', this._updateRender); } // control diff --git a/src/interaction/active.js b/src/interaction/active.js index d4e8807d45..7269fc37bf 100644 --- a/src/interaction/active.js +++ b/src/interaction/active.js @@ -9,8 +9,10 @@ export default class Active extends Interaction { } process(ev) { this.layer._addActiveFeature(ev); + this.layer.scene._engine.update(); } reset() { this.layer._resetStyle(); + this.layer.scene._engine.update(); } } diff --git a/src/interaction/select.js b/src/interaction/select.js index 2cf5e4d001..2481872694 100644 --- a/src/interaction/select.js +++ b/src/interaction/select.js @@ -8,5 +8,6 @@ export default class Select extends Interaction { } process(ev) { this.layer._addActiveFeature(ev); + this.layer.scene._engine.update(); } }