Agriculture-front-end/public/Cesium/Workers/createGroundPolylineGeometry.js

2 lines
20 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["./BoundingSphere-561b54d0","./buildModuleUrl-3addfe33","./Cartesian2-47311507","./Cartographic-3309dd0d","./Check-7b2a090c","./when-b60132fc","./Math-119be1a3","./ArcType-29cf2197","./arrayRemoveDuplicates-d2f048c5","./ComponentDatatype-c140a87d","./EllipsoidGeodesic-0f19ac62","./EllipsoidRhumbLine-ed1a6bf4","./EncodedCartesian3-f1396b05","./GeometryAttribute-3a42bbdc","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./Transforms-cb0006b0","./WebMercatorProjection-01b1b5e7","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./PrimitiveType-39acab88","./FeatureDetection-c3b71206"],(function(e,a,t,i,n,r,s,o,l,u,c,h,C,d,p,g,m,f,v,w,y,_,T){"use strict";function M(a){a=r.defaultValue(a,{}),this._ellipsoid=r.defaultValue(a.ellipsoid,t.Ellipsoid.WGS84),this._rectangle=r.defaultValue(a.rectangle,t.Rectangle.MAX_VALUE),this._projection=new e.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=r.defaultValue(a.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=r.defaultValue(a.numberOfLevelZeroTilesY,1),this._customDPI=a.customDPI,this._scaleDenominators=a.scaleDenominators,this._tileWidth=r.defaultValue(a.tileWidth,256),this._tileHeight=r.defaultValue(a.tileHeight,256),this._beginLevel=r.defaultValue(a.beginLevel,0)}Object.defineProperties(M.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}},beginLevel:{get:function(){return this._beginLevel}}}),M.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e-this._beginLevel},M.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e-this._beginLevel},M.prototype.rectangleToNativeRectangle=function(e,a){var i=s.CesiumMath.toDegrees(e.west),n=s.CesiumMath.toDegrees(e.south),o=s.CesiumMath.toDegrees(e.east),l=s.CesiumMath.toDegrees(e.north);return r.defined(a)?(a.west=i,a.south=n,a.east=o,a.north=l,a):new t.Rectangle(i,n,o,l)},M.prototype.tileXYToNativeRectangle=function(e,a,t,i){var n=this.tileXYToRectangle(e,a,t,i);return n.west=s.CesiumMath.toDegrees(n.west),n.south=s.CesiumMath.toDegrees(n.south),n.east=s.CesiumMath.toDegrees(n.east),n.north=s.CesiumMath.toDegrees(n.north),n},M.prototype.tileXYToRectangle=function(e,a,i,n){var o=this._rectangle;if(r.defined(this._customDPI)&&r.defined(this._scaleDenominators)){var l=this.calculateResolution(i),u=-s.CesiumMath.PI+e*this._tileWidth*l.x,c=-s.CesiumMath.PI+(e+1)*this._tileWidth*l.x,h=s.CesiumMath.PI_OVER_TWO-a*this._tileHeight*l.y,C=s.CesiumMath.PI_OVER_TWO-(a+1)*this._tileHeight*l.y;return r.defined(n)?(n.west=u,n.south=C,n.east=c,n.north=h,n):new t.Rectangle(u,C,c,h)}var d=this.getNumberOfXTilesAtLevel(i),p=this.getNumberOfYTilesAtLevel(i),g=o.width/d,m=(u=e*g+o.west,c=(e+1)*g+o.west,o.height/p);h=o.north-a*m,C=o.north-(a+1)*m;return r.defined(n)||(n=new t.Rectangle(u,C,c,h)),n.west=u,n.south=C,n.east=c,n.north=h,n},M.prototype.positionToTileXY=function(e,a,i){var n=this._rectangle;if(t.Rectangle.contains(n,e)){var o=this.getNumberOfXTilesAtLevel(a),l=this.getNumberOfYTilesAtLevel(a),u=n.width/o,c=n.height/l;if(r.defined(this._customDPI)&&r.defined(this._scaleDenominators)){var h=this.calculateResolution(a);u=this._tileWidth*h.x,c=this._tileHeight*h.y}var C=e.longitude;n.east<n.west&&(C+=s.CesiumMath.TWO_PI);var d=(C-n.west)/u|0;d>=o&&(d=o-1);var p=(n.north-e.latitude)/c|0;return p>=l&&(p=l-1),r.defined(i)?(i.x=d,i.y=p,i):new t.Cartesian2(d,p)}},M.prototype.calculateResolution=function(e){var a=.0254*this._scaleDenominators[e-this._beginLevel]/this._customDPI.x,i=.0254*this._scaleDenominators[e-this._beginLevel]/this._customDPI.y,n=t.Ellipsoid.WGS84.maximumRadius;return new t.Cartesian2(a/n,i/n)};var E=new i.Cartesian3,b=new i.Cartesian3,P=new i.Cartographic,O=new i.Cartesian3,I=new i.Cartesian3,L=new e.BoundingSphere,S=new M,D=[new i.Cartographic,new i.Cartographic,new i.Cartographic,new i.Cartographic],k=new t.Cartesian2,A={};function N(e){i.Cartographic.fromRadians(e.east,e.north,0,D[0]),i.Cartograp