diff --git a/.eslintignore b/.eslintignore index e35cabbe24..9e34b3efdb 100755 --- a/.eslintignore +++ b/.eslintignore @@ -8,9 +8,6 @@ node_modules/ demos/assets/ demos/index.html demos/* -<<<<<<< HEAD rollup/* webpack/* -======= -src/core/three.js ->>>>>>> master +src/core/three.js \ No newline at end of file diff --git a/package.json b/package.json index b9cd0f7767..de8cfb3603 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7", - "version": "1.1.0", + "version": "1.1.1", "description": "Large-scale WebGL-powered Geospatial Data Visualization", "main": "build/l7.js", "browser": "build/l7.js", diff --git a/src/core/layer.js b/src/core/layer.js index ef474d51a0..9d7e3fea00 100644 --- a/src/core/layer.js +++ b/src/core/layer.js @@ -89,6 +89,7 @@ export default class Layer extends Base { const zoom = this.scene.getZoom(); object.material.setUniformsValue('u_time', this.scene._engine.clock.getElapsedTime()); object.material.setUniformsValue('u_zoom', zoom); + this.preRender(); }; object.onAfterRender = () => { // 每次渲染后改变状态 @@ -282,7 +283,11 @@ export default class Layer extends Base { this.off('mouseleave', resetHander); } } - + setActive(id, color) { + this._activeIds = id; + this.layerMesh.material.setUniformsValue('u_activeId', id); + this.layerMesh.material.setUniformsValue('u_activeColor', ColorUtil.color2RGBA(color)); + } _addActiveFeature(e) { const { featureId } = e; this._activeIds = featureId; diff --git a/src/util/geo.js b/src/util/geo.js index fca8dd519d..1830562536 100644 --- a/src/util/geo.js +++ b/src/util/geo.js @@ -12,15 +12,15 @@ export function extent(data) { return extent; } function calcExtent(extent, coords) { - coords.forEach(coord => { - if (Array.isArray(coord[0])) { + if (Array.isArray(coords[0])) { + coords.forEach(coord => { calcExtent(extent, coord); - } else { - if (extent[0] > coord[0]) extent[0] = coord[0]; - if (extent[1] > coord[1]) extent[1] = coord[1]; - if (extent[2] < coord[0]) extent[2] = coord[0]; - if (extent[3] < coord[1]) extent[3] = coord[1]; - } - }); + }); + } else { + if (extent[0] > coords[0]) extent[0] = coords[0]; + if (extent[1] > coords[1]) extent[1] = coords[1]; + if (extent[2] < coords[0]) extent[2] = coords[0]; + if (extent[3] < coords[1]) extent[3] = coords[1]; + } return extent; }