2 lines
5.1 KiB
JavaScript
2 lines
5.1 KiB
JavaScript
define(["./createTaskProcessorWorker","./Resource-8ae1a924","./Cartesian3-e0307675","./HouseDrawer","./snappyJs","./GetPrimitiveData","./when-422ea0ae","./ScanLine","./ElevationTool","./Cache","./defaultValue-81eec7ed","./Check-741c5f3c","./combine-3c023bda","./Math-e73894ab","./RuntimeError-26acdd3b","./Color-82ef4a75","./Transforms-5b829630","./Cartesian2-bd414876","./Matrix4-4c545f70","./ComponentDatatype-aaeec80f","./WebGLConstants-508b9636","./GeometryInstance-1b39c9e8","./PolygonGeometry-95e6b579","./ArcType-fc72c06c","./GeometryOffsetAttribute-ed56ff58","./BoundingRectangle-0e36efc3","./GeographicProjection-c931c7fb","./BoundingSphere-9a3b5656","./Rectangle-cf3e0e3e","./EllipsoidGeodesic-e7a5ca44","./EllipsoidTangentPlane-4d138901","./AxisAlignedBoundingBox-8774439c","./IntersectionTests-80510c7b","./Plane-bc8b6777","./GeometryAttribute-2b42a913","./Matrix2-dc0c61cc","./GeometryPipeline-e7083fea","./AttributeCompression-8f752c03","./EncodedCartesian3-aafcc30f","./IndexDatatype-3f3c99e8","./PolygonGeometryLibrary-231711c2","./arrayRemoveDuplicates-cea3b206","./EllipsoidRhumbLine-592e8885","./GeometryAttributes-32b29525","./PolygonPipeline-04baeb41","./VertexFormat-d50a69ba","./PolygonOutlineGeometry-29f6cf19","./PixelFormat-bd725b72","./PrimitivePipeline-d5bc2e2a","./WebMercatorProjection-44373a3d","./GetRidingLanternGeometry","./LinkedQueue"],(function(e,t,r,n,l,o,i,a,c,f,s,u,h,g,y,d,p,m,b,P,v,w,x,A,C,G,D,S,M,E,L,R,B,F,T,I,N,O,j,k,H,V,q,z,J,W,_,Q,U,K,X,Y){"use strict";let Z,$,ee,te=512,re="",ne={},le={},oe=new f(1e5);function ie(e){let t=1e3,r=0;for(let n=0;n<e.length;n++){let l=e[n];for(let e=0;e<l.length-1;e++){let n=Math.round(l[e+1]);n<t&&(t=n),n>r&&(r=n),e++}}return{ymax:r,ymin:t}}function ae(e,t){let n=t.rectangle;for(var l=[],o=0;o<e.length;o++){var i=ce(e[o],e[o+1],n),a=r.Cartesian3.fromDegrees(i[0],i[1]);l.push(a),o++}return l}function ce(e,t,r){var n=fe(r.west+r.width/te*e),l=fe(r.north-r.height/te*t);return[n=Number(n.toFixed(6)),l=Number(l.toFixed(6))]}function fe(e){return 180*e/Math.PI}function se(e,t){if(Array.isArray(t[0])){let r=t.length;for(let n=0;n<r;n++){se(e,t[n])}}else e.push(t)}function ue(e,t){if("F"!=e[0])if(Array.isArray(e[0])){let r=e.length;for(let n=0;n<r;n++){ue(e[n],t)}}else t&&function(e){let t=[e[0],e[1]];for(let r=2;r<e.length;r++){let n=t[0]+e[r],l=t[1]+e[r+1];e[r]=n,e[r+1]=l,t=[n,l],r++}}(e);else e[0]=[.05*-te,.05*-te,1.05*te,.05*-te,1.05*te,1.05*te,.05*-te,1.05*te]}return e((function(e,r){if(1==e.init)return function(e){return Z=new Function("drawer","level",e.styleStr),te=e.tileSize,re=e.return_type,ne=e,$=e.indexDbNames,ee=e.indexDbName,c.getDBMap($,le)}(e);var f,s=e.url,u=new t.Resource({url:s});if(u.request.throttle=!1,u.request.throttleByServer=!0,u.request.type=1,!(f="stream_snappy"==re?u.fetchArrayBuffer():u.fetchJson()))return!0;let h=[];h.push(f);let g=$.slice(0,$.length-1);h.push(c.getElevation(le,g,e.xyz));let y=i.when.defer();return i.when.all(h,(function(t){let i=t[0];if(i||(i={}),"stream_snappy"==re){i=l(i);let e=function(e){let t=[],r=0,n=0;for(;r<e.length;){let l=e[r++];if(l<128)t[n++]=l;else if(l>191&&l<224){let o=e[r++];t[n++]=(31&l)<<6|63&o}else if(l>239&&l<365){let o=((7&l)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[n++]=55296+(o>>10),t[n++]=56320+(1023&o)}else{let o=e[r++],i=e[r++];t[n++]=(15&l)<<12|(63&o)<<6|63&i}}let l=[],o=0,i=0,a=0,c=5e4,f=t.length/c-1;for(o=0;o<f;o++)i=o*c,a=(o+1)*c,l.push(String.fromCharCode.apply({},t.slice(i,a)));return i=o*c,a=t.length,l.push(String.fromCharCode.apply({},t.slice(i,a))),l=l.join(""),l}(new Uint8Array(i));i=JSON.parse(e)}let f=function(e,t){if(e&&e.layer){(function(e,t){for(let r in e){let n=e[r].features;n||(n=e[r].datas);for(let e=0;e<n.length;e++)ue(n[e][2],t)}})(e=e.layer,t.needDecode);let r={},l=new n([e],t.level,r,t.controlVector,t.highLightVector,t.filterLayerId);return Z.call({},l,t.level),function(e){for(let t in e){let r=e[t];for(let e=0;e<r.length;e++){let t=r[e],n=[];se(n,t.data),delete t.data,t.geometrys=n;let l=0;if(ne.hasOwnProperty("heightProperty")){let e=ne.heightProperty;l=t.properties[e],ne.hasOwnProperty("heightScale")&&(l*=parseFloat(ne.heightScale))}t.height=l,t.totalHeight=l}}}(r),r}return{}}(i,e);ne.hasTerrain&&function(e,t){var r=1e3,n=0;for(let l in e){let o=e[l];for(let e=0;e<o.length;e++){let l=o[e],i=-2e4,a=oe.get(l.properties.id);if(a)i=a;else{for(let e=0;e<l.geometrys.length;e++){let o=l.geometrys[e];for(let e=0;e<o.length-1;e++){let l=Math.round(o[e]),a=Math.round(o[e+1]);if(a<r&&(r=a),a>n&&(n=a),e++,l<0||l>te-1||a<0||a>te-1)continue;let c=a*te+l,f=0;for(let e in t){f+=t[e].data[c]}f>i&&(i=f)}}-2e4==i&&(i=0),oe.set(l.properties.id,i)}l.terrainHeight=i,l.totalHeight=i+l.height}}}(f,t[1]);let s=function(e,t){let r=new Int32Array(t*t);for(let n in e){let l=e[n];for(let e=0;e<l.length;e++){let n=l[e],o=ie(n.geometrys);a(r,n,t,o.ymax,o.ymin)}}return r}(f,te);!function(e,t){for(let r in e){let n=e[r];for(let e=0;e<n.length;e++){let r=n[e];r.polygons=[];for(let e=0;e<r.geometrys.length;e++){let n=ae(r.geometrys[e],t);r.polygons.push(n)}delete r.geometrys}}}(f,e);let u=o(f,e.level,ne,r);c.updateElevation(le[ee],ee,e.xyz,s).promise.always((function(e){y.resolve(u)}))}),(function(e){y.reject(e)})),y.promise}))}));
|