2 lines
4.7 KiB
JavaScript
2 lines
4.7 KiB
JavaScript
define(["./createTaskProcessorWorker","./Resource-8ae1a924","./Cartesian3-e0307675","./HouseDrawer","./ParseBinaryData","./GetPrimitiveData","./when-422ea0ae","./ScanLine","./ElevationTool","./Cache","./defaultValue-81eec7ed","./Check-741c5f3c","./combine-3c023bda","./Math-e73894ab","./RuntimeError-26acdd3b","./Buffer","./base64","./ieee754","./isArray","./VarintReader","./snappyJs","./CodeTool","./LayerContentModel","./GisTools","./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,o,l,i,a,c,f,s,u,h,d,g,y,p,m,b,v,P,x,G,w,A,C,D,M,B,L,R,T,E,F,I,S,V,k,H,N,O,j,q,z,W,J,Q,K,U,X,Y,Z,$,_,ee,te,re,ne,oe,le,ie){"use strict";let ae,ce,fe,se={},ue=512,he={},de={},ge={},ye=new f(1e5);function pe(e,t){if("F"!=e[0])if(Array.isArray(e[0])){let r=e.length;for(let n=0;n<r;n++){pe(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],o=t[1]+e[r+1];e[r]=n,e[r+1]=o,t=[n,o],r++}}(e);else e[0]=[.05*-ue,.05*-ue,1.05*ue,.05*-ue,1.05*ue,1.05*ue,.05*-ue,1.05*ue]}function me(e){let t=1e3,r=0;for(let n=0;n<e.length;n++){let o=e[n];for(let e=0;e<o.length-1;e++){let n=Math.round(o[e+1]);n<t&&(t=n),n>r&&(r=n),e++}}return{ymax:r,ymin:t}}function be(e,t){if(Array.isArray(t[0])){let r=t.length;for(let n=0;n<r;n++){be(e,t[n])}}else e.push(t)}function ve(e,t){let n=t.rectangle;for(var o=[],l=0;l<e.length;l++){var i=Pe(e[l],e[l+1],n),a=r.Cartesian3.fromDegrees(i[0],i[1]);o.push(a),l++}return o}function Pe(e,t,r){var n=xe(r.west+r.width/ue*e),o=xe(r.north-r.height/ue*t);return[n=Number(n.toFixed(6)),o=Number(o.toFixed(6))]}function xe(e){return 180*e/Math.PI}return e((function(e,r){if(1==e.init)return function(e){return fe=new Function("render","level",e.styleStr),ue=e.tileSize,he=e,ae=e.indexDbNames,ce=e.indexDbName,de=e.serverInfo,ge=e.layerFieldMap,c.getDBMap(ae,se)}(e);var f=e.url,s=new t.Resource({url:f});s.request.throttle=!1,s.request.throttleByServer=!0,s.request.type=1;var u=s.fetchArrayBuffer();if(!u)return!0;let h=[];h.push(u);let d=ae.slice(0,ae.length-1);h.push(c.getElevation(se,d,e.xyz));let g=i.when.defer();return i.when.all(h,(function(t){let i=t[0];if(!i)return void g.resolve({});let f=function(e,t){if(e){!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++)pe(n[e][2],t)}}(e,t.needDecode);let r={},o=new n([e],t.level,r,t.controlVector,t.highLightVector,t.filterLayerId);return fe.call({},o,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=[];be(n,t.data),delete t.data,t.geometrys=n;let o=0;if(he.hasOwnProperty("heightProperty")){let e=he.heightProperty;o=t.properties[e],he.hasOwnProperty("heightScale")&&(o*=parseFloat(he.heightScale))}t.height=o,t.totalHeight=o}}}(r),r}return{}}(o(i,ge,de),e);he.hasTerrain&&function(e,t){var r=1e3,n=0;for(let o in e){let l=e[o];for(let e=0;e<l.length;e++){let o=l[e],i=-2e4,a=ye.get(o.properties.id);if(a)i=a;else{for(let e=0;e<o.geometrys.length;e++){let l=o.geometrys[e];for(let e=0;e<l.length-1;e++){let o=Math.round(l[e]),a=Math.round(l[e+1]);if(a<r&&(r=a),a>n&&(n=a),e++,o<0||o>ue-1||a<0||a>ue-1)continue;let c=a*ue+o,f=0;for(let e in t){f+=t[e].data[c]}f>i&&(i=f)}}-2e4==i&&(i=0),ye.set(o.properties.id,i)}o.terrainHeight=i,o.totalHeight=i+o.height}}}(f,t[1]);let s=function(e,t){let r=new Int32Array(t*t);for(let n in e){let o=e[n];for(let e=0;e<o.length;e++){let n=o[e],l=me(n.geometrys);a(r,n,t,l.ymax,l.ymin)}}return r}(f,ue);!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=ve(r.geometrys[e],t);r.polygons.push(n)}delete r.geometrys}}}(f,e);let u=l(f,e.level,he,r);c.updateElevation(se[ce],ce,e.xyz,s).promise.always((function(e){g.resolve(u)}))}),(function(e){g.reject(e)})),g.promise}))}));
|