@gmgis/gm-sdk 1.12.5 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist/index.js +1848 -0
- package/dist/gm.min.js +16983 -16483
- package/dist/index.js +1436 -1434
- package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
- package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
- package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
- package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
- package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
- package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
- package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
- package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
- package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
- package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
- package/dist/resources/Workers/{chunk-I2ITFFPX.js → chunk-A56XVLQR.js} +2 -13
- package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
- package/dist/resources/Workers/{chunk-PRGYLLJT.js → chunk-ARG42DC4.js} +2 -31
- package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
- package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
- package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
- package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
- package/dist/resources/Workers/{chunk-DI5NGJUP.js → chunk-D6AA5QVT.js} +2 -20
- package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
- package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
- package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
- package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
- package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
- package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
- package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
- package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
- package/dist/resources/Workers/{chunk-7JO7GPJN.js → chunk-GBYLG25F.js} +2 -15
- package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
- package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
- package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
- package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
- package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
- package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
- package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
- package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
- package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
- package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
- package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
- package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
- package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
- package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
- package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
- package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
- package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
- package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
- package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
- package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
- package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
- package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
- package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
- package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
- package/dist/resources/Workers/{chunk-6CHGCNMW.js → chunk-WZDE3RYP.js} +4 -34
- package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
- package/dist/resources/Workers/combineGeometry.js +2 -40
- package/dist/resources/Workers/createBoxGeometry.js +2 -32
- package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -209
- package/dist/resources/Workers/createCircleGeometry.js +2 -175
- package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -121
- package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -481
- package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -199
- package/dist/resources/Workers/createCorridorGeometry.js +2 -1237
- package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -542
- package/dist/resources/Workers/createCylinderGeometry.js +2 -34
- package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -205
- package/dist/resources/Workers/createEllipseGeometry.js +2 -45
- package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -38
- package/dist/resources/Workers/createEllipsoidGeometry.js +2 -33
- package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -35
- package/dist/resources/Workers/createFrustumGeometry.js +2 -32
- package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -210
- package/dist/resources/Workers/createGeometry.js +2 -144
- package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1582
- package/dist/resources/Workers/createPlaneGeometry.js +2 -198
- package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -98
- package/dist/resources/Workers/createPolygonGeometry.js +2 -1381
- package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -509
- package/dist/resources/Workers/createPolylineGeometry.js +2 -470
- package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -354
- package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -251
- package/dist/resources/Workers/createRectangleGeometry.js +2 -1246
- package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -453
- package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -374
- package/dist/resources/Workers/createSphereGeometry.js +2 -92
- package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -92
- package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
- package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -466
- package/dist/resources/Workers/createVectorTileGeometries.js +2 -361
- package/dist/resources/Workers/createVectorTilePoints.js +2 -88
- package/dist/resources/Workers/createVectorTilePolygons.js +2 -359
- package/dist/resources/Workers/createVectorTilePolylines.js +2 -236
- package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -539
- package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2252
- package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -729
- package/dist/resources/Workers/createWallGeometry.js +2 -464
- package/dist/resources/Workers/createWallOutlineGeometry.js +2 -312
- package/dist/resources/Workers/decodeDraco.js +2 -345
- package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2642
- package/dist/resources/Workers/decodeI3S.js +2 -1319
- package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
- package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/dist/resources/Workers/transcodeKTX2.js +29 -3360
- package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
- package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -793
- package/package.json +74 -74
- package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
- package/dist/resources/Workers/chunk-26GA3JAM.js +0 -139
- package/dist/resources/Workers/chunk-27HUZ7SA.js +0 -305
- package/dist/resources/Workers/chunk-2ZGOQXYU.js +0 -171
- package/dist/resources/Workers/chunk-3Q2L65QU.js +0 -1258
- package/dist/resources/Workers/chunk-472HQ3EH.js +0 -100
- package/dist/resources/Workers/chunk-5ODQSF26.js +0 -101
- package/dist/resources/Workers/chunk-5OOFQLKF.js +0 -634
- package/dist/resources/Workers/chunk-5PTXS2GO.js +0 -10390
- package/dist/resources/Workers/chunk-76BYBWHP.js +0 -122
- package/dist/resources/Workers/chunk-7BMOHCPM.js +0 -390
- package/dist/resources/Workers/chunk-7KTQP4VB.js +0 -59
- package/dist/resources/Workers/chunk-7O373FFS.js +0 -665
- package/dist/resources/Workers/chunk-AD63PIY6.js +0 -163
- package/dist/resources/Workers/chunk-BHQJ2NT7.js +0 -353
- package/dist/resources/Workers/chunk-C6YYBQXW.js +0 -102
- package/dist/resources/Workers/chunk-CKY7HOHV.js +0 -287
- package/dist/resources/Workers/chunk-DHYHSFFJ.js +0 -73
- package/dist/resources/Workers/chunk-E27BLMDD.js +0 -115
- package/dist/resources/Workers/chunk-E63IIM5T.js +0 -75
- package/dist/resources/Workers/chunk-E6V6SQZW.js +0 -456
- package/dist/resources/Workers/chunk-EJZTDTUH.js +0 -138
- package/dist/resources/Workers/chunk-FDOV2LBJ.js +0 -220
- package/dist/resources/Workers/chunk-FIGIZHAQ.js +0 -684
- package/dist/resources/Workers/chunk-GESF4OXQ.js +0 -1800
- package/dist/resources/Workers/chunk-GGZJN2TI.js +0 -2717
- package/dist/resources/Workers/chunk-GNBFYG7F.js +0 -1481
- package/dist/resources/Workers/chunk-GWCFU2SA.js +0 -300
- package/dist/resources/Workers/chunk-IBLIYJZR.js +0 -196
- package/dist/resources/Workers/chunk-JW4FOI6M.js +0 -476
- package/dist/resources/Workers/chunk-K4GQUNB5.js +0 -262
- package/dist/resources/Workers/chunk-M3GMB5OP.js +0 -834
- package/dist/resources/Workers/chunk-MXIZJAPH.js +0 -629
- package/dist/resources/Workers/chunk-N5KJGGCM.js +0 -1073
- package/dist/resources/Workers/chunk-NGPPMXRM.js +0 -435
- package/dist/resources/Workers/chunk-O3E4OAOE.js +0 -511
- package/dist/resources/Workers/chunk-PGRPDNHG.js +0 -1048
- package/dist/resources/Workers/chunk-S6MRMMQU.js +0 -157
- package/dist/resources/Workers/chunk-SMDOP47J.js +0 -945
- package/dist/resources/Workers/chunk-TGONEMZO.js +0 -421
- package/dist/resources/Workers/chunk-TKVT5GQM.js +0 -781
- package/dist/resources/Workers/chunk-U72QNFOJ.js +0 -758
- package/dist/resources/Workers/chunk-VJZB3WAV.js +0 -963
- package/dist/resources/Workers/chunk-VU2MNO7L.js +0 -239
- package/dist/resources/Workers/chunk-XY4BATBS.js +0 -500
- package/dist/resources/Workers/chunk-YFXQECWV.js +0 -2857
- package/dist/resources/Workers/chunk-YSGTGQQO.js +0 -398
- package/dist/resources/Workers/chunk-YZ733KKS.js +0 -368
|
@@ -0,0 +1,1848 @@
|
|
|
1
|
+
var ig=Object.create;var ji=Object.defineProperty;var rg=Object.getOwnPropertyDescriptor;var sg=Object.getOwnPropertyNames;var og=Object.getPrototypeOf,ag=Object.prototype.hasOwnProperty;var ng=(a,e,t)=>e in a?ji(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var lg=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of sg(e))!ag.call(a,s)&&s!==t&&ji(a,s,{get:()=>e[s],enumerable:!(r=rg(e,s))||r.enumerable});return a};var hg=(a,e,t)=>(t=a!=null?ig(og(a)):{},lg(e||!a||!a.__esModule?ji(t,"default",{value:a,enumerable:!0}):t,a));var qi=(a,e,t)=>(ng(a,typeof e!="symbol"?e+"":e,t),t);var Hh=b((q4,Nh)=>{function py(){this.__data__=[],this.size=0}Nh.exports=py});var so=b((Z4,Wh)=>{function dy(a,e){return a===e||a!==a&&e!==e}Wh.exports=dy});var ct=b((Y4,Gh)=>{var my=so();function uy(a,e){for(var t=a.length;t--;)if(my(a[t][0],e))return t;return-1}Gh.exports=uy});var Bh=b((X4,Uh)=>{var _y=ct(),fy=Array.prototype,gy=fy.splice;function yy(a){var e=this.__data__,t=_y(e,a);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():gy.call(e,t,1),--this.size,!0}Uh.exports=yy});var jh=b((J4,Vh)=>{var vy=ct();function wy(a){var e=this.__data__,t=vy(e,a);return t<0?void 0:e[t][1]}Vh.exports=wy});var Zh=b((K4,qh)=>{var Cy=ct();function xy(a){return Cy(this.__data__,a)>-1}qh.exports=xy});var Xh=b((Q4,Yh)=>{var Ty=ct();function Ey(a,e){var t=this.__data__,r=Ty(t,a);return r<0?(++this.size,t.push([a,e])):t[r][1]=e,this}Yh.exports=Ey});var pt=b(($4,Jh)=>{var Py=Hh(),by=Bh(),Ay=jh(),My=Zh(),Iy=Xh();function Be(a){var e=-1,t=a==null?0:a.length;for(this.clear();++e<t;){var r=a[e];this.set(r[0],r[1])}}Be.prototype.clear=Py;Be.prototype.delete=by;Be.prototype.get=Ay;Be.prototype.has=My;Be.prototype.set=Iy;Jh.exports=Be});var Qh=b((eR,Kh)=>{var Sy=pt();function Dy(){this.__data__=new Sy,this.size=0}Kh.exports=Dy});var ec=b((tR,$h)=>{function Ly(a){var e=this.__data__,t=e.delete(a);return this.size=e.size,t}$h.exports=Ly});var ic=b((iR,tc)=>{function Ry(a){return this.__data__.get(a)}tc.exports=Ry});var sc=b((rR,rc)=>{function Oy(a){return this.__data__.has(a)}rc.exports=Oy});var oo=b((sR,oc)=>{var ky=typeof global=="object"&&global&&global.Object===Object&&global;oc.exports=ky});var pe=b((oR,ac)=>{var Fy=oo(),zy=typeof self=="object"&&self&&self.Object===Object&&self,Ny=Fy||zy||Function("return this")();ac.exports=Ny});var Ut=b((aR,nc)=>{var Hy=pe(),Wy=Hy.Symbol;nc.exports=Wy});var pc=b((nR,cc)=>{var lc=Ut(),hc=Object.prototype,Gy=hc.hasOwnProperty,Uy=hc.toString,dt=lc?lc.toStringTag:void 0;function By(a){var e=Gy.call(a,dt),t=a[dt];try{a[dt]=void 0;var r=!0}catch{}var s=Uy.call(a);return r&&(e?a[dt]=t:delete a[dt]),s}cc.exports=By});var mc=b((lR,dc)=>{var Vy=Object.prototype,jy=Vy.toString;function qy(a){return jy.call(a)}dc.exports=qy});var mt=b((hR,fc)=>{var uc=Ut(),Zy=pc(),Yy=mc(),Xy="[object Null]",Jy="[object Undefined]",_c=uc?uc.toStringTag:void 0;function Ky(a){return a==null?a===void 0?Jy:Xy:_c&&_c in Object(a)?Zy(a):Yy(a)}fc.exports=Ky});var Ve=b((cR,gc)=>{function Qy(a){var e=typeof a;return a!=null&&(e=="object"||e=="function")}gc.exports=Qy});var ao=b((pR,yc)=>{var $y=mt(),e0=Ve(),t0="[object AsyncFunction]",i0="[object Function]",r0="[object GeneratorFunction]",s0="[object Proxy]";function o0(a){if(!e0(a))return!1;var e=$y(a);return e==i0||e==r0||e==t0||e==s0}yc.exports=o0});var wc=b((dR,vc)=>{var a0=pe(),n0=a0["__core-js_shared__"];vc.exports=n0});var Tc=b((mR,xc)=>{var no=wc(),Cc=function(){var a=/[^.]+$/.exec(no&&no.keys&&no.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}();function l0(a){return!!Cc&&Cc in a}xc.exports=l0});var lo=b((uR,Ec)=>{var h0=Function.prototype,c0=h0.toString;function p0(a){if(a!=null){try{return c0.call(a)}catch{}try{return a+""}catch{}}return""}Ec.exports=p0});var bc=b((_R,Pc)=>{var d0=ao(),m0=Tc(),u0=Ve(),_0=lo(),f0=/[\\^$.*+?()[\]{}|]/g,g0=/^\[object .+?Constructor\]$/,y0=Function.prototype,v0=Object.prototype,w0=y0.toString,C0=v0.hasOwnProperty,x0=RegExp("^"+w0.call(C0).replace(f0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function T0(a){if(!u0(a)||m0(a))return!1;var e=d0(a)?x0:g0;return e.test(_0(a))}Pc.exports=T0});var Mc=b((fR,Ac)=>{function E0(a,e){return a==null?void 0:a[e]}Ac.exports=E0});var Ae=b((gR,Ic)=>{var P0=bc(),b0=Mc();function A0(a,e){var t=b0(a,e);return P0(t)?t:void 0}Ic.exports=A0});var Bt=b((yR,Sc)=>{var M0=Ae(),I0=pe(),S0=M0(I0,"Map");Sc.exports=S0});var ut=b((vR,Dc)=>{var D0=Ae(),L0=D0(Object,"create");Dc.exports=L0});var Oc=b((wR,Rc)=>{var Lc=ut();function R0(){this.__data__=Lc?Lc(null):{},this.size=0}Rc.exports=R0});var Fc=b((CR,kc)=>{function O0(a){var e=this.has(a)&&delete this.__data__[a];return this.size-=e?1:0,e}kc.exports=O0});var Nc=b((xR,zc)=>{var k0=ut(),F0="__lodash_hash_undefined__",z0=Object.prototype,N0=z0.hasOwnProperty;function H0(a){var e=this.__data__;if(k0){var t=e[a];return t===F0?void 0:t}return N0.call(e,a)?e[a]:void 0}zc.exports=H0});var Wc=b((TR,Hc)=>{var W0=ut(),G0=Object.prototype,U0=G0.hasOwnProperty;function B0(a){var e=this.__data__;return W0?e[a]!==void 0:U0.call(e,a)}Hc.exports=B0});var Uc=b((ER,Gc)=>{var V0=ut(),j0="__lodash_hash_undefined__";function q0(a,e){var t=this.__data__;return this.size+=this.has(a)?0:1,t[a]=V0&&e===void 0?j0:e,this}Gc.exports=q0});var Vc=b((PR,Bc)=>{var Z0=Oc(),Y0=Fc(),X0=Nc(),J0=Wc(),K0=Uc();function je(a){var e=-1,t=a==null?0:a.length;for(this.clear();++e<t;){var r=a[e];this.set(r[0],r[1])}}je.prototype.clear=Z0;je.prototype.delete=Y0;je.prototype.get=X0;je.prototype.has=J0;je.prototype.set=K0;Bc.exports=je});var Zc=b((bR,qc)=>{var jc=Vc(),Q0=pt(),$0=Bt();function ev(){this.size=0,this.__data__={hash:new jc,map:new($0||Q0),string:new jc}}qc.exports=ev});var Xc=b((AR,Yc)=>{function tv(a){var e=typeof a;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?a!=="__proto__":a===null}Yc.exports=tv});var _t=b((MR,Jc)=>{var iv=Xc();function rv(a,e){var t=a.__data__;return iv(e)?t[typeof e=="string"?"string":"hash"]:t.map}Jc.exports=rv});var Qc=b((IR,Kc)=>{var sv=_t();function ov(a){var e=sv(this,a).delete(a);return this.size-=e?1:0,e}Kc.exports=ov});var ep=b((SR,$c)=>{var av=_t();function nv(a){return av(this,a).get(a)}$c.exports=nv});var ip=b((DR,tp)=>{var lv=_t();function hv(a){return lv(this,a).has(a)}tp.exports=hv});var sp=b((LR,rp)=>{var cv=_t();function pv(a,e){var t=cv(this,a),r=t.size;return t.set(a,e),this.size+=t.size==r?0:1,this}rp.exports=pv});var ap=b((RR,op)=>{var dv=Zc(),mv=Qc(),uv=ep(),_v=ip(),fv=sp();function qe(a){var e=-1,t=a==null?0:a.length;for(this.clear();++e<t;){var r=a[e];this.set(r[0],r[1])}}qe.prototype.clear=dv;qe.prototype.delete=mv;qe.prototype.get=uv;qe.prototype.has=_v;qe.prototype.set=fv;op.exports=qe});var lp=b((OR,np)=>{var gv=pt(),yv=Bt(),vv=ap(),wv=200;function Cv(a,e){var t=this.__data__;if(t instanceof gv){var r=t.__data__;if(!yv||r.length<wv-1)return r.push([a,e]),this.size=++t.size,this;t=this.__data__=new vv(r)}return t.set(a,e),this.size=t.size,this}np.exports=Cv});var cp=b((kR,hp)=>{var xv=pt(),Tv=Qh(),Ev=ec(),Pv=ic(),bv=sc(),Av=lp();function Ze(a){var e=this.__data__=new xv(a);this.size=e.size}Ze.prototype.clear=Tv;Ze.prototype.delete=Ev;Ze.prototype.get=Pv;Ze.prototype.has=bv;Ze.prototype.set=Av;hp.exports=Ze});var dp=b((FR,pp)=>{function Mv(a,e){for(var t=-1,r=a==null?0:a.length;++t<r&&e(a[t],t,a)!==!1;);return a}pp.exports=Mv});var up=b((zR,mp)=>{var Iv=Ae(),Sv=function(){try{var a=Iv(Object,"defineProperty");return a({},"",{}),a}catch{}}();mp.exports=Sv});var ho=b((NR,fp)=>{var _p=up();function Dv(a,e,t){e=="__proto__"&&_p?_p(a,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):a[e]=t}fp.exports=Dv});var co=b((HR,gp)=>{var Lv=ho(),Rv=so(),Ov=Object.prototype,kv=Ov.hasOwnProperty;function Fv(a,e,t){var r=a[e];(!(kv.call(a,e)&&Rv(r,t))||t===void 0&&!(e in a))&&Lv(a,e,t)}gp.exports=Fv});var ft=b((WR,yp)=>{var zv=co(),Nv=ho();function Hv(a,e,t,r){var s=!t;t||(t={});for(var o=-1,n=e.length;++o<n;){var l=e[o],h=r?r(t[l],a[l],l,t,a):void 0;h===void 0&&(h=a[l]),s?Nv(t,l,h):zv(t,l,h)}return t}yp.exports=Hv});var wp=b((GR,vp)=>{function Wv(a,e){for(var t=-1,r=Array(a);++t<a;)r[t]=e(t);return r}vp.exports=Wv});var Ye=b((UR,Cp)=>{function Gv(a){return a!=null&&typeof a=="object"}Cp.exports=Gv});var Tp=b((BR,xp)=>{var Uv=mt(),Bv=Ye(),Vv="[object Arguments]";function jv(a){return Bv(a)&&Uv(a)==Vv}xp.exports=jv});var Ap=b((VR,bp)=>{var Ep=Tp(),qv=Ye(),Pp=Object.prototype,Zv=Pp.hasOwnProperty,Yv=Pp.propertyIsEnumerable,Xv=Ep(function(){return arguments}())?Ep:function(a){return qv(a)&&Zv.call(a,"callee")&&!Yv.call(a,"callee")};bp.exports=Xv});var Vt=b((jR,Mp)=>{var Jv=Array.isArray;Mp.exports=Jv});var Sp=b((qR,Ip)=>{function Kv(){return!1}Ip.exports=Kv});var po=b((gt,Xe)=>{var Qv=pe(),$v=Sp(),Rp=typeof gt=="object"&>&&!gt.nodeType&>,Dp=Rp&&typeof Xe=="object"&&Xe&&!Xe.nodeType&&Xe,ew=Dp&&Dp.exports===Rp,Lp=ew?Qv.Buffer:void 0,tw=Lp?Lp.isBuffer:void 0,iw=tw||$v;Xe.exports=iw});var kp=b((ZR,Op)=>{var rw=9007199254740991,sw=/^(?:0|[1-9]\d*)$/;function ow(a,e){var t=typeof a;return e=e==null?rw:e,!!e&&(t=="number"||t!="symbol"&&sw.test(a))&&a>-1&&a%1==0&&a<e}Op.exports=ow});var mo=b((YR,Fp)=>{var aw=9007199254740991;function nw(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=aw}Fp.exports=nw});var Np=b((XR,zp)=>{var lw=mt(),hw=mo(),cw=Ye(),pw="[object Arguments]",dw="[object Array]",mw="[object Boolean]",uw="[object Date]",_w="[object Error]",fw="[object Function]",gw="[object Map]",yw="[object Number]",vw="[object Object]",ww="[object RegExp]",Cw="[object Set]",xw="[object String]",Tw="[object WeakMap]",Ew="[object ArrayBuffer]",Pw="[object DataView]",bw="[object Float32Array]",Aw="[object Float64Array]",Mw="[object Int8Array]",Iw="[object Int16Array]",Sw="[object Int32Array]",Dw="[object Uint8Array]",Lw="[object Uint8ClampedArray]",Rw="[object Uint16Array]",Ow="[object Uint32Array]",G={};G[bw]=G[Aw]=G[Mw]=G[Iw]=G[Sw]=G[Dw]=G[Lw]=G[Rw]=G[Ow]=!0;G[pw]=G[dw]=G[Ew]=G[mw]=G[Pw]=G[uw]=G[_w]=G[fw]=G[gw]=G[yw]=G[vw]=G[ww]=G[Cw]=G[xw]=G[Tw]=!1;function kw(a){return cw(a)&&hw(a.length)&&!!G[lw(a)]}zp.exports=kw});var jt=b((JR,Hp)=>{function Fw(a){return function(e){return a(e)}}Hp.exports=Fw});var qt=b((yt,Je)=>{var zw=oo(),Wp=typeof yt=="object"&&yt&&!yt.nodeType&&yt,vt=Wp&&typeof Je=="object"&&Je&&!Je.nodeType&&Je,Nw=vt&&vt.exports===Wp,uo=Nw&&zw.process,Hw=function(){try{var a=vt&&vt.require&&vt.require("util").types;return a||uo&&uo.binding&&uo.binding("util")}catch{}}();Je.exports=Hw});var Vp=b((KR,Bp)=>{var Ww=Np(),Gw=jt(),Gp=qt(),Up=Gp&&Gp.isTypedArray,Uw=Up?Gw(Up):Ww;Bp.exports=Uw});var _o=b((QR,jp)=>{var Bw=wp(),Vw=Ap(),jw=Vt(),qw=po(),Zw=kp(),Yw=Vp(),Xw=Object.prototype,Jw=Xw.hasOwnProperty;function Kw(a,e){var t=jw(a),r=!t&&Vw(a),s=!t&&!r&&qw(a),o=!t&&!r&&!s&&Yw(a),n=t||r||s||o,l=n?Bw(a.length,String):[],h=l.length;for(var c in a)(e||Jw.call(a,c))&&!(n&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Zw(c,h)))&&l.push(c);return l}jp.exports=Kw});var Zt=b(($R,qp)=>{var Qw=Object.prototype;function $w(a){var e=a&&a.constructor,t=typeof e=="function"&&e.prototype||Qw;return a===t}qp.exports=$w});var fo=b((eO,Zp)=>{function e1(a,e){return function(t){return a(e(t))}}Zp.exports=e1});var Xp=b((tO,Yp)=>{var t1=fo(),i1=t1(Object.keys,Object);Yp.exports=i1});var Kp=b((iO,Jp)=>{var r1=Zt(),s1=Xp(),o1=Object.prototype,a1=o1.hasOwnProperty;function n1(a){if(!r1(a))return s1(a);var e=[];for(var t in Object(a))a1.call(a,t)&&t!="constructor"&&e.push(t);return e}Jp.exports=n1});var go=b((rO,Qp)=>{var l1=ao(),h1=mo();function c1(a){return a!=null&&h1(a.length)&&!l1(a)}Qp.exports=c1});var Yt=b((sO,$p)=>{var p1=_o(),d1=Kp(),m1=go();function u1(a){return m1(a)?p1(a):d1(a)}$p.exports=u1});var td=b((oO,ed)=>{var _1=ft(),f1=Yt();function g1(a,e){return a&&_1(e,f1(e),a)}ed.exports=g1});var rd=b((aO,id)=>{function y1(a){var e=[];if(a!=null)for(var t in Object(a))e.push(t);return e}id.exports=y1});var od=b((nO,sd)=>{var v1=Ve(),w1=Zt(),C1=rd(),x1=Object.prototype,T1=x1.hasOwnProperty;function E1(a){if(!v1(a))return C1(a);var e=w1(a),t=[];for(var r in a)r=="constructor"&&(e||!T1.call(a,r))||t.push(r);return t}sd.exports=E1});var Xt=b((lO,ad)=>{var P1=_o(),b1=od(),A1=go();function M1(a){return A1(a)?P1(a,!0):b1(a)}ad.exports=M1});var ld=b((hO,nd)=>{var I1=ft(),S1=Xt();function D1(a,e){return a&&I1(e,S1(e),a)}nd.exports=D1});var md=b((wt,Ke)=>{var L1=pe(),dd=typeof wt=="object"&&wt&&!wt.nodeType&&wt,hd=dd&&typeof Ke=="object"&&Ke&&!Ke.nodeType&&Ke,R1=hd&&hd.exports===dd,cd=R1?L1.Buffer:void 0,pd=cd?cd.allocUnsafe:void 0;function O1(a,e){if(e)return a.slice();var t=a.length,r=pd?pd(t):new a.constructor(t);return a.copy(r),r}Ke.exports=O1});var _d=b((cO,ud)=>{function k1(a,e){var t=-1,r=a.length;for(e||(e=Array(r));++t<r;)e[t]=a[t];return e}ud.exports=k1});var gd=b((pO,fd)=>{function F1(a,e){for(var t=-1,r=a==null?0:a.length,s=0,o=[];++t<r;){var n=a[t];e(n,t,a)&&(o[s++]=n)}return o}fd.exports=F1});var yo=b((dO,yd)=>{function z1(){return[]}yd.exports=z1});var Jt=b((mO,wd)=>{var N1=gd(),H1=yo(),W1=Object.prototype,G1=W1.propertyIsEnumerable,vd=Object.getOwnPropertySymbols,U1=vd?function(a){return a==null?[]:(a=Object(a),N1(vd(a),function(e){return G1.call(a,e)}))}:H1;wd.exports=U1});var xd=b((uO,Cd)=>{var B1=ft(),V1=Jt();function j1(a,e){return B1(a,V1(a),e)}Cd.exports=j1});var vo=b((_O,Td)=>{function q1(a,e){for(var t=-1,r=e.length,s=a.length;++t<r;)a[s+t]=e[t];return a}Td.exports=q1});var wo=b((fO,Ed)=>{var Z1=fo(),Y1=Z1(Object.getPrototypeOf,Object);Ed.exports=Y1});var Co=b((gO,Pd)=>{var X1=vo(),J1=wo(),K1=Jt(),Q1=yo(),$1=Object.getOwnPropertySymbols,eC=$1?function(a){for(var e=[];a;)X1(e,K1(a)),a=J1(a);return e}:Q1;Pd.exports=eC});var Ad=b((yO,bd)=>{var tC=ft(),iC=Co();function rC(a,e){return tC(a,iC(a),e)}bd.exports=rC});var xo=b((vO,Md)=>{var sC=vo(),oC=Vt();function aC(a,e,t){var r=e(a);return oC(a)?r:sC(r,t(a))}Md.exports=aC});var Sd=b((wO,Id)=>{var nC=xo(),lC=Jt(),hC=Yt();function cC(a){return nC(a,hC,lC)}Id.exports=cC});var Ld=b((CO,Dd)=>{var pC=xo(),dC=Co(),mC=Xt();function uC(a){return pC(a,mC,dC)}Dd.exports=uC});var Od=b((xO,Rd)=>{var _C=Ae(),fC=pe(),gC=_C(fC,"DataView");Rd.exports=gC});var Fd=b((TO,kd)=>{var yC=Ae(),vC=pe(),wC=yC(vC,"Promise");kd.exports=wC});var Nd=b((EO,zd)=>{var CC=Ae(),xC=pe(),TC=CC(xC,"Set");zd.exports=TC});var Wd=b((PO,Hd)=>{var EC=Ae(),PC=pe(),bC=EC(PC,"WeakMap");Hd.exports=bC});var Kt=b((bO,Zd)=>{var To=Od(),Eo=Bt(),Po=Fd(),bo=Nd(),Ao=Wd(),qd=mt(),Qe=lo(),Gd="[object Map]",AC="[object Object]",Ud="[object Promise]",Bd="[object Set]",Vd="[object WeakMap]",jd="[object DataView]",MC=Qe(To),IC=Qe(Eo),SC=Qe(Po),DC=Qe(bo),LC=Qe(Ao),Fe=qd;(To&&Fe(new To(new ArrayBuffer(1)))!=jd||Eo&&Fe(new Eo)!=Gd||Po&&Fe(Po.resolve())!=Ud||bo&&Fe(new bo)!=Bd||Ao&&Fe(new Ao)!=Vd)&&(Fe=function(a){var e=qd(a),t=e==AC?a.constructor:void 0,r=t?Qe(t):"";if(r)switch(r){case MC:return jd;case IC:return Gd;case SC:return Ud;case DC:return Bd;case LC:return Vd}return e});Zd.exports=Fe});var Xd=b((AO,Yd)=>{var RC=Object.prototype,OC=RC.hasOwnProperty;function kC(a){var e=a.length,t=new a.constructor(e);return e&&typeof a[0]=="string"&&OC.call(a,"index")&&(t.index=a.index,t.input=a.input),t}Yd.exports=kC});var Kd=b((MO,Jd)=>{var FC=pe(),zC=FC.Uint8Array;Jd.exports=zC});var Qt=b((IO,$d)=>{var Qd=Kd();function NC(a){var e=new a.constructor(a.byteLength);return new Qd(e).set(new Qd(a)),e}$d.exports=NC});var tm=b((SO,em)=>{var HC=Qt();function WC(a,e){var t=e?HC(a.buffer):a.buffer;return new a.constructor(t,a.byteOffset,a.byteLength)}em.exports=WC});var rm=b((DO,im)=>{var GC=/\w*$/;function UC(a){var e=new a.constructor(a.source,GC.exec(a));return e.lastIndex=a.lastIndex,e}im.exports=UC});var lm=b((LO,nm)=>{var sm=Ut(),om=sm?sm.prototype:void 0,am=om?om.valueOf:void 0;function BC(a){return am?Object(am.call(a)):{}}nm.exports=BC});var cm=b((RO,hm)=>{var VC=Qt();function jC(a,e){var t=e?VC(a.buffer):a.buffer;return new a.constructor(t,a.byteOffset,a.length)}hm.exports=jC});var dm=b((OO,pm)=>{var qC=Qt(),ZC=tm(),YC=rm(),XC=lm(),JC=cm(),KC="[object Boolean]",QC="[object Date]",$C="[object Map]",ex="[object Number]",tx="[object RegExp]",ix="[object Set]",rx="[object String]",sx="[object Symbol]",ox="[object ArrayBuffer]",ax="[object DataView]",nx="[object Float32Array]",lx="[object Float64Array]",hx="[object Int8Array]",cx="[object Int16Array]",px="[object Int32Array]",dx="[object Uint8Array]",mx="[object Uint8ClampedArray]",ux="[object Uint16Array]",_x="[object Uint32Array]";function fx(a,e,t){var r=a.constructor;switch(e){case ox:return qC(a);case KC:case QC:return new r(+a);case ax:return ZC(a,t);case nx:case lx:case hx:case cx:case px:case dx:case mx:case ux:case _x:return JC(a,t);case $C:return new r;case ex:case rx:return new r(a);case tx:return YC(a);case ix:return new r;case sx:return XC(a)}}pm.exports=fx});var _m=b((kO,um)=>{var gx=Ve(),mm=Object.create,yx=function(){function a(){}return function(e){if(!gx(e))return{};if(mm)return mm(e);a.prototype=e;var t=new a;return a.prototype=void 0,t}}();um.exports=yx});var gm=b((FO,fm)=>{var vx=_m(),wx=wo(),Cx=Zt();function xx(a){return typeof a.constructor=="function"&&!Cx(a)?vx(wx(a)):{}}fm.exports=xx});var vm=b((zO,ym)=>{var Tx=Kt(),Ex=Ye(),Px="[object Map]";function bx(a){return Ex(a)&&Tx(a)==Px}ym.exports=bx});var Tm=b((NO,xm)=>{var Ax=vm(),Mx=jt(),wm=qt(),Cm=wm&&wm.isMap,Ix=Cm?Mx(Cm):Ax;xm.exports=Ix});var Pm=b((HO,Em)=>{var Sx=Kt(),Dx=Ye(),Lx="[object Set]";function Rx(a){return Dx(a)&&Sx(a)==Lx}Em.exports=Rx});var Im=b((WO,Mm)=>{var Ox=Pm(),kx=jt(),bm=qt(),Am=bm&&bm.isSet,Fx=Am?kx(Am):Ox;Mm.exports=Fx});var Om=b((GO,Rm)=>{var zx=cp(),Nx=dp(),Hx=co(),Wx=td(),Gx=ld(),Ux=md(),Bx=_d(),Vx=xd(),jx=Ad(),qx=Sd(),Zx=Ld(),Yx=Kt(),Xx=Xd(),Jx=dm(),Kx=gm(),Qx=Vt(),$x=po(),eT=Tm(),tT=Ve(),iT=Im(),rT=Yt(),sT=Xt(),oT=1,aT=2,nT=4,Sm="[object Arguments]",lT="[object Array]",hT="[object Boolean]",cT="[object Date]",pT="[object Error]",Dm="[object Function]",dT="[object GeneratorFunction]",mT="[object Map]",uT="[object Number]",Lm="[object Object]",_T="[object RegExp]",fT="[object Set]",gT="[object String]",yT="[object Symbol]",vT="[object WeakMap]",wT="[object ArrayBuffer]",CT="[object DataView]",xT="[object Float32Array]",TT="[object Float64Array]",ET="[object Int8Array]",PT="[object Int16Array]",bT="[object Int32Array]",AT="[object Uint8Array]",MT="[object Uint8ClampedArray]",IT="[object Uint16Array]",ST="[object Uint32Array]",W={};W[Sm]=W[lT]=W[wT]=W[CT]=W[hT]=W[cT]=W[xT]=W[TT]=W[ET]=W[PT]=W[bT]=W[mT]=W[uT]=W[Lm]=W[_T]=W[fT]=W[gT]=W[yT]=W[AT]=W[MT]=W[IT]=W[ST]=!0;W[pT]=W[Dm]=W[vT]=!1;function $t(a,e,t,r,s,o){var n,l=e&oT,h=e&aT,c=e&nT;if(t&&(n=s?t(a,r,s,o):t(a)),n!==void 0)return n;if(!tT(a))return a;var p=Qx(a);if(p){if(n=Xx(a),!l)return Bx(a,n)}else{var u=Yx(a),g=u==Dm||u==dT;if($x(a))return Ux(a,l);if(u==Lm||u==Sm||g&&!s){if(n=h||g?{}:Kx(a),!l)return h?jx(a,Gx(n,a)):Vx(a,Wx(n,a))}else{if(!W[u])return s?a:{};n=Jx(a,u,l)}}o||(o=new zx);var _=o.get(a);if(_)return _;o.set(a,n),iT(a)?a.forEach(function(w){n.add($t(w,e,t,w,a,o))}):eT(a)&&a.forEach(function(w,P){n.set(P,$t(w,e,t,P,a,o))});var d=c?h?Zx:qx:h?sT:rT,T=p?void 0:d(a);return Nx(T||a,function(w,P){T&&(P=w,w=a[P]),Hx(n,P,$t(w,e,t,P,a,o))}),n}Rm.exports=$t});var Fm=b((UO,km)=>{var DT=Om(),LT=1,RT=4;function OT(a){return DT(a,LT|RT)}km.exports=OT});var Qn={};function $n(a,e){Qn[a]=e}function q(a){return Qn[a]}var el={};function bt(a,e){el[a]=e}function Zi(a){return el[a]}import*as i from"cesium";var tl=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Yi=1,rt=8,ot=class a{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");let s=r>>4;if(s!==Yi)throw new Error(`Got v${s} data when expected v${Yi}.`);let o=tl[r&15];if(!o)throw new Error("Unrecognized array type.");let[n]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new a(l,n,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=tl.indexOf(this.ArrayType),n=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,h=(8-l%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,rt,e),this.coords=new this.ArrayType(this.data,rt+l+h,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(rt+n+l+h),this.ids=new this.IndexArrayType(this.data,rt,e),this.coords=new this.ArrayType(this.data,rt+l+h,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Yi<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ji(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:n,nodeSize:l}=this,h=[0,o.length-1,0],c=[];for(;h.length;){let p=h.pop()||0,u=h.pop()||0,g=h.pop()||0;if(u-g<=l){for(let w=g;w<=u;w++){let P=n[2*w],M=n[2*w+1];P>=e&&P<=r&&M>=t&&M<=s&&c.push(o[w])}continue}let _=g+u>>1,d=n[2*_],T=n[2*_+1];d>=e&&d<=r&&T>=t&&T<=s&&c.push(o[_]),(p===0?e<=d:t<=T)&&(h.push(g),h.push(_-1),h.push(1-p)),(p===0?r>=d:s>=T)&&(h.push(_+1),h.push(u),h.push(1-p))}return c}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:s,coords:o,nodeSize:n}=this,l=[0,s.length-1,0],h=[],c=r*r;for(;l.length;){let p=l.pop()||0,u=l.pop()||0,g=l.pop()||0;if(u-g<=n){for(let w=g;w<=u;w++)il(o[2*w],o[2*w+1],e,t)<=c&&h.push(s[w]);continue}let _=g+u>>1,d=o[2*_],T=o[2*_+1];il(d,T,e,t)<=c&&h.push(s[_]),(p===0?e-r<=d:t-r<=T)&&(l.push(g),l.push(_-1),l.push(1-p)),(p===0?e+r>=d:t+r>=T)&&(l.push(_+1),l.push(u),l.push(1-p))}return h}};function Ji(a,e,t,r,s,o){if(s-r<=t)return;let n=r+s>>1;rl(a,e,n,r,s,o),Ji(a,e,t,r,n-1,1-o),Ji(a,e,t,n+1,s,1-o)}function rl(a,e,t,r,s,o){for(;s>r;){if(s-r>600){let c=s-r+1,p=t-r+1,u=Math.log(c),g=.5*Math.exp(2*u/3),_=.5*Math.sqrt(u*g*(c-g)/c)*(p-c/2<0?-1:1),d=Math.max(r,Math.floor(t-p*g/c+_)),T=Math.min(s,Math.floor(t+(c-p)*g/c+_));rl(a,e,t,d,T,o)}let n=e[2*t+o],l=r,h=s;for(st(a,e,r,t),e[2*s+o]>n&&st(a,e,r,s);l<h;){for(st(a,e,l,h),l++,h--;e[2*l+o]<n;)l++;for(;e[2*h+o]>n;)h--}e[2*r+o]===n?st(a,e,r,h):(h++,st(a,e,h,s)),h<=t&&(r=h+1),t<=h&&(s=h-1)}}function st(a,e,t,r){Xi(a,t,r),Xi(e,2*t,2*r),Xi(e,2*t+1,2*r+1)}function Xi(a,e,t){let r=a[e];a[e]=a[t],a[t]=r}function il(a,e,t,r){let s=a-t,o=e-r;return s*s+o*o}var cg={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},sl=Math.fround||(a=>e=>(a[0]=+e,a[0]))(new Float32Array(1)),Re=2,Ce=3,Ki=4,we=5,al=6,He=class{constructor(e){this.options=Object.assign(Object.create(cg),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");let o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;let n=[];for(let h=0;h<e.length;h++){let c=e[h];if(!c.geometry)continue;let[p,u]=c.geometry.coordinates,g=sl(At(p)),_=sl(Mt(u));n.push(g,_,1/0,h,-1,1),this.options.reduce&&n.push(0)}let l=this.trees[s+1]=this._createTree(n);t&&console.timeEnd(o);for(let h=s;h>=r;h--){let c=+Date.now();l=this.trees[h]=this._createTree(this._cluster(l,h)),t&&console.log("z%d: %d clusters in %dms",h,l.numItems,+Date.now()-c)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180,s=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){let u=this.getClusters([r,s,180,n],t),g=this.getClusters([-180,s,o,n],t);return u.concat(g)}let l=this.trees[this._limitZoom(t)],h=l.range(At(r),Mt(n),At(o),Mt(s)),c=l.data,p=[];for(let u of h){let g=this.stride*u;p.push(c[g+we]>1?ol(c,g,this.clusterProps):this.points[c[g+Ce]])}return p}getChildren(e){let t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);let n=o.data;if(t*this.stride>=n.length)throw new Error(s);let l=this.options.radius/(this.options.extent*Math.pow(2,r-1)),h=n[t*this.stride],c=n[t*this.stride+1],p=o.within(h,c,l),u=[];for(let g of p){let _=g*this.stride;n[_+Ki]===e&&u.push(n[_+we]>1?ol(n,_,this.clusterProps):this.points[n[_+Ce]])}if(u.length===0)throw new Error(s);return u}getLeaves(e,t,r){t=t||10,r=r||0;let s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){let s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:n,radius:l}=this.options,h=l/n,c=(r-h)/o,p=(r+1+h)/o,u={features:[]};return this._addTileFeatures(s.range((t-h)/o,c,(t+1+h)/o,p),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-h/o,c,1,p),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,c,h/o,p),s.data,-1,r,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){let n=this.getChildren(t);for(let l of n){let h=l.properties;if(h&&h.cluster?o+h.point_count<=s?o+=h.point_count:o=this._appendLeaves(e,h.cluster_id,r,s,o):o<s?o++:e.push(l),e.length===r)break}return o}_createTree(e){let t=new ot(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,n){for(let l of e){let h=l*this.stride,c=t[h+we]>1,p,u,g;if(c)p=nl(t,h,this.clusterProps),u=t[h],g=t[h+1];else{let T=this.points[t[h+Ce]];p=T.properties;let[w,P]=T.geometry.coordinates;u=At(w),g=Mt(P)}let _={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(g*o-s))]],tags:p},d;c||this.options.generateId?d=t[h+Ce]:d=this.points[t[h+Ce]].id,d!==void 0&&(_.id=d),n.features.push(_)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:r,extent:s,reduce:o,minPoints:n}=this.options,l=r/(s*Math.pow(2,t)),h=e.data,c=[],p=this.stride;for(let u=0;u<h.length;u+=p){if(h[u+Re]<=t)continue;h[u+Re]=t;let g=h[u],_=h[u+1],d=e.within(h[u],h[u+1],l),T=h[u+we],w=T;for(let P of d){let M=P*p;h[M+Re]>t&&(w+=h[M+we])}if(w>T&&w>=n){let P=g*T,M=_*T,R,F=-1,H=((u/p|0)<<5)+(t+1)+this.points.length;for(let ee of d){let Y=ee*p;if(h[Y+Re]<=t)continue;h[Y+Re]=t;let B=h[Y+we];P+=h[Y]*B,M+=h[Y+1]*B,h[Y+Ki]=H,o&&(R||(R=this._map(h,u,!0),F=this.clusterProps.length,this.clusterProps.push(R)),o(R,this._map(h,Y)))}h[u+Ki]=H,c.push(P/w,M/w,1/0,H,-1,w),o&&c.push(F)}else{for(let P=0;P<p;P++)c.push(h[u+P]);if(w>1)for(let P of d){let M=P*p;if(!(h[M+Re]<=t)){h[M+Re]=t;for(let R=0;R<p;R++)c.push(h[M+R])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+we]>1){let n=this.clusterProps[e[t+al]];return r?Object.assign({},n):n}let s=this.points[e[t+Ce]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}};function ol(a,e,t){return{type:"Feature",id:a[e+Ce],properties:nl(a,e,t),geometry:{type:"Point",coordinates:[pg(a[e]),dg(a[e+1])]}}}function nl(a,e,t){let r=a[e+we],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=a[e+al],n=o===-1?{}:Object.assign({},t[o]);return Object.assign(n,{cluster:!0,cluster_id:a[e+Ce],point_count:r,point_count_abbreviated:s})}function At(a){return a/360+.5}function Mt(a){let e=Math.sin(a*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function pg(a){return(a-.5)*360}function dg(a){let e=(180-a*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ll=new i.WebMercatorProjection,Qi=class{static transformCartesianToWGS84(e){if(e){let t=i.Ellipsoid.WGS84.cartesianToCartographic(e);return new X(i.Math.toDegrees((t==null?void 0:t.longitude)||0),i.Math.toDegrees((t==null?void 0:t.latitude)||0),t.height||0)}return new X(0,0)}static transformCartographicToWGS84(e){return e?new X(i.Math.toDegrees((e==null?void 0:e.longitude)||0),i.Math.toDegrees((e==null?void 0:e.latitude)||0),e.height||0):new X(0,0)}static transformWGS84ToCartesian(e){return e?i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt,i.Ellipsoid.WGS84):i.Cartesian3.ZERO}static transformWGS84ToCartographic(e){return e?i.Cartographic.fromDegrees(e.lng,e.lat,e.alt):i.Cartographic.ZERO}static transformCartesianArrayToWGS84Array(e){return e?e.map(t=>this.transformCartesianToWGS84(t)):[]}static transformWGS84ArrayToCartesianArray(e){return e?e.map(t=>this.transformWGS84ToCartesian(t)):[]}static transformWGS84ToMercator(e){let t=ll.project(i.Cartographic.fromDegrees(e.lng,e.lat,e.alt));return new X(t.x,t.y,t.z)}static transformMercatorToWGS84(e){let t=ll.unproject(new i.Cartesian3(e.lng,e.lat,e.alt));return new X(i.Math.toDegrees(t.longitude),i.Math.toDegrees(t.latitude),t.height)}static transformWindowToWGS84(e,t){let r=t.scene,s;if(r.mode===i.SceneMode.SCENE3D){let o=r.camera.getPickRay(e);s=r.globe.pick(o,r)}else s=r.camera.pickEllipsoid(e,i.Ellipsoid.WGS84);return this.transformCartesianToWGS84(s)}static transformWGS84ToWindow(e,t){let r=t.scene;return i.SceneTransforms.worldToWindowCoordinates(r,this.transformWGS84ToCartesian(e))}},f=Qi;var It=52.35987755982988,te=3.141592653589793,hl=6378245,cl=.006693421622965943,$i=class{static BD09ToGCJ02(e,t){let r=+e-.0065,s=+t-.006,o=Math.sqrt(r*r+s*s)-2e-5*Math.sin(s*It),n=Math.atan2(s,r)-3e-6*Math.cos(r*It),l=o*Math.cos(n),h=o*Math.sin(n);return[l,h]}static GCJ02ToBD09(e,t){t=+t,e=+e;let r=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*It),s=Math.atan2(t,e)+3e-6*Math.cos(e*It),o=r*Math.cos(s)+.0065,n=r*Math.sin(s)+.006;return[o,n]}static WGS84ToGCJ02(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let r=this.delta(e,t);return[e+r[0],t+r[1]]}}static GCJ02ToWGS84(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let r=[e,t],s=this.WGS84ToGCJ02(e,t),o=s[0]-e,n=s[1]-t;do s=this.WGS84ToGCJ02(r[0]-=o,r[1]-=n),o=s[0]-e,n=s[1]-t;while(Math.abs(o)>1e-7||Math.abs(n)>1e-7);return r}}static delta(e,t){let r=this.transformLng(e-105,t-35),s=this.transformLat(e-105,t-35),o=t/180*te,n=Math.sin(o);n=1-cl*n*n;let l=Math.sqrt(n);return r=r*180/(hl/l*Math.cos(o)*te),s=s*180/(hl*(1-cl)/(n*l)*te),[r,s]}static transformLng(e,t){t=+t,e=+e;let r=300+e+2*t+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return r+=(20*Math.sin(6*e*te)+20*Math.sin(2*e*te))*2/3,r+=(20*Math.sin(e*te)+40*Math.sin(e/3*te))*2/3,r+=(150*Math.sin(e/12*te)+300*Math.sin(e/30*te))*2/3,r}static transformLat(e,t){t=+t,e=+e;let r=-100+2*e+3*t+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return r+=(20*Math.sin(6*e*te)+20*Math.sin(2*e*te))*2/3,r+=(20*Math.sin(t*te)+40*Math.sin(t/3*te))*2/3,r+=(160*Math.sin(t/12*te)+320*Math.sin(t*te/30))*2/3,r}static out_of_china(e,t){return t=+t,e=+e,!(e>73.66&&e<135.05&&t>3.86&&t<53.55)}},me=$i;var er=class a{constructor(e,t,r,s,o,n){this._lng=+e||0,this._lat=+t||0,this._alt=+r||0,this._heading=+s||0,this._pitch=+o||0,this._roll=+n||0}set lng(e){this._lng=+e}get lng(){return this._lng}set lat(e){this._lat=+e}get lat(){return this._lat}set alt(e){this._alt=+e}get alt(){return this._alt}set heading(e){this._heading=+e}get heading(){return this._heading}set pitch(e){this._pitch=+e}get pitch(){return this._pitch}set roll(e){this._roll=+e}get roll(){return this._roll}serialize(){let e=new a(this._lng,this._lat,this._alt,this._heading,this._pitch,this._roll);return JSON.stringify(e)}distance(e){return!e||!(e instanceof a)?0:i.Cartesian3.distance(f.transformWGS84ToCartesian(this),f.transformWGS84ToCartesian(e))}clone(){let e=new a;return e.lng=this.lng||0,e.lat=this.lat||0,e.alt=this.alt||0,e.heading=this.heading||0,e.pitch=this.pitch||0,e.roll=this.roll||0,e}copy(){return this.clone()}toArray(){return[this.lng,this.lat,this.alt,this.heading,this.pitch,this.roll]}toString(){return`${this.lng},${this.lat},${this.alt},${this.heading},${this.pitch},${this.roll}`}toObject(){return{lng:this.lng,lat:this.lat,alt:this.alt,heading:this.heading,pitch:this.pitch,roll:this.roll}}static fromArray(e){let t=new a;return Array.isArray(e)&&(t.lng=e[0]||0,t.lat=e[1]||0,t.alt=e[2]||0,t.heading=e[3]||0,t.pitch=e[4]||0,t.roll=e[5]||0),t}static fromString(e){let t=new a;if(e&&typeof e=="string"){let r=e.split(",");t=this.fromArray(r)}return t}static fromObject(e){return new a(e.lng,e.lat,e.alt,e.heading,e.pitch,e.roll)}static deserialize(e){let t=new a,r=JSON.parse(e);return r&&(t.lng=r.lng||0,t.lat=r.lat||0,t.alt=r.alt||0,t.heading=r.heading||0,t.pitch=r.pitch||0,t.roll=r.roll||0),t}},X=er;var tr=class{static parsePosition(e){let t=new X;return e&&(typeof e=="string"?t=X.fromString(e):Array.isArray(e)?t=X.fromArray(e):!(Object(e)instanceof X)&&Object(e).hasOwnProperty("lng")&&Object(e).hasOwnProperty("lat")?t=X.fromObject(e):Object(e)instanceof X?t=e:Object(e)instanceof i.Cartesian3?t=f.transformCartesianToWGS84(e):Object(e)instanceof i.Cartographic&&(t=f.transformCartographicToWGS84(e))),t}static parsePositions(e){if(typeof e=="string"){if(e.indexOf("#")>=0)throw new Error("the positions invalid");e=e.split(";").filter(t=>!!t)}return e.map(t=>this.parsePosition(t))}static parsePointCoordToArray(e){return e=this.parsePosition(e),[e.lng,e.lat]}static parsePolylineCoordToArray(e){let t=[];return e=this.parsePositions(e),e.forEach(r=>{t.push([r.lng,r.lat])}),t}static parsePolygonCoordToArray(e,t=!1){let r=[];return e=this.parsePositions(e),e.forEach(s=>{r.push([s.lng,s.lat])}),t&&r.length>0&&r.push(r[0]),[r]}},y=tr;var at={ADD:"add",REMOVE:"remove"},O={LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,WHEEL:i.ScreenSpaceEventType.WHEEL,MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout"},pl={ADD_LAYER:"addLayer",REMOVE_LAYER:"removeLayer",ADD_EFFECT:"addEffect",REMOVE_EFFECT:"removeEffect",LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,WHEEL:i.ScreenSpaceEventType.WHEEL},D={CAMERA_MOVE_END:"cameraMoveEnd",CAMERA_CHANGED:"cameraChanged",PRE_UPDATE:"preUpdate",POST_UPDATE:"postUpdate",PRE_RENDER:"preRender",POST_RENDER:"postRender",MORPH_COMPLETE:"morphComplete",CLOCK_TICK:"clockTick",RENDER_ERROR:"renderError"},xe={...at,LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout",POSITION_UPDATE:"positionUpdate"},Oe={READY:"ready",TEX_READY:"texturesReady"},K={INITIAL_TILES_LOADED:"initialTilesLoaded",ALL_TILES_LOADED:"allTilesLoaded ",LOAD_PROGRESS:"loadProgress ",TILE_FAILED:"tileFailed ",TILE_LOAD:"tileLoad",TILE_UNLOAD:"tileUnload",TILE_VISIBLE:"tileVisible"},Te=at,Ee={...at,LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK},oe={...at,POST_RENDER:"postRender",ACTIVATE:"activate",DEACTIVATE:"deactivate",RESET_TIME_LINE:"restTimeLine"},ae={...at,POST_RENDER:"postRender",RESET_TIME_LINE:"restTimeLine"},E={DRAW_START:"drawStart",DRAW_STOP:"drawStop",EDIT_START:"editStart",EDIT_STOP:"editEnd",DRAW_ANCHOR:"drawAnchor",CREATE_ANCHOR:"createAnchor",UPDATE_ANCHOR:"updateAnchor",ANCHOR_MOVING:"anchorMoving",EDIT_ANCHOR_STOP:"editAnchorStop",CLEAR_ANCHOR:"clearAnchor"};var ir=class{constructor(e){this._types=e,this._cache={}}_on(e,t,r){let s=this.getEvent(e),o;return s&&t&&(o=s.addEventListener(t,r||this)),o}_off(e,t,r){let s=this.getEvent(e),o=!1;return s&&t&&(o=s.removeEventListener(t,r||this)),o}_fire(e,t){let r=this.getEvent(e);r&&r.raiseEvent(t)}_registerEvent(){Object.keys(this._types).forEach(e=>{let t=this._types[e];this._cache[t]=new i.Event})}on(e,t,r){return this._on(e,t,r)}once(e,t,r){let s=this._on(e,o=>{t(o),s&&s()},r)}off(e,t,r){return this._off(e,t,r)}fire(e,t){this._fire(e,t)}getEvent(e){return this._cache[e]||void 0}},U=ir;var rr=class extends U{constructor(e,t={}){super(O),this._viewer=e,this._selected=void 0,this._enableEventPropagation=t.enableEventPropagation,this._enableMouseOver=t.enableMouseOver,this._enableMouseMovePick=t.enableMouseMovePick,this._registerEvent(),this._addDefaultEvent()}_registerEvent(){let e=new i.ScreenSpaceEventHandler(this._viewer.canvas);Object.keys(i.ScreenSpaceEventType).forEach(t=>{let r=i.ScreenSpaceEventType[t];this._cache[r]=new i.Event,e.setInputAction(s=>{this._cache[r].raiseEvent(s)},r)})}_addDefaultEvent(){this.on(this._types.LEFT_DOWN,this._leftDownHandler,this),this.on(this._types.LEFT_UP,this._leftUpHandler,this),this.on(this._types.CLICK,this._clickHandler,this),this.on(this._types.DB_CLICK,this._dbClickHandler,this),this.on(this._types.RIGHT_DOWN,this._rightDownHandler,this),this.on(this._types.RIGHT_UP,this._rightUpHandler,this),this.on(this._types.RIGHT_CLICK,this._rightClickHandler,this),this.on(this._types.MOUSE_MOVE,this._mouseMoveHandler,this),this.on(this._types.WHEEL,this._mouseWheelHandler,this)}_adjustPosition(e){let t=this._viewer.canvas.getBoundingClientRect(),r=this._viewer.canvas.offsetWidth/t.width,s=this._viewer.canvas.offsetHeight/t.height;return new i.Cartesian2(e.x*r,e.y*s)}_getMousePosition(e){let t=this._viewer.scene,r,s,o,n;if(t.pickPositionSupported&&(r=t.pickPosition(e)),r){let l=i.Ellipsoid.WGS84.cartesianToCartographic(r);l&&(o={lng:i.Math.toDegrees(l.longitude),lat:i.Math.toDegrees(l.latitude),alt:l.height})}if(t.mode===i.SceneMode.SCENE3D&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)){let l=t.camera.getPickRay(e);s=t.globe.pick(l,t)}else s=t.camera.pickEllipsoid(e,i.Ellipsoid.WGS84);if(s){let l=i.Ellipsoid.WGS84.cartesianToCartographic(s);l&&(n={lng:i.Math.toDegrees(l.longitude),lat:i.Math.toDegrees(l.latitude),alt:l.height})}return{windowPosition:e,position:r,wgs84Position:o,surfacePosition:s,wgs84SurfacePosition:n}}_getMouseInfo(e){return{...this._getMousePosition(this._adjustPosition(e)),target:this._viewer.scene.pick(this._adjustPosition(e))}}_getDrillInfos(e){let t=[],s=this._viewer.scene.drillPick(e);return s&&s.length&&s.forEach(o=>{t.push(this._getTargetInfo(o))}),t}_getOverlayId(e){let t;return(e==null?void 0:e.id)instanceof i.Entity?t=e.id.overlayId:e instanceof i.Cesium3DTileFeature?t=e.tileset.overlayId:((e==null?void 0:e.primitive)instanceof i.Cesium3DTileset||e!=null&&e.primitive)&&(t=e.primitive.overlayId),t}_getTargetInfo(e){let t,r,s;return(e==null?void 0:e.id)instanceof i.Entity?(r=this._viewer.getLayers().filter(o=>o.layerId===e.id.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.id.overlayId))):e instanceof i.Cesium3DTileFeature?(r=this._viewer.getLayers().filter(o=>o.layerId===e.tileset.layerId)[0],s=e,r!=null&&r.getOverlay&&(t=r.getOverlay(e.tileset.overlayId),s&&s.getPropertyNames&&s.getPropertyNames().forEach(n=>{t.attr[n]=s.getProperty(n)}))):(e==null?void 0:e.primitive)instanceof i.Cesium3DTileset?(r=this._viewer.getLayers().filter(o=>o.layerId===e.primitive.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.primitive.overlayId))):e!=null&&e.primitive&&(r=this._viewer.getLayers().filter(o=>o.layerId===e.primitive.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.primitive.overlayId))),{layer:r,overlay:t,feature:s,instanceId:e==null?void 0:e.instanceId}}_raiseEvent(e,t={}){var l;let r,s=this._getTargetInfo(t.target),o=s==null?void 0:s.overlay,n=s==null?void 0:s.layer;o!=null&&o.overlayEvent&&(r=o.overlayEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),(!r||r.numberOfListeners===0||this._eventPropagation)&&(n!=null&&n.layerEvent)&&(r=n.layerEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),(!r||r.numberOfListeners===0||this._enableEventPropagation)&&((l=this._viewer)!=null&&l.viewerEvent)&&(r=this._viewer.viewerEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),o!=null&&o.allowDrillPicking&&this._getDrillInfos(t.windowPosition).forEach(c=>{let p=c==null?void 0:c.overlay,u=c==null?void 0:c.layer;(p==null?void 0:p.overlayId)!==o.overlayId&&(p!=null&&p.overlayEvent)&&(r=p.overlayEvent.getEvent(e),(!r||r.numberOfListeners===0)&&(u!=null&&u.layerEvent)&&(r=u.layerEvent.getEvent(e)),r&&r.numberOfListeners>0&&r.raiseEvent({...c,...t}))})}_clickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.CLICK,this._getMouseInfo(e.position))}_dbClickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.DB_CLICK,this._getMouseInfo(e.position))}_rightClickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.RIGHT_CLICK,this._getMouseInfo(e.position))}_mouseMoveHandler(e){if(!(e!=null&&e.endPosition))return!1;if(this._enableMouseMovePick){let t=this._getMouseInfo(e.endPosition);this._viewer.canvas.style.cursor=t.target?"pointer":"default",this._raiseEvent(O.MOUSE_MOVE,t),this._enableMouseOver&&(!this._selected||this._getOverlayId(this._selected.target)!==this._getOverlayId(t.target))&&(this._raiseEvent(O.MOUSE_OUT,this._selected),this._raiseEvent(O.MOUSE_OVER,t),this._selected=t)}else this._raiseEvent(O.MOUSE_MOVE,this._getMousePosition(this._adjustPosition(e.endPosition)))}_leftDownHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.LEFT_DOWN,this._getMouseInfo(e.position))}_leftUpHandler(e){this._raiseEvent(O.LEFT_UP,this._getMouseInfo(e.position))}_rightDownHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.RIGHT_DOWN,this._getMouseInfo(e.position))}_rightUpHandler(e){this._raiseEvent(O.RIGHT_UP,this._getMouseInfo(e.position))}_mouseWheelHandler(e){this._raiseEvent(O.WHEEL,{movement:e})}},sr=rr;var or=class extends U{constructor(){super(pl),this._registerEvent()}},ar=or;var nr=class extends U{constructor(e){super(D),this._camera=e.camera,this._scene=e.scene,this._clock=e.clock}on(e,t,r){let s;switch(e){case D.CAMERA_MOVE_END:s=this._camera.moveEnd.addEventListener(t,r||this);break;case D.CAMERA_CHANGED:s=this._camera.changed.addEventListener(t,r||this);break;case D.PRE_UPDATE:s=this._scene.preUpdate.addEventListener(t,r||this);break;case D.POST_UPDATE:s=this._scene.postUpdate.addEventListener(t,r||this);break;case D.PRE_RENDER:s=this._scene.preRender.addEventListener(t,r||this);break;case D.POST_RENDER:s=this._scene.postRender.addEventListener(t,r||this);break;case D.MORPH_COMPLETE:s=this._scene.morphComplete.addEventListener(t,r||this);break;case D.CLOCK_TICK:s=this._clock.onTick.addEventListener(t,r||this);break;case D.RENDER_ERROR:s=this._scene.renderError.addEventListener(t,r||this);break;default:break}return s}off(e,t,r){let s=!1;switch(e){case D.CAMERA_MOVE_END:s=this._camera.moveEnd.removeEventListener(t,r||this);break;case D.CAMERA_CHANGED:s=this._camera.changed.removeEventListener(t,r||this);break;case D.PRE_UPDATE:s=this._scene.preUpdate.removeEventListener(t,r||this);break;case D.POST_UPDATE:s=this._scene.postUpdate.removeEventListener(t,r||this);break;case D.PRE_RENDER:s=this._scene.preRender.removeEventListener(t,r||this);break;case D.POST_RENDER:s=this._scene.postRender.removeEventListener(t,r||this);break;case D.MORPH_COMPLETE:s=this._scene.morphComplete.removeEventListener(t,r||this);break;case D.CLOCK_TICK:s=this._clock.onTick.removeEventListener(t,r||this);break;case D.RENDER_ERROR:s=this._scene.renderError.removeEventListener(t,r||this);break;default:break}return s}},lr=nr;var hr=class extends U{constructor(){super(Te),this._registerEvent()}},cr=hr;var pr=class extends U{constructor(){super(Ee),this._registerEvent()}},dr=pr;var mr=class extends U{constructor(){super(xe),this._registerEvent()}},ur=mr;var _r=class extends U{constructor(e){super(K),this._tileset=e}on(e,t,r){return this._tileset.then(s=>{switch(e){case K.INITIAL_TILES_LOADED:s.initialTilesLoaded.addEventListener(t,r||this);break;case K.ALL_TILES_LOADED:s.allTilesLoaded.addEventListener(t,r||this);break;case K.LOAD_PROGRESS:s.loadProgress.addEventListener(t,r||this);break;case K.TILE_FAILED:s.tileFailed.addEventListener(t,r||this);break;case K.TILE_LOAD:s.tileLoad.addEventListener(t,r||this);break;case K.TILE_UNLOAD:s.tileUnload.addEventListener(t,r||this);break;case K.TILE_VISIBLE:s.tileVisible.addEventListener(t,r||this);break;default:break}}),null}off(e,t,r){return this._tileset.then(s=>{switch(e){case K.INITIAL_TILES_LOADED:s.initialTilesLoaded.removeEventListener(t,r||this);break;case K.ALL_TILES_LOADED:s.allTilesLoaded.removeEventListener(t,r||this);break;case K.LOAD_PROGRESS:s.loadProgress.removeEventListener(t,r||this);break;case K.TILE_FAILED:s.tileFailed.removeEventListener(t,r||this);break;case K.TILE_LOAD:s.tileLoad.removeEventListener(t,r||this);break;case K.TILE_UNLOAD:s.tileUnload.removeEventListener(t,r||this);break;case K.TILE_VISIBLE:s.tileVisible.removeEventListener(t,r||this);break;default:break}}),!0}},fr=_r;var gr=class extends U{constructor(e){super(Oe),this._model=e}on(e,t,r){return this._model.then(s=>{switch(e){case Oe.READY:s.readyEvent.addEventListener(t,r||this);break;case Oe.TEX_READY:s.texturesReadyEvent.addEventListener(t,r||this);break;default:break}}),null}off(e,t,r){return this._model.then(s=>{switch(e){case Oe.READY:s.readyEvent.removeEventListener(t,r||this);break;case Oe.TEX_READY:s.texturesReadyEvent.removeEventListener(t,r||this);break;default:break}}),!0}},yr=gr;var vr=class extends U{constructor(){super(oe),this._registerEvent()}},wr=vr;var Cr=class extends U{constructor(){super(ae),this._registerEvent()}},xr=Cr;var Tr=class extends U{constructor(){super(E),this._registerEvent()}},nt=Tr;var mg={LEFT_MIDDLE:0,LEFT_RIGHT:1},Pe=mg;var ug="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Er=class{static uuid(e="D"){let t=[];t[8]=t[13]=t[18]=t[23]="-",t[14]="4";let r;for(let s=0;s<36;s++)t[s]||(r=0|Math.random()*16,t[s]=ug[s===19?r&3|8:r]);return e+"-"+t.join("")}static merge(e,...t){let r,s,o,n;for(s=0,o=t.length;s<o;s++){n=t[s];for(r in n)e[r]=n[r]}return e}static splitWords(e){return this.trim(e).split(/\s+/)}static setOptions(e,t){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let r in t)e.options[r]=t[r];return e.options}static formatNum(e,t){let r=Math.pow(10,t===void 0?6:t);return Math.round(e*r)/r}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static emptyImageUrl(){return function(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}()}static checkPosition(e){return e&&e.hasOwnProperty("_lng")&&e.hasOwnProperty("_lat")&&e.hasOwnProperty("_alt")}static debounce(e,t){let r=null;return function(){r&&clearTimeout(r),r=setTimeout(e,t)}}static throttle(e,t){let r=!0;return function(){if(!r)return!1;r=!1,setTimeout(()=>{e(),r=!0},t)}}static dataURLtoBlob(e){let t=e.split(","),r=t[0].match(/:(.*?);/)[1],s=atob(t[1]),o=s.length,n=new Uint8Array(o);for(;o--;)n[o]=s.charCodeAt(o);return new Blob([n],{type:r})}static isPromise(e){return Promise.resolve(e)==e}},C=Er;var Pr=class{static get(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,t){let r=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!r||r==="auto")&&document.defaultView){let s=document.defaultView.getComputedStyle(e,null);r=s?s[t]:null}return r==="auto"?null:r}static create(e,t,r=null){let s=document.createElement(e);return s.className=t||"",r&&r.appendChild(s),s}static remove(e){let t=e.parentNode;t&&t.removeChild(e)}static empty(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,t){if(e.classList!==void 0)return e.classList.contains(t);let r=this.getClass(e);return r.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(r)}static addClass(e,t){if(e.classList!==void 0){let r=C.splitWords(t);for(let s=0,o=r.length;s<o;s++)e.classList.add(r[s])}else if(!this.hasClass(e,t)){let r=this.getClass(e);this.setClass(e,(r?r+" ":"")+t)}}static removeClass(e,t){e.classList!==void 0?e.classList.remove(t):this.setClass(e,C.trim((" "+this.getClass(e)+" ").replace(" "+t+" "," ")))}static setClass(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvg(e,t,r,s){let o=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");o.setAttribute("class","svg-path"),o.setAttribute("width",e),o.setAttribute("height",t),o.setAttribute("viewBox",`0 0 ${e} ${t}`);let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",r),o.appendChild(n),s&&s.appendChild(o),o}static parseDom(e,t,r){t=t!=null?t:!1;let s=document.createElement("div");return s.className=r||"",s.innerHTML=e,t?s:s.childNodes}static enterFullscreen(e){e&&(e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen())}static exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}static createVideo(e,t,r=null){let s=this.create("video",t,r),o=this.create("source","",s);o.setAttribute("src",e),o.setAttribute("type","video/map4");let n=this.create("source","",s);return n.setAttribute("src",e),n.setAttribute("type","video/quicktime"),s}},I=Pr;var br=Math.PI*2,St=100,Ar=1e-4,Mr=class{static distance(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}static wholeDistance(e){let t=0;for(let r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t}static getBaseLength(e){return Math.pow(this.wholeDistance(e),.99)}static mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}static getCircleCenterOfThreePoints(e,t,r){let s=[(e[0]+t[0])/2,(e[1]+t[1])/2],o=[s[0]-e[1]+t[1],s[1]+e[0]-t[0]],n=[(e[0]+r[0])/2,(e[1]+r[1])/2],l=[n[0]-e[1]+r[1],n[1]+e[0]-r[0]];return this.getIntersectPoint(s,o,n,l)}static getIntersectPoint(e,t,r,s){let o,n,l,h;return e[1]===t[1]?(l=(s[0]-r[0])/(s[1]-r[1]),o=l*(e[1]-r[1])+r[0],n=e[1],[o,n]):r[1]===s[1]?(h=(t[0]-e[0])/(t[1]-e[1]),o=h*(r[1]-e[1])+e[0],n=r[1],[o,n]):(h=(t[0]-e[0])/(t[1]-e[1]),l=(s[0]-r[0])/(s[1]-r[1]),n=(h*e[1]-e[0]-l*r[1]+r[0])/(h-l),o=h*n-h*e[1]+e[0],[o,n])}static getAzimuth(e,t){let r,s=Math.asin(Math.abs(t[1]-e[1])/this.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?r=s+Math.PI:t[1]>=e[1]&&t[0]<e[0]?r=br-s:t[1]<e[1]&&t[0]<e[0]?r=s:t[1]<e[1]&&t[0]>=e[0]&&(r=Math.PI-s),r}static getAngleOfThreePoints(e,t,r){let s=this.getAzimuth(t,e)-this.getAzimuth(t,r);return s<0?s+br:s}static isClockWise(e,t,r){return(r[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(r[0]-e[0])}static getPointOnLine(e,t,r){let s=t[0]+e*(r[0]-t[0]),o=t[1]+e*(r[1]-t[1]);return[s,o]}static getCubicValue(e,t,r,s,o){e=Math.max(Math.min(e,1),0);let n=1-e,l=e*e,h=l*e,c=n*n,p=c*n,u=p*t[0]+3*c*e*r[0]+3*n*l*s[0]+h*o[0],g=p*t[1]+3*c*e*r[1]+3*n*l*s[1]+h*o[1];return[u,g]}static getThirdPoint(e,t,r,s,o){let n=this.getAzimuth(e,t),l=o?n+r:n-r,h=s*Math.cos(l),c=s*Math.sin(l);return[t[0]+h,t[1]+c]}static getArcPoints(e,t,r,s){let o,n,l=[],h=s-r;h=h<0?h+br:h;for(let c=0;c<=St;c++){let p=r+h*c/St;o=e[0]+t*Math.cos(p),n=e[1]+t*Math.sin(p),l.push([o,n])}return l}static getBisectorNormals(e,t,r,s){let o=this.getNormal(t,r,s),n=Math.sqrt(o[0]*o[0]+o[1]*o[1]),l=o[0]/n,h=o[1]/n,c=this.distance(t,r),p=this.distance(r,s),u,g,_,d,T;return n>Ar?this.isClockWise(t,r,s)?(u=e*c,g=r[0]-u*h,_=r[1]+u*l,T=[g,_],u=e*p,g=r[0]+u*h,_=r[1]-u*l,d=[g,_]):(u=e*c,g=r[0]+u*h,_=r[1]-u*l,T=[g,_],u=e*p,g=r[0]-u*h,_=r[1]+u*l,d=[g,_]):(g=r[0]+e*(t[0]-r[0]),_=r[1]+e*(t[1]-r[1]),T=[g,_],g=r[0]+e*(s[0]-r[0]),_=r[1]+e*(s[1]-r[1]),d=[g,_]),[T,d]}static getNormal(e,t,r){let s=e[0]-t[0],o=e[1]-t[1],n=Math.sqrt(s*s+o*o);s/=n,o/=n;let l=r[0]-t[0],h=r[1]-t[1],c=Math.sqrt(l*l+h*h);l/=c,h/=c;let p=s+l,u=o+h;return[p,u]}static getCurvePoints(e,t){let s=[this.getLeftMostControlPoint(e,t)],o,n,l,h;for(let u=0;u<t.length-2;u++)o=t[u],n=t[u+1],l=t[u+2],h=this.getBisectorNormals(e,o,n,l),s=s.concat(h);let c=this.getRightMostControlPoint(e,t);s.push(c);let p=[];for(let u=0;u<t.length-1;u++){o=t[u],n=t[u+1],p.push(o);for(let g=0;g<St;g++){let _=this.getCubicValue(g/St,o,s[u*2],s[u*2+1],n);p.push(_)}p.push(n)}return p}static getLeftMostControlPoint(e,t){let r=t[0],s=t[1],o=t[2],l=this.getBisectorNormals(0,r,s,o)[0],h=this.getNormal(r,s,o),c=Math.sqrt(h[0]*h[0]+h[1]*h[1]),p,u;if(c>Ar){let g=this.mid(r,s),_=r[0]-g[0],d=r[1]-g[1],w=2/this.distance(r,s),P=-w*d,M=w*_,R=P*P-M*M,F=2*P*M,H=M*M-P*P,ee=l[0]-g[0],Y=l[1]-g[1];p=g[0]+R*ee+F*Y,u=g[1]+F*ee+H*Y}else p=r[0]+e*(s[0]-r[0]),u=r[1]+e*(s[1]-r[1]);return[p,u]}static getRightMostControlPoint(e,t){let r=t.length,s=t[r-3],o=t[r-2],n=t[r-1],h=this.getBisectorNormals(0,s,o,n)[1],c=this.getNormal(s,o,n),p=Math.sqrt(c[0]*c[0]+c[1]*c[1]),u,g;if(p>Ar){let _=this.mid(o,n),d=n[0]-_[0],T=n[1]-_[1],P=2/this.distance(o,n),M=-P*T,R=P*d,F=M*M-R*R,H=2*M*R,ee=R*R-M*M,Y=h[0]-_[0],B=h[1]-_[1];u=_[0]+F*Y+H*B,g=_[1]+H*Y+ee*B}else u=n[0]+e*(o[0]-n[0]),g=n[1]+e*(o[1]-n[1]);return[u,g]}static getBezierPoints(e){if(e.length<=2)return e;let t=[],r=e.length-1;for(let s=0;s<=1;s+=.01){let o=0,n=0;for(let l=0;l<=r;l++){let h=this.getBinomialFactor(r,l),c=Math.pow(s,l),p=Math.pow(1-s,r-l);o+=h*c*p*e[l][0],n+=h*c*p*e[l][1]}t.push([o,n])}return t.push(e[r]),t}static getBinomialFactor(e,t){return this.getFactorial(e)/(this.getFactorial(t)*this.getFactorial(e-t))}static getFactorial(e){if(e<=1)return 1;if(e===2)return 2;if(e===3)return 6;if(e===4)return 24;if(e===5)return 120;let t=1;for(let r=1;r<=e;r++)t*=r;return t}static getQBSplinePoints(e){if(e.length<=2)return e;let t=2,r=[],s=e.length-t-1;r.push(e[0]);for(let o=0;o<=s;o++)for(let n=0;n<=1;n+=.05){let l=0,h=0;for(let c=0;c<=t;c++){let p=this.getQuadricBSplineFactor(c,n);l+=p*e[o+c][0],h+=p*e[o+c][1]}r.push([l,h])}return r.push(e[e.length-1]),r}static getQuadricBSplineFactor(e,t){return e===0?Math.pow(t-1,2)/2:e===1?(-2*Math.pow(t,2)+2*t+1)/2:e===2?Math.pow(t,2)/2:0}},x=Mr;var Ir=class{constructor(e){this._viewer=e,this._options={}}_setViewerOption(){var e,t,r;return this._viewer.delegate.shadows=(t=(e=this._options)==null?void 0:e.shadows)!=null?t:!1,this._viewer.delegate.resolutionScale=((r=this._options)==null?void 0:r.resolutionScale)||1,this}_setCanvasOption(){return this._options.tabIndex&&this._viewer.scene.canvas.setAttribute("tabIndex",this._options.tabIndex),this}_setSceneOption(){var t,r,s,o,n;let e=this._viewer.scene;return e.skyAtmosphere.show=(t=this._options.showAtmosphere)!=null?t:!0,e.sun.show=(r=this._options.showSun)!=null?r:!0,e.moon.show=(s=this._options.showMoon)!=null?s:!0,e.postProcessStages.fxaa.enabled=(o=this._options.enableFxaa)!=null?o:!1,e.msaaSupported&&(e.msaaSamples=+this._options.msaaSamples||1),e.verticalExaggeration=this._options.verticalExaggeration||1,e.verticalExaggerationRelativeHeight=(n=this._options.verticalExaggerationRelativeHeight)!=null?n:0,this}_setSkyBoxOption(){var t;if(!this._options.skyBox)return this;let e=this._options.skyBox;if(e instanceof i.SkyBox)this._viewer.scene.skyBox=e;else{let r=this._viewer.scene.skyBox;r.show=(t=e.show)!=null?t:!0,e.offsetAngle&&(r.offsetAngle=e.offsetAngle),e!=null&&e.sources&&(r.sources=e.sources)}return this}_setGlobeOption(){var r,s,o,n,l,h,c,p,u,g,_,d;if(!this._options.globe)return this;let e=this._viewer.scene.globe,t=this._options.globe;if(C.merge(e,{show:(r=t==null?void 0:t.show)!=null?r:!0,showGroundAtmosphere:(s=t==null?void 0:t.showGroundAtmosphere)!=null?s:!0,enableLighting:(o=t==null?void 0:t.enableLighting)!=null?o:!1,depthTestAgainstTerrain:(n=t==null?void 0:t.depthTestAgainstTerrain)!=null?n:!1,tileCacheSize:+(t==null?void 0:t.tileCacheSize)||100,preloadSiblings:(l=t==null?void 0:t.preloadSiblings)!=null?l:!1,showSkirts:(h=t==null?void 0:t.showSkirts)!=null?h:!0,baseColor:(t==null?void 0:t.baseColor)||new i.Color(0,0,.5,1)}),C.merge(e.translucency,{enabled:(p=(c=t==null?void 0:t.translucency)==null?void 0:c.enabled)!=null?p:!1,backFaceAlpha:+((u=t==null?void 0:t.translucency)==null?void 0:u.backFaceAlpha)||1,backFaceAlphaByDistance:(g=t==null?void 0:t.translucency)==null?void 0:g.backFaceAlphaByDistance,frontFaceAlpha:+((_=t==null?void 0:t.translucency)==null?void 0:_.frontFaceAlpha)||1,frontFaceAlphaByDistance:(d=t==null?void 0:t.translucency)==null?void 0:d.frontFaceAlphaByDistance}),t!=null&&t.filterColor){let T=this._viewer.scene.globe._surfaceShaderSet.baseFragmentShaderSource,w=T.sources.pop();T.sources.push(w.replace("out_FragColor = finalColor;",`out_FragColor = finalColor * vec4${t.filterColor.toString()};`))}return this}_setCameraController(){var r,s,o,n,l,h,c;if(!((r=this._options)!=null&&r.cameraController))return this;let e=this._viewer.scene.screenSpaceCameraController,t=this._options.cameraController;return C.merge(e,{enableInputs:(s=t==null?void 0:t.enableInputs)!=null?s:!0,enableRotate:(o=t==null?void 0:t.enableRotate)!=null?o:!0,enableTilt:(n=t==null?void 0:t.enableTilt)!=null?n:!0,enableTranslate:(l=t==null?void 0:t.enableTranslate)!=null?l:!0,enableZoom:(h=t==null?void 0:t.enableZoom)!=null?h:!0,enableCollisionDetection:(c=t==null?void 0:t.enableCollisionDetection)!=null?c:!0,minimumZoomDistance:+(t==null?void 0:t.minimumZoomDistance)||1,maximumZoomDistance:+(t==null?void 0:t.maximumZoomDistance)||40489014}),this}setOptions(e){return Object.keys(e).length===0?this:(this._options={...this._options,...e},this._setViewerOption()._setCanvasOption()._setSceneOption()._setSkyBoxOption()._setGlobeOption()._setCameraController(),this)}},Sr=Ir;var Dr=class{constructor(e){this._viewer=e,this._mouseMode=0}setPitchRange(e,t){let r=new i.ScreenSpaceEventHandler(this._viewer.scene.canvas);this._viewer.scene.mode===i.SceneMode.SCENE3D&&(r.setInputAction(s=>{r.setInputAction(o=>{let n=!0,l=o.endPosition.y<o.startPosition.y;l&&this._viewer.camera.pitch>i.Math.toRadians(t)||!l&&this._viewer.camera.pitch<i.Math.toRadians(e)?n=!1:n=!0,this._viewer.scene.screenSpaceCameraController.enableTilt=n},i.ScreenSpaceEventType.MOUSE_MOVE)},this._mouseMode===Pe.LEFT_MIDDLE?i.ScreenSpaceEventType.MIDDLE_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN),r.setInputAction(s=>{this._viewer.scene.screenSpaceCameraController.enableTilt=!0,r.removeInputAction(i.ScreenSpaceEventType.MOUSE_MOVE)},this._mouseMode===Pe.LEFT_MIDDLE?i.ScreenSpaceEventType.MIDDLE_UP:i.ScreenSpaceEventType.RIGHT_UP))}changeMouseMode(e){this._mouseMode=e||Pe.LEFT_MIDDLE,e===Pe.LEFT_MIDDLE?(this._viewer.scene.screenSpaceCameraController.tiltEventTypes=[i.CameraEventType.MIDDLE_DRAG,i.CameraEventType.PINCH,{eventType:i.CameraEventType.LEFT_DRAG,modifier:i.KeyboardEventModifier.CTRL},{eventType:i.CameraEventType.RIGHT_DRAG,modifier:i.KeyboardEventModifier.CTRL}],this._viewer.scene.screenSpaceCameraController.zoomEventTypes=[i.CameraEventType.RIGHT_DRAG,i.CameraEventType.WHEEL,i.CameraEventType.PINCH]):e===Pe.LEFT_RIGHT&&(this._viewer.scene.screenSpaceCameraController.tiltEventTypes=[i.CameraEventType.RIGHT_DRAG,i.CameraEventType.PINCH,{eventType:i.CameraEventType.LEFT_DRAG,modifier:i.KeyboardEventModifier.CTRL},{eventType:i.CameraEventType.RIGHT_DRAG,modifier:i.KeyboardEventModifier.CTRL}],this._viewer.scene.screenSpaceCameraController.zoomEventTypes=[i.CameraEventType.WHEEL,i.CameraEventType.PINCH])}},Lr=Dr;var _g={INITIALIZED:"initialized",ADDED:"added",REMOVED:"removed",CLEARED:"cleared",INSTALLED:"installed",ENABLED:"enabled",DISABLED:"disabled",PLAY:"play",PAUSE:"pause",RESTORE:"restore"},m=_g;var fg={},Rr=fg;var Or=class{constructor(){this._viewer=void 0,this._enable=!1,this._wrapper=void 0,this._ready=!1}set enable(e){this._enable!==e&&(this._enable=e,this._state=this._enable?m.ENABLED:m.DISABLED,this._enableHook&&this._enableHook())}get enable(){return this._enable}get state(){return this._state}_mountContent(){}_bindEvent(){}_unbindEvent(){}_enableHook(){!this._ready&&this._mountContent(),this._enable?(!this._wrapper.parentNode&&this._viewer.widgetContainer.appendChild(this._wrapper),this._bindEvent()):(this._unbindEvent(),this._wrapper.parentNode&&this._viewer.widgetContainer.removeChild(this._wrapper))}_updateWindowCoord(e){}_installHook(){}_getViewerOffset(){return this._viewer?this._viewer.getOffset():{x:0,y:0}}install(e){this._viewer=e,this._installHook&&this._installHook(),this._state=m.INSTALLED}setWrapper(e){return this}setContent(e){if(e&&typeof e=="string")this._wrapper.innerHTML=e;else if(e&&e instanceof Element){for(;this._wrapper.hasChildNodes();)this._wrapper.removeChild(this._wrapper.firstChild);this._wrapper.appendChild(e)}return this}hide(){this._wrapper&&(this._wrapper.style.cssText=`
|
|
2
|
+
visibility:hidden;
|
|
3
|
+
`)}static registerType(e){e&&(Rr[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getWidgetType(e){return Rr[e.toLocaleUpperCase()]||void 0}},S=Or;var kr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget context-menu"),this._ulEl=void 0,this._handler=void 0,this._overlay=void 0,this._position=void 0,this._wgs84Position=void 0,this._surfacePosition=void 0,this._wgs84SurfacePosition=void 0,this._windowPosition=void 0,this._instanceId=void 0,this._config={},this._defaultMenu=[{label:"\u98DE\u5230\u9ED8\u8BA4\u4F4D\u7F6E",callback:()=>{this._viewer.camera.flyHome(1.5)},context:this},{label:"\u53D6\u6D88\u98DE\u884C",callback:()=>{this._viewer.camera.cancelFlight()},context:this}],this._overlayMenu=[],this._state=m.INITIALIZED}get type(){return S.getWidgetType("contextmenu")}set DEFAULT_MENU(e){this._defaultMenu=e}set config(e){this._config=e,e.customClass&&this._setCustomClass()}_installHook(){let e=this;Object.defineProperty(this._viewer,"contextMenu",{get(){return e}}),this._handler=new i.ScreenSpaceEventHandler(this._viewer.canvas)}_bindEvent(){this._handler.setInputAction(e=>{this._onRightClick(e)},i.ScreenSpaceEventType.RIGHT_CLICK),this._handler.setInputAction(e=>{this._onClick(e)},i.ScreenSpaceEventType.LEFT_CLICK)}_unbindEvent(){this._handler.removeInputAction(i.ScreenSpaceEventType.RIGHT_CLICK),this._handler.removeInputAction(i.ScreenSpaceEventType.LEFT_CLICK)}_mountContent(){this._ulEl=I.create("ul","menu-list",this._wrapper),this._ready=!0}_mountMenu(){for(;this._ulEl.hasChildNodes();)this._ulEl.removeChild(this._ulEl.firstChild);this._overlayMenu&&this._overlayMenu.length&&this._overlayMenu.forEach(e=>{this._addMenuItem(e.label,e.callback,e.context||this)}),this._defaultMenu&&this._defaultMenu.length&&this._defaultMenu.forEach(e=>{this._addMenuItem(e.label,e.callback,e.context||this)})}_onRightClick(e){var s;if(!this._enable)return;this._overlay=void 0;let t=this._viewer.scene;this._windowPosition=e.position;let r=t.pick(e.position);if(t.pickPositionSupported&&(this._position=t.pickPosition(e.position)),this._position){let o=i.Ellipsoid.WGS84.cartesianToCartographic(this._position);o&&(this._wgs84Position={lng:i.Math.toDegrees(o.longitude),lat:i.Math.toDegrees(o.latitude),alt:o.height})}if(t.mode===i.SceneMode.SCENE3D){let o=t.camera.getPickRay(e.position);this._surfacePosition=t.globe.pick(o,t)}else this._surfacePosition=t.camera.pickEllipsoid(e.position,i.Ellipsoid.WGS84);if(this._surfacePosition){let o=i.Ellipsoid.WGS84.cartesianToCartographic(this._surfacePosition);o&&(this._wgs84SurfacePosition={lng:i.Math.toDegrees(o.longitude),lat:i.Math.toDegrees(o.latitude),alt:o.height})}if(this._instanceId=r==null?void 0:r.instanceId,(r==null?void 0:r.id)instanceof i.Entity){let o=this._viewer.getLayers().filter(n=>n.layerId===r.id.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.id.overlayId))}else if(r instanceof i.Cesium3DTileFeature){let o=this._viewer.getLayers().filter(n=>n.layerId===r.tileset.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.tileset.overlayId))}else if((r==null?void 0:r.primitive)instanceof i.Cesium3DTileset){let o=this._viewer.getLayers().filter(n=>n.layerId===r.primitive.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.primitive.overlayId))}else if(r!=null&&r.primitive){let o=this._viewer.getLayers().filter(n=>n.layerId===r.primitive.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.primitive.overlayId))}this._overlayMenu=((s=this._overlay)==null?void 0:s.contextMenu)||[],this._mountMenu(),this._updateWindowCoord(e.position)}_onClick(e){this.hide()}_updateWindowCoord(e){let t=this._ulEl.hasChildNodes()?"visible":"hidden",{x:r,y:s}=e,o=this._getViewerOffset();r+=o.x,s+=o.y,this._wrapper.style.cssText=`
|
|
4
|
+
visibility:${t};
|
|
5
|
+
z-index:1;
|
|
6
|
+
transform:translate3d(${Math.round(r)}px,${Math.round(s)}px, 0);
|
|
7
|
+
`}_setCustomClass(){I.setClass(this._wrapper,`dc-context-menu ${this._config.customClass}`)}_addMenuItem(e,t,r){if(!e||!t)return this;let s=I.create("li","menu-item",null),o=I.create("a","",s);o.innerHTML=e,o.href="javascript:void(0)";let n=this;return t&&(o.onclick=()=>{t.call(r,{windowPosition:n._windowPosition,position:n._position,wgs84Position:n._wgs84Position,surfacePosition:n._surfacePosition,wgs84SurfacePosition:n._wgs84SurfacePosition,overlay:n._overlay,instanceId:n._instanceId}),n.hide()}),this._ulEl.appendChild(s),this}};S.registerType("contextmenu");var dl=kr;var Fr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget location-bar"),this._mouseEl=void 0,this._cameraEl=void 0,this._fpsEl=void 0,this._msEl=void 0,this._lastMouseSampleTime=i.getTimestamp(),this._lastCameraSampleTime=i.getTimestamp(),this._lastFpsSampleTime=i.getTimestamp(),this._lastMsSampleTime=i.getTimestamp(),this._fpsFrameCount=0,this._msFrameCount=0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("location_bar")}_installHook(){let e=this;Object.defineProperty(this._viewer,"locationBar",{get(){return e}})}_bindEvent(){this._viewer.on(O.MOUSE_MOVE,this._onMove,this),this._viewer.on(D.CAMERA_CHANGED,this._onCameraChanged,this),this._viewer.on(D.POST_UPDATE,this._onPostUpdate,this)}_unbindEvent(){this._viewer.off(O.MOUSE_MOVE,this._onMove,this),this._viewer.off(D.CAMERA_CHANGED,this._onCameraChanged,this),this._viewer.off(D.POST_UPDATE,this._onPostUpdate,this)}_mountContent(){this._mouseEl=I.create("div","mouse-bar",this._wrapper),this._cameraEl=I.create("div","camera-bar",this._wrapper),this._msEl=I.create("div","ms-bar",this._wrapper),this._fpsEl=I.create("div","fps-bar",this._wrapper),this._ready=!0}_onMove(e){let t=i.getTimestamp();if(t<this._lastMouseSampleTime+300)return;let r=e.wgs84SurfacePosition;this._mouseEl.innerHTML=`
|
|
8
|
+
<span>\u7ECF\u5EA6\uFF1A${(r==null?void 0:r.lng.toFixed(8))||Number.NaN}</span>
|
|
9
|
+
<span>\u7EAC\u5EA6\uFF1A${(r==null?void 0:r.lat.toFixed(8))||Number.NaN}</span>
|
|
10
|
+
<span>\u6D77\u62D4\uFF1A${(r==null?void 0:r.alt.toFixed(2))||Number.NaN} \u7C73</span>`,this._lastMouseSampleTime=t}_onCameraChanged(){let e=i.getTimestamp();if(e<this._lastCameraSampleTime+300)return;let t=this._viewer.cameraPosition;this._cameraEl.innerHTML=`
|
|
11
|
+
<span>\u89C6\u89D2\uFF1A${(+t.pitch).toFixed(2)}</span>
|
|
12
|
+
<span>\u89C6\u9AD8\uFF1A${(+t.alt).toFixed(2)} \u7C73</span>
|
|
13
|
+
`,this._lastCameraSampleTime=e}_onPostUpdate(){let e=i.getTimestamp();this._msFrameCount++;let t=e-this._lastMsSampleTime;if(t>200){let s=(t/this._msFrameCount).toFixed(2);this._msEl.innerHTML=`<span>${s} MS</span>`,this._lastMsSampleTime=e,this._msFrameCount=0}this._fpsFrameCount++;let r=e-this._lastFpsSampleTime;if(r>1e3){let s=this._fpsFrameCount*1e3/r|0;this._fpsEl.innerHTML=`<span>${s} FPS</span>`,this._lastFpsSampleTime=e,this._fpsFrameCount=0}}};S.registerType("location_bar");var ml=Fr;var gg=`
|
|
14
|
+
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAG5ElEQVRoQ+2Yf2xVZxnHP89py9qliPe0BUTqBrunuDEBx8QfcxuwRYcxM3HO7Y8JZUNKTweKmWyaGDBZYtwSMmnvuXRKcEMzt0WmwdllE1nclkgsyUaIUM4ZNmKihfbcDjbCpPc85rT3QG1677ltb5UlPf+e932e7/f5vu/zPO8jfMA/+YDjZ4rA/1vBKQWmFBgWAXOnex0Bu4FPAf8Evu3b1vOFgnTZHKHa1LEVgZTtEoLv9NkLfpMjs03hfMa2VucjcdkQSKTdVkGq/ebk2ghswjmxSMh2+Lb10cufgOO9AHRk7OSTw8Gajqu+beUN9GWjgJnq2qZi3JqxrRURATPtbka5w7etL066AjXprmUaGDdhyCI0WAhyHeAjHFPoMgI9lDWyr/Y3X9udD4yZcg8j2qMiewVZhmpjoeiHdiakgJny6tXQLaJ8FZiTA/auCD2q9IBWozILYdZF0KoHBXb2tTT8fDQiNanjjSpyCxr83W9ZsC0uTY+bQE3Ke1BFtwD14dkVpMNQOk63JL1RgbV13RYYxkqEO0S5AfQPasiOzAZrXxzIkqfR8LwixlaBfYEYT2aar/ld0SC2Hplmzqzch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FQvjeqDIZ14FEk7YWLFUIWwX7hKkPJALKwpNFQoRCXsoUdaANjLUInSKIXsGtGLPO/ZVmZqUt1pFnxKRx/qakw8XG5RRCSRS7mABi/Jv7sGyY+R7IM5JTXvXx4MBY6UIYdtxF1AO+iJq7PFbks9G+4e9B67FYEncK26433wETolQN7wfMR33JSAcMBV8hNc4b9+uol9G9VZgSc7ZKcIBQJZfhK+1kcSjFxno477dEE46iv5GJWA67pHQgoGs6bWThyJrpuN1g14VXbLa9u6PZIPsUgkGbhQxblDkNtArh9ZLN8JvA9U/XlE9fX/P6tnvjYYqehOHE44+27qzaOS5hXkUOL5FRIZaZeUVhDOonkWkH9gAVAJngekjHB5V0b2GUbGvr2newUJgctPnaCrxkm9bq8YKfjBM+TaZjnu3CMtVWQwsC1PppbVyLhfpEwodUPbsQFnl0bNNc+J7pJFzoZjxTByp2DowaGDrgfLaurmLVINz06undXevnXf+Yms95GEckzn+hgZPFzM+LESiOAJ5LAw9cIL1IPcAM3JHrgfhLdDDiswSdDHIoksm9C8Ce3RAnvI3WWfiIhz3f0IEIuOJ9rdnGEFwp6p+BeQaoA50JoRHjT6gV5VODXh+tCwUB3LSFJiI41LtLYkCpQIzHjtTBMYTtVLumVKglNEcj63/AIrz7E/FBbRAAAAAAElFTkSuQmCC
|
|
15
|
+
`,ul=gg;var yg=`
|
|
16
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
17
|
+
<svg width="162px" height="162px" viewBox="0 0 162 162" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
18
|
+
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
|
19
|
+
<title>compass-outer</title>
|
|
20
|
+
<desc>Created with Sketch.</desc>
|
|
21
|
+
<defs></defs>
|
|
22
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill-rule="evenodd">
|
|
23
|
+
<g id="compass-outer" fill-rule="nonzero">
|
|
24
|
+
<path d="M80.8410544,161.682109 C36.1937731,161.682109 0,125.488336 0,80.8410544 C0,36.1937731 36.1937731,0 80.8410544,0 C125.488336,0 161.682109,36.1937731 161.682109,80.8410544 C161.682109,125.488336 125.488336,161.682109 80.8410544,161.682109 Z M81.1836011,134.620909 C110.696211,134.620909 134.620909,110.696211 134.620909,81.1836011 C134.620909,51.6709916 110.696211,27.7462941 81.1836011,27.7462941 C51.6709916,27.7462941 27.7462941,51.6709916 27.7462941,81.1836011 C27.7462941,110.696211 51.6709916,134.620909 81.1836011,134.620909 Z" id="Oval-108"></path>
|
|
25
|
+
<circle id="Oval-74" fill="#FFFFFF" cx="129.493683" cy="127.952092" r="1.54159147"></circle>
|
|
26
|
+
<circle id="Oval-74-Copy-3" fill="#FFFFFF" cx="129.493683" cy="35.4566038" r="1.54159147"></circle>
|
|
27
|
+
<circle id="Oval-74-Copy-5" fill="#FFFFFF" cx="30.8318294" cy="127.952092" r="1.54159147"></circle>
|
|
28
|
+
<circle id="Oval-74-Copy-4" fill="#FFFFFF" cx="30.8318294" cy="35.4566038" r="1.54159147"></circle>
|
|
29
|
+
<polygon id="N" fill="#FFFFFF" points="84.9318072 23.1238721 84.9318072 13.1321362 82.5623385 13.1321362 82.5623385 19.2984646 77.951866 13.1321362 75.7108625 13.1321362 75.7108625 23.1238721 78.0946053 23.1238721 78.0946053 16.9718176 82.6908037 23.1238721"></polygon>
|
|
30
|
+
<polygon id="Line" fill="#FFFFFF" points="143.368007 82.1093476 152.617555 82.1093476 152.617555 81.2993476 143.368007 81.2993476"></polygon>
|
|
31
|
+
<polygon id="Line-Copy-8" fill="#FFFFFF" points="9.24954884 82.1093476 18.4990976 82.1093476 18.4990976 81.2993476 9.24954884 81.2993476"></polygon>
|
|
32
|
+
<polygon id="Line" fill="#FFFFFF" points="81.2993476 143.368007 81.2993476 152.617555 82.1093476 152.617555 82.1093476 143.368007"></polygon>
|
|
33
|
+
</g>
|
|
34
|
+
</g>
|
|
35
|
+
</svg>
|
|
36
|
+
`,_l=yg;var vg=`
|
|
37
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
38
|
+
<svg width="17px" height="17px" viewBox="0 0 17 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
39
|
+
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
|
40
|
+
<title>compass-inner</title>
|
|
41
|
+
<desc>Created with Sketch.</desc>
|
|
42
|
+
<defs></defs>
|
|
43
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill-rule="evenodd">
|
|
44
|
+
<g id="compass-inner" fill-rule="nonzero">
|
|
45
|
+
<path d="M8.5,16.5 C4.081722,16.5 0.5,12.918278 0.5,8.5 C0.5,4.081722 4.081722,0.5 8.5,0.5 C12.918278,0.5 16.5,4.081722 16.5,8.5 C16.5,12.918278 12.918278,16.5 8.5,16.5 Z M8.5,15.5 C12.3659932,15.5 15.5,12.3659932 15.5,8.5 C15.5,4.63400675 12.3659932,1.5 8.5,1.5 C4.63400675,1.5 1.5,4.63400675 1.5,8.5 C1.5,12.3659932 4.63400675,15.5 8.5,15.5 Z" id="Oval-96"></path>
|
|
46
|
+
<path d="M9.92599835,7.09066832 C12.7122872,9.87695712 14.3709388,12.5452228 13.4497471,13.4664145 C12.5285555,14.3876061 9.86028979,12.7289545 7.074001,9.94266568 C4.2877122,7.15637688 2.62906055,4.48811119 3.55025221,3.56691953 C4.47144386,2.64572788 7.13970955,4.30437952 9.92599835,7.09066832 Z M9.21889157,7.7977751 C6.92836458,5.50724811 4.52075769,4.01062761 4.25735899,4.27402631 C3.99396029,4.53742501 5.49058078,6.9450319 7.78110778,9.2355589 C10.0716348,11.5260859 12.4792417,13.0227064 12.7426404,12.7593077 C13.0060391,12.495909 11.5094186,10.0883021 9.21889157,7.7977751 Z" id="Oval-96-Copy-2"></path>
|
|
47
|
+
<path d="M9.92599835,9.94266568 C7.13970955,12.7289545 4.47144386,14.3876061 3.55025221,13.4664145 C2.62906055,12.5452228 4.2877122,9.87695712 7.074001,7.09066832 C9.86028979,4.30437952 12.5285555,2.64572788 13.4497471,3.56691953 C14.3709388,4.48811119 12.7122872,7.15637688 9.92599835,9.94266568 Z M9.21889157,9.2355589 C11.5094186,6.9450319 13.0060391,4.53742501 12.7426404,4.27402631 C12.4792417,4.01062761 10.0716348,5.50724811 7.78110778,7.7977751 C5.49058078,10.0883021 3.99396029,12.495909 4.25735899,12.7593077 C4.52075769,13.0227064 6.92836458,11.5260859 9.21889157,9.2355589 Z" id="Oval-96-Copy-3"></path>
|
|
48
|
+
<path d="M15.1464466,1.1464466 L14.3453364,1.94755684 L13.9608692,2.33202401 L14.667976,3.03913077 L15.0524431,2.65466362 L15.8535534,1.8535534 L15.1464466,1.1464466 Z M2.29760014,13.995293 L1.85311902,14.4397742 L1.004311,15.2885822 L1.71141776,15.995689 L2.56022581,15.146881 L3.00470698,14.7023998 L2.29760014,13.995293 Z" id="Line"></path>
|
|
49
|
+
<circle id="Oval-432" cx="16" cy="1" r="1"></circle>
|
|
50
|
+
<circle id="Oval-432-Copy" cx="1" cy="16" r="1"></circle>
|
|
51
|
+
</g>
|
|
52
|
+
</g>
|
|
53
|
+
</svg>
|
|
54
|
+
`,fl=vg;var wg=`
|
|
55
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
56
|
+
<svg width="53px" height="53px" viewBox="0 0 53 53" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
|
57
|
+
<!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
|
|
58
|
+
<title>compass-rotation-marker</title>
|
|
59
|
+
<desc>Created with Sketch.</desc>
|
|
60
|
+
<defs></defs>
|
|
61
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
62
|
+
<g id="compass-rotation-marker">
|
|
63
|
+
<path d="M52.4399986,26.2199993 C52.4399986,11.7390936 40.7009051,0 26.2199993,0 C11.7390936,0 0,11.7390936 0,26.2199993 C0,40.7009051 11.7390936,52.4399986 26.2199993,52.4399986 C40.7009051,52.4399986 52.4399986,40.7009051 52.4399986,26.2199993 Z" id="rotator" stroke-opacity="0.135841259" stroke="#E2A549" stroke-width="9" opacity="0.201434235"></path>
|
|
64
|
+
<path d="M0,26.2199993 C0,11.7390936 11.7390936,0 26.2199993,0 L26.2199993,9 C16.7096563,9 9,16.7096563 9,26.2199993" id="Shape" opacity="0.634561567" fill="#4990E2"></path>
|
|
65
|
+
</g>
|
|
66
|
+
</g>
|
|
67
|
+
</svg>
|
|
68
|
+
`,gl=wg;var Cg=`
|
|
69
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
70
|
+
<svg width="50px" height="6px" viewBox="0 0 50 6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
|
71
|
+
<!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
|
|
72
|
+
<title>decrease</title>
|
|
73
|
+
<path d="M46.6183575,0.657894737 L3.30112724,0.657894737 C1.44927539,0.657894737 0,1.66880618 0,2.96052632 C0,4.25224645 1.44927539,5.26315789 3.30112724,5.26315789 L46.6988728,5.26315789 C48.5507246,5.26315789 50,4.25224645 50,2.96052632 C49.9194847,1.66880618 48.4702093,0.657894737 46.6183575,0.657894737 L46.6183575,0.657894737 L46.6183575,0.657894737 Z" id="Shape"></path>
|
|
74
|
+
</svg>
|
|
75
|
+
`,yl=Cg;var xg=`
|
|
76
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
77
|
+
<svg width="50px" height="50px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
|
78
|
+
<!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
|
|
79
|
+
<title>increase</title>
|
|
80
|
+
<path d="M0,25 C0,25.3514939 0.131810207,25.659051 0.373462207,25.900703 C0.615114207,26.142355 0.922671379,26.2741652 1.27416517,26.2741652 L23.7258348,26.2741652 L23.7258348,48.7258348 C23.7258348,49.0773286 23.857645,49.3848858 24.099297,49.6265378 C24.3189807,49.8462214 24.6485061,50 25,50 C25.7029877,50 26.2741652,49.4288225 26.2741652,48.7258348 L26.2741652,26.2741652 L48.7258348,26.2741652 C49.4288225,26.2741652 50,25.7029877 50,25 C50,24.2970123 49.4288225,23.7258348 48.7258348,23.7258348 L26.2741652,23.7258348 L26.2741652,1.27416517 C26.2741652,0.571177517 25.7029877,0 25,0 C24.2970123,0 23.7258348,0.571177517 23.7258348,1.27416517 L23.7258348,23.7258348 L1.27416517,23.7258348 C0.571177517,23.7258348 0,24.2970123 0,25 L0,25 L0,25 L0,25 Z" id="Shape"></path>
|
|
81
|
+
</svg>
|
|
82
|
+
`,vl=xg;var Tg=`
|
|
83
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
84
|
+
<svg width="50px" height="50px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
|
85
|
+
<!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
|
|
86
|
+
<title>refresh</title>
|
|
87
|
+
<path d="M48.2758621,0 C47.2844828,0 46.5086207,0.775193846 46.5086207,1.76571923 L46.5086207,12.2308355 C42.0689655,4.78036173 34.0086207,0 25,0 C11.2068965,0 0,11.1972438 0,25.0215332 C0,38.8458226 11.2068965,50 25,50 C38.7931035,50 50,38.8027562 50,25.0215332 C50,24.0310078 49.2241379,23.2558139 48.2327587,23.2558139 C47.2413793,23.2558139 46.4655172,24.0310078 46.4655172,25.0215332 C46.4655172,36.8647717 36.8103448,46.5116279 24.9568965,46.5116279 C13.1034483,46.5116279 3.49137933,36.8217054 3.49137933,24.9784668 C3.49137933,13.1352283 13.1465517,3.48837212 25,3.48837212 C33.4913793,3.48837212 41.0775862,8.44099913 44.5258621,16.0206718 L32.1551724,16.0206718 C31.1637931,16.0206718 30.3879311,16.7958657 30.3879311,17.7863911 C30.3879311,18.7769164 31.1637931,19.5521103 32.1551724,19.5521103 L48.2327587,19.5521103 C49.2241379,19.5521103 50,18.7769164 50,17.7863911 L50,1.72265288 C50,0.775193846 49.2241379,0 48.2758621,0 L48.2758621,0 L48.2758621,0 Z" id="Shape"></path>
|
|
88
|
+
</svg>
|
|
89
|
+
`,wl=Tg;var Eg=`
|
|
90
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
91
|
+
<svg width="19px" height="28px" viewBox="0 0 19 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
92
|
+
<path d="M0.6551724,2.3448276 L0.6551724,25.6551724 C0.6551724,26.6454761 1.4579722,27.4482759 2.4482759,27.4482759 C3.4385796,27.4482759 4.2413793,26.6454761 4.2413793,25.6551724 L4.2413793,2.3448276 C4.2413793,1.3545239 3.4385796,0.5517241 2.4482759,0.5517241 C1.4579722,0.5517241 0.6551724,1.3545239 0.6551724,2.3448276 L0.6551724,2.3448276 Z M7.6551724,2.3448276 L7.6551724,25.6551724 C7.6551724,26.6454761 8.4579722,27.4482759 9.4482759,27.4482759 C10.4385796,27.4482759 11.2413793,26.6454761 11.2413793,25.6551724 L11.2413793,2.3448276 C11.2413793,1.3545239 10.4385796,0.5517241 9.4482759,0.5517241 C8.4579722,0.5517241 7.6551724,1.3545239 7.6551724,2.3448276 L7.6551724,2.3448276 Z M14.6551724,2.3448276 L14.6551724,25.6551724 C14.6551724,26.6454761 15.4579722,27.4482759 16.4482759,27.4482759 C17.4385796,27.4482759 18.2413793,26.6454761 18.2413793,25.6551724 L18.2413793,2.3448276 C18.2413793,1.3545239 17.4385796,0.5517241 16.4482759,0.5517241 C15.4579722,0.5517241 14.6551724,1.3545239 14.6551724,2.3448276 L14.6551724,2.3448276 Z" id="splitter"></path>
|
|
93
|
+
</svg>
|
|
94
|
+
`,Cl=Eg;var Pg={logo:ul,compass_outer:_l,compass_inner:fl,compass_rotation_marker:gl,decrease:yl,increase:vl,refresh:wl,splitter:Cl},re=Pg;var zr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget slider"),this._baseLayer=void 0,this._moveActive=!1,this._state=m.INITIALIZED}get type(){return S.getWidgetType("map_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"mapSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._baseLayer?this._viewer.scene.splitPosition=this._baseLayer.splitDirection>0?1:0:this._viewer.scene.splitPosition=0}_mountContent(){let e=I.parseDom(re.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addBaseLayer(e,t=1){return!this._viewer||!this._enable?this:(e&&(this._baseLayer&&this._viewer.imageryLayers.remove(this._baseLayer),this._baseLayer=this._viewer.imageryLayers.addImageryProvider(e),this._baseLayer.splitDirection=t||0,this._viewer.scene.splitPosition=this._wrapper.offsetLeft/this._wrapper.parentElement.offsetWidth),this)}};S.registerType("map_split");var xl=zr;var Nr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget map-switch"),this._config=void 0,this._cache=[],this._state=m.INITIALIZED}get type(){return S.getWidgetType("map_switch")}_enableHook(){!this._wrapper.parentNode&&this._viewer&&this._viewer.widgetContainer.appendChild(this._wrapper)}_installHook(){let e=this;Object.defineProperty(this._viewer,"mapSwitch",{get(){return e}}),this.enable=!0,this._wrapper.onmouseover=()=>{let t=80,r=5;e._cache.length>0&&(t=e._cache.length*(t+r)-r),this._wrapper.style.width=`${t}px`},this._wrapper.onmouseout=()=>{e._wrapper.style.width="80px"}}_addItem(e){let t=I.create("div","map-item",this._wrapper),r=this._cache.length?this._cache.length-1:0;r===0&&I.addClass(t,"active"),t.setAttribute("data-index",String(r)),t.onclick=o=>{let n=document.getElementsByClassName("map-item active");n&&n.length&&(n[0].className="map-item"),this._viewer&&(o.target.className="map-item active",this._viewer.changeBaseLayer(+o.target.getAttribute("data-index")||0))},e.iconUrl&&(t.style.cssText=`
|
|
95
|
+
background:url(${e.iconUrl});
|
|
96
|
+
`);let s=I.create("span","",t);s.innerHTML=e.name||"\u5730\u56FE"}addMap(e={}){this._enable&&(this._cache.push(e),this._addItem(e),this._cache.length>1&&(this._wrapper.style.visibility="visible"))}};S.registerType("map_switch");var Tl=Nr;var Hr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget popup"),this._config={customClass:""},this._position=void 0,this._offsetX=0,this._offsetY=0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("popup")}set config(e){this._config=e,e.customClass&&this._setCustomClass()}_bindEvent(){if(this._viewer&&this._wrapper){let e=this,t=this._viewer.scene;t.postRender.addEventListener(()=>{if(e._position&&e._enable&&e._updateWindowCoord&&e._wrapper.style.visibility==="visible"){let r=i.SceneTransforms.worldToWindowCoordinates(t,e._position);r&&e._updateWindowCoord(r)}})}}_mountContent(){this._wrapper.style.visibility="hidden"}_installHook(){this.enable=!0,this._bindEvent();let e=this;Object.defineProperty(this._viewer,"popup",{get(){return e}})}_updateWindowCoord(e){let t=e.x-this._wrapper.offsetWidth/2,r=e.y-this._wrapper.offsetHeight;this._config.position==="topleft"?(t=e.x-this._wrapper.offsetWidth,r=e.y-this._wrapper.offsetHeight):this._config.position==="topright"?(t=e.x,r=e.y-this._wrapper.offsetHeight):this._config.position==="bottomleft"?(t=e.x-this._wrapper.offsetWidth,r=e.y):this._config.position==="bottomright"&&(t=e.x,r=e.y),t=t+this._offsetX,r=r+this._offsetY,this._wrapper.style.cssText=`
|
|
97
|
+
visibility:visible;
|
|
98
|
+
z-index:1;
|
|
99
|
+
transform:translate3d(${Math.round(t)}px,${Math.round(r)}px, 0);
|
|
100
|
+
`}_setCustomClass(){I.setClass(this._wrapper,`widget popup ${this._config.customClass}`)}setWrapper(e){return e&&e instanceof Element&&(this._wrapper=e,I.addClass(this._wrapper,"widget popup")),this}setPosition(e,t={x:0,y:0}){return this._position=e,this._offsetX=t.x||0,this._offsetY=t.y||0,this._wrapper&&(this._wrapper.style.cssText=`
|
|
101
|
+
visibility:visible;
|
|
102
|
+
`),this}showAt(e,t,r={x:0,y:0}){return this.setPosition(e,r).setContent(t),this}};S.registerType("popup");var El=Hr;var Wr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget tool-tip"),this._ready=!0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("tooltip")}_installHook(){let e=this;Object.defineProperty(this._viewer,"tooltip",{get(){return e}})}_updateWindowCoord(e){let t=e.x+10,r=e.y-this._wrapper.offsetHeight/2;this._wrapper.style.cssText=`
|
|
103
|
+
visibility:visible;
|
|
104
|
+
z-index:1;
|
|
105
|
+
transform:translate3d(${Math.round(t)}px,${Math.round(r)}px, 0);
|
|
106
|
+
`}showAt(e,t){return this._enable?(e&&this._updateWindowCoord(e),this.setContent(t),this):this}};S.registerType("tooltip");var Pl=Wr;var Gr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget hawkeye-map",null),this._wrapper.setAttribute("id",C.uuid()),this._map=void 0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("hawkeye_map")}_mountContent(){let e=new i.CesiumWidget(this._wrapper,{sceneMode:i.SceneMode.SCENE2D,creditContainer:document.createElement("div"),creditViewport:document.createElement("div"),baseLayer:!1});e.imageryLayers.removeAll(),e.canvas.parentNode.className="viewer-canvas",C.merge(e.scene.screenSpaceCameraController,{enableRotate:!1,enableTranslate:!1,enableZoom:!1,enableTilt:!1,enableLook:!1,maximumZoomDistance:40489014}),this._map=e,this._ready=!0}_bindEvent(){this._viewer.on(D.CAMERA_CHANGED,this._syncMap,this)}_unbindEvent(){this._viewer.off(D.CAMERA_CHANGED,this._syncMap,this)}_installHook(){let e=this;Object.defineProperty(this._viewer,"hawkeyeMap",{get(){return e}}),this._viewer.camera.percentageChanged=.01}_syncMap(){let e=new i.Cartesian2(Math.floor(this._viewer.canvas.clientWidth/2),Math.floor(this._viewer.canvas.clientHeight/2)),t=this._viewer.scene.camera.pickEllipsoid(e);if(!t)return!1;let r=i.Cartesian3.distance(t,this._viewer.scene.camera.positionWC);this._map.scene.camera.lookAt(t,new i.Cartesian3(0,0,r))}addBaseLayer(e){return!this._map||!this._enable?this:(e&&(this._map.imageryLayers.removeAll(),Array.isArray(e)||(e=[e]),e.forEach(t=>{this._map.imageryLayers.add(i.ImageryLayer.fromProviderAsync(t,{}))})),this)}};S.registerType("hawkeye_map");var bl=Gr;var Ur=class extends S{constructor(){super(),this._wrapper=I.create("div","widget compass"),this._compassRectangle=void 0,this._outRing=void 0,this._gyro=void 0,this._rotation_marker=void 0,this._orbitCursorAngle=0,this._orbitCursorOpacity=0,this._orbitLastTimestamp=0,this._orbitFrame=void 0,this._orbitIsLook=!1,this._rotateInitialCursorAngle=void 0,this._rotateFrame=void 0,this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("compass")}_installHook(){let e=this;Object.defineProperty(this._viewer,"compass",{get(){return e}}),this._wrapper.onmousedown=t=>{this._handleMouseDown(t)},this._wrapper.ondblclick=t=>{this._handleDoubleClick(t)}}_bindEvent(){this._viewer.on(D.POST_RENDER,this._postRenderHandler,this)}_unbindEvent(){this._viewer.off(D.POST_RENDER,this._postRenderHandler,this)}_postRenderHandler(){let e=this._viewer.camera.heading;this._outRing&&(this._outRing.style.cssText=`
|
|
107
|
+
transform : rotate(-${e}rad);
|
|
108
|
+
-webkit-transform : rotate(-${e}rad);
|
|
109
|
+
`)}_mountContent(){I.create("div","out-ring-bg",this._wrapper),this._outRing=I.parseDom(re.compass_outer,!0,"out-ring"),this._wrapper.appendChild(this._outRing),this._gyro=I.parseDom(re.compass_inner,!0,"gyro"),this._wrapper.appendChild(this._gyro),this._rotation_marker=I.parseDom(re.compass_rotation_marker,!0,"rotation_marker"),this._wrapper.appendChild(this._rotation_marker),this._rotation_marker.style.visibility="hidden",this._ready=!0}_handleMouseDown(e){if(this._viewer.scene.mode===i.SceneMode.MORPHING)return!0;this._compassRectangle=e.currentTarget.getBoundingClientRect();let r=this._compassRectangle.width/2,s=this._getVector(e),o=i.Cartesian2.magnitude(s)/r;if(o<50/145)this._orbit(s);else if(o<1)this._rotate(s);else return!0}_handleDoubleClick(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs)return!0;if(e.mode===i.SceneMode.COLUMBUS_VIEW&&!r.enableTranslate||(e.mode===i.SceneMode.SCENE3D||e.mode===i.SceneMode.COLUMBUS_VIEW)&&(!r.enableLook||e.mode===i.SceneMode.SCENE3D&&!r.enableRotate))return;let s=this._getCameraFocus(!0);if(!s)return;let o=e.globe.ellipsoid.cartographicToCartesian(t.positionCartographic),n=e.globe.ellipsoid.geodeticSurfaceNormal(s),l=new i.BoundingSphere(s,0);t.flyToBoundingSphere(l,{offset:new i.HeadingPitchRange(0,i.Math.PI_OVER_TWO-i.Cartesian3.angleBetween(n,t.directionWC),i.Cartesian3.distance(o,s)),duration:1.5})}_getCameraFocus(e){let t=new i.Cartesian3,r=this._viewer.scene,s=r.camera;if(r.mode!==i.SceneMode.MORPHING){if(this._viewer.delegate.trackedEntity)t=this._viewer.delegate.trackedEntity.position.getValue(this._viewer.clock.currentTime);else{let o=new i.Ray;o.origin=s.positionWC,o.direction=s.directionWC,t=r.globe.pick(o,r)}if(t){if(r.mode===i.SceneMode.SCENE2D||r.mode===i.SceneMode.COLUMBUS_VIEW){t=s.worldToCameraCoordinatesPoint(t);let o=new i.Cartographic;e&&(t=r.globe.ellipsoid.cartographicToCartesian(r.mapProjection.unproject(t,o)))}else e||(t=s.worldToCameraCoordinatesPoint(t));return t}}}_orbit(e){let t=this._viewer.scene,r=t.screenSpaceCameraController,s=t.camera;if(!(t.mode===i.SceneMode.MORPHING||!r.enableInputs)){switch(t.mode){case i.SceneMode.COLUMBUS_VIEW:if(r.enableLook)break;if(!r.enableTranslate||!r.enableTilt)return;break;case i.SceneMode.SCENE3D:if(r.enableLook)break;if(!r.enableTilt||!r.enableRotate)return;break;case i.SceneMode.SCENE2D:if(!r.enableTranslate)return;break}if(this._mouseMoveHandle=o=>{this._orbitMouseMoveFunction(o)},this._mouseUpHandle=()=>{this._orbitMouseUpFunction()},document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._orbitLastTimestamp=i.getTimestamp(),this._viewer.delegate.trackedEntity)this._orbitFrame=void 0,this._orbitIsLook=!1;else{let o=this._getCameraFocus(!0);o?(this._orbitFrame=i.Transforms.eastNorthUpToFixedFrame(o,t.globe.ellipsoid),this._orbitIsLook=!1):(this._orbitFrame=i.Transforms.eastNorthUpToFixedFrame(s.positionWC,t.globe.ellipsoid),this._orbitIsLook=!0)}this._rotation_marker.style.visibility="visible",this._gyro.className+=" gyro-active",document.addEventListener("mousemove",this._mouseMoveHandle,!1),document.addEventListener("mouseup",this._mouseUpHandle,!1),this._viewer.clock.onTick.addEventListener(this._orbitTickFunction,this),this._updateAngleAndOpacity(e,this._compassRectangle.width)}}_orbitTickFunction(){let e=this._viewer.scene,t=this._viewer.camera,r=i.getTimestamp(),s=r-this._orbitLastTimestamp,o=(this._orbitCursorOpacity-.5)*2.5/1e3,n=s*o,l=this._orbitCursorAngle+i.Math.PI_OVER_TWO,h=Math.cos(l)*n,c=Math.sin(l)*n,p;this._orbitFrame&&(p=i.Matrix4.clone(t.transform),t.lookAtTransform(this._orbitFrame)),e.mode===i.SceneMode.SCENE2D?t.move(new i.Cartesian3(h,c,0),Math.max(e.canvas.clientWidth,e.canvas.clientHeight)/100*t.positionCartographic.height*n):this._orbitIsLook?(t.look(i.Cartesian3.UNIT_Z,-h),t.look(t.right,-c)):(t.rotateLeft(h),t.rotateUp(c)),this._orbitFrame&&p&&t.lookAtTransform(p),this._orbitLastTimestamp=r}_updateAngleAndOpacity(e,t){let r=Math.atan2(-e.y,e.x);this._orbitCursorAngle=i.Math.zeroToTwoPi(r-i.Math.PI_OVER_TWO);let s=i.Cartesian2.magnitude(e),o=t/2,n=Math.min(s/o,1);this._orbitCursorOpacity=.5*n*n+.5,this._rotation_marker.style.cssText=`
|
|
110
|
+
transform: rotate(-${this._orbitCursorAngle}rad);
|
|
111
|
+
opacity: ${this._orbitCursorOpacity}`}_orbitMouseMoveFunction(e){this._updateAngleAndOpacity(this._getVector(e),this._compassRectangle.width)}_orbitMouseUpFunction(){document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._viewer.clock.onTick.removeEventListener(this._orbitTickFunction,this),this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0,this._rotation_marker.style.visibility="hidden",this._gyro.className=this._gyro.className.replace(" gyro-active","")}_rotate(e){let t=this._viewer.scene,r=t.camera,s=t.screenSpaceCameraController;if(t.mode===i.SceneMode.MORPHING||t.mode===i.SceneMode.SCENE2D||!s.enableInputs||!s.enableLook&&(t.mode===i.SceneMode.COLUMBUS_VIEW||t.mode===i.SceneMode.SCENE3D&&!s.enableRotate))return;if(this._mouseMoveHandle=n=>{this._rotateMouseMoveFunction(n)},this._mouseUpHandle=()=>{this._rotateMouseUpFunction()},document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._rotateInitialCursorAngle=Math.atan2(-e.y,e.x),this._viewer.delegate.trackedEntity)this._rotateFrame=void 0;else{let n=this._getCameraFocus(!0);!n||t.mode===i.SceneMode.COLUMBUS_VIEW&&!s.enableLook&&!s.enableTranslate?this._rotateFrame=i.Transforms.eastNorthUpToFixedFrame(r.positionWC,t.globe.ellipsoid):this._rotateFrame=i.Transforms.eastNorthUpToFixedFrame(n,t.globe.ellipsoid)}let o;this._rotateFrame&&(o=i.Matrix4.clone(r.transform),r.lookAtTransform(this._rotateFrame)),this._rotateInitialCameraAngle=-r.heading,this._rotateFrame&&o&&r.lookAtTransform(o),document.addEventListener("mousemove",this._mouseMoveHandle,!1),document.addEventListener("mouseup",this._mouseUpHandle,!1)}_rotateMouseMoveFunction(e){let t=this._viewer.camera,r=this._getVector(e),o=Math.atan2(-r.y,r.x)-this._rotateInitialCursorAngle,n=i.Math.zeroToTwoPi(this._rotateInitialCameraAngle-o),l;this._rotateFrame&&(l=i.Matrix4.clone(t.transform),t.lookAtTransform(this._rotateFrame));let h=-t.heading;t.rotateRight(n-h),this._rotateFrame&&l&&t.lookAtTransform(l)}_rotateMouseUpFunction(){document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0}_getVector(e){let t=this._compassRectangle,r=new i.Cartesian2((t.right-t.left)/2,(t.bottom-t.top)/2),s=new i.Cartesian2(e.clientX-t.left,e.clientY-t.top),o=new i.Cartesian2;return i.Cartesian2.subtract(s,r,o),o}};S.registerType("compass");var Al=Ur;var Ml=new i.EllipsoidGeodesic,ke=[1,2,3,5],Br=[...ke,...ke.map(a=>a*10),...ke.map(a=>a*100),...ke.map(a=>a*1e3),...ke.map(a=>a*1e4),...ke.map(a=>a*1e5),...ke.map(a=>a*1e6)],Vr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget distance-legend"),this._labelEl=void 0,this._scaleBarEl=void 0,this._lastUpdate=i.getTimestamp(),this._state=m.INITIALIZED}get type(){return S.getWidgetType("distance_legend")}_installHook(){let e=this;Object.defineProperty(this._viewer,"distanceLegend",{get(){return e}})}_bindEvent(){this._viewer.on(D.POST_RENDER,this._updateContent,this)}_unbindEvent(){this._viewer.off(D.POST_RENDER,this._updateContent,this)}_updateContent(e,t){let r=i.getTimestamp();if(r<this._lastUpdate+250||!this._labelEl||!this._scaleBarEl)return;this._lastUpdate=r;let s=e.canvas.width,o=e.canvas.height,n=e.camera.getPickRay(new i.Cartesian2(s/2|0,o-1)),l=e.camera.getPickRay(new i.Cartesian2(1+s/2|0,o-1)),h=e.globe.pick(n,e),c=e.globe.pick(l,e);if(!h||!c)return;Ml.setEndPoints(e.globe.ellipsoid.cartesianToCartographic(h),e.globe.ellipsoid.cartesianToCartographic(c));let p=Ml.surfaceDistance,u=100,g=0;for(let _=Br.length-1;_>=0;--_)if(Br[_]/p<u){g=Br[_];break}if(g){this._wrapper.style.visibility="visible",this._labelEl.innerHTML=g>=1e3?`${g/1e3} km`:`${g} m`;let _=g/p|0;this._scaleBarEl.style.cssText=`width: ${_}px; left: ${(125-_)/2}px;`}}_mountContent(){this._labelEl=I.create("div","label",this._wrapper),this._scaleBarEl=I.create("div","scale-bar",this._wrapper),this._wrapper.style.visibility="hidden",this._ready=!0}};S.registerType("distance_legend");var Il=Vr;var jr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget zoom-controller"),this._zoomInEl=void 0,this._zoomOutEl=void 0,this._refreshEl=void 0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("zoom_controller")}_getCameraFocus(e){let t=new i.Ray(e.camera.positionWC,e.camera.directionWC),r=i.IntersectionTests.rayEllipsoid(t,i.Ellipsoid.WGS84);return r?i.Ray.getPoint(t,r.start):i.IntersectionTests.grazingAltitudeLocation(t,i.Ellipsoid.WGS84)}_getCameraPosition(e,t,r){let s=new i.Cartesian3,o=i.Cartesian3.subtract(t,e.position,s),n=i.Cartesian3.multiplyByScalar(o,r,s);return i.Cartesian3.add(e.position,n,s)}_zoomIn(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs||e.mode===i.SceneMode.COLUMBUS_VIEW)return!0;if(e.mode===i.SceneMode.SCENE2D)t.zoomIn(t.positionCartographic.height*.5);else if(e.mode===i.SceneMode.SCENE3D){let s=this._getCameraFocus(e),o=this._getCameraPosition(t,s,1/2);t.flyTo({destination:o,orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},duration:.5,convert:!1})}}_refresh(){this._viewer.camera.flyHome(1.5)}_zoomOut(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs||e.mode===i.SceneMode.COLUMBUS_VIEW)return!0;if(e.mode===i.SceneMode.SCENE2D)t.zoomOut(t.positionCartographic.height);else if(e.mode===i.SceneMode.SCENE3D){let s=this._getCameraFocus(e),o=this._getCameraPosition(t,s,-1);t.flyTo({destination:o,orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},duration:.5,convert:!1})}}_installHook(){let e=this;Object.defineProperty(this._viewer,"zoomController",{get(){return e}})}_mountContent(){this._zoomInEl=I.parseDom(re.increase,!0,"zoom-in"),this._refreshEl=I.parseDom(re.refresh,!0,"refresh"),this._zoomOutEl=I.parseDom(re.decrease,!0,"zoom-out"),this._wrapper.appendChild(this._zoomInEl),this._wrapper.appendChild(this._refreshEl),this._wrapper.appendChild(this._zoomOutEl);let e=this;this._zoomInEl.onclick=()=>{e._zoomIn()},this._refreshEl.onclick=()=>{e._refresh()},this._zoomOutEl.onclick=()=>{e._zoomOut()},this._ready=!0}};S.registerType("zoom_controller");var Sl=jr;var qr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget loading-mask"),this._state=m.INITIALIZED}get type(){return S.getWidgetType("loading_mask")}_installHook(){let e=this;Object.defineProperty(this._viewer,"loadingMask",{get(){return e}})}_mountContent(){let e=I.parseDom(`
|
|
112
|
+
<span></span>
|
|
113
|
+
<span></span>
|
|
114
|
+
<span></span>
|
|
115
|
+
<span></span>
|
|
116
|
+
<span></span>
|
|
117
|
+
`,!0,"loading");this._wrapper.appendChild(e),this._ready=!0}};S.registerType("loading_mask");var Dl=qr;var Zr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget slider"),this._tileset=void 0,this._moveActive=!1,this._state=m.INITIALIZED}get type(){return S.getWidgetType("tileset_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"tilesetSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._tileset?this._viewer.scene.splitPosition=this._tileset.splitDirection>0?1:0:this._viewer.scene.splitPosition=0}_mountContent(){let e=I.parseDom(re.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addTileset(e){return!this._viewer||!this._enable?this:(e&&(this._tileset&&this._viewer.scene.primitives.remove(this._tileset),this._tileset=this._viewer.scene.primitives.add(e.delegate||e),this._viewer.scene.splitPosition=this._wrapper.offsetLeft/this._wrapper.parentElement.offsetWidth),this)}};S.registerType("tileset_split");var Ll=Zr;var Yr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget slider"),this._tileset=void 0,this._baseLayer=void 0,this._moveActive=!1,this._state=m.INITIALIZED}get type(){return S.getWidgetType("scene_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"sceneSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._viewer.scene.splitPosition=1}_mountContent(){let e=I.parseDom(re.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addTileset(e){return!this._viewer||!this._enable?this:(e&&(this._tileset&&this._viewer.scene.primitives.remove(this._tileset),Promise.resolve(e.delegate||e).then(t=>{this._tileset=this._viewer.scene.primitives.add(t)})),this)}addBaseLayer(e){return!this._viewer||!this._enable?this:(e&&(this._baseLayer&&this._viewer.imageryLayers.remove(this._baseLayer),Promise.resolve(e).then(t=>{this._baseLayer=this._viewer.imageryLayers.addImageryProvider(t),this._baseLayer.splitDirection=1})),this)}};S.registerType("scene_split");var Rl=Yr;function Xr(){return{popup:new El,contextMenu:new dl,tooltip:new Pl,mapSwitch:new Tl,mapSplit:new xl,locationBar:new ml,hawkeyeMap:new bl,compass:new Al,distanceLegend:new Il,zoomController:new Sl,loadingMask:new Dl,tilesetSplit:new Ll,sceneSplit:new Rl}}var We="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAACCklEQVQ4jWP8//8/Ax5gwMDAIACVfgDF2AHIIDSs8Of+8x3/vv/88ffFu++/jl75/evEte//vnz//e/Dl3d/nrye8P//fwF0fSicv28/Vv7/////t8W7/79Wi///gt0DBb9zLfv/89Cl/3/fff7w//9/A2S9cK/9//i1g4GZqeSdcwnzn4v38HmXgSs3gIGnKfEXIyebOQMDwwWQGMwgh/9fvu8hxhAY4Ix1ZeCdnPOTkYNNgoGB4QMT2DWfv6/50riIaENA4Pvi3Qy/T99k//v0TQOIDzLI4P/nb/zfJm8g2hAY+Nq8hIFJmC8DbNDfp28Sfqw7zEKyKQwMDL8OXQKFLShsDJgYmRhN/j58SY45YPDn1hMOUFpjYmBj5aHEIBhg+vvw5QVWPWWyDWBkY/kBoplYjVQPsOgrkWeIADcDq7kmyGsXQLG2gd3XkoFZXpxkg7hzAhn+3nl6HpaOPvx79X4+35xikgwBWcxVEPSXWUW6iAGajhiYxASLWLTkHxNrGMhLAmsb/v57+2klAwPDAbAYUjEi8O/tp0t/rj2U/ZTSy4ArJtns9Bj4F5T9YWBk2M4kKewHNxytPBL49+p9H5OYYOLPzcfBCQ6WbUAGsAdY/2VWkfrz/+PXIiZxwWkorsRRsCn8e/cp8v+nb/aMvFygTMnw/8v3q8zy4rsZGBgWYKhmYGAAAN6EGE9igaT+AAAAAElFTkSuQmCC";var Dt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAAB+klEQVQ4jZ2UT2gTQRTGv5nd7G7TsNnW1QimWC+CghBEqJ7sSTx50oM3iwhejSJ486J4qdWLt6JXsQdPVdRDj0WQBqEehKJotLbEbrLNJvtnZlYmZEub1rLJB8Mw8+b9Zt7Me0PiOMY+KgGwuubv3ba3JKinjUfBj7dC+D6L1tt+82Pke5/agnsRZ+4GC38/iePY6vXbcSLBnXtUGXnYdObQWJ8BC6s7NjeGzyJfuAXNONGgSn4SQCWxbYEE33xECL3zZ+WyEvpf9gsXpn0dVuFuSKgxkcAS0GQsvA9pIIlyI1cweuRBQIh+GECddk4jvLn62nRqiFTTeYWgtaTzaPW+HEtQKeabebc2mxqSqLE2A6qO3uyAeLR6rdWYV/umAPC9RQjuyrspUYCeYVE1hdveioIVQ+YaJSST633mQURZ9KuiDZ0cGECI5sueakOnFjLGYCCqmNCzp2VoFflqr7PmBahasW+QTEwWfFtK8qjOWe35geJ0XxC5sWnf4Kp+rIxuHkFR7bKmH/+ZFiZDOnR0lnPmvASwIOe2F60l2MbnMPg69rd6e1fBJpKFa489ZQB5o2QKl5L53v/I4qz2WFHtqZb7DoG3iLC93DEYuXPImhdlKExwt6yoB59td/zfxzYuuHNV8OZ5SodlUUKI1rKqFd8DeLFrNYB/A6b1Qz9EzRMAAAAASUVORK5CYII=";var Mg={icon_center:Dt,icon_anchor:We,icon_size:[12,12],clampToModel:!1,maxAnchorSize:999},Jr=class{constructor(){this._viewer=void 0,this._anchorLayer=new i.CustomDataSource("draw-anchor-layer"),this._floatingAnchor=void 0,this._options={},this._plotEvent=new nt,this._tooltipMess=void 0}set tooltipMess(e){this._tooltipMess=e}_getEventPosition(e){return this._options.clampToModel&&e.position?e.position:e.surfacePosition}_onClick(e){let t=this._getEventPosition(e);if(!t)return!1;this._floatingAnchor||(this._floatingAnchor=this._onCreateAnchor({position:t})),this._plotEvent.fire(E.DRAW_ANCHOR,t)}_onMouseMove(e){this._viewer.tooltip.showAt(e.windowPosition,this._tooltipMess);let t=this._getEventPosition(e);if(!t)return!1;this._floatingAnchor&&this._floatingAnchor.position.setValue(t),this._plotEvent.fire(E.ANCHOR_MOVING,t)}_onRightClick(e){this._plotEvent.fire(E.DRAW_STOP,this._getEventPosition(e))}_onCreateAnchor({position:e,isCenter:t=!1}){var r;return this._anchorLayer.entities.add({position:e,billboard:{image:t?this._options.icon_center:this._options.icon_anchor,width:this._options.icon_size[0],height:this._options.icon_size[1],pixelOffset:this._options.pixelOffset||new i.Cartesian2(0,0),eyeOffset:this._options.eyeOffset||new i.Cartesian3(0,0,-100),disableDepthTestDistance:(r=this._options.disableDepthTestDistance)!=null?r:0,heightReference:this._viewer.scene.mode===i.SceneMode.SCENE3D&&!this._options.clampToModel?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE}})}_onClearAnchor(){this._anchorLayer.entities.removeAll()}_bindEvent(){this._viewer.on(O.CLICK,this._onClick,this),this._viewer.on(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.on(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.on(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.on(E.CLEAR_ANCHOR,this._onClearAnchor,this)}_unbindEvent(){this._viewer.off(O.CLICK,this._onClick,this),this._viewer.off(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.off(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.off(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.off(E.CLEAR_ANCHOR,this._onClearAnchor,this)}on(e,t,r){return this._plotEvent.on(e,t,r||this),this}off(e,t,r){return this._plotEvent.off(e,t,r||this),this}fire(e,t={}){return this._plotEvent.fire(e,t),this}activate(e={}){return this._viewer.tooltip.enable=!0,this._options={...Mg,...e},this._unbindEvent(),this._bindEvent(),this.fire(E.DRAW_START,this._options),this}deactivate(){return this._unbindEvent(),this._viewer.tooltip.enable=!1,this._anchorLayer.entities.removeAll(),this._floatingAnchor=void 0,this}install(e){this._viewer=e,this._viewer.dataSources.add(this._anchorLayer),Object.defineProperty(this._viewer,"drawTool",{value:this,writable:!1})}},Ol=Jr;var kl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAACDElEQVQ4jWP8//8/Ax5gwMDAIACVfgDF2AHIIDSscO/l7x3ff/378fz9n++Hr//4fezmz+9ffvz7/eHr33eP3/6Z8P//fwF0fSguevv5X6UwL1PbwoNfGRrWfGJ48PoPiuUOWuwMDSH8DHryrB8FuZkcGBgYLsDk4AZ9/Pavg5mJscS24SXzhQe/8XmXocCLl6Etgv8XJxujOcwwmEEOX37830OMITCQYM/NMD1F8CcHK6MEAwPDByaQ+Ofv/9fUrvpItCEgsODgV4aTt3+xP3n3twHEBxlk8On7P/4J2z4TbQgMNKz5yCDCy5QBNujJu78Ja05+YyHZFAYGhgPXfjJ8+PoPFDYGTEyMDCYPXv8lxxwwuPnsDwcorTGxsTDyoEczOYDp4es/Fwzk2cg2gI2F8QeIZjJWYjtgoMBKliEC3EwMlmpsIK9dAMXaBn8TTgYFUdLDu8CTl+H2iz/nYenow8uPf+cvyBQiyRCQxcU+vH9VJViKGKDpiEGcn7lIW5b1MbGGgby0qVTk75vPf1eCUgFIDDnTCrz5/O/S1ce/ZROmv8PIsDAAyrhLcoT/MDIybJcSZPaDiaOXRwIvP/7tE+dnTtx45js4wV148Ass4aDFwRBkxvlXVZLlz4ev/4okBJinIWvEVbApvP38L/LT93/2vJxMoEzJ8OXHv6sKoiy7QdkMQzUDAwMAuq71NKWtMMgAAAAASUVORK5CYII=";var Sg={icon_center:Dt,icon_anchor:We,icon_midAnchor:kl,icon_size:[12,12],clampToModel:!0},Kr=class{constructor(){this._viewer=void 0,this._anchorLayer=new i.CustomDataSource("edit-anchor-layer"),this._options={},this._plotEvent=new nt,this._tooltipMess=void 0,this._pickedAnchor=void 0,this._isMoving=!1,this._anchors=[]}set tooltipMess(e){this._tooltipMess=e}_onClick(e){if(this._isMoving){let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;if(!t)return!1;this._pickedAnchor&&this._pickedAnchor.position&&this._pickedAnchor.properties&&(this._pickedAnchor.position.setValue(t),this._plotEvent.fire(E.EDIT_ANCHOR_STOP,{pickedAnchor:this._pickedAnchor,position:t})),this._isMoving=!1}else{if(!e.target||!e.target.id)return!1;this._pickedAnchor=e.target.id,this._isMoving=!0}}_onMouseMove(e){if(this._viewer.tooltip.showAt(e.windowPosition,this._tooltipMess),!this._isMoving&&this._anchors.length!==0)return!1;let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;if(!t)return!1;this._pickedAnchor&&this._pickedAnchor.position&&this._pickedAnchor.properties?(this._pickedAnchor.position.setValue(t),this._plotEvent.fire(E.ANCHOR_MOVING,{pickedAnchor:this._pickedAnchor,position:t})):this._anchors.length===0&&this._plotEvent.fire(E.ANCHOR_MOVING,{position:t})}_onRightClick(e){let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;this._plotEvent.fire(E.EDIT_STOP,{pickedAnchor:this._pickedAnchor,position:t})}_onCreateAnchor({position:e,index:t,isCenter:r=!1,isMid:s=!1}){var l;let o=s?this._options.icon_midAnchor:r?this._options.icon_center:this._options.icon_anchor,n=this._anchorLayer.entities.add({position:e,billboard:{image:o,width:this._options.icon_size[0],height:this._options.icon_size[1],pixelOffset:this._options.pixelOffset||new i.Cartesian2(0,0),eyeOffset:this._options.eyeOffset||new i.Cartesian3(0,0,-100),disableDepthTestDistance:(l=this._options.disableDepthTestDistance)!=null?l:0,heightReference:this._viewer.scene.mode===i.SceneMode.SCENE3D&&!this._options.clampToModel?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},properties:{isMid:s,index:t}});this._anchors.push(n)}_onUpdateAnchor({index:e,position:t}){this._anchors[e]&&this._anchors[e].position.setValue(t)}_onClearAnchor(){this._anchorLayer.entities.removeAll(),this._anchors=[]}_bindEvent(){this._viewer.on(O.CLICK,this._onClick,this),this._viewer.on(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.on(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.on(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.on(E.UPDATE_ANCHOR,this._onUpdateAnchor,this),this._plotEvent.on(E.CLEAR_ANCHOR,this._onClearAnchor,this)}_unbindEvent(){this._viewer.off(O.CLICK,this._onClick,this),this._viewer.off(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.off(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.off(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.off(E.UPDATE_ANCHOR,this._onUpdateAnchor,this),this._plotEvent.off(E.CLEAR_ANCHOR,this._onClearAnchor,this)}on(e,t,r){return this._plotEvent.on(e,t,r||this),this}off(e,t,r){return this._plotEvent.off(e,t,r||this),this}fire(e,t){return this._plotEvent.fire(e,t),this}activate(e={}){return this._anchorLayer.entities.removeAll(),this._anchors=[],this._viewer.tooltip.enable=!0,this._options={...Sg,...e},this._unbindEvent(),this._bindEvent(),this.fire(E.EDIT_START,this._options),this}deactivate(){return this._unbindEvent(),this._viewer.tooltip.enable=!1,this._anchorLayer.entities.removeAll(),this._anchors=[],this}install(e){this._viewer=e,this._viewer.dataSources.add(this._anchorLayer),Object.defineProperty(this._viewer,"editTool",{value:this,writable:!1})}},Fl=Kr;function Qr(){return{drawTool:new Ol,editTool:new Fl}}var{ImageryLayer:Dg}=i,$r=class{constructor(e){if(!e.globe)throw new Error("globe is required");this._globe=e.globe,this._imageryLayers=[],this._selectedImageryLayer=void 0,this._count=0}set selectedImageryLayer(e){if((!e||!e.layers)&&new Error("imagery format error"),!(this._selectedImageryLayer&&e.id===this._selectedImageryLayer.id)){if(this._selectedImageryLayer&&e.id!==this._selectedImageryLayer.id){for(let t=0;t<this._selectedImageryLayer.cache.length;t++)this._globe.imageryLayers.remove(this._selectedImageryLayer.cache[t]);e.cache=[]}for(let t=e.layers.length-1;t>=0;t--){let r=e.layers[t],s=Dg.fromProviderAsync(r,e.options);r&&this._globe.imageryLayers.add(s,0),e.cache.push(s)}this._selectedImageryLayer=e}}get selectedImageryLayer(){return this._selectedImageryLayer}addImageryLayer(e,t={}){let r=[];return Array.isArray(e)?r=e.slice(0):r=[e],this._count++,this._imageryLayers.push({id:`imagery-no-${this._count}`,layers:r,cache:[],options:t}),this}changeImageryLayer(e){if(e>this._imageryLayers.length-1)throw new Error("index error");return this.selectedImageryLayer=this._imageryLayers[e],this}},es=$r;var{BoxGeometry:zl,Cartesian3:Lg,defined:fe,DeveloperError:Nl,GeometryPipeline:Rg,Matrix3:Hl,Matrix4:ts,Transforms:Og,VertexFormat:kg,BufferUsage:Fg,CubeMap:zg,loadCubeMap:Ng,RenderState:Hg,VertexArray:Wg,BlendingState:Gg,SceneMode:Wl,ShaderProgram:Ug,ShaderSource:Bg,SkyBox:Vg}=i,jg=`
|
|
118
|
+
uniform samplerCube u_cubeMap;
|
|
119
|
+
in vec3 v_texCoord;
|
|
120
|
+
void main()
|
|
121
|
+
{
|
|
122
|
+
vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
|
|
123
|
+
out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
|
|
124
|
+
}
|
|
125
|
+
`,qg=`
|
|
126
|
+
in vec3 position;
|
|
127
|
+
out vec3 v_texCoord;
|
|
128
|
+
uniform mat3 u_rotateMatrix;
|
|
129
|
+
void main()
|
|
130
|
+
{
|
|
131
|
+
vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
|
|
132
|
+
gl_Position = czm_projection * vec4(p, 1.0);
|
|
133
|
+
v_texCoord = position.xyz;
|
|
134
|
+
}
|
|
135
|
+
`,is=class extends Vg{constructor(e={}){super(e),this.offsetAngle=(e==null?void 0:e.offsetAngle)||0}update(e,t){let r=this;if(!this.show||e.mode!==Wl.SCENE3D&&e.mode!==Wl.MORPHING||!e.passes.render)return;let s=e.context;if(this._sources!==this.sources){this._sources=this.sources;let n=this.sources;if(!fe(n.positiveX)||!fe(n.negativeX)||!fe(n.positiveY)||!fe(n.negativeY)||!fe(n.positiveZ)||!fe(n.negativeZ))throw new Nl("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof n.positiveX!=typeof n.negativeX||typeof n.positiveX!=typeof n.positiveY||typeof n.positiveX!=typeof n.negativeY||typeof n.positiveX!=typeof n.positiveZ||typeof n.positiveX!=typeof n.negativeZ)throw new Nl("this.sources properties must all be the same type.");typeof n.positiveX=="string"?Ng(s,this._sources).then(function(l){r._cubeMap=r._cubeMap&&r._cubeMap.destroy(),r._cubeMap=l}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new zg({context:s,source:n}))}let o=this._command;if(o.modelMatrix=Og.eastNorthUpToFixedFrame(e.camera.positionWC),this.offsetAngle!==0&&ts.multiply(o.modelMatrix,ts.fromRotationTranslation(Hl.fromRotationZ(this.offsetAngle/180*Math.PI)),o.modelMatrix),!fe(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return r._cubeMap},u_rotateMatrix:function(){return ts.getMatrix3(o.modelMatrix,new Hl)}};let n=zl.createGeometry(zl.fromDimensions({dimensions:new Lg(2,2,2),vertexFormat:kg.POSITION_ONLY})),l=this._attributeLocations=Rg.createAttributeLocations(n);o.vertexArray=Wg.fromGeometry({context:s,geometry:n,attributeLocations:l,bufferUsage:Fg._DRAW}),o.renderState=Hg.fromCache({blending:Gg.ALPHA_BLEND})}if(!fe(o.shaderProgram)||this._useHdr!==t){let n=new Bg({defines:[t?"HDR":""],sources:[jg]});o.shaderProgram=Ug.fromCache({context:s,vertexShaderSource:qg,fragmentShaderSource:n,attributeLocations:this._attributeLocations}),this._useHdr=t}if(fe(this._cubeMap))return o}},Gl=is;var Zg={creditContainer:document.createElement("div"),creditViewport:document.createElement("div"),baseLayer:!1,shouldAnimate:!0},rs=class{constructor(e,t={}){if(__cmdOut&&__cmdOut(),!e||typeof e=="string"&&!document.getElementById(e))throw new Error("Viewer: the container is empty");if(e instanceof HTMLElement)throw new Error("Viewer: not support the type container");if(typeof e=="string"){let o=Zi("baseUrl");o&&i.buildModuleUrl.setBaseUrl(o)}this._delegate=typeof e!="string"?e:new i.CesiumWidget(e,{...Zg,...t}),this._delegate.canvas.parentNode.className="viewer-canvas",new sr(this,t),this._viewerEvent=new ar,this._sceneEvent=new lr(this),this._viewerOption=new Sr(this),this._cameraOption=new Lr(this),this._widgetContainer=I.create("div","viewer-widgets",typeof e=="string"?document.getElementById(e):this._delegate.container),this._layerContainer=I.create("div","viewer-layers",typeof e=="string"?document.getElementById(e):this._delegate.container),this._baseLayerPicker=new es({globe:this._delegate.scene.globe}),this._layerGroupCache={},this._layerCache={};let r=Xr();Object.keys(r).forEach(o=>{this._use(r[o])});let s=Qr();Object.keys(s).forEach(o=>{this._use(s[o])})}get delegate(){return this._delegate}get container(){return this._delegate.container}get widgetContainer(){return this._widgetContainer}get layerContainer(){return this._layerContainer}get scene(){return this._delegate.scene}get camera(){return this._delegate.camera}get canvas(){return this._delegate.scene.canvas}get dataSources(){return this._delegate.dataSources}get imageryLayers(){return this._delegate.imageryLayers}get terrainProvider(){return this._delegate.terrainProvider}get entities(){return this._delegate.entities}get postProcessStages(){return this._delegate.scene.postProcessStages}get clock(){return this._delegate.clock}get viewerEvent(){return this._viewerEvent}get cameraPosition(){var t,r,s,o,n,l,h;let e=f.transformCartographicToWGS84((t=this.camera)==null?void 0:t.positionCartographic);return e&&(e.heading=i.Math.toDegrees((s=(r=this.camera)==null?void 0:r.heading)!=null?s:0),e.pitch=i.Math.toDegrees((n=(o=this.camera)==null?void 0:o.pitch)!=null?n:0),e.roll=i.Math.toDegrees((h=(l=this.camera)==null?void 0:l.roll)!=null?h:0)),e}get resolution(){let e=this.scene.canvas.width,t=this.scene.canvas.height,r=f.transformWindowToWGS84(new i.Cartesian2(e/2|0,t-1),this),s=f.transformWindowToWGS84(new i.Cartesian2(1+e/2|0,t-1),this);return!r||!s?1:Math.abs(r.lng-s.lng)}get viewBounds(){let e=this.scene.canvas.width,t=this.scene.canvas.height,r=f.transformWindowToWGS84(new i.Cartesian2(0,t),this),s=f.transformWindowToWGS84(new i.Cartesian2(e,0),this);return!r||!s?i.Rectangle.MAX_VALUE:i.Rectangle.fromDegrees(r.lng,r.lat,s.lng,s.lat)}get zoom(){let e=this.camera.positionCartographic.height,t=40487.57,r=7096758e-11,s=91610.74,o=-40467.74;return Math.round(o+(t-o)/(1+Math.pow(e/s,r)))}_use(e){return e&&e.install&&e.install(this),this}_addLayerGroup(e){e!=null&&e.layerGroupEvent&&!Object(this._layerGroupCache).hasOwnProperty(e.id)&&(e.layerGroupEvent.fire(Te.ADD,this),this._layerGroupCache[e.id]=e)}_removeLayerGroup(e){e!=null&&e.layerGroupEvent&&Object(this._layerGroupCache).hasOwnProperty(e.id)&&(e.layerGroupEvent.fire(Te.REMOVE,this),delete this._layerGroupCache[e.id])}_addLayer(e){!this._layerCache[e.type]&&(this._layerCache[e.type]={}),Object(this._layerCache[e.type]).hasOwnProperty(e.id)||(e.fire(Ee.ADD,this),this._layerCache[e.type][e.id]=e)}_removeLayer(e){Object(this._layerCache[e.type]).hasOwnProperty(e.id)&&(e.fire(Ee.REMOVE,this),delete this._layerCache[e.type][e.id])}setOptions(e){return this._viewerOption.setOptions(e),this}setPitchRange(e=-90,t=-20){return this._cameraOption.setPitchRange(e,t),this}changeSceneMode(e,t=0){return e===2?this._delegate.scene.morphTo2D(t):e===3?this._delegate.scene.morphTo3D(t):e===2.5&&this._delegate.scene.morphToColumbusView(t),this}changeMouseMode(e){return this._cameraOption.changeMouseMode(e),this}setTerrain(e){return this._delegate.scene.setTerrain(new i.Terrain(e||Promise.resolve(new i.EllipsoidTerrainProvider))),this}addBaseLayer(e,t={}){return e?(this._baseLayerPicker.addImageryLayer(e,t),this._baseLayerPicker.selectedImageryLayer||this._baseLayerPicker.changeImageryLayer(0),this.mapSwitch&&this.mapSwitch.addMap(t),this):this}changeBaseLayer(e){return this._baseLayerPicker.changeImageryLayer(e),this}getImageryLayerInfo(e){let t=this._delegate.camera.getPickRay(e);return this._delegate.imageryLayers.pickImageryLayerFeatures(t,this._delegate.scene)}addLayerGroup(e){return this._addLayerGroup(e),this}removeLayerGroup(e){return this._removeLayerGroup(e),this}getLayerGroup(e){return this._layerGroupCache[e]||void 0}addLayer(e){return this._addLayer(e),this}removeLayer(e){return this._removeLayer(e),this}hasLayer(e){return Object(this._layerCache[e.type]).hasOwnProperty(e.id)}getLayer(e){let t=this.getLayers().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}getLayers(){let e=[];return Object.keys(this._layerCache).forEach(t=>{let r=this._layerCache[t];Object.keys(r).forEach(s=>{e.push(r[s])})}),e}eachLayer(e,t){return Object.keys(this._layerCache).forEach(r=>{let s=this._layerCache[r];Object.keys(s).forEach(o=>{e.call(t,s[o])})}),this}flyTo(e,t){return this._delegate.flyTo((e==null?void 0:e.delegate)||e,{duration:t}),this}zoomTo(e){return this._delegate.zoomTo((e==null?void 0:e.delegate)||e),this}flyToPosition(e,t,r){return e=y.parsePosition(e),this.camera.flyTo({destination:f.transformWGS84ToCartesian(e),orientation:{heading:i.Math.toRadians(e.heading),pitch:i.Math.toRadians(e.pitch),roll:i.Math.toRadians(e.roll)},complete:t,duration:r}),this}zoomToPosition(e,t){return this.flyToPosition(e,t,0),this}flyToBounds(e,{heading:t=0,pitch:r=0,roll:s=0},o,n){return e?(Array.isArray(e)||(e=e.split(",")),this.camera.flyTo({destination:i.Rectangle.fromDegrees(e[0],e[1],e[2],e[3]),orientation:{heading:i.Math.toRadians(t),pitch:i.Math.toRadians(r),roll:i.Math.toRadians(s)},complete:o,duration:n}),this):this}zoomToBounds(e,{heading:t=0,pitch:r=0,roll:s=0},o){return this.flyToBounds(e,{heading:t,pitch:r,roll:s},o),this}on(e,t,r){return this._viewerEvent.on(e,t,r||this),this._sceneEvent.on(e,t,r||this),this}once(e,t,r){return this._viewerEvent.once(e,t,r||this),this}off(e,t,r){return this._viewerEvent.off(e,t,r||this),this._sceneEvent.off(e,t,r||this),this}destroy(){return Object.keys(this._layerCache).forEach(e=>{let t=this._layerCache[e];Object.keys(t).forEach(r=>{this._removeLayer(t[r])})}),this._delegate.destroy(),this._delegate=void 0,this._baseLayerPicker=void 0,this._layerCache={},this._widgetContainer.parentNode.removeChild(this._widgetContainer),this._widgetContainer=void 0,this._layerContainer.parentNode.removeChild(this._layerContainer),this._layerContainer=void 0,this}exportScene(e){this.scene.render();let r=this.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),s=document.createElement("a"),o=C.dataURLtoBlob(r),n=URL.createObjectURL(o);return s.download=`${e||"scene"}.png`,s.href=n,s.click(),this}getOffset(){var r;let e={x:0,y:0},t=(r=this._delegate)==null?void 0:r.container;if(t)if(t.getBoundingClientRect){let s=t.getBoundingClientRect();e.x=s.left,e.y=s.top}else e.x=t.offsetLeft,e.y=t.offsetTop;return e}resize(){return this._delegate.resize(),this}},Yg=rs;var Xg={ARCGIS:"arcgis",BING:"bing",OSM:"osm",SINGLE_TILE:"single_tile",WMS:"wms",WMTS:"wmts",XYZ:"xyz",COORD:"coord",GRID:"grid",MAPBOX:"mapbox",MAPBOX_STYLE:"mapbox_style",TMS:"tms"},k=Xg;var ss=class extends i.WebMercatorTilingScheme{constructor(e){super(e);let t=new i.WebMercatorProjection;this._projection.project=function(r,s){return s=me.WGS84ToGCJ02(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude)),s=t.project(new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))),new i.Cartesian2(s.x,s.y)},this._projection.unproject=function(r,s){let o=t.unproject(r);return s=me.GCJ02ToWGS84(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude)),new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))}}},Lt=ss;var Ul={img:"//webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",elec:"//webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",cva:"//webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"},os=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Ul[e.style]||Ul.elec].join(""),e.subdomains=e.subdomains||["01","02","03","04"],e.crs==="WGS84"&&(e.tilingScheme=new Lt),super(e)}};k.AMAP="amap";var Bl=os;var Jg=637099681e-2,Vl=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],Rt=[75,60,45,30,15,0],Kg=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],jl=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],as=class{constructor(){this.isWgs84=!1}getDistanceByMC(e,t){if(!e||!t||(e=this.convertMC2LL(e),!e))return 0;let r=this.toRadians(e.lng),s=this.toRadians(e.lat);if(t=this.convertMC2LL(t),!t)return 0;let o=this.toRadians(t.lng),n=this.toRadians(t.lat);return this.getDistance(r,o,s,n)}getDistanceByLL(e,t){if(!e||!t)return 0;e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74),t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74);let r=this.toRadians(e.lng),s=this.toRadians(e.lat),o=this.toRadians(t.lng),n=this.toRadians(t.lat);return this.getDistance(r,o,s,n)}convertMC2LL(e){if(!e)return{lng:0,lat:0};let t={};if(this.isWgs84){t.lng=e.lng/2003750834e-2*180;let o=e.lat/2003750834e-2*180;return t.lat=180/Math.PI*(2*Math.atan(Math.exp(o*Math.PI/180))-Math.PI/2),{lng:t.lng.toFixed(6),lat:t.lat.toFixed(6)}}let r={lng:Math.abs(e.lng),lat:Math.abs(e.lat)},s;for(let o=0;o<Vl.length;o++)if(r.lat>=Vl[o]){s=Kg[o];break}return t=this.convertor(e,s),{lng:t.lng.toFixed(6),lat:t.lat.toFixed(6)}}convertLL2MC(e){if(!e)return{lng:0,lat:0};if(e.lng>180||e.lng<-180||e.lat>90||e.lat<-90)return e;if(this.isWgs84){let o={},n=6378137;o.lng=e.lng*Math.PI/180*n;let l=e.lat*Math.PI/180;return o.lat=n/2*Math.log((1+Math.sin(l))/(1-Math.sin(l))),{lng:parseFloat(o.lng.toFixed(2)),lat:parseFloat(o.lat.toFixed(2))}}e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74);let t={lng:e.lng,lat:e.lat},r;for(let o=0;o<Rt.length;o++)if(t.lat>=Rt[o]){r=jl[o];break}if(!r){for(let o=0;o<Rt.length;o++)if(t.lat<=-Rt[o]){r=jl[o];break}}let s=this.convertor(e,r);return{lng:parseFloat(s.lng.toFixed(2)),lat:parseFloat(s.lat.toFixed(2))}}convertor(e,t){if(!e||!t)return{lng:0,lat:0};let r=t[0]+t[1]*Math.abs(e.lng),s=Math.abs(e.lat)/t[9],o=t[2]+t[3]*s+t[4]*s*s+t[5]*s*s*s+t[6]*s*s*s*s+t[7]*s*s*s*s*s+t[8]*s*s*s*s*s*s;return r*=e.lng<0?-1:1,o*=e.lat<0?-1:1,{lng:r,lat:o}}getDistance(e,t,r,s){return Jg*Math.acos(Math.sin(r)*Math.sin(s)+Math.cos(r)*Math.cos(s)*Math.cos(t-e))}toRadians(e){return Math.PI*e/180}toDegrees(e){return 180*e/Math.PI}getRange(e,t,r){return t!=null&&(e=Math.max(e,t)),r!=null&&(e=Math.min(e,r)),e}getLoop(e,t,r){for(;e>r;)e-=r-t;for(;e<t;)e+=r-t;return e}lngLatToMercator(e){return this.convertLL2MC(e)}lngLatToPoint(e){let t=this.convertLL2MC(e);return{x:t.lng,y:t.lat}}mercatorToLngLat(e){return this.convertMC2LL(e)}pointToLngLat(e){let t={lng:e.x,lat:e.y};return this.convertMC2LL(t)}pointToPixel(e,t,r,s){if(!e)return{x:0,y:0};e=this.lngLatToMercator(e);let o=this.getZoomUnits(t),n=Math.round((e.lng-r.lng)/o+s.width/2),l=Math.round((r.lat-e.lat)/o+s.height/2);return{x:n,y:l}}pixelToPoint(e,t,r,s){if(!e)return{lng:0,lat:0};let o=this.getZoomUnits(t),n=r.lng+o*(e.x-s.width/2),l=r.lat-o*(e.y-s.height/2),h={lng:n,lat:l};return this.mercatorToLngLat(h)}getZoomUnits(e){return Math.pow(2,18-e)}},ql=as;var ns=class extends i.WebMercatorTilingScheme{constructor(e){super(e);let t=new ql;this._projection.project=function(r,s){return s=s||{},s=me.WGS84ToGCJ02(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude)),s=me.GCJ02ToBD09(s[0],s[1]),s[0]=Math.min(s[0],180),s[0]=Math.max(s[0],-180),s[1]=Math.min(s[1],74.000022),s[1]=Math.max(s[1],-71.988531),s=t.lngLatToPoint({lng:s[0],lat:s[1]}),new i.Cartesian2(s.x,s.y)},this._projection.unproject=function(r,s){return s=s||{},s=t.mercatorToLngLat({lng:r.x,lat:r.y}),s=me.BD09ToGCJ02(s.lng,s.lat),s=me.GCJ02ToWGS84(s[0],s[1]),new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))},this.resolutions=e.resolutions||[]}tileXYToNativeRectangle(e,t,r,s){let o=this.resolutions[r],n=e*o,l=(e+1)*o,h=((t=-t)+1)*o,c=t*o;return i.defined(s)?(s.west=n,s.south=c,s.east=l,s.north=h,s):new i.Rectangle(n,c,l,h)}positionToTileXY(e,t,r){let s=this._rectangle;if(!i.Rectangle.contains(s,e))return;let n=this._projection.project(e);if(!i.defined(n))return;let l=this.resolutions[t],h=Math.floor(n.x/l),c=-Math.floor(n.y/l);return i.defined(r)?(r.x=h,r.y=c,r):new i.Cartesian2(h,c)}},Zl=ns;var Yl={img:"//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",vec:"//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020",custom:"//api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",traffic:"//its.map.baidu.com:8002/traffic/TrafficTileService?time={time}&label={labelStyle}&v=016&level={z}&x={x}&y={y}&scaler=2"},ls=class extends i.UrlTemplateImageryProvider{constructor(e={}){if(e.url=e.url||[e.protocol||"",Yl[e.style]||Yl.custom].join(""),e.crs==="WGS84"){let t=[];for(let r=0;r<19;r++)t[r]=256*Math.pow(2,18-r);e.tilingScheme=new Zl({resolutions:t,rectangleSouthwestInMeters:new i.Cartesian2(-2003772637e-2,-1247410417e-2),rectangleNortheastInMeters:new i.Cartesian2(2003772637e-2,1247410417e-2)})}else e.tilingScheme=new i.WebMercatorTilingScheme({rectangleSouthwestInMeters:new i.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new i.Cartesian2(33554054,33746824)});e.maximumLevel=18,super(e),this._rectangle=this._tilingScheme.rectangle,this._url=e.url,this._crs=e.crs||"BD09",this._style=e.style||"normal"}requestImage(e,t,r){let s=this._tilingScheme.getNumberOfXTilesAtLevel(r),o=this._tilingScheme.getNumberOfYTilesAtLevel(r),n=this._url.replace("{z}",r).replace("{s}",String(1)).replace("{style}",this._style);return this._crs==="WGS84"?n=n.replace("{x}",String(e)).replace("{y}",String(-t)):n=n.replace("{x}",String(e-s/2)).replace("{y}",String(o/2-t-1)),i.ImageryProvider.loadImage(this,n)}};k.BAIDU="baidu";var Xl=ls;var Qg="//tiles{s}.geovisearth.com/base/v1/{style}/{z}/{x}/{y}?format={format}&tmsIds=w&token={key}",hs=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Qg.replace(/\{style\}/g,e.style||"vec").replace(/\{format\}/g,e.format||"png").replace(/\{key\}/g,e.key||"")].join(""),e.subdomains=e.subdomains||["1","2","3"],super(e)}};k.GEO_VIS="geoVis";var Jl=hs;var Kl={img:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}",elec:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=m&x={x}&y={y}&z={z}",cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=h&x={x}&y={y}&z={z}",ter:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=t@131,r&x={x}&y={y}&z={z}",img_cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=y&x={x}&y={y}&z={z}"},cs=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Kl[e.style]||Kl.elec].join(""),e.crs==="WGS84"&&(e.tilingScheme=new Lt),super(e)}};k.GOOGLE="google";var Ql=cs;var $g="//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}",ps=class extends i.UrlTemplateImageryProvider{constructor(e={}){super({url:[e.protocol||"",$g.replace(/\{style\}/g,e.style||"vec").replace(/\{key\}/g,e.key||"")].join(""),subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:18})}};k.TDT="tdt";var $l=ps;var eh={img:"//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400",elec:"//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347"},ds=class extends i.UrlTemplateImageryProvider{constructor(e={}){let t=e.url||[e.protocol||"",eh[e.style]||eh.elec].join("");e.url=t.replace("{style}",e.style||1),e.subdomains=e.subdomains||["1","2","3"],e.style==="img"&&(e.customTags={sx:(r,s,o,n)=>s>>4,sy:(r,s,o,n)=>(1<<n)-o>>4}),super(e)}};k.TENCENT="tencent";var th=ds;var ms=class{static createAMapImageryLayer(e){return Promise.resolve(new Bl(e))}static createBaiduImageryLayer(e){return Promise.resolve(new Xl(e))}static createGeoVisImageryLayer(e){return Promise.resolve(new Jl(e))}static createGoogleImageryLayer(e){return Promise.resolve(new Ql(e))}static createTdtImageryLayer(e){return Promise.resolve(new $l(e))}static createTencentImageryLayer(e){return Promise.resolve(new th(e))}static createArcGisImageryLayer(e){return i.ArcGisMapServerImageryProvider.fromUrl(e.url,e)}static createBingImageryLayer(e){return i.BingMapsImageryProvider.fromUrl(e.url,e)}static createOSMImageryLayer(e){return Promise.resolve(new i.OpenStreetMapImageryProvider(e))}static createSingleTileImageryLayer(e){return i.SingleTileImageryProvider.fromUrl(e.url,e)}static createWMSImageryLayer(e){return Promise.resolve(new i.WebMapServiceImageryProvider(e))}static createWMTSImageryLayer(e){return Promise.resolve(new i.WebMapTileServiceImageryProvider(e))}static createXYZImageryLayer(e){return Promise.resolve(new i.UrlTemplateImageryProvider(e))}static createCoordImageryLayer(e){return Promise.resolve(new i.TileCoordinatesImageryProvider(e))}static createGridImageryLayer(e){return Promise.resolve(new i.GridImageryProvider(e))}static createMapboxImageryLayer(e){return Promise.resolve(new i.MapboxImageryProvider(e))}static createMapboxStyleImageryLayer(e){return Promise.resolve(new i.MapboxStyleImageryProvider(e))}static createTMSImageryLayer(e){return i.TileMapServiceImageryProvider.fromUrl(e.url,e)}static createImageryLayer(e,t){let r;switch(e){case k.AMAP:r=this.createAMapImageryLayer(t);break;case k.BAIDU:r=this.createBaiduImageryLayer(t);break;case k.GEO_VIS:r=this.createGeoVisImageryLayer(t);break;case k.GOOGLE:r=this.createGoogleImageryLayer(t);break;case k.TDT:r=this.createTdtImageryLayer(t);break;case k.TENCENT:r=this.createTencentImageryLayer(t);break;case k.ARCGIS:r=this.createArcGisImageryLayer(t);break;case k.BING:r=this.createBingImageryLayer(t);break;case k.OSM:r=this.createOSMImageryLayer(t);break;case k.SINGLE_TILE:r=this.createSingleTileImageryLayer(t);break;case k.WMS:r=this.createWMSImageryLayer(t);break;case k.WMTS:r=this.createWMTSImageryLayer(t);break;case k.XYZ:r=this.createXYZImageryLayer(t);break;case k.COORD:r=this.createCoordImageryLayer(t);break;case k.GRID:r=this.createGridImageryLayer(t);break;case k.MAPBOX:r=this.createMapboxImageryLayer(t);break;case k.MAPBOX_STYLE:r=this.createMapboxStyleImageryLayer(t);break;case k.TMS:r=this.createTMSImageryLayer(t);break;default:break}return r}},ih=ms;var us=class extends i.GeographicTilingScheme{constructor(e={}){super(e),this._origin=e.origin||[-180,90],this._zoomOffset=e.zoomOffset||0,this._tileSize=e.tileSize||256,this._resolutions=e.resolutions||[]}get zoomOffset(){return this._zoomOffset}tileXYToRectangle(e,t,r,s){if(!this._resolutions||!this._resolutions[r+this._zoomOffset])return i.Rectangle.MAX_VALUE;let o=this._resolutions[r+this._zoomOffset]*this._tileSize,n=i.Math.toRadians(this._origin[0]+e*o),l=i.Math.toRadians(this._origin[1]-(t+1)*o),h=i.Math.toRadians(this._origin[0]+(e+1)*o),c=i.Math.toRadians(this._origin[1]-t*o);return s?(s.west=n,s.south=l,s.east=h,s.north=c,s):new i.Rectangle(n,l,h,c)}positionToTileXY(e,t,r){if(!this._resolutions||!this._resolutions[t+this._zoomOffset])return new i.Cartesian2;let s=this._resolutions[t+this._zoomOffset]*this._tileSize,o=i.Math.toDegrees(e.longitude),n=i.Math.toDegrees(e.latitude),l=Math.floor((o-this._origin[0])/s),h=Math.floor((this._origin[1]-n)/s);return r?(r.x=l,r.y=h,r):new i.Cartesian2(Math.max(0,l),Math.max(0,h))}},rh=us;var _s=class extends i.WebMercatorTilingScheme{constructor(e={}){super(e),this._origin=e.origin||[-200375083427892e-7,200375083427892e-7],this._zoomOffset=e.zoomOffset||0,this._tileSize=e.tileSize||256,this._resolutions=e.resolutions||[]}get zoomOffset(){return this._zoomOffset}tileXYToNativeRectangle(e,t,r,s){if(!this._resolutions||!this._resolutions[r+this._zoomOffset])return i.Rectangle.MAX_VALUE;if(e<0||t<0)return i.Rectangle.MAX_VALUE;let o=this._resolutions[r+this._zoomOffset]*this._tileSize,n=this._origin[0]+e*o,l=this._origin[1]-(t+1)*o,h=this._origin[0]+(e+1)*o,c=this._origin[1]-t*o;return s?(s.west=n,s.south=l,s.east=h,s.north=c,s):new i.Rectangle(n,l,h,c)}positionToTileXY(e,t,r){let s=this._rectangle;if(!i.Rectangle.contains(s,e))return;if(!this._resolutions||!this._resolutions[t+this._zoomOffset])return new i.Cartesian2;let o=this._resolutions[t+this._zoomOffset]*this._tileSize,l=this._projection.project(e),h=Math.floor((l.x-this._origin[0])/o),c=Math.floor((this._origin[1]-l.y)/o);return r?(r.x=h,r.y=c,r):new i.Cartesian2(Math.max(0,h),Math.max(0,c))}},sh=_s;var ey={NONE:"none",XYZ:"xyz",ARCGIS:"arcgis",GOOGLE:"google",VR:"vr"},be=ey;var fs=class{static createEllipsoidTerrain(e){return Promise.resolve(new i.EllipsoidTerrainProvider(e))}static createUrlTerrain(e){return i.CesiumTerrainProvider.fromUrl(e.url,e)}static createGoogleTerrain(e){return i.GoogleEarthEnterpriseTerrainProvider.fromUrl(e.url,e)}static createArcgisTerrain(e){return i.ArcGISTiledElevationTerrainProvider.fromUrl(e.url,e)}static createVRTerrain(e){return i.VRTheWorldTerrainProvider.fromUrl(e.url,e)}static createTerrain(e,t){let r;switch(e){case be.NONE:r=this.createEllipsoidTerrain(t);break;case be.XYZ:r=this.createUrlTerrain(t);break;case be.GOOGLE:r=this.createGoogleTerrain(t);break;case be.ARCGIS:r=this.createArcgisTerrain(t);break;case be.VR:r=this.createVRTerrain(t);break;default:break}return r}},oh=fs;var ty={},lt=ty;var gs=class{constructor(e){this._id=C.uuid(),this._bid=e||C.uuid(),this._delegate=void 0,this._viewer=void 0,this._state=void 0,this._show=!0,this._isGround=!1,this._cache={},this._attr={},this._layerEvent=new dr,this._layerEvent.on(Ee.ADD,this._onAdd,this),this._layerEvent.on(Ee.REMOVE,this._onRemove,this)}get layerId(){return this._id}get id(){return this._bid}get delegate(){return this._delegate}set show(e){this._show=e,this._delegate&&(this._delegate.show=this._show)}get show(){return this._show}get layerEvent(){return this._layerEvent}set attr(e){this._attr=e}get attr(){return this._attr}get state(){return this._state}_addedHook(){}_removedHook(){}_onAdd(e){this._viewer=e,this._delegate&&(this._delegate instanceof i.PrimitiveCollection?this._isGround?this._viewer.scene.groundPrimitives.add(this._delegate):this._viewer.scene.primitives.add(this._delegate):this._delegate instanceof i.ImageryLayer?this._viewer.imageryLayers.add(this._delegate):this._viewer.dataSources.add(this._delegate),this._addedHook&&this._addedHook(),this._state=m.ADDED)}_onRemove(){this._delegate&&this._viewer&&(this._cache={},this._delegate instanceof i.PrimitiveCollection?(this._delegate.removeAll(),this._isGround?this._viewer.scene.groundPrimitives.remove(this._delegate):this._viewer.scene.primitives.remove(this._delegate)):this._delegate instanceof i.ImageryLayer?this._viewer.imageryLayers.remove(this._delegate,!1):this._delegate instanceof Promise?(this._delegate.then(e=>{e.entities.removeAll()}),this._viewer.dataSources.remove(this._delegate)):(this._delegate.entities&&this._delegate.entities.removeAll(),this._viewer.dataSources.remove(this._delegate)),this._removedHook&&this._removedHook(),this._state=m.REMOVED)}_addOverlay(e){this._cache.hasOwnProperty(e.overlayId)||(this._cache[e.overlayId]=e,this._delegate&&e.fire(xe.ADD,this),this._state===m.CLEARED&&(this._state=m.ADDED))}_removeOverlay(e){this._cache.hasOwnProperty(e.overlayId)&&(this._delegate&&e.fire(xe.REMOVE,this),delete this._cache[e.overlayId])}addOverlay(e){return this._addOverlay(e),this}addOverlays(e){return Array.isArray(e)&&e.forEach(t=>{this._addOverlay(t)}),this}removeOverlay(e){return this._removeOverlay(e),this}getOverlay(e){return this._cache[e]||void 0}getOverlayById(e){let t;return Object.keys(this._cache).forEach(r=>{this._cache[r].id===e&&(t=this._cache[r])}),t}getOverlaysByAttr(e,t){let r=[];return this.eachOverlay(s=>{s.attr[e]===t&&r.push(s)},this),r}eachOverlay(e,t){return Object.keys(this._cache).forEach(r=>{e&&e.call(t||this,this._cache[r])}),this}getOverlays(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}clear(){}remove(){this._viewer&&this._viewer.removeLayer(this)}addTo(e){return e!=null&&e.addLayer&&e.addLayer(this),this}setStyle(e){}on(e,t,r){return this._layerEvent.on(e,t,r||this),this}off(e,t,r){return this._layerEvent.off(e,t,r||this),this}fire(e,t){return this._layerEvent.fire(e,t),this}static registerType(e){e&&(lt[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getLayerType(e){return lt[e.toLocaleUpperCase()]||void 0}},A=gs;var ys=class{constructor(e){this._id=e||C.uuid(),this._cache={},this._show=!0,this._viewer=void 0,this._layerGroupEvent=new cr,this._layerGroupEvent.on(Te.ADD,this._onAdd,this),this._layerGroupEvent.on(Te.REMOVE,this._onRemove,this),this._state=m.INITIALIZED}get id(){return this._id}get type(){return A.getLayerType("layer_group")}set show(e){this._show=e,Object.keys(this._cache).forEach(t=>{this._cache[t].show=this._show})}get show(){return this._show}get layerGroupEvent(){return this._layerGroupEvent}get state(){return this._state}_onAdd(e){this._viewer=e,Object.keys(this._cache).forEach(t=>{this._viewer.addLayer(this._cache[t])}),this._state=m.ADDED}_onRemove(){Object.keys(this._cache).forEach(e=>{this._viewer&&this._viewer.removeLayer(this._cache[e])}),this._cache={},this._state=m.REMOVED}addLayer(e){return Object(this._cache).hasOwnProperty(e.id)||(this._cache[e.id]=e,this._viewer&&this._viewer.addLayer(e)),this}removeLayer(e){return Object(this._cache).hasOwnProperty(e.id)&&(this._viewer&&this._viewer.removeLayer(e),delete this._cache[e.id]),this}getLayer(e){return this._cache[e]||void 0}getLayers(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}addTo(e){return e&&e.addLayerGroup&&e.addLayerGroup(this),this}remove(){return this._viewer&&this._viewer.removeLayerGroup(this),this}};A.registerType("layer_group");var ah=ys;var iy={radius:60,maxZoom:25,style:"circle",image:"",gradientColors:{1e-4:i.Color.DEEPSKYBLUE,.001:i.Color.GREEN,.01:i.Color.ORANGE,.1:i.Color.RED},gradientImages:{},showCount:!0,fontSize:12,clusterSize:16,fontColor:i.Color.BLACK,getCountOffset:a=>({x:-3.542857*String(a).length+1.066667,y:String(a).length>3?5:4})},vs=class extends A{constructor(e,t={}){super(e),this._delegate=new i.PrimitiveCollection,this._options={...iy,...t},this._billboards=this._delegate.add(new i.BillboardCollection),this._labels=this._delegate.add(new i.LabelCollection),this._cluster=new He({radius:this._options.radius,maxZoom:this._options.maxZoom}),this._allCount=0,this._changedRemoveCallback=void 0,this._lastChangedTime=null,this._state=m.INITIALIZED}get type(){return A.getLayerType("cluster")}_addOverlay(e){}_removeOverlay(e){}_getCircleImage(e,t){let r=this._options.clusterSize*(String(t).length+1),s=e.toCssColorString()+"-"+t;if(!this._cache[s]){let o=document.createElement("canvas");o.width=r,o.height=r;let n=o.getContext("2d");n.save(),n.scale(r/24,r/24),n.fillStyle=e.withAlpha(.2).toCssColorString(),n.beginPath(),n.arc(12,12,9,0,2*Math.PI),n.closePath(),n.fill(),n.beginPath(),n.arc(12,12,6,0,2*Math.PI),n.fillStyle=e.toCssColorString(),n.closePath(),n.fill(),n.restore(),this._cache[s]=o.toDataURL()}return this._cache[s]}_getClusteringImage(e,t){let r=this._options.clusterSize*(String(t).length+1),s=e.toCssColorString()+"-"+t,o=-Math.PI/12,n=Math.PI/2,l=Math.PI/6;if(!this._cache[s]){let h=document.createElement("canvas");h.width=r,h.height=r;let c=h.getContext("2d");c.save(),c.scale(r/24,r/24),c.beginPath(),c.arc(12,12,6,0,2*Math.PI),c.fillStyle=e.toCssColorString(),c.fill(),c.closePath(),c.lineWidth=2;for(let p=0;p<3;p++)c.beginPath(),c.arc(12,12,8,o,o+n,!1),c.strokeStyle=e.withAlpha(.4).toCssColorString(),c.stroke(),c.arc(12,12,11,o,o+n,!1),c.strokeStyle=e.withAlpha(.2).toCssColorString(),c.stroke(),c.closePath(),o=o+n+l;c.restore(),this._cache[s]=h.toDataURL()}return this._cache[s]}_getClusterImage(e){let t=e/this._allCount,r;if(this._options.style==="custom"){let s=Object.keys(this._options.gradientImages).sort((o,n)=>Number(o)-Number(n));for(let o=s.length-1;o>=0;o--)if(t>=Number(s[o])){r=this._options.gradientImages[s[o]];break}r||(r=this._options.gradientImages[s[0]])}else{let s=Object.keys(this._options.gradientColors).sort((n,l)=>Number(n)-Number(l)),o;for(let n=s.length-1;n>=0;n--)if(t>=Number(s[n])){o=this._options.gradientColors[s[n]];break}o||(o=this._options.gradientColors[s[0]]),r=this._options.style==="circle"?this._getCircleImage(o,e):this._getClusteringImage(o,e)}return r}_changeCluster(e){let t=i.getTimestamp();if(this._lastChangedTime&&t-this._lastChangedTime<=1e3)return;this._lastChangedTime=t,this._cache={},this._billboards.removeAll(),this._labels.removeAll();let r=this._viewer.camera.computeViewRectangle();r||(r=this._viewer.viewBounds),this._allCount&&this._cluster.getClusters([i.Math.toDegrees(r.west),i.Math.toDegrees(r.south),i.Math.toDegrees(r.east),i.Math.toDegrees(r.north)],this._viewer.zoom).forEach(o=>{let n=C.uuid();if(o.properties.cluster){let l=o.properties.point_count,h=this._billboards.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),image:this._getClusterImage(l)});if(h.layerId=this.layerId,h.overlayId=n,h.attr={count:l},this._cache[n]=h,this._options.showCount){let c=this._labels.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),text:String(l),font:`${this._options.fontSize} px sans-serif`,disableDepthTestDistance:Number.POSITIVE_INFINITY,fillColor:this._options.fontColor,scale:.8,pixelOffset:this._options.getCountOffset(l)});c.layerId=this.layerId,c.overlayId=n,c.attr={count:l},this._cache[n]=c}}else{let l=this._billboards.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),image:this._options.image,...o.properties.style});l.layerId=this.layerId,l.overlayId=n,l.attr=o.properties,this._cache[n]=l}})}_addedHook(){this._changedRemoveCallback=this._viewer.camera.changed.addEventListener(this._changeCluster,this)}_removedHook(){this._changedRemoveCallback&&this._changedRemoveCallback()}setPoints(e=[]){return e.length&&(this._allCount=e.length,this._cluster.load(e.map(t=>{let r=y.parsePosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[r.lng,r.lat]},properties:t.attr||{}}}))),this}clear(){return this._cache={},this._allCount=0,this._state=m.CLEARED,this}};A.registerType("cluster");var nh=vs;var ws=class extends A{constructor(e,t="",r={}){super(e),this._delegate=i.CzmlDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("czml")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("czml");var lh=ws;var Cs=class extends A{constructor(e){super(e),this._delegate=new i.CustomDataSource(e),this._state=m.INITIALIZED}get type(){return A.getLayerType("dynamic")}clear(){return this._delegate.entities&&this._delegate.entities.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("dynamic");var hh=Cs;var xs=class extends A{constructor(e){super(e),this._delegate=new i.CustomDataSource(e),this._state=m.INITIALIZED}get type(){return A.getLayerType("vector")}clear(){return this._delegate.entities&&this._delegate.entities.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("vector");var ue=xs;var ry={name:"",count:10,maximumLevel:21,dataProperty:"",callback:()=>null},Ts=class extends A{constructor(e,t,r={}){super(e),this._url=t,this._options={...ry,...r},this._levelLayers={},this._tileWidth=256,this._tileHeight=256,this._maximumLevel=this._options.maximumLevel,this._tilingScheme=this._options.tilingScheme||new i.GeographicTilingScheme,this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._token=void 0;for(let s=0;s<this.maximumLevel;s++)this._levelLayers[String(s)]=new ue(e+"-grid-"+s);this._viewer=void 0,this._imageryLayer=void 0,this._imagery=document.createElement("canvas"),this._imagery.width=this._tileWidth,this._imagery.height=this._tileHeight,this._state=m.INITIALIZED}get type(){return A.getLayerType("feature_grid")}get url(){return this._url}set show(e){this._show=e,Object.keys(this._levelLayers).forEach(t=>{this._levelLayers[t].show=e})}get show(){return this._show}get token(){return this._token}get tileWidth(){if(!this.ready)throw new i.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}get tileHeight(){if(!this.ready)throw new i.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}get maximumLevel(){if(!this.ready)throw new i.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}get minimumLevel(){if(!this.ready)throw new i.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}get tilingScheme(){if(!this.ready)throw new i.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}get rectangle(){if(!this.ready)throw new i.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}get ready(){return!!this._url}get credit(){return this._credit}get hasAlphaChannel(){return!0}_onAdd(e){this._viewer=e,this._imageryLayer=this._viewer.imageryLayers.addImageryProvider(this),Object.keys(this._levelLayers).forEach(t=>{this._viewer.addLayer(this._levelLayers[t])}),this._state=m.ADDED}_onRemove(){this._imageryLayer&&this._viewer.imageryLayers.remove(this._imageryLayer),Object.keys(this._levelLayers).forEach(e=>{this._viewer.removeLayer(this._levelLayers[e])}),this._state=m.REMOVED}getTileCredits(e,t,r){}requestImage(e,t,r,s){let o=this._levelLayers[String(r)],n=this._tilingScheme.tileXYToRectangle(e,t,r);return this._viewer&&n&&o&&i.Rectangle.intersection(n,this._viewer.viewBounds)&&i.Resource.fetchJson({url:this._url,queryParameters:{minX:i.Math.toDegrees(n.west),minY:i.Math.toDegrees(n.south),maxX:i.Math.toDegrees(n.east),maxY:i.Math.toDegrees(n.north),count:this._options.count}}).then(l=>{let h=l;if(this._options.dataProperty&&(h=l[this._options.dataProperty]),h&&h.length){for(let c=r+3;c<this._maximumLevel;c++)this._levelLayers[String(c)]&&this._levelLayers[String(c)].clear();h.forEach(c=>{let p=this._options.callback(c);p&&o.addOverlay(p)})}}),this._imagery}clear(){Object.keys(this._levelLayers).forEach(e=>{this._levelLayers[e].clear()}),this._state=m.CLEARED}};A.registerType("feature_grid");var ch=Ts;var sy={},N=sy;var Es=class{constructor(){this._id=C.uuid(),this._bid=C.uuid(),this._delegate=void 0,this._layer=void 0,this._state=void 0,this._show=!0,this._style={},this._attr={},this._allowDrillPicking=!1,this._contextMenu=[],this._overlayEvent=new ur,this._overlayEvent.on(xe.ADD,this._onAdd,this),this._overlayEvent.on(xe.REMOVE,this._onRemove,this)}get overlayId(){return this._id}get type(){return""}set id(e){this._bid=e}get id(){return this._bid}set show(e){this._show=e,C.isPromise(this._delegate)?this._delegate.then(t=>{t.show=this._show}):this._delegate&&(this._delegate.show=this._show)}get show(){return this._show}set attr(e){this._attr=e}get attr(){return this._attr}set allowDrillPicking(e){this._allowDrillPicking=e}get allowDrillPicking(){return this._allowDrillPicking}get overlayEvent(){return this._overlayEvent}get delegate(){return this._delegate}get state(){return this._state}set contextMenu(e){this._contextMenu=e}get contextMenu(){return this._contextMenu}_getLayerCollection(e){let t;switch(e){case"point_primitive":t=this._layer.points;break;case"billboard_primitive":case"bounce_billboard_primitive":t=this._layer.billboards;break;case"label_primitive":case"bounce_label_primitive":t=this._layer.labels;break;case"polyline_primitive":t=this._layer.polylines;break;case"cloud_primitive":t=this._layer.clouds;break;default:break}return t}_mountedHook(){}_addedHook(){var e;if(!this._delegate)return!1;this._delegate instanceof Promise?this._delegate.then(t=>{var r;t.layerId=(r=this._layer)==null?void 0:r.layerId,t.overlayId=this._id}):(this._delegate.layerId=(e=this._layer)==null?void 0:e.layerId,this._delegate.overlayId=this._id)}_removedHook(){}_onAdd(e){var t,r,s,o;if(e){if(this._layer=e,this._mountedHook&&this._mountedHook(),(r=(t=this._layer)==null?void 0:t.delegate)!=null&&r.entities&&this._delegate)this._layer.delegate.entities.add(this._delegate);else if((o=(s=this._layer)==null?void 0:s.delegate)!=null&&o.add){let n=this._getLayerCollection(this.type);n?(this._delegate&&(this._delegate=n.add(this._delegate)),C.merge(this._delegate,this._style),this.update&&this.destroy&&this._layer.delegate.add(this)):C.isPromise(this._delegate)?this._delegate.then(l=>{this._layer.delegate.add(l)}):this.update&&this.destroy?this._layer.delegate.add(this):this._delegate&&this._layer.delegate.add(this._delegate)}this._addedHook&&this._addedHook(),this._state=m.ADDED}}_onRemove(){var e,t,r,s;if(this._layer){if((t=(e=this._layer)==null?void 0:e.delegate)!=null&&t.entities)this._layer.delegate.entities.remove(this._delegate);else if((s=(r=this._layer)==null?void 0:r.delegate)!=null&&s.remove){let o=this._getLayerCollection(this.type);o?(this._delegate&&o.remove(this._delegate),this.update&&this.destroy&&this._layer.delegate.remove(this)):C.isPromise(this._delegate)?this._delegate.then(n=>{this._layer.delegate.remove(n)}):this.update&&this.destroy?this._layer.delegate.remove(this):this._delegate&&this._layer.delegate.remove(this._delegate)}this._removedHook&&this._removedHook(),this._state=m.REMOVED}}setLabel(e,t){return this._delegate?(this._delegate instanceof i.Entity&&(this._delegate.label={...t,text:e}),this):this}setStyle(e){return this}remove(){return this._layer&&this._layer.removeOverlay(this),this}addTo(e){return e&&e.addOverlay&&e.addOverlay(this),this}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this}fire(e,t){return this._overlayEvent.fire(e,t),this}static registerType(e){e&&(N[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getOverlayType(e){return N[e.toLocaleUpperCase()]||void 0}},v=Es;var Ps=class extends v{constructor(e,t){super(),this._delegate=new i.Entity({billboard:{}}),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._state=m.INITIALIZED}get type(){return v.getOverlayType("custom_billboard")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("CustomBillboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setLabel(e,t){return this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.billboard,e),this)}setVLine(e={}){if(this._position.alt>0&&!this._delegate.polyline){let t=this._position.copy();t.alt=e.height||0,this._delegate.polyline={...e,positions:f.transformWGS84ArrayToCartesianArray([t,this._position])}}return this}setBottomCircle(e,t={},r=0){let s=0,o=r;return this._delegate.ellipse={...t,semiMajorAxis:e,semiMinorAxis:e,stRotation:new i.CallbackProperty(()=>(s+=o,(s>=360||s<=-360)&&(s=0),s),!1)},this}};v.registerType("custom_billboard");var ph=Ps;var bs=class extends v{constructor(e,t){super(),this._delegate=new i.Entity({label:{}}),this._position=y.parsePosition(e),this._text=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("custom_label")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.label.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.text,C.merge(this._style,e),C.merge(this._delegate.label,e),this)}setVLine(e={}){if(this._position.alt>0&&!this._delegate.polyline){let t=this._position.copy();t.alt=e.height||0,this._delegate.polyline={...e,positions:f.transformWGS84ArrayToCartesianArray([t,this._position])}}return this}setBottomCircle(e,t={},r=0){let s=0,o=r;return this._delegate.ellipse={...t,semiMajorAxis:e,semiMinorAxis:e,stRotation:new i.CallbackProperty(()=>(s+=o,(s>=360||s<=-360)&&(s=0),s),!1)},this}};v.registerType("custom_label");var dh=bs;var As=class extends v{constructor(){super(),this._startTime=void 0,this._lastTime=void 0,this._sampledPosition=new i.SampledPositionProperty,this._cache=[],this._maxCacheSize=10,this._state=m.INITIALIZED}set maxCacheSize(e){this._maxCacheSize=e}get maxCacheSize(){return this._maxCacheSize}get position(){return f.transformCartesianToWGS84(this._sampledPosition.getValue(i.JulianDate.now()))}_removePosition(){if(this._cache.length>this._maxCacheSize){let e=i.JulianDate.addSeconds(this._cache[0],-.2,new i.JulianDate),t=i.JulianDate.addSeconds(this._cache[this._cache.length-this._maxCacheSize],-.2,new i.JulianDate);this._sampledPosition.removeSamples(new i.TimeInterval({start:e,stop:t})),this._cache.splice(0,this._cache.length-this._maxCacheSize)}}addPosition(e,t){this._removePosition();let r=i.JulianDate.now(),s=i.JulianDate.addSeconds(r,t,new i.JulianDate);return this._sampledPosition.addSample(s,f.transformWGS84ToCartesian(y.parsePosition(e))),this._lastTime=s,this._cache.push(this._lastTime),this}bindDom(e){return this}},Ot=As;var Ms=class extends Ot{constructor(e,t){super(),this._position=y.parsePosition(e),this._icon=t,this._delegate=new i.Entity({billboard:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("dynamic_billboard")}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("DynamicBillboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._startTime=i.JulianDate.now(),this._sampledPosition.addSample(this._startTime,f.transformWGS84ToCartesian(this._position)),this._delegate.position=this._sampledPosition,this._cache.push(this._startTime),this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.billboard,e),this)}};v.registerType("dynamic_billboard");var mh=Ms;var Is=class extends Ot{constructor(e,t){super(),this._position=y.parsePosition(e),this._modelUrl=t,this._delegate=new i.Entity({model:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("dynamic_model")}set modelUrl(e){this._modelUrl=e,this._delegate.model.uri=this._modelUrl}get modelUrl(){return this._modelUrl}_mountedHook(){this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._startTime=i.JulianDate.now(),this._sampledPosition.addSample(this._startTime,f.transformWGS84ToCartesian(this._position)),this._delegate.position=this._sampledPosition,this._delegate.orientation=new i.VelocityOrientationProperty(this._sampledPosition),this._cache.push(this._startTime),this.modelUrl=this._modelUrl}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.uri,C.merge(this._style,e),C.merge(this._delegate.model,e),this)}};v.registerType("dynamic_model");var uh=Is;function oy(a,e,t){let r=i.Cartesian3.subtract(a,e,new i.Cartesian3),s=i.Cartesian3.subtract(t,e,new i.Cartesian3),o=i.Cartesian3.cross(r,s,r);return i.Cartesian3.magnitude(o)*.5}function ge(a){let e=0;if(!Array.isArray(a))return e;a[0]instanceof i.Cartesian3||(a=f.transformWGS84ArrayToCartesianArray(a));let t=i.CoplanarPolygonGeometry.createGeometry(i.CoplanarPolygonGeometry.fromPositions({positions:a,vertexFormat:i.VertexFormat.POSITION_ONLY}));if(!t)return e;let r=t.attributes.position.values,s=t.indices;for(let o=0;o<s.length;o+=3){let n=i.Cartesian3.unpack(r,s[o]*3,new i.Cartesian3),l=i.Cartesian3.unpack(r,s[o+1]*3,new i.Cartesian3),h=i.Cartesian3.unpack(r,s[o+2]*3,new i.Cartesian3);e+=oy(n,l,h)}return e}function Ss(a=[],e=0){let t=180,r=90,s=-180,o=-90;if(a.forEach(n=>{t=Math.min(t,n.lng||n.x),r=Math.min(r,n.lat||n.y),s=Math.max(s,n.lng||n.x),o=Math.max(o,n.lat||n.y)}),e>0){let n=Math.abs(s-s),l=Math.abs(o-r);t-=n*e,r-=l*e,s+=n*e,o+=l*e}return{west:t,south:r,east:s,north:o}}function ye(a){if(a&&Array.isArray(a)){let e=0;a.forEach(({alt:s})=>e=Math.max(e,s));let t=i.BoundingSphere.fromPoints(f.transformWGS84ArrayToCartesianArray(a)),r=f.transformCartesianToWGS84(t.center);return r.alt=e,r}return new X}function Ds(a,e){e=e||{};let t=[];for(let r=0;r<a.length-1;r++){let s=ay(a[r],a[r+1],e.count);s&&s.length>0&&(t=t.concat(s))}return t}function ay(a,e,t){if(!a||!e)return null;let r=[];t=t||40;let s=function(M){return 1-2*M+M*M},o=M=>2*M-2*M*M,n=M=>M*M,l,h,c,p,u,g,_=0,d=parseFloat(a.lat),T=parseFloat(e.lat),w=parseFloat(a.lng),P=parseFloat(e.lng);P>w&&P-w>180&&w<0&&(w=360+w,P=360+P),g=0,T===d?(l=0,h=w-P):P===w?(l=Math.PI/2,h=d-T):(l=Math.atan((T-d)/(P-w)),h=(T-d)/Math.sin(l)),g===0&&(g=l+Math.PI/5),c=h/2,u=c*Math.cos(g)+w,p=c*Math.sin(g)+d;for(let M=0;M<t+1;M++){let R=w*s(_)+u*o(_)+P*n(_),F=d*s(_)+p*o(_)+T*n(_),H=a.lng,ee=e.lng;r.push([H<0&&ee>0?R-360:R,F]),_=_+1/t}return r}function ie(a){let e=0;if(a&&Array.isArray(a))for(let t=0;t<a.length-1;t++){let r=f.transformWGS84ToCartographic(a[t]),s=f.transformWGS84ToCartographic(a[t+1]),o=new i.EllipsoidGeodesic;o.setEndPoints(r,s);let n=o.surfaceDistance;n=Math.sqrt(Math.pow(n,2)+Math.pow(s.height-r.height,2)),e+=n}return e.toFixed(3)}function ve(a,e){let t=a,r=e;if(!t||!r)return 0;a instanceof i.Cartesian3||(t=y.parsePosition(a),t=f.transformWGS84ToCartesian(t)),e instanceof i.Cartesian3||(r=y.parsePosition(e),r=f.transformWGS84ToCartesian(r));let s=i.Transforms.eastNorthUpToFixedFrame(t),o=i.Cartesian3.subtract(r,t,new i.Cartesian3),n=i.Matrix4.multiplyByPointAsVector(i.Matrix4.inverse(s,new i.Matrix4),o,new i.Cartesian3),l=Math.atan2(n.y,n.x)-i.Math.PI_OVER_TWO;return l=i.Math.TWO_PI-i.Math.zeroToTwoPi(l),isNaN(l)?0:l}function ht(a,e,t){return a=parseFloat(a)||0,a>=parseFloat(e)&&a<=parseFloat(t)}function z(a,e){return i.Cartesian3.midpoint(a,e,new i.Cartesian3)}function Ls(a,e){let t=y.parsePosition(a),r=y.parsePosition(e);t=f.transformWGS84ToCartographic(t),r=f.transformWGS84ToCartographic(r);let s=new i.EllipsoidGeodesic(t,r).interpolateUsingFraction(.5);return new X(i.Math.toDegrees(s.longitude),i.Math.toDegrees(s.latitude),s.height)}function Rs(a,e,t=0,r=50){let s=[];t=Math.max(+t,100),r=Math.max(+r,50);let o=Math.abs(a.lng-e.lng),n=Math.abs(a.lat-e.lat),l=Math.max(o,n),h=l/r;if(o>n){let c=(e.lat-a.lat)/r;a.lng-e.lng>0&&(h=-h);for(let p=0;p<r;p++){let u=t-Math.pow(-.5*l+Math.abs(h)*p,2)*4*t/Math.pow(l,2),g=a.lng+h*p,_=a.lat+c*p;s.push([g,_,u])}}else{let c=(e.lng-a.lng)/r;a.lat-e.lat>0&&(h=-h);for(let p=0;p<r;p++){let u=t-Math.pow(-.5*l+Math.abs(h)*p,2)*4*t/Math.pow(l,2),g=a.lng+c*p,_=a.lat+h*p;s.push([g,_,u])}}return s.push([e.lng,e.lat,e.alt||0]),s}var{Math:ny}=i,_h={};C.merge(_h,ny,{area:ge,bounds:Ss,center:ye,curve:Ds,distance:ie,heading:ve,isBetween:ht,midCartesian:z,midPosition:Ls,parabola:Rs});var Os=class a extends v{constructor(e,t){super(),this._delegate=I.create("div","div-icon"),this._position=y.parsePosition(e),this._delegate.setAttribute("id",this._id),C.merge(this._delegate.style,{position:"absolute",top:"0",left:"0"}),this.content=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("div_icon")}set show(e){this._show=e,this._delegate.style.visibility=this._show?"visible":"hidden"}get show(){return this._show}set position(e){this._position=y.parsePosition(e)}get position(){return this._position}set content(e){if(e&&typeof e=="string")this._delegate.innerHTML=e;else if(e&&e instanceof Element){for(;this._delegate.hasChildNodes();)this._delegate.removeChild(this._delegate.firstChild);this._delegate.appendChild(e)}}get content(){return this._delegate.childNodes||[]}_updateStyle(e,t,r){if(!this._show||!e)return;let s=e.x-this._delegate.offsetWidth/2,o=e.y-this._delegate.offsetHeight/2;this._style.position==="topleft"?(s=e.x-this._delegate.offsetWidth,o=e.y-this._delegate.offsetHeight):this._style.position==="topright"?(s=e.x,o=e.y-this._delegate.offsetHeight):this._style.position==="bottomleft"?(s=e.x-this._delegate.offsetWidth,o=e.y):this._style.position==="bottomright"&&(s=e.x,o=e.y);let n=`translate3d(${Math.round(s)}px,${Math.round(o)}px, 0)`,l="scale3d(1,1,1)",h=this._style.scaleByDistance;if(t&&h){let u=h.near||0,g=h.nearValue||1,_=h.far||Number.MAX_VALUE,d=h.farValue||0,T=t/_;if(t<u)l=`scale3d(${g},${g},1)`;else if(t>_)l=`scale3d(${d},${d},1)`;else{let w=d+T*(g-d);l=`scale3d(${w},${w},1)`}}let c=!0,p=this._style.distanceDisplayCondition;t&&p&&(c=ht(t,p.near||0,p.far||Number.MAX_VALUE)),this._delegate.style.transform=`${n} ${l}`,this._delegate.style.visibility=c&&r?"visible":"hidden"}_onAdd(e){this._layer=e,this._layer.delegate.appendChild(this._delegate);let t={layer:e,overlay:this,position:f.transformWGS84ToCartesian(this._position)};this._delegate.addEventListener("click",()=>{this._overlayEvent.fire(O.CLICK,t)}),this._delegate.addEventListener("mouseover",()=>{this._overlayEvent.fire(O.MOUSE_OVER,t)}),this._delegate.addEventListener("mouseout",()=>{this._overlayEvent.fire(O.MOUSE_OUT,t)}),this._state=m.ADDED}_onRemove(){this._layer&&(this._layer.delegate.removeChild(this._delegate),this._state=m.REMOVED)}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this._style.className&&I.addClass(this._delegate,this._style.className),this)}static fromEntity(e,t){var n;let r,s=i.JulianDate.now(),o=f.transformCartesianToWGS84(e.position.getValue(s));return r=new a(o,t),e.billboard&&(r.attr={...(n=e==null?void 0:e.properties)==null?void 0:n.getValue(s)}),r}};v.registerType("div_icon");var fh=Os;var ks=class a extends v{constructor(e,t){super(),this._delegate=new i.Entity({model:{}}),this._position=y.parsePosition(e),this._modelUrl=t,this._rotateAmount=0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("model")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._rotateAmount===0&&(this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll))))}get position(){return this._position}set modelUrl(e){this._modelUrl=e,this._delegate.model.uri=this._modelUrl}get modelUrl(){return this._modelUrl}set rotateAmount(e){this._rotateAmount=+e,this._delegate.orientation=new i.CallbackProperty(()=>(this._position.heading+=this._rotateAmount,(this._position.heading>=360||this._position.heading<=-360)&&(this._position.heading=0),i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))),!1)}get rotateAmount(){return this._rotateAmount}_mountedHook(){this.position=this._position,this.modelUrl=this._modelUrl}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.uri,C.merge(this._style,e),C.merge(this._delegate.model,e),this)}static fromEntity(e,t){let r=i.JulianDate.now(),s=f.transformCartesianToWGS84(e.position.getValue(r)),o=new a(s,t);return o.attr={...e.properties.getValue(r)},o}};v.registerType("model");var Ge=ks;var Fs=class extends v{constructor(e,t={}){super(),this._delegate=i.I3SDataProvider.fromUrl(e,t),this._state=m.INITIALIZED}get type(){return v.getOverlayType("i3s")}ready(e){return this._delegate.then(e),this}setLabel(e,t){return console.warn("not support this function"),this}};v.registerType("i3s");var gh=Fs;var zs=class extends v{constructor(e,t={}){super(),this._delegate=i.Cesium3DTileset.fromUrl(e,t),this._tilesetEvent=new fr(this._delegate),this._tileVisibleCallback=void 0,this._properties=void 0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("tileset")}set show(e){this._show=e,this._delegate.then(t=>{t.show=e})}_bindVisibleEvent(){this._tileVisibleCallback&&this._tileVisibleCallback(),this._tileVisibleCallback=this._delegate.then(e=>{e.tileVisible.addEventListener(this._updateTile,this)})}_updateTile(e){let t=e.content;for(let r=0;r<t.featuresLength;r++){let s=t.getFeature(r);this._properties&&this._properties.length&&this._properties.forEach(o=>{s.hasProperty(o.key)&&s.getProperty(o.key)===o.keyValue&&s.setProperty(o.propertyName,o.propertyValue)})}}ready(e){return this._delegate.then(e),this}setPosition(e){return e=y.parsePosition(e),this._delegate.then(t=>{let r=i.Transforms.eastNorthUpToFixedFrame(i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt)),s=i.Matrix4.fromRotationTranslation(i.Matrix3.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(e.heading),i.Math.toRadians(e.pitch),i.Math.toRadians(e.roll))));i.Matrix4.multiply(r,s,r),t.root.transform=r}),this}setHeadingPitchRoll(e,t,r){return this._delegate.then(s=>{let o=s.root.transform,n=i.Matrix4.fromRotationTranslation(i.Matrix3.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(e||0),i.Math.toRadians(t||0),i.Math.toRadians(r||0))));i.Matrix4.multiply(o,n,o),s.root.transform=o}),this}setLabel(e,t){return console.warn("not support this function"),this}clampToGround(){return this._delegate.then(e=>{let t=i.Cartographic.fromCartesian(e.boundingSphere.center),r=i.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),s=i.Cartesian3.fromRadians(t.longitude,t.latitude,0),o=i.Cartesian3.subtract(s,r,new i.Cartesian3);e.modelMatrix=i.Matrix4.fromTranslation(o)}),this}setHeight(e,t=!1){return this._delegate.then(r=>{let s=i.Cartographic.fromCartesian(r.boundingSphere.center),o=i.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),n=i.Cartesian3.fromRadians(s.longitude,s.latitude,t?e:s.height+e),l=i.Cartesian3.subtract(n,o,new i.Cartesian3);r.modelMatrix=i.Matrix4.fromTranslation(l)}),this}setScale(e){return this._delegate.then(t=>{let r=t.root.transform;e>0&&e!==1&&i.Matrix4.multiplyByUniformScale(r,e,r),t.root.transform=r}),this}setProperties(e){return this._properties=e,this._bindVisibleEvent(),this}setSplitDirection(e){return this._delegate.then(t=>{t.splitDirection=e}),this}setCustomShader(e){return this._delegate.then(t=>{t.customShader=e}),this}setClippingPolygons(e=null,t=!1){if(!e||e.length<3)return this._delegate.then(n=>{n.clippingPolygons&&(n.clippingPolygons.enabled=!1)}),this;let r=i.Cartesian3.fromDegreesArray(e),s=new i.ClippingPolygon({positions:r}),o=new i.ClippingPolygonCollection({polygons:[s],inverse:t});return this._delegate.then(n=>{n.clippingPolygons=o}),this}async setClippingPlanes(e=null,t=!1){if(!e||e.length<2)return this._delegate.then(F=>{F.clippingPlanes&&(F.clippingPlanes.enabled=!1)}),this;let r=i.Cartesian3.fromDegrees(e[1].lng,e[1].lat),s=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat),o=new i.Cartesian3((r.x+s.x)/2,(r.y+s.y)/2,(r.z+s.z)/2),n=i.Cartesian3.subtract(s,r,new i.Cartesian3),l=i.Cartesian3.cross(o,n,new i.Cartesian3),h=i.Cartesian3.normalize(l,new i.Cartesian3),c=await Promise.resolve(this._delegate),p=c.boundingSphere.center,u=c.boundingSphere.radius,g=i.Transforms.eastNorthUpToFixedFrame(p),_,d=c.root.transform;d.equals(i.Matrix4.IDENTITY)?(d=g,_=i.Matrix4.inverse(g,new i.Matrix4)):_=i.Matrix4.inverse(d,new i.Matrix4);let T=new i.Cartesian3(p.x-r.x,p.y-r.y,p.z-r.z),w=i.Cartesian3.dot(T,h),P=i.Matrix4.multiplyByPointAsVector(_,h,new i.Cartesian3),M=new i.ClippingPlane(P,w),R=new i.ClippingPlaneCollection({planes:[M],unionClippingRegions:t});return c.clippingPlanes=R,{center:p,size:u,distance:w,clippingPlanes:c.clippingPlanes}}setStyle(e){return e&&e instanceof i.Cesium3DTileStyle&&(this._style=e,this._delegate.then(t=>{t.style=e})),this}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this._tilesetEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this._tilesetEvent.off(e,t,r||this),this}};v.registerType("tileset");var yh=zs;var kt=Math.PI/2,Ns=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.headTailFactor=.8,this._state=m.INITIALIZED}get type(){return v.getOverlayType("attack_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getArrowHeadPoints(e,t,r){let s=x.getBaseLength(e),o=s*this.headHeightFactor,n=e[e.length-1];s=x.distance(n,e[e.length-2]);let l=x.distance(t,r);o>l*this.headTailFactor&&(o=l*this.headTailFactor);let h=o*this.headWidthFactor,c=o*this.neckWidthFactor;o=o>s?s:o;let p=o*this.neckHeightFactor,u=x.getThirdPoint(e[e.length-2],n,0,o,!0),g=x.getThirdPoint(e[e.length-2],n,0,p,!0),_=x.getThirdPoint(n,u,kt,h,!1),d=x.getThirdPoint(n,u,kt,h,!0),T=x.getThirdPoint(n,g,kt,c,!1),w=x.getThirdPoint(n,g,kt,c,!0);return[T,_,n,d,w]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r)/x.getBaseLength(o),p=this._getArrowBodyPoints(o,l,h,c),u=p.length,g=[t].concat(p.slice(0,u/2));g.push(l);let _=[r].concat(p.slice(u/2,u));return _.push(h),g=x.getQBSplinePoints(g),_=x.getQBSplinePoints(_),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(g.concat(n,_.reverse()))))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("attack_arrow");var Ue=Ns;var Q=Math.PI/2,Hs=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this._state=m.INITIALIZED}get type(){return v.getOverlayType("double_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getArrowPoints(e,t,r,s){let o=x.mid(e,t),n=x.distance(o,r),l=x.getThirdPoint(r,o,0,n*.3,!0),h=x.getThirdPoint(r,o,0,n*.5,!0);l=x.getThirdPoint(o,l,Q,n/5,s),h=x.getThirdPoint(o,h,Q,n/4,s);let c=[o,l,h,r],p=this._getArrowHeadPoints(c),u=p[0],g=p[4],_=x.distance(e,t)/x.getBaseLength(c)/2,d=this._getArrowBodyPoints(c,u,g,_),T=d.length,w=d.slice(0,T/2),P=d.slice(T/2,T);return w.push(u),P.push(g),w=w.reverse(),w.push(t),P=P.reverse(),P.push(e),w.reverse().concat(p,P)}_getArrowHeadPoints(e){let r=x.getBaseLength(e)*this.headHeightFactor,s=e[e.length-1],o=r*this.headWidthFactor,n=r*this.neckWidthFactor,l=r*this.neckHeightFactor,h=x.getThirdPoint(e[e.length-2],s,0,r,!0),c=x.getThirdPoint(e[e.length-2],s,0,l,!0),p=x.getThirdPoint(s,h,Q,o,!1),u=x.getThirdPoint(s,h,Q,o,!0),g=x.getThirdPoint(s,c,Q,n,!1),_=x.getThirdPoint(s,c,Q,n,!0);return[g,p,s,u,_]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_getTempPoint4(e,t,r){let s=x.mid(e,t),o=x.distance(s,r),n=x.getAngleOfThreePoints(e,s,r),l,h,c,p;return n<Q?(h=o*Math.sin(n),c=o*Math.cos(n),p=x.getThirdPoint(e,s,Q,h,!1),l=x.getThirdPoint(s,p,Q,c,!0)):n>=Q&&n<Math.PI?(h=o*Math.sin(Math.PI-n),c=o*Math.cos(Math.PI-n),p=x.getThirdPoint(e,s,Q,h,!1),l=x.getThirdPoint(s,p,Q,c,!1)):n>=Math.PI&&n<Math.PI*1.5?(h=o*Math.sin(n-Math.PI),c=o*Math.cos(n-Math.PI),p=x.getThirdPoint(e,s,Q,h,!0),l=x.getThirdPoint(s,p,Q,c,!0)):(h=o*Math.sin(Math.PI*2-n),c=o*Math.cos(Math.PI*2-n),p=x.getThirdPoint(e,s,Q,h,!0),l=x.getThirdPoint(s,p,Q,c,!1)),l}_getHierarchy(){let e=this._positions.length,t,r,s=y.parsePolygonCoordToArray(this._positions)[0],o=s[0],n=s[1],l=s[2];e===3?t=this._getTempPoint4(o,n,l):t=s[3],e===3||e===4?r=x.mid(o,n):r=s[4];let h,c;x.isClockWise(o,n,l)?(h=this._getArrowPoints(o,r,t,!1),c=this._getArrowPoints(r,n,l,!0)):(h=this._getArrowPoints(n,r,l,!1),c=this._getArrowPoints(r,o,t,!0));let p=h.length,u=(p-5)/2,g=h.slice(0,u),_=h.slice(u,u+5),d=h.slice(u+5,p),T=c.slice(0,u),w=c.slice(u,u+5),P=c.slice(u+5,p);T=x.getBezierPoints(T);let M=x.getBezierPoints(P.concat(g.slice(1)));return d=x.getBezierPoints(d),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(T.concat(w,M,_,d))))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("double_arrow");var Ft=Hs;var vh=Math.PI/2,Ws=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.tailWidthFactor=.15,this.neckWidthFactor=.2,this.headWidthFactor=.25,this.headAngle=Math.PI/8.5,this.neckAngle=Math.PI/13,this._state=m.INITIALIZED}get type(){return v.getOverlayType("fine_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1],s=x.getBaseLength(e),o=s*this.tailWidthFactor,n=s*this.neckWidthFactor,l=s*this.headWidthFactor,h=x.getThirdPoint(r,t,vh,o,!0),c=x.getThirdPoint(r,t,vh,o,!1),p=x.getThirdPoint(t,r,this.headAngle,l,!1),u=x.getThirdPoint(t,r,this.headAngle,l,!0),g=x.getThirdPoint(t,r,this.neckAngle,n,!1),_=x.getThirdPoint(t,r,this.neckAngle,n,!0);return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions([h,g,p,r,u,_,c])))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("fine_arrow");var zt=Ws;var ly=Math.PI/2,wh=100,Gs=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.t=.4,this._state=m.INITIALIZED}get type(){return v.getOverlayType("gathering_place")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0];if(this._positions.length===2){let n=x.mid(e[0],e[1]),l=x.distance(e[0],n)/.9,h=x.getThirdPoint(e[0],n,ly,l,!0);e=[e[0],h,e[1]]}let t=x.mid(e[0],e[2]);e.push(t,e[0],e[1]);let r=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1],c=e[n+2],p=x.getBisectorNormals(this.t,l,h,c);r=r.concat(p)}let s=r.length;r=[r[s-1]].concat(r.slice(0,s-1));let o=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1];o.push(l);for(let c=0;c<=wh;c++){let p=x.getCubicValue(c/wh,l,r[n*2],r[n*2+1],h);o.push(p)}o.push(h)}return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(o)))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("gathering_place");var Nt=Gs;var Us=class extends Ue{constructor(e){super(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.tailWidthFactor=.1,this.headTailFactor=.8,this.swallowTailFactor=1,this._state=m.INITIALIZED}get type(){return v.getOverlayType("tailed_attack_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r),p=x.getBaseLength(o),u=p*this.tailWidthFactor*this.swallowTailFactor,g=x.getThirdPoint(o[1],o[0],0,u,!0),_=c/p,d=this._getArrowBodyPoints(o,l,h,_),T=d.length,w=[t].concat(d.slice(0,T/2));w.push(l);let P=[r].concat(d.slice(T/2,T));return P.push(h),w=x.getQBSplinePoints(w),P=x.getQBSplinePoints(P),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(w.concat(n,P.reverse(),[g,w[0]]))))}};v.registerType("tailed_attack_arrow");var Ht=Us;var Bs=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._delegate={position:void 0,image:void 0,width:0,height:0},this._state=m.INITIALIZED}get type(){return v.getOverlayType("billboard_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("Billboard Primitive: the size invalid");this._size=e,this._delegate.width=this._size[0]||32,this._delegate.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position&&delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("billboard_primitive");var Wt=Bs;var Ch={maxOffsetY:10,offsetAmount:.1},Vs=class extends Wt{constructor(e,t){super(e,t),this._currentOffset=new i.Cartesian2(0,0),this._isUp=!0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("bounce_billboard_primitive")}update(e){var s,o;if(!this._show)return;let t=((s=this._style)==null?void 0:s.maxOffsetY)||Ch.maxOffsetY,r=((o=this._style)==null?void 0:o.offsetAmount)||Ch.offsetAmount;this._currentOffset.y>=0?this._isUp=!0:this._currentOffset.y<=-t&&(this._isUp=!1),this._currentOffset.y+=r*(this._isUp?-1:1),this._delegate.pixelOffset=this._currentOffset}destroy(){return i.destroyObject(this)}};v.registerType("bounce_billboard_primitive");var xh=Vs;var js=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._text=t,this._delegate={position:void 0,text:void 0},this._state=m.INITIALIZED}get type(){return v.getOverlayType("label_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position&&delete e.text,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("label_primitive");var Gt=js;var Th={maxOffsetY:10,offsetAmount:.1},qs=class extends Gt{constructor(e,t){super(e,t),this._currentOffset=new i.Cartesian2(0,0),this._isUp=!0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("bounce_label_primitive")}update(e){var s,o;if(!this._show)return;let t=((s=this._style)==null?void 0:s.maxOffsetY)||Th.maxOffsetY,r=((o=this._style)==null?void 0:o.offsetAmount)||Th.offsetAmount;this._currentOffset.y>=0?this._isUp=!0:this._currentOffset.y<=-t&&(this._isUp=!1),this._currentOffset.y+=r*(this._isUp?-1:1),this._delegate.pixelOffset=this._currentOffset}destroy(){return i.destroyObject(this)}};v.registerType("bounce_label_primitive");var Eh=qs;var Zs=class extends v{constructor(e){super(),this._position=y.parsePosition(e),this._delegate={position:void 0,scale:{x:12,y:8}},this._state=m.INITIALIZED}get type(){return v.getOverlayType("cloud_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("cloud_primitive");var Ph=Zs;var hy={minRadius:10,minHeight:30,color:i.Color.RED,slices:128,speed:10},Ys=class extends v{constructor(e,t,r){super(),this._center=y.parsePosition(e),this._delegate=void 0,this._height=r,this._radius=t,this._currentHeight=r||0,this._currentRadius=10,this._style={...hy},this._state=m.INITIALIZED}get type(){return v.getOverlayType("diffuse_wall_primitive")}set center(e){this._center=y.parsePosition(e)}get center(){return this._center}set radius(e){this._radius=e}get radius(){return this._radius}set height(e){this._height=e}get height(){return this._height}_getPositions(){let e=[],t=i.Transforms.eastNorthUpToFixedFrame(f.transformWGS84ToCartesian(this._center));for(let r=0;r<this._style.slices;r++){let s=r/this._style.slices*i.Math.TWO_PI,o=Math.cos(s),n=Math.sin(s),l=new i.Cartesian3(o*this._currentRadius,n*this._currentRadius,0);e.push(i.Matrix4.multiplyByPoint(t,l,new i.Cartesian3))}return e.push(e[0]),e}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}update(e){var s;if(this._delegate=this._delegate&&this._delegate.destroy(),this._currentRadius+=this._radius/this._style.speed/20,this._currentHeight-=this._height/this._style.speed/20,(this._currentRadius>this._radius||this._currentHeight<this._style.minHeight)&&(this._currentRadius=this._style.minRadius,this._currentHeight=this._height),!this._style.slices||this._style.slices<3)return!1;let t=this._getPositions();if(!t||!t.length)return!1;let r=new i.WallGeometry({positions:t,minimumHeights:this._getHeights(t.length,0),maximumHeights:this._getHeights(t.length,this._currentHeight)});this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:r}),appearance:new i.MaterialAppearance({material:i.Material.fromType("WallDiffuse",{color:(s=this._style)==null?void 0:s.color}),flat:!0}),asynchronous:!1}),this._delegate.update(e)}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this)}destroy(){return i.destroyObject(this)}};v.registerType("diffuse_wall_primitive");var bh=Ys;var Xs=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t||{x:10,y:10,z:10},this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("elec_ellipsoid_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.geometryInstances.modelMatrix=i.Transforms.eastNorthUpToFixedFrame(f.transformWGS84ToCartesian(this._position))}get position(){return this._position}set radius(e){this._radius=e,this._delegate.geometryInstances.geometry=new i.EllipsoidGeometry({radii:this._radius,maximumCone:i.Math.PI_OVER_TWO})}get radius(){return this._radius}_setAppearance(){var e,t;this._style&&(this._delegate.appearance=new i.MaterialAppearance({material:i.Material.fromType("EllipsoidElectric",{color:((e=this._style)==null?void 0:e.color)||i.Color.GREEN,speed:((t=this._style)==null?void 0:t.speed)||5})}))}_mountedHook(){this.radius=this._radius,this.position=this._position,!this._delegate.appearance&&this._setAppearance()}setLabel(e,t){return this}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),this._setAppearance(),this)}};v.registerType("elec_ellipsoid_primitive");var Ah=Xs;var Js=class extends v{constructor(e,t=1){super(),this._positions=y.parsePositions(e),this._width=t,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("flow_line_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolylineGeometry({positions:f.transformWGS84ArrayToCartesianArray(this._positions),width:this._width})}get positions(){return this._positions}_setAppearance(){var e,t,r,s;this._delegate.appearance=new i.PolylineMaterialAppearance({material:i.Material.fromType("PolylineFlow",{color:((e=this._style)==null?void 0:e.color)||new i.Color(1,0,0,.7),speed:((t=this._style)==null?void 0:t.speed)||1,percent:((r=this._style)==null?void 0:r.percent)||.03,gradient:((s=this._style)==null?void 0:s.gradient)||.1})})}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setLabel(e,t){return this}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("flow_line_primitive");var Mh=Js;var Ih="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAEACAYAAADSoXR2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXA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ZDAfkZ3tthQfkwNkVeeD6kiuaUabcp6DpS9YyalrAdQ8bT1EFQVUabarND9fNuyB2gREYAABCAAAQhAAAIQoM770UgBXARCIr/koDogVlzgrWuxemBKd0m4JnBed0+5ZQ9gn3BK5LK+P4y5ewoB8DFiKO91COLFfwVuTCZV1hSoYw1APZCsFIkbN1Haaa87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=";var cy={color:i.Color.ORANGE},Ks=class extends v{constructor(e,t,r,s){super(),this._center=y.parsePosition(e),this._length=t||100,this._topRadius=r||1,this._bottomRadius=s||50,this._delegate=new i.PrimitiveCollection,this._style={...cy},this._state=m.INITIALIZED}get type(){return v.getOverlayType("light-cylinder-primitive")}set center(e){this._center=y.parsePosition(e),this._updatePrimitives()}get center(){return this._center}set length(e){this._length=e,this._updatePrimitives()}get length(){return this._length}set topRadius(e){this._topRadius=e,this._updatePrimitives()}get topRadius(){return this._topRadius}set bottomRadius(e){this._bottomRadius=e,this._updatePrimitives()}get bottomRadius(){return this._bottomRadius}_computeEllipsePositions(e,t){let r=i.EllipseGeometryLibrary.computeEllipsePositions({center:f.transformWGS84ToCartesian(e),semiMajorAxis:t,semiMinorAxis:t,rotation:0,granularity:.005},!1,!0),s=i.Cartesian3.unpackArray(r.outerPositions);return s.push(s[0]),s}_createCylinderInstance(e,t,r){let s=t.slice(),o=t.length,n=2*o,l=[],h=1/(o-1),c=[],p=[],u=(_,d=0)=>{let T=i.Cartographic.fromCartesian(_);return T.height+=d,i.Cartographic.toCartesian(T)};for(let _=0;_<o;_++){p.push(u(e[_],r)),l.push(_*h,0);let d=_+1,T=(_+1)%o,w=n-d;c.push(w-1,w,_),c.push(_,T,w-1)}for(let _ in p)s.push(p[o-_-1]),l.push(1-_*h,1);let g=i.PolygonGeometry.createGeometry(new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(s),perPositionHeight:!0}));return g.indices=c,g.attributes.st.values=l,new i.GeometryInstance({geometry:g})}_getCircleImage(){let e=document.createElement("canvas");e.width=512,e.height=512;let t=e.getContext("2d");return t.fillStyle="rgba(255,255,255,0)",t.strokeStyle="rgba(255, 255, 255,255)",t.setLineDash([50,50]),t.lineWidth=30,t.beginPath(),t.arc(256,256,150,0,Math.PI*2,!0),t.stroke(),t.restore(),e}_getParticlesImage(e){let t=document.createElement("canvas");t.width=64,t.height=256;let r=t.getContext("2d");return r.clearRect(0,0,64,256),r.drawImage(e,0,0),r.drawImage(e,33,0),t}_updatePrimitives(){this._delegate.removeAll();let e=this._center.alt===0,t=this._computeEllipsePositions(this._center,this._topRadius),r=this._computeEllipsePositions(this._center,this._bottomRadius*.7),s=this._computeEllipsePositions(this._center,this._bottomRadius),o={geometryInstances:new i.GeometryInstance({geometry:new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(this._computeEllipsePositions(this._center,this._bottomRadius*2)),perPositionHeight:!e}),asynchronous:!1})},n=e?new i.GroundPrimitive(o):new i.Primitive(o);n.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CircleRingType,{color:this._style.color})});let l=e?new i.GroundPrimitive(o):new i.Primitive(o);l.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CircleRotateType,{color:this._style.color,image:this._getCircleImage()})});let h=new i.Primitive({geometryInstances:this._createCylinderInstance(t,r,this._length),appearance:new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CylinderFadeType,{color:this._style.color})}),asynchronous:!1});e?i.GroundPrimitive.initializeTerrainHeights().then(()=>{this._delegate.add(n),this._delegate.add(l),this._delegate.add(h)}):(this._delegate.add(n),this._delegate.add(l),this._delegate.add(h)),i.Resource.fetchImage({url:Ih}).then(c=>{let p=new i.Primitive({geometryInstances:this._createCylinderInstance(t,s,this._length),appearance:new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CylinderParticlesType,{color:this._style.color,image:this._getParticlesImage(c)})}),asynchronous:!1});this._delegate.add(p)})}_mountedHook(){this.center=this._center}update(e){this._delegate.update(e)}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this)}destroy(){return i.destroyObject(this)}};v.registerType("light-cylinder-primitive");var Sh=Ks;var Qs=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._modelUrl=t,this._delegate=i.Model.fromGltfAsync({url:t}),this._modelEvent=new yr(this._delegate),this._state=m.INITIALIZED}get type(){return v.getOverlayType("model_primitive")}set position(e){this._position=y.parsePosition(e);let t=f.transformWGS84ToCartesian(this._position);this._delegate.then(r=>{r.modelMatrix=i.Transforms.headingPitchRollToFixedFrame(t,new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))})}get position(){return this._position}set modelUrl(e){this._modelUrl=e,this._delegate=i.Model.fromGltfAsync({url:e,...this._style}),this.position=this._position}get modelUrl(){return this._modelUrl}_mountedHook(){this.position=this._position}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this._delegate.then(t=>{C.merge(t,e)}),this)}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this._modelEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this._modelEvent.off(e,t,r||this),this}};v.registerType("model_primitive");var Dh=Qs;var Lh={pixelSize:8,outlineColor:i.Color.BLUE,outlineWidth:2},$s=class extends v{constructor(e){super(),this._position=y.parsePosition(e),this._delegate={position:void 0},this._state=m.INITIALIZED}get type(){return v.getOverlayType("point_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position,C.merge(this._delegate,Lh,this._style)}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,C.merge(this._style,e),C.merge(this._delegate,Lh,this._style),this)}};v.registerType("point_primitive");var Rh=$s;var eo=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate={positions:[]},this._state=m.INITIALIZED}get type(){return v.getOverlayType("polyline_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}get center(){return ye(this._positions)}get distance(){return ie(this._positions)}_mountedHook(){this.positions=this._positions}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("polyline_primitive");var Oh=eo;var to=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t,this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("scan_circle_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.geometryInstances.geometry=new i.EllipseGeometry({center:f.transformWGS84ToCartesian(this._position),semiMajorAxis:this._radius,semiMinorAxis:this._radius})}get position(){return this._position}set radius(e){this._radius=e,this._delegate.geometryInstances.geometry.semiMajorAxis=this._radius,this._delegate.geometryInstances.geometry.semiMinorAxis=this._radius}get radius(){return this._radius}_setAppearance(){var e,t;this._style&&(this._delegate.appearance=new i.MaterialAppearance({material:i.Material.fromType("CircleScan",{color:((e=this._style)==null?void 0:e.color)||i.Color.WHITE,speed:((t=this._style)==null?void 0:t.speed)||10})}))}_mountedHook(){this.position=this._position,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("scan_circle_primitive");var kh=to;var io=class extends v{constructor(e,t=1){super(),this._positions=y.parsePositions(e),this._width=t,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("trail_line_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolylineGeometry({positions:f.transformWGS84ArrayToCartesianArray(this._positions),width:this._width})}get positions(){return this._positions}_setAppearance(){var e,t;this._delegate.appearance=new i.PolylineMaterialAppearance({material:i.Material.fromType("PolylineTrail",{color:((e=this._style)==null?void 0:e.color)||new i.Color(1,0,0,.7),speed:((t=this._style)==null?void 0:t.speed)||5})})}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("trail_line_primitive");var Fh=io;var ro=class extends v{constructor(e,t){super(),this._positions=y.parsePositions(e),this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._video=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("video_primitive")}set positions(e){var t,r,s,o;this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=i.PolygonGeometry.fromPositions({positions:f.transformWGS84ArrayToCartesianArray(this._positions),height:(t=this._style)==null?void 0:t.height,extrudedHeight:(r=this._style)==null?void 0:r.extrudedHeight,closeTop:(s=this._style)==null?void 0:s.closeTop,closeBottom:(o=this._style)==null?void 0:o.closeBottom,vertexFormat:i.EllipsoidSurfaceAppearance.VERTEX_FORMAT})}get positions(){return this._positions}set video(e){this._video=e,this._setAppearance()}get video(){return this._video}_setAppearance(){this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Image",{image:this._video})})}_mountedHook(){this.positions=this._positions,this.video=this._video}setStyle(e){var t;return Object.keys(e).length===0?this:(C.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this)}};v.registerType("video_primitive");var zh=ro;var zm=hg(Fm(),1),Mo=class extends v{constructor(e,t,r){super(),this._viewer=e,this._horizontalViewAngle=t.horizontalViewAngle||60,this._verticalViewAngle=t.verticalViewAngle||40,this._viewPosition=t.viewPosition,this._viewPositionEnd=t.viewPositionEnd,this._viewDistance=null,this._lightCamera=null,this._viewHeading=null,this._viewPitch=null,this._orientation=null,this._outLinePrimitive=null,this._outline=!1,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._video=r,this._init(),this._state=m.INITIALIZED}get type(){return v.getOverlayType("video_primitive")}set positions(e){this._createGeometry()}get positions(){return this._positions}set video(e){this._video=e,this._setAppearance()}get video(){return this._video}set outline(e){this._outline=e,this._outLinePrimitive.show=e}get outline(){return this._outline}_init(){this._viewDistance=i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd),this._viewHeading=this._getHeading(this._viewPosition,this._viewPositionEnd),this._viewPitch=this._getPitch(this._viewPosition,this._viewPositionEnd),this._createLightCamera()}_createLightCamera(){this._lightCamera=new i.Camera(this._viewer.scene),this._lightCamera.position=this._viewPosition,this._lightCamera.frustum.near=this._viewDistance*1e-4,this._lightCamera.frustum.far=this._viewDistance;let e=i.Math.toRadians(this._horizontalViewAngle),t=i.Math.toRadians(this._verticalViewAngle),r=this._viewDistance*Math.tan(e/2)*2/(this._viewDistance*Math.tan(t/2)*2);this._lightCamera.frustum.aspectRatio=r,e>t?this._lightCamera.frustum.fov=e:this._lightCamera.frustum.fov=t,this._lightCamera.setView({destination:this._viewPosition,orientation:{heading:i.Math.toRadians(this._viewHeading||0),pitch:i.Math.toRadians(this._viewPitch||0),roll:0}})}_createGeometry(){let e=new i.Cartesian3,t=new i.Matrix3,r=new i.Quaternion,s=this._lightCamera.directionWC,o=this._lightCamera.upWC,n=this._lightCamera.rightWC;n=i.Cartesian3.negate(n,e);let l=t;i.Matrix3.setColumn(l,0,n,l),i.Matrix3.setColumn(l,1,o,l),i.Matrix3.setColumn(l,2,s,l),this._orientation=i.Quaternion.fromRotationMatrix(l,r);let h=(0,zm.default)(this._lightCamera.frustum);h.near=h.far-.01,this._delegate.geometryInstances.geometry=new i.FrustumGeometry({frustum:h,origin:this._viewPosition,orientation:this._orientation}),this._setOutlineGeometry()}_setAppearance(){this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Image",{image:this._video})})}_mountedHook(){this.positions=this._positions,this.video=this._video}setStyle(e){var t;return Object.keys(e).length===0?this:(C.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this)}_getHeading(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.atan2(r.x,r.y))}_getPitch(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.asin(r.z))}_setOutlineGeometry(e=""){let t=new i.GeometryInstance({geometry:new i.FrustumOutlineGeometry({frustum:this._lightCamera.frustum,origin:this._viewPosition,orientation:this._orientation}),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(e?i.Color.fromCssColorString(e):i.Color.BLUE)}});this._outLinePrimitive=new i.Primitive({geometryInstances:[t],appearance:new i.PerInstanceColorAppearance({flat:!0})}),this._outLinePrimitive.show=this._outline,this._viewer.scene.primitives.add(this._outLinePrimitive)}};v.registerType("video_projection_primitive");var Nm=Mo;var Io=class extends v{constructor(e,t=[]){super(),this._positions=y.parsePositions(e),this._holes=t.map(r=>y.parsePositions(r)),this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}}),asynchronous:!0}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("water_primitive")}set positions(e){var t,r,s,o;this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(this._positions),this._holes.map(n=>new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(n)))),height:(t=this._style)==null?void 0:t.height,extrudedHeight:(r=this._style)==null?void 0:r.extrudedHeight,closeTop:(s=this._style)==null?void 0:s.closeTop,closeBottom:(o=this._style)==null?void 0:o.closeBottom,vertexFormat:i.EllipsoidSurfaceAppearance.VERTEX_FORMAT})}get positions(){return this._positions}_setAppearance(){var e,t,r,s,o,n,l,h;this._style&&(this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Water",{baseWaterColor:((e=this._style)==null?void 0:e.baseWaterColor)||new i.Color(.2,.3,.6,1),blendColor:((t=this._style)==null?void 0:t.blendColor)||new i.Color(0,1,.699,1),specularMap:((r=this._style)==null?void 0:r.specularMap)||i.Material.DefaultImageId,normalMap:((s=this._style)==null?void 0:s.normalMap)||i.Material.DefaultImageId,frequency:((o=this._style)==null?void 0:o.frequency)||1e3,animationSpeed:((n=this._style)==null?void 0:n.animationSpeed)||.01,amplitude:((l=this._style)==null?void 0:l.amplitude)||10,specularIntensity:((h=this._style)==null?void 0:h.specularIntensity)||.5})}))}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e){var t;return Object.keys(e).length===0?this:(C.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("water_primitive");var Hm=Io;var So=class a extends v{constructor(e,t){super(),this._delegate=new i.Entity({billboard:{}}),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._state=m.INITIALIZED}get type(){return v.getOverlayType("billboard")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("Billboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.billboard,e),this)}static fromEntity(e){var o;let t,r=i.JulianDate.now(),s=f.transformCartesianToWGS84(e.position.getValue(r));return e.billboard&&(t=new a(s,e.billboard.image.getValue(r)),t.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(r)}),t}};v.registerType("billboard");var Me=So;var Do=class extends v{constructor(e,t,r,s){super(),this._position=y.parsePosition(e),this._length=t,this._width=r,this._height=s,this._delegate=new i.Entity({box:{dimensions:{x:+this._length,y:+this._width,z:+this._height}}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("box")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set length(e){let t=this._delegate.box.dimensions.getValue();this._length=e||0,t.x=+this._length,this._delegate.box.dimensions.setValue(t)}get length(){return this._length}set width(e){let t=this._delegate.box.dimensions.getValue();this._width=e||0,t.y=+this._width,this._delegate.box.dimensions.setValue(t)}get width(){return this._width}set height(e){let t=this._delegate.box.dimensions.getValue();this._height=e||0,t.z=+this._height,this._delegate.box.dimensions.setValue(t)}get height(){return this._height}_mountedHook(){this.position=this._position}setStyle(e){return Object.keys(e).length===0?this:(delete e.length&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.box,e),this)}};v.registerType("box");var Wm=Do;var Lo=class extends v{constructor(e,t){super(),this._delegate=new i.Entity({ellipse:{}}),this._center=y.parsePosition(e),this._radius=+t||0,this._rotateAmount=0,this._stRotation=0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("circle")}set center(e){this._center=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._center)}get center(){return this._center}set radius(e){this._radius=+e,this._delegate.ellipse.semiMajorAxis=this._radius,this._delegate.ellipse.semiMinorAxis=this._radius}get radius(){return this._radius}set rotateAmount(e){this._rotateAmount=+e,this._delegate.ellipse.stRotation=new i.CallbackProperty(()=>(this._stRotation+=this._rotateAmount,(this._stRotation>=360||this._stRotation<=-360)&&(this._stRotation=0),i.Math.toRadians(this._stRotation)),!1)}get rotateAmount(){return this._rotateAmount}_mountedHook(){this.center=this._center,this.radius=this._radius}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this._center),this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.center,C.merge(this._style,e),C.merge(this._delegate.ellipse,e),this)}};v.registerType("circle");var ei=Lo;var Ro=class a extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({corridor:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("corridor")}set positions(e){this._positions=y.parsePositions(e),this._delegate.corridor.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.corridor,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("corridor");var Gm=Ro;var Oo=class extends v{constructor(e,t,r,s){super(),this._position=y.parsePosition(e),this._length=+t||0,this._topRadius=+r||0,this._bottomRadius=+s||0,this._delegate=new i.Entity({cylinder:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("cylinder")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set length(e){this._length=+e||0,this._delegate.cylinder.length=this._length}get length(){return this._length}set topRadius(e){this._topRadius=+e||0,this._delegate.cylinder.topRadius=this._topRadius}get topRadius(){return this._topRadius}set bottomRadius(e){this._bottomRadius=+e||0,this._delegate.cylinder.bottomRadius=this._bottomRadius}get bottomRadius(){return this._bottomRadius}_mountedHook(){this.position=this._position,this.length=this._length,this.topRadius=this._topRadius,this.bottomRadius=this._bottomRadius}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.length&&delete e.topRadius&&delete e.bottomRadius,C.merge(this._style,e),C.merge(this._delegate.cylinder,e),this)}};v.registerType("cylinder");var Um=Oo;var ko=class extends v{constructor(e,t,r){super(),this._position=y.parsePosition(e),this._semiMajorAxis=+t||0,this._semiMinorAxis=+r||0,this._delegate=new i.Entity({ellipse:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("ellipse")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set semiMajorAxis(e){this._semiMajorAxis=+e||0,this._delegate.ellipse.semiMajorAxis=this._semiMajorAxis}get semiMajorAxis(){return this._semiMajorAxis}set semiMinorAxis(e){this._semiMinorAxis=+e||0,this._delegate.ellipse.semiMinorAxis=this._semiMinorAxis}get semiMinorAxis(){return this._semiMinorAxis}_mountedHook(){this.position=this._position,this.semiMajorAxis=this._semiMajorAxis,this.semiMinorAxis=this._semiMinorAxis}setStyle(e){return Object.keys(e).length===0?this:(delete e.semiMajorAxis&&delete e.semiMinorAxis,C.merge(this._style,e),C.merge(this._delegate.ellipse,e),this)}};v.registerType("ellipse");var Bm=ko;var Fo=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t||{x:10,y:10,z:10},this._delegate=new i.Entity({ellipsoid:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("sphere")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set radius(e){this._radius=e||{x:10,y:10,z:10},this._delegate.ellipsoid.radii=this._radius}get radius(){return this._radius}_mountedHook(){this.position=this._position,this.radius=this._radius}setStyle(e){return Object.keys(e).length===0?this:(delete e.radius,C.merge(this._style,e),C.merge(this._delegate.ellipsoid,e),this)}};v.registerType("ellipsoid");var Vm=Fo;var zo=class a extends v{constructor(e,t){super(),this._delegate=new i.Entity({label:{}}),this._position=y.parsePosition(e),this._text=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("label")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.label.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.text,C.merge(this._style,e),C.merge(this._delegate.label,e),this)}static fromEntity(e){var o;let t=i.JulianDate.now(),r=f.transformCartesianToWGS84(e.position.getValue(t)),s;return e.billboard&&(s=new a(r,e.name),s.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(t)}),s}};v.registerType("label");var ti=zo;var No=class extends v{constructor(e,t,r,s={}){if(super(),this._position=y.parsePosition(e),this._width=+t||100,this._height=+r||100,s.normal&&typeof s.normal=="string"){let o=String(s.normal).toLocaleUpperCase();s.normal=o==="X"?i.Cartesian3.UNIT_X:o==="Y"?i.Cartesian3.UNIT_Y:i.Cartesian3.UNIT_Z}else s.normal=i.Cartesian3.UNIT_Z;this._normal=s.normal,this._distance=s.distance||0,this._delegate=new i.Entity({plane:{dimensions:{x:this._width,y:this._height},plane:new i.Plane(this._normal,this._distance)}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("plane")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set width(e){let t=this._delegate.plane.dimensions.getValue();this._width=+e||0,t.x=this._width}get width(){return this._width}set height(e){let t=this._delegate.plane.dimensions.getValue();this._height=+e||0,t.y=this._height}get height(){return this._height}set distance(e){let t=this.entityGraphic.plane.getValue();this._distance=e,t.distance=e}get distance(){return this._distance}_mountedHook(){this.position=this._position,this.distance=this._distance}setStyle(e){return Object.keys(e).length===0?this:(delete e.dimensions&&delete["plane"],C.merge(this._style,e),C.merge(this._delegate.plane,e),this)}};v.registerType("plane");var jm=No;var qm={pixelSize:8,outlineColor:i.Color.BLUE,outlineWidth:2},Ho=class a extends v{constructor(e){super(),this._delegate=new i.Entity({point:{}}),this._position=y.parsePosition(e),this._state=m.INITIALIZED}get type(){return v.getOverlayType("point")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position,C.merge(this._delegate.point,qm,this._style)}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,C.merge(this._style,e),C.merge(this._delegate.point,qm,this._style),this)}static fromEntity(e){var o;let t,r=i.JulianDate.now(),s=f.transformCartesianToWGS84(e.position.getValue(r));return t=new a(s),t.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(r)},t}};v.registerType("point");var ii=Ho;var Wo=class a extends v{constructor(e){super(),this._delegate=new i.Entity({polygon:{}}),this._positions=y.parsePositions(e),this._holes=[],this._state=m.INITIALIZED}get type(){return v.getOverlayType("polygon")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._computeHierarchy()}get positions(){return this._positions}set holes(e){e&&e.length&&(this._holes=e.map(t=>y.parsePositions(t)),this._delegate.polygon.hierarchy=this._computeHierarchy())}get holes(){return this._holes}get center(){return ye([...this._positions,this._positions[0]])}get area(){return ge(this._positions)}_computeHierarchy(){let e=new i.PolygonHierarchy;return e.positions=f.transformWGS84ArrayToCartesianArray(this._positions),e.holes=this._holes.map(t=>new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(t))),e}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this.center),this._delegate.label={text:e,...t},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polygon){let o=f.transformCartesianArrayToWGS84Array(e.polygon.hierarchy.getValue(r).positions);t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("polygon");var Ie=Wo;var Go=class a extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polyline:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("polyline")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polyline.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}get center(){return ye(this._positions)}get distance(){return ie(this._positions)}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this.center),this._delegate.label={text:e,...t},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polyline,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("polyline");var Se=Go;var Uo=class a extends v{constructor(e,t){super(),this._positions=y.parsePositions(e),this._shape=t||[],this._delegate=new i.Entity({polylineVolume:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("polyline_volume")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polylineVolume.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}set shape(e){this._shape=e||[],this._delegate.polylineVolume.shape=this._shape}get shape(){return this._shape}_mountedHook(){this.positions=this._positions,this.shape=this._shape}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions&&delete e.shape,C.merge(this._style,e),C.merge(this._delegate.polylineVolume,e),this)}static fromEntity(e,t){var o;let r,s=i.JulianDate.now();if(e.polyline){let n=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(s));r=new a(n,t),r.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(s)}}return r}};v.registerType("polyline_volume");var Zm=Uo;var Bo=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({rectangle:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("rect")}set positions(e){this._positions=y.parsePositions(e),this._delegate.rectangle.coordinates=i.Rectangle.fromCartesianArray(f.transformWGS84ArrayToCartesianArray(this._positions))}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){let r=this._delegate.rectangle.coordinates.getValue();return this._delegate.position=i.Cartographic.toCartesian(i.Rectangle.center(r,new i.Cartographic)),this._delegate.label={...t,text:e},this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.rectangle,e),this)}};v.registerType("rect");var ri=Bo;var Vo=class a extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({wall:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("wall")}set positions(e){this._positions=y.parsePositions(e),this._delegate.wall.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.wall,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("wall");var Ym=Vo;var jo=class extends v{constructor(e,t,r){super(),this._viewer=e,this._delegate=new i.Entity({wall:{}}),this._center=y.parsePosition(t),this._radius=+r||0,this._heading=0,this._headingSpeed=1,this._rotateAmount=0,this._stRotation=0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("volum_radar")}set center(e){this._center=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._center),this.positionArr=this._calcPoints(this._center._lng,this._center._lat,this._radius,0),this._createWallAndEllipsoid(),this._addPostRender()}get center(){return this._center}set radius(e){this._radius=+e}get radius(){return this._radius}set headingSpeed(e){this._headingSpeed=e}get headingSpeed(){return this._headingSpeed}set rotateAmount(e){}get rotateAmount(){return this._rotateAmount}_createWallAndEllipsoid(){this._delegate.wall={positions:new i.CallbackProperty(()=>i.Cartesian3.fromDegreesArrayHeights(this.positionArr),!1),material:this._style.material||i.Color.fromCssColorString("#00dcff82"),distanceDisplayCondition:this._style.distanceDisplayCondition||new i.DistanceDisplayCondition(0,105e5)},this._delegate.ellipsoid={radii:new i.Cartesian3(this._radius,this._radius,this._radius),maximumCone:i.Math.toRadians(90),material:this._style.material||i.Color.fromCssColorString("#00dcff82"),outline:this._style.outline||!0,outlineColor:this._style.material||i.Color.fromCssColorString("#00dcff82"),outlineWidth:this._style.outlineWidth||1,stackPartitions:this._style.stackPartitions||40,slicePartitions:this._style.slicePartitions||40,distanceDisplayCondition:this._style.distanceDisplayCondition||new i.DistanceDisplayCondition(0,105e5)}}_addPostRender(){this.tickListener=this._viewer.clock.onTick.addEventListener(()=>{this._heading+=this._headingSpeed,this.positionArr=this._calcPoints(this._center._lng,this._center._lat,this._radius,this._heading)})}_calcPoints(e,t,r,s){let o=i.Transforms.eastNorthUpToFixedFrame(i.Cartesian3.fromDegrees(e,t)),n=r*Math.cos(s*Math.PI/180),l=r*Math.sin(s*Math.PI/180),h=i.Cartesian3.fromElements(n,l,0),c=i.Matrix4.multiplyByPoint(o,h,new i.Cartesian3),p=i.Cartographic.fromCartesian(c),u=i.Math.toDegrees(p.longitude),g=i.Math.toDegrees(p.latitude);return this._computeCirclularFlight(e,t,u,g,0,90)}_computeCirclularFlight(e,t,r,s,o,n){let l=[];l.push(e),l.push(t),l.push(0);let h=i.Cartesian3.distance(i.Cartesian3.fromDegrees(e,t),i.Cartesian3.fromDegrees(r,s));for(let c=o;c<=o+n;c++){let p=h*Math.sin(c*Math.PI/180),u=Math.cos(c*Math.PI/180),g=(r-e)*u+e,_=(s-t)*u+t;l.push(g),l.push(_),l.push(p)}return l}_computeHierarchy(){let e=new i.PolygonHierarchy,t=i.EllipseGeometryLibrary.computeEllipsePositions({center:f.transformWGS84ToCartesian(this._center),semiMajorAxis:this._radius,semiMinorAxis:this._radius,rotation:0,granularity:.005},!1,!0),r=i.Cartesian3.unpackArray(t.outerPositions);return r.push(r[0]),e.positions=r,e}_mountedHook(){this.center=this._center}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this._center),this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.wall,e),C.merge(this._delegate.ellipsoid,e),this)}};v.registerType("volum_radar");var Xm=jo;var qo=class extends A{constructor(e,t,r={}){if(!t)throw new Error("GeoJsonLayer\uFF1Athe url invalid");super(e),this._delegate=i.GeoJsonDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("geojson")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}_createBillboard(e){if(e.position&&e.billboard)return Me.fromEntity(e)}_createPolyline(e){if(e.polyline)return Se.fromEntity(e)}_createPolygon(e){if(e.polygon)return Ie.fromEntity(e)}_createModel(e,t){if(e)return Ge.fromEntity(e,t)}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}toVectorLayer(){let e=new ue(this.id);return this.eachOverlay(t=>{t.billboard?e.addOverlay(this._createBillboard(t)):t.polyline?e.addOverlay(this._createPolyline(t)):t.polygon&&e.addOverlay(this._createPolygon(t))},this),e}toModelLayer(e){let t=new ue(this.id);return this.eachOverlay(r=>{t.addOverlay(this._createModel(r,e))},this),t}};A.registerType("geojson");var si=qo;var Zo=class extends A{constructor(e,t,r={}){if(!t)throw new Error("GpxLayer: the url is empty");super(e),this._delegate=i.KmlDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("gpx")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("gpx");var Jm=Zo;var kT={radialColor:i.Color.WHITE,radialWidth:2,showRadial:!0,LabelColor:i.Color.YELLOW,weftColor:i.Color.WHITE,weftWidth:2},Yo=class extends A{constructor(e,t){super(e),this._options={...kT,...t},this._delegate=new i.CustomDataSource(e),this._state=m.INITIALIZED}get type(){return A.getLayerType("graticule")}_addedHook(){for(let e=0;e<36;e++)this._delegate.entities.add({polyline:{positions:i.Cartesian3.fromDegreesArray([e*10,89.5,e*10,-89.5]),material:this._options.radialColor,width:this._options.radialWidth},show:this._options.showRadial}),this._delegate.entities.add({position:i.Cartesian3.fromDegrees(e*10,0),label:{text:e*10+"\xB0",font:"12px",fillColor:this._options.LabelColor}});for(let e=0;e<18;e++){let t=[];for(let r=0;r<129;r++)t.push(-180+r*(360/128),(e<9?e:-e)*10);this._delegate.entities.add({polyline:{positions:i.Cartesian3.fromDegreesArray(t),material:this._options.weftColor,width:this._options.weftWidth}})}}};A.registerType("graticule");var Km=Yo;var Xo=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._isGround=!0,this._state=m.INITIALIZED}get type(){return A.getLayerType("ground_primitive")}clear(){return this._delegate&&this._delegate.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("ground_primitive");var Qm=Xo;var Jo=class extends A{constructor(e){super(e),this._delegate=I.create("div","html-layer",void 0),this._delegate.setAttribute("id",this._id),this._renderRemoveCallback=void 0,this._state=m.INITIALIZED}get type(){return A.getLayerType("html")}set show(e){this._show=e,this._delegate.style.visibility=this._show?"visible":"hidden",Object.keys(this._cache).forEach(t=>{this._cache[t].show=e})}get show(){return this._show}_onAdd(e){this._viewer=e,this._viewer.layerContainer.appendChild(this._delegate);let t=this._viewer.scene;this._renderRemoveCallback=t.postRender.addEventListener(()=>{let r=this._viewer.camera.positionWC,s=this._viewer.camera.direction,o=this._viewer.getOffset();this.eachOverlay(n=>{if(n&&n.position){let l=f.transformWGS84ToCartesian(n.position),h=t.globe.ellipsoid.geodeticSurfaceNormal(l,new i.Cartesian3),c=i.SceneTransforms.worldToWindowCoordinates(t,l);c&&(c.x+=o.x,c.y+=o.y),n._updateStyle(c,i.Cartesian3.distance(l,r),i.Cartesian3.dot(s,h)<=0)}},this)},this),this._state=m.ADDED}_onRemove(){this._renderRemoveCallback&&this._renderRemoveCallback(),this._viewer.layerContainer.removeChild(this._delegate),this._state=m.REMOVED}clear(){for(;this._delegate.hasChildNodes();)this._delegate.removeChild(this._delegate.firstChild);return this._cache={},this._state=m.CLEARED,this}};A.registerType("html");var $m=Jo;var Ko=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._state=m.INITIALIZED}get type(){return A.getLayerType("i3s")}clear(){return this._delegate.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("i3s");var eu=Ko;var Qo=class extends A{constructor(e,t,r={}){if(!t)throw new Error("KmlLayer: the url is empty");super(e),this._delegate=i.KmlDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("kml")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("kml");var tu=Qo;var $o=class extends A{constructor(e,t=""){super(e),this._dataSource=i.GeoJsonDataSource.load(t),this._delegate=new i.CustomDataSource(e),this._initLabel(),this._state=m.INITIALIZED}get type(){return A.getLayerType("label")}_createLabel(e){if(e.position&&e.name)return ti.fromEntity(e)}_initLabel(){this._dataSource.then(e=>{e.entities.values.forEach(r=>{let s=this._createLabel(r);this.addOverlay(s)})})}};A.registerType("label");var iu=$o;var ea=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._points=this._delegate.add(new i.PointPrimitiveCollection),this._labels=this._delegate.add(new i.LabelCollection),this._billboards=this._delegate.add(new i.BillboardCollection),this._polylines=this._delegate.add(new i.PolylineCollection),this._clouds=this._delegate.add(new i.CloudCollection),this._state=m.INITIALIZED}get type(){return A.getLayerType("primitive")}get points(){return this._points}get labels(){return this._labels}get billboards(){return this._billboards}get polylines(){return this._polylines}get clouds(){return this._clouds}clear(){return this._delegate&&this._delegate.removeAll(),this._points=this._delegate.add(new i.PointPrimitiveCollection),this._labels=this._delegate.add(new i.LabelCollection),this._billboards=this._delegate.add(new i.BillboardCollection),this._polylines=this._delegate.add(new i.PolylineCollection),this._clouds=this._delegate.add(new i.CloudCollection),this._cache={},this._state=m.CLEARED,this}};A.registerType("primitive");var ru=ea;var ta=class extends A{constructor(e,t,r){super(e),this._delegate=i.ImageryLayer.fromProviderAsync(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("raster-tile")}};A.registerType("raster-tile");var su=ta;var ia=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._state=m.INITIALIZED}get type(){return A.getLayerType("tileset")}clear(){return this._delegate.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("tileset");var ou=ia;si.registerType("topojson");var ra=class extends A{constructor(e,t,r={}){if(!t)throw"Shp2JsonLayer\uFF1Athe url invalid";if(!q("shpUtil"))throw"missing shpUtil";super(e);let o=this._init(t,r);this._delegate=i.GeoJsonDataSource.load(o,r),this._state=m.INITIALIZED}async _init(e,t){var s;return await shpUtil.toGeoJSON(e,void 0,(s=t.encoding)!=null?s:"gbk",t.crs)}get type(){return A.getLayerType("shp")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}_createBillboard(e){if(e.position&&e.billboard)return Me.fromEntity(e)}_createPolyline(e){if(e.polyline)return Se.fromEntity(e)}_createPolygon(e){if(e.polygon)return Ie.fromEntity(e)}_createModel(e,t){if(e)return Ge.fromEntity(e,t)}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}toVectorLayer(){let e=new ue(this.id);return this.eachOverlay(t=>{t.billboard?e.addOverlay(this._createBillboard(t)):t.polyline?e.addOverlay(this._createPolyline(t)):t.polygon&&e.addOverlay(this._createPolygon(t))},this),e}toModelLayer(e){let t=new ue(this.id);return this.eachOverlay(r=>{t.addOverlay(this._createModel(r,e))},this),t}};A.registerType("shp");var au=ra;var lu=[].indexOf||function(a){for(let e=0,t=this.length;e<t;e++)if(e in this&&this[e]===a)return e;return-1},oi=`attribute vec4 position;
|
|
136
|
+
varying vec2 texcoord;
|
|
137
|
+
void main(){
|
|
138
|
+
texcoord = position.xy*0.5+0.5;
|
|
139
|
+
gl_Position = position;
|
|
140
|
+
}`,ai=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
141
|
+
precision highp int;
|
|
142
|
+
precision highp float;
|
|
143
|
+
#else
|
|
144
|
+
precision mediump int;
|
|
145
|
+
precision mediump float;
|
|
146
|
+
#endif
|
|
147
|
+
uniform sampler2D source;
|
|
148
|
+
varying vec2 texcoord;`,FT=function(){let a,e,t,r;if(window.WebGLRenderingContext!=null)return r=["WEBKIT","MOZ","MS","O"],t=/^WEBKIT_(.*)|MOZ_(.*)|MS_(.*)|O_(.*)/,a=WebGLRenderingContext.prototype.getExtension,WebGLRenderingContext.prototype.getExtension=function(s){let o,n,l,h,c;if(n=s.match(t),n!==null&&(s=n[1]),o=a.call(this,s),o===null){for(h=0,c=r.length;h<c;h++)if(l=r[h],o=a.call(this,l+"_"+s),o!==null)return o;return null}else return o},e=WebGLRenderingContext.prototype.getSupportedExtensions,WebGLRenderingContext.prototype.getSupportedExtensions=function(){let s,o,n,l,h,c;for(l=e.call(this),n=[],h=0,c=l.length;h<c;h++)s=l[h],o=s.match(t),o!==null&&(s=o[1]),lu.call(n,s)<0&&n.push(s);return n}},zT=function(){let a,e,t,r,s,o,n,l,h,c,p,u,g,_;if(s=function(){let d,T,w;return d=document.createElement("canvas"),d.width=2,d.height=2,T=d.getContext("2d"),w=T.getImageData(0,0,2,2),w.data.set(new Uint8ClampedArray([0,0,0,0,255,255,255,255,0,0,0,0,255,255,255,255])),T.putImageData(w,0,0),d},s(),e=function(d,T){let w,P,M,R,F,H,ee,Y,B,ze,it,Le,de,Ne;if(H=d.createProgram(),de=d.createShader(d.VERTEX_SHADER),d.attachShader(H,de),d.shaderSource(de,`attribute vec2 position;
|
|
149
|
+
void main(){
|
|
150
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
151
|
+
}`),d.compileShader(de),!d.getShaderParameter(de,d.COMPILE_STATUS))throw d.getShaderInfoLog(de);if(M=d.createShader(d.FRAGMENT_SHADER),d.attachShader(H,M),d.shaderSource(M,`uniform sampler2D source;
|
|
152
|
+
void main(){
|
|
153
|
+
gl_FragColor = texture2D(source, vec2(1.0, 1.0));
|
|
154
|
+
}`),d.compileShader(M),!d.getShaderParameter(M,d.COMPILE_STATUS))throw d.getShaderInfoLog(M);if(d.linkProgram(H),!d.getProgramParameter(H,d.LINK_STATUS))throw d.getProgramInfoLog(H);return d.useProgram(H),P=function(){return d.deleteShader(M),d.deleteShader(de),d.deleteProgram(H),d.deleteBuffer(w),d.deleteTexture(B),d.deleteTexture(Le),d.deleteFramebuffer(R),d.bindBuffer(d.ARRAY_BUFFER,null),d.useProgram(null),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null)},Le=d.createTexture(),d.bindTexture(d.TEXTURE_2D,Le),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,2,2,0,d.RGBA,d.UNSIGNED_BYTE,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),R=d.createFramebuffer(),d.bindFramebuffer(d.FRAMEBUFFER,R),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,Le,0),ze=s(),B=d.createTexture(),d.bindTexture(d.TEXTURE_2D,B),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,T,ze),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),Ne=new Float32Array([1,1,-1,1,-1,-1,1,1,-1,-1,1,-1]),w=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,w),d.bufferData(d.ARRAY_BUFFER,Ne,d.STATIC_DRAW),F=d.getAttribLocation(H,"position"),it=d.getUniformLocation(H,"source"),d.enableVertexAttribArray(F),d.vertexAttribPointer(F,2,d.FLOAT,!1,0,0),d.uniform1i(it,0),d.drawArrays(d.TRIANGLES,0,6),ee=new Uint8Array(4*4),d.readPixels(0,0,2,2,d.RGBA,d.UNSIGNED_BYTE,ee),Y=Math.abs(ee[0]-127)<10,P(),Y},r=function(d,T){let w;return w=d.createTexture(),d.bindTexture(d.TEXTURE_2D,w),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,2,2,0,d.RGBA,T,null),d.getError()===0?(d.deleteTexture(w),!0):(d.deleteTexture(w),!1)},a=function(d,T){let w,P,M;return M=d.createTexture(),d.bindTexture(d.TEXTURE_2D,M),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,2,2,0,d.RGBA,T,null),P=d.createFramebuffer(),d.bindFramebuffer(d.FRAMEBUFFER,P),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,M,0),w=d.checkFramebufferStatus(d.FRAMEBUFFER),d.deleteTexture(M),d.deleteFramebuffer(P),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null),w===d.FRAMEBUFFER_COMPLETE},h=[],c={},p=[],t=function(){let d,T,w,P,M,R,F;d=document.createElement("canvas"),w=null;try{w=d.getContext("experimental-webgl"),w===null&&(w=d.getContext("webgl"))}catch{}if(w!=null&&(R=w.getExtension("OES_texture_float"),R===null?r(w,w.FLOAT)?(F=!0,h.push("OES_texture_float"),c.OES_texture_float={shim:!0}):(F=!1,p.push("OES_texture_float")):r(w,w.FLOAT)?(F=!0,h.push("OES_texture_float")):(F=!1,p.push("OES_texture_float")),F&&(T=w.getExtension("WEBGL_color_buffer_float"),T===null?a(w,w.FLOAT)?(h.push("WEBGL_color_buffer_float"),c.WEBGL_color_buffer_float={shim:!0,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863}):p.push("WEBGL_color_buffer_float"):a(w,w.FLOAT)?h.push("WEBGL_color_buffer_float"):p.push("WEBGL_color_buffer_float"),T=w.getExtension("OES_texture_float_linear"),T===null?e(w,w.FLOAT)?(h.push("OES_texture_float_linear"),c.OES_texture_float_linear={shim:!0}):p.push("OES_texture_float_linear"):e(w,w.FLOAT)?h.push("OES_texture_float_linear"):p.push("OES_texture_float_linear")),P=w.getExtension("OES_texture_half_float"),P===null?r(w,36193)?(M=!0,h.push("OES_texture_half_float"),P=c.OES_texture_half_float={HALF_FLOAT_OES:36193,shim:!0}):(M=!1,p.push("OES_texture_half_float")):r(w,P.HALF_FLOAT_OES)?(M=!0,h.push("OES_texture_half_float")):(M=!1,p.push("OES_texture_half_float")),M))return T=w.getExtension("EXT_color_buffer_half_float"),T===null?a(w,P.HALF_FLOAT_OES)?(h.push("EXT_color_buffer_half_float"),c.EXT_color_buffer_half_float={shim:!0,RGBA16F_EXT:34842,RGB16F_EXT:34843,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863}):p.push("EXT_color_buffer_half_float"):a(w,P.HALF_FLOAT_OES)?h.push("EXT_color_buffer_half_float"):p.push("EXT_color_buffer_half_float"),T=w.getExtension("OES_texture_half_float_linear"),T===null?e(w,P.HALF_FLOAT_OES)?(h.push("OES_texture_half_float_linear"),c.OES_texture_half_float_linear={shim:!0}):p.push("OES_texture_half_float_linear"):e(w,P.HALF_FLOAT_OES)?h.push("OES_texture_half_float_linear"):p.push("OES_texture_half_float_linear")},window.WebGLRenderingContext!=null){for(t(),u={},g=0,_=p.length;g<_;g++)l=p[g],u[l]=!0;return o=WebGLRenderingContext.prototype.getExtension,WebGLRenderingContext.prototype.getExtension=function(d){let T;return T=c[d],T===void 0?u[d]?null:o.call(this,d):T},n=WebGLRenderingContext.prototype.getSupportedExtensions,WebGLRenderingContext.prototype.getSupportedExtensions=function(){let d,T,w,P,M,R,F;for(w=n.call(this),T=[],P=0,R=w.length;P<R;P++)d=w[P],u[d]===void 0&&T.push(d);for(M=0,F=h.length;M<F;M++)d=h[M],lu.call(T,d)<0&&T.push(d);return T},WebGLRenderingContext.prototype.getFloatExtension=function(d){let T,w,P,M,R,F,H,ee,Y,B,ze,it,Le,de,Ne,Tt,Et,Pt,Zn,Yn,Xn,Jn,Wi,Kn,Gi,Ui;for(d.prefer==null&&(d.prefer=["half"]),d.require==null&&(d.require=[]),d.throws==null&&(d.throws=!0),de=this.getExtension("OES_texture_float"),F=this.getExtension("OES_texture_half_float"),it=this.getExtension("WEBGL_color_buffer_float"),M=this.getExtension("EXT_color_buffer_half_float"),Le=this.getExtension("OES_texture_float_linear"),R=this.getExtension("OES_texture_half_float_linear"),ze={texture:de!==null,filterable:Le!==null,renderable:it!==null,score:0,precision:"single",half:!1,single:!0,type:this.FLOAT},P={texture:F!==null,filterable:R!==null,renderable:M!==null,score:0,precision:"half",half:!0,single:!1,type:(Kn=F!=null?F.HALF_FLOAT_OES:void 0)!=null?Kn:null},w=[],ze.texture&&w.push(ze),P.texture&&w.push(P),B=[],Tt=0,Zn=w.length;Tt<Zn;Tt++){for(T=w[Tt],Ne=!0,Gi=d.require,Et=0,Yn=Gi.length;Et<Yn;Et++)l=Gi[Et],T[l]===!1&&(Ne=!1);Ne&&B.push(T)}for(Pt=0,Xn=B.length;Pt<Xn;Pt++)for(T=B[Pt],Ui=d.prefer,H=Wi=0,Jn=Ui.length;Wi<Jn;H=++Wi)Y=Ui[H],ee=Math.pow(2,d.prefer.length-H-1),T[Y]&&(T.score+=ee);if(B.sort(function(Bi,Vi){if(Bi.score===Vi.score)return 0;if(Bi.score<Vi.score)return 1;if(Bi.score>Vi.score)return-1}),B.length===0){if(d.throws)throw"No floating point texture support that is "+d.require.join(", ");return null}else return B=B[0],{filterable:B.filterable,renderable:B.renderable,type:B.type,precision:B.precision}}}};FT();zT();var Ct=function(){function a(e,t){let r,s;this.gl=e,s=t.vertex,r=t.fragment,this.program=this.gl.createProgram(),this.vs=this.gl.createShader(this.gl.VERTEX_SHADER),this.fs=this.gl.createShader(this.gl.FRAGMENT_SHADER),this.gl.attachShader(this.program,this.vs),this.gl.attachShader(this.program,this.fs),this.compileShader(this.vs,s),this.compileShader(this.fs,r),this.link(),this.value_cache={},this.uniform_cache={},this.attribCache={}}return a.prototype.attribLocation=function(e){let t=this.attribCache[e];return t===void 0&&(t=this.attribCache[e]=this.gl.getAttribLocation(this.program,e)),t},a.prototype.compileShader=function(e,t){if(this.gl.shaderSource(e,t),this.gl.compileShader(e),!this.gl.getShaderParameter(e,this.gl.COMPILE_STATUS))throw"Shader Compile Error: "+this.gl.getShaderInfoLog(e)},a.prototype.link=function(){if(this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))throw"Shader Link Error: "+this.gl.getProgramInfoLog(this.program)},a.prototype.use=function(){return this.gl.useProgram(this.program),this},a.prototype.uniformLoc=function(e){let t=this.uniform_cache[e];return t===void 0&&(t=this.uniform_cache[e]=this.gl.getUniformLocation(this.program,e)),t},a.prototype.int=function(e,t){let r,s;return r=this.value_cache[e],r!==t&&(this.value_cache[e]=t,s=this.uniformLoc(e),s&&this.gl.uniform1i(s,t)),this},a.prototype.vec2=function(e,t,r){let s;return s=this.uniformLoc(e),s&&this.gl.uniform2f(s,t,r),this},a.prototype.float=function(e,t){let r,s;return r=this.value_cache[e],r!==t&&(this.value_cache[e]=t,s=this.uniformLoc(e),s&&this.gl.uniform1f(s,t)),this},a}(),NT=function(){function a(e){this.gl=e,this.buffer=this.gl.createFramebuffer()}return a.prototype.destroy=function(){return this.gl.deleteFRamebuffer(this.buffer)},a.prototype.bind=function(){return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.buffer),this},a.prototype.unbind=function(){return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this},a.prototype.check=function(){let e;switch(e=this.gl.checkFramebufferStatus(this.gl.FRAMEBUFFER),e){case this.gl.FRAMEBUFFER_UNSUPPORTED:throw"Framebuffer is unsupported";case this.gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:throw"Framebuffer incomplete attachment";case this.gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:throw"Framebuffer incomplete dimensions";case this.gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:throw"Framebuffer incomplete missing attachment"}return this},a.prototype.color=function(e){return this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,e.target,e.handle,0),this.check(),this},a.prototype.depth=function(e){return this.gl.framebufferRenderbuffer(this.gl.FRAMEBUFFER,this.gl.DEPTH_ATTACHMENT,this.gl.RENDERBUFFER,e.id),this.check(),this},a.prototype.destroy=function(){return this.gl.deleteFramebuffer(this.buffer)},a}(),hu=function(){function a(e,t){let r,s;switch(this.gl=e,t==null&&(t={}),this.channels=this.gl[((r=t.channels)!=null?r:"rgba").toUpperCase()],typeof t.type=="number"?this.type=t.type:this.type=this.gl[((s=t.type)!=null?s:"unsigned_byte").toUpperCase()],this.channels){case this.gl.RGBA:this.chancount=4;break;case this.gl.RGB:this.chancount=3;break;case this.gl.LUMINANCE_ALPHA:this.chancount=2;break;default:this.chancount=1}this.target=this.gl.TEXTURE_2D,this.handle=this.gl.createTexture()}return a.prototype.destroy=function(){return this.gl.deleteTexture(this.handle)},a.prototype.bind=function(e){if(e==null&&(e=0),e>15)throw"Texture unit too large: "+e;return this.gl.activeTexture(this.gl.TEXTURE0+e),this.gl.bindTexture(this.target,this.handle),this},a.prototype.setSize=function(e,t){return this.width=e,this.height=t,this.gl.texImage2D(this.target,0,this.channels,this.width,this.height,0,this.channels,this.type,null),this},a.prototype.upload=function(e){return this.width=e.width,this.height=e.height,this.gl.texImage2D(this.target,0,this.channels,this.channels,this.type,e),this},a.prototype.linear=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this},a.prototype.nearest=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this},a.prototype.clampToEdge=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this},a.prototype.repeat=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.gl.REPEAT),this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.gl.REPEAT),this},a}(),nu=function(){function a(e,t,r){let s;this.gl=e,this.width=t,this.height=r,s=this.gl.getFloatExtension({require:["renderable"]}),this.texture=new hu(this.gl,{type:s.type}).bind(0).setSize(this.width,this.height).nearest().clampToEdge(),this.fbo=new NT(this.gl).bind().color(this.texture).unbind()}return a.prototype.use=function(){return this.fbo.bind()},a.prototype.bind=function(e){return this.texture.bind(e)},a.prototype.end=function(){return this.fbo.unbind()},a.prototype.resize=function(e,t){return this.width=e,this.height=t,this.texture.bind(0).setSize(this.width,this.height)},a}(),HT=function(){function a(e,t,r,s){let o,n,l;for(this.heatmap=e,this.gl=t,this.width=r,this.height=s,this.shader=new Ct(this.gl,{vertex:`attribute vec4 position, intensity;
|
|
155
|
+
varying vec2 off, dim;
|
|
156
|
+
varying float vIntensity;
|
|
157
|
+
uniform vec2 viewport;
|
|
158
|
+
|
|
159
|
+
void main(){
|
|
160
|
+
dim = abs(position.zw);
|
|
161
|
+
off = position.zw;
|
|
162
|
+
vec2 pos = position.xy + position.zw;
|
|
163
|
+
vIntensity = intensity.x;
|
|
164
|
+
gl_Position = vec4((pos/viewport)*2.0-1.0, 0.0, 1.0);
|
|
165
|
+
}`,fragment:`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
166
|
+
precision highp int;
|
|
167
|
+
precision highp float;
|
|
168
|
+
#else
|
|
169
|
+
precision mediump int;
|
|
170
|
+
precision mediump float;
|
|
171
|
+
#endif
|
|
172
|
+
varying vec2 off, dim;
|
|
173
|
+
varying float vIntensity;
|
|
174
|
+
void main(){
|
|
175
|
+
float falloff = (1.0 - smoothstep(0.0, 1.0, length(off/dim)));
|
|
176
|
+
float intensity = falloff*vIntensity;
|
|
177
|
+
gl_FragColor = vec4(intensity);
|
|
178
|
+
}`}),this.clampShader=new Ct(this.gl,{vertex:oi,fragment:ai+`uniform float low, high;
|
|
179
|
+
void main(){
|
|
180
|
+
gl_FragColor = vec4(clamp(texture2D(source, texcoord).rgb, low, high), 1.0);
|
|
181
|
+
}`}),this.multiplyShader=new Ct(this.gl,{vertex:oi,fragment:ai+`uniform float value;
|
|
182
|
+
void main(){
|
|
183
|
+
gl_FragColor = vec4(texture2D(source, texcoord).rgb*value, 1.0);
|
|
184
|
+
}`}),this.blurShader=new Ct(this.gl,{vertex:oi,fragment:ai+`uniform vec2 viewport;
|
|
185
|
+
void main(){
|
|
186
|
+
vec4 result = vec4(0.0);
|
|
187
|
+
for(int x=-1; x<=1; x++){
|
|
188
|
+
for(int y=-1; y<=1; y++){
|
|
189
|
+
vec2 off = vec2(x,y)/viewport;
|
|
190
|
+
//float factor = 1.0 - smoothstep(0.0, 1.5, length(off));
|
|
191
|
+
float factor = 1.0;
|
|
192
|
+
result += vec4(texture2D(source, texcoord+off).rgb*factor, factor);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
gl_FragColor = vec4(result.rgb/result.w, 1.0);
|
|
196
|
+
}`}),this.nodeBack=new nu(this.gl,this.width,this.height),this.nodeFront=new nu(this.gl,this.width,this.height),this.vertexBuffer=this.gl.createBuffer(),this.vertexSize=8,this.maxPointCount=1024*10,this.vertexBufferData=new Float32Array(this.maxPointCount*this.vertexSize*6),this.vertexBufferViews=[],o=n=0,l=this.maxPointCount;0<=l?n<l:n>l;o=0<=l?++n:--n)this.vertexBufferViews.push(new Float32Array(this.vertexBufferData.buffer,0,o*this.vertexSize*6));this.bufferIndex=0,this.pointCount=0}return a.prototype.resize=function(e,t){return this.width=e,this.height=t,this.nodeBack.resize(this.width,this.height),this.nodeFront.resize(this.width,this.height)},a.prototype.update=function(){var e,t;if(this.pointCount>0)return this.gl.enable(this.gl.BLEND),this.nodeFront.use(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.vertexBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.vertexBufferViews[this.pointCount],this.gl.STREAM_DRAW),t=this.shader.attribLocation("position"),e=this.shader.attribLocation("intensity"),this.gl.enableVertexAttribArray(1),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,8*4,0),this.gl.vertexAttribPointer(e,4,this.gl.FLOAT,!1,8*4,4*4),this.shader.use().vec2("viewport",this.width,this.height),this.gl.drawArrays(this.gl.TRIANGLES,0,this.pointCount*6),this.gl.disableVertexAttribArray(1),this.pointCount=0,this.bufferIndex=0,this.nodeFront.end(),this.gl.disable(this.gl.BLEND)},a.prototype.clear=function(){return this.nodeFront.use(),this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.nodeFront.end()},a.prototype.clamp=function(e,t){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.clampShader.use().int("source",0).float("low",e).float("high",t),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.multiply=function(e){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.multiplyShader.use().int("source",0).float("value",e),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.blur=function(){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.blurShader.use().int("source",0).vec2("viewport",this.width,this.height),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.swap=function(){let e=this.nodeFront;return this.nodeFront=this.nodeBack,this.nodeBack=e},a.prototype.addVertex=function(e,t,r,s,o){return this.vertexBufferData[this.bufferIndex++]=e,this.vertexBufferData[this.bufferIndex++]=t,this.vertexBufferData[this.bufferIndex++]=r,this.vertexBufferData[this.bufferIndex++]=s,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o},a.prototype.addPoint=function(e,t,r,s){let o;return r==null&&(r=50),s==null&&(s=.2),this.pointCount>=this.maxPointCount-1&&this.update(),t=this.height-t,o=r/2,this.addVertex(e,t,-o,-o,s),this.addVertex(e,t,+o,-o,s),this.addVertex(e,t,-o,+o,s),this.addVertex(e,t,-o,+o,s),this.addVertex(e,t,+o,-o,s),this.addVertex(e,t,+o,+o,s),this.pointCount+=1},a}(),WT=function(){function a(e){let t,r,s,o,n,l,h,c,p,u,g,_,d;_=e!=null?e:{},this.canvas=_.canvas,this.width=_.width,this.height=_.height,c=_.intensityToAlpha,l=_.gradientTexture,r=_.alphaRange,this.canvas||(this.canvas=document.createElement("canvas"));try{if(this.gl=this.canvas.getContext("experimental-webgl",{depth:!1,antialias:!1}),this.gl===null&&(this.gl=this.canvas.getContext("webgl",{depth:!1,antialias:!1}),this.gl===null))throw"WebGL not supported"}catch(T){throw o=T,"WebGL not supported"}window.WebGLDebugUtils!=null&&(this.gl=window.WebGLDebugUtils.makeDebugContext(this.gl,function(T,w,P){throw window.WebGLDebugUtils.glEnumToString(T)+" was caused by call to: "+w})),this.gl.enableVertexAttribArray(0),this.gl.blendFunc(this.gl.ONE,this.gl.ONE),l?(g=this.gradientTexture=new hu(this.gl,{channels:"rgba"}).bind(0).setSize(2,2).nearest().clampToEdge(),typeof l=="string"?(h=new Image,h.onload=function(){return g.bind().upload(h)},h.src=l):l.width>0&&l.height>0?g.upload(l):l.onload=function(){return g.upload(l)},n=`uniform sampler2D gradientTexture;
|
|
197
|
+
vec3 getColor(float intensity){
|
|
198
|
+
return texture2D(gradientTexture, vec2(intensity, 0.0)).rgb;
|
|
199
|
+
}`):(g=null,n=`vec3 getColor(float intensity){
|
|
200
|
+
vec3 blue = vec3(0.0, 0.0, 1.0);
|
|
201
|
+
vec3 cyan = vec3(0.0, 1.0, 1.0);
|
|
202
|
+
vec3 green = vec3(0.0, 1.0, 0.0);
|
|
203
|
+
vec3 yellow = vec3(1.0, 1.0, 0.0);
|
|
204
|
+
vec3 red = vec3(1.0, 0.0, 0.0);
|
|
205
|
+
|
|
206
|
+
vec3 color = (
|
|
207
|
+
fade(-0.25, 0.25, intensity)*blue +
|
|
208
|
+
fade(0.0, 0.5, intensity)*cyan +
|
|
209
|
+
fade(0.25, 0.75, intensity)*green +
|
|
210
|
+
fade(0.5, 1.0, intensity)*yellow +
|
|
211
|
+
smoothstep(0.75, 1.0, intensity)*red
|
|
212
|
+
);
|
|
213
|
+
return color;
|
|
214
|
+
}`),c==null&&(c=!0),c?(d=r!=null?r:[0,1],s=d[0],t=d[1],p=`vec4 alphaFun(vec3 color, float intensity){
|
|
215
|
+
float alpha = smoothstep(`+s.toFixed(8)+", "+t.toFixed(8)+`, intensity);
|
|
216
|
+
return vec4(color*alpha, alpha);
|
|
217
|
+
}`):p=`vec4 alphaFun(vec3 color, float intensity){
|
|
218
|
+
return vec4(color, 1.0);
|
|
219
|
+
}`,this.shader=new Ct(this.gl,{vertex:oi,fragment:ai+(`float linstep(float low, float high, float value){
|
|
220
|
+
return clamp((value-low)/(high-low), 0.0, 1.0);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
float fade(float low, float high, float value){
|
|
224
|
+
float mid = (low+high)*0.5;
|
|
225
|
+
float range = (high-low)*0.5;
|
|
226
|
+
float x = 1.0 - clamp(abs(mid-value)/range, 0.0, 1.0);
|
|
227
|
+
return smoothstep(0.0, 1.0, x);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
`+n+`
|
|
231
|
+
`+p+`
|
|
232
|
+
|
|
233
|
+
void main(){
|
|
234
|
+
float intensity = smoothstep(0.0, 1.0, texture2D(source, texcoord).r);
|
|
235
|
+
vec3 color = getColor(intensity);
|
|
236
|
+
gl_FragColor = alphaFun(color, intensity);
|
|
237
|
+
}`)}),this.width==null&&(this.width=this.canvas.offsetWidth||2),this.height==null&&(this.height=this.canvas.offsetHeight||2),this.canvas.width=this.width,this.canvas.height=this.height,this.gl.viewport(0,0,this.width,this.height),this.quad=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.quad),u=new Float32Array([-1,-1,0,1,1,-1,0,1,-1,1,0,1,-1,1,0,1,1,-1,0,1,1,1,0,1]),this.gl.bufferData(this.gl.ARRAY_BUFFER,u,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),this.heights=new HT(this,this.gl,this.width,this.height)}return a.prototype.adjustSize=function(){let e,t;if(t=this.canvas.offsetWidth||2,e=this.canvas.offsetHeight||2,this.width!==t||this.height!==e)return this.gl.viewport(0,0,t,e),this.canvas.width=t,this.canvas.height=e,this.width=t,this.height=e,this.heights.resize(this.width,this.height)},a.prototype.display=function(){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.heights.nodeFront.bind(0),this.gradientTexture&&this.gradientTexture.bind(1),this.shader.use().int("source",0).int("gradientTexture",1),this.gl.drawArrays(this.gl.TRIANGLES,0,6)},a.prototype.update=function(){return this.heights.update()},a.prototype.clear=function(){return this.heights.clear()},a.prototype.clamp=function(e,t){return e==null&&(e=0),t==null&&(t=1),this.heights.clamp(e,t)},a.prototype.multiply=function(e){return e==null&&(e=.95),this.heights.multiply(e)},a.prototype.blur=function(){return this.heights.blur()},a.prototype.addPoint=function(e,t,r,s){return this.heights.addPoint(e,t,r,s)},a.prototype.addPoints=function(e){let t,r,s,o;for(o=[],r=0,s=e.length;r<s;r++)t=e[r],o.push(this.addPoint(t.x,t.y,t.size,t.intensity));return o},a}();function sa(a){return new WT(a)}var oa=new i.WebMercatorProjection,GT={radius:30,height:0,gradient:void 0,useGround:!1,classificationType:2},aa=class extends A{constructor(e,t={}){super(e),this._options={...GT,...t},this._delegate=new i.PrimitiveCollection,this._isGround=this._options.useGround,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id",e),this._heat=void 0,this._scale=1,this._points=[],this._bounds=new i.Rectangle,this._boundsInMeter=void 0,this._primitive=this._delegate.add(this._isGround?new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}}),classificationType:this._options.classificationType}):new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})})),this._state=m.INITIALIZED}get type(){return A.getLayerType("heat-map")}_addedHook(){this._canvas.style.cssText=`
|
|
238
|
+
visibility:hidden;
|
|
239
|
+
width:${this._viewer.canvas.width}px;
|
|
240
|
+
height:${this._viewer.canvas.height}px;
|
|
241
|
+
`,this._viewer.layerContainer.appendChild(this._canvas),this._points&&this._points.length&&(this._heat=sa({canvas:this._canvas,gradientTexture:this._createGradientTexture()}),this._scale=Math.min(Math.abs(this._boundsInMeter.west-this._boundsInMeter.east)/this._viewer.canvas.width,Math.abs(this._boundsInMeter.north-this._boundsInMeter.south)/this._viewer.canvas.height),this._heat.blur(),this._heat.addPoints(this._parsePoints(this._points)),this._update())}_createGradientTexture(){if(!this._options.gradient)return;let e=document.createElement("canvas");e.width=200,e.height=10;let t=e.getContext("2d"),r=t.createLinearGradient(0,0,200,0);for(let s in this._options.gradient)r.addColorStop(+s,this._options.gradient[s]);return t.fillStyle=r,t.fillRect(0,0,200,10),e}_parsePoints(e){return e.map(t=>{let r=oa.project(i.Cartographic.fromDegrees(t.lng,t.lat));return{x:(r.x-this._boundsInMeter.west)/this._scale,y:(r.y-this._boundsInMeter.south)/this._scale,size:this._options.radius,intensity:t.value||Math.random()}})}_computeBounds(){i.Rectangle.fromCartographicArray(this._points.map(e=>i.Cartographic.fromDegrees(e.lng,e.lat)),this._bounds)}_computeBoundsInMeter(){let e=oa.project(i.Rectangle.southwest(this._bounds)),t=oa.project(i.Rectangle.northeast(this._bounds));this._boundsInMeter=new i.Rectangle(e.x,e.y,t.x,t.y)}_update(){if(!this._points||!this._points.length)return!1;this._heat.adjustSize(),this._heat.update(),this._heat.display(),this._primitive&&this._primitive.geometryInstances&&(this._primitive.geometryInstances.geometry=new i.RectangleGeometry({rectangle:this._bounds,height:this._options.height})),this._primitive.appearance=new i.MaterialAppearance({material:new i.Material({fabric:{type:"Heat-Image",uniforms:{image:this._canvas},source:`
|
|
242
|
+
uniform sampler2D image;
|
|
243
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){
|
|
244
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
245
|
+
vec2 st = materialInput.st;
|
|
246
|
+
vec4 colorImage = texture(image,st);
|
|
247
|
+
if(colorImage.rgb == vec3(1.0) || colorImage.rgb == vec3(0.0)){
|
|
248
|
+
discard;
|
|
249
|
+
}
|
|
250
|
+
material.diffuse = colorImage.rgb;
|
|
251
|
+
material.alpha = colorImage.a;
|
|
252
|
+
return material;
|
|
253
|
+
}
|
|
254
|
+
`},translucent:function(e){return!0}}),flat:!0})}setPoints(e){return this._points=e,this._computeBounds(),this._computeBoundsInMeter(),this._viewer&&(this._scale=Math.min(Math.abs(this._boundsInMeter.west-this._boundsInMeter.east)/this._viewer.canvas.width,Math.abs(this._boundsInMeter.north-this._boundsInMeter.south)/this._viewer.canvas.height),this._heat=sa({canvas:this._canvas,gradientTexture:this._createGradientTexture()})),this._heat&&(this._heat.blur(),this._heat.addPoints(this._parsePoints(this._points)),this._update()),this}clear(){return this._heat.clear(),this._points=[],this._state=m.CLEARED,this}};A.registerType("heat-map");var UT=aa;var na=class{constructor(e,t){this.u=e,this.v=t,this.m=this.magnitude()}magnitude(){return Math.sqrt(this.u*this.u+this.v*this.v)}directionTo(){let t=Math.atan2(this.u,this.v)*(180/Math.PI);return t<0&&(t+=360),t}directionFrom(){return(this.directionTo()+180)%360}},la=na;var ha=class{constructor(e){this.grid=[],this.xmin=e.xmin,this.xmax=e.xmax,this.ymin=e.ymin,this.ymax=e.ymax,this.cols=e.cols,this.rows=e.rows,this.us=e.us,this.vs=e.vs,this.deltaX=e.deltaX,this.deltaY=e.deltaY,this.deltaY<0&&this.ymin<this.ymax?console.warn("[wind-core]: The data is flipY"):(this.ymin=Math.min(e.ymax,e.ymin),this.ymax=Math.max(e.ymax,e.ymin)),this.isFields=!0;let t=Math.ceil((this.xmax-this.xmin)/e.deltaX),r=Math.ceil((this.ymax-this.ymin)/e.deltaY);(t!==this.cols||r!==this.rows)&&console.warn("[wind-core]: The data grid not equal"),this.isContinuous=Math.floor(this.cols*e.deltaX)>=360,this.wrappedX="wrappedX"in e?e.wrappedX:this.xmax>180,this.grid=this.buildGrid(),this.range=this.calculateRange()}buildGrid(){let e=[],t=0,r=this,s=r.rows,o=r.cols,n=r.us,l=r.vs;for(let h=0;h<s;h++){let c=[];for(let p=0;p<o;p++,t++){let u=n[t],g=l[t],_=this.isValid(u)&&this.isValid(g);c[p]=_?new la(u,g):null}this.isContinuous&&c.push(c[0]),e[h]=c}return e}release(){this.grid=[]}extent(){return[this.xmin,this.ymin,this.xmax,this.ymax]}bilinearInterpolateVector(e,t,r,s,o,n){let l=1-e,h=1-t,c=l*h,p=e*h,u=l*t,g=e*t,_=r.u*c+s.u*p+o.u*u+n.u*g,d=r.v*c+s.v*p+o.v*u+n.v*g;return new la(_,d)}calculateRange(){if(!this.grid||!this.grid[0])return;let e=this.grid.length,t=this.grid[0].length,r,s;for(let o=0;o<e;o++)for(let n=0;n<t;n++){let l=this.grid[o][n];if(l!==null){let h=l.m||l.magnitude();r===void 0?r=h:s===void 0?(s=h,r=Math.min(r,s),s=Math.max(r,s)):(r=Math.min(h,r),s=Math.max(h,s))}}return[r,s]}isValid(e){return e!=null}getWrappedLongitudes(){let e=this.xmin,t=this.xmax;return this.wrappedX&&(this.isContinuous?(e=-180,t=180):(t=this.xmax-360,e=this.xmin-360)),[e,t]}contains(e,t){let r=this.getWrappedLongitudes(),s=r[0],o=r[1],n=e>=s&&e<=o,l;return this.deltaY>=0?l=t>=this.ymin&&t<=this.ymax:l=t>=this.ymax&&t<=this.ymin,n&&l}floorMod(e,t){return e-t*Math.floor(e/t)}getDecimalIndexes(e,t){let r=this.floorMod(e-this.xmin,360)/this.deltaX,s=(this.ymax-t)/this.deltaY;return[r,s]}valueAt(e,t){if(!this.contains(e,t))return null;let r=this.getDecimalIndexes(e,t),s=Math.floor(r[0]),o=Math.floor(r[1]),n=this.clampColumnIndex(s),l=this.clampRowIndex(o);return this.valueAtIndexes(n,l)}interpolatedValueAt(e,t){if(!this.contains(e,t))return null;let r=this.getDecimalIndexes(e,t),s=r[0],o=r[1];return this.interpolatePoint(s,o)}hasValueAt(e,t){return this.valueAt(e,t)!==null}interpolatePoint(e,t){let r=this.getFourSurroundingIndexes(e,t),s=r[0],o=r[1],n=r[2],l=r[3],h=this.getFourSurroundingValues(s,o,n,l);if(h){let c=h[0],p=h[1],u=h[2],g=h[3];return this.bilinearInterpolateVector(e-s,t-n,c,p,u,g)}return null}clampColumnIndex(e){let t=e;e<0&&(t=0);let r=this.cols-1;return e>r&&(t=r),t}clampRowIndex(e){let t=e;e<0&&(t=0);let r=this.rows-1;return e>r&&(t=r),t}getFourSurroundingIndexes(e,t){let r=Math.floor(e),s=r+1;this.isContinuous&&s>=this.cols&&(s=0),s=this.clampColumnIndex(s);let o=this.clampRowIndex(Math.floor(t)),n=this.clampRowIndex(o+1);return[r,s,o,n]}getFourSurroundingValues(e,t,r,s){let o;if(o=this.grid[r]){let n=o[e],l=o[t];if(this.isValid(n)&&this.isValid(l)&&(o=this.grid[s])){let h=o[e],c=o[t];if(this.isValid(h)&&this.isValid(c))return[n,l,h,c]}}return null}valueAtIndexes(e,t){return this.grid[t][e]}lonLatAtIndexes(e,t){let r=this.longitudeAtX(e),s=this.latitudeAtY(t);return[r,s]}longitudeAtX(e){let t=this.deltaX/2,r=this.xmin+t+e*this.deltaX;return this.wrappedX&&(r=r>180?r-360:r),r}latitudeAtY(e){let t=this.deltaY/2;return this.ymax-t-e*this.deltaY}randomize(e,t,r,s){e===void 0&&(e={});let o=Math.random()*(t||this.cols)|0,n=Math.random()*(r||this.rows)|0,l=s([o,n]);return l!==null?(e.x=l[0],e.y=l[1]):(e.x=this.longitudeAtX(o),e.y=this.latitudeAtY(n)),e}checkFields(){return this.isFields}},cu=ha;var ca=class{constructor(e){this.options={},this.particles=[],this.ctx=e,this.animationLoop=void 0,this.animate=this.animate.bind(this)}_indexFor(e,t,r,s){return Math.max(0,Math.min(s.length-1,Math.round((e-t)/(r-t)*(s.length-1))))}_moveParticles(){if(!this.particles||!this.particles.length)return;let e=this.ctx.canvas.width,t=this.ctx.canvas.height,r=this.particles,s=this.options.maxAge,o=typeof this.options.velocityScale=="function"?this.options.velocityScale():this.options.velocityScale;for(let n=0;n<r.length;n++){let l=r[n];l.age>s&&(l.age=0,this.field.randomize(l,e,t,this.unProject));let h=l.x,c=l.y,p=this.field.interpolatedValueAt(h,c);if(p===null)l.age=s;else{let u=h+p.u*o,g=c+p.v*o;this.field.hasValueAt(u,g)?(l.xt=u,l.yt=g,l.m=p.m):(l.x=u,l.y=g,l.age=s)}l.age++}}_drawParticles(){if(!this.particles||!this.particles.length)return;let e=this.particles,t=this.ctx.globalCompositeOperation;this.ctx.globalCompositeOperation="destination-in",this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.globalCompositeOperation=t,this.ctx.globalAlpha=this.options.globalAlpha,this.ctx.fillStyle="rgba(0, 0, 0, "+this.options.globalAlpha+")",this.ctx.lineWidth=this.options.lineWidth?this.options.lineWidth:1,this.ctx.strokeStyle=this.options.colorScale?this.options.colorScale:"#fff";let r=0,s=e.length;if(this.field&&s>0){let o,n;if(this.options.minVelocity&&this.options.maxVelocity)o=this.options.minVelocity,n=this.options.maxVelocity;else{let l=this.field.range;o=l[0],n=l[1]}for(;r<s;r++)this[this.options.useCoordsDraw?"_drawCoordsParticle":"_drawPixelParticle"](e[r],o,n)}}_drawPixelParticle(e,t,r){let s=[e.x,e.y],o=[e.xt,e.yt],n=e.xt-e.x,l=e.yt-e.y;n*n+l*l>20*20||o&&s&&o[0]&&o[1]&&s[0]&&s[1]&&e.age<=this.options.maxAge&&this._drawStroke(s,o,e,t,r)}_drawCoordsParticle(e,t,r){let s=[e.x,e.y],o=[e.xt,e.yt];if(o&&s&&o[0]&&o[1]&&s[0]&&s[1]&&this.intersectsCoordinate(o)&&e.age<=this.options.maxAge){let n=this.project(s),l=this.project(o);this._drawStroke(n,l,e,t,r)}}_drawStroke(e,t,r,s,o){if(e&&t){if(this.ctx.beginPath(),this.ctx.moveTo(e[0],e[1]),this.ctx.lineTo(t[0],t[1]),typeof this.options.colorScale=="function")this.ctx.strokeStyle=this.options.colorScale(r.m);else if(Array.isArray(this.options.colorScale)){let n=this._indexFor(r.m,s,o,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}typeof this.options.lineWidth=="function"&&(this.ctx.lineWidth=this.options.lineWidth(r.m)),r.x=r.xt,r.y=r.yt,this.ctx.stroke()}}_prepareParticlePaths(){let e=this.ctx.canvas.width,t=this.ctx.canvas.height,r=typeof this.options.paths=="function"?this.options.paths(this):this.options.paths,s=[];if(!this.field)return[];for(let o=0;o<r;o++)s.push(this.field.randomize({age:Math.floor(Math.random()*this.options.maxAge)},e,t,this.unProject));return s}project(){throw new Error("project must be override")}unProject(){throw new Error("unProject must be override")}intersectsCoordinate(e){throw new Error("must be override")}prerender(){this.field&&(this.particles=this._prepareParticlePaths(),!this.starting&&!this.forceStop&&(this.starting=!0,this._then=Date.now(),this.animate()))}render(){return this._moveParticles(),this._drawParticles(),this}clearCanvas(){this.stop(),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.forceStop=!1}start(){this.starting=!0,this.forceStop=!1,this._then=Date.now(),this.animate()}stop(){cancelAnimationFrame(this.animationLoop),this.starting=!1,this.forceStop=!0}animate(){this.animationLoop&&cancelAnimationFrame(this.animationLoop),this.animationLoop=requestAnimationFrame(this.animate);let e=Date.now(),t=e-this._then;t>this.options.frameRate&&(this._then=e-t%this.options.frameRate,this.render())}setData(e){return this.field=e,this}setOptions(e){var t,r,s,o;return this.options=e,!((t=this.options)!=null&&t.maxAge)&&((r=this.options)!=null&&r.particleAge)&&(this.options.maxAge=Number(this.options.particleAge)),!((s=this.options)!=null&&s.paths)&&((o=this.options)!=null&&o.particleMultiplier)&&(this.options.paths=Math.round(this.options.width*this.options.height*Number(this.options.particleMultiplier))),this}},pu=ca;var BT={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:1/25,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0},pa=class extends A{constructor(e,t={}){super(e),this._options={...BT,...t},this._data=void 0,this._canvas=document.createElement("canvas"),this._state=m.INITIALIZED}get type(){return A.getLayerType("wind")}set show(e){this._show=e,this._canvas.style.visibility=e?"visible":"hidden"}get show(){return this._show}_formatData(e){let t,r;if(e.forEach(function(o){switch(o.header.parameterCategory+","+o.header.parameterNumber){case"1,2":case"2,2":t=o;break;case"1,3":case"2,3":r=o;break}}),!r||!t)return;let s=t.header;return new cu({xmin:s.lo1,ymin:s.la1,xmax:s.lo2,ymax:s.la2,deltaX:s.dx,deltaY:s.dy,cols:s.nx,rows:s.ny,us:t.data,vs:r.data})}_mountCanvas(){if(!this._viewer||!this._canvas)return;this._canvas.style.cssText="position:absolute; left:0; top:0;user-select:none;pointer-events: none;",this._canvas.className="dc-wind-layer";let{width:e,height:t}=this._viewer.canvas;this._canvas.width=e,this._canvas.height=t,this._canvas.style.width=e+"px",this._canvas.style.height=t+"px",this._viewer.layerContainer.appendChild(this._canvas)}_addedHook(){let e=this._viewer.scene,t=this._viewer.camera,r=i.Ellipsoid.WGS84;this._delegate.intersectsCoordinate=s=>{if(e.mode===i.SceneMode.SCENE3D){let o=new i.EllipsoidalOccluder(r,t.position),n=i.Cartesian3.fromDegrees(s[0],s[1]);return o.isPointVisible(n)}else if(e.mode===i.SceneMode.SCENE2D)return!(s[0]===-180||s[0]===180);return!0},this._delegate.project=s=>{let o=i.Cartesian3.fromDegrees(s[0],s[1]),n=i.SceneTransforms.worldToWindowCoordinates(e,o);return[n.x,n.y]},this._delegate.unProject=s=>{let o=new i.Cartesian2(s[0],s[1]),n;if(e.mode===i.SceneMode.SCENE3D?n=e.globe.pick(t.getPickRay(o),e):n=e.camera.pickEllipsoid(o,r),!n)return null;let l=r.cartesianToCartographic(n),h=i.Math.toDegrees(l.latitude);return[i.Math.toDegrees(l.longitude),h]}}_onAdd(e){this._viewer=e,this._mountCanvas();let t=this._canvas.getContext("2d");this._delegate||(this._delegate=new pu(t),this._delegate.setOptions(this._options),this._addedHook()),this._data&&(this._delegate.setData(this._data),this._delegate.prerender(),this._delegate.render())}_onRemove(){this._delegate&&this._delegate.stop(),this._canvas&&this._viewer.layerContainer.removeChild(this._canvas),delete this._canvas}setData(e,t){return e&&e.checkFields&&e.checkFields()?this._data=e:Array.isArray(e)&&(this._data=this._formatData(e)),this._delegate&&(this._delegate.setData(this._data),t&&(this._options={...this._options,...t},this._delegate.setOptions(this._options)),this._delegate.prerender(),this._delegate.render()),this}setOptions(e){return this._options={...this._options,...e},this._delegate&&(this._delegate.setOptions(this._options),this._delegate.prerender(),this._delegate.render()),this}};A.registerType("wind");var VT=pa;var{Cartesian3:ni,Ellipsoid:jT,Math:du}=i;function _e(a){this._api=a,this._viewer=Object(a.getZr()).viewer,this._mapOffset=[0,0],this.dimensions=["lng","lat"]}_e.prototype.getViewer=function(){return this._viewer};_e.prototype.setMapOffset=function(a){return this._mapOffset=a,this};_e.prototype.dataToPoint=function(a){let e=[],t=ni.fromDegrees(a[0],a[1]);if(!t)return e;let r=jT.WGS84.geodeticSurfaceNormal(t,new ni),s=this._viewer.camera.direction;if(ni.dot(r,s)>=0)return e;let o=this._viewer.scene.cartesianToCanvasCoordinates(t);return o?[o.x-this._mapOffset[0],o.y-this._mapOffset[1]]:e};_e.prototype.pointToData=function(a){let e=this._viewer.scene.globe.ellipsoid,t=new ni(a[0]+this._mapOffset[0],a[1]+this._mapOffset[1],0),r=e.cartesianToCartographic(t);return[du.toDegrees(r.longitude),du.toDegrees(r.latitude)]};_e.create=function(a,e){let t;a.eachComponent("GLMap",function(r){t=new _e(e),t.setMapOffset(r.__mapOffset||[0,0]),r.coordinateSystem=t}),a.eachSeries(function(r){r.get("coordinateSystem")==="GLMap"&&(r.coordinateSystem=t)})};_e.dimensions=["lng","lat"];function qT(a){_e.prototype.getViewRect=function(){let e=this._api;return new a.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},_e.prototype.getRoamTransform=function(){return a.matrix.create()}}var mu=!1;function uu(a){if(mu)return;let{registerAction:e,registerCoordinateSystem:t,extendComponentModel:r,extendComponentView:s}=a;r({type:"GLMap",getViewer(){return Object(this.getZr()).viewer},defaultOption:{roam:!1}}),s({type:"GLMap",init:function(o,n){this.api=n,n.getZr().viewer.clock.onTick.addEventListener(this.moveHandler,this)},moveHandler:function(){this.api.getZr().dom.style.visibility!=="hidden"&&this.api.dispatchAction({type:"GLMapRoam"})},render:function(o,n,l){},dispose:function(){this.api.getZr().viewer.clock.onTick.removeEventListener(this.moveHandler,this)}}),qT(a),t("GLMap",_e),e({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(o,n){}),mu=!0}var da=class extends A{constructor(e,t){if(!q("echarts"))throw new Error("miss the echarts lib");super(e),this._option=t,this._delegate=void 0,this._chart=void 0}set show(e){this._show=e,this._delegate.style.visibility=e?"visible":"hidden"}get show(){return this._show}_createChartElement(){let e=this._viewer.scene.canvas,t=document.createElement("div");return t.setAttribute("id",this._id),t.setAttribute("data-layer-type","chart-layer"),t.style.cssText=`position:absolute; top:0; left:0; width: ${e.clientWidth}px; height: ${e.clientHeight}px;pointer-events:none;`,this._viewer.layerContainer.appendChild(t),t}_onAdd(e){let t=q("echarts");uu(t),this._viewer=e,this._viewer.canvas.setAttribute("tabIndex","0"),this._delegate=this._createChartElement(),this._chart=t.init(this._delegate),Object(this._chart.getZr()).viewer=e,this._option&&this._chart.setOption({...this._option,GLMap:{},animation:!1}),this._state=m.ADDED}_onRemove(){this._delegate&&this._viewer&&(this._chart.dispose(),this._viewer.layerContainer.removeChild(this._delegate),this._state=m.REMOVED)}setOption(e={}){return this._option=e,this._chart&&this._chart.setOption({...e,GLMap:{},animation:!1}),this}clear(){return this._chart.clear(),this}resize(){return this._chart.resize(),this}},ZT=da;var _u=`/**\r
|
|
255
|
+
* @license\r
|
|
256
|
+
* Cellular noise ("Worley noise") in 2D in GLSL.\r
|
|
257
|
+
* Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved.\r
|
|
258
|
+
* This code is released under the conditions of the MIT license.\r
|
|
259
|
+
* See LICENSE file for details.\r
|
|
260
|
+
*/\r
|
|
261
|
+
\r
|
|
262
|
+
//#ifdef GL_OES_standard_derivatives\r
|
|
263
|
+
// #extension GL_OES_standard_derivatives : enable\r
|
|
264
|
+
//#endif\r
|
|
265
|
+
//\r
|
|
266
|
+
//float aastep (float threshold , float value)\r
|
|
267
|
+
//{\r
|
|
268
|
+
// float afwidth = 0.7 * length ( vec2 ( dFdx ( value ), dFdy ( value )));\r
|
|
269
|
+
// return smoothstep ( threshold - afwidth , threshold + afwidth , value );\r
|
|
270
|
+
//}\r
|
|
271
|
+
\r
|
|
272
|
+
// Permutation polynomial: (34x^2 + x) mod 289\r
|
|
273
|
+
vec3 _czm_permute289(vec3 x)\r
|
|
274
|
+
{\r
|
|
275
|
+
return mod((34.0 * x + 1.0) * x, 289.0);\r
|
|
276
|
+
}\r
|
|
277
|
+
\r
|
|
278
|
+
/**\r
|
|
279
|
+
* DOC_TBA\r
|
|
280
|
+
*\r
|
|
281
|
+
* Implemented by Stefan Gustavson, and distributed under the MIT License. {@link http://openglinsights.git.sourceforge.net/git/gitweb.cgi?p=openglinsights/openglinsights;a=tree;f=proceduraltextures}\r
|
|
282
|
+
*\r
|
|
283
|
+
* @name czm_cellular\r
|
|
284
|
+
* @glslFunction\r
|
|
285
|
+
*\r
|
|
286
|
+
* @see Stefan Gustavson's chapter, <i>Procedural Textures in GLSL</i>, in <a href="http://www.openglinsights.com/">OpenGL Insights</a>.\r
|
|
287
|
+
*/\r
|
|
288
|
+
vec2 czm_cellular(vec2 P)\r
|
|
289
|
+
// Cellular noise, returning F1 and F2 in a vec2.\r
|
|
290
|
+
// Standard 3x3 search window for good F1 and F2 values\r
|
|
291
|
+
{\r
|
|
292
|
+
#define K 0.142857142857 // 1/7\r
|
|
293
|
+
#define Ko 0.428571428571 // 3/7\r
|
|
294
|
+
#define jitter 1.0 // Less gives more regular pattern\r
|
|
295
|
+
vec2 Pi = mod(floor(P), 289.0);\r
|
|
296
|
+
vec2 Pf = fract(P);\r
|
|
297
|
+
vec3 oi = vec3(-1.0, 0.0, 1.0);\r
|
|
298
|
+
vec3 of = vec3(-0.5, 0.5, 1.5);\r
|
|
299
|
+
vec3 px = _czm_permute289(Pi.x + oi);\r
|
|
300
|
+
vec3 p = _czm_permute289(px.x + Pi.y + oi); // p11, p12, p13\r
|
|
301
|
+
vec3 ox = fract(p*K) - Ko;\r
|
|
302
|
+
vec3 oy = mod(floor(p*K),7.0)*K - Ko;\r
|
|
303
|
+
vec3 dx = Pf.x + 0.5 + jitter*ox;\r
|
|
304
|
+
vec3 dy = Pf.y - of + jitter*oy;\r
|
|
305
|
+
vec3 d1 = dx * dx + dy * dy; // d11, d12 and d13, squared\r
|
|
306
|
+
p = _czm_permute289(px.y + Pi.y + oi); // p21, p22, p23\r
|
|
307
|
+
ox = fract(p*K) - Ko;\r
|
|
308
|
+
oy = mod(floor(p*K),7.0)*K - Ko;\r
|
|
309
|
+
dx = Pf.x - 0.5 + jitter*ox;\r
|
|
310
|
+
dy = Pf.y - of + jitter*oy;\r
|
|
311
|
+
vec3 d2 = dx * dx + dy * dy; // d21, d22 and d23, squared\r
|
|
312
|
+
p = _czm_permute289(px.z + Pi.y + oi); // p31, p32, p33\r
|
|
313
|
+
ox = fract(p*K) - Ko;\r
|
|
314
|
+
oy = mod(floor(p*K),7.0)*K - Ko;\r
|
|
315
|
+
dx = Pf.x - 1.5 + jitter*ox;\r
|
|
316
|
+
dy = Pf.y - of + jitter*oy;\r
|
|
317
|
+
vec3 d3 = dx * dx + dy * dy; // d31, d32 and d33, squared\r
|
|
318
|
+
// Sort out the two smallest distances (F1, F2)\r
|
|
319
|
+
vec3 d1a = min(d1, d2);\r
|
|
320
|
+
d2 = max(d1, d2); // Swap to keep candidates for F2\r
|
|
321
|
+
d2 = min(d2, d3); // neither F1 nor F2 are now in d3\r
|
|
322
|
+
d1 = min(d1a, d2); // F1 is now in d1\r
|
|
323
|
+
d2 = max(d1a, d2); // Swap to keep candidates for F2\r
|
|
324
|
+
d1.xy = (d1.x < d1.y) ? d1.xy : d1.yx; // Swap if smaller\r
|
|
325
|
+
d1.xz = (d1.x < d1.z) ? d1.xz : d1.zx; // F1 is in d1.x\r
|
|
326
|
+
d1.yz = min(d1.yz, d2.yz); // F2 is now not in d2.yz\r
|
|
327
|
+
d1.y = min(d1.y, d1.z); // nor in d1.z\r
|
|
328
|
+
d1.y = min(d1.y, d2.x); // F2 is in d1.y, we're done.\r
|
|
329
|
+
return sqrt(d1.xy);\r
|
|
330
|
+
}\r
|
|
331
|
+
`;var fu=`/**\r
|
|
332
|
+
* @license\r
|
|
333
|
+
* Description : Array and textureless GLSL 2D/3D/4D simplex\r
|
|
334
|
+
* noise functions.\r
|
|
335
|
+
* Author : Ian McEwan, Ashima Arts.\r
|
|
336
|
+
* Maintainer : ijm\r
|
|
337
|
+
* Lastmod : 20110822 (ijm)\r
|
|
338
|
+
* License : Copyright (C) 2011 Ashima Arts. All rights reserved.\r
|
|
339
|
+
* Distributed under the MIT License. See LICENSE file.\r
|
|
340
|
+
* https://github.com/ashima/webgl-noise\r
|
|
341
|
+
*/\r
|
|
342
|
+
\r
|
|
343
|
+
vec4 _czm_mod289(vec4 x)\r
|
|
344
|
+
{\r
|
|
345
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;\r
|
|
346
|
+
}\r
|
|
347
|
+
\r
|
|
348
|
+
vec3 _czm_mod289(vec3 x)\r
|
|
349
|
+
{\r
|
|
350
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;\r
|
|
351
|
+
}\r
|
|
352
|
+
\r
|
|
353
|
+
vec2 _czm_mod289(vec2 x)\r
|
|
354
|
+
{\r
|
|
355
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;\r
|
|
356
|
+
}\r
|
|
357
|
+
\r
|
|
358
|
+
float _czm_mod289(float x)\r
|
|
359
|
+
{\r
|
|
360
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;\r
|
|
361
|
+
}\r
|
|
362
|
+
\r
|
|
363
|
+
vec4 _czm_permute(vec4 x)\r
|
|
364
|
+
{\r
|
|
365
|
+
return _czm_mod289(((x*34.0)+1.0)*x);\r
|
|
366
|
+
}\r
|
|
367
|
+
\r
|
|
368
|
+
vec3 _czm_permute(vec3 x)\r
|
|
369
|
+
{\r
|
|
370
|
+
return _czm_mod289(((x*34.0)+1.0)*x);\r
|
|
371
|
+
}\r
|
|
372
|
+
\r
|
|
373
|
+
float _czm_permute(float x)\r
|
|
374
|
+
{\r
|
|
375
|
+
return _czm_mod289(((x*34.0)+1.0)*x);\r
|
|
376
|
+
}\r
|
|
377
|
+
\r
|
|
378
|
+
vec4 _czm_taylorInvSqrt(vec4 r)\r
|
|
379
|
+
{\r
|
|
380
|
+
return 1.79284291400159 - 0.85373472095314 * r;\r
|
|
381
|
+
}\r
|
|
382
|
+
\r
|
|
383
|
+
float _czm_taylorInvSqrt(float r)\r
|
|
384
|
+
{\r
|
|
385
|
+
return 1.79284291400159 - 0.85373472095314 * r;\r
|
|
386
|
+
}\r
|
|
387
|
+
\r
|
|
388
|
+
vec4 _czm_grad4(float j, vec4 ip)\r
|
|
389
|
+
{\r
|
|
390
|
+
const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\r
|
|
391
|
+
vec4 p,s;\r
|
|
392
|
+
\r
|
|
393
|
+
p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\r
|
|
394
|
+
p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\r
|
|
395
|
+
s = vec4(lessThan(p, vec4(0.0)));\r
|
|
396
|
+
p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\r
|
|
397
|
+
\r
|
|
398
|
+
return p;\r
|
|
399
|
+
}\r
|
|
400
|
+
\r
|
|
401
|
+
/**\r
|
|
402
|
+
* DOC_TBA\r
|
|
403
|
+
*\r
|
|
404
|
+
* Implemented by Ian McEwan, Ashima Arts, and distributed under the MIT License. {@link https://github.com/ashima/webgl-noise}\r
|
|
405
|
+
*\r
|
|
406
|
+
* @name czm_snoise\r
|
|
407
|
+
* @glslFunction\r
|
|
408
|
+
*\r
|
|
409
|
+
* @see <a href="https://github.com/ashima/webgl-noise">https://github.com/ashima/webgl-noise</a>\r
|
|
410
|
+
* @see Stefan Gustavson's paper <a href="http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf">Simplex noise demystified</a>\r
|
|
411
|
+
*/\r
|
|
412
|
+
float czm_snoise(vec2 v)\r
|
|
413
|
+
{\r
|
|
414
|
+
const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\r
|
|
415
|
+
0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\r
|
|
416
|
+
-0.577350269189626, // -1.0 + 2.0 * C.x\r
|
|
417
|
+
0.024390243902439); // 1.0 / 41.0\r
|
|
418
|
+
// First corner\r
|
|
419
|
+
vec2 i = floor(v + dot(v, C.yy) );\r
|
|
420
|
+
vec2 x0 = v - i + dot(i, C.xx);\r
|
|
421
|
+
\r
|
|
422
|
+
// Other corners\r
|
|
423
|
+
vec2 i1;\r
|
|
424
|
+
//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\r
|
|
425
|
+
//i1.y = 1.0 - i1.x;\r
|
|
426
|
+
i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\r
|
|
427
|
+
// x0 = x0 - 0.0 + 0.0 * C.xx ;\r
|
|
428
|
+
// x1 = x0 - i1 + 1.0 * C.xx ;\r
|
|
429
|
+
// x2 = x0 - 1.0 + 2.0 * C.xx ;\r
|
|
430
|
+
vec4 x12 = x0.xyxy + C.xxzz;\r
|
|
431
|
+
x12.xy -= i1;\r
|
|
432
|
+
\r
|
|
433
|
+
// Permutations\r
|
|
434
|
+
i = _czm_mod289(i); // Avoid truncation effect in permutation\r
|
|
435
|
+
vec3 p = _czm_permute( _czm_permute( i.y + vec3(0.0, i1.y, 1.0 )) + i.x + vec3(0.0, i1.x, 1.0 ));\r
|
|
436
|
+
\r
|
|
437
|
+
vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\r
|
|
438
|
+
m = m*m ;\r
|
|
439
|
+
m = m*m ;\r
|
|
440
|
+
\r
|
|
441
|
+
// Gradients: 41 points uniformly over a line, mapped onto a diamond.\r
|
|
442
|
+
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\r
|
|
443
|
+
vec3 x = 2.0 * fract(p * C.www) - 1.0;\r
|
|
444
|
+
vec3 h = abs(x) - 0.5;\r
|
|
445
|
+
vec3 ox = floor(x + 0.5);\r
|
|
446
|
+
vec3 a0 = x - ox;\r
|
|
447
|
+
\r
|
|
448
|
+
// Normalise gradients implicitly by scaling m\r
|
|
449
|
+
// Approximation of: m *= inversesqrt( a0*a0 + h*h );\r
|
|
450
|
+
m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\r
|
|
451
|
+
\r
|
|
452
|
+
// Compute final noise value at P\r
|
|
453
|
+
vec3 g;\r
|
|
454
|
+
g.x = a0.x * x0.x + h.x * x0.y;\r
|
|
455
|
+
g.yz = a0.yz * x12.xz + h.yz * x12.yw;\r
|
|
456
|
+
return 130.0 * dot(m, g);\r
|
|
457
|
+
}\r
|
|
458
|
+
\r
|
|
459
|
+
float czm_snoise(vec3 v)\r
|
|
460
|
+
{\r
|
|
461
|
+
const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\r
|
|
462
|
+
const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\r
|
|
463
|
+
\r
|
|
464
|
+
// First corner\r
|
|
465
|
+
vec3 i = floor(v + dot(v, C.yyy) );\r
|
|
466
|
+
vec3 x0 = v - i + dot(i, C.xxx) ;\r
|
|
467
|
+
\r
|
|
468
|
+
// Other corners\r
|
|
469
|
+
vec3 g = step(x0.yzx, x0.xyz);\r
|
|
470
|
+
vec3 l = 1.0 - g;\r
|
|
471
|
+
vec3 i1 = min( g.xyz, l.zxy );\r
|
|
472
|
+
vec3 i2 = max( g.xyz, l.zxy );\r
|
|
473
|
+
\r
|
|
474
|
+
// x0 = x0 - 0.0 + 0.0 * C.xxx;\r
|
|
475
|
+
// x1 = x0 - i1 + 1.0 * C.xxx;\r
|
|
476
|
+
// x2 = x0 - i2 + 2.0 * C.xxx;\r
|
|
477
|
+
// x3 = x0 - 1.0 + 3.0 * C.xxx;\r
|
|
478
|
+
vec3 x1 = x0 - i1 + C.xxx;\r
|
|
479
|
+
vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\r
|
|
480
|
+
vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\r
|
|
481
|
+
\r
|
|
482
|
+
// Permutations\r
|
|
483
|
+
i = _czm_mod289(i);\r
|
|
484
|
+
vec4 p = _czm_permute( _czm_permute( _czm_permute(\r
|
|
485
|
+
i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\r
|
|
486
|
+
+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\r
|
|
487
|
+
+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\r
|
|
488
|
+
\r
|
|
489
|
+
// Gradients: 7x7 points over a square, mapped onto an octahedron.\r
|
|
490
|
+
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\r
|
|
491
|
+
float n_ = 0.142857142857; // 1.0/7.0\r
|
|
492
|
+
vec3 ns = n_ * D.wyz - D.xzx;\r
|
|
493
|
+
\r
|
|
494
|
+
vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\r
|
|
495
|
+
\r
|
|
496
|
+
vec4 x_ = floor(j * ns.z);\r
|
|
497
|
+
vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\r
|
|
498
|
+
\r
|
|
499
|
+
vec4 x = x_ *ns.x + ns.yyyy;\r
|
|
500
|
+
vec4 y = y_ *ns.x + ns.yyyy;\r
|
|
501
|
+
vec4 h = 1.0 - abs(x) - abs(y);\r
|
|
502
|
+
\r
|
|
503
|
+
vec4 b0 = vec4( x.xy, y.xy );\r
|
|
504
|
+
vec4 b1 = vec4( x.zw, y.zw );\r
|
|
505
|
+
\r
|
|
506
|
+
//vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\r
|
|
507
|
+
//vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\r
|
|
508
|
+
vec4 s0 = floor(b0)*2.0 + 1.0;\r
|
|
509
|
+
vec4 s1 = floor(b1)*2.0 + 1.0;\r
|
|
510
|
+
vec4 sh = -step(h, vec4(0.0));\r
|
|
511
|
+
\r
|
|
512
|
+
vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\r
|
|
513
|
+
vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\r
|
|
514
|
+
\r
|
|
515
|
+
vec3 p0 = vec3(a0.xy,h.x);\r
|
|
516
|
+
vec3 p1 = vec3(a0.zw,h.y);\r
|
|
517
|
+
vec3 p2 = vec3(a1.xy,h.z);\r
|
|
518
|
+
vec3 p3 = vec3(a1.zw,h.w);\r
|
|
519
|
+
\r
|
|
520
|
+
//Normalise gradients\r
|
|
521
|
+
vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\r
|
|
522
|
+
p0 *= norm.x;\r
|
|
523
|
+
p1 *= norm.y;\r
|
|
524
|
+
p2 *= norm.z;\r
|
|
525
|
+
p3 *= norm.w;\r
|
|
526
|
+
\r
|
|
527
|
+
// Mix final noise value\r
|
|
528
|
+
vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\r
|
|
529
|
+
m = m * m;\r
|
|
530
|
+
return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\r
|
|
531
|
+
dot(p2,x2), dot(p3,x3) ) );\r
|
|
532
|
+
}\r
|
|
533
|
+
\r
|
|
534
|
+
float czm_snoise(vec4 v)\r
|
|
535
|
+
{\r
|
|
536
|
+
const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\r
|
|
537
|
+
0.276393202250021, // 2 * G4\r
|
|
538
|
+
0.414589803375032, // 3 * G4\r
|
|
539
|
+
-0.447213595499958); // -1 + 4 * G4\r
|
|
540
|
+
\r
|
|
541
|
+
// (sqrt(5) - 1)/4 = F4, used once below\r
|
|
542
|
+
#define F4 0.309016994374947451\r
|
|
543
|
+
\r
|
|
544
|
+
// First corner\r
|
|
545
|
+
vec4 i = floor(v + dot(v, vec4(F4)) );\r
|
|
546
|
+
vec4 x0 = v - i + dot(i, C.xxxx);\r
|
|
547
|
+
\r
|
|
548
|
+
// Other corners\r
|
|
549
|
+
\r
|
|
550
|
+
// Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\r
|
|
551
|
+
vec4 i0;\r
|
|
552
|
+
vec3 isX = step( x0.yzw, x0.xxx );\r
|
|
553
|
+
vec3 isYZ = step( x0.zww, x0.yyz );\r
|
|
554
|
+
// i0.x = dot( isX, vec3( 1.0 ) );\r
|
|
555
|
+
i0.x = isX.x + isX.y + isX.z;\r
|
|
556
|
+
i0.yzw = 1.0 - isX;\r
|
|
557
|
+
// i0.y += dot( isYZ.xy, vec2( 1.0 ) );\r
|
|
558
|
+
i0.y += isYZ.x + isYZ.y;\r
|
|
559
|
+
i0.zw += 1.0 - isYZ.xy;\r
|
|
560
|
+
i0.z += isYZ.z;\r
|
|
561
|
+
i0.w += 1.0 - isYZ.z;\r
|
|
562
|
+
\r
|
|
563
|
+
// i0 now contains the unique values 0,1,2,3 in each channel\r
|
|
564
|
+
vec4 i3 = clamp( i0, 0.0, 1.0 );\r
|
|
565
|
+
vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\r
|
|
566
|
+
vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\r
|
|
567
|
+
\r
|
|
568
|
+
// x0 = x0 - 0.0 + 0.0 * C.xxxx\r
|
|
569
|
+
// x1 = x0 - i1 + 1.0 * C.xxxx\r
|
|
570
|
+
// x2 = x0 - i2 + 2.0 * C.xxxx\r
|
|
571
|
+
// x3 = x0 - i3 + 3.0 * C.xxxx\r
|
|
572
|
+
// x4 = x0 - 1.0 + 4.0 * C.xxxx\r
|
|
573
|
+
vec4 x1 = x0 - i1 + C.xxxx;\r
|
|
574
|
+
vec4 x2 = x0 - i2 + C.yyyy;\r
|
|
575
|
+
vec4 x3 = x0 - i3 + C.zzzz;\r
|
|
576
|
+
vec4 x4 = x0 + C.wwww;\r
|
|
577
|
+
\r
|
|
578
|
+
// Permutations\r
|
|
579
|
+
i = _czm_mod289(i);\r
|
|
580
|
+
float j0 = _czm_permute( _czm_permute( _czm_permute( _czm_permute(i.w) + i.z) + i.y) + i.x);\r
|
|
581
|
+
vec4 j1 = _czm_permute( _czm_permute( _czm_permute( _czm_permute (\r
|
|
582
|
+
i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\r
|
|
583
|
+
+ i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\r
|
|
584
|
+
+ i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\r
|
|
585
|
+
+ i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\r
|
|
586
|
+
\r
|
|
587
|
+
// Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\r
|
|
588
|
+
// 7*7*6 = 294, which is close to the ring size 17*17 = 289.\r
|
|
589
|
+
vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\r
|
|
590
|
+
\r
|
|
591
|
+
vec4 p0 = _czm_grad4(j0, ip);\r
|
|
592
|
+
vec4 p1 = _czm_grad4(j1.x, ip);\r
|
|
593
|
+
vec4 p2 = _czm_grad4(j1.y, ip);\r
|
|
594
|
+
vec4 p3 = _czm_grad4(j1.z, ip);\r
|
|
595
|
+
vec4 p4 = _czm_grad4(j1.w, ip);\r
|
|
596
|
+
\r
|
|
597
|
+
// Normalise gradients\r
|
|
598
|
+
vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\r
|
|
599
|
+
p0 *= norm.x;\r
|
|
600
|
+
p1 *= norm.y;\r
|
|
601
|
+
p2 *= norm.z;\r
|
|
602
|
+
p3 *= norm.w;\r
|
|
603
|
+
p4 *= _czm_taylorInvSqrt(dot(p4,p4));\r
|
|
604
|
+
\r
|
|
605
|
+
// Mix contributions from the five corners\r
|
|
606
|
+
vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\r
|
|
607
|
+
vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\r
|
|
608
|
+
m0 = m0 * m0;\r
|
|
609
|
+
m1 = m1 * m1;\r
|
|
610
|
+
return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\r
|
|
611
|
+
+ dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\r
|
|
612
|
+
}\r
|
|
613
|
+
`;var gu=`uniform vec4 asphaltColor;\r
|
|
614
|
+
uniform float bumpSize;\r
|
|
615
|
+
uniform float roughness;\r
|
|
616
|
+
\r
|
|
617
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
618
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
619
|
+
\r
|
|
620
|
+
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\r
|
|
621
|
+
//Main cellular pattern\r
|
|
622
|
+
vec4 color = asphaltColor;\r
|
|
623
|
+
vec2 st = materialInput.st;\r
|
|
624
|
+
vec2 F = czm_cellular(st / bumpSize);\r
|
|
625
|
+
color.rgb -= (F.x / F.y) * 0.1;\r
|
|
626
|
+
\r
|
|
627
|
+
//Extra bumps for roughness\r
|
|
628
|
+
float noise = czm_snoise(st / bumpSize);\r
|
|
629
|
+
noise = pow(noise, 5.0) * roughness;\r
|
|
630
|
+
color.rgb += noise;\r
|
|
631
|
+
\r
|
|
632
|
+
material.diffuse = color.rgb;\r
|
|
633
|
+
material.alpha = color.a;\r
|
|
634
|
+
\r
|
|
635
|
+
return material;\r
|
|
636
|
+
}\r
|
|
637
|
+
`;var yu=`uniform vec4 lightColor;\r
|
|
638
|
+
uniform vec4 darkColor;\r
|
|
639
|
+
uniform float frequency;\r
|
|
640
|
+
\r
|
|
641
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
642
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
643
|
+
\r
|
|
644
|
+
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\r
|
|
645
|
+
vec2 F = czm_cellular(materialInput.st * frequency);\r
|
|
646
|
+
float t = 1.0 - F.x * F.x;\r
|
|
647
|
+
\r
|
|
648
|
+
vec4 color = mix(lightColor, darkColor, t);\r
|
|
649
|
+
material.diffuse = color.rgb;\r
|
|
650
|
+
material.alpha = color.a;\r
|
|
651
|
+
\r
|
|
652
|
+
return material;\r
|
|
653
|
+
}\r
|
|
654
|
+
`;var vu=`uniform vec4 brickColor;\r
|
|
655
|
+
uniform vec4 mortarColor;\r
|
|
656
|
+
uniform vec2 brickSize;\r
|
|
657
|
+
uniform vec2 brickPct;\r
|
|
658
|
+
uniform float brickRoughness;\r
|
|
659
|
+
uniform float mortarRoughness;\r
|
|
660
|
+
\r
|
|
661
|
+
#define Integral(x, p) ((floor(x) * p) + max(fract(x) - (1.0 - p), 0.0))\r
|
|
662
|
+
\r
|
|
663
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
664
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
665
|
+
\r
|
|
666
|
+
// From OpenGL Shading Language (3rd edition) pg. 194, 501\r
|
|
667
|
+
vec2 st = materialInput.st;\r
|
|
668
|
+
vec2 position = st / brickSize;\r
|
|
669
|
+
if(fract(position.y * 0.5) > 0.5) {\r
|
|
670
|
+
position.x += 0.5;\r
|
|
671
|
+
}\r
|
|
672
|
+
\r
|
|
673
|
+
//calculate whether to use brick or mortar (does AA)\r
|
|
674
|
+
vec2 filterWidth = vec2(0.02);\r
|
|
675
|
+
vec2 useBrick = (Integral(position + filterWidth, brickPct) -\r
|
|
676
|
+
Integral(position, brickPct)) / filterWidth;\r
|
|
677
|
+
float useBrickFinal = useBrick.x * useBrick.y;\r
|
|
678
|
+
vec4 color = mix(mortarColor, brickColor, useBrickFinal);\r
|
|
679
|
+
\r
|
|
680
|
+
//Apply noise to brick\r
|
|
681
|
+
vec2 brickScaled = vec2(st.x / 0.1, st.y / 0.006);\r
|
|
682
|
+
float brickNoise = abs(czm_snoise(brickScaled) * brickRoughness / 5.0);\r
|
|
683
|
+
color.rg += brickNoise * useBrickFinal;\r
|
|
684
|
+
\r
|
|
685
|
+
//Apply noise to mortar\r
|
|
686
|
+
vec2 mortarScaled = st / 0.005;\r
|
|
687
|
+
float mortarNoise = max(czm_snoise(mortarScaled) * mortarRoughness, 0.0);\r
|
|
688
|
+
color.rgb += mortarNoise * (1.0 - useBrickFinal);\r
|
|
689
|
+
\r
|
|
690
|
+
material.diffuse = color.rgb;\r
|
|
691
|
+
material.alpha = color.a;\r
|
|
692
|
+
\r
|
|
693
|
+
return material;\r
|
|
694
|
+
}\r
|
|
695
|
+
`;var wu=`uniform vec4 cementColor;\r
|
|
696
|
+
uniform float grainScale;\r
|
|
697
|
+
uniform float roughness;\r
|
|
698
|
+
\r
|
|
699
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
700
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
701
|
+
\r
|
|
702
|
+
float noise = czm_snoise(materialInput.st / grainScale);\r
|
|
703
|
+
noise = pow(noise, 5.0) * roughness;\r
|
|
704
|
+
\r
|
|
705
|
+
vec4 color = cementColor;\r
|
|
706
|
+
color.rgb += noise;\r
|
|
707
|
+
\r
|
|
708
|
+
material.diffuse = color.rgb;\r
|
|
709
|
+
material.alpha = color.a;\r
|
|
710
|
+
\r
|
|
711
|
+
return material;\r
|
|
712
|
+
}\r
|
|
713
|
+
`;var Cu=`uniform vec4 color;\r
|
|
714
|
+
uniform float time;\r
|
|
715
|
+
\r
|
|
716
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
717
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
718
|
+
float alpha = 1.0;\r
|
|
719
|
+
if (time != 1.0)\r
|
|
720
|
+
{\r
|
|
721
|
+
float t = 0.5 + (0.5 * czm_snoise(materialInput.str / (1.0 / 10.0))); // Scale [-1, 1] to [0, 1]\r
|
|
722
|
+
\r
|
|
723
|
+
if (t > time)\r
|
|
724
|
+
{\r
|
|
725
|
+
alpha = 0.0;\r
|
|
726
|
+
}\r
|
|
727
|
+
}\r
|
|
728
|
+
\r
|
|
729
|
+
material.diffuse = color.rgb;\r
|
|
730
|
+
material.alpha = color.a * alpha;\r
|
|
731
|
+
\r
|
|
732
|
+
return material;\r
|
|
733
|
+
}\r
|
|
734
|
+
`;var xu=`uniform vec4 lightColor;\r
|
|
735
|
+
uniform vec4 darkColor;\r
|
|
736
|
+
uniform float frequency;\r
|
|
737
|
+
\r
|
|
738
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
739
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
740
|
+
\r
|
|
741
|
+
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\r
|
|
742
|
+
vec2 F = czm_cellular(materialInput.st * frequency);\r
|
|
743
|
+
float t = 0.1 + (F.y - F.x);\r
|
|
744
|
+
\r
|
|
745
|
+
vec4 color = mix(lightColor, darkColor, t);\r
|
|
746
|
+
material.diffuse = color.rgb;\r
|
|
747
|
+
material.alpha = color.a;\r
|
|
748
|
+
\r
|
|
749
|
+
return material;\r
|
|
750
|
+
}\r
|
|
751
|
+
`;var Tu=`czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
752
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
753
|
+
\r
|
|
754
|
+
vec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\r
|
|
755
|
+
vec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\r
|
|
756
|
+
float cosAngIncidence = max(dot(normalWC, positionWC), 0.0);\r
|
|
757
|
+
\r
|
|
758
|
+
material.diffuse = mix(reflection.diffuse, refraction.diffuse, cosAngIncidence);\r
|
|
759
|
+
\r
|
|
760
|
+
return material;\r
|
|
761
|
+
}\r
|
|
762
|
+
`;var Eu=`uniform vec4 grassColor;\r
|
|
763
|
+
uniform vec4 dirtColor;\r
|
|
764
|
+
uniform float patchiness;\r
|
|
765
|
+
\r
|
|
766
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
767
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
768
|
+
\r
|
|
769
|
+
vec2 st = materialInput.st;\r
|
|
770
|
+
float noise1 = (czm_snoise(st * patchiness * 1.0)) * 1.0;\r
|
|
771
|
+
float noise2 = (czm_snoise(st * patchiness * 2.0)) * 0.5;\r
|
|
772
|
+
float noise3 = (czm_snoise(st * patchiness * 4.0)) * 0.25;\r
|
|
773
|
+
float noise = sin(noise1 + noise2 + noise3) * 0.1;\r
|
|
774
|
+
\r
|
|
775
|
+
vec4 color = mix(grassColor, dirtColor, noise);\r
|
|
776
|
+
\r
|
|
777
|
+
//Make thatch patterns\r
|
|
778
|
+
float verticalNoise = czm_snoise(vec2(st.x * 100.0, st.y * 20.0)) * 0.02;\r
|
|
779
|
+
float horizontalNoise = czm_snoise(vec2(st.x * 20.0, st.y * 100.0)) * 0.02;\r
|
|
780
|
+
float stripeNoise = min(verticalNoise, horizontalNoise);\r
|
|
781
|
+
\r
|
|
782
|
+
color.rgb += stripeNoise;\r
|
|
783
|
+
\r
|
|
784
|
+
material.diffuse = color.rgb;\r
|
|
785
|
+
material.alpha = color.a;\r
|
|
786
|
+
\r
|
|
787
|
+
return material;\r
|
|
788
|
+
}\r
|
|
789
|
+
`;var Pu=`uniform samplerCube cubeMap;\r
|
|
790
|
+
\r
|
|
791
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
792
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
793
|
+
\r
|
|
794
|
+
vec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\r
|
|
795
|
+
vec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\r
|
|
796
|
+
vec3 reflectedWC = reflect(positionWC, normalWC);\r
|
|
797
|
+
material.diffuse = textureCube(cubeMap, reflectedWC).channels;\r
|
|
798
|
+
\r
|
|
799
|
+
return material;\r
|
|
800
|
+
}\r
|
|
801
|
+
`;var bu=`uniform samplerCube cubeMap;\r
|
|
802
|
+
uniform float indexOfRefractionRatio;\r
|
|
803
|
+
\r
|
|
804
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
805
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
806
|
+
\r
|
|
807
|
+
vec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\r
|
|
808
|
+
vec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\r
|
|
809
|
+
vec3 refractedWC = refract(positionWC, -normalWC, indexOfRefractionRatio);\r
|
|
810
|
+
material.diffuse = textureCube(cubeMap, refractedWC).channels;\r
|
|
811
|
+
\r
|
|
812
|
+
return material;\r
|
|
813
|
+
}\r
|
|
814
|
+
`;var Au=`uniform vec4 lightColor;\r
|
|
815
|
+
uniform vec4 darkColor;\r
|
|
816
|
+
uniform float frequency;\r
|
|
817
|
+
\r
|
|
818
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
819
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
820
|
+
\r
|
|
821
|
+
vec3 scaled = materialInput.str * frequency;\r
|
|
822
|
+
float t = abs(czm_snoise(scaled));\r
|
|
823
|
+
\r
|
|
824
|
+
vec4 color = mix(lightColor, darkColor, t);\r
|
|
825
|
+
material.diffuse = color.rgb;\r
|
|
826
|
+
material.alpha = color.a;\r
|
|
827
|
+
\r
|
|
828
|
+
return material;\r
|
|
829
|
+
}\r
|
|
830
|
+
`;var Mu=`uniform vec4 lightWoodColor;\r
|
|
831
|
+
uniform vec4 darkWoodColor;\r
|
|
832
|
+
uniform float ringFrequency;\r
|
|
833
|
+
uniform vec2 noiseScale;\r
|
|
834
|
+
uniform float grainFrequency;\r
|
|
835
|
+
\r
|
|
836
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
837
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
838
|
+
\r
|
|
839
|
+
//Based on wood shader from OpenGL Shading Language (3rd edition) pg. 455\r
|
|
840
|
+
vec2 st = materialInput.st;\r
|
|
841
|
+
\r
|
|
842
|
+
vec2 noisevec;\r
|
|
843
|
+
noisevec.x = czm_snoise(st * noiseScale.x);\r
|
|
844
|
+
noisevec.y = czm_snoise(st * noiseScale.y);\r
|
|
845
|
+
\r
|
|
846
|
+
vec2 location = st + noisevec;\r
|
|
847
|
+
float dist = sqrt(location.x * location.x + location.y * location.y);\r
|
|
848
|
+
dist *= ringFrequency;\r
|
|
849
|
+
\r
|
|
850
|
+
float r = fract(dist + noisevec[0] + noisevec[1]) * 2.0;\r
|
|
851
|
+
if(r > 1.0)\r
|
|
852
|
+
r = 2.0 - r;\r
|
|
853
|
+
\r
|
|
854
|
+
vec4 color = mix(lightWoodColor, darkWoodColor, r);\r
|
|
855
|
+
\r
|
|
856
|
+
//streaks\r
|
|
857
|
+
r = abs(czm_snoise(vec2(st.x * grainFrequency, st.y * grainFrequency * 0.02))) * 0.2;\r
|
|
858
|
+
color.rgb += lightWoodColor.rgb * r;\r
|
|
859
|
+
\r
|
|
860
|
+
material.diffuse = color.rgb;\r
|
|
861
|
+
material.alpha = color.a;\r
|
|
862
|
+
\r
|
|
863
|
+
return material;\r
|
|
864
|
+
}\r
|
|
865
|
+
`;i.ShaderSource._czmBuiltinsAndUniforms.czm_cellular=_u;i.ShaderSource._czmBuiltinsAndUniforms.czm_snoise=fu;i.Material.AsphaltType="Asphalt";i.Material._materialCache.addMaterial(i.Material.AsphaltType,{fabric:{type:i.Material.AsphaltType,uniforms:{asphaltColor:new i.Color(.15,.15,.15,1),bumpSize:.02,roughness:.2},source:gu},translucent:function(a){return a.uniforms.asphaltColor.alpha<1}});i.Material.BlobType="Blob";i.Material._materialCache.addMaterial(i.Material.BlobType,{fabric:{type:i.Material.BlobType,uniforms:{lightColor:new i.Color(1,1,1,.5),darkColor:new i.Color(0,0,1,.5),frequency:10},source:yu},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.BrickType="Brick";i.Material._materialCache.addMaterial(i.Material.BrickType,{fabric:{type:i.Material.BrickType,uniforms:{brickColor:new i.Color(.6,.3,.1,1),mortarColor:new i.Color(.8,.8,.7,1),brickSize:new i.Cartesian2(.3,.15),brickPct:new i.Cartesian2(.9,.85),brickRoughness:.2,mortarRoughness:.1},source:vu},translucent:function(a){var e=a.uniforms;return e.brickColor.alpha<1||e.mortarColor.alpha<1}});i.Material.CementType="Cement";i.Material._materialCache.addMaterial(i.Material.CementType,{fabric:{type:i.Material.CementType,uniforms:{cementColor:new i.Color(.95,.95,.85,1),grainScale:.01,roughness:.3},source:wu},translucent:function(a){return a.uniforms.cementColor.alpha<1}});i.Material.ErosionType="Erosion";i.Material._materialCache.addMaterial(i.Material.ErosionType,{fabric:{type:i.Material.ErosionType,uniforms:{color:new i.Color(1,0,0,.5),time:1},source:Cu},translucent:function(a){return a.uniforms.color.alpha<1}});i.Material.FacetType="Facet";i.Material._materialCache.addMaterial(i.Material.FacetType,{fabric:{type:i.Material.FacetType,uniforms:{lightColor:new i.Color(.25,.25,.25,.75),darkColor:new i.Color(.75,.75,.75,.75),frequency:10},source:xu},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.FresnelType="Fresnel";i.Material._materialCache.addMaterial(i.Material.FresnelType,{fabric:{type:i.Material.FresnelType,materials:{reflection:{type:i.Material.ReflectionType},refraction:{type:i.Material.RefractionType}},source:Tu},translucent:!1});i.Material.GrassType="Grass";i.Material._materialCache.addMaterial(i.Material.GrassType,{fabric:{type:i.Material.GrassType,uniforms:{grassColor:new i.Color(.25,.4,.1,1),dirtColor:new i.Color(.1,.1,.1,1),patchiness:1.5},source:Eu},translucent:function(a){var e=a.uniforms;return e.grassColor.alpha<1||e.dirtColor.alpha<1}});i.Material.ReflectionType="Reflection";i.Material._materialCache.addMaterial(i.Material.ReflectionType,{fabric:{type:i.Material.ReflectionType,uniforms:{cubeMap:i.Material.DefaultCubeMapId,channels:"rgb"},source:Pu},translucent:!1});i.Material.RefractionType="Refraction";i.Material._materialCache.addMaterial(i.Material.RefractionType,{fabric:{type:i.Material.RefractionType,uniforms:{cubeMap:i.Material.DefaultCubeMapId,channels:"rgb",indexOfRefractionRatio:.9},source:bu},translucent:!1});i.Material.TyeDyeType="TieDye";i.Material._materialCache.addMaterial(i.Material.TyeDyeType,{fabric:{type:i.Material.TyeDyeType,uniforms:{lightColor:new i.Color(1,1,0,.75),darkColor:new i.Color(1,0,0,.75),frequency:5},source:Au},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.WoodType="Wood";i.Material._materialCache.addMaterial(i.Material.WoodType,{fabric:{type:i.Material.WoodType,uniforms:{lightWoodColor:new i.Color(.6,.3,.1,1),darkWoodColor:new i.Color(.4,.2,.07,1),ringFrequency:3,noiseScale:new i.Cartesian2(.7,.5),grainFrequency:27},source:Mu},translucent:function(a){let e=a.uniforms;return e.lightWoodColor.alpha<1||e.darkWoodColor.alpha<1}});var Iu=`uniform vec4 color;\r
|
|
866
|
+
uniform float speed;\r
|
|
867
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
868
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
869
|
+
vec2 st = materialInput.st ;\r
|
|
870
|
+
vec2 center = vec2(0.5);\r
|
|
871
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
872
|
+
float r = 0.5 + sin(time) / 3.0;\r
|
|
873
|
+
float dis = distance(st, center);\r
|
|
874
|
+
float a = 0.0;\r
|
|
875
|
+
if(dis < r) {\r
|
|
876
|
+
a = 1.0 - smoothstep(0.0, r, dis);\r
|
|
877
|
+
}\r
|
|
878
|
+
material.alpha = pow(a,10.0) ;\r
|
|
879
|
+
material.diffuse = color.rgb * a * 3.0;\r
|
|
880
|
+
return material;\r
|
|
881
|
+
}\r
|
|
882
|
+
`;var Su=`uniform vec4 color;\r
|
|
883
|
+
uniform float speed;\r
|
|
884
|
+
\r
|
|
885
|
+
vec3 circlePing(float r, float innerTail, float frontierBorder, float timeResetSeconds, float radarPingSpeed, float fadeDistance){\r
|
|
886
|
+
float t = fract(czm_frameNumber * speed / 1000.0);\r
|
|
887
|
+
float time = mod(t, timeResetSeconds) * radarPingSpeed;\r
|
|
888
|
+
float circle;\r
|
|
889
|
+
circle += smoothstep(time - innerTail, time, r) * smoothstep(time + frontierBorder,time, r);\r
|
|
890
|
+
circle *= smoothstep(fadeDistance, 0.0, r);\r
|
|
891
|
+
return vec3(circle);\r
|
|
892
|
+
}\r
|
|
893
|
+
\r
|
|
894
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
895
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
896
|
+
vec2 st = materialInput.st * 2.0 - 1.0 ;\r
|
|
897
|
+
vec2 center = vec2(0.);\r
|
|
898
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
899
|
+
vec3 flagColor;\r
|
|
900
|
+
float r = length(st - center) / 4.;\r
|
|
901
|
+
flagColor += circlePing(r, 0.25, 0.025, 4.0, 0.3, 1.0) * color.rgb;\r
|
|
902
|
+
material.alpha = length(flagColor);\r
|
|
903
|
+
material.diffuse = flagColor.rgb;\r
|
|
904
|
+
return material;\r
|
|
905
|
+
}\r
|
|
906
|
+
`;var Du=`uniform vec4 color;\r
|
|
907
|
+
uniform float speed;\r
|
|
908
|
+
\r
|
|
909
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
910
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
911
|
+
material.diffuse = 1.5 * color.rgb;\r
|
|
912
|
+
vec2 st = materialInput.st;\r
|
|
913
|
+
float dis = distance(st, vec2(0.5, 0.5));\r
|
|
914
|
+
float per = fract(czm_frameNumber * speed / 1000.0);\r
|
|
915
|
+
if(dis > per * 0.5){\r
|
|
916
|
+
material.alpha = color.a;\r
|
|
917
|
+
}else {\r
|
|
918
|
+
discard;\r
|
|
919
|
+
}\r
|
|
920
|
+
return material;\r
|
|
921
|
+
}\r
|
|
922
|
+
`;var Lu=`uniform vec4 color;\r
|
|
923
|
+
uniform float speed;\r
|
|
924
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
925
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
926
|
+
vec2 st = materialInput.st * 2.0 - 1.0;\r
|
|
927
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
928
|
+
float r = length(st) * 1.2;\r
|
|
929
|
+
float a = pow(r, 2.0);\r
|
|
930
|
+
float b = sin(r * 0.8 - 1.6);\r
|
|
931
|
+
float c = sin(r - 0.010);\r
|
|
932
|
+
float s = sin(a - time * 2.0 + b) * c;\r
|
|
933
|
+
float d = abs(1.0 / (s * 10.8)) - 0.01;\r
|
|
934
|
+
material.alpha = pow(d,10.0) ;\r
|
|
935
|
+
material.diffuse = color.rgb * d;\r
|
|
936
|
+
return material;\r
|
|
937
|
+
}\r
|
|
938
|
+
`;var Ru=`uniform vec4 color;\r
|
|
939
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
940
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
941
|
+
vec2 st = materialInput.st;\r
|
|
942
|
+
vec2 center = st - vec2(0.5,0.5);\r
|
|
943
|
+
float length = length(center) / 0.5;\r
|
|
944
|
+
float time = 1. - abs(czm_frameNumber / 360. - 0.5);\r
|
|
945
|
+
float param = 1. - step(length, 0.6); //\u5927\u4E8E0.6\u6A21\u7CCA\uFF0Crate = 0.6\r
|
|
946
|
+
float scale = param * length; // 0.6< length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1.\r
|
|
947
|
+
float alpha = param * (1.0 - abs(scale - 0.8) / 0.2); // 0.8 < length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1.\r
|
|
948
|
+
float param1 = step(length, 0.7); //\u5C0F\u4E8E0.5\u6A21\u7CCA\r
|
|
949
|
+
float scale1 = param1 * length; // 0.6< length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1.\r
|
|
950
|
+
alpha += param1 * (1.0 - abs(scale1 - 0.35) / 0.35); // 0.8 < length \u8FD4\u56DE0\uFF0C\u53CD\u4E4B\u8FD4\u56DE1.\r
|
|
951
|
+
material.diffuse = color.rgb * vec3(color.a);\r
|
|
952
|
+
material.alpha = pow(alpha, 4.0);\r
|
|
953
|
+
return material;\r
|
|
954
|
+
}\r
|
|
955
|
+
`;var Ou=`uniform vec4 color;\r
|
|
956
|
+
uniform sampler2D image;\r
|
|
957
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
958
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
959
|
+
vec2 st = materialInput.st;\r
|
|
960
|
+
vec2 center = st - vec2(0.5,0.5);\r
|
|
961
|
+
float time = -czm_frameNumber * 3.1415926 / 180.;\r
|
|
962
|
+
float sin_t = sin(time);\r
|
|
963
|
+
float cos_t = cos(time);\r
|
|
964
|
+
vec2 center_rotate = vec2(center.s * cos_t - center.t * sin_t + 0.5,center.s * sin_t + center.t * cos_t + 0.5);\r
|
|
965
|
+
vec4 colorImage = texture(image,center_rotate);\r
|
|
966
|
+
vec3 temp = colorImage.rgb * color.rgb;\r
|
|
967
|
+
temp *= color.a;\r
|
|
968
|
+
material.diffuse = temp;\r
|
|
969
|
+
float length = 2. - length(center) / 0.5;\r
|
|
970
|
+
material.alpha = colorImage.a * pow(length, 0.5);\r
|
|
971
|
+
return material;\r
|
|
972
|
+
}\r
|
|
973
|
+
`;var ku=`uniform vec4 color;\r
|
|
974
|
+
uniform float speed;\r
|
|
975
|
+
\r
|
|
976
|
+
float circle(vec2 uv, float r, float blur) {\r
|
|
977
|
+
float d = length(uv) * 2.0;\r
|
|
978
|
+
float c = smoothstep(r+blur, r, d);\r
|
|
979
|
+
return c;\r
|
|
980
|
+
}\r
|
|
981
|
+
\r
|
|
982
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)\r
|
|
983
|
+
{\r
|
|
984
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
985
|
+
vec2 st = materialInput.st - .5;\r
|
|
986
|
+
material.diffuse = color.rgb;\r
|
|
987
|
+
material.emission = vec3(0);\r
|
|
988
|
+
float t =fract(czm_frameNumber * speed / 1000.0);\r
|
|
989
|
+
float s = 0.3;\r
|
|
990
|
+
float radius1 = smoothstep(.0, s, t) * 0.5;\r
|
|
991
|
+
float alpha1 = circle(st, radius1, 0.01) * circle(st, radius1, -0.01);\r
|
|
992
|
+
float alpha2 = circle(st, radius1, 0.01 - radius1) * circle(st, radius1, 0.01);\r
|
|
993
|
+
float radius2 = 0.5 + smoothstep(s, 1.0, t) * 0.5;\r
|
|
994
|
+
float alpha3 = circle(st, radius1, radius2 + 0.01 - radius1) * circle(st, radius1, -0.01);\r
|
|
995
|
+
material.alpha = smoothstep(1.0, s, t) * (alpha1 + alpha2*0.1 + alpha3*0.1);\r
|
|
996
|
+
material.alpha *= color.a;\r
|
|
997
|
+
return material;\r
|
|
998
|
+
}\r
|
|
999
|
+
`;var Fu=`uniform vec4 color;\r
|
|
1000
|
+
uniform float speed;\r
|
|
1001
|
+
\r
|
|
1002
|
+
#define PI 3.14159265359\r
|
|
1003
|
+
\r
|
|
1004
|
+
vec2 rotate2D (vec2 _st, float _angle) {\r
|
|
1005
|
+
_st = mat2(cos(_angle),-sin(_angle), sin(_angle),cos(_angle)) * _st;\r
|
|
1006
|
+
return _st;\r
|
|
1007
|
+
}\r
|
|
1008
|
+
\r
|
|
1009
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1010
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1011
|
+
vec2 st = materialInput.st * 2.0 - 1.0;\r
|
|
1012
|
+
st *= 1.6;\r
|
|
1013
|
+
float time = czm_frameNumber * speed / 1000.0;\r
|
|
1014
|
+
float r = length(st);\r
|
|
1015
|
+
float w = .3;\r
|
|
1016
|
+
st = rotate2D(st,(r*PI*6.-time*2.));\r
|
|
1017
|
+
float a = smoothstep(-w,.2,st.x) * smoothstep(w,.2,st.x);\r
|
|
1018
|
+
float b = abs(1./(sin(pow(r,2.)*2.-time*1.3)*6.))*.4;\r
|
|
1019
|
+
material.alpha = a * b ;\r
|
|
1020
|
+
material.diffuse = color.rgb * a * b * 3.0;\r
|
|
1021
|
+
return material;\r
|
|
1022
|
+
}\r
|
|
1023
|
+
`;var zu=`uniform vec4 color;\r
|
|
1024
|
+
uniform float speed;\r
|
|
1025
|
+
\r
|
|
1026
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1027
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1028
|
+
vec2 st = materialInput.st * 2.0 - 1.0;\r
|
|
1029
|
+
float time =czm_frameNumber * speed / 1000.0;\r
|
|
1030
|
+
float radius = length(st);\r
|
|
1031
|
+
float angle = atan(st.y/st.x);\r
|
|
1032
|
+
float radius1 = sin(time * 2.0) + sin(40.0*angle+time)*0.01;\r
|
|
1033
|
+
float radius2 = cos(time * 3.0);\r
|
|
1034
|
+
vec3 fragColor = 0.2 + 0.5 * cos( time + color.rgb + vec3(0,2,4));\r
|
|
1035
|
+
float inten1 = 1.0 - sqrt(abs(radius1 - radius));\r
|
|
1036
|
+
float inten2 = 1.0 - sqrt(abs(radius2 - radius));\r
|
|
1037
|
+
material.alpha = pow(inten1 + inten2 , 5.0) ;\r
|
|
1038
|
+
material.diffuse = fragColor * (inten1 + inten2);\r
|
|
1039
|
+
return material;\r
|
|
1040
|
+
}\r
|
|
1041
|
+
`;var Nu=`uniform vec4 color;
|
|
1042
|
+
uniform float speed;
|
|
1043
|
+
uniform float count;
|
|
1044
|
+
uniform float gradient;
|
|
1045
|
+
|
|
1046
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
1047
|
+
{
|
|
1048
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
1049
|
+
material.diffuse = 1.5 * color.rgb;
|
|
1050
|
+
vec2 st = materialInput.st;
|
|
1051
|
+
float dis = distance(st, vec2(0.5, 0.5));
|
|
1052
|
+
float per = fract(czm_frameNumber * speed / 1000.0);
|
|
1053
|
+
if(count == 1.0){
|
|
1054
|
+
if(dis > per * 0.5){
|
|
1055
|
+
discard;
|
|
1056
|
+
}else {
|
|
1057
|
+
material.alpha = color.a * dis / per / 2.0;
|
|
1058
|
+
}
|
|
1059
|
+
} else {
|
|
1060
|
+
vec3 str = materialInput.str;
|
|
1061
|
+
if(abs(str.z) > 0.001){
|
|
1062
|
+
discard;
|
|
1063
|
+
}
|
|
1064
|
+
if(dis > 0.5){
|
|
1065
|
+
discard;
|
|
1066
|
+
} else {
|
|
1067
|
+
float perDis = 0.5 / count;
|
|
1068
|
+
float disNum;
|
|
1069
|
+
float bl = 0.0;
|
|
1070
|
+
for(int i = 0; i <= 10; i++){
|
|
1071
|
+
if(float(i) <= count){
|
|
1072
|
+
disNum = perDis * float(i) - dis + per / count;
|
|
1073
|
+
if(disNum > 0.0){
|
|
1074
|
+
if(disNum < perDis){
|
|
1075
|
+
bl = 1.0 - disNum / perDis;
|
|
1076
|
+
}
|
|
1077
|
+
else if(disNum - perDis < perDis){
|
|
1078
|
+
bl = 1.0 - abs(1.0 - disNum / perDis);
|
|
1079
|
+
}
|
|
1080
|
+
material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return material;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
`;i.Material.CircleBlurType="CircleBlur";i.Material._materialCache.addMaterial(i.Material.CircleBlurType,{fabric:{type:i.Material.CircleBlurType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Iu},translucent:function(a){return!0}});i.Material.CircleDiffuseType="CircleDiffuse";i.Material._materialCache.addMaterial(i.Material.CircleDiffuseType,{fabric:{type:i.Material.CircleDiffuseType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Su},translucent:function(a){return!0}});i.Material.CircleFadeType="CircleFade";i.Material._materialCache.addMaterial(i.Material.CircleFadeType,{fabric:{type:i.Material.CircleFadeType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Du},translucent:function(a){return!0}});i.Material.CirclePulseType="CirclePulse";i.Material._materialCache.addMaterial(i.Material.CirclePulseType,{fabric:{type:i.Material.CirclePulseType,uniforms:{color:new i.Color(1,0,0,.7),speed:12},source:Lu},translucent:function(a){return!0}});i.Material.CircleRingType="CircleRing";i.Material._materialCache.addMaterial(i.Material.CircleRingType,{fabric:{type:i.Material.CircleRingType,uniforms:{color:new i.Color(1,0,0,.7)},source:Ru},translucent:function(a){return!0}});i.Material.CircleRotateType="CircleRotate";i.Material._materialCache.addMaterial(i.Material.CircleRotateType,{fabric:{type:i.Material.CircleRotateType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:Ou},translucent:function(a){return!0}});i.Material.CircleScanType="CircleScan";i.Material._materialCache.addMaterial(i.Material.CircleScanType,{fabric:{type:i.Material.CircleScanType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:ku},translucent:function(a){return!0}});i.Material.CircleSpiralType="CircleSpiral";i.Material._materialCache.addMaterial(i.Material.CircleSpiralType,{fabric:{type:i.Material.CircleSpiralType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Fu},translucent:function(a){return!0}});i.Material.CircleVaryType="CircleVary";i.Material._materialCache.addMaterial(i.Material.CircleVaryType,{fabric:{type:i.Material.CircleVaryType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:zu},translucent:function(a){return!0}});i.Material.CircleWaveType="CircleWave";i.Material._materialCache.addMaterial(i.Material.CircleWaveType,{fabric:{type:i.Material.CircleWaveType,uniforms:{color:new i.Color(1,0,0,.7),speed:3,count:1,gradient:.1},source:Nu},translucent:function(a){return!0}});var Hu=`uniform vec4 color;\r
|
|
1090
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1091
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1092
|
+
vec2 st = materialInput.st;\r
|
|
1093
|
+
float powerRatio = 1. / (fract(czm_frameNumber / 30.0) + 1.) ;\r
|
|
1094
|
+
float alpha = pow(1. - st.t,powerRatio);\r
|
|
1095
|
+
vec4 temp = vec4(color.rgb, alpha * color.a);\r
|
|
1096
|
+
material.diffuse = temp.rgb;\r
|
|
1097
|
+
material.alpha = temp.a;\r
|
|
1098
|
+
return material;\r
|
|
1099
|
+
}\r
|
|
1100
|
+
`;var Wu=`uniform vec4 color;\r
|
|
1101
|
+
uniform sampler2D image;\r
|
|
1102
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1103
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1104
|
+
vec2 st = materialInput.st;\r
|
|
1105
|
+
float time = fract(czm_frameNumber / 90.) ;\r
|
|
1106
|
+
vec2 new_st = fract(st- vec2(time,time));\r
|
|
1107
|
+
vec4 colorImage = texture(image, new_st);\r
|
|
1108
|
+
vec3 diffuse = colorImage.rgb;\r
|
|
1109
|
+
float alpha = colorImage.a;\r
|
|
1110
|
+
diffuse *= color.rgb;\r
|
|
1111
|
+
alpha *= color.a;\r
|
|
1112
|
+
material.diffuse = diffuse;\r
|
|
1113
|
+
material.alpha = alpha * pow(1. - st.t,color.a);\r
|
|
1114
|
+
return material;\r
|
|
1115
|
+
}\r
|
|
1116
|
+
`;i.Material.CylinderFadeType="CylinderFade";i.Material._materialCache.addMaterial(i.Material.CylinderFadeType,{fabric:{type:i.Material.CylinderFadeType,uniforms:{color:new i.Color(1,0,0,.7)},source:Hu},translucent:function(a){return!0}});i.Material.CylinderParticlesType="CylinderParticles";i.Material._materialCache.addMaterial(i.Material.CylinderParticlesType,{fabric:{type:i.Material.CylinderParticlesType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:Wu},translucent:function(a){return!0}});var Gu=`uniform vec4 color;\r
|
|
1117
|
+
uniform float speed;\r
|
|
1118
|
+
\r
|
|
1119
|
+
#define pi 3.1415926535\r
|
|
1120
|
+
#define PI2RAD 0.01745329252\r
|
|
1121
|
+
#define TWO_PI (2. * PI)\r
|
|
1122
|
+
\r
|
|
1123
|
+
float rands(float p){\r
|
|
1124
|
+
return fract(sin(p) * 10000.0);\r
|
|
1125
|
+
}\r
|
|
1126
|
+
\r
|
|
1127
|
+
float noise(vec2 p){\r
|
|
1128
|
+
float time = fract( czm_frameNumber * speed / 1000.0);\r
|
|
1129
|
+
float t = time / 20000.0;\r
|
|
1130
|
+
if(t > 1.0) t -= floor(t);\r
|
|
1131
|
+
return rands(p.x * 14. + p.y * sin(t) * 0.5);\r
|
|
1132
|
+
}\r
|
|
1133
|
+
\r
|
|
1134
|
+
vec2 sw(vec2 p){\r
|
|
1135
|
+
return vec2(floor(p.x), floor(p.y));\r
|
|
1136
|
+
}\r
|
|
1137
|
+
\r
|
|
1138
|
+
vec2 se(vec2 p){\r
|
|
1139
|
+
return vec2(ceil(p.x), floor(p.y));\r
|
|
1140
|
+
}\r
|
|
1141
|
+
\r
|
|
1142
|
+
vec2 nw(vec2 p){\r
|
|
1143
|
+
return vec2(floor(p.x), ceil(p.y));\r
|
|
1144
|
+
}\r
|
|
1145
|
+
\r
|
|
1146
|
+
vec2 ne(vec2 p){\r
|
|
1147
|
+
return vec2(ceil(p.x), ceil(p.y));\r
|
|
1148
|
+
}\r
|
|
1149
|
+
\r
|
|
1150
|
+
float smoothNoise(vec2 p){\r
|
|
1151
|
+
vec2 inter = smoothstep(0.0, 1.0, fract(p));\r
|
|
1152
|
+
float s = mix(noise(sw(p)), noise(se(p)), inter.x);\r
|
|
1153
|
+
float n = mix(noise(nw(p)), noise(ne(p)), inter.x);\r
|
|
1154
|
+
return mix(s, n, inter.y);\r
|
|
1155
|
+
}\r
|
|
1156
|
+
\r
|
|
1157
|
+
float fbm(vec2 p){\r
|
|
1158
|
+
float z = 2.0;\r
|
|
1159
|
+
float rz = 0.0;\r
|
|
1160
|
+
vec2 bp = p;\r
|
|
1161
|
+
for(float i = 1.0; i < 6.0; i++){\r
|
|
1162
|
+
rz += abs((smoothNoise(p) - 0.5)* 2.0) / z;\r
|
|
1163
|
+
z *= 2.0;\r
|
|
1164
|
+
p *= 2.0;\r
|
|
1165
|
+
}\r
|
|
1166
|
+
return rz;\r
|
|
1167
|
+
}\r
|
|
1168
|
+
\r
|
|
1169
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)\r
|
|
1170
|
+
{\r
|
|
1171
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1172
|
+
vec2 st = materialInput.st;\r
|
|
1173
|
+
vec2 st2 = materialInput.st;\r
|
|
1174
|
+
float time = fract( czm_frameNumber * speed / 1000.0);\r
|
|
1175
|
+
if (st.t < 0.5) {\r
|
|
1176
|
+
discard;\r
|
|
1177
|
+
}\r
|
|
1178
|
+
st *= 4.;\r
|
|
1179
|
+
float rz = fbm(st);\r
|
|
1180
|
+
st /= exp(mod( time * 2.0, pi));\r
|
|
1181
|
+
rz *= pow(15., 0.9);\r
|
|
1182
|
+
vec4 temp = vec4(0);\r
|
|
1183
|
+
temp = mix( color / rz, vec4(color.rgb, 0.1), 0.2);\r
|
|
1184
|
+
if (st2.s < 0.05) {\r
|
|
1185
|
+
temp = mix(vec4(color.rgb, 0.1), temp, st2.s / 0.05);\r
|
|
1186
|
+
}\r
|
|
1187
|
+
if (st2.s > 0.95){\r
|
|
1188
|
+
temp = mix(temp, vec4(color.rgb, 0.1), (st2.s - 0.95) / 0.05);\r
|
|
1189
|
+
}\r
|
|
1190
|
+
material.diffuse = temp.rgb;\r
|
|
1191
|
+
material.alpha = temp.a * 2.0;\r
|
|
1192
|
+
return material;\r
|
|
1193
|
+
}\r
|
|
1194
|
+
`;var Uu=`uniform vec4 color;\r
|
|
1195
|
+
uniform float speed;\r
|
|
1196
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1197
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1198
|
+
vec2 st = materialInput.st;\r
|
|
1199
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1200
|
+
float alpha = abs(smoothstep(0.5,1.,fract( -st.t - time)));\r
|
|
1201
|
+
alpha += .1;\r
|
|
1202
|
+
material.alpha = alpha;\r
|
|
1203
|
+
material.diffuse = color.rgb;\r
|
|
1204
|
+
return material;\r
|
|
1205
|
+
}\r
|
|
1206
|
+
`;i.Material.EllipsoidElectricType="EllipsoidElectric";i.Material._materialCache.addMaterial(i.Material.EllipsoidElectricType,{fabric:{type:i.Material.EllipsoidElectricType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:Gu},translucent:function(a){return!0}});i.Material.EllipsoidTrailType="EllipsoidTrail";i.Material._materialCache.addMaterial(i.Material.EllipsoidTrailType,{fabric:{type:i.Material.EllipsoidTrailType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Uu},translucent:function(a){return!0}});var Bu=`uniform vec4 color;\r
|
|
1207
|
+
uniform float speed;\r
|
|
1208
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1209
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1210
|
+
float time = fract( czm_frameNumber * speed / 1000.0);\r
|
|
1211
|
+
vec2 st = materialInput.st;\r
|
|
1212
|
+
float scalar = smoothstep(0.0,1.0,time);\r
|
|
1213
|
+
material.diffuse = color.rgb * scalar;\r
|
|
1214
|
+
material.alpha = color.a * scalar ;\r
|
|
1215
|
+
return material;\r
|
|
1216
|
+
}\r
|
|
1217
|
+
`;var Vu=`uniform vec4 color;\r
|
|
1218
|
+
uniform float speed;\r
|
|
1219
|
+
uniform float percent;\r
|
|
1220
|
+
uniform float gradient;\r
|
|
1221
|
+
\r
|
|
1222
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1223
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1224
|
+
vec2 st = materialInput.st;\r
|
|
1225
|
+
float t =fract(czm_frameNumber * speed / 1000.0);\r
|
|
1226
|
+
t *= (1.0 + percent);\r
|
|
1227
|
+
float alpha = smoothstep(t- percent, t, st.s) * step(-t, -st.s);\r
|
|
1228
|
+
alpha += gradient;\r
|
|
1229
|
+
material.diffuse = color.rgb;\r
|
|
1230
|
+
material.alpha = alpha;\r
|
|
1231
|
+
return material;\r
|
|
1232
|
+
}\r
|
|
1233
|
+
`;var ju=`uniform sampler2D image;\r
|
|
1234
|
+
uniform float speed;\r
|
|
1235
|
+
uniform vec4 color;\r
|
|
1236
|
+
uniform vec2 repeat;\r
|
|
1237
|
+
\r
|
|
1238
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1239
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1240
|
+
vec2 st = repeat * materialInput.st;\r
|
|
1241
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1242
|
+
vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t));\r
|
|
1243
|
+
if(color.a == 0.0){\r
|
|
1244
|
+
if(colorImage.rgb == vec3(1.0) || colorImage.rgb == vec3(0.0)){\r
|
|
1245
|
+
discard;\r
|
|
1246
|
+
}\r
|
|
1247
|
+
material.alpha = colorImage.a;\r
|
|
1248
|
+
material.diffuse = colorImage.rgb;\r
|
|
1249
|
+
}else{\r
|
|
1250
|
+
material.alpha = colorImage.a * color.a;\r
|
|
1251
|
+
material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\r
|
|
1252
|
+
}\r
|
|
1253
|
+
return material;\r
|
|
1254
|
+
}\r
|
|
1255
|
+
`;var qu=`uniform sampler2D image;\r
|
|
1256
|
+
uniform vec4 color;\r
|
|
1257
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1258
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1259
|
+
vec2 st = materialInput.st;\r
|
|
1260
|
+
vec4 colorImage = texture(image,st);\r
|
|
1261
|
+
vec3 fragColor = color.rgb;\r
|
|
1262
|
+
material.alpha = colorImage.a * color.a * 3.;\r
|
|
1263
|
+
material.diffuse = max(fragColor.rgb + colorImage.rgb , fragColor.rgb);\r
|
|
1264
|
+
return material;\r
|
|
1265
|
+
}\r
|
|
1266
|
+
`;var Zu=`uniform sampler2D image;\r
|
|
1267
|
+
uniform vec4 color;\r
|
|
1268
|
+
uniform float speed;\r
|
|
1269
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1270
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1271
|
+
vec2 st = materialInput.st;\r
|
|
1272
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1273
|
+
vec4 colorImage = texture(image,st);\r
|
|
1274
|
+
vec3 fragColor = color.rgb;\r
|
|
1275
|
+
if(st.t > 0.45 && st.t < 0.55 ) {\r
|
|
1276
|
+
fragColor = vec3(1.0);\r
|
|
1277
|
+
}\r
|
|
1278
|
+
if(color.a == 0.0){\r
|
|
1279
|
+
material.alpha = colorImage.a * 1.5 * fract(st.s - time);\r
|
|
1280
|
+
material.diffuse = colorImage.rgb;\r
|
|
1281
|
+
}else{\r
|
|
1282
|
+
material.alpha = colorImage.a * color.a * 1.5 * smoothstep(.0,1., fract(st.s - time));\r
|
|
1283
|
+
material.diffuse = max(fragColor.rgb * material.alpha , fragColor.rgb);\r
|
|
1284
|
+
}\r
|
|
1285
|
+
return material;\r
|
|
1286
|
+
}\r
|
|
1287
|
+
`;var Yu=`uniform vec4 color;\r
|
|
1288
|
+
uniform float speed;\r
|
|
1289
|
+
\r
|
|
1290
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1291
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1292
|
+
vec2 st = materialInput.st;\r
|
|
1293
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1294
|
+
material.diffuse = color.rgb;\r
|
|
1295
|
+
material.alpha = color.a * fract(st.s-time);\r
|
|
1296
|
+
return material;\r
|
|
1297
|
+
}\r
|
|
1298
|
+
`;i.Material.PolylineFlickerType="PolylineFlicker";i.Material._materialCache.addMaterial(i.Material.PolylineFlickerType,{fabric:{type:i.Material.PolylineFlickerType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:Bu},translucent:function(a){return!0}});i.Material.PolylineFlowType="PolylineFlow";i.Material._materialCache.addMaterial(i.Material.PolylineFlowType,{fabric:{type:i.Material.PolylineFlowType,uniforms:{color:new i.Color(1,0,0,.7),speed:1,percent:.03,gradient:.1},source:Vu},translucent:function(a){return!0}});i.Material.PolylineImageTrailType="PolylineImageTrail";i.Material._materialCache.addMaterial(i.Material.PolylineImageTrailType,{fabric:{type:i.Material.PolylineImageTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1,repeat:new i.Cartesian2(1,1)},source:ju},translucent:function(a){return!0}});i.Material.PolylineLightingType="PolylineLighting";i.Material._materialCache.addMaterial(i.Material.PolylineLightingType,{fabric:{type:i.Material.PolylineLightingType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:qu},translucent:function(a){return!0}});i.Material.PolylineLightingTrailType="PolylineLightingTrail";i.Material._materialCache.addMaterial(i.Material.PolylineLightingTrailType,{fabric:{type:i.Material.PolylineLightingTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:3},source:Zu},translucent:function(a){return!0}});i.Material.PolylineTrailType="PolylineTrail";i.Material._materialCache.addMaterial(i.Material.PolylineTrailType,{fabric:{type:i.Material.PolylineTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1,repeat:new i.Cartesian2(1,1)},source:Yu},translucent:function(a){return!0}});var Xu=`uniform vec4 color;\r
|
|
1299
|
+
uniform float speed;\r
|
|
1300
|
+
\r
|
|
1301
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1302
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1303
|
+
vec2 st = materialInput.st * 2.0 - 1.0;\r
|
|
1304
|
+
float t = czm_frameNumber * speed / 1000.0 ;\r
|
|
1305
|
+
vec3 col = vec3(0.0);\r
|
|
1306
|
+
vec2 p = vec2(sin(t), cos(t));\r
|
|
1307
|
+
float d = length(st - dot(p, st) * p);\r
|
|
1308
|
+
if (dot(st, p) < 0.) {\r
|
|
1309
|
+
d = length(st);\r
|
|
1310
|
+
}\r
|
|
1311
|
+
\r
|
|
1312
|
+
col = .006 / d * color.rgb;\r
|
|
1313
|
+
\r
|
|
1314
|
+
if(distance(st,vec2(0)) > 0.99 ){\r
|
|
1315
|
+
col =color.rgb;\r
|
|
1316
|
+
}\r
|
|
1317
|
+
\r
|
|
1318
|
+
material.alpha = pow(length(col),2.0);\r
|
|
1319
|
+
material.diffuse = col * 3.0 ;\r
|
|
1320
|
+
return material;\r
|
|
1321
|
+
}\r
|
|
1322
|
+
`;var Ju=`uniform vec4 color;\r
|
|
1323
|
+
uniform float speed;\r
|
|
1324
|
+
\r
|
|
1325
|
+
#define PI 3.14159265359\r
|
|
1326
|
+
\r
|
|
1327
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1328
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1329
|
+
vec2 st = materialInput.st;\r
|
|
1330
|
+
vec2 scrPt = st * 2.0 - 1.0;\r
|
|
1331
|
+
float time = czm_frameNumber * speed / 1000.0 ;\r
|
|
1332
|
+
vec3 col = vec3(0.0);\r
|
|
1333
|
+
mat2 rot;\r
|
|
1334
|
+
float theta = -time * 1.0 * PI - 2.2;\r
|
|
1335
|
+
float cosTheta, sinTheta;\r
|
|
1336
|
+
cosTheta = cos(theta);\r
|
|
1337
|
+
sinTheta = sin(theta);\r
|
|
1338
|
+
rot[0][0] = cosTheta;\r
|
|
1339
|
+
rot[0][1] = -sinTheta;\r
|
|
1340
|
+
rot[1][0] = sinTheta;\r
|
|
1341
|
+
rot[1][1] = cosTheta;\r
|
|
1342
|
+
vec2 scrPtRot = rot * scrPt;\r
|
|
1343
|
+
float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);\r
|
|
1344
|
+
float falloff = 1.0 - length(scrPtRot);\r
|
|
1345
|
+
float ringSpacing = 0.23;\r
|
|
1346
|
+
if(mod(length(scrPtRot), ringSpacing) < 0.015 && length(scrPtRot) / ringSpacing < 5.0) {\r
|
|
1347
|
+
col += vec3(0, 0.5, 0);\r
|
|
1348
|
+
}\r
|
|
1349
|
+
col += vec3(0, 0.8, 0) * step(mod(length(scrPtRot), ringSpacing), 0.01) * step(length(scrPtRot), 1.0);\r
|
|
1350
|
+
material.alpha =pow(length(col + vec3(.5)),5.0);\r
|
|
1351
|
+
material.diffuse = (0.5 + pow(angle, 2.0) * falloff ) * color.rgb ;\r
|
|
1352
|
+
return material;\r
|
|
1353
|
+
}\r
|
|
1354
|
+
`;var Ku=`uniform vec4 color;\r
|
|
1355
|
+
uniform float speed;\r
|
|
1356
|
+
\r
|
|
1357
|
+
#define PI 3.14159265359\r
|
|
1358
|
+
\r
|
|
1359
|
+
float rand(vec2 co){\r
|
|
1360
|
+
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\r
|
|
1361
|
+
}\r
|
|
1362
|
+
\r
|
|
1363
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1364
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1365
|
+
vec2 st = materialInput.st;\r
|
|
1366
|
+
vec2 pos = st - vec2(0.5);\r
|
|
1367
|
+
float time = czm_frameNumber * speed / 1000.0 ;\r
|
|
1368
|
+
float r = length(pos);\r
|
|
1369
|
+
float t = atan(pos.y, pos.x) - time * 2.5;\r
|
|
1370
|
+
float a = (atan(sin(t), cos(t)) + PI)/(2.0*PI);\r
|
|
1371
|
+
float ta = 0.5;\r
|
|
1372
|
+
float v = smoothstep(ta-0.05,ta+0.05,a) * smoothstep(ta+0.05,ta-0.05,a);\r
|
|
1373
|
+
vec3 flagColor = color.rgb * v;\r
|
|
1374
|
+
float blink = pow(sin(time*1.5)*0.5+0.5, 0.8);\r
|
|
1375
|
+
flagColor = color.rgb * pow(a, 8.0*(.2+blink))*(sin(r*500.0)*.5+.5) ;\r
|
|
1376
|
+
flagColor = flagColor * pow(r, 0.4);\r
|
|
1377
|
+
material.alpha = length(flagColor) * 1.3;\r
|
|
1378
|
+
material.diffuse = flagColor * 3.0;\r
|
|
1379
|
+
return material;\r
|
|
1380
|
+
}\r
|
|
1381
|
+
`;i.Material.RadarLineType="RadarLine";i.Material._materialCache.addMaterial(i.Material.RadarLineType,{fabric:{type:i.Material.RadarLineType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Xu},translucent:function(a){return!0}});i.Material.RadarSweepType="RadarSweep";i.Material._materialCache.addMaterial(i.Material.RadarSweepType,{fabric:{type:i.Material.RadarSweepType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Ju},translucent:function(a){return!0}});i.Material.RadarWaveType="RadarWave";i.Material._materialCache.addMaterial(i.Material.RadarWaveType,{fabric:{type:i.Material.RadarWaveType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Ku},translucent:function(a){return!0}});var Qu=`uniform vec4 color;\r
|
|
1382
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1383
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1384
|
+
vec2 st = materialInput.st;\r
|
|
1385
|
+
material.diffuse = color.rgb * 2.0;\r
|
|
1386
|
+
material.alpha = color.a * (1.0-fract(st.t)) * 0.8;\r
|
|
1387
|
+
return material;\r
|
|
1388
|
+
}\r
|
|
1389
|
+
`;var $u=`uniform sampler2D image;\r
|
|
1390
|
+
uniform vec4 color;\r
|
|
1391
|
+
uniform float speed;\r
|
|
1392
|
+
uniform vec2 repeat;\r
|
|
1393
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1394
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1395
|
+
vec2 st = materialInput.st * repeat;\r
|
|
1396
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1397
|
+
vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t));\r
|
|
1398
|
+
material.alpha = colorImage.a * color.a ;\r
|
|
1399
|
+
material.diffuse = colorImage.rgb * color.rgb * 3.0 ;\r
|
|
1400
|
+
return material;\r
|
|
1401
|
+
}\r
|
|
1402
|
+
`;var e_=`uniform sampler2D image;\r
|
|
1403
|
+
uniform float speed;\r
|
|
1404
|
+
uniform vec4 color;\r
|
|
1405
|
+
uniform vec2 repeat;\r
|
|
1406
|
+
\r
|
|
1407
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1408
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1409
|
+
float perDis = 1.0 / repeat.y / 3.0 ;\r
|
|
1410
|
+
vec2 st = materialInput.st * repeat;\r
|
|
1411
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1412
|
+
vec4 colorImage = texture(image, vec2(st.s, fract(st.t - time)));\r
|
|
1413
|
+
material.alpha = colorImage.a * smoothstep(.2 ,1. ,distance(st.t * perDis ,1. + perDis ));\r
|
|
1414
|
+
material.diffuse = max(color.rgb * material.alpha * 1.5, color.rgb);\r
|
|
1415
|
+
material.emission = max(color.rgb * material.alpha * 1.5, color.rgb);\r
|
|
1416
|
+
return material;\r
|
|
1417
|
+
}\r
|
|
1418
|
+
`;var t_=` uniform sampler2D image;\r
|
|
1419
|
+
uniform float speed;\r
|
|
1420
|
+
uniform vec4 color;\r
|
|
1421
|
+
\r
|
|
1422
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){\r
|
|
1423
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\r
|
|
1424
|
+
vec2 st = materialInput.st;\r
|
|
1425
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1426
|
+
vec4 colorImage = texture(image, vec2(fract(st.t - time), st.t));\r
|
|
1427
|
+
if(color.a == 0.0){\r
|
|
1428
|
+
material.alpha = colorImage.a;\r
|
|
1429
|
+
material.diffuse = colorImage.rgb;\r
|
|
1430
|
+
}else{\r
|
|
1431
|
+
material.alpha = colorImage.a * color.a;\r
|
|
1432
|
+
material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\r
|
|
1433
|
+
}\r
|
|
1434
|
+
return material;\r
|
|
1435
|
+
}\r
|
|
1436
|
+
`;i.Material.WallDiffuseType="WallDiffuse";i.Material._materialCache.addMaterial(i.Material.WallDiffuseType,{fabric:{type:i.Material.WallDiffuseType,uniforms:{color:new i.Color(1,0,0,.7)},source:Qu},translucent:function(a){return!0}});i.Material.WallImageTrailType="WallImageTrail";i.Material._materialCache.addMaterial(i.Material.WallImageTrailType,{fabric:{type:i.Material.WallImageTrailType,uniforms:{image:i.Material.DefaultImageId,color:new i.Color(1,0,0,.7),speed:3,repeat:new i.Cartesian2(1,1)},source:$u},translucent:function(a){return!0}});i.Material.WallLineTrailType="WallLineTrail";i.Material._materialCache.addMaterial(i.Material.WallLineTrailType,{fabric:{type:i.Material.WallLineTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,repeat:new i.Cartesian2(1,1),speed:3},source:e_},translucent:function(a){return!0}});i.Material.WallTrailType="WallTrail";i.Material._materialCache.addMaterial(i.Material.WallTrailType,{fabric:{type:i.Material.WallTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1},source:t_},translucent:function(a){return!0}});var ma=class{constructor(e={}){this._definitionChanged=new i.Event,this._color=void 0,this._colorSubscription=void 0,this._speed=void 0,this._speedSubscription=void 0,this.color=e.color||i.Color.fromBytes(0,255,255,255),this.speed=e.speed||1}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return null}getValue(e,t){return t=i.defaultValue(t,{}),t}equals(e){return this===e}},L=ma;var li=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleBlurType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(li.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var i_=li;var hi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleDiffuseType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(hi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var r_=hi;var ci=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleFadeType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(ci.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var s_=ci;var pi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CirclePulseType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(pi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var o_=pi;var di=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleScanType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(di.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var a_=di;var mi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleSpiralType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(mi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var n_=mi;var ui=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleVaryType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(ui.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var l_=ui;var _i=class a extends L{constructor(e={}){super(e),this.count=Math.max(e.count||3,1),this.gradient=i.Math.clamp(e.gradient||.1,0,1)}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return i.Material.CircleWaveType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t.count=i.Property.getValueOrUndefined(this._count,e),t.gradient=i.Property.getValueOrUndefined(this._gradient,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._count,e._count)&&i.Property.equals(this._gradient,e._gradient)}};Object.defineProperties(_i.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),count:i.createPropertyDescriptor("count"),gradient:i.createPropertyDescriptor("gradient")});var h_=_i;var fi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.EllipsoidElectricType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(fi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var c_=fi;var gi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.EllipsoidTrailType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(gi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var p_=gi;var yi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.PolylineFlickerType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(yi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var d_=yi;var vi=class a extends L{constructor(e={}){super(e),this._percent=void 0,this._percentSubscription=void 0,this._gradient=void 0,this._gradientSubscription=void 0,this.percent=e.percent||.03,this.gradient=e.gradient||.1}getType(e){return i.Material.PolylineFlowType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t.percent=i.Property.getValueOrUndefined(this._percent,e),t.gradient=i.Property.getValueOrUndefined(this._gradient,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._percent,e._percent)&&i.Property.equals(this._gradient,e._gradient)}};Object.defineProperties(vi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),percent:i.createPropertyDescriptor("percent"),gradient:i.createPropertyDescriptor("gradient")});var m_=vi;var wi=class a extends L{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=e.image,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.PolylineImageTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)&&i.Property.equals(this._repeat,e._repeat)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(wi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image"),repeat:i.createPropertyDescriptor("repeat")});var u_=wi;var Ci="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAACYCAYAAACS0lH9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAJ0GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDIgMTE2LjE2NDY1NSwgMjAyMS8wMS8yNi0xNTo0MToyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPS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mCC";var xi=class a extends L{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=Ci}getType(e){return i.Material.PolylineLightingType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)}};Object.defineProperties(xi.prototype,{color:i.createPropertyDescriptor("color"),image:i.createPropertyDescriptor("image")});var __=xi;var Ti=class a extends L{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=Ci}getType(e){return i.Material.PolylineLightingTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ti.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image")});var f_=Ti;var Ei=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.PolylineTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=this._speed,t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ei.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var g_=Ei;var Pi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.RadarLineType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Pi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var y_=Pi;var bi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.RadarSweepType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(bi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var v_=bi;var Ai=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.RadarWaveType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ai.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var w_=Ai;var Mi=class a extends L{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=e.image,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.WallImageTrailType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)&&i.Property.equals(this._repeat,e._repeat)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Mi.prototype,{image:i.createPropertyDescriptor("image"),color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),repeat:i.createPropertyDescriptor("repeat")});var C_=Mi;var x_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVwAAABACAYAAABWdc94A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6d2hlbj0iMjAyMS0wMi0yNFQxNDoyMDoxNiswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIxLjIgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+eAiLkwAAAQZJREFUeJzt3LERwDAMxDAl5/1XdqYIXRiYQBULFf/svQeA/72nDwC4heACRAQXICK4ABHBBYgILkBEcAEiggsQEVyAiOACRAQXICK4ABHBBYgILkBkzYx9RoDAmpnn9BEAN/BSAIgILkBEcAEiggsQEVyAiOACRAQXICK4ABHBBYgILkBEcAEiggsQEVyAiOACRAQXIGKAHCBigBwg4qUAEBFcgIjgAkQEFyAiuAARwQWICC5ARHABIoILEBFcgIjgAkQEFyAiuAARwQWI2MMFiNjDBYh4KQBEBBcgIrgAEcEFiAguQERwASKCCxARXICI4AJEBBcgIrgAEcEFiAguQERwASIfRmAGiWTgoMYAAAAASUVORK5CYII=";var Ii=class a extends L{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=x_,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.WallLineTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._repeat,e._repeat)}};Object.defineProperties(Ii.prototype,{color:i.createPropertyDescriptor("color"),image:i.createPropertyDescriptor("image"),repeat:i.createPropertyDescriptor("repeat"),speed:i.createPropertyDescriptor("speed")});var T_=Ii;var E_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAOhlWElmTU0AKgAAAAgABgESAAMAAAABAAEAAAEaAAUAAAABAAAAVgEbAAUAAAABAAAAXgExAAIAAAAkAAAAZgEyAAIAAAAUAAAAiodpAAQAAAABAAAAngAAAAAAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIENDIDIwMTggKE1hY2ludG9zaCkAMjAxODoxMDoyNiAxNTozMDozNAAABJAEAAIAAAAUAAAA1KABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAAAyMDE4OjEwOjI2IDE1OjI0OjI1ALUCxicAAAAJcEhZcwAACxMAAAsTAQCanBgAAAdgaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgICAgICAgICB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAge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rZ8yo9YMeBrjMQezPoW4CWgYYpJ5a7aSfp1cvitOyfo27JTbIRFdHAaBhObskmLG0zYyOoO04IY1zy13TcKnR3Q5lMA2MuHfxp75VN4LgOi4ZNtf74MOUnIwCWDV/5e7uSlkbfCcRMuH2yrvBRlLgcO9xXqjIP/9lUeTLjFI3z8F+ualIvlptDJAAAAAElFTkSuQmCC";var Si=class a extends L{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=E_}getType(e){return i.Material.WallTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Si.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image")});var P_=Si;var Di=class a{constructor(e){e=e||{},this._definitionChanged=new i.Event,this._baseWaterColor=void 0,this._baseWaterColorSubscription=void 0,this.baseWaterColor=e.baseWaterColor||new i.Color(.2,.3,.6,1),this._blendColor=void 0,this._blendColorSubscription=void 0,this.blendColor=e.blendColor||new i.Color(0,1,.699,1),this._specularMap=void 0,this._specularMapSubscription=void 0,this.specularMap=e.specularMap||i.Material.DefaultImageId,this._normalMap=void 0,this._normalMapSubscription=void 0,this.normalMap=e.normalMap||i.Material.DefaultImageId,this.frequency=i.defaultValue(e.frequency,1e3),this.animationSpeed=i.defaultValue(e.animationSpeed,.01),this.amplitude=i.defaultValue(e.amplitude,10),this.specularIntensity=i.defaultValue(e.specularIntensity,.5)}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return i.Material.WaterType}getValue(e,t){return t||(t={}),t.baseWaterColor=i.Property.getValueOrUndefined(this._baseWaterColor,e),t.blendColor=i.Property.getValueOrUndefined(this._blendColor,e),t.specularMap=i.Property.getValueOrUndefined(this._specularMap,e),t.normalMap=i.Property.getValueOrUndefined(this._normalMap,e),t.frequency=this.frequency,t.animationSpeed=this.animationSpeed,t.amplitude=this.amplitude,t.specularIntensity=this.specularIntensity,t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._baseWaterColor,e._baseWaterColor)}};Object.defineProperties(Di.prototype,{baseWaterColor:i.createPropertyDescriptor("baseWaterColor"),blendColor:i.createPropertyDescriptor("blendColor"),specularMap:i.createPropertyDescriptor("specularMap"),normalMap:i.createPropertyDescriptor("normalMap")});var b_=Di;var ua=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_stoppedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._delegate&&this._layer.entities.remove(this._delegate),this._stoppedHook()}_bindEvent(){this.drawTool.on(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(E.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(E.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}stop(){return this.drawTool.fire(E.DRAW_STOP),this}},V=ua;var NE={pixelSize:10,outlineColor:i.Color.BLUE,outlineWidth:5},_a=class extends V{constructor(e){super(),this._position=i.Cartesian3.ZERO,this._style={...NE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({position:new i.CallbackProperty(()=>this._position,!1),point:{...this._style}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._position&&(e=new ii(f.transformCartesianToWGS84(this._position)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._position=e,this.drawTool.fire(E.DRAW_STOP,e)}_onAnchorMoving(e){this._position=e}},A_=_a;var HE={width:3,material:i.Color.YELLOW.withAlpha(.6)},fa=class extends V{constructor(e){super(),this._style={...HE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Se(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},M_=fa;var WE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},ga=class extends V{constructor(e){super(),this._style={...WE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(e=>e.clone())):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ie(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e})}},I_=ga;var GE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},ya=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._radius=0,this._style={...GE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>{if(this._positions.length>1){if(this._radius=i.Cartesian3.distance(this._positions[0],this._positions[1]),this._radius<=0)return null;let e=i.EllipseGeometryLibrary.computeEllipsePositions({center:this._positions[0],semiMajorAxis:this._radius,semiMinorAxis:this._radius,rotation:0,granularity:.005},!1,!0),t=i.Cartesian3.unpackArray(e.outerPositions);return t.push(t[0]),new i.PolygonHierarchy(t)}else return null},!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new ei(f.transformCartesianToWGS84(this._positions[0]),this._radius).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e,isCenter:t===1}),t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},S_=ya;var UE={material:i.Color.YELLOW.withAlpha(.6)},va=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._style={...UE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({rectangle:{...this._style,coordinates:new i.CallbackProperty(e=>this._positions.length>1?i.Rectangle.fromCartesianArray(this._positions):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new ri(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},D_=va;var wa=class extends V{constructor(e){super(),this._position=i.Cartesian3.ZERO,this._style={image:We,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({position:new i.CallbackProperty(()=>this._position,!1),billboard:{...this._style}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._position&&(e=new Me(f.transformCartesianToWGS84(this._position),this._style.image).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._position=e,this.drawTool.fire(E.DRAW_STOP)}_onAnchorMoving(e){this._position=e}},L_=wa;var Li=Math.PI/2,Ca=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.headTailFactor=.8}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_getArrowHeadPoints(e,t,r){let s=x.getBaseLength(e),o=s*this.headHeightFactor,n=e[e.length-1];s=x.distance(n,e[e.length-2]);let l=x.distance(t,r);o>l*this.headTailFactor&&(o=l*this.headTailFactor);let h=o*this.headWidthFactor,c=o*this.neckWidthFactor;o=o>s?s:o;let p=o*this.neckHeightFactor,u=x.getThirdPoint(e[e.length-2],n,0,o,!0),g=x.getThirdPoint(e[e.length-2],n,0,p,!0),_=x.getThirdPoint(n,u,Li,h,!1),d=x.getThirdPoint(n,u,Li,h,!0),T=x.getThirdPoint(n,g,Li,c,!1),w=x.getThirdPoint(n,g,Li,c,!0);return[T,_,n,d,w]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r)/x.getBaseLength(o),p=this._getArrowBodyPoints(o,l,h,c),u=p.length,g=[t].concat(p.slice(0,u/2));g.push(l);let _=[r].concat(p.slice(u/2,u));return _.push(h),g=x.getQBSplinePoints(g),_=x.getQBSplinePoints(_),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(g.concat(n,_.reverse()))))}},$e=Ca;var BE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},xa=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...BE,...e},this._graphics=new $e}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ue(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},R_=xa;var $=Math.PI/2,Ta=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_getArrowPoints(e,t,r,s){let o=x.mid(e,t),n=x.distance(o,r),l=x.getThirdPoint(r,o,0,n*.3,!0),h=x.getThirdPoint(r,o,0,n*.5,!0);l=x.getThirdPoint(o,l,$,n/5,s),h=x.getThirdPoint(o,h,$,n/4,s);let c=[o,l,h,r],p=this._getArrowHeadPoints(c),u=p[0],g=p[4],_=x.distance(e,t)/x.getBaseLength(c)/2,d=this._getArrowBodyPoints(c,u,g,_),T=d.length,w=d.slice(0,T/2),P=d.slice(T/2,T);return w.push(u),P.push(g),w=w.reverse(),w.push(t),P=P.reverse(),P.push(e),w.reverse().concat(p,P)}_getArrowHeadPoints(e){let r=x.getBaseLength(e)*this.headHeightFactor,s=e[e.length-1],o=r*this.headWidthFactor,n=r*this.neckWidthFactor,l=r*this.neckHeightFactor,h=x.getThirdPoint(e[e.length-2],s,0,r,!0),c=x.getThirdPoint(e[e.length-2],s,0,l,!0),p=x.getThirdPoint(s,h,$,o,!1),u=x.getThirdPoint(s,h,$,o,!0),g=x.getThirdPoint(s,c,$,n,!1),_=x.getThirdPoint(s,c,$,n,!0);return[g,p,s,u,_]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_getTempPoint4(e,t,r){let s=x.mid(e,t),o=x.distance(s,r),n=x.getAngleOfThreePoints(e,s,r),l,h,c,p;return n<$?(h=o*Math.sin(n),c=o*Math.cos(n),p=x.getThirdPoint(e,s,$,h,!1),l=x.getThirdPoint(s,p,$,c,!0)):n>=$&&n<Math.PI?(h=o*Math.sin(Math.PI-n),c=o*Math.cos(Math.PI-n),p=x.getThirdPoint(e,s,$,h,!1),l=x.getThirdPoint(s,p,$,c,!1)):n>=Math.PI&&n<Math.PI*1.5?(h=o*Math.sin(n-Math.PI),c=o*Math.cos(n-Math.PI),p=x.getThirdPoint(e,s,$,h,!0),l=x.getThirdPoint(s,p,$,c,!0)):(h=o*Math.sin(Math.PI*2-n),c=o*Math.cos(Math.PI*2-n),p=x.getThirdPoint(e,s,$,h,!0),l=x.getThirdPoint(s,p,$,c,!1)),l}_createHierarchy(){let e=this._positions.length,t,r,s=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],o=s[0],n=s[1],l=s[2];e===3?t=this._getTempPoint4(o,n,l):t=s[3],e===3||e===4?r=x.mid(o,n):r=s[4];let h,c;x.isClockWise(o,n,l)?(h=this._getArrowPoints(o,r,t,!1),c=this._getArrowPoints(r,n,l,!0)):(h=this._getArrowPoints(n,r,l,!1),c=this._getArrowPoints(r,o,t,!0));let p=h.length,u=(p-5)/2,g=h.slice(0,u),_=h.slice(u,u+5),d=h.slice(u+5,p),T=c.slice(0,u),w=c.slice(u,u+5),P=c.slice(u+5,p);T=x.getBezierPoints(T);let M=x.getBezierPoints(P.concat(g.slice(1)));return d=x.getBezierPoints(d),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(T.concat(w,M,_,d))))}},Ri=Ta;var VE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Ea=class extends V{constructor(e){super(),this._maxAnchorSize=4,this._style={...VE,...e},this._graphics=new Ri}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ft(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},O_=Ea;var k_=Math.PI/2,Pa=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.tailWidthFactor=.15,this.neckWidthFactor=.2,this.headWidthFactor=.25,this.headAngle=Math.PI/8.5,this.neckAngle=Math.PI/13}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1],s=x.getBaseLength(e),o=s*this.tailWidthFactor,n=s*this.neckWidthFactor,l=s*this.headWidthFactor,h=x.getThirdPoint(r,t,k_,o,!0),c=x.getThirdPoint(r,t,k_,o,!1),p=x.getThirdPoint(t,r,this.headAngle,l,!1),u=x.getThirdPoint(t,r,this.headAngle,l,!0),g=x.getThirdPoint(t,r,this.neckAngle,n,!1),_=x.getThirdPoint(t,r,this.neckAngle,n,!0);return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions([h,g,p,r,u,_,c])))}},Oi=Pa;var jE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},ba=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._style={...jE,...e},this._graphics=new Oi}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new zt(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},F_=ba;var qE=Math.PI/2,z_=100,Aa=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.t=.4}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0];if(this._positions.length===2){let n=x.mid(e[0],e[1]),l=x.distance(e[0],n)/.9,h=x.getThirdPoint(e[0],n,qE,l,!0);e=[e[0],h,e[1]]}let t=x.mid(e[0],e[2]);e.push(t,e[0],e[1]);let r=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1],c=e[n+2],p=x.getBisectorNormals(this.t,l,h,c);r=r.concat(p)}let s=r.length;r=[r[s-1]].concat(r.slice(0,s-1));let o=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1];o.push(l);for(let c=0;c<=z_;c++){let p=x.getCubicValue(c/z_,l,r[n*2],r[n*2+1],h);o.push(p)}o.push(h)}return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(o)))}},ki=Aa;var ZE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Ma=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...ZE,...e},this._graphics=new ki}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Nt(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},N_=Ma;var Ia=class extends $e{constructor(e){super(e),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.tailWidthFactor=.1,this.headTailFactor=.8,this.swallowTailFactor=1}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r),p=x.getBaseLength(o),u=p*this.tailWidthFactor*this.swallowTailFactor,g=x.getThirdPoint(o[1],o[0],0,u,!0),_=c/p,d=this._getArrowBodyPoints(o,l,h,_),T=d.length,w=[t].concat(d.slice(0,T/2));w.push(l);let P=[r].concat(d.slice(T/2,T));return P.push(h),w=x.getQBSplinePoints(w),P=x.getQBSplinePoints(P),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(w.concat(n,P.reverse(),[g,w[0]]))))}},Fi=Ia;var YE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Sa=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...YE,...e},this._graphics=new Fi}_mountEntity(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ht(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},H_=Sa;var Da=class{constructor(e){this._viewer=void 0,this._layer=void 0,this._overlay=e,this._overlay.show=!1,this._delegate=new i.Entity,this._delegate.merge(e.delegate),this._options={},this._positions=[]}get editTool(){return this._viewer.editTool}_mountedHook(){}_stoppedHook(){this._overlay.positions=f.transformCartesianArrayToWGS84Array(this._positions),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[].concat(f.transformWGS84ArrayToCartesianArray(this._overlay.positions)),this._positions.forEach((e,t)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:e,index:t})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now());this._positions[r.index]=t}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now());this._positions[r.index]=t}_onEditStop({pickedAnchor:e,position:t}){this._unbindEvent(),this._viewer.editTool.deactivate(),this._layer.entities.remove(this._delegate),this._stoppedHook()}_bindEvent(){return this.editTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.on(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.on(E.EDIT_STOP,this._onEditStop,this),this}_unbindEvent(){this.editTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.off(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.off(E.EDIT_STOP,this._onEditStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._viewer.editTool.activate(t),this._mountedHook(),this._mountAnchor(),this._unbindEvent(),this._bindEvent(),this}stop(){return this.editTool.fire(E.EDIT_STOP,{pickedAnchor:null,position:null}),this}},j=Da;var La=class extends j{constructor(e){super(e),this._position=void 0}_mountedHook(){this.editTool.tooltipMess="\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._position=this._delegate.position.getValue(i.JulianDate.now()),this._delegate.position=new i.CallbackProperty(()=>this._position,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.position=f.transformCartesianToWGS84(this._position),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_onAnchorMoving({pickedAnchor:e,position:t}){this._position=t}},W_=La;var Ra=class extends j{constructor(e){super(e)}_mountedHook(){this._delegate.polyline.positions=new i.CallbackProperty(()=>this._positions.length>1?this._positions:null,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.positions=f.transformCartesianArrayToWGS84Array(this._positions.filter((e,t)=>t%2===0)),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[];let e=this._overlay.delegate.polyline.positions.getValue(i.JulianDate.now());for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.push(e[e.length-1]),this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1]);this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((l,h)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:l,index:h,isMid:h%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(this._positions[s]=t,!r.isMid&&this._options.maxAnchorSize>2){let o=-1,n=-1,l=-1,h=-1,c=this._positions.length;if(s===0?(l=s+2,h=s+1):r.index===c-1?(o=s-2,n=s-1):(o=s-2,n=s-1,l=s+2,h=s+1),o>0){let p=z(this._positions[o],this._positions[s]);this._positions[n]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:n,position:p})}if(l>0){let p=z(this._positions[l],this._positions[s]);this._positions[h]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:h,position:p})}}}},G_=Ra;var Oa=class extends j{constructor(e){super(e)}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(t=>t.clone())):null,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.positions=f.transformCartesianArrayToWGS84Array(this._positions.filter((e,t)=>t%2===0)),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[];let e=this._overlay.delegate.polygon.hierarchy.getValue(i.JulianDate.now()).positions;e.push(e[0]);for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o,n,l=this._positions.length;s===l-1?(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[0])):(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1])),this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((h,c)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:h,index:c,isMid:c%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;this._positions[s]=t;let o=this._positions.length;if(!r.isMid){let n=-1,l=-1,h=-1,c=-1;s===0?(n=o-2,l=o-1,h=s+2,c=s+1):s===o-2?(n=s-2,l=s-1,h=0,c=o-1):(n=s-2,l=s-1,h=s+2,c=s+1);let p=z(this._positions[n],this._positions[s]),u=z(this._positions[h],this._positions[s]);this._positions[l]=p,this._positions[c]=u,this.editTool.fire(E.UPDATE_ANCHOR,{index:l,position:p}),this.editTool.fire(E.UPDATE_ANCHOR,{index:c,position:u})}}},U_=Oa;var ka=class extends j{constructor(e){super(e),this._center=void 0,this._radius=0}_mountedHook(){this._radius=this._overlay.radius,this._center=f.transformWGS84ToCartesian(this._overlay.center),this._positions=[].concat([this._center,this._computeCirclePoints(this._center,this._radius)[0]]),this._delegate.ellipse=null,this._delegate.polygon={...this._overlay._style},this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>{if(this._positions.length>1){if(this._radius=i.Cartesian3.distance(this._positions[0],this._positions[1]),this._radius<=0)return null;let t=this._computeCirclePoints(this._positions[0],this._radius);return t.push(t[0]),new i.PolygonHierarchy(t)}else return null},!1),this._layer.entities.add(this._delegate)}_computeCirclePoints(e,t){let r=[],s=i.EllipseGeometryLibrary.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:t,rotation:0,granularity:.005},!1,!0);return s&&s.outerPositions&&(r=i.Cartesian3.unpackArray(s.outerPositions)),r}_stoppedHook(){this._overlay.center=f.transformCartesianToWGS84(this._positions[0]),this._overlay.radius=this._radius,this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions.forEach((e,t)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:e,index:t,isCenter:t%2===0})})}},B_=ka;var Fa=class extends j{constructor(e){super(e),this._overlay=e}_mountedHook(){this._delegate.rectangle.coordinates=new i.CallbackProperty(e=>this._positions.length>1?i.Rectangle.fromCartesianArray(this._positions):null,!1),this._layer.entities.add(this._delegate)}},V_=Fa;var za=class extends j{constructor(e){super(e),this._position=void 0}_mountedHook(){this.editTool.tooltipMess="\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._position=this._delegate.position.getValue(i.JulianDate.now()),this._delegate.position=new i.CallbackProperty(()=>this._position,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.position=f.transformCartesianToWGS84(this._position),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_onAnchorMoving({pickedAnchor:e,position:t}){this._position=t}},j_=za;var Na=class extends j{constructor(e){super(e),this._graphics=new $e}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},q_=Na;var Ha=class extends j{constructor(e){super(e),this._graphics=new Ri}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Z_=Ha;var Wa=class extends j{constructor(e){super(e),this._graphics=new Oi}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Y_=Wa;var Ga=class extends j{constructor(e){super(e),this._graphics=new ki}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},X_=Ga;var Ua=class extends j{constructor(e){super(e),this._graphics=new Fi}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},J_=Ua;var Ba=class{constructor(e,t={}){this._viewer=e,this._options=t,this._layer=new i.CustomDataSource("plot-layer"),this._viewer.dataSources.add(this._layer),this._currentWorker=void 0,this._state=void 0}get viewer(){return this._viewer}get layer(){return this._layer}get state(){return this._state}_createDrawWorker(e,t){let r;switch(e){case N.POINT:r=new A_(t);break;case N.POLYLINE:r=new M_(t);break;case N.POLYGON:r=new I_(t);break;case N.CIRCLE:r=new S_(t);break;case N.RECT:r=new D_(t);break;case N.BILLBOARD:r=new L_(t);break;case N.ATTACK_ARROW:r=new R_(t);break;case N.DOUBLE_ARROW:r=new O_(t);break;case N.FINE_ARROW:r=new F_(t);break;case N.TAILED_ATTACK_ARROW:r=new H_(t);break;case N.GATHERING_PLACE:r=new N_(t);break;default:break}return r}_createEditWorker(e){let t;switch(e.type){case N.POINT:t=new W_(e);break;case N.POLYLINE:t=new G_(e);break;case N.POLYGON:t=new U_(e);break;case N.CIRCLE:t=new B_(e);break;case N.RECT:t=new V_(e);break;case N.BILLBOARD:t=new j_(e);break;case N.ATTACK_ARROW:t=new q_(e);break;case N.DOUBLE_ARROW:t=new Z_(e);break;case N.FINE_ARROW:t=new Y_(e);break;case N.TAILED_ATTACK_ARROW:t=new J_(e);break;case N.GATHERING_PLACE:t=new X_(e);break;default:break}return t}draw(e,t,r={},s=!1){var n;this._state="draw",this._currentWorker&&this._currentWorker.stop();let o=(r==null?void 0:r.maxAnchorSize)||999;return r&&delete r.maxAnchorSize,this._currentWorker=(n=this._createDrawWorker(e,r))==null?void 0:n.start(this,{...this._options,maxAnchorSize:o,onDrawStop:t,clampToModel:s!=null?s:this._options.clampToModel}),this}edit(e,t,r=!1){var s;return this._state="edit",this._currentWorker&&this._currentWorker.stop(),this._currentWorker=(s=this._createEditWorker(e))==null?void 0:s.start(this,{...this._options,onEditStop:t,clampToModel:r!=null?r:this._options.clampToModel}),this}stop(){this._currentWorker&&this._currentWorker.stop(),this._currentWorker=null}destroy(){return this._viewer.dataSources.remove(this._layer),this._viewer=void 0,this}},XE=Ba;var Va=class{constructor(e){this._viewer=e,this._options={}}_bindEvent(){}_unbindEvent(){}start(){if(this._viewer.clock.shouldAnimate=!0,this._unbindEvent(),this._options.duration){let e=setTimeout(()=>{this._unbindEvent(),this._options.callback&&this._options.callback.call(this._options.context||this),clearTimeout(e)},Number(this._options.duration)*1e3)}return this._bindEvent(),this}stop(){return this._unbindEvent(),this}},se=Va;var JE={},Z=JE;var ja=class extends se{constructor(e,t={}){super(e),this._options=t,this._heading=e.camera.heading,this._aroundAmount=.2}get type(){return Z.AROUND_VIEW}set aroundAmount(e){this._aroundAmount=e}_bindEvent(){this._viewer.clock.onTick.addEventListener(this._onAround,this)}_unbindEvent(){this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.clock.onTick.removeEventListener(this._onAround,this)}_onAround(e,t){this._heading+=i.Math.toRadians(this._aroundAmount),(this._heading>=Math.PI*2||this._heading<=-Math.PI*2)&&(this._heading=0),this._viewer.camera.setView({orientation:{heading:this._heading,pitch:this._options.pitch?i.Math.toRadians(this._options.pitch):this._viewer.camera.pitch,roll:this._options.roll?i.Math.toRadians(this._options.roll):this._viewer.camera.roll}})}};Z.AROUND_VIEW="around_view";var K_=ja;var qa=class extends se{constructor(e,t,r={}){super(e),this._position=y.parsePosition(t),this._options=r,this._heading=e.camera.heading,this._aroundAmount=.2}get type(){return Z.AROUND_POINT}set position(e){this._position=y.parsePosition(e)}set aroundAmount(e){this._aroundAmount=e}_bindEvent(){this._viewer.clock.onTick.addEventListener(this._onAround,this)}_unbindEvent(){this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.clock.onTick.removeEventListener(this._onAround,this)}_onAround(e,t){this._heading+=i.Math.toRadians(this._aroundAmount),(this._heading>=Math.PI*2||this._heading<=-Math.PI*2)&&(this._heading=0),this._viewer.camera.lookAt(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRange(this._heading,i.Math.toRadians(this._options.pitch||0),this._options.range||1e3))}};Z.AROUND_POINT="around_point";var Q_=qa;var $_=`in vec2 v_textureCoordinates;\r
|
|
1437
|
+
uniform sampler2D colorTexture;\r
|
|
1438
|
+
uniform sampler2D depthTexture;\r
|
|
1439
|
+
uniform vec3 centerWC;\r
|
|
1440
|
+
uniform vec3 normalWC;\r
|
|
1441
|
+
uniform float radius;\r
|
|
1442
|
+
uniform vec4 color;\r
|
|
1443
|
+
uniform float speed;\r
|
|
1444
|
+
\r
|
|
1445
|
+
float getDepth(){\r
|
|
1446
|
+
float z_window = czm_unpackDepth(texture(depthTexture, v_textureCoordinates));\r
|
|
1447
|
+
z_window = czm_reverseLogDepth(z_window);\r
|
|
1448
|
+
float n_range = czm_depthRange.near;\r
|
|
1449
|
+
float f_range = czm_depthRange.far;\r
|
|
1450
|
+
return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\r
|
|
1451
|
+
}\r
|
|
1452
|
+
\r
|
|
1453
|
+
vec4 toEye(in vec2 uv, in float depth){\r
|
|
1454
|
+
vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\r
|
|
1455
|
+
vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\r
|
|
1456
|
+
posInCamera = posInCamera / posInCamera.w;\r
|
|
1457
|
+
return posInCamera;\r
|
|
1458
|
+
}\r
|
|
1459
|
+
\r
|
|
1460
|
+
vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\r
|
|
1461
|
+
vec3 v01 = point - planeOrigin;\r
|
|
1462
|
+
float d = dot(planeNormal, v01) ;\r
|
|
1463
|
+
return (point - planeNormal * d);\r
|
|
1464
|
+
}\r
|
|
1465
|
+
\r
|
|
1466
|
+
void main() {\r
|
|
1467
|
+
out_FragColor = texture(colorTexture, v_textureCoordinates);\r
|
|
1468
|
+
float depth = getDepth();\r
|
|
1469
|
+
vec4 viewPos = toEye(v_textureCoordinates, depth);\r
|
|
1470
|
+
vec4 center = czm_view * vec4(centerWC,1);\r
|
|
1471
|
+
vec4 planeNormal = czm_view * vec4(normalWC,0);\r
|
|
1472
|
+
vec3 prjOnPlane = pointProjectOnPlane(planeNormal.xyz, center.xyz, viewPos.xyz);\r
|
|
1473
|
+
float dis = length(prjOnPlane.xyz - center.xyz);\r
|
|
1474
|
+
float time = fract(czm_frameNumber * speed / 1000.0);\r
|
|
1475
|
+
float temp = radius * time;\r
|
|
1476
|
+
if(dis < temp) {\r
|
|
1477
|
+
float f = 1.0 - abs(temp - dis) / temp;\r
|
|
1478
|
+
f = pow(f, 4.0);\r
|
|
1479
|
+
out_FragColor = mix(out_FragColor, color, f);\r
|
|
1480
|
+
}\r
|
|
1481
|
+
}\r
|
|
1482
|
+
`;var Za=class extends se{constructor(e,t,r,s={}){super(e),this._delegate=void 0,this._position=y.parsePosition(t),this._radius=r||100,this._color=s.color||i.Color.RED,this._speed=s.speed||2}get type(){return Z.CIRCLE_SCAN}_mountContent(){let e=f.transformWGS84ToCartesian(this._position),t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e,new i.Cartesian3),r=this;this._delegate=new i.PostProcessStage({name:C.uuid(),fragmentShader:$_,uniforms:{centerWC:function(){return e},normalWC:function(){return t},radius:function(){return r._radius},speed:function(){return r._speed},color:function(){return r._color}}})}start(){return!this._delegate&&this._mountContent(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate),this}stop(){return this._delegate&&this._viewer.scene.postProcessStages.remove(this._delegate),this._delegate=void 0,this}};Z.CIRCLE_SCAN="circle_scan";var ef=Za;var Ya=class extends se{constructor(e,t={}){super(e),this._options=t,this._positions=[],this._durations=[3],this._currentIndex=0,this._timer=void 0}get type(){return Z.FLYING}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}set durations(e){this._durations=e}get durations(){return this._durations}_cameraFly(){let e=this,t=this._viewer.camera,r=this._positions[this._currentIndex],s=()=>{let o=e._positions[e._currentIndex+1];o?(e._currentIndex++,e._currentIndex<=e._positions.length-1&&(e._timer=setTimeout(()=>{e._cameraFly()},(e._options.dwellTime||1)*1e3))):!o&&e._options.loop&&(e._currentIndex=0,e._timer=setTimeout(()=>{e._cameraFly()},(e._options.dwellTime||1)*1e3)),e._options.callback&&e._options.callback(e._currentIndex)};r&&t.flyTo({destination:f.transformWGS84ToCartesian(r),orientation:{heading:i.Math.toRadians(r.heading),pitch:i.Math.toRadians(r.pitch),roll:i.Math.toRadians(r.roll)},complete:s,duration:this._durations.length===1?this._durations[0]:this._durations[this._currentIndex]})}start(){return this._positions&&this._positions.length&&(this._currentIndex=0,this._cameraFly()),this}pause(){return this._viewer.camera.cancelFlight(),this._timer&&clearTimeout(this._timer),this}restore(){return this._positions&&this._positions.length&&this._cameraFly(),this}};Z.FLYING="flying";var tf=Ya;var Xa=class extends se{constructor(e,t={}){super(e),this._options=t}get type(){return Z.GLOBE_ROTATE}_icrf(e,t){if(e.mode!==i.SceneMode.SCENE3D)return!0;let r=i.Transforms.computeIcrfToFixedMatrix(t);if(r){let s=this._viewer.camera,o=i.Cartesian3.clone(s.position),n=i.Matrix4.fromRotationTranslation(r);s.lookAtTransform(n,o)}}_bindEvent(){this._viewer.clock.multiplier=this._options.speed||12*1e3,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.scene.postUpdate.addEventListener(this._icrf,this)}_unbindEvent(){this._viewer.clock.multiplier=1,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.scene.postUpdate.removeEventListener(this._icrf,this)}};Z.GLOBE_ROTATE="globe_rotate";var rf=Xa;var sf=`in vec2 v_textureCoordinates;\r
|
|
1483
|
+
uniform sampler2D colorTexture;\r
|
|
1484
|
+
uniform sampler2D depthTexture;\r
|
|
1485
|
+
uniform vec3 centerWC;\r
|
|
1486
|
+
uniform vec3 planeNormalWC;\r
|
|
1487
|
+
uniform vec3 lineNormalWC;\r
|
|
1488
|
+
uniform float radius;\r
|
|
1489
|
+
uniform vec4 color;\r
|
|
1490
|
+
\r
|
|
1491
|
+
float getDepth(){\r
|
|
1492
|
+
float z_window = czm_unpackDepth(texture(depthTexture, v_textureCoordinates));\r
|
|
1493
|
+
z_window = czm_reverseLogDepth(z_window);\r
|
|
1494
|
+
float n_range = czm_depthRange.near;\r
|
|
1495
|
+
float f_range = czm_depthRange.far;\r
|
|
1496
|
+
return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\r
|
|
1497
|
+
}\r
|
|
1498
|
+
\r
|
|
1499
|
+
vec4 toEye(in vec2 uv, in float depth){\r
|
|
1500
|
+
vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\r
|
|
1501
|
+
vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\r
|
|
1502
|
+
posInCamera = posInCamera / posInCamera.w;\r
|
|
1503
|
+
return posInCamera;\r
|
|
1504
|
+
}\r
|
|
1505
|
+
\r
|
|
1506
|
+
bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\r
|
|
1507
|
+
{\r
|
|
1508
|
+
vec3 v01 = testPt - ptOnLine;\r
|
|
1509
|
+
normalize(v01);\r
|
|
1510
|
+
vec3 temp = cross(v01, lineNormal);\r
|
|
1511
|
+
vec4 planeNormalEC = czm_view * vec4(planeNormalWC,0);\r
|
|
1512
|
+
float d = dot(temp, planeNormalEC.xyz);\r
|
|
1513
|
+
return d > 0.5;\r
|
|
1514
|
+
}\r
|
|
1515
|
+
\r
|
|
1516
|
+
vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\r
|
|
1517
|
+
{\r
|
|
1518
|
+
vec3 v01 = point -planeOrigin;\r
|
|
1519
|
+
float d = dot(planeNormal, v01) ;\r
|
|
1520
|
+
return (point - planeNormal * d);\r
|
|
1521
|
+
}\r
|
|
1522
|
+
\r
|
|
1523
|
+
float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\r
|
|
1524
|
+
{\r
|
|
1525
|
+
vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\r
|
|
1526
|
+
return length(tempPt - ptOnLine);\r
|
|
1527
|
+
}\r
|
|
1528
|
+
\r
|
|
1529
|
+
void main() {\r
|
|
1530
|
+
out_FragColor = texture(colorTexture, v_textureCoordinates);\r
|
|
1531
|
+
float depth = getDepth();\r
|
|
1532
|
+
vec4 viewPos = toEye(v_textureCoordinates, depth);\r
|
|
1533
|
+
vec4 centerEC = czm_view * vec4(centerWC,1);\r
|
|
1534
|
+
vec4 planeNormalEC = czm_view * vec4(planeNormalWC,0);\r
|
|
1535
|
+
vec4 lineNormalEC = czm_view * vec4(lineNormalWC,0);\r
|
|
1536
|
+
vec3 prjOnPlane = pointProjectOnPlane(planeNormalEC.xyz, centerEC.xyz, viewPos.xyz);\r
|
|
1537
|
+
float dis = length(prjOnPlane.xyz - centerEC.xyz);\r
|
|
1538
|
+
float diameter = radius * 2.0;\r
|
|
1539
|
+
if(dis < radius){\r
|
|
1540
|
+
float f0 = 1.0 -abs(radius - dis) / radius;\r
|
|
1541
|
+
f0 = pow(f0, 64.0);\r
|
|
1542
|
+
vec3 lineEndPt = vec3(centerEC.xyz) + vec3(lineNormalEC.xyz) * radius;\r
|
|
1543
|
+
float f = 0.0;\r
|
|
1544
|
+
if(isPointOnLineRight(centerEC.xyz, lineNormalEC.xyz, prjOnPlane.xyz)) {\r
|
|
1545
|
+
float dis1= length(prjOnPlane.xyz - lineEndPt);\r
|
|
1546
|
+
f = abs(diameter - dis1) / diameter;\r
|
|
1547
|
+
f = pow(f, 3.0);\r
|
|
1548
|
+
}\r
|
|
1549
|
+
out_FragColor = mix(out_FragColor, color, f + f0);\r
|
|
1550
|
+
}\r
|
|
1551
|
+
}\r
|
|
1552
|
+
`;var Ja=class extends se{constructor(e,t,r,s={}){super(e),this._position=y.parsePosition(t),this._radius=r||100,this._color=s.color||i.Color.BLUE,this._speed=s.speed||3,this._delegate=void 0}get type(){return Z.RADAR_SCAN}_mountContent(){let e=f.transformWGS84ToCartesian(this._position),t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e,new i.Cartesian3),r=new Date().getTime(),s=this;this._delegate=new i.PostProcessStage({name:C.uuid(),fragmentShader:sf,uniforms:{centerWC:function(){return e},planeNormalWC:function(){return t},lineNormalWC:function(){let o=new i.Quaternion,n=new i.Matrix3,l=i.Cartesian3.cross(i.Cartesian3.UNIT_Z,t,new i.Cartesian3),h=new Date().getTime(),c=i.Math.PI*2*((h-r)/1e4)*s._speed;return i.Quaternion.fromAxisAngle(t,c,o),i.Matrix3.fromQuaternion(o,n),i.Matrix3.multiplyByVector(n,l,l),i.Cartesian3.normalize(l,l),l},radius:function(){return s._radius},color:function(){return s._color}}})}start(){return!this._delegate&&this._mountContent(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate),this}stop(){return this._delegate&&this._viewer.scene.postProcessStages.remove(this._delegate),this._delegate=void 0,this}};Z.RADAR_SCAN="radar_scan";var of=Ja;var Ka=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._gradations=1,this._selected=[],this._state=m.INITIALIZED}get type(){return"black_and_white"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set gradations(e){this._gradations=e,this._delegate&&(this._delegate.uniforms.gradations=e)}get gradations(){return this._gradations}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createBlackAndWhiteStage(),this._delegate&&(this._delegate.uniforms.gradations=this._gradations,this._viewer.scene.postProcessStages.add(this._delegate))}},af=Ka;var Qa=class{constructor(e){this._viewer=e,this._enable=!1,this._contrast=128,this._brightness=-.3,this._glowOnly=!1,this._delta=1,this._sigma=3.8,this._stepSize=5,this._selected=[],this._state=m.INITIALIZED}get type(){return"bloom"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set contrast(e){this._contrast=e,this._delegate&&(this._delegate.uniforms.contrast=e)}get contrast(){return this._contrast}set brightness(e){this._brightness=e,this._delegate&&(this._delegate.uniforms.brightness=e)}get brightness(){return this._brightness}set glowOnly(e){this._glowOnly=e,this._delegate&&(this._delegate.uniforms.glowOnly=e)}get glowOnly(){return this._glowOnly}set delta(e){this._delta=e,this._delegate&&(this._delegate.uniforms.delta=e)}get delta(){return this._delta}set sigma(e){this._sigma=e,this._delegate&&(this._delegate.uniforms.sigma=e)}get sigma(){return this._sigma}set stepSize(e){this._stepSize=e,this._delegate&&(this._delegate.uniforms.stepSize=e)}get stepSize(){return this._stepSize}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=this._viewer.scene.postProcessStages.bloom,this._delegate.uniforms.contrast=this._contrast,this._delegate.uniforms.brightness=this._brightness,this._delegate.uniforms.glowOnly=this._glowOnly,this._delegate.uniforms.delta=this._delta,this._delegate.uniforms.sigma=this._sigma,this._delegate.uniforms.stepSize=this._stepSize}},nf=Qa;var $a=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._intensity=1,this._selected=[],this._state=m.INITIALIZED}get type(){return"brightness"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set intensity(e){this._intensity=e,this._delegate&&(this._delegate.uniforms.brightness=e)}get intensity(){return this._intensity}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createBrightnessStage(),this._delegate&&(this._delegate.uniforms.brightness=this._intensity,this._viewer.scene.postProcessStages.add(this._delegate))}},lf=$a;var en=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._focalDistance=87,this._delta=1,this._sigma=3.8,this._stepSize=2.5,this._selected=[],this._state=m.INITIALIZED}get type(){return"depth_of_field"}set enable(e){this._enable=e,i.PostProcessStageLibrary.isDepthOfFieldSupported(this._viewer.scene)&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e),this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set focalDistance(e){this._focalDistance=e,this._delegate&&(this._delegate.uniforms.focalDistance=e)}get focalDistance(){return this._focalDistance}set delta(e){this._delta=e,this._delegate&&(this._delegate.uniforms.delta=e)}get delta(){return this._delta}set sigma(e){this._sigma=e,this._delegate&&(this._delegate.uniforms.sigma=e)}get sigma(){return this._sigma}set stepSize(e){this._stepSize=e,this._delegate&&(this._delegate.uniforms.stepSize=e)}get stepSize(){return this._stepSize}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createDepthOfFieldStage(),this._delegate&&(this._delegate.uniforms.focalDistance=this._focalDistance,this._delegate.uniforms.delta=this._delta,this._delegate.uniforms.sigma=this._sigma,this._delegate.uniforms.stepSize=this._stepSize,this._viewer.scene.postProcessStages.add(this._delegate))}},hf=en;var tn=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._intensity=6,this._distortion=61,this._dirtAmount=.4,this._haloWidth=.4,this._selected=[],this._state=m.INITIALIZED}get type(){return"lens_flare"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set intensity(e){this._intensity=e,this._delegate&&(this._delegate.uniforms.intensity=e)}get intensity(){return this._intensity}set distortion(e){this._distortion=e,this._delegate&&(this._delegate.uniforms.distortion=e)}get distortion(){return this._distortion}set dirtAmount(e){this._dirtAmount=e,this._delegate&&(this._delegate.uniforms.dirtAmount=e)}get dirtAmount(){return this._dirtAmount}set haloWidth(e){this._haloWidth=e,this._delegate&&(this._delegate.uniforms.haloWidth=e)}get haloWidth(){return this._haloWidth}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createLensFlareStage(),this._delegate&&(this._delegate.uniforms.intensity=this._intensity,this._delegate.uniforms.distortion=this._distortion,this._delegate.uniforms.dirtAmount=this._dirtAmount,this._delegate.uniforms.haloWidth=this._haloWidth,this._viewer.scene.postProcessStages.add(this._delegate))}},cf=tn;var rn=class{constructor(e){this._viewer=e,this._enable=!1,this._selected=[],this._state=m.INITIALIZED}get type(){return"night"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createNightVisionStage(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate)}},pf=rn;var sn=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._color=i.Color.GREEN,this._length=.5,this._selected=[],this._state=m.INITIALIZED}get type(){return"silhouette"}set enable(e){this._enable=e,i.PostProcessStageLibrary.isSilhouetteSupported(this._viewer.scene)&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e),this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.color=e)}get color(){return this._color}set length(e){this._length=e,this._delegate&&(this._delegate.uniforms.length=e)}get length(){return this._length}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createSilhouetteStage(),this._delegate&&(this._delegate.uniforms.color=this._color,this._delegate.uniforms.length=this._length,this._viewer.scene.postProcessStages.add(this._delegate))}},df=sn;var mf=`in vec2 v_textureCoordinates;
|
|
1553
|
+
uniform sampler2D colorTexture;
|
|
1554
|
+
uniform sampler2D depthTexture;
|
|
1555
|
+
uniform float u_depthThreshold;
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
void main(void) {
|
|
1559
|
+
float depth = czm_readDepth(depthTexture, v_textureCoordinates);
|
|
1560
|
+
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
1561
|
+
if(depth < 1.0 - u_depthThreshold ){
|
|
1562
|
+
out_FragColor = color;
|
|
1563
|
+
}else {
|
|
1564
|
+
out_FragColor = vec4(1.,0.,0.,1.);
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
`;var uf=`in vec2 v_textureCoordinates;
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
uniform sampler2D colorTexture;
|
|
1571
|
+
uniform sampler2D u_silhouetteTexture;
|
|
1572
|
+
uniform sampler2D u_redTexture;
|
|
1573
|
+
uniform vec4 u_color;
|
|
1574
|
+
|
|
1575
|
+
void main(void) {
|
|
1576
|
+
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
1577
|
+
vec4 silhouetteColor = texture(u_silhouetteTexture, v_textureCoordinates);
|
|
1578
|
+
vec4 redColor = texture(u_redTexture, v_textureCoordinates);
|
|
1579
|
+
|
|
1580
|
+
if(redColor.r == 1.0 ){
|
|
1581
|
+
out_FragColor = mix(color, u_color, silhouetteColor.a);
|
|
1582
|
+
}else {
|
|
1583
|
+
out_FragColor = color;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
`;var on=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._depthThreshold=1e-5,this._color=i.Color.RED,this._state=m.INITIALIZED}get type(){return"skyLine"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set depthThreshold(e){this._depthThreshold=e}get depthThreshold(){return this._depthThreshold}set color(e){this._color=e}get color(){return this._color}_createPostProcessStage(){let e=i.PostProcessStageLibrary.createEdgeDetectionStage(),t=this,r=new i.PostProcessStage({fragmentShader:mf,uniforms:{u_depthThreshold:function(){return t._depthThreshold}}}),s=new i.PostProcessStage({fragmentShader:uf,uniforms:{u_silhouetteTexture:e.name,u_redTexture:r.name,u_color:function(){return t._color}}});this._delegate=new i.PostProcessStageComposite({stages:[e,r,s],inputPreviousStageTexture:!1,uniforms:e.uniforms}),this._viewer.scene.postProcessStages.add(this._delegate)}},_f=on;var an=class{constructor(e){if(!e)throw Error("missing viewer param");this._blackAndWhite=new af(e),this._bloom=new nf(e),this._brightness=new lf(e),this._depthOfField=new hf(e),this._lensFlare=new cf(e),this._night=new pf(e),this._silhouette=new df(e),this._skyLine=new _f(e)}get blackAndWhite(){return this._blackAndWhite}get bloom(){return this._bloom}get brightness(){return this._brightness}get depthOfField(){return this._depthOfField}get lensFlare(){return this._lensFlare}get night(){return this._night}get silhouette(){return this._silhouette}get skyLine(){return this._skyLine}},tP=an;var ff=`in vec2 v_textureCoordinates;\r
|
|
1587
|
+
uniform sampler2D colorTexture;\r
|
|
1588
|
+
uniform sampler2D depthTexture;\r
|
|
1589
|
+
uniform vec4 fogByDistance;\r
|
|
1590
|
+
uniform vec4 fogColor;\r
|
|
1591
|
+
\r
|
|
1592
|
+
\r
|
|
1593
|
+
float getDistance(sampler2D depthTexture, vec2 texCoords){\r
|
|
1594
|
+
float depth = czm_unpackDepth(texture(depthTexture, texCoords));\r
|
|
1595
|
+
if (depth == 0.0) {\r
|
|
1596
|
+
return czm_infinity;\r
|
|
1597
|
+
}\r
|
|
1598
|
+
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\r
|
|
1599
|
+
return -eyeCoordinate.z / eyeCoordinate.w;\r
|
|
1600
|
+
}\r
|
|
1601
|
+
\r
|
|
1602
|
+
\r
|
|
1603
|
+
float interpolateByDistance(vec4 nearFarScalar, float distance){\r
|
|
1604
|
+
float startDistance = nearFarScalar.x;\r
|
|
1605
|
+
float startValue = nearFarScalar.y;\r
|
|
1606
|
+
float endDistance = nearFarScalar.z;\r
|
|
1607
|
+
float endValue = nearFarScalar.w;\r
|
|
1608
|
+
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\r
|
|
1609
|
+
return mix(startValue, endValue, t);\r
|
|
1610
|
+
}\r
|
|
1611
|
+
\r
|
|
1612
|
+
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor){\r
|
|
1613
|
+
return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\r
|
|
1614
|
+
}\r
|
|
1615
|
+
\r
|
|
1616
|
+
void main(void){\r
|
|
1617
|
+
float distance = getDistance(depthTexture, v_textureCoordinates);\r
|
|
1618
|
+
vec4 sceneColor = texture(colorTexture, v_textureCoordinates);\r
|
|
1619
|
+
float blendAmount = interpolateByDistance(fogByDistance, distance);\r
|
|
1620
|
+
vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);\r
|
|
1621
|
+
out_FragColor = alphaBlend(finalFogColor, sceneColor);\r
|
|
1622
|
+
}\r
|
|
1623
|
+
`;var nn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._fogByDistance={near:10,nearValue:0,far:2e3,farValue:1},this._color=new i.Color(0,0,0,1),this._state=m.INITIALIZED}get type(){return"fog"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set fogByDistance(e){var t,r,s,o;this._fogByDistance=e,this._delegate&&(this._delegate.uniforms.fogByDistance=new i.Cartesian4(((t=this._fogByDistance)==null?void 0:t.near)||10,((r=this._fogByDistance)==null?void 0:r.nearValue)||0,((s=this._fogByDistance)==null?void 0:s.far)||2e3,((o=this._fogByDistance)==null?void 0:o.farValue)||1))}get fogByDistance(){return this._fogByDistance}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.fogColor=e)}get color(){return this._color}_createPostProcessStage(){var e,t,r,s;this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:ff,uniforms:{fogByDistance:new i.Cartesian4(((e=this._fogByDistance)==null?void 0:e.near)||10,((t=this._fogByDistance)==null?void 0:t.nearValue)||0,((r=this._fogByDistance)==null?void 0:r.far)||200,((s=this._fogByDistance)==null?void 0:s.farValue)||1),fogColor:this._color}}),this._viewer.scene.postProcessStages.add(this._delegate)}},gf=nn;var yf=`in vec2 v_textureCoordinates;\r
|
|
1624
|
+
uniform sampler2D colorTexture;\r
|
|
1625
|
+
uniform float speed;\r
|
|
1626
|
+
uniform float mixNum;\r
|
|
1627
|
+
\r
|
|
1628
|
+
float hash(float x){\r
|
|
1629
|
+
return fract(sin(x*23.3)*13.13);\r
|
|
1630
|
+
}\r
|
|
1631
|
+
\r
|
|
1632
|
+
void main(){\r
|
|
1633
|
+
float time = czm_frameNumber * speed / 1000.0;\r
|
|
1634
|
+
vec2 resolution = czm_viewport.zw;\r
|
|
1635
|
+
vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\r
|
|
1636
|
+
vec3 c=vec3(.1,.2,.3);\r
|
|
1637
|
+
float a=-.3;\r
|
|
1638
|
+
float si=sin(a),co=cos(a);\r
|
|
1639
|
+
uv*=mat2(co,-si,si,co);\r
|
|
1640
|
+
uv*=length(uv+vec2(0,4.9))*.3+1.;\r
|
|
1641
|
+
float v=1.-sin(hash(floor(uv.x*100.))*2.);\r
|
|
1642
|
+
float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*10.;\r
|
|
1643
|
+
c*=v*b;\r
|
|
1644
|
+
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), mixNum);\r
|
|
1645
|
+
}\r
|
|
1646
|
+
`;var ln=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._speed=10,this._mixNum=.5,this._state=m.INITIALIZED}get type(){return"rain"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set speed(e){this._speed=e,this._delegate&&(this._delegate.uniforms.speed=e)}get speed(){return this._speed}set mixNum(e){this._mixNum=e,this._delegate&&(this._delegate.uniforms.mixNum=e)}get mixNum(){return this._mixNum}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:yf,uniforms:{speed:this._speed,mixNum:this._mixNum}}),this._viewer.scene.postProcessStages.add(this._delegate)}},vf=ln;var wf=`in vec2 v_textureCoordinates;\r
|
|
1647
|
+
uniform sampler2D colorTexture;\r
|
|
1648
|
+
uniform float speed;\r
|
|
1649
|
+
\r
|
|
1650
|
+
float snow(vec2 uv,float scale){\r
|
|
1651
|
+
float time = czm_frameNumber * speed / 1000.0 ;\r
|
|
1652
|
+
float w=smoothstep(1.,0.,-uv.y*(scale/10.));\r
|
|
1653
|
+
if(w<.1)return 0.;\r
|
|
1654
|
+
uv+=time/scale;\r
|
|
1655
|
+
uv.y+=time*2./scale;\r
|
|
1656
|
+
uv.x+=sin(uv.y+time*.5)/scale;\r
|
|
1657
|
+
uv*=scale;\r
|
|
1658
|
+
vec2 s=floor(uv),f=fract(uv),p;\r
|
|
1659
|
+
float k=3.,d;\r
|
|
1660
|
+
p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;\r
|
|
1661
|
+
d=length(p);\r
|
|
1662
|
+
k=min(d,k);\r
|
|
1663
|
+
k=smoothstep(0.,k,sin(f.x+f.y)*0.01);\r
|
|
1664
|
+
return k*w;\r
|
|
1665
|
+
}\r
|
|
1666
|
+
\r
|
|
1667
|
+
void main(){\r
|
|
1668
|
+
vec2 resolution = czm_viewport.zw;\r
|
|
1669
|
+
vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\r
|
|
1670
|
+
vec3 finalColor=vec3(0);\r
|
|
1671
|
+
float c = 0.0;\r
|
|
1672
|
+
c+=snow(uv,10.);\r
|
|
1673
|
+
c+=snow(uv,8.);\r
|
|
1674
|
+
c+=snow(uv,6.);\r
|
|
1675
|
+
c+=snow(uv,5.);\r
|
|
1676
|
+
finalColor=(vec3(c));\r
|
|
1677
|
+
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\r
|
|
1678
|
+
}\r
|
|
1679
|
+
`;var hn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._speed=10,this._state=m.INITIALIZED}get type(){return"snow"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set speed(e){this._speed=e,this._delegate&&(this._delegate.uniforms.speed=e)}get speed(){return this._speed}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:wf,uniforms:{speed:this._speed}}),this._viewer.scene.postProcessStages.add(this._delegate)}},Cf=hn;var xf="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAgCgAwAEAAAAAQAAAQAAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAQACAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQ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OPwpi25z8rUgEnp+tJ+8/u0ATKzL3qQSt6/pVbL/AN39acN/ofzoAmNwR1H6Go2nbtj9aT5vQ0ZagBvnSe1J5jt1xT8Me36UbT6UAQnd6/rSYcd/1qx5Z9KNh9qAIlLDvSncepP0qTyzQIz7UAQFOOv60qqB3NTeWfajyj/kUARYFPDFehp3lH1FHlH1oATcT1Jpufen+V70eSPWgBm7FJnNS+WtLsHpQBHz6UeWW9Kl2CjFAELRkdaZg1ZIzTNpFAEJWkK1Pg0YYdqAKrCq8lXmBPUVVlX2oAoSVXPWrUq+1ViOaAP/2Q==";var cn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._rotateAmount=0,this._enable=!1,this._heading=0,this._state=m.INITIALIZED}get type(){return"cloud"}set enable(e){!this._viewer.scene.mode!==i.SceneMode.SCENE3D&&(this._delegate||this._createPrimitive(),this._enable=this._delegate.show=e,this._enable?this._viewer.scene.postUpdate.addEventListener(this._onRotate,this):this._viewer.scene.postUpdate.removeEventListener(this._onRotate,this))}get enable(){return this._enable}set rotateAmount(e){this._rotateAmount=e}get rotateAmount(){return this._rotateAmount}_onRotate(e,t){this._rotateAmount!==0&&(this._heading+=this._rotateAmount,(this._heading>=360||this._heading<=-360)&&(this._heading=0),this._delegate.modelMatrix=i.Transforms.headingPitchRollToFixedFrame(new i.Cartesian3,new i.HeadingPitchRoll(i.Math.toRadians(this._heading),0,0)))}_createPrimitive(){this._delegate=new i.Primitive({appearance:new i.EllipsoidSurfaceAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{color:new i.Color(1,1,1,1),image:xf},components:{alpha:"texture(image, fract(repeat * materialInput.st)).r * color.a",diffuse:"vec3(1.0)"}}}),translucent:!0,aboveGround:!0})}),this._delegate.geometryInstances=new i.GeometryInstance({geometry:new i.EllipsoidGeometry({vertexFormat:i.VertexFormat.POSITION_AND_ST,radii:this._viewer.scene.globe.ellipsoid.radii}),id:this._id}),this._delegate.show=this._enable,this._viewer.scene.primitives.add(this._delegate)}},Tf=cn;var pn=class{constructor(e){if(!e)throw Error("missing viewer param");this._fog=new gf(e),this._rain=new vf(e),this._snow=new Cf(e),this._cloud=new Tf(e)}get fog(){return this._fog}get rain(){return this._rain}get snow(){return this._snow}get cloud(){return this._cloud}},aP=pn;var dn=class{constructor(e){this._viewer=e,this._enable=!1,this._moveRate=100,this._rotateRate=.01,this._flags={moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1,turnLeft:!1,turnRight:!1}}set enable(e){this._enable!==e&&this._viewer.scene.mode===i.SceneMode.SCENE3D&&(this._enable=e,this._enable?this._bindEvent():this._unbindEvent())}get enable(){return this._enable}set moveRate(e){this._moveRate=e}get moveRate(){return this._moveRate}set rotateRate(e){this._rotateRate=e}get rotateRate(){return this._rotateRate}_bindEvent(){let e=this._viewer.scene.canvas;e.setAttribute("tabindex","0"),e.addEventListener("click",this._onClick.bind(this),!1),this._viewer.clock.onTick.addEventListener(this._onTick,this),document.addEventListener("keydown",this._onKeydown.bind(this),!1),document.addEventListener("keyup",this._onKeyup.bind(this),!1)}_unbindEvent(){Object.keys(this._flags).forEach(t=>{this._flags[t]=!1});let e=this._viewer.scene.canvas;e.removeAttribute("tabindex"),e.removeEventListener("click",this._onClick,!1),this._viewer.clock.onTick.removeEventListener(this._onTick,this),document.removeEventListener("keydown",this._onKeydown,!1),document.removeEventListener("keyup",this._onKeyup,!1)}_getFlagForKeyCode(e){let t;switch(e.keyCode){case 87:case 38:e.shiftKey?t="moveUp":t="moveForward";break;case 83:case 40:e.shiftKey?t="moveDown":t="moveBackward";break;case 65:case 37:t="moveLeft";break;case 68:case 39:t="moveRight";break;case 81:t="turnLeft";break;case 69:t="turnRight";break;default:break}return t}_onClick(){this._viewer.scene.canvas.focus()}_onKeydown(e){let t=this._getFlagForKeyCode(e);t&&(this._flags[t]=!0)}_onKeyup(e){Object.keys(this._flags).forEach(t=>{this._flags[t]=!1})}_onTick(){let e=this._viewer.scene.camera,r=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e.position).height/this._moveRate,s=i.Cartesian3.clone(e.position,new i.Cartesian3);this._flags.moveForward&&e.moveForward(r),this._flags.moveBackward&&e.moveBackward(r),this._flags.moveUp&&e.moveUp(r),this._flags.moveDown&&e.moveDown(r),this._flags.moveLeft&&e.moveLeft(r),this._flags.moveRight&&e.moveRight(r),this._flags.turnLeft&&e.rotate(s,-this._rotateRate),this._flags.turnRight&&e.rotate(s,this._rotateRate)}},Ef=dn;var mn=class{constructor(e){this._viewer=e,this._viewOption={},this._cache={},this._activedPath=void 0}_onPostRender(){if(!this._activedPath)return!1;this._activedPath.pathEvent&&this._activedPath.pathEvent.fire(ae.POST_RENDER,{viewer:this._viewer,viewOption:this._viewOption})}addPath(e){return e&&!this._cache.hasOwnProperty(e.pathId)&&(e.pathEvent.fire(ae.ADD),this._cache[e.pathId]=e),this}addPaths(e){return Array.isArray(e)&&e.forEach(t=>{this.addPath(t)}),this}removePath(e){return e&&this._cache.hasOwnProperty(e.pathId)&&(delete this._cache[e.pathId],e.pathEvent.fire(ae.REMOVE)),this}getPath(e){let t=this.getPaths().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}getPaths(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}activate(e,t={}){var r;return!e||(e==null?void 0:e.pathId)===((r=this._activedPath)==null?void 0:r.pathId)||!this._cache.hasOwnProperty(e==null?void 0:e.pathId)?this:(this._viewOption=t,this._activedPath&&this.deactivate(),this._activedPath=e,this._activedPath.pathEvent&&this._activedPath.pathEvent.fire(ae.RESET_TIME_LINE),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this)}deactivate(){return this._activedPath&&(this._activedPath.actived=!1),this._activedPath=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this}clear(){return this._cache={},this._activedPath&&(this._activedPath.actived=!1),this._activedPath=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this}},Pf=mn;var un=class{constructor(e,t,r){this._id=C.uuid(),this._bid=void 0,this._positions=y.parsePositions(e),this._duration=t||20,this._pathMode=r||"speed",this._timeLine=[],this._sampledPosition=void 0,this._actived=!1,this._endTime=i.JulianDate.now(),this._pathEvent=new xr,this._pathEvent.on(ae.ADD,this._onAdd,this),this._pathEvent.on(ae.REMOVE,this._onRemove,this),this._pathEvent.on(ae.POST_RENDER,this._onPostRender,this),this._pathEvent.on(ae.RESET_TIME_LINE,this._resetTimeLine,this),this._state=m.INITIALIZED}get pathId(){return this._id}set id(e){this._bid=e}get id(){return this._bid}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}set duration(e){this._duration=e}get duration(){return this._duration}set pathMode(e){this._pathMode=e}get pathMode(){return this._pathMode}get pathEvent(){return this._pathEvent}set actived(e){this._actived=e}get actived(){return this._actived}get state(){return this._state}_onAdd(){this._state=m.ADDED}_onRemove(){this._state=m.REMOVED}_onPostRender({viewer:e,viewOption:t}){if(!this.actived)return!1;let r=i.JulianDate.now();if(i.JulianDate.lessThan(r,this._endTime)&&this._sampledPosition){let s=this._sampledPosition.getValue(r),o=this._sampledPosition.getValue(i.JulianDate.addSeconds(r,.001,new i.JulianDate));s&&o&&e.camera.lookAt(s,new i.HeadingPitchRange(ve(s,o),i.Math.toRadians((t==null?void 0:t.pitch)||-20),(t==null?void 0:t.range)||2e3))}else e.camera.lookAtTransform(i.Matrix4.IDENTITY),this._actived=!1}_resetTimeLine(){if(!this._positions||!this._positions.length)return!1;let e=i.JulianDate.now(),t=0,r=[];if(this._pathMode==="speed"){let s=ie(this._positions)/this._duration;r=this._positions.map((o,n,l)=>(n!==0&&(t+=ie([l[n-1],o])/s),i.JulianDate.addSeconds(e,t,new i.JulianDate)))}else{let s=this._positions.length,o=(this._duration-this._duration%s)/s;r=this._positions.map((n,l)=>i.JulianDate.addSeconds(e,l*o,new i.JulianDate))}this._sampledPosition=new i.SampledPositionProperty,this._sampledPosition.addSamples(r,f.transformWGS84ArrayToCartesianArray(this._positions)),this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._sampledPosition.setInterpolationOptions({interpolationDegree:2,interpolationAlgorithm:i.HermitePolynomialApproximation}),this._endTime=r[r.length-1],this._actived=!0}},bf=un;var nP={FP:"1",TP:"2",TRACKED:"tracked",FREE:"free"},De=nP;var _n=class{constructor(e){this._viewer=e,this._cache={},this._delegete=new i.CustomDataSource("history-track-layer"),this._viewer.dataSources.add(this._delegete),this._activedTrack=void 0,this._viewOption={},this._stopTime=void 0,this._state=m.INITIALIZED}get delegate(){return this._delegete.entities}get state(){return this._state}_onPostRender(){Object.keys(this._cache).forEach(e=>{let t=this._cache[e];t.trackEvent&&t.trackEvent.fire(oe.POST_RENDER,{viewer:this._viewer,viewOption:this._viewOption})}),this._viewer.scene.requestRender()}addTrack(e){return e&&e.trackEvent&&!this._cache.hasOwnProperty(e.trackId)&&(e.trackEvent.fire(oe.ADD,this),this._cache[e.trackId]=e),this}addTracks(e){return Array.isArray(e)&&e.forEach(t=>{this.addTrack(t)}),this}getTrack(e){let t=this.getTracks().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}removeTrack(e){return e&&e.trackEvent&&this._cache.hasOwnProperty(e.trackId)&&(e.trackEvent.fire(oe.REMOVE,this),delete this._cache[e.trackId]),this}getTracks(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}play(){let e=i.JulianDate.now();return Object.keys(this._cache).forEach(t=>{let r=this._cache[t];r.startTime=e,r.viewed=!1}),this._activedTrack=void 0,this._stopTime=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this._state=m.PLAY,this}pause(){return this._stopTime=i.JulianDate.now(),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._state=m.PAUSE,this}restore(){if(this._state!==m.PAUSE)return this;if(this._stopTime){let e=i.JulianDate.now();Object.keys(this._cache).forEach(t=>{this._cache[t].trackEvent.fire(oe.RESET_TIME_LINE,{stopTime:this._stopTime,duration:i.JulianDate.secondsDifference(e,this._stopTime)})})}return this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this._state=m.PLAY,this}viewTrack(e,t={}){if(!this._cache.hasOwnProperty(e.trackId))throw new Error("TrackController: track does not added ");return this._viewOption=t,this._activedTrack&&(this._activedTrack.viewed=!1),e.viewed=!0,this._activedTrack=e,t.mode===De.FREE&&(this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0),this}releaseTrack(e){if(!this._cache.hasOwnProperty(e.trackId))throw new Error("TrackController: track does not added ");return e.viewed&&(e.viewed=!1),this._activedTrack=void 0,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this}clear(){return Object.keys(this._cache).forEach(e=>{this.removeTrack(this._cache[e])}),this._activedTrack&&(this._activedTrack.viewed=!1),this._activedTrack=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this}},Af=_n;var lP={clampToGround:!1,clampToTileset:!1,interpolationType:"Linear",interpolationDegree:2,endDelayTime:.5,headingOffset:0},hP={width:2,material:i.Color.ORANGE,clampToGround:!0,depthFailMaterial:i.Color.ORANGE.withAlpha(.8)},fn=class{constructor(e,t,r,s){this._id=C.uuid(),this._bid=void 0,this._positions=y.parsePositions(e),this._duration=t||20,this._callback=r,this._options={...lP,...s},this._controller=void 0,this._sampledPosition=void 0,this._velocityOrientation=void 0,this._viewed=!1,this._delegate=new i.Entity,this._pathPositions=[],this._path=new i.Entity({show:!1,polyline:{positions:new i.CallbackProperty(()=>this._pathPositions,!1)}}),this._positionIndex=0,this._timeLine=[],this._startTime=void 0,this._endTime=void 0,this._trackEvent=new wr,this._trackEvent.on(oe.POST_RENDER,this._onPostRender,this),this._trackEvent.on(oe.ADD,this._onAdd,this),this._trackEvent.on(oe.REMOVE,this._onRemove,this),this._trackEvent.on(oe.RESET_TIME_LINE,this._resetTimeLine,this),this._state=m.INITIALIZED}get currentDistance(){return ie(y.parsePositions(this._pathPositions))}get currentPosition(){let[e]=this._pathPositions.slice(-1);return y.parsePosition(e)}get allDistance(){return ie(this._positions)}get trackId(){return this._id}set id(e){this._bid=e}get id(){return this._bid}set positions(e){this._positions=y.parsePositions(e),this._resetTimeLine({})}get positions(){return this._positions}set duration(e){this._duration=e,this._resetTimeLine({})}get duration(){return this._duration}set startTime(e){e instanceof Date?this._startTime=i.JulianDate.fromDate(e):this._startTime=e,this._resetTimeLine({})}get startTime(){return this._startTime}set viewed(e){this._viewed=e}get viewed(){return this._viewed}get trackEvent(){return this._trackEvent}get state(){return this._state}_onAdd(e){if(!e)return!1;this._controller=e,this._controller.delegate.add(this._delegate),this._controller.delegate.add(this._path),!this._startTime&&(this._startTime=i.JulianDate.now()),this._state=m.ADDED}_onRemove(){if(!this._controller)return!1;this._controller.delegate.remove(this._delegate),this._controller.delegate.remove(this._path),this._viewed=!1,this._startTime=void 0,this._state=m.REMOVED}_onPostRender({viewer:e,viewOption:t}){if(!this._startTime||!this._endTime)return!1;let r=i.JulianDate.now();if(i.JulianDate.lessThanOrEquals(r,this._endTime)){let s=this._sampledPosition.getValue(r);if(!s)return!1;this._pathPositions.push(s),this._options.clampToTileset?this._delegate.position=e.scene.clampToHeight(s,[this._delegate]):this._delegate.position=s;let o=this._velocityOrientation.getValue(r);if(o){let l=i.Quaternion.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(this._options.headingOffset||0),0,0),new i.Quaternion);this._delegate.orientation=i.Quaternion.multiply(o,l,new i.Quaternion)}let n=this._timeLine[this._positionIndex];if(n){let l=i.JulianDate.secondsDifference(r,n);if(l>=0&&l<=1){let h=this._positions[this._positionIndex]||void 0;if(h&&o){let c=i.Matrix3.fromQuaternion(o),p=i.Matrix4.fromRotationTranslation(c,s),u=i.Transforms.fixedFrameToHeadingPitchRoll(p);h.heading=i.Math.toDegrees(u.heading),h.pitch=i.Math.toDegrees(u.pitch),h.roll=i.Math.toDegrees(u.roll)}this._callback&&this._callback(h,this._positionIndex+1===this._positions.length),this._positionIndex++,this._options.loop&&this._positionIndex===this._positions.length&&this._restart()}}}this._setCameraView(e,t)}_restart(){this._startTime=i.JulianDate.now(),this._resetTimeLine({})}_setCameraView(e,t){var s,o,n;if(!this._viewed)return!1;let r=i.JulianDate.now();if(i.JulianDate.greaterThan(r,this._endTime))e.camera.lookAtTransform(i.Matrix4.IDENTITY),e.delegate.trackedEntity&&(e.delegate.trackedEntity=void 0),this._viewed=!1;else{let l=this._sampledPosition.getValue(r),h=this._sampledPosition.getValue(i.JulianDate.addSeconds(r,1/60,new i.JulianDate));l&&h&&((t==null?void 0:t.mode)===De.TRACKED&&((o=(s=e.delegate)==null?void 0:s.trackedEntity)==null?void 0:o.id)!==((n=this._delegate)==null?void 0:n.id)?e.delegate.trackedEntity=this._delegate:(t==null?void 0:t.mode)===De.FP?e.camera.lookAt(l,new i.HeadingPitchRange(ve(l,h),i.Math.toRadians((t==null?void 0:t.pitch)||0),(t==null?void 0:t.range)||10)):(t==null?void 0:t.mode)===De.TP&&e.camera.lookAt(l,new i.HeadingPitchRange(0,i.Math.toRadians((t==null?void 0:t.pitch)||-90),(t==null?void 0:t.range)||1e3)))}}_resetTimeLine(e){var r;if(!this._startTime||!this._duration||!((r=this._positions)!=null&&r.length))return!1;let t=0;if(!(e!=null&&e.stopTime)&&!(e!=null&&e.duration)){let s=ie(this._positions)/this._duration;this._timeLine=this._positions.map((o,n,l)=>(n!==0&&(t+=ie([l[n-1],o])/s),i.JulianDate.addSeconds(this._startTime,t,new i.JulianDate))),this._pathPositions=[],this._positionIndex=0}else e!=null&&e.stopTime&&(e!=null&&e.duration)&&(this._duration+=e.duration,this._timeLine=this._timeLine.map(s=>i.JulianDate.addSeconds(s,e.duration,new i.JulianDate)));this._sampledPosition=new i.SampledPositionProperty,this._sampledPosition.addSamples(this._timeLine,f.transformWGS84ArrayToCartesianArray(this._positions)),this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._options.interpolationType==="Hermite"?this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||2,interpolationAlgorithm:i.HermitePolynomialApproximation}):this._options.interpolationType==="Linear"?this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||1,interpolationAlgorithm:i.LinearApproximation}):this._options.interpolationType==="Lagrange"&&this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||5,interpolationAlgorithm:i.LagrangePolynomialApproximation}),this._velocityOrientation=new i.VelocityOrientationProperty(this._sampledPosition),this._endTime=i.JulianDate.addSeconds(this._timeLine[this._timeLine.length-1],this._options.endDelayTime,new i.JulianDate)}addPosition(e,t){return this._positions.push(y.parsePosition(e)),this._duration+=t,this._resetTimeLine({}),this}setModel(e,t){return this._delegate.model={...t,uri:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setBillboard(e,t){return this._delegate.billboard={...t,image:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setLabel(e,t){return this._delegate.label={...t,text:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setPath(e,t={}){return this._path.show=!!e,C.merge(this._path.polyline,hP,t),this}},Mf=fn;var cP={ANGLE:"angle",AREA:"area",AREA_HEIGHT:"area_height",AREA_SURFACE:"area_surface",DISTANCE:"distance",DISTANCE_SURFACE:"distance_surface",HEADING:"heading",HEIGHT:"height",TRIANGLE_HEIGHT:"triangle_height"},ne=cP;var gn=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(E.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(E.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},zi=gn;var yn=class extends zi{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP,e))}},le=yn;var vn=class{constructor(e){this._viewer=void 0,this._layer=void 0,this._overlay=e,this._delegate=new i.Entity,this._delegate.merge(e),this._options={},this._positions=[]}get editTool(){return this._viewer.editTool}_mountedHook(){}_mountAnchor(){}_onAnchorMoving({pickedAnchor:e,position:t}){}_onEditAnchorStop({pickedAnchor:e,position:t}){}_onEditStop({pickedAnchor:e,position:t}){this._unbindEvent(),this._viewer.editTool.deactivate()}_bindEvent(){return this.editTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.on(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.on(E.EDIT_STOP,this._onEditStop,this),this}_unbindEvent(){this.editTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.off(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.off(E.EDIT_STOP,this._onEditStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.editTool.activate(t),this._mountedHook(),this._mountAnchor(),this._unbindEvent(),this._bindEvent(),this}},Ni=vn;var wn=class extends Ni{constructor(e){super(e)}_mountedHook(){this.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._delegate.polyline.positions=new i.CallbackProperty(()=>this._positions.length>1?this._positions:null,!1),this._layer.entities.add(this._delegate)}_mountAnchor(){let e=[].concat(this._overlay.polyline.positions.getValue(i.JulianDate.now()));if(this._options.maxAnchorSize>2){for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.push(e[e.length-1]),this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}else this._positions=e,this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r})});this._layer.entities.remove(this._overlay)}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1]);this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((l,h)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:l,index:h,isMid:h%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(this._positions[s]=t,!r.isMid&&this._options.maxAnchorSize>2){let o=-1,n=-1,l=-1,h=-1,c=this._positions.length;if(s===0?(l=s+2,h=s+1):r.index===c-1?(o=s-2,n=s-1):(o=s-2,n=s-1,l=s+2,h=s+1),o>0){let p=z(this._positions[o],this._positions[s]);this._positions[n]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:n,position:p})}if(l>0){let p=z(this._positions[l],this._positions[s]);this._positions[h]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:h,position:p})}}this._options.onCalc&&this._options.onCalc(this._positions)}},he=wn;var Cn=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)?i.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},J=Cn;var xn=class extends J{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}})}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[1];let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t);this._helpLinePositions=[e[0],i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3),e[1]];let s=Math.abs(i.Plane.getPointDistance(r,e[1]));this._resultLabel.label.text=`\u89D2\u5EA6\uFF1A${i.Math.toDegrees(Math.asin(s/i.Cartesian3.distance(e[0],e[1]))).toFixed(2)} \u5EA6`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},If=xn;var Tn=class extends zi{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(e=>e.clone())):null,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e})}},et=Tn;var En=class extends Ni{constructor(e){super(e)}_mountedHook(){this.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>this._positions.length>2?new i.PolygonHierarchy(this._positions):null,!1),this._layer.entities.add(this._delegate)}_mountAnchor(){let e=[].concat(this._overlay.polygon.hierarchy.getValue(i.JulianDate.now()).positions);e.push(e[0]);for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})}),this._layer.entities.remove(this._overlay)}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o,n,l=this._positions.length;s===l-1?(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[0])):(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1])),this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((h,c)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:h,index:c,isMid:c%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;this._positions[s]=t;let o=this._positions.length;if(!r.isMid){let n=-1,l=-1,h=-1,c=-1;s===0?(n=o-2,l=o-1,h=s+2,c=s+1):s===o-2?(n=s-2,l=s-1,h=0,c=o-1):(n=s-2,l=s-1,h=s+2,c=s+1);let p=z(this._positions[n],this._positions[s]),u=z(this._positions[h],this._positions[s]);this._positions[l]=p,this._positions[c]=u,this.editTool.fire(E.UPDATE_ANCHOR,{index:l,position:p}),this.editTool.fire(E.UPDATE_ANCHOR,{index:c,position:u})}this._options.onCalc&&this._options.onCalc(this._positions)}},tt=En;var Pn=class extends J{constructor(){super()}_onDrawStop(e){new tt(e).start({viewer:this._viewer,layer:this._layer},this._options)}_onCalc(e){var t;e.length>2&&(this._resultLabel.position=(t=i.BoundingSphere.fromPoints(e))==null?void 0:t.center,this._resultLabel.label.text=`\u9762\u79EF\uFF1A${ge(e).toFixed(2)} \u5E73\u65B9\u7C73`)}start(e,t){return this._startHook(e,t),new et({material:t.material||i.Color.YELLOW.withAlpha(.6),perPositionHeight:!0}).start(e,this._options),this}},Sf=Pn;var bn=class extends J{constructor(){super()}_onDrawStop(e){new tt(e).start({viewer:this._viewer,layer:this._layer},this._options)}_lerp(e,t=4){let r=[];for(let s=0;s<t;++s)for(let o=0;o<t;++o){let n=i.Math.lerp(e.west,e.east,o/(t-1)),l=i.Math.lerp(e.south,e.north,s/(t-1));r.push(i.Cartesian3.fromRadians(n,l))}return r}_onCalc(e){if(e.length>2){let t=this._lerp(i.Rectangle.fromCartesianArray(e),this._options.lerpNum);this._getSampledHeight(t,!0).then(([r,s])=>r.map((o,n)=>({lng:o.longitude,lat:o.latitude,alt:Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0)}))).then(r=>{let s=0,o;r.forEach(n=>{n.alt>s&&(s=n.alt,o=n)}),o&&(this._resultLabel.position=i.Cartesian3.fromRadians(o.lng,o.lat,o.alt),this._resultLabel.label.text=`\u9AD8\u5EA6\uFF1A${s.toFixed(2)} \u7C73`)})}}start(e,t){return this._startHook(e,t),new et({material:t.material||i.Color.YELLOW.withAlpha(.6)}).start(e,this._options),this}},Df=bn;var An=class extends J{constructor(){super()}_lerp(e,t=4){let r=[];for(let s=0;s<t;++s)for(let o=0;o<t;++o){let n=i.Math.lerp(e.west,e.east,o/(t-1)),l=i.Math.lerp(e.south,e.north,s/(t-1));r.push(i.Cartesian3.fromRadians(n,l))}return r}_onDrawStop(e){new tt(e).start({viewer:this._viewer,layer:this._layer},this._options)}_onCalc(e){var t;if(e.length>2){this._resultLabel.position=(t=i.BoundingSphere.fromPoints(e))==null?void 0:t.center;let r=this._lerp(i.Rectangle.fromCartesianArray(e),this._options.lerpNum);this._getSampledHeight(r.concat(e),!1).then(([s])=>s.map(o=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),o.height))).then(s=>{this._resultLabel.label.text=`\u9762\u79EF\uFF1A${ge(s).toFixed(2)} \u5E73\u65B9\u7C73`})}}start(e,t){return this._startHook(e,t),new et({material:t.material||i.Color.YELLOW.withAlpha(.6)}).start(e,this._options),this}},Lf=An;var Mn=class extends J{constructor(){super(),this._maxAnchorSize=9999}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[e.length-1];let t=0;for(let r=0;r<e.length-1;r++){let s=i.Cartesian3.distance(e[r],e[r+1]);t+=s}this._resultLabel.label.text=t>1e3?`\u8DDD\u79BB\uFF1A${(t/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${t.toFixed(2)} \u7C73`}}start(e,t){return this._startHook(e,t),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},Rf=Mn;var In=class extends J{constructor(){super(),this._maxAnchorSize=9999}_lerp(e,t,r=5){let s=[],o=i.Cartographic.fromCartesian(e),n=i.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push(i.Cartesian3.fromRadians(h,c,p))}return s}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t).then(([r,s])=>r.map((o,n)=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0)))).then(r=>{let s=0;for(let o=0;o<r.length-1;o++){let n=i.Cartesian3.distance(r[o],r[o+1]);s+=n}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t){return this._startHook(e,t),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},Of=In;var Sn=class extends J{constructor(){super(),this._maxAnchorSize=2}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){e.length>0&&(this._startLabel.position=e[0]),e.length>1&&(this._resultLabel.position=e[e.length-1],this._resultLabel.label.text=`\u504F\u822A\uFF1A${i.Math.toDegrees(ve(e[0],e[1])).toFixed(1)} \u5EA6`)}start(e,t){return this._startHook(e,t),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},kf=Sn;var Dn=class extends J{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}})}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[1];let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t);this._helpLinePositions=[e[0],i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3),e[1]];let s=Math.abs(i.Plane.getPointDistance(r,e[1]));this._resultLabel.label.text=`\u9AD8\u5EA6\uFF1A${s.toFixed(2)} \u7C73`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},Ff=Dn;var Ln=class extends J{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}}),this._lengthLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._heightLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._distanceLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}})}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t),s=i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3);this._helpLinePositions=[e[0],s,e[1]];let o=i.Cartesian3.distance(e[0],s),n=Math.abs(i.Plane.getPointDistance(r,e[1])),l=i.Cartesian3.distance(e[0],e[1]);this._lengthLabel.position=i.Cartesian3.midpoint(e[0],s,new i.Cartesian3),this._lengthLabel.label.text=o>1e3?`${(o/1e3).toFixed(2)} \u516C\u91CC`:`${o.toFixed(2)} \u7C73`,this._distanceLabel.position=i.Cartesian3.midpoint(e[0],e[1],new i.Cartesian3),this._distanceLabel.label.text=l>1e3?`${(l/1e3).toFixed(2)} \u516C\u91CC`:`${l.toFixed(2)} \u7C73`,this._heightLabel.position=i.Cartesian3.midpoint(s,e[1],new i.Cartesian3),this._heightLabel.label.text=n>1e3?`${(n/1e3).toFixed(2)} \u516C\u91CC`:`${n.toFixed(2)} \u7C73`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),this._layer.entities.add(this._lengthLabel),this._layer.entities.add(this._heightLabel),this._layer.entities.add(this._distanceLabel),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},zf=Ln;var Rn=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.CustomDataSource("measure-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}angle(e={}){return new If().start(this,e),this}area(e={}){return new Sf().start(this,e),this}areaHeight(e={}){return new Df().start(this,e),this}areaSurface(e={}){return new Lf().start(this,e),this}distance(e={}){return new Rf().start(this,e),this}distanceSurface(e={}){return new Of().start(this,e),this}heading(e={}){return new kf().start(this,e),this}height(e={}){return new Ff().start(this,e),this}triangleHeight(e={}){return new zf().start(this,e),this}activate(e,t){switch(e){case ne.ANGLE:this.angle(t);break;case ne.AREA:this.area(t);break;case ne.AREA_HEIGHT:this.areaHeight(t);break;case ne.AREA_SURFACE:this.areaSurface(t);break;case ne.DISTANCE:this.distance(t);break;case ne.DISTANCE_SURFACE:this.distanceSurface(t);break;case ne.HEADING:this.heading(t);break;case ne.HEIGHT:this.height(t);break;case ne.TRIANGLE_HEIGHT:this.triangleHeight(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},Nf=Rn;var On=class{static pointBuffer(e,t,r=8){var l;let s=q("turf");if(!s)throw"missing turf";let o=s.point(y.parsePointCoordToArray(e)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static polylineBuffer(e,t,r=8){var l;let s=q("turf");if(!s)throw"missing turf";let o=s.lineString(y.parsePolylineCoordToArray(e)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static polygonBuffer(e,t,r=8){var l;let s=q("turf");if(!s)throw"missing turf";let o=s.polygon(y.parsePolygonCoordToArray(e,!0)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static sector(e,t,r,s,o=64){var c;let n=q("turf");if(!n)throw"missing turf";let l=n.point(y.parsePointCoordToArray(e)),h=n.sector(l,t,r,s,{units:"meters",steps:o});return((c=h==null?void 0:h.geometry)==null?void 0:c.coordinates[0])||[]}static transformPolylineScale(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.lineString(y.parsePolylineCoordToArray(e)),o=r.transformScale(s,t,{units:"meters"});return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates)||[]}static transformPolygonScale(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.polygon(y.parsePolygonCoordToArray(e,!0)),o=r.transformScale(s,t,{units:"meters"});return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates[0])||[]}static transformPolylineRotate(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.lineString(y.parsePolylineCoordToArray(e)),o=r.transformRotate(s,t);return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates)||[]}static transformPolygonRotate(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.polygon(y.parsePolygonCoordToArray(e,!0)),o=r.transformRotate(s,t);return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates[0])||[]}static polygonEquivalent(e,t,r,s=null){let o=q("turf");if(!o)throw"missing turf";let n=[];for(let p=0,u=e.length;p<u;p++){let g=e[p];n.push({type:"Feature",properties:g,geometry:{type:"Point",coordinates:[g.x,g.y]}})}let l={type:"FeatureCollection",features:n};s&&s!==null&&(l=o.interpolate(l,s.cellSize||10,{gridType:"point",property:r,units:(s==null?void 0:s.units)||"kilometers",weight:(s==null?void 0:s.weight)||1}));let h=o.isobands(l,t,{zProperty:r}),c=o.isolines(l,t,{zProperty:r});return{geojsonPoly:h,geojsonLine:c}}},Hf=On;var pP={SIGHT_LINE:"sightLine",VIEW_SHED:"viewshed"},xt=pP;var dP={PROFILE:"profile"},Hi=dP;var kn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._color=i.Color.YELLOW,this._width=1,this._spacing=100,this._state=m.INITIALIZED}get type(){return"contourLine"}set enable(e){this._enable=e,e&&this._viewer?this._createAnalysis():(this._delegate&&(this._delegate=null),this._viewer&&(this._viewer.scene.globe.material=null))}get enable(){return this._enable}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.color=e)}get color(){return this._color}set width(e){this._width=e,this._delegate&&(this._delegate.uniforms.width=e)}get width(){return this._width}set spacing(e){this._spacing=e,this._delegate&&(this._delegate.uniforms.spacing=e)}get spacing(){return this._spacing}_init(e,t,r){this._enable=!0,this._color=e||i.Color.YELLOW,this._width=t||1,this._spacing=r||100,this._enable&&this._viewer&&this._createAnalysis()}deactivate(){this._enable=!1,this._delegate&&(this._delegate=null),this._viewer&&(this._viewer.scene.globe.material=null)}_createAnalysis(){let e=this._viewer.scene.globe,t=i.Material.fromType("ElevationContour"),r=t.uniforms;r.width=this._width,r.spacing=this._spacing,r.color=this._color,e.material=t,this._delegate=t}},Wf=kn;var Fn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._enable=!1,this._positions=[],this._maxDistance=5,this._speed=1e3,this._maxHeight=20,this._inRangeColor=i.Color.YELLOW,this._outRangeColor=i.Color.WHITE,this._state=m.INITIALIZED}get type(){return"tilesetShake"}set enable(e){this._enable=e,this.tileset_arr.forEach(t=>{let r=null;this._enable?r=this._getShader(t.tileset2):r=new window.GM.CustomShader,t.tileset.setCustomShader(r)})}get enable(){return this._enable}set maxDistance(e){this._maxDistance=e,this._enable&&this._changeSettings()}get maxDistance(){return this._maxDistance}set speed(e){this._speed=e,this._enable&&this._changeSettings()}get speed(){return this._speed}set maxHeight(e){this._maxHeight=e,this._enable&&this._changeSettings()}get maxHeight(){return this._maxHeight}_getShader(e){let t=e.boundingSphere.center.clone(),r=i.Transforms.eastNorthUpToFixedFrame(t),s=i.Matrix4.inverse(r,new i.Matrix4);return new i.CustomShader({uniforms:{M_LocaltoWorld:{type:i.UniformType.MAT4,value:r},M_WorldtoLocal:{type:i.UniformType.MAT4,value:s},center:{type:i.UniformType.VEC3,value:t},MAX_Distance:{type:i.UniformType.FLOAT,value:this._maxDistance},Speed:{type:i.UniformType.FLOAT,value:this._speed},height:{type:i.UniformType.FLOAT,value:this._maxHeight}},vertexShaderText:this._getVs(),fragmentShaderText:this._getFs()})}_changeSettings(){this.tileset_arr.forEach(e=>{let t=this._getShader(e.tileset2);e.tileset.setCustomShader(t)})}_getVs(){return`
|
|
1680
|
+
void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
|
|
1681
|
+
vec3 positionMC = vsInput.attributes.positionMC;
|
|
1682
|
+
//\u4E16\u754C\u5750\u6807\u8F6C\u5C40\u90E8 \u8981\u5C06\u6A21\u578B\u5750\u6807\u8F6C\u4E3A\u4E16\u754C\u5750\u6807
|
|
1683
|
+
vec4 positionInLocal=M_WorldtoLocal*czm_model*vec4(positionMC,1.0);
|
|
1684
|
+
positionInLocal=positionInLocal/positionInLocal.w;
|
|
1685
|
+
|
|
1686
|
+
// \u6A21\u62DF\u5730\u9707\u6447\u6643\u6548\u679C
|
|
1687
|
+
// float shakeIntensity = 5.0; // \u9707\u52A8\u5F3A\u5EA6
|
|
1688
|
+
float shakeIntensity = MAX_Distance; // \u6700\u5927\u8DDD\u79BB
|
|
1689
|
+
float shakeSpeed = Speed / 10000.0; // \u9707\u52A8\u901F\u5EA6
|
|
1690
|
+
float time = czm_frameNumber * shakeSpeed;
|
|
1691
|
+
// float time = czm_frameNumber / 10.0 * shakeSpeed;
|
|
1692
|
+
float shakeOffset = sin(time) * shakeIntensity;
|
|
1693
|
+
|
|
1694
|
+
// \u751F\u6210\u968F\u673A\u65B9\u5411\u7684\u5355\u4F4D\u5411\u91CF
|
|
1695
|
+
// \u4E3A\u6BCF\u4E2A\u5EFA\u7B51\u7269\u751F\u6210\u552F\u4E00\u7684\u968F\u673A\u65B9\u5411
|
|
1696
|
+
float buildingID = floor(positionMC.z); // \u5047\u8BBE\u6BCF\u680B\u5EFA\u7B51\u7269\u9AD8\u5EA6\u4E3A BuildingHeight
|
|
1697
|
+
float randomAngle = fract(sin(buildingID * 123.456) * 789.012); // \u4F7F\u7528\u5EFA\u7B51\u7269ID\u751F\u6210\u968F\u673A\u89D2\u5EA6
|
|
1698
|
+
vec3 randomDirection = normalize(vec3(cos(randomAngle * 2.0 * 3.14159265),
|
|
1699
|
+
sin(randomAngle * 2.0 * 3.14159265),
|
|
1700
|
+
0.0)); // \u5728XY\u5E73\u9762\u5185\u968F\u673A\u65B9\u5411
|
|
1701
|
+
// \u9876\u70B9\u5168\u968F\u673A\uFF0C\u6548\u679C\u4E71\u7CDF\u7CDF
|
|
1702
|
+
// float randomAngle = fract(sin(dot(positionMC.xy, vec2(12.9898, 78.233))) * 43758.5453);
|
|
1703
|
+
// vec3 randomDirection = normalize(vec3(cos(randomAngle * 2.0 * 3.14159265),
|
|
1704
|
+
// sin(randomAngle * 2.0 * 3.14159265),
|
|
1705
|
+
// 0.0)); // \u5728XY\u5E73\u9762\u5185\u968F\u673A\u65B9\u5411
|
|
1706
|
+
|
|
1707
|
+
float threshold = height;
|
|
1708
|
+
if (positionMC.z > threshold) {
|
|
1709
|
+
// positionInLocal.xy+=shakeOffset;
|
|
1710
|
+
positionInLocal.xyz += randomDirection * shakeOffset; // \u4F7F\u7528\u968F\u673A\u65B9\u5411
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
// positionInLocal.xy+=MAX_Distance;
|
|
1714
|
+
//\u8F6C\u56DE\u4E16\u754C\u5750\u6807 \u4E58\u9006\u77E9\u9635
|
|
1715
|
+
vec4 positionInWorld=czm_inverseModel*M_LocaltoWorld*positionInLocal;
|
|
1716
|
+
positionInWorld=positionInWorld/positionInWorld.w;
|
|
1717
|
+
vsOutput.positionMC=positionInWorld.xyz;
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
`}_getFs(){return`
|
|
1721
|
+
void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
|
|
1722
|
+
material.diffuse = vec3(0.2, 0.5, 1.0); // \u5C06\u6750\u8D28\u989C\u8272\u8BBE\u7F6E\u4E3A\u7EA2\u8272 vec3(1.0, 0.0, 0.0) vec3(0.945, 0.459, 0.620)
|
|
1723
|
+
}
|
|
1724
|
+
`}_init(e,t={}){this._enable=!0,this._maxDistance=t.maxDistance||5,this._speed=t.speed||1e3,this._maxHeight=t.maxHeight||20,e&&(this._layer=e,this.tileset_arr=this._layer.delegate._primitives.map(r=>({overlayId:r.overlayId,tileset2:r,tileset:this._layer._cache[r.overlayId]||null})),this.tileset_arr.forEach(r=>{let s=this._getShader(r.tileset2);r.tileset.setCustomShader(s)}))}deactivate(){this._enable=!1,!(!this.tileset_arr||this.tileset_arr.length===0)&&this.tileset_arr.forEach(e=>{let t=new window.GM.CustomShader;e.tileset.setCustomShader(t)})}},Gf=Fn;var zn=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("terrainClip"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=m.INITIALIZED,this._callback=null}get type(){return"terrainClip"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=e.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});this._id=C.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let n=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,n).then(l=>{let h=l.map(c=>{let p=i.Math.toDegrees(c.longitude),u=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:p,lat:u,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),n={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,show:!0};this._area.push({id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s,o],show:!0}),typeof this._callback=="function"&&this._callback(n)}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_createBottomSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t));return this._layer.entities.add({polygon:{hierarchy:r,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:p})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]);let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0;let s=r.positions.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layer.entities.getById(r.entityIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPolygons.removeAll()}},Uf=zn;function ce(a,e){this.viewer=a,this.options=e||{},this._positions=[new i.Cartesian3(-1.1825928630924462e6,5.5155809806405855e6,2966674365247578e-9),new i.Cartesian3(-1183337777477057e-9,5515825617716778e-9,2.9659274345367434e6),new i.Cartesian3(-1.1845084932830015e6,5515571328839522e-9,2965932974956288e-9),new i.Cartesian3(-1.1855870332886775e6,5514889448799464e-9,2.9667642948399023e6),new i.Cartesian3(-1.1850990292063756e6,5514576687407264e-9,2967535347584739e-9),new i.Cartesian3(-1.1828409384216308e6,551522464431188e-8,2.9672341119776894e6)],this._height=this.options.height||0,this.bottomImg=e.bottomImg,this.wallImg=e.wallImg,this.splitNum=i.defaultValue(e.splitNum,50),this._positions&&this._positions.length>0&&this.updateData(this._positions)}Object.defineProperties(ce.prototype,{show:{get:function(){return this._show},set:function(a){this._show=a,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=a),this._switchExcavate(a)}},height:{get:function(){return this._height},set:function(a){this._height=a,this._updateExcavateDepth(a)}}});ce.prototype.updateData=function(a){this.clear();var e=[],t=a.length,r=new i.Cartesian3,s=i.Cartesian3.subtract(a[0],a[1],r);s=s.x>0,this.excavateMinHeight=9999;for(var o=0;o<t;++o){var n=(o+1)%t,l=i.Cartographic.fromCartesian(a[o]),h=viewer.scene.globe.getHeight(l)||l.height;h<this.excavateMinHeight&&(this.excavateMinHeight=h);var c=i.Cartesian3.add(a[o],a[n],new i.Cartesian3);c=i.Cartesian3.multiplyByScalar(c,.5,c);var p=i.Cartesian3.normalize(c,new i.Cartesian3),u=i.Cartesian3.subtract(a[n],c,new i.Cartesian3);u=i.Cartesian3.normalize(u,u);var g=i.Cartesian3.cross(u,p,new i.Cartesian3);g=i.Cartesian3.normalize(g,g);var _=new i.Plane(g,0),d=i.Plane.getPointDistance(_,c);e.push(new i.ClippingPlane(g,d))}this.viewer.scene.globe.clippingPlanes=new i.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:i.Color.WHITE,enabled:!0}),this._prepareWell(a),this._createWell(this.wellData)};ce.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()};ce.prototype._prepareWell=function(a){var e=this.splitNum,t=a.length;if(t!=0){for(var r=this.excavateMinHeight-this.height,s=[],o=[],n=[],l=0;l<t;l++){var h=l==t-1?0:l+1,c=i.Cartographic.fromCartesian(a[l]),p=i.Cartographic.fromCartesian(a[h]),u=[c.longitude,c.latitude],g=[p.longitude,p.latitude];l==0&&(n.push(new i.Cartographic(u[0],u[1])),o.push(i.Cartesian3.fromRadians(u[0],u[1],r)),s.push(i.Cartesian3.fromRadians(u[0],u[1],0)));for(var _=1;_<=e;_++){var d=i.Math.lerp(u[0],g[0],_/e),T=i.Math.lerp(u[1],g[1],_/e);l==t-1&&_==e||(n.push(new i.Cartographic(d,T)),o.push(i.Cartesian3.fromRadians(d,T,r)),s.push(i.Cartesian3.fromRadians(d,T,0)))}}this.wellData={lerp_pos:n,bottom_pos:o,no_height_top:s}}};ce.prototype._createWell=function(a){if(this.viewer.terrainProvider._layers){var e=this;this._createBottomSurface(a.bottom_pos);var t=i.sampleTerrainMostDetailed(this.viewer.terrainProvider,a.lerp_pos);i.when(t,function(r){for(var s=r.length,o=[],n=0;n<s;n++){var l=i.Cartesian3.fromRadians(r[n].longitude,r[n].latitude,r[n].height);o.push(l)}e._createWellWall(a.bottom_pos,o)})}else this._createBottomSurface(a.bottom_pos),this._createWellWall(a.bottom_pos,a.no_height_top)};ce.prototype._getMinHeight=function(a){let e=5e6,t=null;for(let r=0;r<a.length;r++){let s=a[r].z;s<e&&(e=s,t=this._ellipsoidToLonLat(a[r]))}return t.altitude};ce.prototype._ellipsoidToLonLat=function(a){let e=this.viewer.scene.globe.ellipsoid,t=new i.Cartesian3(a.x,a.y,a.z),r=e.cartesianToCartographic(t),s=i.Math.toDegrees(r.latitude),o=i.Math.toDegrees(r.longitude),n=r.height;return{longitude:o,latitude:s,altitude:n}};ce.prototype._createBottomSurface=function(a){if(a.length){let r=this._getMinHeight(a),s=[];for(let l=0;l<a.length;l++){let h=this._ellipsoidToLonLat(a[l]);s.push(h.longitude),s.push(h.latitude),s.push(r)}let o=new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,closeBottom:!1}),n=i.PolygonGeometry.createGeometry(o);var e=new i.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),t=new i.MaterialAppearance({translucent:!1,flat:!0,material:e});this.bottomSurface=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:n}),appearance:t,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}};ce.prototype._createWellWall=function(a,e){let t=this._getMinHeight(a),r=[],s=[];for(let c=0;c<e.length;c++)r.push(this._ellipsoidToLonLat(e[c]).altitude),s.push(t);let o=new i.WallGeometry({positions:e,maximumHeights:r,minimumHeights:s}),n=i.WallGeometry.createGeometry(o);var l=new i.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),h=new i.MaterialAppearance({translucent:!1,flat:!0,material:l});this.wellWall=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:n,attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.GREY)},id:"PitWall"}),appearance:h,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)};ce.prototype._switchExcavate=function(a){a?(this.viewer.scene.globe.material=i.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)};ce.prototype._updateExcavateDepth=function(a){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var e=this.wellData.lerp_pos,t=[],r=e.length,s=0;s<r;s++)t.push(i.Cartesian3.fromRadians(e[s].longitude,e[s].latitude,this.excavateMinHeight-a));this.wellData.bottom_pos=t,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)};var Bf=ce;var Nn=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("TerrainUplift"),e.dataSources.add(this._layer),this._layerUplift=new i.CustomDataSource("TerrainUplift2"),e.dataSources.add(this._layerUplift),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._upHeight=t.upHeight||0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._upHeight=t.upHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=m.INITIALIZED,this._callback=null}get type(){return"TerrainUplift"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}set upHeight(e){this._upHeight=e}get upHeight(){return this._upHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight),t!=null&&t.upHeight&&(this._upHeight=t.upHeight);let s=e.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});this._id=C.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let n=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,n).then(l=>{let h=l.map(c=>{let p=i.Math.toDegrees(c.longitude),u=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:p,lat:u,alt:c.height}});this._perCreateEntity(e,h,t),this._createUpliftArea(e,h)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_createUpliftArea(e,t=[]){let r=this._viewer.terrainProvider,s=this._getTinPoints(e,t);i.sampleTerrainMostDetailed(r,s).then(o=>{let n=q("turf"),l=o.map(function(p){return n.point([i.Math.toDegrees(p.longitude),i.Math.toDegrees(p.latitude),p.height],{z:p.height})}),h=n.featureCollection(l);n.tin(h,"z").features.forEach(p=>{let u=[];p.geometry.coordinates[0].forEach((d,T)=>{u.push(parseFloat(d[0])),u.push(parseFloat(d[1]));let w=T===1?p.properties.b:T===2?p.properties.c:p.properties.a;u.push(w+this._upHeight)});let g=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(u)),_=this._layerUplift.entities.add({polygon:{hierarchy:g,material:new i.ImageMaterialProperty({image:"/assets/data/aaa.png",repeat:new i.Cartesian2(1,1)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}})})})}_getTinPoints(e,t=[],r=80){let s=q("turf"),o=e.reduce((w,P)=>w.lng<P.lng?w:P).lng,n=e.reduce((w,P)=>w.lng>P.lng?w:P).lng,l=e.reduce((w,P)=>w.lat<P.lat?w:P).lat,h=e.reduce((w,P)=>w.lat>P.lat?w:P).lat,c=i.Rectangle.fromDegrees(o,l,n,h),p=JSON.parse(JSON.stringify(e)).concat(e[0]).map(w=>[w._lng,w._lat]),u=s.polygon([p]),g=r,_=r,d=[];for(let w=0;w<_;w++)for(var T=0;T<g;T++){let P=i.Math.lerp(c.west,c.east,T/(g-1)),M=i.Math.lerp(c.south,c.north,w/(_-1)),R=s.point([i.Math.toDegrees(P),i.Math.toDegrees(M)]);s.booleanPointInPolygon(R,u)&&d.push(i.Cartographic.fromRadians(P,M))}for(let w=0;w<t.length;w++)d.push(i.Cartographic.fromDegrees(t[w].lng,t[w].lat));return d}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),n={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s[0],o[0]],entityUpliftIds:[s[1],o[1]],show:!0};this._area.push(n),typeof this._callback=="function"&&this._callback(n)}_createWallSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat))});let r=this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}),s=this._layerUplift.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1),transparent:!0}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight,this._upHeight),maximumHeights:this._currentHeight.map(o=>o+this._upHeight)}});return[r.id,s.id]}_createBottomSurface(e){let t=[];e.forEach(h=>{t.push(parseFloat(h.lng)),t.push(parseFloat(h.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t)),s=this._layer.entities.add({polygon:{hierarchy:r,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}),o=[];e.forEach(h=>{o.push(parseFloat(h.lng)),o.push(parseFloat(h.lat)),o.push(this._minHeight-this._diffHeight+this._upHeight)});let n=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(o)),l=this._layerUplift.entities.add({polygon:{hierarchy:n,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2),transparent:!0}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}});return[s.id,l.id]}_getHeights(e,t,r=0){let s=[];for(let o=0;o<e;o++)s.push(t+r);return s}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:p})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]),this._layerUplift.entities.removeById(r.entityUpliftIds[0]),this._layerUplift.entities.removeById(r.entityUpliftIds[1]);let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0,this._layerUplift.entities.getById(r.entityUpliftIds[0]).show=!0,this._layerUplift.entities.getById(r.entityUpliftIds[1]).show=!0;let s=r.positions.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1,this._layerUplift.entities.getById(r.entityUpliftIds[0]).show=!1,this._layerUplift.entities.getById(r.entityUpliftIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layerUplift.entities.getById(r.entityUpliftIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._layerUplift.entities.removeAll(),this._clippingPolygons.removeAll()}},Vf=Nn;var Hn=class{constructor(e){qi(this,"_analysisTerrainVisible",e=>{let t=this._viewer.terrainProvider,r=e.map(s=>i.Cartographic.fromDegrees(s.lng,s.lat,s.alt));i.sampleTerrainMostDetailed(t,r).then(s=>{let o=0,n=null;for(let l=0;l<s.length-1;l++){if(l<s.length-2){let h=e[l],c=e[l+1],p=i.Cartesian3.fromDegrees(h.lng,h.lat,h.alt),u=i.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);if(n=this._analysisModelVisible([p,u]),i.defined(n)&&i.defined(n.object)){console.log("\u5728\u6A21\u578B\u4E0A.");let g=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),_=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(n.position,g,i.Color.GREEN),this._drawLine(n.position,_,i.Color.RED);break}}if(s[l].height>=e[l].alt){console.log("\u5728\u5730\u5F62\u4E0A."),o=l;let h=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),c=i.Cartesian3.fromDegrees(e[l].lng,e[l].lat,e[l].alt),p=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(h,c,i.Color.GREEN),this._drawLine(c,p,i.Color.RED);break}}if(o===0&&n===null){console.log("\u5168\u90E8\u53EF\u89C6.");let l=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),h=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(l,h,i.Color.GREEN)}})});qi(this,"_analysisModelVisible",e=>{let t=i.Cartesian3.normalize(i.Cartesian3.subtract(e[1],e[0],new i.Cartesian3),new i.Cartesian3),r=new i.Ray(e[0],t);return this._viewer.scene.pickFromRay(r)});this._id=C.uuid(),this._viewer=e,this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)}get type(){return"sightLine"}get layer(){return this._layer}_init(e,t,r=10){this._layer&&this._layer.entities.removeAll();let s=i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),o=i.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),n=this._viewer.terrainProvider;if(n&&!(n instanceof i.EllipsoidTerrainProvider)){let l=this._lerp(e,t,r).concat([t]);this._analysisTerrainVisible(l)}else this._analysisVisible([s,o])}_analysisVisible(e){let t=this._analysisModelVisible(e);if(i.defined(t)&&i.defined(t.object)){let r=this._drawLine(t.position,e[0],i.Color.GREEN),s=this._drawLine(t.position,e[1],i.Color.RED);console.log("\u5728\u6A21\u578B\u4E0A.",r,s)}else{let r=this._drawLine(e[0],e[1],i.Color.GREEN);console.log("\u4E0D\u5728\u6A21\u578B\u4E0A",r)}}_drawLine(e,t,r){return this._layer||(this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)),this._layer&&this._layer.entities.add({polyline:{positions:[e,t],width:2,material:r,depthFailMaterial:r}}),this}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:p})}return s}deactivate(){this._layer&&this._layer.entities.removeAll(),this._layer&&this._viewer.dataSources.remove(this._layer),this._layer=null}},jf=Hn;var qf=`#define USE_CUBE_MAP_SHADOW true
|
|
1725
|
+
uniform sampler2D colorTexture;
|
|
1726
|
+
uniform sampler2D depthTexture;
|
|
1727
|
+
in vec2 v_textureCoordinates;
|
|
1728
|
+
out vec4 fragColor;
|
|
1729
|
+
uniform mat4 camera_projection_matrix;
|
|
1730
|
+
uniform mat4 camera_view_matrix;
|
|
1731
|
+
uniform samplerCube shadowMap_textureCube;
|
|
1732
|
+
uniform mat4 shadowMap_matrix;
|
|
1733
|
+
uniform vec4 shadowMap_lightPositionEC;
|
|
1734
|
+
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
|
|
1735
|
+
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
|
|
1736
|
+
uniform float helsing_viewDistance;
|
|
1737
|
+
uniform vec4 helsing_visibleAreaColor;
|
|
1738
|
+
uniform vec4 helsing_invisibleAreaColor;
|
|
1739
|
+
struct zx_shadowParameters
|
|
1740
|
+
{
|
|
1741
|
+
vec3 texCoords;
|
|
1742
|
+
float depthBias;
|
|
1743
|
+
float depth;
|
|
1744
|
+
float nDotL;
|
|
1745
|
+
vec2 texelStepSize;
|
|
1746
|
+
float normalShadingSmooth;
|
|
1747
|
+
float darkness;
|
|
1748
|
+
};
|
|
1749
|
+
float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters)
|
|
1750
|
+
{
|
|
1751
|
+
float depthBias = shadowParameters.depthBias;
|
|
1752
|
+
float depth = shadowParameters.depth;
|
|
1753
|
+
float nDotL = shadowParameters.nDotL;
|
|
1754
|
+
float normalShadingSmooth = shadowParameters.normalShadingSmooth;
|
|
1755
|
+
float darkness = shadowParameters.darkness;
|
|
1756
|
+
vec3 uvw = shadowParameters.texCoords;
|
|
1757
|
+
depth -= depthBias;
|
|
1758
|
+
float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
|
|
1759
|
+
return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
|
|
1760
|
+
}
|
|
1761
|
+
vec4 getPositionEC(){
|
|
1762
|
+
return czm_windowToEyeCoordinates(gl_FragCoord);
|
|
1763
|
+
}
|
|
1764
|
+
vec3 getNormalEC(){
|
|
1765
|
+
return vec3(1.);
|
|
1766
|
+
}
|
|
1767
|
+
vec4 toEye(in vec2 uv,in float depth){
|
|
1768
|
+
vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.));
|
|
1769
|
+
vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.);
|
|
1770
|
+
posInCamera=posInCamera/posInCamera.w;
|
|
1771
|
+
return posInCamera;
|
|
1772
|
+
}
|
|
1773
|
+
vec3 pointProjectOnPlane(in vec3 planeNormal,in vec3 planeOrigin,in vec3 point){
|
|
1774
|
+
vec3 v01=point-planeOrigin;
|
|
1775
|
+
float d=dot(planeNormal,v01);
|
|
1776
|
+
return(point-planeNormal*d);
|
|
1777
|
+
}
|
|
1778
|
+
float getDepth(in vec4 depth){
|
|
1779
|
+
float z_window=czm_unpackDepth(depth);
|
|
1780
|
+
z_window=czm_reverseLogDepth(z_window);
|
|
1781
|
+
float n_range=czm_depthRange.near;
|
|
1782
|
+
float f_range=czm_depthRange.far;
|
|
1783
|
+
return(2.*z_window-n_range-f_range)/(f_range-n_range);
|
|
1784
|
+
}
|
|
1785
|
+
float shadow(in vec4 positionEC){
|
|
1786
|
+
vec3 normalEC=getNormalEC();
|
|
1787
|
+
zx_shadowParameters shadowParameters;
|
|
1788
|
+
shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
|
|
1789
|
+
shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
|
|
1790
|
+
shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
|
|
1791
|
+
shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
|
|
1792
|
+
vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC.xyz;
|
|
1793
|
+
float distance=length(directionEC);
|
|
1794
|
+
directionEC=normalize(directionEC);
|
|
1795
|
+
float radius=shadowMap_lightPositionEC.w;
|
|
1796
|
+
if(distance>radius)
|
|
1797
|
+
{
|
|
1798
|
+
return 2.0;
|
|
1799
|
+
}
|
|
1800
|
+
vec3 directionWC=czm_inverseViewRotation*directionEC;
|
|
1801
|
+
shadowParameters.depth=distance/radius-0.0003;
|
|
1802
|
+
shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);
|
|
1803
|
+
shadowParameters.texCoords=directionWC;
|
|
1804
|
+
float visibility=czm_shadowVisibility(shadowMap_textureCube,shadowParameters);
|
|
1805
|
+
return visibility;
|
|
1806
|
+
}
|
|
1807
|
+
bool visible(in vec4 result)
|
|
1808
|
+
{
|
|
1809
|
+
result.x/=result.w;
|
|
1810
|
+
result.y/=result.w;
|
|
1811
|
+
result.z/=result.w;
|
|
1812
|
+
return result.x>=-1.&&result.x<=1.
|
|
1813
|
+
&&result.y>=-1.&&result.y<=1.
|
|
1814
|
+
&&result.z>=-1.&&result.z<=1.;
|
|
1815
|
+
}
|
|
1816
|
+
void main(){
|
|
1817
|
+
// \u91C9\u8272 = \u7ED3\u6784\u4E8C\u7EF4(\u989C\u8272\u7EB9\u7406, \u7EB9\u7406\u5750\u6807)
|
|
1818
|
+
fragColor = texture(colorTexture, v_textureCoordinates);
|
|
1819
|
+
// \u6DF1\u5EA6 = \u83B7\u53D6\u6DF1\u5EA6(\u7ED3\u6784\u4E8C\u7EF4(\u6DF1\u5EA6\u7EB9\u7406, \u7EB9\u7406\u5750\u6807))
|
|
1820
|
+
float depth = getDepth(texture(depthTexture, v_textureCoordinates));
|
|
1821
|
+
// \u89C6\u89D2 = (\u7EB9\u7406\u5750\u6807, \u6DF1\u5EA6)
|
|
1822
|
+
vec4 viewPos = toEye(v_textureCoordinates, depth);
|
|
1823
|
+
// \u4E16\u754C\u5750\u6807
|
|
1824
|
+
vec4 wordPos = czm_inverseView * viewPos;
|
|
1825
|
+
// \u865A\u62DF\u76F8\u673A\u4E2D\u5750\u6807
|
|
1826
|
+
vec4 vcPos = camera_view_matrix * wordPos;
|
|
1827
|
+
float near = .001 * helsing_viewDistance;
|
|
1828
|
+
float dis = length(vcPos.xyz);
|
|
1829
|
+
if(dis > near && dis < helsing_viewDistance){
|
|
1830
|
+
// \u900F\u89C6\u6295\u5F71
|
|
1831
|
+
vec4 posInEye = camera_projection_matrix * vcPos;
|
|
1832
|
+
// \u53EF\u89C6\u533A\u989C\u8272
|
|
1833
|
+
// vec4 helsing_visibleAreaColor=vec4(0.,1.,0.,.5);
|
|
1834
|
+
// vec4 helsing_invisibleAreaColor=vec4(1.,0.,0.,.5);
|
|
1835
|
+
if(visible(posInEye)){
|
|
1836
|
+
float vis = shadow(viewPos);
|
|
1837
|
+
if(vis > 0.3){
|
|
1838
|
+
fragColor = mix(fragColor,helsing_visibleAreaColor,.5);
|
|
1839
|
+
} else{
|
|
1840
|
+
fragColor = mix(fragColor,helsing_invisibleAreaColor,.5);
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}`;var Wn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._sketch=void 0,this._postStage=void 0,this._enable=!0,this._viewPosition=void 0,this._viewPositionEnd=void 0,this._viewDistance=void 0,this._viewHeading=void 0,this._viewPitch=void 0,this._horizontalViewAngle=90,this._verticalViewAngle=60,this._visibleAreaColor=i.Color.GREEN,this._invisibleAreaColor=i.Color.RED,this._softShadows=!0,this._size=2048}get type(){return"viewshed"}set enable(e){this._enable=e,this.update()}get enable(){return this._enable}set viewPosition(e){this._viewPosition=e,this.update()}get viewPosition(){return this._viewPosition}set viewDistance(e){this._viewDistance=e,this.update()}get viewDistance(){return this._viewDistance}set viewHeading(e){this._viewHeading=e,this.update()}get viewHeading(){return this._viewHeading}set viewPitch(e){this._viewPitch=e,this.update()}get viewPitch(){return this._viewPitch}set horizontalViewAngle(e){this._horizontalViewAngle=e,this.update()}get horizontalViewAngle(){return this._horizontalViewAngle}set verticalViewAngle(e){this._verticalViewAngle=e,this.update()}get verticalViewAngle(){return this._verticalViewAngle}set visibleAreaColor(e){this._visibleAreaColor=e,this.update()}get visibleAreaColor(){return this._visibleAreaColor}set invisibleAreaColor(e){this._invisibleAreaColor=e,this.update()}get invisibleAreaColor(){return this._invisibleAreaColor}_init(e,t={}){this._enable=typeof t.enable=="boolean"?t.enable:!0,this._viewPosition=f.transformWGS84ToCartesian(e),this._viewPositionEnd=f.transformWGS84ToCartesian(e),this._viewDistance=t.viewDistance||(this._viewPositionEnd?i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd):100),this._viewHeading=t.viewHeading||(this._viewPositionEnd?this._getHeading(this._viewPosition,this._viewPositionEnd):0),this._viewPitch=t.viewPitch||(this._viewPositionEnd?this._getPitch(this._viewPosition,this._viewPositionEnd):0),this._horizontalViewAngle=t.horizontalViewAngle||90,this._verticalViewAngle=t.verticalViewAngle||60,this._visibleAreaColor=t.visibleAreaColor||i.Color.GREEN,this._invisibleAreaColor=t.invisibleAreaColor||i.Color.RED,this._softShadows=typeof t.softShadows=="boolean"?t.softShadows:!0,this._size=t.size||2048}_add(){this._createLightCamera(),this._createShadowMap(),this._drawSketch(),this._createPostStage()}update(){this.deactivate(),this._add()}updatePosition(e){this._viewPositionEnd=e,this._viewDistance=i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd),this._viewHeading=this._getHeading(this._viewPosition,this._viewPositionEnd),this._viewPitch=this._getPitch(this._viewPosition,this._viewPositionEnd),this._sketch||this._drawSketch()}deactivate(){this._sketch&&(this._viewer.entities.remove(this._sketch),this._sketch=void 0),this._postStage&&(this._viewer.scene.postProcessStages.remove(this._postStage),this._postStage=void 0)}_createLightCamera(){this.lightCamera=new i.Camera(this._viewer.scene),this.lightCamera.position=this._viewPosition,this.lightCamera.frustum.near=this._viewDistance*.001,this.lightCamera.frustum.far=this._viewDistance;let e=i.Math.toRadians(this._horizontalViewAngle),t=i.Math.toRadians(this._verticalViewAngle),r=this._viewDistance*Math.tan(e/2)*2/(this._viewDistance*Math.tan(t/2)*2);this.lightCamera.frustum.aspectRatio=r,e>t?this.lightCamera.frustum.fov=e:this.lightCamera.frustum.fov=t,this.lightCamera.setView({destination:this._viewPosition,orientation:{heading:i.Math.toRadians(this._viewHeading||0),pitch:i.Math.toRadians(this._viewPitch||0),roll:0}})}_createShadowMap(){this.shadowMap=new i.ShadowMap({context:this._viewer.scene.context,lightCamera:this.lightCamera,enabled:this._enable,isPointLight:!0,pointLightRadius:this._viewDistance,cascadesEnabled:!1,size:this._size,softShadows:this._softShadows,normalOffset:!1,fromLightSource:!1,darkness:1}),this._viewer.scene.shadowMap=this.shadowMap}_createPostStage(){let e=new i.PostProcessStage({fragmentShader:qf,uniforms:{shadowMap_textureCube:()=>(this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState")),Reflect.get(this.shadowMap,"_shadowMapTexture")),shadowMap_matrix:()=>(this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState")),Reflect.get(this.shadowMap,"_shadowMapMatrix")),shadowMap_lightPositionEC:()=>(this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState")),Reflect.get(this.shadowMap,"_lightPositionEC")),shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:()=>{this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState"));let t=this.shadowMap._pointBias;return i.Cartesian4.fromElements(t.normalOffsetScale,this.shadowMap._distance,this.shadowMap.maximumDistance,0,new i.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:()=>{this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState"));let t=this.shadowMap._pointBias,s=new i.Cartesian2;return s.x=1/this.shadowMap._textureSize.x,s.y=1/this.shadowMap._textureSize.y,i.Cartesian4.fromElements(s.x,s.y,t.depthBias,t.normalShadingSmooth,new i.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:()=>this._viewDistance,helsing_visibleAreaColor:this._visibleAreaColor,helsing_invisibleAreaColor:this._invisibleAreaColor}});this._postStage=this._viewer.scene.postProcessStages.add(e)}drawFrustumOutline(){let e=new i.Cartesian3,t=new i.Matrix3,r=new i.Quaternion,s=this.lightCamera.positionWC,o=this.lightCamera.directionWC,n=this.lightCamera.upWC,l=this.lightCamera.rightWC;l=i.Cartesian3.negate(l,e);let h=t;i.Matrix3.setColumn(h,0,l,h),i.Matrix3.setColumn(h,1,n,h),i.Matrix3.setColumn(h,2,o,h);let c=i.Quaternion.fromRotationMatrix(h,r),p=new i.GeometryInstance({geometry:new i.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:this._viewPosition,orientation:c}),id:Math.random().toString(36).substr(2),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.YELLOWGREEN),show:new i.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this._viewer.scene.primitives.add(new i.Primitive({geometryInstances:[p],appearance:new i.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}_drawSketch(){this._sketch=this._viewer.entities.add({name:"sketch",position:this._viewPosition,show:!0,orientation:new i.CallbackProperty(()=>i.Transforms.headingPitchRollQuaternion(this._viewPosition,i.HeadingPitchRoll.fromDegrees(this._viewHeading-90,this._viewPitch,0)),!1),ellipsoid:{radii:new i.CallbackProperty(()=>new i.Cartesian3(this._viewDistance,this._viewDistance,this._viewDistance),!1),innerRadii:new i.Cartesian3(2,2,2),minimumClock:i.Math.toRadians(-this._horizontalViewAngle/2),maximumClock:i.Math.toRadians(this._horizontalViewAngle/2),minimumCone:i.Math.toRadians(this._verticalViewAngle+7.75),maximumCone:i.Math.toRadians(180-this._verticalViewAngle-7.75),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:i.Color.YELLOWGREEN}})}_getHeading(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.atan2(r.x,r.y))}_getPitch(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.asin(r.z))}},Zf=Wn;var Gn=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._contourLine=new Wf(e),this._tilesetShake=new Gf(e),this._sightLine=new jf(e),this._viewshed=new Zf(e)}get ContourLine(){return this._contourLine}get TilesetShake(){return this._tilesetShake}get SightLine(){return this._sightLine}get ViewShed(){return this._viewshed}contourLine(e,t,r){this._contourLine._init(e,t,r)}tilesetShake(e,t){this._tilesetShake._init(e,t)}terrainClip(e={}){return new Uf(this._viewer,e)}terrainClipPlan(e={}){return new Bf(this._viewer,e)}terrainUplift(e={}){return new Vf(this._viewer,e)}sightLine(e,t,r){return this._sightLine._init(e,t,r)}viewshed(e,t){return this._viewshed._init(e,t),this._viewshed}deactivate(e=null){switch(e){case xt.SIGHT_LINE:this._sightLine.deactivate();break;case xt.VIEW_SHED:this._viewshed.deactivate();break;default:this._contourLine.deactivate(),this._tilesetShake.deactivate();break}return this}},Yf=Gn;var Un=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(E.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(E.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},Xf=Un;var Bn=class extends Xf{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP,e))}},Jf=Bn;var Vn=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)?i.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onComputedStop(e,t=!1){let r=[];return t?r=e.map((s,o)=>{let l=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),h=0;for(let c=1;c<=o;c++){let p=i.Cartesian3.distance(e[c-1],e[c]);h+=p}return{longitude:i.Math.toDegrees(l.longitude),latitude:i.Math.toDegrees(l.latitude),height:l.height,distance:h,cartesian3Position:s}}):r=e.map((s,o)=>{let n=0;for(let l=1;l<=o;l++){let h=i.Cartesian3.fromRadians(e[l-1].longitude,e[l-1].latitude,e[l-1].height),c=i.Cartesian3.fromRadians(e[l].longitude,e[l].latitude,e[l].height),p=i.Cartesian3.distance(h,c);n+=p}return{longitude:i.Math.toDegrees(s.longitude),latitude:i.Math.toDegrees(s.latitude),height:s.height,distance:n,cartesian3Position:i.Cartesian3.fromRadians(s.longitude,s.latitude,s.height)}}),r}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},Kf=Vn;var jn=class extends Kf{constructor(){super(),this._maxAnchorSize=9999,this._positions=[],this._includeModel=!0,this._callback=null}_lerp(e,t,r=5){let s=[],o=i.Cartographic.fromCartesian(e),n=i.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push(i.Cartesian3.fromRadians(h,c,p))}return s}async _onDrawStop(e){let t=this._positions.filter((s,o)=>o!==1),r=await this._onComputedStop(t,this._includeModel);typeof this._callback=="function"&&await this._callback(r)}_stoppedHook(){this._options.onDrawStop&&this._options.onDrawStop(entity)}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t,this._includeModel).then(([r,s])=>(this._includeModel||(this._positions=r),r.map((o,n)=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0))))).then(r=>{this._includeModel&&(this._positions=r);let s=0;for(let o=0;o<r.length-1;o++){let n=i.Cartesian3.distance(r[o],r[o+1]);s+=n}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t,r={}){return this._startHook(e,r),new Jf({material:r.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:r.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:r.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this._includeModel=r==null?void 0:r.includeModel,this._callback=t,this}},Qf=jn;var qn=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.CustomDataSource("plotAnalysis-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}profile(e,t={}){var r;return(r=new Qf)==null||r.start(this,e,t),this}activate(e,t){switch(e){case Hi.PROFILE:this.profile(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},$f=qn;var dY=i.Cartesian2,mY=i.Cartesian3,uY=i.Matrix3,_Y=i.Matrix4,fY=i.Material,gY=i.SceneMode,yY=i.SkyBox,vY=i.Color,wY=i.Rectangle,CY=i.ShadowMode,xY=i.JulianDate,TY=i.HeightReference,EY=i.HorizontalOrigin,PY=i.VerticalOrigin,bY=i.CallbackProperty,AY=i.ClassificationType,MY=i.Cesium3DTileStyle,IY=i.GeographicTilingScheme,SY=i.WebMercatorTilingScheme,DY=i.ColorMaterialProperty,LY=i.ImageMaterialProperty,RY=i.PolylineDashMaterialProperty,OY=i.PolylineGlowMaterialProperty,kY=i.PolylineOutlineMaterialProperty,FY=i.PolylineArrowMaterialProperty,zY=i.writeTextToCanvas,NY=i.CustomShaderMode,HY=i.CustomShaderTranslucencyMode,WY=i.CustomShader,GY=i.UniformType,UY=i.Ellipsoid,BY=i.Resource,VY=i.createGooglePhotorealistic3DTileset,jY=i.createElevationBandMaterial,qY=i.ModelAnimationLoop,ZY=i.ClippingPlane,YY=i.ClippingPlaneCollection,XY=i.ClippingPolygon,JY=i.ClippingPolygonCollection;globalThis.__cmdOut=()=>{console.clear(),console.log(`%c
|
|
1845
|
+
GM-SDK %c %c
|
|
1846
|
+
|
|
1847
|
+
\u7248\u672C: 2.0.2 - 2025-08-18
|
|
1848
|
+
\u7F51\u7AD9\u4E3B\u9875: http://127.0.0.1:8081/greatmap/gm-docs/zh/index.html`,"font-size:20px;padding-left:70px;color:#EEB422","font-size:14px;padding-left:50px;color:#EEB422;font-style:oblique","font-size:12px;color:#0865ba")};var tg="./libs/gm-sdk/resources/",eg=tg;bt("baseUrl",tg);var $Y={set baseUrl(a){eg=a,bt("baseUrl",a)},get baseUrl(){return eg}},eX="2.0.2";export{Yf as Analysis,xt as AnalysisType,Z as AnimationType,Q_ as AroundPoint,K_ as AroundView,Ue as AttackArrow,Me as Billboard,Wt as BillboardPrimitive,xh as BounceBillboardPrimitive,Eh as BounceLabelPrimitive,Wm as Box,bY as CallbackProperty,dY as Cartesian2,mY as Cartesian3,ZT as ChartLayer,ei as Circle,i_ as CircleBlurMaterialProperty,r_ as CircleDiffuseMaterialProperty,s_ as CircleFadeMaterialProperty,o_ as CirclePulseMaterialProperty,ef as CircleScan,a_ as CircleScanMaterialProperty,n_ as CircleSpiralMaterialProperty,l_ as CircleVaryMaterialProperty,h_ as CircleWaveMaterialProperty,AY as ClassificationType,ZY as ClippingPlane,YY as ClippingPlaneCollection,XY as ClippingPolygon,JY as ClippingPolygonCollection,Ph as CloudPrimitive,nh as ClusterLayer,vY as Color,DY as ColorMaterialProperty,me as CoordTransform,Gm as Corridor,ph as CustomBillboard,rh as CustomGeographicTilingScheme,dh as CustomLabel,sh as CustomMercatorTilingScheme,WY as CustomShader,NY as CustomShaderMode,HY as CustomShaderTranslucencyMode,Um as Cylinder,lh as CzmlLayer,bh as DiffuseWallPrimitive,fh as DivIcon,I as DomUtil,Ft as DoubleArrow,mh as DynamicBillboard,hh as DynamicLayer,uh as DynamicModel,tP as Effect,Ah as ElecEllipsoidPrimitive,Bm as Ellipse,UY as Ellipsoid,c_ as EllipsoidElectricMaterialProperty,p_ as EllipsoidTrailMaterialProperty,ch as FeatureGridLayer,zt as FineArrow,Mh as FlowLinePrimitive,tf as Flying,Nt as GatheringPlace,si as GeoJsonLayer,Hf as GeoTools,IY as GeographicTilingScheme,rf as GlobeRotate,Jm as GpxLayer,Km as GraticuleLayer,Qm as GroundPrimitiveLayer,Gl as GroundSkyBox,UT as HeatMapLayer,TY as HeightReference,EY as HorizontalOrigin,$m as HtmlLayer,gh as I3S,eu as I3SLayer,LY as ImageMaterialProperty,ih as ImageryLayerFactory,k as ImageryType,xY as JulianDate,Ef as KeyboardRoaming,tu as KmlLayer,ti as Label,iu as LabelLayer,Gt as LabelPrimitive,A as Layer,ah as LayerGroup,lt as LayerType,Sh as LightCylinderPrimitive,fY as Material,_h as Math,uY as Matrix3,_Y as Matrix4,Nf as Measure,ne as MeasureType,Ge as Model,qY as ModelAnimationLoop,Oe as ModelEventType,Dh as ModelPrimitive,O as MouseEventType,Pe as MouseMode,v as Overlay,N as OverlayType,y as P,y as Parse,jm as Plane,XE as Plot,$f as PlotAnalysis,Hi as PlotAnalysisType,ii as Point,Rh as PointPrimitive,Ie as Polygon,Se as Polyline,FY as PolylineArrowMaterialProperty,RY as PolylineDashMaterialProperty,d_ as PolylineFlickerMaterialProperty,m_ as PolylineFlowMaterialProperty,OY as PolylineGlowMaterialProperty,u_ as PolylineImageTrailMaterialProperty,__ as PolylineLightingMaterialProperty,f_ as PolylineLightingTrailMaterialProperty,kY as PolylineOutlineMaterialProperty,Oh as PolylinePrimitive,g_ as PolylineTrailMaterialProperty,Zm as PolylineVolume,X as Position,ru as PrimitiveLayer,y_ as RadarLineMaterialProperty,of as RadarScan,v_ as RadarSweepMaterialProperty,w_ as RadarWaveMaterialProperty,su as RasterTileLayer,ri as Rect,wY as Rectangle,BY as Resource,Pf as RoamingController,bf as RoamingPath,kh as ScanCirclePrimitive,D as SceneEventType,gY as SceneMode,CY as ShadowMode,au as Shp2JsonLayer,yY as SkyBox,Vm as Sphere,f as T,Ht as TailedAttackArrow,oh as TerrainFactory,be as TerrainType,K as TileSetEventType,yh as Tileset,ou as TilesetLayer,MY as TilesetStyle,Mf as Track,Af as TrackController,De as TrackViewMode,Fh as TrailLinePrimitive,f as Transform,GY as UniformType,C as Util,eX as VERSION,ue as VectorLayer,PY as VerticalOrigin,zh as VideoPrimitive,Nm as VideoProjectionPrimitive,Yg as Viewer,Xm as VolumRadar,Ym as Wall,C_ as WallImageTrailMaterialProperty,T_ as WallLineTrailMaterialProperty,P_ as WallTrailMaterialProperty,b_ as WaterMaterialProperty,Hm as WaterPrimitive,aP as Weather,SY as WebMercatorTilingScheme,VT as WindLayer,$Y as config,jY as createElevationBandMaterial,VY as createGooglePhotorealistic3DTileset,q as getLib,$n as registerLib,zY as writeTextToCanvas};
|