qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/createVerticesFromGoogleEar...

2 lines
7.6 KiB
JavaScript
Raw Permalink Normal View History

2023-11-07 10:04:37 +08:00
define(["./AxisAlignedBoundingBox-8774439c","./BoundingSphere-9a3b5656","./Cartesian2-bd414876","./Cartesian3-e0307675","./defaultValue-81eec7ed","./TerrainEncoding-0f7ffc20","./Math-e73894ab","./Matrix4-4c545f70","./OrientedBoundingBox-c5d2adb7","./Rectangle-cf3e0e3e","./RuntimeError-26acdd3b","./Transforms-5b829630","./WebMercatorProjection-44373a3d","./createTaskProcessorWorker","./Check-741c5f3c","./GeographicProjection-c931c7fb","./AttributeCompression-8f752c03","./ComponentDatatype-aaeec80f","./WebGLConstants-508b9636","./Matrix2-dc0c61cc","./EllipsoidTangentPlane-4d138901","./IntersectionTests-80510c7b","./Plane-bc8b6777","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda"],(function(t,e,n,i,o,a,r,s,c,u,h,d,l,g,m,p,f,I,E,T,C,M,x,N,b,S){"use strict";const w=Uint16Array.BYTES_PER_ELEMENT,B=Int32Array.BYTES_PER_ELEMENT,P=Uint32Array.BYTES_PER_ELEMENT,A=Float32Array.BYTES_PER_ELEMENT,R=Float64Array.BYTES_PER_ELEMENT;function y(t,e,n){n=o.defaultValue(n,r.CesiumMath);const i=t.length;for(let o=0;o<i;++o)if(n.equalsEpsilon(t[o],e,r.CesiumMath.EPSILON12))return o;return-1}const _=new n.Cartographic,W=new i.Cartesian3,v=new i.Cartesian3,F=new i.Cartesian3,O=new s.Matrix4;function V(t,e,a,c,u,h,d,l,g,m,p){const f=l.length;for(let I=0;I<f;++I){const E=l[I],T=E.cartographic,C=E.index,M=t.length,x=T.longitude;let N=T.latitude;N=r.CesiumMath.clamp(N,-r.CesiumMath.PI_OVER_TWO,r.CesiumMath.PI_OVER_TWO);const b=T.height-d.skirtHeight;d.hMin=Math.min(d.hMin,b),n.Cartographic.fromRadians(x,N,b,_),m&&(_.longitude+=g),m?I===f-1?_.latitude+=p:0===I&&(_.latitude-=p):_.latitude+=g;const S=d.ellipsoid.cartographicToCartesian(_);t.push(S),e.push(b),a.push(n.Cartesian2.clone(a[C])),c.length>0&&c.push(c[C]),u.length>0&&u.push(u[C]),s.Matrix4.multiplyByPoint(d.toENU,S,W);const w=d.minimum,B=d.maximum;i.Cartesian3.minimumByComponent(W,w,w),i.Cartesian3.maximumByComponent(W,B,B);const P=d.lastBorderPoint;if(o.defined(P)){const t=P.index;h.push(t,M-1,M,M,C,t)}d.lastBorderPoint=E}}return g((function(g,m){g.ellipsoid=n.Ellipsoid.clone(g.ellipsoid),g.rectangle=u.Rectangle.clone(g.rectangle);const p=function(u,g,m,p,f,I,E,T,C,M,x){let N,b,S,Y,k,U;o.defined(p)?(N=p.west,b=p.south,S=p.east,Y=p.north,k=p.width,U=p.height):(N=r.CesiumMath.toRadians(f.west),b=r.CesiumMath.toRadians(f.south),S=r.CesiumMath.toRadians(f.east),Y=r.CesiumMath.toRadians(f.north),k=r.CesiumMath.toRadians(p.width),U=r.CesiumMath.toRadians(p.height));const H=[b,Y],L=[N,S],G=d.Transforms.eastNorthUpToFixedFrame(g,m),j=s.Matrix4.inverseTransformation(G,O);let D,z;C&&(D=l.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b),z=1/(l.WebMercatorProjection.geodeticLatitudeToMercatorAngle(Y)-D));const q=1!==I,J=new DataView(u);let K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;const X=v;X.x=Number.POSITIVE_INFINITY,X.y=Number.POSITIVE_INFINITY,X.z=Number.POSITIVE_INFINITY;const Z=F;Z.x=Number.NEGATIVE_INFINITY,Z.y=Number.NEGATIVE_INFINITY,Z.z=Number.NEGATIVE_INFINITY;let $,tt,et=0,nt=0,it=0;for(tt=0;tt<4;++tt){let t=et;$=J.getUint32(t,!0),t+=P;const e=r.CesiumMath.toRadians(180*J.getFloat64(t,!0));t+=R,-1===y(L,e)&&L.push(e);const n=r.CesiumMath.toRadians(180*J.getFloat64(t,!0));t+=R,-1===y(H,n)&&H.push(n),t+=2*R;let i=J.getInt32(t,!0);t+=B,nt+=i,i=J.getInt32(t,!0),it+=3*i,et+=$+P}const ot=[],at=[],rt=new Array(nt),st=new Array(nt),ct=new Array(nt),ut=C?new Array(nt):[],ht=q?new Array(nt):[],dt=new Array(it),lt=[],gt=[],mt=[],pt=[];let ft=0,It=0;for(et=0,tt=0;tt<4;++tt){$=J.getUint32(et,!0),et+=P;const t=et,e=r.CesiumMath.toRadians(180*J.getFloat64(et,!0));et+=R;const o=r.CesiumMath.toRadians(180*J.getFloat64(et,!0));et+=R;const a=r.CesiumMath.toRadians(180*J.getFloat64(et,!0)),c=.5*a;et+=R;const u=r.CesiumMath.toRadians(180*J.getFloat64(et,!0)),d=.5*u;et+=R;const g=J.getInt32(et,!0);et+=B;const p=J.getInt32(et,!0);et+=B,et+=B;const f=new Array(g);for(let t=0;t<g;++t){const h=e+J.getUint8(et++)*a;_.longitude=h;const g=o+J.getUint8(et++)*u;_.latitude=g;let p=J.getFloat32(et,!0);if(et+=A,0!==p&&p<x&&(p*=-Math.pow(2,M)),p*=6371010,_.height=p,-1!==y(L,h)||-1!==y(H,g)){c