/** * SmartEarth WebSDK - https://websdk.terra-it.cn * Version 5.4.1 */ import{a as gt}from"./chunk-JD47PROB.js";import{a as L}from"./chunk-T2CEZF5S.js";import{a as ct}from"./chunk-R6MANQZ2.js";import{a as at}from"./chunk-3YQEVL2U.js";import{a as At}from"./chunk-DUJ55QTE.js";import"./chunk-7635WVJB.js";import"./chunk-YCO6GHZ4.js";import{a as ft}from"./chunk-BTGKTRUU.js";import{a as Y}from"./chunk-VPVZKJ47.js";import{a as $}from"./chunk-FVZBCGC7.js";import"./chunk-PVXELJ4I.js";import{a as pt,b as nt}from"./chunk-FTVLHTAP.js";import"./chunk-DA6K763I.js";import"./chunk-TWEYJPY7.js";import{a as bt,b as Ot}from"./chunk-5HPENZ6M.js";import"./chunk-SY6XZLBE.js";import{a as ht}from"./chunk-TO2OYNR6.js";import"./chunk-MZR3JOBY.js";import{c as dt,d as X}from"./chunk-6SNQZF7I.js";import{d as yt}from"./chunk-CLGTNV2A.js";import{f as lt,h as wt}from"./chunk-RQCJJCAO.js";import{a as J}from"./chunk-7J4RJR4J.js";import{b as c,c as ot,d as A,e as S,f as D,g as Tt}from"./chunk-UMC5CP2H.js";import{a as l}from"./chunk-72V3KRTJ.js";import"./chunk-7M2TDEJ6.js";import"./chunk-W5CDIT4C.js";import{a as mt,b as G}from"./chunk-VJ26MOOM.js";import{e as P}from"./chunk-E3YQ3WWZ.js";function O(t,e){this.position=t,P(this.position)||(this.position=new A),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=O.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(O.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let t=A.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(l.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){let t=l.PI_OVER_TWO+Math.atan2(this.y,this.x);return t>Math.PI&&(t-=l.TWO_PI),t}}});var it=new ot,Ft=new c;O.prototype.getLatitude=function(t){P(t)||(t=S.default),it.latitude=this.conformalLatitude,it.longitude=this.longitude,it.height=0;let e=this.ellipsoid.cartographicToCartesian(it,Ft);return t.cartesianToCartographic(e,it),it.latitude};var vt=new bt,St=new c,Vt=new c;O.fromCartesian=function(t,e){G.defined("cartesian",t);let o=l.signNotZero(t.z),n=O.NORTH_POLE_TANGENT_PLANE,s=O.SOUTH_POLE;o<0&&(n=O.SOUTH_POLE_TANGENT_PLANE,s=O.NORTH_POLE);let i=vt;i.origin=n.ellipsoid.scaleToGeocentricSurface(t,i.origin),i.direction=c.subtract(i.origin,s,St),c.normalize(i.direction,i.direction);let r=Ot.rayPlane(i,n.plane,Vt),f=c.subtract(r,s,r),m=c.dot(n.xAxis,f),g=o*c.dot(n.yAxis,f);return P(e)?(e.position=new A(m,g),e.tangentPlane=n,e):new O(new A(m,g),n)};O.fromCartesianArray=function(t,e){G.defined("cartesians",t);let o=t.length;P(e)?e.length=o:e=new Array(o);for(let n=0;n=0?r:r+l.TWO_PI;s.westOverIdl=Math.min(s.westOverIdl,f),s.eastOverIdl=Math.max(s.eastOverIdl,f),i.west=Math.min(i.west,r),i.east=Math.max(i.east,r);let m=t.getLatitude(o),g=m;if(i.south=Math.min(i.south,m),i.north=Math.max(i.north,m),n!==ct.RHUMB){let H=A.subtract(e.position,t.position,te),x=A.dot(e.position,H)/A.dot(H,H);if(x>0&&x<1){let B=A.add(e.position,A.multiplyByScalar(H,-x,H),ee),C=k.clone(e,oe);C.position=B;let R=C.getLatitude(o);i.south=Math.min(i.south,R),i.north=Math.max(i.north,R),Math.abs(m)>Math.abs(R)&&(g=R)}}let w=e.x*t.y-t.x*e.y,a=Math.sign(w);a!==0&&(a*=A.angleBetween(e.position,t.position)),g>=0&&(s.northAngle+=a),g<=0&&(s.southAngle+=a)}var Rt=new k,ne=new k,U={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};W.computeRectangleFromPositions=function(t,e,o,n){if(G.defined("positions",t),P(n)||(n=new wt),t.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,U.northAngle=0,U.southAngle=0,U.westOverIdl=Number.POSITIVE_INFINITY,U.eastOverIdl=Number.NEGATIVE_INFINITY;let s=t.length,i=k.fromCartesian(t[0],ne);for(let r=1;rU.eastOverIdl-U.westOverIdl&&(n.west=U.westOverIdl,n.east=U.eastOverIdl,n.east>l.PI&&(n.east=n.east-l.TWO_PI),n.west>l.PI&&(n.west=n.west-l.TWO_PI)),l.equalsEpsilon(Math.abs(U.northAngle),l.TWO_PI,l.EPSILON10)&&(n.north=l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),l.equalsEpsilon(Math.abs(U.southAngle),l.TWO_PI,l.EPSILON10)&&(n.south=-l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),n};var ie=new k;function re(t,e,o){return t.height>=l.PI||t.width>=l.PI?k.fromCartesian(e[0],ie).tangentPlane:$.fromPoints(e,o)}var It=new ot;function se(t,e,o){return(n,s)=>{if(t.height>=l.PI||t.width>=l.PI){if(t.south<0&&t.north>0){P(s)||(s=[]);for(let r=0;r=l.PI||t.width>=l.PI)return(s,i)=>{if(t.south<0&&t.north>0){let r=o.cartesianToCartographic(s,It);return P(i)||(i=new A),i.x=r.longitude/l.PI,i.y=r.latitude/l.PI_OVER_TWO,i}return k.fromCartesian(s,i)};let n=$.fromPoints(e,o);return(s,i)=>n.projectPointsOntoPlane(s,i)}function ce(t,e,o,n){return(s,i)=>!n&&(t.height>=l.PI_OVER_TWO||t.width>=2*l.PI_OVER_THREE)?L.splitPolygonsOnEquator(s,e,o,i):s}function le(t,e,o,n){if(e.height>=l.PI||e.width>=l.PI)return gt.fromRectangle(e,void 0,Ht);let s=t,i=$.fromPoints(s,o);return L.computeBoundingRectangle(i.plane.normal,i.projectPointOntoPlane.bind(i),s,n,Ht)}W.createGeometry=function(t){let e=t._vertexFormat,o=t._ellipsoid,n=t._granularity,s=t._stRotation,i=t._polygonHierarchy,r=t._perPositionHeight,f=t._closeTop,m=t._closeBottom,g=t._arcType,w=t._textureCoordinates,a=P(w),H=i.positions;if(H.length<3)return;let x=t.rectangle,B=L.polygonsFromHierarchy(i,a,se(x,H,o),!r,o,ce(x,o,g,r)),C=B.hierarchy,R=B.polygons,V=function(N){return N},_=a?L.polygonsFromHierarchy(w,!0,V,!1,o).polygons:void 0;if(C.length===0)return;let Q=C[0].outerRing,y=le(Q,x,o,s),T=[],d=t._height,j=t._extrudedHeight,z=t._perPositionHeightExtrude||!l.equalsEpsilon(d,j,0,l.EPSILON2),u={perPositionHeight:r,vertexFormat:e,geometry:void 0,rotationAxis:re(x,Q,o).plane.normal,projectTo2d:ae(x,Q,o),boundingRectangle:y,ellipsoid:o,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:g},h;if(z)for(u.extrude=!0,u.top=f,u.bottom=m,u.shadowVolume=t._shadowVolume,u.offsetAttribute=t._offsetAttribute,h=0;h