From 5362965dee474640ea659ce88d058c468cd69bdb Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Wed, 27 Feb 2019 16:44:33 +0800 Subject: [PATCH] update three --- .eslintignore | 1 + .torch.compile.opts.js | 5 +- package.json | 2 +- src/geo/lngLat.js | 75 --------------------------- src/geom/buffer/heatmap/hexagon.js | 1 - src/geom/buffer/point/normalBuffer.js | 2 +- src/layer/heatmap.js | 1 - src/layer/lineLayer.js | 1 - src/layer/pointLayer.js | 2 - src/source/transform/grid.js | 6 --- 10 files changed, 6 insertions(+), 90 deletions(-) delete mode 100644 src/geo/lngLat.js diff --git a/.eslintignore b/.eslintignore index 81629f01bf..776103ec61 100755 --- a/.eslintignore +++ b/.eslintignore @@ -7,3 +7,4 @@ node_modules/ demos/assets/ demos/index.html demos/* +src/core/three.js diff --git a/.torch.compile.opts.js b/.torch.compile.opts.js index cea3ac8770..142e0804d2 100755 --- a/.torch.compile.opts.js +++ b/.torch.compile.opts.js @@ -3,13 +3,14 @@ module.exports = { babelrc: { presets: [ "@babel/preset-env" - ] + ], }, extensions: ['.js'], include: [ 'src/**/*.js', 'test/**/*.js', - 'node_modules/_three@0.96.0@three/**/*.js', + 'node_modules/_three@0.101.1@three/**/*.js', + 'node_modules/three/**/*.js', 'node_modules/simple-statistics/src/*.js' ], exclude: [ diff --git a/package.json b/package.json index e992b41020..c28b5a396a 100755 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "polyline-normals": "^2.0.2", "rbush": "^2.0.2", "simple-statistics": "^7.0.1", - "three": "^0.96.0", + "three": "^0.101.1", "venn.js": "^0.2.20", "viewport-mercator-project": "^5.2.0", "webworkify-webpack": "^2.1.3", diff --git a/src/geo/lngLat.js b/src/geo/lngLat.js deleted file mode 100644 index b635918f0c..0000000000 --- a/src/geo/lngLat.js +++ /dev/null @@ -1,75 +0,0 @@ -self._wkHandlers={};; - - function _prep_h17(){function a(b,c,d,e,g,k){var l=[0,0,0,0,0],n=d.slice(0,4).concat(l),p=[],s=Math.PI/180*6,A=void 0,I=void 0,A=d.slice(0,2),D=m(e),F=m(g),I=q.normalize(h(D).fg(h(A))),C=q.normalize(h(F).fg(h(A)));q.OK(I,k)?(A=q.oD(I),I=q.oD(C)):(A=q.oD(C),I=q.oD(I),k=[F,D],D=k[0],F=k[1],g=[g,e],e=g[0],g=g[1]);D=Math.ceil(Math.abs(I-A)/s);30<=D&&(D=60-D);for(k=0;kMath.sqrt(3)/2&&(d=Math.sqrt(3)/2);c=c.oJ(d)}return c}function g(a,c,e){if(void 0===e||!0===e)b.push(a[0],a[1]),b.push(-c.y,c.x,0,0),b.push(m,0,0),d.push(a[2]);if(void 0===e||!1===e)b.push(a[0],a[1]),b.push(c.y,-c.x,0,0),b.push(m,0,0),d.push(a[2])}for(var k=a[0],l=a[a.length-1],m=0,n=void 0;k[0]===l[0]&&k[1]===l[1]&&k!==l;)a.pop(),l=a[a.length-1];a.push(k);a.push(a[1]);a.unshift(l);var p=a.length;a.forEach(function(a,d, k){var l=k[d-1];k=k[d+1];var r=void 0;l&&(m+=q.Fd(a,l));if(0===d||d===p-1)0===d?(r=q.normalize(h(k[0]-a[0],k[1]-a[1])),c.push(0,1,2)):(r=q.normalize(h(a[0]-l[0],a[1]-l[1])),d=b.length/9+2,c.push(d-3,d-1,d-2)),g(a,r);else{d=q.normalize(h(a[0]-l[0],a[1]-l[1]));k=q.normalize(h(k[0]-a[0],k[1]-a[1]));l=q.normalize(d.multiply(-1).mi(k));n=q.OK(l,d);g(a,e(d,k),!0);g(a,e(d,k),!1);g(a,e(d,k),!0);g(a,e(d,k),!1);a=b.length/9-4;k=a+2;var r=9*a,s=r+9,x=s+9,B=x+9;d=Math.abs(q.cos(d,l)/q.sin(d,l));n?(b[r+7]=d,b[s+ 7]=-d,b[x+7]=-d,b[B+7]=d):(b[r+7]=-d,b[s+7]=d,b[x+7]=d,b[B+7]=-d);c.push(a,a-1,a+1);c.push(k,k+1,k+2)}})}function e(c,d,e){function g(a,b){if(p)for(;0=a&&(a+=2*Math.PI);return a}},s={mi:function(a){return h(this.x+a.x,this.y+a.y)},fg:function(a){return h(this.x-a.x,this.y-a.y)},multiply:function(a){return"number"===typeof a?h(this.x*a,this.y*a):this.x*a.x+this.y*a.y},oJ:function(a){return h(this.x/a,this.y/a)},NC:function(a){var b=a.y;return this.x===a.x&&this.y===b}};return{parse:function(a,b){var h=a.lineJoin,h=void 0===h?"bevel":h,k= a.lineCap,k=void 0===k?"butt":k,l=a.Zda,l=void 0===l?!1:l,m=a.tn,n=void 0===m?!1:m,p=a.LX,m=a.Iia,q=void 0===m?!0:m,m=a.Sda,s=[],A=[],I=g(a.Nr,void 0===p?!0:p),p=[];l?(d(I,s,A,p),h=s.length,[0,1,2,h/9-1,h/9-2].forEach(function(a){s[9*a+8]=-1})):(c(I,s,A,h,n,p),e(I,s,A,k,p));q&&(s=new Float32Array(s),A=65535=h||b.jn;if(d||b){d=1 { - const { color, size, id, coordinates} = item; + const { color, size, id, coordinates } = item; attributes.vertices.push(...coordinates); attributes.colors.push(...color); attributes.pickingIds.push(id); diff --git a/src/layer/heatmap.js b/src/layer/heatmap.js index 3b23ad98da..73b9b0b1b7 100644 --- a/src/layer/heatmap.js +++ b/src/layer/heatmap.js @@ -36,7 +36,6 @@ export default class HeatMapLayer extends Layer { }; const Mesh = new DrawHexagon(this._buffer, config); this.add(Mesh); - } _drawGrid() { this.type = 'heatmap'; diff --git a/src/layer/lineLayer.js b/src/layer/lineLayer.js index c83c3f0a88..ff672b9196 100644 --- a/src/layer/lineLayer.js +++ b/src/layer/lineLayer.js @@ -11,7 +11,6 @@ export default class LineLayer extends Layer { render() { this.type = 'polyline'; this.init(); - const source = this.layerSource; const layerData = this.layerData; const style = this.get('styleOptions'); const buffer = this._buffer = new LineBuffer({ diff --git a/src/layer/pointLayer.js b/src/layer/pointLayer.js index 7acbdfbf53..39eb197c6d 100644 --- a/src/layer/pointLayer.js +++ b/src/layer/pointLayer.js @@ -37,7 +37,6 @@ export default class PointLayer extends Layer { this._textPoint(); return; } - const source = this.layerSource; const style = this.get('styleOptions'); const pointShapeType = this._getShape(); @@ -98,7 +97,6 @@ export default class PointLayer extends Layer { } _textPoint() { - const source = this.layerSource; const styleOptions = this.get('styleOptions'); const buffer = new TextBuffer({ type: this.shapeType, diff --git a/src/source/transform/grid.js b/src/source/transform/grid.js index 21440bae89..4098f15e15 100644 --- a/src/source/transform/grid.js +++ b/src/source/transform/grid.js @@ -5,12 +5,6 @@ import * as statistics from './statistics'; const R_EARTH = 6378000; -/** - * 计算方格密度图 - * @param {*} data 经纬度数据 和属性数据 - * @param {*} size 半径大小 单位 km - * @return - */ export function aggregatorToGrid(data, option) { const dataArray = data.dataArray; const { size = 10 } = option;