cesium_dev_kit 1.1.24 → 1.2.1

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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var oe=class extends Error{constructor(h,y,o={}){super(`[cesium_dev_kit:${h}] ${y}`),this.name="CesiumDevKitError",this.code=h,this.details=o.details,this.cause=o.cause,Object.setPrototypeOf(this,new.target.prototype);}};function lt(e){return e instanceof oe?true:!!e&&typeof e=="object"&&e.name==="CesiumDevKitError"&&typeof e.code=="string"}var wt=null;function Lt(e){wt=e;}function Yn(){return wt}function pe(e,h){if(wt)try{wt(e,h);return}catch(o){console.error("[cesium_dev_kit] error handler threw:",o);}let y=h!=null&&h.scope?`[cesium_dev_kit:${h.scope}]`:"[cesium_dev_kit]";console.warn(y,e,h!=null?h:"");}var kt=null,Dt=null,Rt=null;function qn(e){return e&&typeof e=="object"&&e.default?e.default:e}function Bt(e,h){return h().then(qn).catch(y=>{throw lt(y)?y:new oe("OPTIONAL_DEPENDENCY_MISSING",`\u8BE5\u529F\u80FD\u9700\u8981\u53EF\u9009\u4F9D\u8D56 "${e}"\uFF0C\u8BF7\u5148\u5B89\u88C5\uFF1Anpm i ${e}`,{cause:y,details:{package:e}})})}function Zt(){return kt||(kt=Bt("echarts",()=>import('echarts'))),kt}function De(){return Dt||(Dt=Bt("dat.gui",()=>import('dat.gui'))),Dt}function $t(){return Rt||(Rt=Bt("libgif",()=>import('libgif'))),Rt}var Qn="";function en(e,h){if(!h)return "";if(/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(h)||h.startsWith("data:")||h.startsWith("/"))return h;let y=(e||"").replace(/\/+$/,"");return y?y+"/"+h.replace(/^\/+/,""):h}function fe(e=""){return {baseService:e,skyBox:{one:{positiveX:"static/data/images/SkyBox/00h+00.jpg",negativeX:"static/data/images/SkyBox/12h+00.jpg",positiveY:"static/data/images/SkyBox/06h+00.jpg",negativeY:"static/data/images/SkyBox/18h+00.jpg",positiveZ:"static/data/images/SkyBox/06h+90.jpg",negativeZ:"static/data/images/SkyBox/06h-90.jpg"},two:{positiveX:"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:"static/data/images/SkyBox/Version2_dark_mz.jpg"},three:{positiveX:"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"},nearOne:{positiveX:"static/data/images/SkyBox/rightav9.jpg",negativeX:"static/data/images/SkyBox/leftav9.jpg",positiveY:"static/data/images/SkyBox/frontav9.jpg",negativeY:"static/data/images/SkyBox/backav9.jpg",positiveZ:"static/data/images/SkyBox/topav9.jpg",negativeZ:"static/data/images/SkyBox/bottomav9.jpg"},nearTwo:{positiveX:"static/data/images/SkyBox/SunSetRight.png",negativeX:"static/data/images/SkyBox/SunSetLeft.png",positiveY:"static/data/images/SkyBox/SunSetFront.png",negativeY:"static/data/images/SkyBox/SunSetBack.png",positiveZ:"static/data/images/SkyBox/SunSetUp.png",negativeZ:"static/data/images/SkyBox/SunSetDown.png"},nearThree:{positiveX:"static/data/images/SkyBox/Right.jpg",negativeX:"static/data/images/SkyBox/Left.jpg",positiveY:"static/data/images/SkyBox/Front.jpg",negativeY:"static/data/images/SkyBox/Back.jpg",positiveZ:"static/data/images/SkyBox/Up.jpg",negativeZ:"static/data/images/SkyBox/Down.jpg"}},drawPointGraphics:"static/data/images/file/location4.png",graphic:{craeteRotateCylinderGraphics:"static/data/images/file/cc2.png",craeteDynamicCricleGraphics:"static/data/images/Textures/circle_bg.png",craeteDynamicShadeWallGraphics:"static/data/images/Textures/fence.png",createCustomDefBillboardGraphics:"static/data/images/file/div1.png"},material:{PolylineCityLinkMaterialProperty:"static/data/images/Textures/meteor_01.png",WarnLinkMaterialProperty:"static/data/images/Textures/jsx2.png"},plugin:{Css3Renderer_one:"static/data/images/Textures/circle2.png",Css3Renderer_two:"static/data/images/Textures/circle1.png"},primitive:{TetrahedronPrimitive:"static/data/images/Textures/fence.png",WaterPrimitive:"static/data/images/Textures/river.png"},passEffect:{satellite:"static/data/images/file/satellite.svg"},amalysis:{createClipPlanAnalysis_wallImg:"static/data/images/file/excavate_side_min.jpg",createClipPlanAnalysis_bottomImg:"static/data/images/file/excavate_bottom_min.jpg",createSubmergedAnalysis:"static/data/images/file/water.png"}}}var Jn=fe();var Kn=Object.assign((e,h)=>e!=null?e:h,{EMPTY_OBJECT:Object.freeze({})}),Re=Kn;function re(e){function h(...y){let o=e();return new o(...y)}return h.prototype=e().prototype,Object.defineProperty(h,"__cesiumDevKitCreateModule",{value:e,enumerable:false,configurable:false,writable:false}),h}function Fe(e){let h=e==null?void 0:e.__cesiumDevKitCreateModule;return typeof h=="function"?h():e}function Ze(e){if(e)try{if(typeof e.isDestroyed=="function"&&e.isDestroyed())return;typeof e.destroy=="function"&&e.destroy();}catch(h){console.warn("[cesium_dev_kit] failed to dispose viewer:",h);}}var Oe=new WeakMap;function ae(e,h){if(!e||typeof h!="function")return;let y=Oe.get(e);y?y.push(h):Oe.set(e,[h]);}function $e(e,h){if(!e||!h||e===h)return;let y=Oe.get(e);if(!y||y.length===0)return;Oe.delete(e);let o=Oe.get(h);o?o.push(...y):Oe.set(h,y);}function Ce(e){if(!e||typeof e!="object"&&typeof e!="function")return;let h=Oe.get(e);if(h){Oe.delete(e);for(let y=h.length-1;y>=0;y--)try{h[y]();}catch(o){console.warn("[cesium_dev_kit] cleanup failed:",o);}}}function se(e){e&&typeof e.destroy!="function"&&Object.defineProperty(e,"destroy",{value:function(){Ce(this);},enumerable:false,configurable:true,writable:true});}function Ne(e,h){Object.getOwnPropertyNames(h.prototype).forEach(y=>{y!=="constructor"&&(e.prototype[y]=h.prototype[y]);});}function Zn(){let e={},h;class y{constructor(n,a,r){if(n){this._viewer=n,e=a,h=r||fe(),this._drawLayer=new e.CustomDataSource("drawLayer"),n&&n.dataSources.add(this._drawLayer);let i=this._drawLayer;se(this),ae(this,()=>{this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._drawLayer===i&&(this._drawLayer=void 0));}),this.type="base",this.id="base",this.myname="BASE",this._installBaiduImageryProvider(),this._installGoogleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox();}}createGraphics(){return new e.Entity}_objHasOwnProperty(n,a,r){return n.hasOwnProperty(a)?n[a]:r}getDfSt(n){if(!h)return;let a=h,r=n.reduce((i,l)=>i?i[l]:a[l],void 0);if(r!=null)return typeof r!="string"?r:en(a.baseService,r)}setOneSkyBox(){return new e.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})}setTwoSkyBox(){return new e.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})}setThreeSkyBox(){return new e.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})}setOneGroundSkyBox(){return new e.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})}setTwoGroundSkyBox(){return new e.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})}setThreeGroundSkyBox(){return new e.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})}setDarkEffect(n){n=n||{};var a=`uniform sampler2D colorTexture;
1
+ var ae=class extends Error{constructor(u,f,a={}){super(`[cesium_dev_kit:${u}] ${f}`),this.name="CesiumDevKitError",this.code=u,this.details=a.details,this.cause=a.cause,Object.setPrototypeOf(this,new.target.prototype);}};function ct(e){return e instanceof ae?true:!!e&&typeof e=="object"&&e.name==="CesiumDevKitError"&&typeof e.code=="string"}var Ct=null;function Dt(e){Ct=e;}function tr(){return Ct}function ge(e,u){if(Ct)try{Ct(e,u);return}catch(a){console.error("[cesium_dev_kit] error handler threw:",a);}let f=u!=null&&u.scope?`[cesium_dev_kit:${u.scope}]`:"[cesium_dev_kit]";console.warn(f,e,u!=null?u:"");}var Rt=null,Bt=null,Gt=null;function nr(e){return e&&typeof e=="object"&&e.default?e.default:e}function Ot(e,u){return u().then(nr).catch(f=>{throw ct(f)?f:new ae("OPTIONAL_DEPENDENCY_MISSING",`\u8BE5\u529F\u80FD\u9700\u8981\u53EF\u9009\u4F9D\u8D56 "${e}"\uFF0C\u8BF7\u5148\u5B89\u88C5\uFF1Anpm i ${e}`,{cause:f,details:{package:e}})})}function en(){return Rt||(Rt=Ot("echarts",()=>import('echarts'))),Rt}function Re(){return Bt||(Bt=Ot("dat.gui",()=>import('dat.gui'))),Bt}function tn(){return Gt||(Gt=Ot("libgif",()=>import('libgif'))),Gt}var rr="";function nn(e,u){if(!u)return "";if(/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(u)||u.startsWith("data:")||u.startsWith("/"))return u;let f=(e||"").replace(/\/+$/,"");return f?f+"/"+u.replace(/^\/+/,""):u}function ye(e=""){return {baseService:e,skyBox:{one:{positiveX:"static/data/images/SkyBox/00h+00.jpg",negativeX:"static/data/images/SkyBox/12h+00.jpg",positiveY:"static/data/images/SkyBox/06h+00.jpg",negativeY:"static/data/images/SkyBox/18h+00.jpg",positiveZ:"static/data/images/SkyBox/06h+90.jpg",negativeZ:"static/data/images/SkyBox/06h-90.jpg"},two:{positiveX:"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:"static/data/images/SkyBox/Version2_dark_mz.jpg"},three:{positiveX:"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"},nearOne:{positiveX:"static/data/images/SkyBox/rightav9.jpg",negativeX:"static/data/images/SkyBox/leftav9.jpg",positiveY:"static/data/images/SkyBox/frontav9.jpg",negativeY:"static/data/images/SkyBox/backav9.jpg",positiveZ:"static/data/images/SkyBox/topav9.jpg",negativeZ:"static/data/images/SkyBox/bottomav9.jpg"},nearTwo:{positiveX:"static/data/images/SkyBox/SunSetRight.png",negativeX:"static/data/images/SkyBox/SunSetLeft.png",positiveY:"static/data/images/SkyBox/SunSetFront.png",negativeY:"static/data/images/SkyBox/SunSetBack.png",positiveZ:"static/data/images/SkyBox/SunSetUp.png",negativeZ:"static/data/images/SkyBox/SunSetDown.png"},nearThree:{positiveX:"static/data/images/SkyBox/Right.jpg",negativeX:"static/data/images/SkyBox/Left.jpg",positiveY:"static/data/images/SkyBox/Front.jpg",negativeY:"static/data/images/SkyBox/Back.jpg",positiveZ:"static/data/images/SkyBox/Up.jpg",negativeZ:"static/data/images/SkyBox/Down.jpg"}},drawPointGraphics:"static/data/images/file/location4.png",graphic:{craeteRotateCylinderGraphics:"static/data/images/file/cc2.png",craeteDynamicCricleGraphics:"static/data/images/Textures/circle_bg.png",craeteDynamicShadeWallGraphics:"static/data/images/Textures/fence.png",createCustomDefBillboardGraphics:"static/data/images/file/div1.png"},material:{PolylineCityLinkMaterialProperty:"static/data/images/Textures/meteor_01.png",WarnLinkMaterialProperty:"static/data/images/Textures/jsx2.png"},plugin:{Css3Renderer_one:"static/data/images/Textures/circle2.png",Css3Renderer_two:"static/data/images/Textures/circle1.png"},primitive:{TetrahedronPrimitive:"static/data/images/Textures/fence.png",WaterPrimitive:"static/data/images/Textures/river.png"},passEffect:{satellite:"static/data/images/file/satellite.svg"},amalysis:{createClipPlanAnalysis_wallImg:"static/data/images/file/excavate_side_min.jpg",createClipPlanAnalysis_bottomImg:"static/data/images/file/excavate_bottom_min.jpg",createSubmergedAnalysis:"static/data/images/file/water.png"}}}var ir=ye();var ar=Object.assign((e,u)=>e!=null?e:u,{EMPTY_OBJECT:Object.freeze({})}),Be=ar;function re(e){function u(...f){let a=e();return new a(...f)}return u.prototype=e().prototype,Object.defineProperty(u,"__cesiumDevKitCreateModule",{value:e,enumerable:false,configurable:false,writable:false}),u}function He(e){let u=e==null?void 0:e.__cesiumDevKitCreateModule;return typeof u=="function"?u():e}function $e(e){if(e)try{if(typeof e.isDestroyed=="function"&&e.isDestroyed())return;typeof e.destroy=="function"&&e.destroy();}catch(u){console.warn("[cesium_dev_kit] failed to dispose viewer:",u);}}var Ve=new WeakMap;function oe(e,u){if(!e||typeof u!="function")return;let f=Ve.get(e);f?f.push(u):Ve.set(e,[u]);}function et(e,u){if(!e||!u||e===u)return;let f=Ve.get(e);if(!f||f.length===0)return;Ve.delete(e);let a=Ve.get(u);a?a.push(...f):Ve.set(u,f);}function Ce(e){if(!e||typeof e!="object"&&typeof e!="function")return;let u=Ve.get(e);if(u){Ve.delete(e);for(let f=u.length-1;f>=0;f--)try{u[f]();}catch(a){console.warn("[cesium_dev_kit] cleanup failed:",a);}}}function se(e){e&&typeof e.destroy!="function"&&Object.defineProperty(e,"destroy",{value:function(){Ce(this);},enumerable:false,configurable:true,writable:true});}function je(e,u){Object.getOwnPropertyNames(u.prototype).forEach(f=>{f!=="constructor"&&(e.prototype[f]=u.prototype[f]);});}function or(){let e={},u;class f{constructor(n,o,r){if(n){this._viewer=n,e=o,u=r||ye(),this._drawLayer=new e.CustomDataSource("drawLayer"),n&&n.dataSources.add(this._drawLayer);let i=this._drawLayer;se(this),oe(this,()=>{this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._drawLayer===i&&(this._drawLayer=void 0));}),this.type="base",this.id="base",this.myname="BASE",this._installBaiduImageryProvider(),this._installGoogleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox();}}createGraphics(){return new e.Entity}_objHasOwnProperty(n,o,r){return n.hasOwnProperty(o)?n[o]:r}getDfSt(n){if(!u)return;let o=u,r=n.reduce((i,s)=>i?i[s]:o[s],void 0);if(r!=null)return typeof r!="string"?r:nn(o.baseService,r)}setOneSkyBox(){return new e.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})}setTwoSkyBox(){return new e.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})}setThreeSkyBox(){return new e.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})}setOneGroundSkyBox(){return new e.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})}setTwoGroundSkyBox(){return new e.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})}setThreeGroundSkyBox(){return new e.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})}setDarkEffect(n){n=n||{};var o=`uniform sampler2D colorTexture;
2
2
  in vec2 v_textureCoordinates;
3
3
  uniform float scale;
4
4
  uniform vec3 offset;
@@ -6,7 +6,7 @@ void main() {
6
6
  vec4 color = texture(colorTexture, v_textureCoordinates);
7
7
  out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);
8
8
  }
9
- `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"darkEffect",fragmentShader:a,uniforms:{scale:1,offset(){return n.offset||new e.Cartesian3(.1,.2,.3)}}}))}setBlurBloom(n){if(this._viewer&&n){var a=`uniform float height;
9
+ `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"darkEffect",fragmentShader:o,uniforms:{scale:1,offset(){return n.offset||new e.Cartesian3(.1,.2,.3)}}}))}setBlurBloom(n){if(this._viewer&&n){var o=`uniform float height;
10
10
  uniform float width;
11
11
  uniform sampler2D colorTexture1;
12
12
 
@@ -29,7 +29,7 @@ result += texture(colorTexture1, st + offset);
29
29
  result = result / float(count);
30
30
  out_FragColor = result;
31
31
  }
32
- `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"blur_x_direction",fragmentShader:a,uniforms:{width:n.width,height:n.height,colorTexture1:"Bright"}}))}}setRainEffect(){if(this._viewer){var n=`uniform sampler2D colorTexture;
32
+ `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"blur_x_direction",fragmentShader:o,uniforms:{width:n.width,height:n.height,colorTexture1:"Bright"}}))}}setRainEffect(){if(this._viewer){var n=`uniform sampler2D colorTexture;
33
33
  in vec2 v_textureCoordinates;
34
34
 
35
35
  float hash(float x){
@@ -120,14 +120,14 @@ void main(void)
120
120
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
121
121
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
122
122
  }
123
- `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:n,uniforms:{fogByDistance:new e.Cartesian4(10,0,200,.3),fogColor:e.Color.AZURE}}))}}setDefSceneConfig(){this._viewer&&(this._viewer.scene.sun.show=false,this._viewer.scene.moon.show=false,this._viewer.scene.fxaa=true,this._viewer.scene.globe.depthTestAgainstTerrain=true,this._viewer.scene.undergroundMode=false,this._viewer.scene.terrainProvider.isCreateSkirt=false,this._viewer.scene.skyAtmosphere.show=false,this._viewer.scene.globe.showGroundAtmosphere=false,this._viewer.scene.globe.enableLighting=true,this._viewer.scene.fog.enabled=false,this._viewer.cesiumWidget.creditContainer.style.display="none");}setBloomLightScene(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=true,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-0.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=false,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=false);}removePostProcessStage(n){n&&(Array.isArray(n)?n.forEach(a=>{this._viewer.scene.postProcessStages.contains(a)&&this._viewer.scene.postProcessStages.remove(a);}):this._viewer.scene.postProcessStages.contains(n)&&this._viewer.scene.postProcessStages.remove(n));}setView(n){if(this._viewer&&n&&n.position){if(n.distance){var a=new e.Cartesian3(0,n.distance,window.opt.distance);n.position=e.Cartesian3.add(n.position,a,new e.Cartesian3);}this._viewer.scene.camera.setView({destination:n.position,orientation:n.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)}});}}flyTo(n){if(this._viewer&&n&&n.position){if(n.distance){var a=new e.Cartesian3(0,n.distance,0);n.position=e.Cartesian3.add(n.position,a,new e.Cartesian3);}this._viewer.scene.camera.flyTo({destination:n.position,orientation:n.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)},easingFunction:n.easingFunction||e.EasingFunction.LINEAR_NONE,duration:n.duration||3,complete:n.callback});}}transformCartesianToWGS84(n){var a,r,i;if(this._viewer&&n){if(n.x===void 0&&(n.lng!==void 0||n.lon!==void 0))return {lng:Number((a=n.lng)!=null?a:n.lon),lat:Number(n.lat),alt:Number((i=(r=n.alt)!=null?r:n.height)!=null?i:0)};let l=e.Cartographic.fromCartesian(n);return {lng:e.Math.toDegrees(l.longitude),lat:e.Math.toDegrees(l.latitude),alt:l.height}}}transformWGS84ArrayToCartesianArray(n,a){if(this._viewer&&n){var r=this;return n?n.map(function(i){return r.transformWGS84ToCartesian(i,a)}):[]}}transformWGS84ToCartesian(n,a){if(this._viewer)return n?e.Cartesian3.fromDegrees(n.lng||n.lon,n.lat,n.alt=a||n.alt,e.Ellipsoid.WGS84):e.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(n){if(this._viewer){var a=this;return n?n.map(function(r){return a.transformCartesianToWGS84(r)}).filter(function(r){return !!r}):[]}}transformWGS84ToCartographic(n){return n?e.Cartographic.fromDegrees(n.lng||n.lon,n.lat,n.alt):e.Cartographic.ZERO}lnglatArrayToCartesians(n){if(!n||n.length<1)return [];let a=[];for(let r=0;r<n.length;r++){let i=e.Cartesian3.fromDegrees(Number(n[r][0]),Number(n[r][1]),Number(n[r][2]||0));a.push(i);}return a}setCameraEotateHeading(n){if(n){let a=this._viewer,r=e.Cartesian3.fromDegrees(n.lng,n.lat,n.height),i=e.Math.toRadians(-30),l=360/30,s=5e3,c=e.JulianDate.fromDate(new Date);a.clock.startTime=c.clone(),a.clock.currentTime=c.clone(),a.clock.clockRange=e.ClockRange.CLAMPED,a.clock.clockStep=e.ClockStep.SYSTEM_CLOCK;let u=a.camera.heading,d=function(){let f=e.JulianDate.secondsDifference(a.clock.currentTime,a.clock.startTime),p=e.Math.toRadians(f*l)+u;a.scene.camera.setView({destination:r,orientation:{heading:p,pitch:i}}),a.scene.camera.moveBackward(s),e.JulianDate.compare(a.clock.currentTime,a.clock.stopTime)>=0&&a.clock.onTick.removeEventListener(d);};a.clock.onTick.addEventListener(d),ae(this,()=>{a.clock.onTick.removeEventListener(d);});}}getCatesian3FromPX(n){if(this._viewer&&n){var a=this._viewer.scene.pick(n),r=null,i=false,l=false;if(a instanceof e.Cesium3DTileFeature&&(i=true),i&&(r=this._viewer.scene.pickPosition(n),r)){let c=e.Cartographic.fromCartesian(r);c.height<0&&(c.height=0);let u=e.Math.toDegrees(c.longitude),d=e.Math.toDegrees(c.latitude),m=c.height;r=this.transformWGS84ToCartesian({lng:u,lat:d,alt:m});}if(!a){var s=this._viewer.scene.camera.getPickRay(n);if(!s)return null;r=this._viewer.scene.globe.pick(s,this._viewer.scene),l=true;}if(a&&!i&&(r=this._viewer.scene.pickPosition(n),r)){let c=e.Cartographic.fromCartesian(r);c.height<0&&(c.height=0);let u=e.Math.toDegrees(c.longitude),d=e.Math.toDegrees(c.latitude),m=c.height;r=this.transformWGS84ToCartesian({lng:u,lat:d,alt:m});}if(!i&&!l&&!a&&(r=this._viewer.scene.camera.pickEllipsoid(n,this._viewer.scene.globe.ellipsoid)),r){let c=this.transformCartesianToWGS84(r);return c.alt<0&&(r=this.transformWGS84ToCartesian(c,.1)),r}return false}}getCameraPosition(){if(this._viewer){var n=this._viewer.scene.camera.pickEllipsoid(new e.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(n){var a=e.Ellipsoid.WGS84.cartesianToCartographic(n),r=a.longitude*180/Math.PI,i=a.latitude*180/Math.PI,l=this._viewer.camera._direction,s=e.Math.toDegrees(l.x),c=e.Math.toDegrees(l.y),u=e.Math.toDegrees(l.z),d=this._viewer.camera.positionCartographic.height,m=e.Math.toDegrees(this._viewer.camera.heading),f=e.Math.toDegrees(this._viewer.camera.pitch),p=e.Math.toDegrees(this._viewer.camera.roll),g=this._viewer.camera.computeViewRectangle(),v=g.west/Math.PI*180,A=g.north/Math.PI*180,w=g.east/Math.PI*180,C=g.south/Math.PI*180,_=(v+w)/2,P=(A+C)/2;return {lon:r,lat:i,height:d,heading:m,pitch:f,roll:p,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:_,y:P},direction:new e.Cartesian3(s,c,u)}}}}pickUpPosition(n){return this.getCatesian3FromPX(n.position)}getHandlerClickPosition(n){if(this._viewer){let a=this._viewer.scene,r=this._viewer,i=a.camera.pickEllipsoid(n.position,a.globe.elliposid),l={cameraPosistion:r.camera.position,heading:r.camera.heading,pitch:r.camera.pitch,roll:r.camera.roll},s=e.Cartographic.fromCartesian(i);s.height<0&&(s.height=0);let c={alt:s.height,lat:e.Math.toDegrees(s.latitude),lon:e.Math.toDegrees(s.longitude)},u=a.pickPosition(n.position),d=e.Cartographic.fromCartesian(u),m={height:d.height,latitude:e.Math.toDegrees(d.latitude),longitude:e.Math.toDegrees(d.longitude)};return {wgs84Coor:c,graphicCoor:m,cameraPosition:l}}}updateCameraState(n){this._viewer.scene._screenSpaceCameraController.enableRotate=n,this._viewer.scene._screenSpaceCameraController.enableTranslate=n,this._viewer.scene._screenSpaceCameraController.enableZoom=n,this._viewer.scene._screenSpaceCameraController.enableTilt=n,this._viewer.scene._screenSpaceCameraController.enableLook=n;}bindHandleEvent({leftClick:n,mouseMove:a,doubleClick:r,leftDown:i,mouseWheel:l,leftUp:s}){if(this._viewer){var c=new e.ScreenSpaceEventHandler(this._viewer.canvas);ae(this,()=>{c&&!c.isDestroyed()&&c.destroy();}),n&&c.setInputAction(function(u){n(u,c);},e.ScreenSpaceEventType.LEFT_CLICK),a&&c.setInputAction(function(u){a(u,c);},e.ScreenSpaceEventType.MOUSE_MOVE),r&&c.setInputAction(function(u){r(u,c);},e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i&&c.setInputAction(function(u){i(u,c);},e.ScreenSpaceEventType.LEFT_DOWN),l&&c.setInputAction(function(u){l(u,c);},e.ScreenSpaceEventType.WHEEL),s&&c.setInputAction(function(u){s(u,c);},e.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(n){return this.bindHandleEvent(n)}getHandlePosition(n){if(this._viewer){var a=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),r=this;ae(this,()=>{a&&!a.isDestroyed()&&a.destroy();}),a.setInputAction(function(i){var l=r._viewer.scene.camera.pickEllipsoid(i.endPosition,r._viewer.scene.globe.ellipsoid);typeof n=="function"&&n(r.transformCartesianToWGS84(l),a);},e.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(n){return this.getHandlePosition(n)}saveSceneImages(){if(this._viewer){let s=function(c){for(var u=c.split(","),d=u[0].match(/:(.*?);/)[1],m=atob(u[1]),f=m.length,p=new Uint8Array(f);f--;)p[f]=m.charCodeAt(f);return new Blob([p],{type:d})};var n=this._viewer.scene.canvas,a=n.toDataURL("image/png").replace("image/png","image/octet-stream"),r=document.createElement("a"),i=s(a),l=URL.createObjectURL(i);r.download="scene.png",r.href=l,r.click();}}_installAmapImageryProvider(){let n="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",a="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function r(i){return i.url=i.style==="img"?n:a,i.subdomains||(i.subdomains=["01","02","03","04"]),new e.UrlTemplateImageryProvider(i)}e.Scene.AmapImageryProvider=r;}_installTdtImageryProvider(){let n="https://{s}.tianditu.gov.cn/{layer}_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER={layer}&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk={key}";function a(r){return new e.WebMapTileServiceImageryProvider({url:n.replace(/\{layer\}/g,r.style||"vec").replace(/\{key\}/g,r.key||""),layer:r.style+"_w",style:"default",format:"tiles",tileMatrixSetID:"GoogleMapsCompatible",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],minimumLevel:0,maximumLevel:18})}e.Scene.TdtImageryProvider=a;}_installTencentImageryProvider(){let n="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",a="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function r(i){return i.layer==="img"?(i.url||(i.url=n),i.subdomains||(i.subdomains=["0","1","2"]),i.customTags={sx(l,s,c,u){return s>>4},sy(l,s,c,u){return (1<<u)-c>>4}}):i.url||(i.url=a),new e.UrlTemplateImageryProvider(i)}e.Scene.TencentImageryProvider=r;}_installGoogleImageryProvider(){let n="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",a="https://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",r="https://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile";function i(l){return l.url=l.style==="img"?a:l.style==="ter"?r:n,l.subdomains||(l.subdomains=["1","2","3","4","5"]),new e.UrlTemplateImageryProvider(l)}e.Scene.GoogleImageryProvider=i;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var n="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function a(i){n=i.url||n,this._url=n,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new e.WebMercatorTilingScheme({rectangleSouthwestInMeters:new e.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new e.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=i.style||"normal",this._ready=true;}Object.defineProperties(a.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new e.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new e.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new e.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new e.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},ready:{get(){return !!this._url}},credit:{get(){return this._credit}},readyPromise:{get(){return this._readyPromise.promise}},usingPrecachedTiles:{get(){return this._useTiles}},hasAlphaChannel:{get(){return true}},layers:{get(){return this._layers}}});function r(i,l,s,c,u){var d=i._url+"&x={x}&y={y}&z={z}&customid={style}",m=i._tilingScheme.getNumberOfXTilesAtLevel(c),f=i._tilingScheme.getNumberOfYTilesAtLevel(c);return d=d.replace("{x}",String(l-m/2)).replace("{y}",String(f/2-s-1)).replace("{z}",String(c)).replace("{style}",u),d}a.prototype.getTileCredits=function(i,l,s){},a.prototype.requestImage=function(i,l,s){if(!this.ready)throw new e.DeveloperError("requestImage must not be called before the imagery provider is ready.");var c=r(this,i,l,s,this._style);return e.ImageryProvider.loadImage(this,c)},e.Scene.BaiduImageryProvider=a;}_installGroundSkyBox(){var n=e.BoxGeometry,a=e.Cartesian3,r=e.defaultValue||Re,i=e.defined,l=e.destroyObject,s=e.DeveloperError,c=e.GeometryPipeline,u=e.Matrix3,d=e.Matrix4,m=e.Transforms,f=e.VertexFormat,p=e.BufferUsage,g=e.CubeMap,v=e.DrawCommand,A=e.loadCubeMap,w=e.RenderState,C=e.VertexArray,_=e.BlendingState,P=e.SceneMode,b=e.ShaderProgram,x=e.ShaderSource,T=`uniform samplerCube u_cubeMap;
123
+ `;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:n,uniforms:{fogByDistance:new e.Cartesian4(10,0,200,.3),fogColor:e.Color.AZURE}}))}}setDefSceneConfig(){this._viewer&&(this._viewer.scene.sun.show=false,this._viewer.scene.moon.show=false,this._viewer.scene.fxaa=true,this._viewer.scene.globe.depthTestAgainstTerrain=true,this._viewer.scene.undergroundMode=false,this._viewer.scene.terrainProvider.isCreateSkirt=false,this._viewer.scene.skyAtmosphere.show=false,this._viewer.scene.globe.showGroundAtmosphere=false,this._viewer.scene.globe.enableLighting=true,this._viewer.scene.fog.enabled=false,this._viewer.cesiumWidget.creditContainer.style.display="none");}setBloomLightScene(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=true,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-0.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=false,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=false);}removePostProcessStage(n){n&&(Array.isArray(n)?n.forEach(o=>{this._viewer.scene.postProcessStages.contains(o)&&this._viewer.scene.postProcessStages.remove(o);}):this._viewer.scene.postProcessStages.contains(n)&&this._viewer.scene.postProcessStages.remove(n));}setView(n){if(this._viewer&&n&&n.position){if(n.distance){var o=new e.Cartesian3(0,n.distance,window.opt.distance);n.position=e.Cartesian3.add(n.position,o,new e.Cartesian3);}this._viewer.scene.camera.setView({destination:n.position,orientation:n.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)}});}}flyTo(n){if(this._viewer&&n&&n.position){if(n.distance){var o=new e.Cartesian3(0,n.distance,0);n.position=e.Cartesian3.add(n.position,o,new e.Cartesian3);}this._viewer.scene.camera.flyTo({destination:n.position,orientation:n.orientation||{heading:e.Math.toRadians(90),pitch:e.Math.toRadians(90),roll:e.Math.toRadians(0)},easingFunction:n.easingFunction||e.EasingFunction.LINEAR_NONE,duration:n.duration||3,complete:n.callback});}}transformCartesianToWGS84(n){var o,r,i;if(this._viewer&&n){if(n.x===void 0&&(n.lng!==void 0||n.lon!==void 0))return {lng:Number((o=n.lng)!=null?o:n.lon),lat:Number(n.lat),alt:Number((i=(r=n.alt)!=null?r:n.height)!=null?i:0)};let s=e.Cartographic.fromCartesian(n);return {lng:e.Math.toDegrees(s.longitude),lat:e.Math.toDegrees(s.latitude),alt:s.height}}}transformWGS84ArrayToCartesianArray(n,o){if(this._viewer&&n){var r=this;return n?n.map(function(i){return r.transformWGS84ToCartesian(i,o)}):[]}}transformWGS84ToCartesian(n,o){if(this._viewer)return n?e.Cartesian3.fromDegrees(n.lng||n.lon,n.lat,n.alt=o||n.alt,e.Ellipsoid.WGS84):e.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(n){if(this._viewer){var o=this;return n?n.map(function(r){return o.transformCartesianToWGS84(r)}).filter(function(r){return !!r}):[]}}transformWGS84ToCartographic(n){return n?e.Cartographic.fromDegrees(n.lng||n.lon,n.lat,n.alt):e.Cartographic.ZERO}lnglatArrayToCartesians(n){if(!n||n.length<1)return [];let o=[];for(let r=0;r<n.length;r++){let i=e.Cartesian3.fromDegrees(Number(n[r][0]),Number(n[r][1]),Number(n[r][2]||0));o.push(i);}return o}setCameraEotateHeading(n){if(n){let o=this._viewer,r=e.Cartesian3.fromDegrees(n.lng,n.lat,n.height),i=e.Math.toRadians(-30),s=360/30,l=5e3,c=e.JulianDate.fromDate(new Date);o.clock.startTime=c.clone(),o.clock.currentTime=c.clone(),o.clock.clockRange=e.ClockRange.CLAMPED,o.clock.clockStep=e.ClockStep.SYSTEM_CLOCK;let h=o.camera.heading,d=function(){let y=e.JulianDate.secondsDifference(o.clock.currentTime,o.clock.startTime),p=e.Math.toRadians(y*s)+h;o.scene.camera.setView({destination:r,orientation:{heading:p,pitch:i}}),o.scene.camera.moveBackward(l),e.JulianDate.compare(o.clock.currentTime,o.clock.stopTime)>=0&&o.clock.onTick.removeEventListener(d);};o.clock.onTick.addEventListener(d),oe(this,()=>{o.clock.onTick.removeEventListener(d);});}}getCatesian3FromPX(n){if(this._viewer&&n){var o=this._viewer.scene.pick(n),r=null,i=false,s=false;if(o instanceof e.Cesium3DTileFeature&&(i=true),i&&(r=this._viewer.scene.pickPosition(n),r)){let c=e.Cartographic.fromCartesian(r);c.height<0&&(c.height=0);let h=e.Math.toDegrees(c.longitude),d=e.Math.toDegrees(c.latitude),m=c.height;r=this.transformWGS84ToCartesian({lng:h,lat:d,alt:m});}if(!o){var l=this._viewer.scene.camera.getPickRay(n);if(!l)return null;r=this._viewer.scene.globe.pick(l,this._viewer.scene),s=true;}if(o&&!i&&(r=this._viewer.scene.pickPosition(n),r)){let c=e.Cartographic.fromCartesian(r);c.height<0&&(c.height=0);let h=e.Math.toDegrees(c.longitude),d=e.Math.toDegrees(c.latitude),m=c.height;r=this.transformWGS84ToCartesian({lng:h,lat:d,alt:m});}if(!i&&!s&&!o&&(r=this._viewer.scene.camera.pickEllipsoid(n,this._viewer.scene.globe.ellipsoid)),r){let c=this.transformCartesianToWGS84(r);return c.alt<0&&(r=this.transformWGS84ToCartesian(c,.1)),r}return false}}getCameraPosition(){if(this._viewer){var n=this._viewer.scene.camera.pickEllipsoid(new e.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(n){var o=e.Ellipsoid.WGS84.cartesianToCartographic(n),r=o.longitude*180/Math.PI,i=o.latitude*180/Math.PI,s=this._viewer.camera._direction,l=e.Math.toDegrees(s.x),c=e.Math.toDegrees(s.y),h=e.Math.toDegrees(s.z),d=this._viewer.camera.positionCartographic.height,m=e.Math.toDegrees(this._viewer.camera.heading),y=e.Math.toDegrees(this._viewer.camera.pitch),p=e.Math.toDegrees(this._viewer.camera.roll),g=this._viewer.camera.computeViewRectangle(),v=g.west/Math.PI*180,A=g.north/Math.PI*180,w=g.east/Math.PI*180,C=g.south/Math.PI*180,b=(v+w)/2,P=(A+C)/2;return {lon:r,lat:i,height:d,heading:m,pitch:y,roll:p,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:b,y:P},direction:new e.Cartesian3(l,c,h)}}}}pickUpPosition(n){return this.getCatesian3FromPX(n.position)}getHandlerClickPosition(n){if(this._viewer){let o=this._viewer.scene,r=this._viewer,i=o.camera.pickEllipsoid(n.position,o.globe.elliposid),s={cameraPosistion:r.camera.position,heading:r.camera.heading,pitch:r.camera.pitch,roll:r.camera.roll},l=e.Cartographic.fromCartesian(i);l.height<0&&(l.height=0);let c={alt:l.height,lat:e.Math.toDegrees(l.latitude),lon:e.Math.toDegrees(l.longitude)},h=o.pickPosition(n.position),d=e.Cartographic.fromCartesian(h),m={height:d.height,latitude:e.Math.toDegrees(d.latitude),longitude:e.Math.toDegrees(d.longitude)};return {wgs84Coor:c,graphicCoor:m,cameraPosition:s}}}updateCameraState(n){this._viewer.scene._screenSpaceCameraController.enableRotate=n,this._viewer.scene._screenSpaceCameraController.enableTranslate=n,this._viewer.scene._screenSpaceCameraController.enableZoom=n,this._viewer.scene._screenSpaceCameraController.enableTilt=n,this._viewer.scene._screenSpaceCameraController.enableLook=n;}bindHandleEvent({leftClick:n,mouseMove:o,doubleClick:r,leftDown:i,mouseWheel:s,leftUp:l}){if(this._viewer){var c=new e.ScreenSpaceEventHandler(this._viewer.canvas);oe(this,()=>{c&&!c.isDestroyed()&&c.destroy();}),n&&c.setInputAction(function(h){n(h,c);},e.ScreenSpaceEventType.LEFT_CLICK),o&&c.setInputAction(function(h){o(h,c);},e.ScreenSpaceEventType.MOUSE_MOVE),r&&c.setInputAction(function(h){r(h,c);},e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i&&c.setInputAction(function(h){i(h,c);},e.ScreenSpaceEventType.LEFT_DOWN),s&&c.setInputAction(function(h){s(h,c);},e.ScreenSpaceEventType.WHEEL),l&&c.setInputAction(function(h){l(h,c);},e.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(n){return this.bindHandleEvent(n)}getHandlePosition(n){if(this._viewer){var o=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),r=this;oe(this,()=>{o&&!o.isDestroyed()&&o.destroy();}),o.setInputAction(function(i){var s=r._viewer.scene.camera.pickEllipsoid(i.endPosition,r._viewer.scene.globe.ellipsoid);typeof n=="function"&&n(r.transformCartesianToWGS84(s),o);},e.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(n){return this.getHandlePosition(n)}saveSceneImages(){if(this._viewer){let l=function(c){for(var h=c.split(","),d=h[0].match(/:(.*?);/)[1],m=atob(h[1]),y=m.length,p=new Uint8Array(y);y--;)p[y]=m.charCodeAt(y);return new Blob([p],{type:d})};var n=this._viewer.scene.canvas,o=n.toDataURL("image/png").replace("image/png","image/octet-stream"),r=document.createElement("a"),i=l(o),s=URL.createObjectURL(i);r.download="scene.png",r.href=s,r.click();}}_installAmapImageryProvider(){let n="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",o="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function r(i){return i.url=i.style==="img"?n:o,i.subdomains||(i.subdomains=["01","02","03","04"]),new e.UrlTemplateImageryProvider(i)}e.Scene.AmapImageryProvider=r;}_installTdtImageryProvider(){let n="https://{s}.tianditu.gov.cn/{layer}_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER={layer}&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk={key}";function o(r){return new e.WebMapTileServiceImageryProvider({url:n.replace(/\{layer\}/g,r.style||"vec").replace(/\{key\}/g,r.key||""),layer:r.style+"_w",style:"default",format:"tiles",tileMatrixSetID:"GoogleMapsCompatible",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],minimumLevel:0,maximumLevel:18})}e.Scene.TdtImageryProvider=o;}_installTencentImageryProvider(){let n="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",o="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function r(i){return i.layer==="img"?(i.url||(i.url=n),i.subdomains||(i.subdomains=["0","1","2"]),i.customTags={sx(s,l,c,h){return l>>4},sy(s,l,c,h){return (1<<h)-c>>4}}):i.url||(i.url=o),new e.UrlTemplateImageryProvider(i)}e.Scene.TencentImageryProvider=r;}_installGoogleImageryProvider(){let n="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",o="https://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",r="https://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile";function i(s){return s.url=s.style==="img"?o:s.style==="ter"?r:n,s.subdomains||(s.subdomains=["1","2","3","4","5"]),new e.UrlTemplateImageryProvider(s)}e.Scene.GoogleImageryProvider=i;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var n="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function o(i){n=i.url||n,this._url=n,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new e.WebMercatorTilingScheme({rectangleSouthwestInMeters:new e.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new e.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=i.style||"normal",this._ready=true;}Object.defineProperties(o.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new e.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new e.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new e.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new e.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new e.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},ready:{get(){return !!this._url}},credit:{get(){return this._credit}},readyPromise:{get(){return this._readyPromise.promise}},usingPrecachedTiles:{get(){return this._useTiles}},hasAlphaChannel:{get(){return true}},layers:{get(){return this._layers}}});function r(i,s,l,c,h){var d=i._url+"&x={x}&y={y}&z={z}&customid={style}",m=i._tilingScheme.getNumberOfXTilesAtLevel(c),y=i._tilingScheme.getNumberOfYTilesAtLevel(c);return d=d.replace("{x}",String(s-m/2)).replace("{y}",String(y/2-l-1)).replace("{z}",String(c)).replace("{style}",h),d}o.prototype.getTileCredits=function(i,s,l){},o.prototype.requestImage=function(i,s,l){if(!this.ready)throw new e.DeveloperError("requestImage must not be called before the imagery provider is ready.");var c=r(this,i,s,l,this._style);return e.ImageryProvider.loadImage(this,c)},e.Scene.BaiduImageryProvider=o;}_installGroundSkyBox(){var n=e.BoxGeometry,o=e.Cartesian3,r=e.defaultValue||Be,i=e.defined,s=e.destroyObject,l=e.DeveloperError,c=e.GeometryPipeline,h=e.Matrix3,d=e.Matrix4,m=e.Transforms,y=e.VertexFormat,p=e.BufferUsage,g=e.CubeMap,v=e.DrawCommand,A=e.loadCubeMap,w=e.RenderState,C=e.VertexArray,b=e.BlendingState,P=e.SceneMode,_=e.ShaderProgram,S=e.ShaderSource,I=`uniform samplerCube u_cubeMap;
124
124
  in vec3 v_texCoord;
125
125
  void main()
126
126
  {
127
127
  vec4 color = texture(u_cubeMap, normalize(v_texCoord));
128
128
  out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
129
129
  }
130
- `,S=`in vec3 position;
130
+ `,x=`in vec3 position;
131
131
  out vec3 v_texCoord;
132
132
  uniform mat3 u_rotateMatrix;
133
133
  void main()
@@ -136,7 +136,7 @@ void main(void)
136
136
  gl_Position = czm_projection * vec4(p, 1.0);
137
137
  v_texCoord = position.xyz;
138
138
  }
139
- `,M=typeof d.getRotation=="function"?d.getRotation.bind(d):d.getMatrix3.bind(d);function E(D){this.sources=D.sources,this._sources=void 0,this.show=r(D.show,true),this._command=new v({modelMatrix:d.clone(d.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var I=new u;E.prototype.update=function(D,V){var W=this;if(this.show&&!(D.mode!==P.SCENE3D&&D.mode!==P.MORPHING)&&D.passes.render){var z=D.context;if(this._sources!==this.sources){this._sources=this.sources;var G=this.sources;if(!i(G.positiveX)||!i(G.negativeX)||!i(G.positiveY)||!i(G.negativeY)||!i(G.positiveZ)||!i(G.negativeZ))throw new s("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof G.positiveX!=typeof G.negativeX||typeof G.positiveX!=typeof G.positiveY||typeof G.positiveX!=typeof G.negativeY||typeof G.positiveX!=typeof G.positiveZ||typeof G.positiveX!=typeof G.negativeZ)throw new s("this.sources properties must all be the same type.");typeof G.positiveX=="string"?A(z,this._sources).then(function(O){W._cubeMap=W._cubeMap&&W._cubeMap.destroy(),W._cubeMap=O;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new g({context:z,source:G}));}var X=this._command;if(X.modelMatrix=m.eastNorthUpToFixedFrame(D.camera._positionWC),!i(X.vertexArray)){X.uniformMap={u_cubeMap(){return W._cubeMap},u_rotateMatrix(){return M(X.modelMatrix,I)}};var j=n.createGeometry(n.fromDimensions({dimensions:new a(2,2,2),vertexFormat:f.POSITION_ONLY})),K=this._attributeLocations=c.createAttributeLocations(j);X.vertexArray=C.fromGeometry({context:z,geometry:j,attributeLocations:K,bufferUsage:p._DRAW}),X.renderState=w.fromCache({blending:_.ALPHA_BLEND});}if(!i(X.shaderProgram)||this._useHdr!==V){var R=new x({defines:[V?"HDR":""],sources:[T]});X.shaderProgram=b.fromCache({context:z,vertexShaderSource:S,fragmentShaderSource:R,attributeLocations:this._attributeLocations}),this._useHdr=V;}if(i(this._cubeMap))return X}},E.prototype.isDestroyed=function(){return false},E.prototype.destroy=function(){var D=this._command;return D.vertexArray=D.vertexArray&&D.vertexArray.destroy(),D.shaderProgram=D.shaderProgram&&D.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),l(this)},e.Scene.GroundSkyBox=E;}removeHandlerByName(n=[]){n.forEach(a=>{this._viewer.screenSpaceEventHandler.removeInputAction(e.ScreenSpaceEventType[a]);});}}return y}var ee=re(Zn);function $n(){let e=null;class y{constructor(n,a,r){if(n){e=a,this._viewer=n,this._graphicsLayer=new e.CustomDataSource("graphicsLayer"),this._drawLayer=this._graphicsLayer,n&&n.dataSources.add(this._graphicsLayer);let i=this._graphicsLayer;se(this),ae(this,()=>{this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._graphicsLayer===i&&(this._graphicsLayer=void 0));});}}getPointGraphics(n){if(n=n||{},n)return new e.PointGraphics({color:n.color||e.Color.GREEN,pixelSize:n.pixelSize||5,outlineColor:n.outlineColor||e.Color.WHITE,outlineWidth:n.outlineWidth||1})}getLineGraphics(n){if(n=n||{},n&&n.positions)return new e.PolylineGraphics({show:true,positions:n.positions,material:n.material||e.Color.YELLOW,width:n.width||1,arcType:e.ArcType.GEODESIC,clampToGround:this._objHasOwnProperty(n,"clampToGround",false)})}getPolygonGraphics(n){if(n=n||{},n&&n.positions)return new e.PolygonGraphics({hierarchy:{positions:n.positions},material:n.material||e.Color.RED.withAlpha(.2),clampToGround:n.clampToGround||false})}getLabelGraphics(n){if(n=n||{},n&&n.l_text)return new e.LabelGraphics({text:n.l_text,font:n.l_font||"14px sans-serif",fillColor:n.l_fillColor||e.Color.GOLD,style:n.l_style||e.LabelStyle.FILL_AND_OUTLINE,outlineColor:n.l_outlineColor||e.Color.GOLD,outlineWidth:n.l_outlineWidth||2,showBackground:n.l_showBackground||false,backgroundColor:n.l_backgroundColor||new e.Color(.165,.165,.165,.8),verticalOrigin:n.l_verticalOrigin||e.VerticalOrigin.BOTTOM,pixelOffset:n.l_pixelOffset||new e.Cartesian2(0,-30),heightReference:n.l_heightReference!=null?n.l_heightReference:e.HeightReference.NONE})}getBillboardGraphics(n){if(n=n||{},n&&n.b_img)return new e.BillboardGraphics({image:n.b_img,width:n.b_width||35,height:n.b_height||35,clampToGround:n.b_clampToGround||true,scale:n.b_scale||1,eyeOffset:n.b_eyeOffset!=null?n.b_eyeOffset:e.Cartesian3.ZERO,pixelOffset:n.b_pixelOffset||new e.Cartesian2(0,-20),scaleByDistance:n.b_scaleByDistance||void 0,heightReference:n.b_heightReference!=null?n.b_heightReference:e.HeightReference.NONE})}getPathGraphics(n){if(n=n||{},n)return new e.PathGraphics({resolution:n.resolution||1,material:new e.PolylineGlowMaterialProperty({glowPower:n.glowPower||.1,color:n.color||e.Color.YELLOW}),width:n.width||30})}getModelGraphics(n){if(n=n||{},n)return new e.ModelGraphics({uri:n.m_url||n.url,scale:n.m_scale||n.scale||10,clampAnimations:true})}getEllipseGraphics(n){if(n=n||{},n)return new e.EllipseGraphics({semiMajorAxis:n.e_semiMajorAxis||1e6,semiMinorAxis:n.e_semiMinorAxis||1e6,metarial:n.e_metarial||e.Color.RED.withAlpha(.5),outline:this._objHasOwnProperty(n,"e_outline",true)})}getEllipsoidGraphics(n){if(n=n||{},n){var a=n.radii||1e6;return new e.EllipsoidGraphics({radii:new e.Cartesian3(a,a,a),innerRadii:this._objHasOwnProperty(n,"innerRadii",new e.Cartesian3(a/1.5,a/1.5,a/1.5)),maximumCone:n.maximumCone||e.Math.PI_OVER_TWO,stackPartitions:n.stackPartitions||56,slicePartitions:n.slicePartitions||56,outlineWidth:n.outlineWidth||2,outlineColor:n.outlineColor||e.Color.YELLOW,outline:this._objHasOwnProperty(n,"outline",true),fill:this._objHasOwnProperty(n,"fill",true),material:n.material||e.Color.RED.withAlpha(.1)})}}getBoxGraphics(n){if(n=n||{},n)return new e.BoxGraphics({show:this._objHasOwnProperty(n,"show",true),fill:this._objHasOwnProperty(n,"fill",true),dimensions:n.dimensions||new e.Cartesian3(0,0,0),material:n.material,outline:this._objHasOwnProperty(n,"outline",true),outlineColor:n.outlineColor||e.Color.BLACK,distanceDisplayCondition:n.distanceDisplayCondition||void 0})}getPlaneGraphics(n){if(n=n||{},n)return new e.PlaneGraphics({plane:n.plane||new e.Plane(e.Cartesian3.UNIT_Y,0),dimensions:n.dimensions||new e.Cartesian2(170,130),material:n.material||e.Color.BLUE})}getCylinderGraphics(n){if(n=n||{},n)return new e.CylinderGraphics({HeightReference:e.HeightReference.RELATIVE_TO_GROUND,length:n.length||500/2,topRadius:n.topRadius||0,bottomRadius:n.bottomRadius||0,material:n.material||new e.Color(0,1,1,.4),slices:n.slices||128})}createPointsGraphics(n){if(n&&n.positions){let a=[];for(let r in n.positions){let i=n.positions[r],l=this.createGraphics();l.name=n.name||"",l.oid=n.oid||"point",l.position=i,n.point&&(l.point=this.getPointGraphics()),n.billboard&&(l.billboard=this.getBillboardGraphics(n.billboard)),n.label&&(l.label=this.getLabelGraphics(n.label)),a.push(this._graphicsLayer.entities.add(l));}return a}}createLineGraphics(n){if(n&&n.positions){var a=this.createGraphics();return a.name=n.name||"",a.oid=n.oid||"line",a.position=n.positions,a.polyline=this.getLineGraphics(n),this._graphicsLayer.entities.add(a)}}createPolygonGraphics(n){if(n=n||{},n){var a=this.createGraphics();return a.polygon=this.getPolygonGraphics(n),a.clampToS3M=this._objHasOwnProperty(n,"clampToS3M",false),this._graphicsLayer.entities.add(a)}}createBoxGraphics(n){if(n=n||{},n){var a=this.createGraphics();return a.position=n.position,a.name=n.name||"box_graphic",a.box=this.getBoxGraphics(n.box),this._graphicsLayer.entities.add(a)}}createModelGraphics(n){if(n&&n.position){var a=this.createGraphics();return a.model=this.getModelGraphics(n),a.position=n.position,this._graphicsLayer.entities.add(a)}}craeteCorridorGraphics(n){if(n&&n.positions){let{positions:r,height:i,width:l,material:s,...c}=n;var a=this.createGraphics();return i=i===void 0?6:i,l=l===void 0?15:l,a.corridor={positions:r,height:i,width:l,...c,material:s||new e.Scene.WarnLinkMaterialProperty({freely:"cross",color:e.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(a)}}craeteDynamicPolyLineGraphics(n){if(n&&n.positions){var a=this.createGraphics();return a.polyline={show:true,positions:[],material:n.material||e.Color.CHARTREUSE,width:n.width||5,clampToGround:this._objHasOwnProperty(n,"clampToGround",false)},a.polyline.positions=new e.CallbackProperty(function(){return n.positions},false),this._graphicsLayer.entities.add(a)}}craeteDynamicCylinderGraphics(n){var a={};if(n&&n.cylinder){var r=n.entity,i=n.cylinder,l=this;return a.cylinder=this.getCylinderGraphics(i),a.position=new e.CallbackProperty(function(){var s=r.position.getValue(l._viewer.clock.currentTime),c=l._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),u=e.Math.toDegrees(c.latitude),d=e.Math.toDegrees(c.longitude);return e.Cartesian3.fromDegrees(d,u,0)},false),a.cylinder.length=new e.CallbackProperty(function(){var s=r.position.getValue(l._viewer.clock.currentTime),c=l._viewer.scene.globe.ellipsoid.cartesianToCartographic(s);return c.height*2},false),a}}createFadeCylinderGraphics(n){if(n=n||{},n&&n.position){let a=this.createGraphics();return a.position=n.position,n.material=new e.Scene.CircleFadeMaterialProperty({color:n.color||e.Color.fromCssColorString("#02ff00"),duration:n.duration||2e3}),a.cylinder=this.getCylinderGraphics(n),this._drawLayer.entities.add(a)}}craeteRotateCylinderGraphics(n){if(n&&n.position){var a=this.createGraphics();return a.cylinder={HeightReference:e.HeightReference.RELATIVE_TO_GROUND,length:n.length||500,topRadius:n.topRadius||500,bottomRadius:n.bottomRadius||500,material:n.material||new e.ImageMaterialProperty({image:n.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:true,repeat:{x:1,y:-1}}),slices:n.slices||128},a.position=n.position,this.setGraphicsRotate({entity:a,position:this.transformCartesianToWGS84(n.position),rotateAmount:4}),this._graphicsLayer.entities.add(a)}}craeteDynamicBlinkCircleGraphics(n){if(n&&n.position){var a=this.createGraphics(),r=n.alp||1,i=this._objHasOwnProperty(n,"flog",true);return a.position=n.position,a.ellipse={semiMinorAxis:n.semiMinorAxis||2e3,semiMajorAxis:n.semiMajorAxis||2e3,height:n.height||10,material:new e.ColorMaterialProperty(new e.CallbackProperty(function(){return i?(r=r-.05,r<=0&&(i=false)):(r=r+.05,r>=1&&(i=true)),e.Color.RED.withAlpha(r)},false))},this._graphicsLayer.entities.add(a)}}craeteDynamicCricleGraphics(n){var C,_;if(n&&n.center){var a=this.createGraphics(),r=this,i=n.center,l=n.radius||800,s=n.rotateAmount||.05,c=0,u=n.height||1,d=0,m=0,f=0,p=(C=n.scale)!=null?C:0,g=(_=n.scale2)!=null?_:0,v=n.material||new e.ImageMaterialProperty({image:n.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:true});a.position=new e.CallbackProperty(function(){return r.transformWGS84ToCartesian(i)},false),a.orientation=new e.CallbackProperty(function(){return e.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(i),new e.HeadingPitchRoll(e.Math.toRadians(d),e.Math.toRadians(m),e.Math.toRadians(f)))},false);let P=l,b=false;var A=()=>{(l>=p||l<=P)&&(b=!b),b?l+=2:l-=2;},w=()=>{g>=l?l+=2:l=P;};return a.ellipse={material:v,height:u,semiMajorAxis:new e.CallbackProperty(function(){return l},false),semiMinorAxis:new e.CallbackProperty(function(){return l},false),stRotation:new e.CallbackProperty(function(){return s>0&&(c+=s,c>=360&&(c=0)),p&&A(),g&&w(),c},false)},this._graphicsLayer.entities.add(a)}}craeteDynamicShadeWallGraphics(n){if(n&&n.positions){var a=n.alp||1,r=n.num||20,i=n.color||e.Color.RED,l=n.speed||.003,s=this.createGraphics();return s.wall={positions:n.positions,material:new e.ImageMaterialProperty({image:n.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:true,color:new e.CallbackProperty(function(){return r%2===0?a-=l:a+=l,(a<=.1||a>=1)&&r++,i.withAlpha(a)},false)})},this._graphicsLayer.entities.add(s)}}createCustomDefBillboardGraphics(n){if(n&&n.position){var a=this,r=document.createElement("img");r.src=n.image||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";let i=function(l){if(l.image){var s=document.createElement("canvas");s.width=l.width||150,s.height=l.height||80;var c=s.getContext("2d");c.drawImage(l.image,0,0);var u=l.text;return c.font="15px bold \u5B8B\u4F53",c.fillStyle="#f4fff0",c.fillText(u,55,36),s}};r.onload=function(){n.image=r;var l=a._graphicsLayer.entities.add({position:n.position,billboard:{image:i(n),scaleByDistance:new e.NearFarScalar(150,.7,15e6,.5),verticalOrigin:e.VerticalOrigin.BOTTOM,pixelOffset:n.b_pixelOffset||new e.Cartesian2(80,-35),width:140,height:100,scale:n.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});typeof n.callback=="function"&&n.callback(l);};}}craeteRotatePlaneGraphics(n){if(n&&n.center&&n.positions){var a=this.createGraphics(),r=0,i=n.positions,l=i[0];return a.position=new e.CallbackProperty(function(){return r==0?(l=i[0],r+=1):r<i.length-1?(l=i[r],r+=1):r==i.length-1&&(l=i[r],r=0),l},false),a.plane={plane:new e.Plane(e.Cartesian3.UNIT_Y,0),dimensions:n.dimensions||new e.Cartesian2(200,150),material:new e.ImageMaterialProperty({image:n.image})},this._graphicsLayer.entities.add(a)}}createVideoPlaneGraphics(n){if(n&&n.position){var a=this.createGraphics();return a.position=n.position,a.plane={plane:new e.Plane(n.normal||e.Cartesian3.UNIT_Y,0),dimensions:n.dimensions||new e.Cartesian2(200,150),material:new e.ImageMaterialProperty({image:n.videoElement})},this._graphicsLayer.entities.add(a)}}async createGifBillboardGraphics(n){let a=await $t();if(n&&n.position){var r=[],i=n.url,l=0,s=6;return function(u,d){var m=document.createElement("img");m.src=u,m.setAttribute("rel:animated_src",u),m.setAttribute("rel:auto_play","0"),document.body.appendChild(m);var f=new a({gif:m});return new Promise(p=>{f.load(()=>{for(let g=1;g<=f.get_length();g++)f.move_to(g),d.push(f.get_canvas().toDataURL());p(d);});})}(i,r),this._graphicsLayer.entities.add({position:n.position,billboard:{verticalOrigin:e.VerticalOrigin.BASELINE,image:new e.CallbackProperty(function(){return r.length?(l<s*(r.length-1)?l++:l=0,r[Math.floor(l/s)]):i},false),scale:.2}})}}setGraphicsRotate(n){if(n&&n.entity&&n.rotateAmount){var a=n.entity,r=n.rotateAmount,i=n.position,l=this;i.heading=0,i.pitch=0,i.roll=0,a.position=new e.CallbackProperty(function(){return l.transformWGS84ToCartesian(i)},false),a.orientation=new e.CallbackProperty(function(){return r>0&&(i.heading+=r,i.heading===360&&(i.heading=0)),e.Transforms.headingPitchRollQuaternion(l.transformWGS84ToCartesian(i),new e.HeadingPitchRoll(e.Math.toRadians(i.heading),e.Math.toRadians(i.pitch),e.Math.toRadians(i.roll)))},false);}}setGraphicsFloat(n){if(n&&n.entity&&n.maxHeiht)try{var a=n.entity,r=n.minHeiht||5,i=n.maxHeiht||100,l=n.cartesians,s=n.speed||.06,c=this,u=r,d=!1;l.length?a.positions=new e.CallbackProperty(function(){var m=c.transformCartesianArrayToWGS84Array(l);for(var f in m){var p=m[f];(r>=i||r<=u)&&(d=!d),d?r+=s:r-=s,p.alt=r;}return c.transformWGS84ArrayToCartesianArray(m,0)},!1):a.position=new e.CallbackProperty(function(){var m=c.transformCartesianToWGS84(l);return (r>=i||r<=u)&&(d=!d),d?r+=s:r-=s,m.alt=r,c.transformWGS84ToCartesian(m)},!1);}catch(m){console.log(m);}}createCanvasGraphics(n){if(n&&n.positions){let a=function(){var r=0,i=document.createElement("canvas"),l=i.getContext("2d"),s=new Image;s.src=n.img||"../../images/ysCesium/logo.png";let c=n.cwidth||0;if(l.clearRect(0,0,c,n.cheight||0),r<=c)l.drawImage(s,r,0);else return r=0,r+=3,i};this._graphicsLayer.entities.add({rectangle:{coordinates:n.positions,material:new e.ImageMaterialProperty({image:new e.CallbackProperty(a,false),transparent:true})}}),typeof n.callback=="function"&&n.callback();}}createFanShape({viewer:n,longitude:a,latitude:r,alt:i,custMaterial:l,speed:s=0,direction:c="+"}){if(n){var u=this.createGraphics(),d=0,m=this._calcPoints(a,r,i,d);u.wall={positions:new e.CallbackProperty(()=>e.Cartesian3.fromDegreesArrayHeights(m),false),material:l||e.Color.AQUAMARINE.withAlpha(.5)};let f=()=>{s>0&&(d+=s,m=this._calcPoints(a,r,i,Number(c+d)));};return n.clock.onTick.addEventListener(f),ae(this,()=>{n.clock.onTick.removeEventListener(f);}),this._graphicsLayer.entities.add(u)}}_computeCirclularFlight(n,a,r,i,l,s){let c=[];c.push(n),c.push(a),c.push(0);var u=e.Cartesian3.distance(e.Cartesian3.fromDegrees(n,a),e.Cartesian3.fromDegrees(r,i));for(let d=l;d<=l+s;d++){let m=u*Math.sin(d*Math.PI/180),f=Math.cos(d*Math.PI/180),p=(r-n)*f+n,g=(i-a)*f+a;c.push(p),c.push(g),c.push(m);}return c}_objHasOwnProperty(n,a,r){let i=n;return i&&i.hasOwnProperty(a)?i[a]:r}_calcPoints(n,a,r,i){var l=e.Transforms.eastNorthUpToFixedFrame(e.Cartesian3.fromDegrees(n,a)),s=r*Math.cos(i*Math.PI/180),c=r*Math.sin(i*Math.PI/180),u=e.Cartesian3.fromElements(s,c,0),d=e.Matrix4.multiplyByPoint(l,u,new e.Cartesian3),m=e.Cartographic.fromCartesian(d),f=e.Math.toDegrees(m.longitude),p=e.Math.toDegrees(m.latitude);return this._computeCirclularFlight(n,a,f,p,0,90)}createCorridorGraphics(n){return this.craeteCorridorGraphics(n)}createDynamicPolyLineGraphics(n){return this.craeteDynamicPolyLineGraphics(n)}createDynamicCylinderGraphics(n){return this.craeteDynamicCylinderGraphics(n)}createRotateCylinderGraphics(n){return this.craeteRotateCylinderGraphics(n)}createDynamicBlinkCircleGraphics(n){return this.craeteDynamicBlinkCircleGraphics(n)}createDynamicCircleGraphics(n){return this.craeteDynamicCricleGraphics(n)}createDynamicShadeWallGraphics(n){return this.craeteDynamicShadeWallGraphics(n)}createRotatePlaneGraphics(n){return this.craeteRotatePlaneGraphics(n)}createGraphics(){return new e.Entity}}return y}var ye=re($n);function er(){let e=null;class y{constructor(n,a,r){n&&(e=a,this._installMaterial());}_installMaterial(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial(),this._installPolylineTrailLinkMaterial();}addMaterialLineGraphics(n){if(this._viewer&&n&&n.image){var a=this.createGraphics();return a.polyline={positions:n.positions,material:new e.PolylineCustomMaterialProperty({color:n.color||e.Color.RED,duration:n.duration||500}),width:n.width},this._viewer.entities.add(a)}}getCustomMaterialLine(n){if(this._viewer&&n&&n.image)return this._initPolylineCustomMaterialProperty(n)}_initPolylineCustomMaterialProperty(n){if(n){var a=e.Color,r=e.defaultValue,i=e.defined,l=Object.defineProperties,s=e.Event,c=e.createPropertyDescriptor,u=e.Property,d=e.Material,m=a.WHITE,f=n.MaterialType||"wallType"+parseInt(String(Math.random()*1e3));let p=function(g){g=r(g,r.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this.color=g.color||e.Color.BLUE,this.duration=g.duration||1e3,this._time=void 0;};return l(p.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:c("color")}),p.prototype.getType=function(){return f},p.prototype.getValue=function(g,v){return i(v)||(v={}),v.color=u.getValueOrClonedDefault(this._color,g,m,v.color),v.image=n.image,this._time===void 0&&(this._time=g.secondsOfDay),v.time=(g.secondsOfDay-this._time)*1e3/this.duration,v},p.prototype.equals=function(g){return this===g||g instanceof p&&u.equals(this._color,g._color)},d._materialCache.addMaterial(f,{fabric:{type:f,uniforms:{color:n.color||new e.Color(1,0,0,.5),image:n.image,time:n.time||0},source:this._getDynamicLineShader({get:true})},translucent:function(){return true}}),new p(n)}}addMaterialWallGraphics(n){if(this._viewer&&n&&n.image){var a=this.createGraphics();return a.wall={positions:n.positions,material:this.getCustomMaterialWall(n),width:n.width},this._viewer.entities.add(a)}}getCustomMaterialWall(n){if(this._viewer&&n&&n.image)return this._initWallCustomMaterialProperty(n)}_initWallCustomMaterialProperty(n){var a=e.Color,r=e.defaultValue,i=e.defined,l=Object.defineProperties,s=e.Event,c=e.createPropertyDescriptor,u=e.Property,d=e.Material,m=n.MaterialType||"wallType"+parseInt(String(Math.random()*1e3));let f=function(p){p=r(p,r.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this.color=p.color||a.BLUE,this.duration=p.duration||3e3,this._time=new Date().getTime();};return l(f.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:c("color")}),f.prototype.getType=function(){return m},f.prototype.getValue=function(p,g){return i(g)||(g={}),g.color=u.getValueOrClonedDefault(this._color,p,a.WHITE,g.color),g.image=n.image,g.time=(new Date().getTime()-this._time)%this.duration/this.duration,g},f.prototype.equals=function(p){return this===p||p instanceof f&&u.equals(this._color,p._color)},d._materialCache.addMaterial(m,{fabric:{type:m,uniforms:{color:new a(1,0,0,.5),image:n.image,time:0},source:this._getDirectionWallShader({get:true,count:n.count,freely:n.freely,direction:n.direction})},translucent:function(){return true}}),new f(n)}_installWaveCircleMaterial(){var n=this,a=e.Color,r=e.defaultValue,i=Object.defineProperties,l=e.Event,s=e.Property,c=e.Material;function u(d){d=d||{},this._definitionChanged=new l,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=r(d.color,a.fromBytes(0,255,255,255)),this.duration=r(d.duration,45),this.count=Math.max(r(d.count,2),1),this.gradient=r(d.gradient,.1),this.gradient<0?this.gradient=0:this.gradient>1&&(this.gradient=1);}i(u.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),u.prototype.getType=function(){return c.CircleWaveType},u.prototype.getValue=function(d,m){return m||(m={}),m.color=s.getValueOrUndefined(this._color,d),m.duration=this._duration,m.count=this.count,m.gradient=this.gradient,m},u.prototype.equals=function(d){return this===d||d instanceof u&&s.equals(this._color,d._color)},i(u.prototype,{color:e.createPropertyDescriptor("color"),duration:e.createPropertyDescriptor("duration")}),e.Scene.CircleWaveMaterialProperty=u,c.CircleWaveType="CircleWave",c._materialCache.addMaterial(c.CircleWaveType,{fabric:{type:c.CircleWaveType,uniforms:{color:new a(1,0,0,.7),duration:45,count:1,gradient:.1},source:n._getDynamicCircleShader({get:true})},translucent:function(){return true}});}_installCircleFadeMaterial(){var n=e.Color,a=e.defaultValue,r=Object.defineProperties,i=e.Event,l=e.Property,s=e.Material,c=new n(0,0,0,0);function u(d){d=a(d,a.EMPTY_OBJECT),this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=a(d.color,c),this._duration=d.duration||1e3,this._time=void 0;}r(u.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),u.prototype.getType=function(){return s.CircleFadeMaterialType},u.prototype.getValue=function(d,m){return m||(m={}),m.color=l.getValueOrClonedDefault(this._color,d,c,m.color),this._time===void 0&&(this._time=new Date().getTime()),m.time=(new Date().getTime()-this._time)/this._duration,m},u.prototype.equals=function(d){return this===d||d instanceof u&&l.equals(this._color,d._color)},r(u.prototype,{color:e.createPropertyDescriptor("color")}),e.Scene.CircleFadeMaterialProperty=u,s.CircleFadeMaterialType="CircleFadeMaterial",s._materialCache.addMaterial(s.CircleFadeMaterialType,{fabric:{type:s.CircleFadeMaterialType,uniforms:{color:new n(1,0,0,1),time:1},source:this._getCircleFadeShader({get:true})},translucent:function(){return true}});}_installCityLineMaterial(){var n=e.Color,a=e.defaultValue,r=e.defined,i=Object.defineProperties,l=e.Event,s=e.createPropertyDescriptor,c=e.Property,u=e.Material,d=n.WHITE;function m(f){f=a(f,a.EMPTY_OBJECT),this._definitionChanged=new l,this._color=void 0,this._colorSubscription=void 0,this.color=f.color||e.Color.BLUE,this.duration=f.duration||1e3,this._time=void 0,this._img=f.imgUrl||u.PolylineCityLinkImage;}i(m.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:s("color")}),m.prototype.getType=function(){return u.PolylineCityLinkType},m.prototype.getValue=function(f,p){return r(p)||(p={}),p.color=c.getValueOrClonedDefault(this._color,f,d,p.color),p.image=this._img,this._time===void 0&&(this._time=f.secondsOfDay),p.time=(f.secondsOfDay-this._time)*1e3/this.duration,p},m.prototype.equals=function(f){return this===f||f instanceof m&&c.equals(this._color,f._color)},e.Scene.PolylineCityLinkMaterialProperty=m,u.PolylineCityLinkType="PolylineCityLink",u.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",u._materialCache.addMaterial(u.PolylineCityLinkType,{fabric:{type:u.PolylineCityLinkType,uniforms:{color:new n(1,0,0,1),image:u.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:true})},translucent:function(){return true}});}_installWarnMaterial(){var n=e.Color,a=e.defaultValue,r=e.defined,i=Object.defineProperties,l=e.Event,s=e.createPropertyDescriptor,c=e.Property,u=e.Material;function d(m){m=a(m,a.EMPTY_OBJECT),this._definitionChanged=new l,this._color=void 0,this._colorSubscription=void 0,this.color=m.color||n.BLUE,this.duration=m.duration||3e3,this._time=new Date().getTime();}i(d.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),d.prototype.getType=function(){return u.WarnLinkType},d.prototype.getValue=function(m,f){return r(f)||(f={}),f.color=c.getValueOrClonedDefault(this._color,m,n.WHITE,f.color),f.image=u.WarnLinkImage,f.time=(new Date().getTime()-this._time)%this.duration/this.duration,f},d.prototype.equals=function(m){return this===m||m instanceof d&&c.equals(this._color,m._color)},i(d.prototype,{color:s("color")}),e.Scene.WarnLinkMaterialProperty=d,u.WarnLinkType="WarnWallLinkType",u.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",u._materialCache.addMaterial(u.WarnLinkType,{fabric:{type:u.WarnLinkType,uniforms:{color:new n(1,0,0,.5),image:u.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:true,count:10,freely:"cross",direction:"-"})},translucent:function(){return true}});}_installFlowMaterial(){var n=e.Color,a=e.defaultValue,r=Object.defineProperties,i=e.Event,l=e.createPropertyDescriptor,s=e.Property,c=e.Material;function u(d){d=a(d,a.EMPTY_OBJECT),this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=d.color||n.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=a(d.duration,45);}r(u.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),u.prototype.getType=function(){return c.PolylineFlowType},u.prototype.getValue=function(d,m){return m||(m={}),m.color=s.getValueOrClonedDefault(this._color,d,e.Color.WHITE,m.color),m.duration=this._duration,m},u.prototype.equals=function(d){return this===d||d instanceof u&&s.equals(this._color,d._color)},r(u.prototype,{color:l("color"),duration:l("duration")}),e.Scene.PolylineFlowMaterialProperty=u,c.PolylineFlowType="PolylineFlow",c._materialCache.addMaterial(c.PolylineFlowType,{fabric:{type:c.PolylineFlowType,uniforms:{color:new n(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:true})},translucent:function(){return true}});}_installPolylineTrailLinkMaterial(){var n=e.Color,a=e.defaultValue,r=Object.defineProperties,i=e.createPropertyDescriptor,l=e.Event,s=e.Property,c=e.Material,u=this.getDfSt(["primitive","WaterPrimitive"]);function d(m){m=a(m,a.EMPTY_OBJECT),this._definitionChanged=new l,this._color=void 0,this.color=m.color||e.Color.WHITE,this.image=m.image||u,this._colorSubscription=void 0,this.duration=m.duration||3e3,this._time=new Date().getTime(),this.speed=m.speed,this.isTranslucent=function(){return true};}r(d.prototype,{isConstant:{get:function(){return false},configurable:true},definitionChanged:{get:function(){return this._definitionChanged},configurable:true},color:i("color"),duration:i("duration")}),d.prototype.getType=function(){return c.PolylineTrailLinkType},d.prototype.getValue=function(m,f){return e.defined(f)||(f={}),f.color=s.getValueOrClonedDefault(this._color,m,this.color,f.color),f.image=c.PolylineTrailLinkImage,f.time=(new Date().getTime()-this._time)%this.duration/this.duration*this.speed,f},d.prototype.equals=function(m){return this===m||m instanceof d&&s.equals(this._color,m._color)},c.PolylineTrailLinkSource=`
139
+ `,M=typeof d.getRotation=="function"?d.getRotation.bind(d):d.getMatrix3.bind(d);function T(R){this.sources=R.sources,this._sources=void 0,this.show=r(R.show,true),this._command=new v({modelMatrix:d.clone(d.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var E=new h;T.prototype.update=function(R,O){var U=this;if(this.show&&!(R.mode!==P.SCENE3D&&R.mode!==P.MORPHING)&&R.passes.render){var z=R.context;if(this._sources!==this.sources){this._sources=this.sources;var V=this.sources;if(!i(V.positiveX)||!i(V.negativeX)||!i(V.positiveY)||!i(V.negativeY)||!i(V.positiveZ)||!i(V.negativeZ))throw new l("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof V.positiveX!=typeof V.negativeX||typeof V.positiveX!=typeof V.positiveY||typeof V.positiveX!=typeof V.negativeY||typeof V.positiveX!=typeof V.positiveZ||typeof V.positiveX!=typeof V.negativeZ)throw new l("this.sources properties must all be the same type.");typeof V.positiveX=="string"?A(z,this._sources).then(function(G){U._cubeMap=U._cubeMap&&U._cubeMap.destroy(),U._cubeMap=G;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new g({context:z,source:V}));}var j=this._command;if(j.modelMatrix=m.eastNorthUpToFixedFrame(R.camera._positionWC),!i(j.vertexArray)){j.uniformMap={u_cubeMap(){return U._cubeMap},u_rotateMatrix(){return M(j.modelMatrix,E)}};var H=n.createGeometry(n.fromDimensions({dimensions:new o(2,2,2),vertexFormat:y.POSITION_ONLY})),q=this._attributeLocations=c.createAttributeLocations(H);j.vertexArray=C.fromGeometry({context:z,geometry:H,attributeLocations:q,bufferUsage:p._DRAW}),j.renderState=w.fromCache({blending:b.ALPHA_BLEND});}if(!i(j.shaderProgram)||this._useHdr!==O){var k=new S({defines:[O?"HDR":""],sources:[I]});j.shaderProgram=_.fromCache({context:z,vertexShaderSource:x,fragmentShaderSource:k,attributeLocations:this._attributeLocations}),this._useHdr=O;}if(i(this._cubeMap))return j}},T.prototype.isDestroyed=function(){return false},T.prototype.destroy=function(){var R=this._command;return R.vertexArray=R.vertexArray&&R.vertexArray.destroy(),R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),s(this)},e.Scene.GroundSkyBox=T;}removeHandlerByName(n=[]){n.forEach(o=>{this._viewer.screenSpaceEventHandler.removeInputAction(e.ScreenSpaceEventType[o]);});}}return f}var ee=re(or);function sr(){let e=null;class f{constructor(n,o,r){if(n){e=o,this._viewer=n,this._graphicsLayer=new e.CustomDataSource("graphicsLayer"),this._drawLayer=this._graphicsLayer,n&&n.dataSources.add(this._graphicsLayer);let i=this._graphicsLayer;se(this),oe(this,()=>{this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._graphicsLayer===i&&(this._graphicsLayer=void 0));});}}getPointGraphics(n){if(n=n||{},n)return new e.PointGraphics({color:n.color||e.Color.GREEN,pixelSize:n.pixelSize||5,outlineColor:n.outlineColor||e.Color.WHITE,outlineWidth:n.outlineWidth||1})}getLineGraphics(n){if(n=n||{},n&&n.positions)return new e.PolylineGraphics({show:true,positions:n.positions,material:n.material||e.Color.YELLOW,width:n.width||1,arcType:e.ArcType.GEODESIC,clampToGround:this._objHasOwnProperty(n,"clampToGround",false)})}getPolygonGraphics(n){if(n=n||{},n&&n.positions)return new e.PolygonGraphics({hierarchy:{positions:n.positions},material:n.material||e.Color.RED.withAlpha(.2),clampToGround:n.clampToGround||false})}getLabelGraphics(n){if(n=n||{},n&&n.l_text)return new e.LabelGraphics({text:n.l_text,font:n.l_font||"14px sans-serif",fillColor:n.l_fillColor||e.Color.GOLD,style:n.l_style||e.LabelStyle.FILL_AND_OUTLINE,outlineColor:n.l_outlineColor||e.Color.GOLD,outlineWidth:n.l_outlineWidth||2,showBackground:n.l_showBackground||false,backgroundColor:n.l_backgroundColor||new e.Color(.165,.165,.165,.8),verticalOrigin:n.l_verticalOrigin||e.VerticalOrigin.BOTTOM,pixelOffset:n.l_pixelOffset||new e.Cartesian2(0,-30),heightReference:n.l_heightReference!=null?n.l_heightReference:e.HeightReference.NONE})}getBillboardGraphics(n){if(n=n||{},n&&n.b_img)return new e.BillboardGraphics({image:n.b_img,width:n.b_width||35,height:n.b_height||35,clampToGround:n.b_clampToGround||true,scale:n.b_scale||1,eyeOffset:n.b_eyeOffset!=null?n.b_eyeOffset:e.Cartesian3.ZERO,pixelOffset:n.b_pixelOffset||new e.Cartesian2(0,-20),scaleByDistance:n.b_scaleByDistance||void 0,heightReference:n.b_heightReference!=null?n.b_heightReference:e.HeightReference.NONE})}getPathGraphics(n){if(n=n||{},n)return new e.PathGraphics({resolution:n.resolution||1,material:new e.PolylineGlowMaterialProperty({glowPower:n.glowPower||.1,color:n.color||e.Color.YELLOW}),width:n.width||30})}getModelGraphics(n){if(n=n||{},n)return new e.ModelGraphics({uri:n.m_url||n.url,scale:n.m_scale||n.scale||10,clampAnimations:true})}getEllipseGraphics(n){if(n=n||{},n)return new e.EllipseGraphics({semiMajorAxis:n.e_semiMajorAxis||1e6,semiMinorAxis:n.e_semiMinorAxis||1e6,metarial:n.e_metarial||e.Color.RED.withAlpha(.5),outline:this._objHasOwnProperty(n,"e_outline",true)})}getEllipsoidGraphics(n){if(n=n||{},n){var o=n.radii||1e6;return new e.EllipsoidGraphics({radii:new e.Cartesian3(o,o,o),innerRadii:this._objHasOwnProperty(n,"innerRadii",new e.Cartesian3(o/1.5,o/1.5,o/1.5)),maximumCone:n.maximumCone||e.Math.PI_OVER_TWO,stackPartitions:n.stackPartitions||56,slicePartitions:n.slicePartitions||56,outlineWidth:n.outlineWidth||2,outlineColor:n.outlineColor||e.Color.YELLOW,outline:this._objHasOwnProperty(n,"outline",true),fill:this._objHasOwnProperty(n,"fill",true),material:n.material||e.Color.RED.withAlpha(.1)})}}getBoxGraphics(n){if(n=n||{},n)return new e.BoxGraphics({show:this._objHasOwnProperty(n,"show",true),fill:this._objHasOwnProperty(n,"fill",true),dimensions:n.dimensions||new e.Cartesian3(0,0,0),material:n.material,outline:this._objHasOwnProperty(n,"outline",true),outlineColor:n.outlineColor||e.Color.BLACK,distanceDisplayCondition:n.distanceDisplayCondition||void 0})}getPlaneGraphics(n){if(n=n||{},n)return new e.PlaneGraphics({plane:n.plane||new e.Plane(e.Cartesian3.UNIT_Y,0),dimensions:n.dimensions||new e.Cartesian2(170,130),material:n.material||e.Color.BLUE})}getCylinderGraphics(n){if(n=n||{},n)return new e.CylinderGraphics({HeightReference:e.HeightReference.RELATIVE_TO_GROUND,length:n.length||500/2,topRadius:n.topRadius||0,bottomRadius:n.bottomRadius||0,material:n.material||new e.Color(0,1,1,.4),slices:n.slices||128})}createPointsGraphics(n){if(n&&n.positions){let o=[];for(let r in n.positions){let i=n.positions[r],s=this.createGraphics();s.name=n.name||"",s.oid=n.oid||"point",s.position=i,n.point&&(s.point=this.getPointGraphics()),n.billboard&&(s.billboard=this.getBillboardGraphics(n.billboard)),n.label&&(s.label=this.getLabelGraphics(n.label)),o.push(this._graphicsLayer.entities.add(s));}return o}}createLineGraphics(n){if(n&&n.positions){var o=this.createGraphics();return o.name=n.name||"",o.oid=n.oid||"line",o.position=n.positions,o.polyline=this.getLineGraphics(n),this._graphicsLayer.entities.add(o)}}createPolygonGraphics(n){if(n=n||{},n){var o=this.createGraphics();return o.polygon=this.getPolygonGraphics(n),o.clampToS3M=this._objHasOwnProperty(n,"clampToS3M",false),this._graphicsLayer.entities.add(o)}}createBoxGraphics(n){if(n=n||{},n){var o=this.createGraphics();return o.position=n.position,o.name=n.name||"box_graphic",o.box=this.getBoxGraphics(n.box),this._graphicsLayer.entities.add(o)}}createModelGraphics(n){if(n&&n.position){var o=this.createGraphics();return o.model=this.getModelGraphics(n),o.position=n.position,this._graphicsLayer.entities.add(o)}}craeteCorridorGraphics(n){if(n&&n.positions){let{positions:r,height:i,width:s,material:l,...c}=n;var o=this.createGraphics();return i=i===void 0?6:i,s=s===void 0?15:s,o.corridor={positions:r,height:i,width:s,...c,material:l||new e.Scene.WarnLinkMaterialProperty({freely:"cross",color:e.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(o)}}craeteDynamicPolyLineGraphics(n){if(n&&n.positions){var o=this.createGraphics();return o.polyline={show:true,positions:[],material:n.material||e.Color.CHARTREUSE,width:n.width||5,clampToGround:this._objHasOwnProperty(n,"clampToGround",false)},o.polyline.positions=new e.CallbackProperty(function(){return n.positions},false),this._graphicsLayer.entities.add(o)}}craeteDynamicCylinderGraphics(n){var o={};if(n&&n.cylinder){var r=n.entity,i=n.cylinder,s=this;return o.cylinder=this.getCylinderGraphics(i),o.position=new e.CallbackProperty(function(){var l=r.position.getValue(s._viewer.clock.currentTime),c=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(l),h=e.Math.toDegrees(c.latitude),d=e.Math.toDegrees(c.longitude);return e.Cartesian3.fromDegrees(d,h,0)},false),o.cylinder.length=new e.CallbackProperty(function(){var l=r.position.getValue(s._viewer.clock.currentTime),c=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(l);return c.height*2},false),o}}createFadeCylinderGraphics(n){if(n=n||{},n&&n.position){let o=this.createGraphics();return o.position=n.position,n.material=new e.Scene.CircleFadeMaterialProperty({color:n.color||e.Color.fromCssColorString("#02ff00"),duration:n.duration||2e3}),o.cylinder=this.getCylinderGraphics(n),this._drawLayer.entities.add(o)}}craeteRotateCylinderGraphics(n){if(n&&n.position){var o=this.createGraphics();return o.cylinder={HeightReference:e.HeightReference.RELATIVE_TO_GROUND,length:n.length||500,topRadius:n.topRadius||500,bottomRadius:n.bottomRadius||500,material:n.material||new e.ImageMaterialProperty({image:n.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:true,repeat:{x:1,y:-1}}),slices:n.slices||128},o.position=n.position,this.setGraphicsRotate({entity:o,position:this.transformCartesianToWGS84(n.position),rotateAmount:4}),this._graphicsLayer.entities.add(o)}}craeteDynamicBlinkCircleGraphics(n){if(n&&n.position){var o=this.createGraphics(),r=n.alp||1,i=this._objHasOwnProperty(n,"flog",true);return o.position=n.position,o.ellipse={semiMinorAxis:n.semiMinorAxis||2e3,semiMajorAxis:n.semiMajorAxis||2e3,height:n.height||10,material:new e.ColorMaterialProperty(new e.CallbackProperty(function(){return i?(r=r-.05,r<=0&&(i=false)):(r=r+.05,r>=1&&(i=true)),e.Color.RED.withAlpha(r)},false))},this._graphicsLayer.entities.add(o)}}craeteDynamicCricleGraphics(n){var C,b;if(n&&n.center){var o=this.createGraphics(),r=this,i=n.center,s=n.radius||800,l=n.rotateAmount||.05,c=0,h=n.height||1,d=0,m=0,y=0,p=(C=n.scale)!=null?C:0,g=(b=n.scale2)!=null?b:0,v=n.material||new e.ImageMaterialProperty({image:n.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:true});o.position=new e.CallbackProperty(function(){return r.transformWGS84ToCartesian(i)},false),o.orientation=new e.CallbackProperty(function(){return e.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(i),new e.HeadingPitchRoll(e.Math.toRadians(d),e.Math.toRadians(m),e.Math.toRadians(y)))},false);let P=s,_=false;var A=()=>{(s>=p||s<=P)&&(_=!_),_?s+=2:s-=2;},w=()=>{g>=s?s+=2:s=P;};return o.ellipse={material:v,height:h,semiMajorAxis:new e.CallbackProperty(function(){return s},false),semiMinorAxis:new e.CallbackProperty(function(){return s},false),stRotation:new e.CallbackProperty(function(){return l>0&&(c+=l,c>=360&&(c=0)),p&&A(),g&&w(),c},false)},this._graphicsLayer.entities.add(o)}}craeteDynamicShadeWallGraphics(n){if(n&&n.positions){var o=n.alp||1,r=n.num||20,i=n.color||e.Color.RED,s=n.speed||.003,l=this.createGraphics();return l.wall={positions:n.positions,material:new e.ImageMaterialProperty({image:n.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:true,color:new e.CallbackProperty(function(){return r%2===0?o-=s:o+=s,(o<=.1||o>=1)&&r++,i.withAlpha(o)},false)})},this._graphicsLayer.entities.add(l)}}createCustomDefBillboardGraphics(n){if(n&&n.position){var o=this,r=document.createElement("img");r.src=n.image||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";let i=function(s){if(s.image){var l=document.createElement("canvas");l.width=s.width||150,l.height=s.height||80;var c=l.getContext("2d");c.drawImage(s.image,0,0);var h=s.text;return c.font="15px bold \u5B8B\u4F53",c.fillStyle="#f4fff0",c.fillText(h,55,36),l}};r.onload=function(){n.image=r;var s=o._graphicsLayer.entities.add({position:n.position,billboard:{image:i(n),scaleByDistance:new e.NearFarScalar(150,.7,15e6,.5),verticalOrigin:e.VerticalOrigin.BOTTOM,pixelOffset:n.b_pixelOffset||new e.Cartesian2(80,-35),width:140,height:100,scale:n.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});typeof n.callback=="function"&&n.callback(s);};}}craeteRotatePlaneGraphics(n){if(n&&n.center&&n.positions){var o=this.createGraphics(),r=0,i=n.positions,s=i[0];return o.position=new e.CallbackProperty(function(){return r==0?(s=i[0],r+=1):r<i.length-1?(s=i[r],r+=1):r==i.length-1&&(s=i[r],r=0),s},false),o.plane={plane:new e.Plane(e.Cartesian3.UNIT_Y,0),dimensions:n.dimensions||new e.Cartesian2(200,150),material:new e.ImageMaterialProperty({image:n.image})},this._graphicsLayer.entities.add(o)}}createVideoPlaneGraphics(n){if(n&&n.position){var o=this.createGraphics();return o.position=n.position,o.plane={plane:new e.Plane(n.normal||e.Cartesian3.UNIT_Y,0),dimensions:n.dimensions||new e.Cartesian2(200,150),material:new e.ImageMaterialProperty({image:n.videoElement})},this._graphicsLayer.entities.add(o)}}async createGifBillboardGraphics(n){let o=await tn();if(n&&n.position){var r=[],i=n.url,s=0,l=6;return function(h,d){var m=document.createElement("img");m.src=h,m.setAttribute("rel:animated_src",h),m.setAttribute("rel:auto_play","0"),document.body.appendChild(m);var y=new o({gif:m});return new Promise(p=>{y.load(()=>{for(let g=1;g<=y.get_length();g++)y.move_to(g),d.push(y.get_canvas().toDataURL());p(d);});})}(i,r),this._graphicsLayer.entities.add({position:n.position,billboard:{verticalOrigin:e.VerticalOrigin.BASELINE,image:new e.CallbackProperty(function(){return r.length?(s<l*(r.length-1)?s++:s=0,r[Math.floor(s/l)]):i},false),scale:.2}})}}setGraphicsRotate(n){if(n&&n.entity&&n.rotateAmount){var o=n.entity,r=n.rotateAmount,i=n.position,s=this;i.heading=0,i.pitch=0,i.roll=0,o.position=new e.CallbackProperty(function(){return s.transformWGS84ToCartesian(i)},false),o.orientation=new e.CallbackProperty(function(){return r>0&&(i.heading+=r,i.heading===360&&(i.heading=0)),e.Transforms.headingPitchRollQuaternion(s.transformWGS84ToCartesian(i),new e.HeadingPitchRoll(e.Math.toRadians(i.heading),e.Math.toRadians(i.pitch),e.Math.toRadians(i.roll)))},false);}}setGraphicsFloat(n){if(n&&n.entity&&n.maxHeiht)try{var o=n.entity,r=n.minHeiht||5,i=n.maxHeiht||100,s=n.cartesians,l=n.speed||.06,c=this,h=r,d=!1;s.length?o.positions=new e.CallbackProperty(function(){var m=c.transformCartesianArrayToWGS84Array(s);for(var y in m){var p=m[y];(r>=i||r<=h)&&(d=!d),d?r+=l:r-=l,p.alt=r;}return c.transformWGS84ArrayToCartesianArray(m,0)},!1):o.position=new e.CallbackProperty(function(){var m=c.transformCartesianToWGS84(s);return (r>=i||r<=h)&&(d=!d),d?r+=l:r-=l,m.alt=r,c.transformWGS84ToCartesian(m)},!1);}catch(m){console.log(m);}}createCanvasGraphics(n){if(n&&n.positions){let o=function(){var r=0,i=document.createElement("canvas"),s=i.getContext("2d"),l=new Image;l.src=n.img||"../../images/ysCesium/logo.png";let c=n.cwidth||0;if(s.clearRect(0,0,c,n.cheight||0),r<=c)s.drawImage(l,r,0);else return r=0,r+=3,i};this._graphicsLayer.entities.add({rectangle:{coordinates:n.positions,material:new e.ImageMaterialProperty({image:new e.CallbackProperty(o,false),transparent:true})}}),typeof n.callback=="function"&&n.callback();}}createFanShape({viewer:n,longitude:o,latitude:r,alt:i,custMaterial:s,speed:l=0,direction:c="+"}){if(n){var h=this.createGraphics(),d=0,m=this._calcPoints(o,r,i,d);h.wall={positions:new e.CallbackProperty(()=>e.Cartesian3.fromDegreesArrayHeights(m),false),material:s||e.Color.AQUAMARINE.withAlpha(.5)};let y=()=>{l>0&&(d+=l,m=this._calcPoints(o,r,i,Number(c+d)));};return n.clock.onTick.addEventListener(y),oe(this,()=>{n.clock.onTick.removeEventListener(y);}),this._graphicsLayer.entities.add(h)}}_computeCirclularFlight(n,o,r,i,s,l){let c=[];c.push(n),c.push(o),c.push(0);var h=e.Cartesian3.distance(e.Cartesian3.fromDegrees(n,o),e.Cartesian3.fromDegrees(r,i));for(let d=s;d<=s+l;d++){let m=h*Math.sin(d*Math.PI/180),y=Math.cos(d*Math.PI/180),p=(r-n)*y+n,g=(i-o)*y+o;c.push(p),c.push(g),c.push(m);}return c}_objHasOwnProperty(n,o,r){let i=n;return i&&i.hasOwnProperty(o)?i[o]:r}_calcPoints(n,o,r,i){var s=e.Transforms.eastNorthUpToFixedFrame(e.Cartesian3.fromDegrees(n,o)),l=r*Math.cos(i*Math.PI/180),c=r*Math.sin(i*Math.PI/180),h=e.Cartesian3.fromElements(l,c,0),d=e.Matrix4.multiplyByPoint(s,h,new e.Cartesian3),m=e.Cartographic.fromCartesian(d),y=e.Math.toDegrees(m.longitude),p=e.Math.toDegrees(m.latitude);return this._computeCirclularFlight(n,o,y,p,0,90)}createCorridorGraphics(n){return this.craeteCorridorGraphics(n)}createDynamicPolyLineGraphics(n){return this.craeteDynamicPolyLineGraphics(n)}createDynamicCylinderGraphics(n){return this.craeteDynamicCylinderGraphics(n)}createRotateCylinderGraphics(n){return this.craeteRotateCylinderGraphics(n)}createDynamicBlinkCircleGraphics(n){return this.craeteDynamicBlinkCircleGraphics(n)}createDynamicCircleGraphics(n){return this.craeteDynamicCricleGraphics(n)}createDynamicShadeWallGraphics(n){return this.craeteDynamicShadeWallGraphics(n)}createRotatePlaneGraphics(n){return this.craeteRotatePlaneGraphics(n)}createGraphics(){return new e.Entity}}return f}var pe=re(sr);function lr(){let e=null;class f{constructor(n,o,r){n&&(e=o,this._installMaterial());}_installMaterial(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial(),this._installPolylineTrailLinkMaterial();}addMaterialLineGraphics(n){if(this._viewer&&n&&n.image){var o=this.createGraphics();return o.polyline={positions:n.positions,material:new e.PolylineCustomMaterialProperty({color:n.color||e.Color.RED,duration:n.duration||500}),width:n.width},this._viewer.entities.add(o)}}getCustomMaterialLine(n){if(this._viewer&&n&&n.image)return this._initPolylineCustomMaterialProperty(n)}_initPolylineCustomMaterialProperty(n){if(n){var o=e.Color,r=e.defaultValue,i=e.defined,s=Object.defineProperties,l=e.Event,c=e.createPropertyDescriptor,h=e.Property,d=e.Material,m=o.WHITE,y=n.MaterialType||"wallType"+parseInt(String(Math.random()*1e3));let p=function(g){g=r(g,r.EMPTY_OBJECT),this._definitionChanged=new l,this._color=void 0,this._colorSubscription=void 0,this.color=g.color||e.Color.BLUE,this.duration=g.duration||1e3,this._time=void 0;};return s(p.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:c("color")}),p.prototype.getType=function(){return y},p.prototype.getValue=function(g,v){return i(v)||(v={}),v.color=h.getValueOrClonedDefault(this._color,g,m,v.color),v.image=n.image,this._time===void 0&&(this._time=g.secondsOfDay),v.time=(g.secondsOfDay-this._time)*1e3/this.duration,v},p.prototype.equals=function(g){return this===g||g instanceof p&&h.equals(this._color,g._color)},d._materialCache.addMaterial(y,{fabric:{type:y,uniforms:{color:n.color||new e.Color(1,0,0,.5),image:n.image,time:n.time||0},source:this._getDynamicLineShader({get:true})},translucent:function(){return true}}),new p(n)}}addMaterialWallGraphics(n){if(this._viewer&&n&&n.image){var o=this.createGraphics();return o.wall={positions:n.positions,material:this.getCustomMaterialWall(n),width:n.width},this._viewer.entities.add(o)}}getCustomMaterialWall(n){if(this._viewer&&n&&n.image)return this._initWallCustomMaterialProperty(n)}_initWallCustomMaterialProperty(n){var o=e.Color,r=e.defaultValue,i=e.defined,s=Object.defineProperties,l=e.Event,c=e.createPropertyDescriptor,h=e.Property,d=e.Material,m=n.MaterialType||"wallType"+parseInt(String(Math.random()*1e3));let y=function(p){p=r(p,r.EMPTY_OBJECT),this._definitionChanged=new l,this._color=void 0,this._colorSubscription=void 0,this.color=p.color||o.BLUE,this.duration=p.duration||3e3,this._time=new Date().getTime();};return s(y.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:c("color")}),y.prototype.getType=function(){return m},y.prototype.getValue=function(p,g){return i(g)||(g={}),g.color=h.getValueOrClonedDefault(this._color,p,o.WHITE,g.color),g.image=n.image,g.time=(new Date().getTime()-this._time)%this.duration/this.duration,g},y.prototype.equals=function(p){return this===p||p instanceof y&&h.equals(this._color,p._color)},d._materialCache.addMaterial(m,{fabric:{type:m,uniforms:{color:new o(1,0,0,.5),image:n.image,time:0},source:this._getDirectionWallShader({get:true,count:n.count,freely:n.freely,direction:n.direction})},translucent:function(){return true}}),new y(n)}_installWaveCircleMaterial(){var n=this,o=e.Color,r=e.defaultValue,i=Object.defineProperties,s=e.Event,l=e.Property,c=e.Material;function h(d){d=d||{},this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=r(d.color,o.fromBytes(0,255,255,255)),this.duration=r(d.duration,45),this.count=Math.max(r(d.count,2),1),this.gradient=r(d.gradient,.1),this.gradient<0?this.gradient=0:this.gradient>1&&(this.gradient=1);}i(h.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),h.prototype.getType=function(){return c.CircleWaveType},h.prototype.getValue=function(d,m){return m||(m={}),m.color=l.getValueOrUndefined(this._color,d),m.duration=this._duration,m.count=this.count,m.gradient=this.gradient,m},h.prototype.equals=function(d){return this===d||d instanceof h&&l.equals(this._color,d._color)},i(h.prototype,{color:e.createPropertyDescriptor("color"),duration:e.createPropertyDescriptor("duration")}),e.Scene.CircleWaveMaterialProperty=h,c.CircleWaveType="CircleWave",c._materialCache.addMaterial(c.CircleWaveType,{fabric:{type:c.CircleWaveType,uniforms:{color:new o(1,0,0,.7),duration:45,count:1,gradient:.1},source:n._getDynamicCircleShader({get:true})},translucent:function(){return true}});}_installCircleFadeMaterial(){var n=e.Color,o=e.defaultValue,r=Object.defineProperties,i=e.Event,s=e.Property,l=e.Material,c=new n(0,0,0,0);function h(d){d=o(d,o.EMPTY_OBJECT),this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=o(d.color,c),this._duration=d.duration||1e3,this._time=void 0;}r(h.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),h.prototype.getType=function(){return l.CircleFadeMaterialType},h.prototype.getValue=function(d,m){return m||(m={}),m.color=s.getValueOrClonedDefault(this._color,d,c,m.color),this._time===void 0&&(this._time=new Date().getTime()),m.time=(new Date().getTime()-this._time)/this._duration,m},h.prototype.equals=function(d){return this===d||d instanceof h&&s.equals(this._color,d._color)},r(h.prototype,{color:e.createPropertyDescriptor("color")}),e.Scene.CircleFadeMaterialProperty=h,l.CircleFadeMaterialType="CircleFadeMaterial",l._materialCache.addMaterial(l.CircleFadeMaterialType,{fabric:{type:l.CircleFadeMaterialType,uniforms:{color:new n(1,0,0,1),time:1},source:this._getCircleFadeShader({get:true})},translucent:function(){return true}});}_installCityLineMaterial(){var n=e.Color,o=e.defaultValue,r=e.defined,i=Object.defineProperties,s=e.Event,l=e.createPropertyDescriptor,c=e.Property,h=e.Material,d=n.WHITE;function m(y){y=o(y,o.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this.color=y.color||e.Color.BLUE,this.duration=y.duration||1e3,this._time=void 0,this._img=y.imgUrl||h.PolylineCityLinkImage;}i(m.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:l("color")}),m.prototype.getType=function(){return h.PolylineCityLinkType},m.prototype.getValue=function(y,p){return r(p)||(p={}),p.color=c.getValueOrClonedDefault(this._color,y,d,p.color),p.image=this._img,this._time===void 0&&(this._time=y.secondsOfDay),p.time=(y.secondsOfDay-this._time)*1e3/this.duration,p},m.prototype.equals=function(y){return this===y||y instanceof m&&c.equals(this._color,y._color)},e.Scene.PolylineCityLinkMaterialProperty=m,h.PolylineCityLinkType="PolylineCityLink",h.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",h._materialCache.addMaterial(h.PolylineCityLinkType,{fabric:{type:h.PolylineCityLinkType,uniforms:{color:new n(1,0,0,1),image:h.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:true})},translucent:function(){return true}});}_installWarnMaterial(){var n=e.Color,o=e.defaultValue,r=e.defined,i=Object.defineProperties,s=e.Event,l=e.createPropertyDescriptor,c=e.Property,h=e.Material;function d(m){m=o(m,o.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this.color=m.color||n.BLUE,this.duration=m.duration||3e3,this._time=new Date().getTime();}i(d.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),d.prototype.getType=function(){return h.WarnLinkType},d.prototype.getValue=function(m,y){return r(y)||(y={}),y.color=c.getValueOrClonedDefault(this._color,m,n.WHITE,y.color),y.image=h.WarnLinkImage,y.time=(new Date().getTime()-this._time)%this.duration/this.duration,y},d.prototype.equals=function(m){return this===m||m instanceof d&&c.equals(this._color,m._color)},i(d.prototype,{color:l("color")}),e.Scene.WarnLinkMaterialProperty=d,h.WarnLinkType="WarnWallLinkType",h.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",h._materialCache.addMaterial(h.WarnLinkType,{fabric:{type:h.WarnLinkType,uniforms:{color:new n(1,0,0,.5),image:h.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:true,count:10,freely:"cross",direction:"-"})},translucent:function(){return true}});}_installFlowMaterial(){var n=e.Color,o=e.defaultValue,r=Object.defineProperties,i=e.Event,s=e.createPropertyDescriptor,l=e.Property,c=e.Material;function h(d){d=o(d,o.EMPTY_OBJECT),this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=d.color||n.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=o(d.duration,45);}r(h.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),h.prototype.getType=function(){return c.PolylineFlowType},h.prototype.getValue=function(d,m){return m||(m={}),m.color=l.getValueOrClonedDefault(this._color,d,e.Color.WHITE,m.color),m.duration=this._duration,m},h.prototype.equals=function(d){return this===d||d instanceof h&&l.equals(this._color,d._color)},r(h.prototype,{color:s("color"),duration:s("duration")}),e.Scene.PolylineFlowMaterialProperty=h,c.PolylineFlowType="PolylineFlow",c._materialCache.addMaterial(c.PolylineFlowType,{fabric:{type:c.PolylineFlowType,uniforms:{color:new n(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:true})},translucent:function(){return true}});}_installPolylineTrailLinkMaterial(){var n=e.Color,o=e.defaultValue,r=Object.defineProperties,i=e.createPropertyDescriptor,s=e.Event,l=e.Property,c=e.Material,h=this.getDfSt(["primitive","WaterPrimitive"]);function d(m){m=o(m,o.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this.color=m.color||e.Color.WHITE,this.image=m.image||h,this._colorSubscription=void 0,this.duration=m.duration||3e3,this._time=new Date().getTime(),this.speed=m.speed,this.isTranslucent=function(){return true};}r(d.prototype,{isConstant:{get:function(){return false},configurable:true},definitionChanged:{get:function(){return this._definitionChanged},configurable:true},color:i("color"),duration:i("duration")}),d.prototype.getType=function(){return c.PolylineTrailLinkType},d.prototype.getValue=function(m,y){return e.defined(y)||(y={}),y.color=l.getValueOrClonedDefault(this._color,m,this.color,y.color),y.image=c.PolylineTrailLinkImage,y.time=(new Date().getTime()-this._time)%this.duration/this.duration*this.speed,y},d.prototype.equals=function(m){return this===m||m instanceof d&&l.equals(this._color,m._color)},c.PolylineTrailLinkSource=`
140
140
  uniform vec4 color;
141
141
  uniform float time;
142
142
  uniform sampler2D image;
@@ -148,7 +148,7 @@ void main(void)
148
148
  material.alpha = colorImage.a * color.a;
149
149
  material.diffuse = (colorImage.rgb+color.rgb)/2.0;
150
150
  return material;
151
- }`,e.Scene.PolylineTrailLinkMaterial=d,c.PolylineTrailLinkType="PolylineTrailLinkMaterial",c.PolylineTrailLinkImage=this.image||u||"static/data/images/Textures/river.png",c._materialCache.addMaterial(c.PolylineTrailLinkType,{fabric:{type:c.PolylineTrailLinkType,uniforms:{color:new n(1,1,1,1),image:c.PolylineTrailLinkImage,time:-20},source:c.PolylineTrailLinkSource},translucent:function(){return true}});}}return y}var ct=re(er);var Be=function(){};Be.prototype={_getFlowLineShader:function(){return `uniform vec4 color;
151
+ }`,e.Scene.PolylineTrailLinkMaterial=d,c.PolylineTrailLinkType="PolylineTrailLinkMaterial",c.PolylineTrailLinkImage=this.image||h||"static/data/images/Textures/river.png",c._materialCache.addMaterial(c.PolylineTrailLinkType,{fabric:{type:c.PolylineTrailLinkType,uniforms:{color:new n(1,1,1,1),image:c.PolylineTrailLinkImage,time:-20},source:c.PolylineTrailLinkSource},translucent:function(){return true}});}}return f}var ut=re(lr);var Ge=function(){};Ge.prototype={_getFlowLineShader:function(){return `uniform vec4 color;
152
152
  uniform float duration;
153
153
 
154
154
  czm_material czm_getMaterial(czm_materialInput materialInput){
@@ -197,23 +197,23 @@ void main(void)
197
197
 
198
198
  return material;
199
199
  }
200
- `},_getDirectionWallShader:function(e){if(e&&e.get){var h=`czm_material czm_getMaterial(czm_materialInput materialInput)
200
+ `},_getDirectionWallShader:function(e){if(e&&e.get){var u=`czm_material czm_getMaterial(czm_materialInput materialInput)
201
201
  {
202
202
  czm_material material = czm_getDefaultMaterial(materialInput);
203
203
  vec2 st = materialInput.st;
204
204
 
205
- `;return e.freely=="vertical"?h+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.t "+e.direction+` time), fract(st.s)));
206
- `:h+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.s "+e.direction+` time), fract(st.t)));
207
- `,h+=`vec4 fragColor;
205
+ `;return e.freely=="vertical"?u+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.t "+e.direction+` time), fract(st.s)));
206
+ `:u+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.s "+e.direction+` time), fract(st.t)));
207
+ `,u+=`vec4 fragColor;
208
208
  fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;
209
209
  fragColor = czm_gammaCorrect(fragColor);
210
- `,h+=` material.diffuse = colorImage.rgb;
210
+ `,u+=` material.diffuse = colorImage.rgb;
211
211
  material.alpha = colorImage.a;
212
212
  material.emission = fragColor.rgb;
213
213
 
214
214
  return material;
215
215
  }
216
- `,h}},_getCircleFadeShader:function(e){if(e&&e.get)return `czm_material czm_getMaterial(czm_materialInput materialInput)
216
+ `,u}},_getCircleFadeShader:function(e){if(e&&e.get)return `czm_material czm_getMaterial(czm_materialInput materialInput)
217
217
 
218
218
  {
219
219
 
@@ -387,7 +387,7 @@ void main(void)
387
387
  out_FragColor = mix(out_FragColor, u_scanColor, f);
388
388
  }
389
389
  }
390
- `}};function tr(){let e={};class h{constructor(o,n){o&&(this._viewer=o,e=n);}splitCartesians3(o){for(var n=[],a=0;a<o.length;a+=3){var r=new e.Cartesian3(o[a],o[a+1],o[a+2]);n.push(r);}return n.push(n[0]),n}getLinkedPointList(o,n,a,r){if(this._viewer){var i=[],l=e.Cartographic.fromCartesian(o),s=e.Cartographic.fromCartesian(n),c=l.longitude*180/Math.PI,u=l.latitude*180/Math.PI,d=s.longitude*180/Math.PI,m=s.latitude*180/Math.PI,f=Math.sqrt((c-d)*(c-d)+(u-m)*(u-m)),p=f*a,g=e.Cartesian3.clone(o),v=e.Cartesian3.clone(n),A=e.Cartesian3.distance(g,e.Cartesian3.ZERO),w=e.Cartesian3.distance(v,e.Cartesian3.ZERO);if(e.Cartesian3.normalize(g,g),e.Cartesian3.normalize(v,v),e.Cartesian3.distance(g,v)==0)return i;var C=e.Cartesian3.angleBetween(g,v);i.push(o);for(var _=1;_<r-1;_++){var P=_*1/(r-1),b=1-P,x=Math.sin(b*C)/Math.sin(C),T=Math.sin(P*C)/Math.sin(C),S=e.Cartesian3.multiplyByScalar(g,x,new e.Cartesian3),M=e.Cartesian3.multiplyByScalar(v,T,new e.Cartesian3),E=e.Cartesian3.add(S,M,new e.Cartesian3),I=P*Math.PI,D=A*b+w*P+Math.sin(I)*p;E=e.Cartesian3.multiplyByScalar(E,D,E),i.push(E);}return i.push(n),i}}getPositionsAngle(o){if(o){var n=o.position1,a=o.position2,r=e.Transforms.eastNorthUpToFixedFrame(n),i=e.Matrix4.inverse(r,new e.Matrix4),l=e.Matrix4.multiplyByPoint(i,n,new e.Cartesian3),s=e.Matrix4.multiplyByPoint(i,a,new e.Cartesian3),c;o.type==="pitch"?c=Math.atan2(s.z-l.z,s.x-l.x):o.type==="heading"&&(c=Math.atan2(s.y-l.y,s.x-l.x));var u=c*(180/Math.PI);return u<0&&(u=u+360),u}}getPositionsArea(o){let n=0;if(o){let a=0,r=e.Ellipsoid.WGS84;o.push(o[0]);for(let i=1;i<o.length;i++){let l=r.cartographicToCartesian(this.transformWGS84ToCartographic(o[i-1])),s=r.cartographicToCartesian(this.transformWGS84ToCartographic(o[i]));a+=l.x*s.y-s.x*l.y;}n=Math.abs(a).toFixed(2);}return n}getPolygonArea(o){if(this._viewer){let n=Math.PI/180,a=180/Math.PI,r=function(s,c){var u=(s.lat||0)*n,d=(s.lng||s.lon||0)*n,m=(c.lat||0)*n,f=(c.lng||c.lon||0)*n;let p=-Math.atan2(Math.sin(d-f)*Math.cos(m),Math.cos(u)*Math.sin(m)-Math.sin(u)*Math.cos(m)*Math.cos(d-f));return p<0&&(p+=Math.PI*2),p=p*a,p},i=function(s,c,u){let d=r(c,s),m=r(c,u),f=d-m;return f<0&&(f+=360),f},l=0;for(let s=0;s<o.length-2;s++){let c=(s+1)%o.length,u=(s+2)%o.length,d=i(o[s],o[c],o[u]),m=this.getPointDistance(this.transformWGS84ToCartesian(o[s]),this.transformWGS84ToCartesian(o[c])),f=this.getPointDistance(this.transformWGS84ToCartesian(o[c]),this.transformWGS84ToCartesian(o[u]));l+=m*f*Math.abs(Math.sin(d));}return l.toFixed(2)}}getPointDistance(o,n){if(this._viewer){var a=e.Cartographic.fromCartesian(o),r=e.Cartographic.fromCartesian(n),i=new e.EllipsoidGeodesic;i.setEndPoints(a,r);var l=i.surfaceDistance;return l=Math.sqrt(Math.pow(l,2)+Math.pow(r.height-a.height,2)),l}}getPositionDistance(o){let n=0;for(let a=0;a<o.length-1;a++){let r=this.transformWGS84ToCartographic(o[a]),i=this.transformWGS84ToCartographic(o[a+1]),l=new e.EllipsoidGeodesic;l.setEndPoints(r,i);let s=l.surfaceDistance;s=Math.sqrt(Math.pow(s,2)+Math.pow(i.height-r.height,2)),n=n+s;}return n.toFixed(3)}getIntersectObj(o,n,a=[],r=false){if(this._viewer){var i=e.Cartesian3.normalize(e.Cartesian3.subtract(n,o,new e.Cartesian3),new e.Cartesian3),l=new e.Ray(o,i),s=[],c=this._viewer.scene;if(r)s=c.drillPickFromRay(l,10,a);else {var u=c.pickFromRay(l,a);e.defined(u)&&(s=[u]);}return s}}getPointOnEllipsoid(o,n,a,r,i,l,s,c,u,d){if(this._viewer){var m=new e.Cartesian3,f=new e.Cartesian3,p=new e.Quaternion,g=new e.Matrix3,v=o+n;e.Cartesian3.multiplyByScalar(r,Math.cos(v),m),e.Cartesian3.multiplyByScalar(a,Math.sin(v),f),e.Cartesian3.add(m,f,m);var A=Math.cos(o);A=A*A;var w=Math.sin(o);w=w*w;var C=l/Math.sqrt(s*A+i*w),_=C/c;return e.Quaternion.fromAxisAngle(m,_,p),e.Matrix3.fromQuaternion(p,g),e.Matrix3.multiplyByVector(g,u,d),e.Cartesian3.normalize(d,d),e.Cartesian3.multiplyByScalar(d,c,d),d}}raisePositionsToHeight(o,n,a){if(this._viewer){for(var r=new e.Cartesian3,i=new e.Cartesian3,l=new e.Cartesian3,s=new e.Cartesian3,c=n.ellipsoid,u=n.height,d=n.extrudedHeight,m=a?o.length/3*2:o.length/3,f=new Float64Array(m*3),p=o.length,g=a?p:0,v=0;v<p;v+=3){var A=v+1,w=v+2,C=e.Cartesian3.fromArray(o,v,r);c.scaleToGeodeticSurface(C,C);var _=e.Cartesian3.clone(C,i),P=c.geodeticSurfaceNormal(C,s),b=e.Cartesian3.multiplyByScalar(P,u,l);e.Cartesian3.add(C,b,C),a&&(e.Cartesian3.multiplyByScalar(P,d,b),e.Cartesian3.add(_,b,_),f[v+g]=_.x,f[A+g]=_.y,f[w+g]=_.z),f[v]=C.x,f[A]=C.y,f[w]=C.z;}return f}}computeEllipseEdgePositions(o){if(this._viewer){var n=new e.Cartesian3,a=new e.Cartesian3,r=new e.Cartesian3,i=new e.Cartesian3,l=o.semiMinorAxis,s=o.semiMajorAxis,c=o.rotation,u=o.center,d=o.granularity&&typeof o.granularity=="number"?o.granularity:Math.PI/180;d>Math.PI/12&&(d=Math.PI/12),d<Math.PI/180&&(d=Math.PI/180);var m=l*l,f=s*s,p=s*l,g=e.Cartesian3.magnitude(u),v=e.Cartesian3.normalize(u,n),A=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,u,a);A=e.Cartesian3.normalize(A,A);var w=e.Cartesian3.cross(v,A,r),C=Math.ceil(e.Math.PI*2/d),_=d,P=0,b=i,x,T=0,S=[];for(x=0;x<C;x++)P=x*_,b=this.getPointOnEllipsoid(P,c,w,A,m,p,f,g,v,b),S[T++]=b.x,S[T++]=b.y,S[T++]=b.z;var M={numPts:C,outerPositions:S};return M}}computeSectorEdgePositions(o){if(this._viewer){var n=new e.Cartesian3,a=new e.Cartesian3,r=new e.Cartesian3,i=new e.Cartesian3,l=o.semiMinorAxis,s=o.semiMajorAxis,c=o.rotation,u=o.angle?o.angle:Math.PI*2,d=o.center,m=o.granularity&&typeof o.granularity=="number"?o.granularity:Math.PI/180;m>Math.PI/12&&(m=Math.PI/12),m<Math.PI/180&&(m=Math.PI/180);var f=l*l,p=s*s,g=s*l,v=e.Cartesian3.magnitude(d),A=e.Cartesian3.normalize(d,n),w=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,d,a);w=e.Cartesian3.normalize(w,w);var C=e.Cartesian3.cross(A,w,r),_=Math.ceil(u/m),P=m,b=0,x=i,T,S=0,M=[];for(T=0;T<_;T++)b=T*P,x=this.getPointOnEllipsoid(b,c,C,w,f,g,p,v,A,x),M[S++]=x.x,M[S++]=x.y,M[S++]=x.z;var E={numPts:_,outerPositions:M};return E}}computeLonlatPointsTerrainData(o,n){if(this._viewer){for(var a=[],r=0;r<o.length;r++)a.push(e.Cartographic.fromDegrees(o[r].lon,o[r].lat));var i=this._viewer.scene.clampToHeightMostDetailed(a);i.then(function(l){n(l);});}}computeCartographicPointsTerrainData(o,n){if(this._viewer){if(o.length<=0)return;for(var a=[],r=0;r<o.length;r++)a.push(e.Cartesian3.fromRadians(o[r].longitude,o[r].latitude,o[r].height));var i=this._viewer.scene.clampToHeightMostDetailed(a),l=this;i.then(function(s){for(var c=[],u=l._viewer.scene.globe.ellipsoid,d=0;d<s.length;d++)c.push(u.cartesianToCartographic(s[d]));n&&n(c);}).catch(function(s){console.log(s);});}}_checkLonDegree(o){return !(o>180||o<-180)}_checkLatDegree(o){return !(o>90||o<-90)}computeInterpolateLineLonlat(o,n){if(!o||!n||o.lon||!o.lat||!n.lon||!n.lat||!this._checkLonDegree(o.lon)||!this._checkLonDegree(n.lon)||!this._checkLatDegree(o.lat)||!this._checkLatDegree(n.lat))return null;var a=[];a.push([o.lon,o.lat]);var r=Math.sqrt(Math.pow(n.lon-o.lon,2)+Math.pow(n.lat-o.lat,2));if(r<=1e-5)return a.push([n.lon,n.lat]),a;for(var i=r/1e-5,l=(n.lon-o.lon)/i,s=(n.lat-o.lat)/i,c=0;c<i;c++){var u=o.lon+(c+1)*l,d=o.lat+(c+1)*s;a.push([u,d]);}return a}computeInterpolateLineCartographic(o,n,a){if(!o||!n||!o.longitude||!o.latitude||!n.longitude||!n.latitude)return null;var r=[];r.push(new e.Cartographic(o.longitude,o.latitude));var i=Math.sqrt(Math.pow(n.longitude-o.longitude,2)+Math.pow(n.latitude-o.latitude,2)),l=a&&typeof a=="number"?a:1e-5*Math.PI/180;if(i<=l)return r.push(new e.Cartographic(n.longitude,n.latitude)),r;for(var s=i/l,c=(n.longitude-o.longitude)/s,u=(n.latitude-o.latitude)/s,d=0;d<s;d++){var m=o.longitude+(d+1)*c,f=o.latitude+(d+1)*u;r.push(new e.Cartographic(m,f));}return r.push(new e.Cartographic(n.longitude,n.latitude,n.height)),r}computeInterpolateLineHeightCartographic(o,n){if(!o||!n||!o.longitude||!o.latitude||!n.longitude||!n.latitude)return null;var a=[];a.push(new e.Cartographic(o.longitude,o.latitude,o.height));var r=Math.sqrt(Math.pow(n.longitude-o.longitude,2)+Math.pow(n.latitude-o.latitude,2));if(r<=1e-5*Math.PI/180)return a.push(new e.Cartographic(n.longitude,n.latitude,n.height)),a;for(var i=r/1e-5*Math.PI/180,l=(n.longitude-o.longitude)/i,s=(n.latitude-o.latitude)/i,c=((n.height||0)-(o.height||0))/i,u=0;u<i;u++){var d=o.longitude+(u+1)*l,m=o.latitude+(u+1)*s,f=(o.height||0)+(u+1)*c;a.push(new e.Cartographic(d,m,f));}return a.push(new e.Cartographic(n.longitude,n.latitude,n.height)),a}computeInterpolate2IndexLineHeightCartographic(o,n,a,r){if(!o||!n||!o.longitude||!o.latitude||!n.longitude||!n.latitude)return null;var i=[];i.push(new e.Cartographic(o.longitude,o.latitude,o.height));for(var l=(n.longitude-o.longitude)/a,s=(n.latitude-o.latitude)/a,c=((n.height||0)-(o.height||0))/a,u=0;u<r;u++){var d=o.longitude+(u+1)*l,m=o.latitude+(u+1)*s,f=(o.height||0)+(u+1)*c;i.push(new e.Cartographic(d,m,f));}return i}computeInterpolateIndexLineHeightCartographic(o,n,a,r){if(!o||!n||!o.longitude||!o.latitude||!n.longitude||!n.latitude)return null;var i=(n.longitude-o.longitude)/a,l=(n.latitude-o.latitude)/a,s=((n.height||0)-(o.height||0))/a,c=o.longitude+r*i,u=o.latitude+r*l,d=(o.height||0)+r*s,m=new e.Cartographic(c,u,d);return m}}return h}var Te=re(tr);var nr=`in vec3 position3DHigh;
390
+ `}};function cr(){let e={};class u{constructor(a,n){a&&(this._viewer=a,e=n);}splitCartesians3(a){for(var n=[],o=0;o<a.length;o+=3){var r=new e.Cartesian3(a[o],a[o+1],a[o+2]);n.push(r);}return n.push(n[0]),n}getLinkedPointList(a,n,o,r){if(this._viewer){var i=[],s=e.Cartographic.fromCartesian(a),l=e.Cartographic.fromCartesian(n),c=s.longitude*180/Math.PI,h=s.latitude*180/Math.PI,d=l.longitude*180/Math.PI,m=l.latitude*180/Math.PI,y=Math.sqrt((c-d)*(c-d)+(h-m)*(h-m)),p=y*o,g=e.Cartesian3.clone(a),v=e.Cartesian3.clone(n),A=e.Cartesian3.distance(g,e.Cartesian3.ZERO),w=e.Cartesian3.distance(v,e.Cartesian3.ZERO);if(e.Cartesian3.normalize(g,g),e.Cartesian3.normalize(v,v),e.Cartesian3.distance(g,v)==0)return i;var C=e.Cartesian3.angleBetween(g,v);i.push(a);for(var b=1;b<r-1;b++){var P=b*1/(r-1),_=1-P,S=Math.sin(_*C)/Math.sin(C),I=Math.sin(P*C)/Math.sin(C),x=e.Cartesian3.multiplyByScalar(g,S,new e.Cartesian3),M=e.Cartesian3.multiplyByScalar(v,I,new e.Cartesian3),T=e.Cartesian3.add(x,M,new e.Cartesian3),E=P*Math.PI,R=A*_+w*P+Math.sin(E)*p;T=e.Cartesian3.multiplyByScalar(T,R,T),i.push(T);}return i.push(n),i}}getPositionsAngle(a){if(a){var n=a.position1,o=a.position2,r=e.Transforms.eastNorthUpToFixedFrame(n),i=e.Matrix4.inverse(r,new e.Matrix4),s=e.Matrix4.multiplyByPoint(i,n,new e.Cartesian3),l=e.Matrix4.multiplyByPoint(i,o,new e.Cartesian3),c;a.type==="pitch"?c=Math.atan2(l.z-s.z,l.x-s.x):a.type==="heading"&&(c=Math.atan2(l.y-s.y,l.x-s.x));var h=c*(180/Math.PI);return h<0&&(h=h+360),h}}getPositionsArea(a){let n=0;if(a){let o=0,r=e.Ellipsoid.WGS84;a.push(a[0]);for(let i=1;i<a.length;i++){let s=r.cartographicToCartesian(this.transformWGS84ToCartographic(a[i-1])),l=r.cartographicToCartesian(this.transformWGS84ToCartographic(a[i]));o+=s.x*l.y-l.x*s.y;}n=Math.abs(o).toFixed(2);}return n}getPolygonArea(a){if(this._viewer){let n=Math.PI/180,o=180/Math.PI,r=function(l,c){var h=(l.lat||0)*n,d=(l.lng||l.lon||0)*n,m=(c.lat||0)*n,y=(c.lng||c.lon||0)*n;let p=-Math.atan2(Math.sin(d-y)*Math.cos(m),Math.cos(h)*Math.sin(m)-Math.sin(h)*Math.cos(m)*Math.cos(d-y));return p<0&&(p+=Math.PI*2),p=p*o,p},i=function(l,c,h){let d=r(c,l),m=r(c,h),y=d-m;return y<0&&(y+=360),y},s=0;for(let l=0;l<a.length-2;l++){let c=(l+1)%a.length,h=(l+2)%a.length,d=i(a[l],a[c],a[h]),m=this.getPointDistance(this.transformWGS84ToCartesian(a[l]),this.transformWGS84ToCartesian(a[c])),y=this.getPointDistance(this.transformWGS84ToCartesian(a[c]),this.transformWGS84ToCartesian(a[h]));s+=m*y*Math.abs(Math.sin(d));}return s.toFixed(2)}}getPointDistance(a,n){if(this._viewer){var o=e.Cartographic.fromCartesian(a),r=e.Cartographic.fromCartesian(n),i=new e.EllipsoidGeodesic;i.setEndPoints(o,r);var s=i.surfaceDistance;return s=Math.sqrt(Math.pow(s,2)+Math.pow(r.height-o.height,2)),s}}getPositionDistance(a){let n=0;for(let o=0;o<a.length-1;o++){let r=this.transformWGS84ToCartographic(a[o]),i=this.transformWGS84ToCartographic(a[o+1]),s=new e.EllipsoidGeodesic;s.setEndPoints(r,i);let l=s.surfaceDistance;l=Math.sqrt(Math.pow(l,2)+Math.pow(i.height-r.height,2)),n=n+l;}return n.toFixed(3)}getIntersectObj(a,n,o=[],r=false){if(this._viewer){var i=e.Cartesian3.normalize(e.Cartesian3.subtract(n,a,new e.Cartesian3),new e.Cartesian3),s=new e.Ray(a,i),l=[],c=this._viewer.scene;if(r)l=c.drillPickFromRay(s,10,o);else {var h=c.pickFromRay(s,o);e.defined(h)&&(l=[h]);}return l}}getPointOnEllipsoid(a,n,o,r,i,s,l,c,h,d){if(this._viewer){var m=new e.Cartesian3,y=new e.Cartesian3,p=new e.Quaternion,g=new e.Matrix3,v=a+n;e.Cartesian3.multiplyByScalar(r,Math.cos(v),m),e.Cartesian3.multiplyByScalar(o,Math.sin(v),y),e.Cartesian3.add(m,y,m);var A=Math.cos(a);A=A*A;var w=Math.sin(a);w=w*w;var C=s/Math.sqrt(l*A+i*w),b=C/c;return e.Quaternion.fromAxisAngle(m,b,p),e.Matrix3.fromQuaternion(p,g),e.Matrix3.multiplyByVector(g,h,d),e.Cartesian3.normalize(d,d),e.Cartesian3.multiplyByScalar(d,c,d),d}}raisePositionsToHeight(a,n,o){if(this._viewer){for(var r=new e.Cartesian3,i=new e.Cartesian3,s=new e.Cartesian3,l=new e.Cartesian3,c=n.ellipsoid,h=n.height,d=n.extrudedHeight,m=o?a.length/3*2:a.length/3,y=new Float64Array(m*3),p=a.length,g=o?p:0,v=0;v<p;v+=3){var A=v+1,w=v+2,C=e.Cartesian3.fromArray(a,v,r);c.scaleToGeodeticSurface(C,C);var b=e.Cartesian3.clone(C,i),P=c.geodeticSurfaceNormal(C,l),_=e.Cartesian3.multiplyByScalar(P,h,s);e.Cartesian3.add(C,_,C),o&&(e.Cartesian3.multiplyByScalar(P,d,_),e.Cartesian3.add(b,_,b),y[v+g]=b.x,y[A+g]=b.y,y[w+g]=b.z),y[v]=C.x,y[A]=C.y,y[w]=C.z;}return y}}computeEllipseEdgePositions(a){if(this._viewer){var n=new e.Cartesian3,o=new e.Cartesian3,r=new e.Cartesian3,i=new e.Cartesian3,s=a.semiMinorAxis,l=a.semiMajorAxis,c=a.rotation,h=a.center,d=a.granularity&&typeof a.granularity=="number"?a.granularity:Math.PI/180;d>Math.PI/12&&(d=Math.PI/12),d<Math.PI/180&&(d=Math.PI/180);var m=s*s,y=l*l,p=l*s,g=e.Cartesian3.magnitude(h),v=e.Cartesian3.normalize(h,n),A=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,h,o);A=e.Cartesian3.normalize(A,A);var w=e.Cartesian3.cross(v,A,r),C=Math.ceil(e.Math.PI*2/d),b=d,P=0,_=i,S,I=0,x=[];for(S=0;S<C;S++)P=S*b,_=this.getPointOnEllipsoid(P,c,w,A,m,p,y,g,v,_),x[I++]=_.x,x[I++]=_.y,x[I++]=_.z;var M={numPts:C,outerPositions:x};return M}}computeSectorEdgePositions(a){if(this._viewer){var n=new e.Cartesian3,o=new e.Cartesian3,r=new e.Cartesian3,i=new e.Cartesian3,s=a.semiMinorAxis,l=a.semiMajorAxis,c=a.rotation,h=a.angle?a.angle:Math.PI*2,d=a.center,m=a.granularity&&typeof a.granularity=="number"?a.granularity:Math.PI/180;m>Math.PI/12&&(m=Math.PI/12),m<Math.PI/180&&(m=Math.PI/180);var y=s*s,p=l*l,g=l*s,v=e.Cartesian3.magnitude(d),A=e.Cartesian3.normalize(d,n),w=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,d,o);w=e.Cartesian3.normalize(w,w);var C=e.Cartesian3.cross(A,w,r),b=Math.ceil(h/m),P=m,_=0,S=i,I,x=0,M=[];for(I=0;I<b;I++)_=I*P,S=this.getPointOnEllipsoid(_,c,C,w,y,g,p,v,A,S),M[x++]=S.x,M[x++]=S.y,M[x++]=S.z;var T={numPts:b,outerPositions:M};return T}}computeLonlatPointsTerrainData(a,n){if(this._viewer){for(var o=[],r=0;r<a.length;r++)o.push(e.Cartographic.fromDegrees(a[r].lon,a[r].lat));var i=this._viewer.scene.clampToHeightMostDetailed(o);i.then(function(s){n(s);});}}computeCartographicPointsTerrainData(a,n){if(this._viewer){if(a.length<=0)return;for(var o=[],r=0;r<a.length;r++)o.push(e.Cartesian3.fromRadians(a[r].longitude,a[r].latitude,a[r].height));var i=this._viewer.scene.clampToHeightMostDetailed(o),s=this;i.then(function(l){for(var c=[],h=s._viewer.scene.globe.ellipsoid,d=0;d<l.length;d++)c.push(h.cartesianToCartographic(l[d]));n&&n(c);}).catch(function(l){console.log(l);});}}_checkLonDegree(a){return !(a>180||a<-180)}_checkLatDegree(a){return !(a>90||a<-90)}computeInterpolateLineLonlat(a,n){if(!a||!n||a.lon||!a.lat||!n.lon||!n.lat||!this._checkLonDegree(a.lon)||!this._checkLonDegree(n.lon)||!this._checkLatDegree(a.lat)||!this._checkLatDegree(n.lat))return null;var o=[];o.push([a.lon,a.lat]);var r=Math.sqrt(Math.pow(n.lon-a.lon,2)+Math.pow(n.lat-a.lat,2));if(r<=1e-5)return o.push([n.lon,n.lat]),o;for(var i=r/1e-5,s=(n.lon-a.lon)/i,l=(n.lat-a.lat)/i,c=0;c<i;c++){var h=a.lon+(c+1)*s,d=a.lat+(c+1)*l;o.push([h,d]);}return o}computeInterpolateLineCartographic(a,n,o){if(!a||!n||!a.longitude||!a.latitude||!n.longitude||!n.latitude)return null;var r=[];r.push(new e.Cartographic(a.longitude,a.latitude));var i=Math.sqrt(Math.pow(n.longitude-a.longitude,2)+Math.pow(n.latitude-a.latitude,2)),s=o&&typeof o=="number"?o:1e-5*Math.PI/180;if(i<=s)return r.push(new e.Cartographic(n.longitude,n.latitude)),r;for(var l=i/s,c=(n.longitude-a.longitude)/l,h=(n.latitude-a.latitude)/l,d=0;d<l;d++){var m=a.longitude+(d+1)*c,y=a.latitude+(d+1)*h;r.push(new e.Cartographic(m,y));}return r.push(new e.Cartographic(n.longitude,n.latitude,n.height)),r}computeInterpolateLineHeightCartographic(a,n){if(!a||!n||!a.longitude||!a.latitude||!n.longitude||!n.latitude)return null;var o=[];o.push(new e.Cartographic(a.longitude,a.latitude,a.height));var r=Math.sqrt(Math.pow(n.longitude-a.longitude,2)+Math.pow(n.latitude-a.latitude,2));if(r<=1e-5*Math.PI/180)return o.push(new e.Cartographic(n.longitude,n.latitude,n.height)),o;for(var i=r/1e-5*Math.PI/180,s=(n.longitude-a.longitude)/i,l=(n.latitude-a.latitude)/i,c=((n.height||0)-(a.height||0))/i,h=0;h<i;h++){var d=a.longitude+(h+1)*s,m=a.latitude+(h+1)*l,y=(a.height||0)+(h+1)*c;o.push(new e.Cartographic(d,m,y));}return o.push(new e.Cartographic(n.longitude,n.latitude,n.height)),o}computeInterpolate2IndexLineHeightCartographic(a,n,o,r){if(!a||!n||!a.longitude||!a.latitude||!n.longitude||!n.latitude)return null;var i=[];i.push(new e.Cartographic(a.longitude,a.latitude,a.height));for(var s=(n.longitude-a.longitude)/o,l=(n.latitude-a.latitude)/o,c=((n.height||0)-(a.height||0))/o,h=0;h<r;h++){var d=a.longitude+(h+1)*s,m=a.latitude+(h+1)*l,y=(a.height||0)+(h+1)*c;i.push(new e.Cartographic(d,m,y));}return i}computeInterpolateIndexLineHeightCartographic(a,n,o,r){if(!a||!n||!a.longitude||!a.latitude||!n.longitude||!n.latitude)return null;var i=(n.longitude-a.longitude)/o,s=(n.latitude-a.latitude)/o,l=((n.height||0)-(a.height||0))/o,c=a.longitude+r*i,h=a.latitude+r*s,d=(a.height||0)+r*l,m=new e.Cartographic(c,h,d);return m}}return u}var Te=re(cr);var ur=`in vec3 position3DHigh;
391
391
  in vec3 position3DLow;
392
392
  in float batchId;
393
393
  in vec3 position;
@@ -441,7 +441,7 @@ void main() {
441
441
  vec4 roatePosition = vec4(position, 1.0);
442
442
  v_st = st;
443
443
  gl_Position = czm_projection * czm_modelView * roatePosition * translateY;
444
- }`,tn=nr;var rr=`in vec2 v_st;
444
+ }`,rn=ur;var hr=`in vec2 v_st;
445
445
  uniform sampler2D wenli;
446
446
  uniform vec2 iResolution;
447
447
  void main() {
@@ -458,7 +458,7 @@ void main() {
458
458
  vec4 mixColor = vec4(mix(vec4(ratio), centerColor, ratio));
459
459
  out_FragColor = vec4(mix(wenli, mixColor, ratio));
460
460
  }
461
- `,nn=rr;var ir=function(){var e={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},h=(function(){var l=function(u){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=u.xField||u.defaultXField,this._yField=u.yField||u.defaultYField,this._valueField=u.valueField||u.defaultValueField,u.radius&&(this._cfgRadius=u.radius);},s=e.defaultRadius;return l.prototype={_organiseData:function(c,u){var d=c[this._xField],m=c[this._yField],f=this._radi,p=this._data,g=this._max,v=this._min,A=c[this._valueField]||1,w=c.radius||this._cfgRadius||s;return p[d]||(p[d]=[],f[d]=[]),p[d][m]?p[d][m]+=A:(p[d][m]=A,f[d][m]=w),p[d][m]>g?(u?this.setDataMax(p[d][m]):this._max=p[d][m],false):{x:d,y:m,value:A,radius:w,min:v,max:g}},_unOrganizeData:function(){var c=[],u=this._data,d=this._radi;for(var m in u)for(var f in u[m])c.push({x:m,y:f,radius:d[m][f],value:u[m][f]});return {min:this._min,max:this._max,data:c}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max});},addData:function(){if(arguments[0].length>0)for(var c=arguments[0],u=c.length;u--;)this.addData.call(this,c[u]);else {var d=this._organiseData(arguments[0],true);d&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[d]});}return this},setData:function(c){var u=c.data,d=u.length;this._data=[],this._radi=[];for(var m=0;m<d;m++)this._organiseData(u[m],false);return this._max=c.max,this._min=c.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(c){return this._max=c,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(c){return this._min=c,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(c){this._coordinator=c;},_getInternalData:function(){return {max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},l})(),y=(function(){var l=function(d){var m=d.gradient||d.defaultGradient,f=document.createElement("canvas"),p=f.getContext("2d");f.width=256,f.height=1;var g=p.createLinearGradient(0,0,256,1);for(var v in m)g.addColorStop(v,m[v]);return p.fillStyle=g,p.fillRect(0,0,256,1),p.getImageData(0,0,256,1).data},s=function(d,m){var f=document.createElement("canvas"),p=f.getContext("2d"),g=d,v=d;if(f.width=f.height=d*2,m==1)p.beginPath(),p.arc(g,v,d,0,2*Math.PI,false),p.fillStyle="rgba(0,0,0,1)",p.fill();else {var A=p.createRadialGradient(g,v,d*m,g,v,d);A.addColorStop(0,"rgba(0,0,0,1)"),A.addColorStop(1,"rgba(0,0,0,0)"),p.fillStyle=A,p.fillRect(0,0,2*d,2*d);}return f},c=function(v){for(var m=[],f=v.min,p=v.max,g=v.radi,v=v.data,A=Object.keys(v),w=A.length;w--;)for(var C=A[w],_=Object.keys(v[C]),P=_.length;P--;){var b=_[P],x=v[C][b],T=g[C][b];m.push({x:C,y:b,value:x,radius:T});}return {min:f,max:p,data:m}};function u(d){var m=d.container,f=this.shadowCanvas=document.createElement("canvas"),p=this.canvas=d.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var v=getComputedStyle(d.container)||{};p.className="heatmap-canvas",this._width=p.width=f.width=d.width||+v.width.replace(/px/,""),this._height=p.height=f.height=d.height||+v.height.replace(/px/,""),this.shadowCtx=f.getContext("2d"),this.ctx=p.getContext("2d"),p.style.cssText=f.style.cssText="position:absolute;left:0;top:0;",m.style.position="relative",m.appendChild(p),this._palette=l(d),this._templates={},this._setStyles(d);}return u.prototype={renderPartial:function(d){d.data.length>0&&(this._drawAlpha(d),this._colorize());},renderAll:function(d){this._clear(),d.data.length>0&&(this._drawAlpha(c(d)),this._colorize());},_updateGradient:function(d){this._palette=l(d);},updateConfig:function(d){d.gradient&&this._updateGradient(d),this._setStyles(d);},setDimensions:function(d,m){this._width=d,this._height=m,this.canvas.width=this.shadowCanvas.width=d,this.canvas.height=this.shadowCanvas.height=m;},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height);},_setStyles:function(d){this._blur=d.blur==0?0:d.blur||d.defaultBlur,d.backgroundColor&&(this.canvas.style.backgroundColor=d.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=d.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=d.height||this._height,this._opacity=(d.opacity||0)*255,this._maxOpacity=(d.maxOpacity||d.defaultMaxOpacity)*255,this._minOpacity=(d.minOpacity||d.defaultMinOpacity)*255,this._useGradientOpacity=!!d.useGradientOpacity;},_drawAlpha:function(p){for(var m=this._min=p.min,f=this._max=p.max,p=p.data||[],g=p.length,v=1-this._blur;g--;){var A=p[g],w=A.x,C=A.y,_=A.radius,P=Math.min(A.value,f),b=w-_,x=C-_,T=this.shadowCtx,S;this._templates[_]?S=this._templates[_]:this._templates[_]=S=s(_,v);var M=(P-m)/(f-m);T.globalAlpha=M<.01?.01:M,T.drawImage(S,b,x),b<this._renderBoundaries[0]&&(this._renderBoundaries[0]=b),x<this._renderBoundaries[1]&&(this._renderBoundaries[1]=x),b+2*_>this._renderBoundaries[2]&&(this._renderBoundaries[2]=b+2*_),x+2*_>this._renderBoundaries[3]&&(this._renderBoundaries[3]=x+2*_);}},_colorize:function(){var d=this._renderBoundaries[0],m=this._renderBoundaries[1],f=this._renderBoundaries[2]-d,p=this._renderBoundaries[3]-m,g=this._width,v=this._height,A=this._opacity,w=this._maxOpacity,C=this._minOpacity,_=this._useGradientOpacity;d<0&&(d=0),m<0&&(m=0),d+f>g&&(f=g-d),m+p>v&&(p=v-m);for(var P=this.shadowCtx.getImageData(d,m,f,p),b=P.data,x=b.length,T=this._palette,S=3;S<x;S+=4){var M=b[S],E=M*4;if(E){var I;A>0?I=A:M<w?M<C?I=C:I=M:I=w,b[S-3]=T[E],b[S-2]=T[E+1],b[S-1]=T[E+2],b[S]=_?T[E+3]:I;}}this.ctx.putImageData(P,d,m),this._renderBoundaries=[1e3,1e3,0,0];},getValueAt:function(d){var m,f=this.shadowCtx,p=f.getImageData(d.x,d.y,1,1),g=p.data[3],v=this._max,A=this._min;return m=Math.abs(v-A)*(g/255)>>0,m},getDataURL:function(){return this.canvas.toDataURL()}},u})(),o=(function(){var l=false;return e.defaultRenderer==="canvas2d"&&(l=y),l})(),n={merge:function(){for(var i={},l=arguments.length,s=0;s<l;s++){var c=arguments[s];for(var u in c)i[u]=c[u];}return i}},a=(function(){var l=(function(){function d(){this.cStore={};}return d.prototype={on:function(m,f,p){var g=this.cStore;g[m]||(g[m]=[]),g[m].push(function(v){return f.call(p,v)});},emit:function(m,f){var p=this.cStore;if(p[m])for(var g=p[m].length,v=0;v<g;v++){var A=p[m][v];A(f);}}},d})(),s=function(u){var d=u._renderer,m=u._coordinator,f=u._store;m.on("renderpartial",d.renderPartial,d),m.on("renderall",d.renderAll,d),m.on("extremachange",function(p){u._config.onExtremaChange&&u._config.onExtremaChange({min:p.min,max:p.max,gradient:u._config.gradient||u._config.defaultGradient});}),f.setCoordinator(m);};function c(){var u=this._config=n.merge(e,arguments[0]||{});if(this._coordinator=new l,u.plugin){var d=u.plugin;if(e.plugins[d]){var m=e.plugins[d];this._renderer=new m.renderer(u),this._store=new m.store(u);}else throw new Error("Plugin '"+d+"' not found. Maybe it was not registered.")}else this._renderer=new o(u),this._store=new h(u);s(this);}return c.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(u){return this._config=n.merge(this._config,u),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(u){return this._store.getValueAt?this._store.getValueAt(u):this._renderer.getValueAt?this._renderer.getValueAt(u):null}},c})(),r={create:function(i){return new a(i)},register:function(i,l){e.plugins[i]=l;}};return r},rn=ir();function ar(){let e=null,y=function(o,n,a){o&&(this._viewer=o,e=n,se(this),this._installPrimitives());};return y.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive();},_installTetrahedronPrimitive:function(){try{var o=e.Cartesian3,n=e.ComponentDatatype,a=e.PrimitiveType,r=e.BoundingSphere,i=e.GeometryAttribute,l=e.GeometryPipeline,s=e.Geometry,c=e.defined,u=e.RenderState,d=e.ShaderSource,m=e.ShaderProgram,f=e.DrawCommand,p=e.Pass,g=e.Appearance,v=e.BufferUsage,A=e.Color,w=e.VertexArray,C=e.buildModuleUrl,_=e.Matrix4,P=e.Matrix3,b=e.Texture,x=e.Resource,T=e.Transforms,S=e.defaultValue||Re,M=this._viewer,E=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";let I=function(R){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=R.position,this._createCommand=D,this._angle=0,this._distance=S(R.distance,1),this._setInterval=void 0,this._viewer=M,this._speed=S(R.speed,1),this._color=S(R.color,new A(1,1,0,.8)),this._scale=S(R.scale,new o(10,10,15)),this._texture=void 0,this._imageUrl=E,this._modelMatrix=j(this),this._height=K(this),X(this);};I.prototype.update=function(R){this.show&&(c(this._command)||(this._command=this._createCommand(R.context,this)),c(this._command)&&R.commandList.push(this._command));},I.prototype.isDestroyed=function(){return !1},I.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},I.prototype.startAnimate=function(){let R=this;this._setInterval=setInterval(O,5);function O(){R._angle=R._angle+.01,Math.sin(R._angle)>0?R._height=.01:R._height=-.01;let q=new e.Cartesian3(0,0,R._height);_.multiplyByTranslation(R._modelMatrix,q,R._modelMatrix);let Z=_.fromRotationTranslation(P.fromRotationZ(e.Math.toRadians(R._speed)));_.multiply(R._modelMatrix,Z,R._modelMatrix);}},I.prototype.closeAnimate=function(){clearInterval(this._setInterval);};let D=function(R,O){var q=!1,Z=!0,le=z(),ie=G(),ce=g.getDefaultRenderState(q,Z,void 0),ve=u.fromCache(ce),_e=new d({sources:[le]}),Ae=new d({sources:[ie]}),Me={color:function(){return O._color},myImage:function(){return c(O._texture)?O._texture:O._viewer.scene.context.defaultTexture}};let we={position:0,textureCoordinates:1};var Ge=m.fromCache({context:R,vertexShaderSource:_e,fragmentShaderSource:Ae,attributeLocations:we});return new f({vertexArray:V(R),primitiveType:a.TRIANGLES,renderState:ve,shaderProgram:Ge,uniformMap:Me,owner:this,pass:p.TRANSLUCENT,modelMatrix:O._modelMatrix})},V=function(R){let O={position:0,textureCoordinates:1};var q=W(),Z=new s({attributes:{position:new i({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.positions}),textureCoordinates:new i({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q.sts})},indices:q.indices,primitiveType:a.TRIANGLES,boundingSphere:r.fromVertices(q.positions)}),le=l.computeNormal(Z),ie=w.fromGeometry({context:R,geometry:le,attributeLocations:O,bufferUsage:v.STATIC_DRAW});return ie},W=function(){var R=new Float64Array(15);R[0]=0,R[1]=1,R[2]=0,R[3]=-1,R[4]=0,R[5]=0,R[6]=0,R[7]=-1,R[8]=0,R[9]=1,R[10]=0,R[11]=0,R[12]=0,R[13]=0,R[14]=-1;var O=new Uint16Array(18);O[0]=4,O[1]=2,O[2]=3,O[3]=4,O[4]=3,O[5]=0,O[6]=4,O[7]=0,O[8]=1,O[9]=4,O[10]=1,O[11]=2,O[12]=1,O[13]=2,O[14]=3,O[15]=1,O[16]=3,O[17]=0;var q=new Float32Array([0,0,1,0,1,1,0,1,.5,.5]);return {indices:O,positions:R,sts:q}},z=function(){var R=`#version 300 es
461
+ `,an=hr;var dr=function(){var e={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},u=(function(){var s=function(h){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=h.xField||h.defaultXField,this._yField=h.yField||h.defaultYField,this._valueField=h.valueField||h.defaultValueField,h.radius&&(this._cfgRadius=h.radius);},l=e.defaultRadius;return s.prototype={_organiseData:function(c,h){var d=c[this._xField],m=c[this._yField],y=this._radi,p=this._data,g=this._max,v=this._min,A=c[this._valueField]||1,w=c.radius||this._cfgRadius||l;return p[d]||(p[d]=[],y[d]=[]),p[d][m]?p[d][m]+=A:(p[d][m]=A,y[d][m]=w),p[d][m]>g?(h?this.setDataMax(p[d][m]):this._max=p[d][m],false):{x:d,y:m,value:A,radius:w,min:v,max:g}},_unOrganizeData:function(){var c=[],h=this._data,d=this._radi;for(var m in h)for(var y in h[m])c.push({x:m,y,radius:d[m][y],value:h[m][y]});return {min:this._min,max:this._max,data:c}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max});},addData:function(){if(arguments[0].length>0)for(var c=arguments[0],h=c.length;h--;)this.addData.call(this,c[h]);else {var d=this._organiseData(arguments[0],true);d&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[d]});}return this},setData:function(c){var h=c.data,d=h.length;this._data=[],this._radi=[];for(var m=0;m<d;m++)this._organiseData(h[m],false);return this._max=c.max,this._min=c.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(c){return this._max=c,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(c){return this._min=c,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(c){this._coordinator=c;},_getInternalData:function(){return {max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},s})(),f=(function(){var s=function(d){var m=d.gradient||d.defaultGradient,y=document.createElement("canvas"),p=y.getContext("2d");y.width=256,y.height=1;var g=p.createLinearGradient(0,0,256,1);for(var v in m)g.addColorStop(v,m[v]);return p.fillStyle=g,p.fillRect(0,0,256,1),p.getImageData(0,0,256,1).data},l=function(d,m){var y=document.createElement("canvas"),p=y.getContext("2d"),g=d,v=d;if(y.width=y.height=d*2,m==1)p.beginPath(),p.arc(g,v,d,0,2*Math.PI,false),p.fillStyle="rgba(0,0,0,1)",p.fill();else {var A=p.createRadialGradient(g,v,d*m,g,v,d);A.addColorStop(0,"rgba(0,0,0,1)"),A.addColorStop(1,"rgba(0,0,0,0)"),p.fillStyle=A,p.fillRect(0,0,2*d,2*d);}return y},c=function(v){for(var m=[],y=v.min,p=v.max,g=v.radi,v=v.data,A=Object.keys(v),w=A.length;w--;)for(var C=A[w],b=Object.keys(v[C]),P=b.length;P--;){var _=b[P],S=v[C][_],I=g[C][_];m.push({x:C,y:_,value:S,radius:I});}return {min:y,max:p,data:m}};function h(d){var m=d.container,y=this.shadowCanvas=document.createElement("canvas"),p=this.canvas=d.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var v=getComputedStyle(d.container)||{};p.className="heatmap-canvas",this._width=p.width=y.width=d.width||+v.width.replace(/px/,""),this._height=p.height=y.height=d.height||+v.height.replace(/px/,""),this.shadowCtx=y.getContext("2d"),this.ctx=p.getContext("2d"),p.style.cssText=y.style.cssText="position:absolute;left:0;top:0;",m.style.position="relative",m.appendChild(p),this._palette=s(d),this._templates={},this._setStyles(d);}return h.prototype={renderPartial:function(d){d.data.length>0&&(this._drawAlpha(d),this._colorize());},renderAll:function(d){this._clear(),d.data.length>0&&(this._drawAlpha(c(d)),this._colorize());},_updateGradient:function(d){this._palette=s(d);},updateConfig:function(d){d.gradient&&this._updateGradient(d),this._setStyles(d);},setDimensions:function(d,m){this._width=d,this._height=m,this.canvas.width=this.shadowCanvas.width=d,this.canvas.height=this.shadowCanvas.height=m;},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height);},_setStyles:function(d){this._blur=d.blur==0?0:d.blur||d.defaultBlur,d.backgroundColor&&(this.canvas.style.backgroundColor=d.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=d.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=d.height||this._height,this._opacity=(d.opacity||0)*255,this._maxOpacity=(d.maxOpacity||d.defaultMaxOpacity)*255,this._minOpacity=(d.minOpacity||d.defaultMinOpacity)*255,this._useGradientOpacity=!!d.useGradientOpacity;},_drawAlpha:function(p){for(var m=this._min=p.min,y=this._max=p.max,p=p.data||[],g=p.length,v=1-this._blur;g--;){var A=p[g],w=A.x,C=A.y,b=A.radius,P=Math.min(A.value,y),_=w-b,S=C-b,I=this.shadowCtx,x;this._templates[b]?x=this._templates[b]:this._templates[b]=x=l(b,v);var M=(P-m)/(y-m);I.globalAlpha=M<.01?.01:M,I.drawImage(x,_,S),_<this._renderBoundaries[0]&&(this._renderBoundaries[0]=_),S<this._renderBoundaries[1]&&(this._renderBoundaries[1]=S),_+2*b>this._renderBoundaries[2]&&(this._renderBoundaries[2]=_+2*b),S+2*b>this._renderBoundaries[3]&&(this._renderBoundaries[3]=S+2*b);}},_colorize:function(){var d=this._renderBoundaries[0],m=this._renderBoundaries[1],y=this._renderBoundaries[2]-d,p=this._renderBoundaries[3]-m,g=this._width,v=this._height,A=this._opacity,w=this._maxOpacity,C=this._minOpacity,b=this._useGradientOpacity;d<0&&(d=0),m<0&&(m=0),d+y>g&&(y=g-d),m+p>v&&(p=v-m);for(var P=this.shadowCtx.getImageData(d,m,y,p),_=P.data,S=_.length,I=this._palette,x=3;x<S;x+=4){var M=_[x],T=M*4;if(T){var E;A>0?E=A:M<w?M<C?E=C:E=M:E=w,_[x-3]=I[T],_[x-2]=I[T+1],_[x-1]=I[T+2],_[x]=b?I[T+3]:E;}}this.ctx.putImageData(P,d,m),this._renderBoundaries=[1e3,1e3,0,0];},getValueAt:function(d){var m,y=this.shadowCtx,p=y.getImageData(d.x,d.y,1,1),g=p.data[3],v=this._max,A=this._min;return m=Math.abs(v-A)*(g/255)>>0,m},getDataURL:function(){return this.canvas.toDataURL()}},h})(),a=(function(){var s=false;return e.defaultRenderer==="canvas2d"&&(s=f),s})(),n={merge:function(){for(var i={},s=arguments.length,l=0;l<s;l++){var c=arguments[l];for(var h in c)i[h]=c[h];}return i}},o=(function(){var s=(function(){function d(){this.cStore={};}return d.prototype={on:function(m,y,p){var g=this.cStore;g[m]||(g[m]=[]),g[m].push(function(v){return y.call(p,v)});},emit:function(m,y){var p=this.cStore;if(p[m])for(var g=p[m].length,v=0;v<g;v++){var A=p[m][v];A(y);}}},d})(),l=function(h){var d=h._renderer,m=h._coordinator,y=h._store;m.on("renderpartial",d.renderPartial,d),m.on("renderall",d.renderAll,d),m.on("extremachange",function(p){h._config.onExtremaChange&&h._config.onExtremaChange({min:p.min,max:p.max,gradient:h._config.gradient||h._config.defaultGradient});}),y.setCoordinator(m);};function c(){var h=this._config=n.merge(e,arguments[0]||{});if(this._coordinator=new s,h.plugin){var d=h.plugin;if(e.plugins[d]){var m=e.plugins[d];this._renderer=new m.renderer(h),this._store=new m.store(h);}else throw new Error("Plugin '"+d+"' not found. Maybe it was not registered.")}else this._renderer=new a(h),this._store=new u(h);l(this);}return c.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(h){return this._config=n.merge(this._config,h),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(h){return this._store.getValueAt?this._store.getValueAt(h):this._renderer.getValueAt?this._renderer.getValueAt(h):null}},c})(),r={create:function(i){return new o(i)},register:function(i,s){e.plugins[i]=s;}};return r},on=dr();function mr(){let e=null,f=function(a,n,o){a&&(this._viewer=a,e=n,se(this),this._installPrimitives());};return f.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive();},_installTetrahedronPrimitive:function(){try{var a=e.Cartesian3,n=e.ComponentDatatype,o=e.PrimitiveType,r=e.BoundingSphere,i=e.GeometryAttribute,s=e.GeometryPipeline,l=e.Geometry,c=e.defined,h=e.RenderState,d=e.ShaderSource,m=e.ShaderProgram,y=e.DrawCommand,p=e.Pass,g=e.Appearance,v=e.BufferUsage,A=e.Color,w=e.VertexArray,C=e.buildModuleUrl,b=e.Matrix4,P=e.Matrix3,_=e.Texture,S=e.Resource,I=e.Transforms,x=e.defaultValue||Be,M=this._viewer,T=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";let E=function(k){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=k.position,this._createCommand=R,this._angle=0,this._distance=x(k.distance,1),this._setInterval=void 0,this._viewer=M,this._speed=x(k.speed,1),this._color=x(k.color,new A(1,1,0,.8)),this._scale=x(k.scale,new a(10,10,15)),this._texture=void 0,this._imageUrl=T,this._modelMatrix=H(this),this._height=q(this),j(this);};E.prototype.update=function(k){this.show&&(c(this._command)||(this._command=this._createCommand(k.context,this)),c(this._command)&&k.commandList.push(this._command));},E.prototype.isDestroyed=function(){return !1},E.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},E.prototype.startAnimate=function(){let k=this;this._setInterval=setInterval(G,5);function G(){k._angle=k._angle+.01,Math.sin(k._angle)>0?k._height=.01:k._height=-.01;let Y=new e.Cartesian3(0,0,k._height);b.multiplyByTranslation(k._modelMatrix,Y,k._modelMatrix);let Q=b.fromRotationTranslation(P.fromRotationZ(e.Math.toRadians(k._speed)));b.multiply(k._modelMatrix,Q,k._modelMatrix);}},E.prototype.closeAnimate=function(){clearInterval(this._setInterval);};let R=function(k,G){var Y=!1,Q=!0,ie=z(),le=V(),ue=g.getDefaultRenderState(Y,Q,void 0),ce=h.fromCache(ue),Ae=new d({sources:[ie]}),be=new d({sources:[le]}),Me={color:function(){return G._color},myImage:function(){return c(G._texture)?G._texture:G._viewer.scene.context.defaultTexture}};let we={position:0,textureCoordinates:1};var Fe=m.fromCache({context:k,vertexShaderSource:Ae,fragmentShaderSource:be,attributeLocations:we});return new y({vertexArray:O(k),primitiveType:o.TRIANGLES,renderState:ce,shaderProgram:Fe,uniformMap:Me,owner:this,pass:p.TRANSLUCENT,modelMatrix:G._modelMatrix})},O=function(k){let G={position:0,textureCoordinates:1};var Y=U(),Q=new l({attributes:{position:new i({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:Y.positions}),textureCoordinates:new i({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Y.sts})},indices:Y.indices,primitiveType:o.TRIANGLES,boundingSphere:r.fromVertices(Y.positions)}),ie=s.computeNormal(Q),le=w.fromGeometry({context:k,geometry:ie,attributeLocations:G,bufferUsage:v.STATIC_DRAW});return le},U=function(){var k=new Float64Array(15);k[0]=0,k[1]=1,k[2]=0,k[3]=-1,k[4]=0,k[5]=0,k[6]=0,k[7]=-1,k[8]=0,k[9]=1,k[10]=0,k[11]=0,k[12]=0,k[13]=0,k[14]=-1;var G=new Uint16Array(18);G[0]=4,G[1]=2,G[2]=3,G[3]=4,G[4]=3,G[5]=0,G[6]=4,G[7]=0,G[8]=1,G[9]=4,G[10]=1,G[11]=2,G[12]=1,G[13]=2,G[14]=3,G[15]=1,G[16]=3,G[17]=0;var Y=new Float32Array([0,0,1,0,1,1,0,1,.5,.5]);return {indices:G,positions:k,sts:Y}},z=function(){var k=`#version 300 es
462
462
  in vec3 position;
463
463
  in vec3 normal;
464
464
  in vec2 st;
@@ -475,7 +475,7 @@ void main() {
475
475
  // v_pickColor = czm_batchTable_pickColor(batchId);
476
476
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
477
477
  }
478
- `;return R},G=function(){var R=`#version 300 es
478
+ `;return k},V=function(){var k=`#version 300 es
479
479
  precision mediump float;
480
480
  in vec3 v_positionEC;
481
481
  in vec3 v_normalEC;
@@ -508,18 +508,18 @@ void main() {
508
508
  out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
509
509
  #endif
510
510
  }
511
- `;return R},X=function(R){x.createIfNeeded(R._imageUrl).fetchImage().then(function(O){var q,Z=R._viewer.scene.context;c(O.internalFormat)?q=new b({context:Z,pixelFormat:O.internalFormat,width:O.naturalWidth,height:O.naturalHeight,source:{arrayBufferView:O.bufferView}}):q=new b({context:Z,source:O}),R._texture=q;});},j=function(R){let O=T.eastNorthUpToFixedFrame(R._localPosition),q=_.fromScale(R._scale),Z=_.multiply(O,q,new _);return R._scaleMatrix=q,R._enuMatrix=O,Z},K=function(R){let O=o.fromElements(0,0,R._distance,new e.Cartesian3),q=e.Matrix4.multiplyByPoint(R._enuMatrix,O,new o),Z=_.multiplyByPoint(R._viewer.scene.camera._viewMatrix,q,new o),le=_.multiplyByPoint(R._viewer.scene.camera.frustum.projectionMatrix,Z,new o);return o.normalize(le,new o).z};e.Scene.TetrahedronPrimitive=I;}catch(I){console.log(I);}},_installXyzAxisPrimitive:function(){function o(n){this._viewer=n.viewer,this._model=n.model,this._matrix=n.matrix,this._radius=void 0,this._layer=new e.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=false,this._xyzPid=void 0,this._builds();}o.prototype={_builds(){this._createAxisXYZ(),this._bindHandler();},remove(){this._layer._primitives.removeAll(),this._handler.destroy();},_createAxisXYZ:function(){this._model.readyPromise.then(n=>{let a=e.Matrix4.getTranslation(n.modelMatrix,new e.Cartesian3),r=n.boundingSphere,i=r.radius,l=new e.ArrowPolylinePrimitive({id:"axisZ",color:e.Color.RED,position:a,width:3,headWidth:5,length:i*2+50,headLength:10}),s=new e.ArrowPolylinePrimitive({id:"axisX",color:e.Color.GREEN,position:a,width:3,headWidth:5,length:i*2+50,headLength:10}),c=new e.ArrowPolylinePrimitive({id:"axisY",color:e.Color.BLUE,position:a,width:3,headWidth:5,length:i*2+50,headLength:10}),u=e.Matrix3.fromRotationY(e.Math.toRadians(90));this._rotationX=e.Matrix4.fromRotationTranslation(u),e.Matrix4.multiply(s.geometryInstances[0].modelMatrix,this._rotationX,s.geometryInstances[0].modelMatrix),e.Matrix4.multiply(s.geometryInstances[1].modelMatrix,this._rotationX,s.geometryInstances[1].modelMatrix);let d=e.Matrix3.fromRotationX(e.Math.toRadians(90));this._rotationY=e.Matrix4.fromRotationTranslation(d),e.Matrix4.multiply(c.geometryInstances[0].modelMatrix,this._rotationY,c.geometryInstances[0].modelMatrix),e.Matrix4.multiply(c.geometryInstances[1].modelMatrix,this._rotationY,c.geometryInstances[1].modelMatrix),this._layer._primitives.add(l),this._layer._primitives.add(s),this._layer._primitives.add(c),this._radius=r.radius,this._createAxisSphere();});},_createAxisSphere:function(){let n=[];for(let l=0;l<=360;l+=3){let s=Math.sin(e.Math.toRadians(l)),c=Math.cos(e.Math.toRadians(l)),u=this._radius*c,d=this._radius*s;n.push(new e.Cartesian3(u,d,0));}let a=this._createAxisSpheres("axisSphereZ",n,this._matrix,e.Color.RED);this._layer._primitives.add(a);let r=this._createAxisSpheres("axisSphereY",n,this._matrix,e.Color.GREEN);this._layer._primitives.add(r),e.Matrix4.multiply(r.geometryInstances.modelMatrix,this._rotationY,r.geometryInstances.modelMatrix);let i=this._createAxisSpheres("axisSphereX",n,this._matrix,e.Color.BLUE);this._layer._primitives.add(i),e.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationX,i.geometryInstances.modelMatrix);},_createAxisSpheres:function(n,a,r,i){let l=new e.PolylineGeometry({positions:a,width:10}),s=new e.GeometryInstance({geometry:l,id:n,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(i)}});return new e.Primitive({geometryInstances:s,appearance:new e.PolylineColorAppearance({translucent:false}),modelMatrix:r})},_updateAxis(n){if(this._layer){let r=this._layer._primitives._primitives;for(let i=1,l=r.length;i<l;i++){let s=r[i],c=e.Matrix4.fromTranslation(new e.Cartesian3(n.x,n.y,n.z));e.Matrix4.multiply(s.modelMatrix,c,s.modelMatrix);}}let a=e.Matrix4.fromTranslation(new e.Cartesian3(n.x,n.y,n.z));e.Matrix4.multiply(this._model.modelMatrix,a,this._model.modelMatrix);},_updateAxisSphere(n){if(this._layer){let r=this._layer._primitives._primitives;for(let i=1,l=r.length;i<l;i++){let s=r[i],c=e.Matrix4.fromRotationTranslation(n);e.Matrix4.multiply(s.modelMatrix,c,s.modelMatrix);}}let a=e.Matrix4.fromRotationTranslation(n);e.Matrix4.multiply(this._model.modelMatrix,a,this._model.modelMatrix);},_bindHandler(){this._handler.setInputAction(n=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case "axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case "axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case "axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case "axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case "axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case "axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case "axisSphereX":this._updateAxisSphere(e.Matrix3.fromRotationX(e.Math.toRadians(1)));break;case "axisSphereY":this._updateAxisSphere(e.Matrix3.fromRotationY(e.Math.toRadians(1)));break;case "axisSphereZ":this._updateAxisSphere(e.Matrix3.fromRotationZ(e.Math.toRadians(1)));break}},e.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(n=>{let a=viewer.scene.pick(n.position);a&&a.id&&(this._xyzPid=a.id,this._xyzState=true);},e.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=false,this._xyzPid=void 0;},e.ScreenSpaceEventType.LEFT_UP);}},e.Scene.XyzAxisPrimitive=o;},_installArrowPolylinePrimitive:function(){function o(a={}){this._color=a.color||e.Color.RED,this._width=a.width||3,this._headWidth=a.headWidth||2*this._width,this._length=a.length||300,this._headLength=a.headLength||10,this._inverse=a.inverse||false,this.position=a.position;let r=a.id,i=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),l=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth})),s=(this._length+this._headLength)/2;return this._inverse&&(s=-s),n(l,[0,0,s]),new e.Primitive({modelMatrix:e.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new e.GeometryInstance({id:r+"-line",geometry:i}),new e.GeometryInstance({id:r+"-arrow",geometry:l})],appearance:new e.MaterialAppearance({material:e.Material.fromType("Color",{color:this._color})})})}let n=function(a,r){let i=new e.Cartesian3;r.length?(i.x=r[0],i.y=r[1],i.z=r[2]):e.Cartesian3.clone(r,i);for(let l=0;l<a.attributes.position.values.length;l+=3)a.attributes.position.values[l]+=i.x,a.attributes.position.values[l+1]+=i.y,a.attributes.position.values[l+2]+=i.z;};e.Scene.ArrowPolylinePrimitive=o;},_installShadowPrimitive:function(){let o=e.defaultValue||Re,n=`in vec3 position;
511
+ `;return k},j=function(k){S.createIfNeeded(k._imageUrl).fetchImage().then(function(G){var Y,Q=k._viewer.scene.context;c(G.internalFormat)?Y=new _({context:Q,pixelFormat:G.internalFormat,width:G.naturalWidth,height:G.naturalHeight,source:{arrayBufferView:G.bufferView}}):Y=new _({context:Q,source:G}),k._texture=Y;});},H=function(k){let G=I.eastNorthUpToFixedFrame(k._localPosition),Y=b.fromScale(k._scale),Q=b.multiply(G,Y,new b);return k._scaleMatrix=Y,k._enuMatrix=G,Q},q=function(k){let G=a.fromElements(0,0,k._distance,new e.Cartesian3),Y=e.Matrix4.multiplyByPoint(k._enuMatrix,G,new a),Q=b.multiplyByPoint(k._viewer.scene.camera._viewMatrix,Y,new a),ie=b.multiplyByPoint(k._viewer.scene.camera.frustum.projectionMatrix,Q,new a);return a.normalize(ie,new a).z};e.Scene.TetrahedronPrimitive=E;}catch(E){console.log(E);}},_installXyzAxisPrimitive:function(){function a(n){this._viewer=n.viewer,this._model=n.model,this._matrix=n.matrix,this._radius=void 0,this._layer=new e.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=false,this._xyzPid=void 0,this._builds();}a.prototype={_builds(){this._createAxisXYZ(),this._bindHandler();},remove(){this._layer._primitives.removeAll(),this._handler.destroy();},_createAxisXYZ:function(){this._model.readyPromise.then(n=>{let o=e.Matrix4.getTranslation(n.modelMatrix,new e.Cartesian3),r=n.boundingSphere,i=r.radius,s=new e.ArrowPolylinePrimitive({id:"axisZ",color:e.Color.RED,position:o,width:3,headWidth:5,length:i*2+50,headLength:10}),l=new e.ArrowPolylinePrimitive({id:"axisX",color:e.Color.GREEN,position:o,width:3,headWidth:5,length:i*2+50,headLength:10}),c=new e.ArrowPolylinePrimitive({id:"axisY",color:e.Color.BLUE,position:o,width:3,headWidth:5,length:i*2+50,headLength:10}),h=e.Matrix3.fromRotationY(e.Math.toRadians(90));this._rotationX=e.Matrix4.fromRotationTranslation(h),e.Matrix4.multiply(l.geometryInstances[0].modelMatrix,this._rotationX,l.geometryInstances[0].modelMatrix),e.Matrix4.multiply(l.geometryInstances[1].modelMatrix,this._rotationX,l.geometryInstances[1].modelMatrix);let d=e.Matrix3.fromRotationX(e.Math.toRadians(90));this._rotationY=e.Matrix4.fromRotationTranslation(d),e.Matrix4.multiply(c.geometryInstances[0].modelMatrix,this._rotationY,c.geometryInstances[0].modelMatrix),e.Matrix4.multiply(c.geometryInstances[1].modelMatrix,this._rotationY,c.geometryInstances[1].modelMatrix),this._layer._primitives.add(s),this._layer._primitives.add(l),this._layer._primitives.add(c),this._radius=r.radius,this._createAxisSphere();});},_createAxisSphere:function(){let n=[];for(let s=0;s<=360;s+=3){let l=Math.sin(e.Math.toRadians(s)),c=Math.cos(e.Math.toRadians(s)),h=this._radius*c,d=this._radius*l;n.push(new e.Cartesian3(h,d,0));}let o=this._createAxisSpheres("axisSphereZ",n,this._matrix,e.Color.RED);this._layer._primitives.add(o);let r=this._createAxisSpheres("axisSphereY",n,this._matrix,e.Color.GREEN);this._layer._primitives.add(r),e.Matrix4.multiply(r.geometryInstances.modelMatrix,this._rotationY,r.geometryInstances.modelMatrix);let i=this._createAxisSpheres("axisSphereX",n,this._matrix,e.Color.BLUE);this._layer._primitives.add(i),e.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationX,i.geometryInstances.modelMatrix);},_createAxisSpheres:function(n,o,r,i){let s=new e.PolylineGeometry({positions:o,width:10}),l=new e.GeometryInstance({geometry:s,id:n,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(i)}});return new e.Primitive({geometryInstances:l,appearance:new e.PolylineColorAppearance({translucent:false}),modelMatrix:r})},_updateAxis(n){if(this._layer){let r=this._layer._primitives._primitives;for(let i=1,s=r.length;i<s;i++){let l=r[i],c=e.Matrix4.fromTranslation(new e.Cartesian3(n.x,n.y,n.z));e.Matrix4.multiply(l.modelMatrix,c,l.modelMatrix);}}let o=e.Matrix4.fromTranslation(new e.Cartesian3(n.x,n.y,n.z));e.Matrix4.multiply(this._model.modelMatrix,o,this._model.modelMatrix);},_updateAxisSphere(n){if(this._layer){let r=this._layer._primitives._primitives;for(let i=1,s=r.length;i<s;i++){let l=r[i],c=e.Matrix4.fromRotationTranslation(n);e.Matrix4.multiply(l.modelMatrix,c,l.modelMatrix);}}let o=e.Matrix4.fromRotationTranslation(n);e.Matrix4.multiply(this._model.modelMatrix,o,this._model.modelMatrix);},_bindHandler(){this._handler.setInputAction(n=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case "axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case "axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case "axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case "axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case "axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case "axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case "axisSphereX":this._updateAxisSphere(e.Matrix3.fromRotationX(e.Math.toRadians(1)));break;case "axisSphereY":this._updateAxisSphere(e.Matrix3.fromRotationY(e.Math.toRadians(1)));break;case "axisSphereZ":this._updateAxisSphere(e.Matrix3.fromRotationZ(e.Math.toRadians(1)));break}},e.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(n=>{let o=viewer.scene.pick(n.position);o&&o.id&&(this._xyzPid=o.id,this._xyzState=true);},e.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=false,this._xyzPid=void 0;},e.ScreenSpaceEventType.LEFT_UP);}},e.Scene.XyzAxisPrimitive=a;},_installArrowPolylinePrimitive:function(){function a(o={}){this._color=o.color||e.Color.RED,this._width=o.width||3,this._headWidth=o.headWidth||2*this._width,this._length=o.length||300,this._headLength=o.headLength||10,this._inverse=o.inverse||false,this.position=o.position;let r=o.id,i=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),s=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth})),l=(this._length+this._headLength)/2;return this._inverse&&(l=-l),n(s,[0,0,l]),new e.Primitive({modelMatrix:e.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new e.GeometryInstance({id:r+"-line",geometry:i}),new e.GeometryInstance({id:r+"-arrow",geometry:s})],appearance:new e.MaterialAppearance({material:e.Material.fromType("Color",{color:this._color})})})}let n=function(o,r){let i=new e.Cartesian3;r.length?(i.x=r[0],i.y=r[1],i.z=r[2]):e.Cartesian3.clone(r,i);for(let s=0;s<o.attributes.position.values.length;s+=3)o.attributes.position.values[s]+=i.x,o.attributes.position.values[s+1]+=i.y,o.attributes.position.values[s+2]+=i.z;};e.Scene.ArrowPolylinePrimitive=a;},_installShadowPrimitive:function(){let a=e.defaultValue||Be,n=`in vec3 position;
512
512
  uniform mat4 u_modelViewMatrix;
513
513
  void main()
514
514
  {
515
515
  gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);
516
516
  }
517
- `,a=`uniform vec4 u_bgColor;
517
+ `,o=`uniform vec4 u_bgColor;
518
518
  void main()
519
519
  {
520
520
  out_FragColor = u_bgColor;
521
521
  }
522
- `;function r(i){i=o(i,o.EMPTY_OBJECT);var l=i.scene;if(!e.defined(l))throw new e.DeveloperError("scene is required.");this._scene=l;var s=l._context;if(!e.defined(s))throw new e.DeveloperError("context is required.");if(!e.defined(i.viewerPosition))throw new e.DeveloperError("this view position is required.");this._viewerPosition=i.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new e.Camera(l),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=o(i.horizontalFov,60),this._verticalFov=o(i.verticalFov,45),this._cameraUpdated=false,this._targetPoint=this._viewerPosition.clone();var c=new e.Cartesian3(0,0,100),u=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.multiplyByPoint(u,c,this._targetPoint),this._distance=100,this._cameraUpdated=false,this._modelMatrix=new e.Matrix4,this._shadowMap=new e.ShadowMap({context:s,enabled:true,lightCamera:this._depthCamera,cascadesEnabled:false}),this.show=true,this._invisiblyColor=e.Color.RED,this._visiblyColor=e.Color.GREEN,this._shadowMap.useCustomColor=true,this.shadowMap._customColor={invisibly:e.Color.RED,visibly:e.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var d=this._indices,m=0;d[m++]=0,d[m++]=1,d[m++]=0,d[m++]=21,d[m++]=0,d[m++]=85,d[m++]=0,d[m++]=105;for(var f=0,p=0;p<5;++p){f++;for(var g=0;g<20;++g)d[m++]=f++,d[m++]=f;}f++;for(var v=0;v<20;++v)for(var A=0;A<5;++A)d[m++]=f,d[m++]=5+f++;this._initialized=true;},this._debugLightFrustum=void 0,this._debugShow=true;}Object.defineProperties(r.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(i){this.shadowMap.debugShow=i,this._debugShow=i;}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(i){this._invisiblyColor=i;var l=this.shadowMap;l._customColor.invisibly=i;}},visiblyColor:{get:function(){return this._visiblyColor},set:function(i){this._visiblyColor=i;var l=this.shadowMap;l._customColor.visibly=i;}},viewerPosition:{get:function(){return this._viewerPosition},set:function(i){this._viewerPosition=i,this._cameraUpdated=false;}},direction:{get:function(){return this._direction},set:function(i){this._direction=i,this._cameraUpdated=false;}},pitch:{get:function(){return this._pitch},set:function(i){this._pitch=i,this._cameraUpdated=false;}},horizontalFov:{get:function(){return this._horizontalFov},set:function(i){this._horizontalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},verticalFov:{get:function(){return this._verticalFov},set:function(i){this._verticalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},distance:{get:function(){return this._distance},set:function(i){this._distance=i,this._cameraUpdated=false;}}}),r.prototype.setDebugFrustumEffect=function(i,l){if(this.debugShow){var s=this.debugLightFrustum._planesPrimitives,c=this.debugLightFrustum._outlinePrimitives;s.forEach(function(u){u.show=i;}),c.forEach(function(u){u.show=l;});}},r.prototype.update=function(i){if(this.show){this._cameraUpdated||(this._updateCamera(),this.debugShow&&(e.defined(this.debugLightFrustum)||(this._debugLightFrustum=new e.DebugCameraPrimitive({camera:this._depthCamera,color:e.Color.YELLOW,updateOnChange:true}),this.setDebugFrustumEffect(false,true))));var l=i.frustumSplits[1];i.frustumSplits[1]=this._distance,this._debugLightFrustum.update(i),i.frustumSplits[1]=l,i.shadowMaps.push(this.shadowMap);}},r.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=e.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:e.Math.toRadians(this._direction),pitch:e.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=true;},r.prototype.setPoseByTargetPoint=function(i){this.distance=e.Cartesian3.distance(this._viewerPosition,i);var l=new e.Cartesian3,s=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.inverse(s,s),e.Matrix4.multiplyByPoint(s,i,l),e.Cartesian3.normalize(l,l),this.direction=e.Math.toDegrees(Math.atan2(l.x,l.y)),this.pitch=e.Math.toDegrees(Math.asin(l.z));},r.prototype._updateHintLine=function(i){var l,s,c,u,d=this._positions,m=e.Math.toRadians(this._horizontalFov),f=e.Math.toRadians(this._verticalFov),p=Math.tan(.5*m),g=Math.tan(.5*f);s=this._distance*p,u=this._distance*g,l=-s,c=-u;var v=new e.Cartesian3(l,c,-this._distance),A=new e.Cartesian3(s,u,0);e.Matrix4.multiplyByPoint(this._modelMatrix,v,v),e.Matrix4.multiplyByPoint(this._modelMatrix,A,A);var w=e.BoundingSphere.fromCornerPoints(v,A);if(i.cullingVolume.computeVisibility(w)===Intersect.OUTSIDE)return void(this._valid=false);this._valid=true;var C=0;d[C++]=0,d[C++]=0,d[C++]=0;for(var _,P,b=Math.PI-.5*m,x=m/4,T=0;T<5;++T){_=b+T*x;for(var S=u/(this._distance/Math.cos(_)),M=Math.atan(S),E=-M,I=M/10,D=0;D<21;++D)P=E+D*I,d[C++]=this._distance*Math.cos(P)*Math.sin(_),d[C++]=this._distance*Math.sin(P),d[C++]=this._distance*Math.cos(P)*Math.cos(_);}x=m/20;for(var V=0;V<21;++V){_=b+V*x;for(var S=u/(this._distance/Math.cos(_)),M=Math.atan(S),E=-M,I=M/2,W=0;W<5;++W)P=E+W*I,d[C++]=this._distance*Math.cos(P)*Math.sin(_),d[C++]=this._distance*Math.sin(P),d[C++]=this._distance*Math.cos(P)*Math.cos(_);}var z=i.context,G=e.Buffer.createIndexBuffer({context:z,typedArray:new Uint32Array(this._indices),usage:e.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),X=e.Buffer.createVertexBuffer({context:z,typedArray:e.ComponentDatatype.createTypedArray(e.ComponentDatatype.FLOAT,this._positions),usage:e.BufferUsage.STATIC_DRAW}),j=[];j.push({index:0,vertexBuffer:X,componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:false});var K=new e.VertexArray({context:z,attributes:j,indexBuffer:G});if(e.defined(this._drawLineCommand))this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=K,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=w;else {var R=e.ShaderProgram.fromCache({context:z,vertexShaderSource:n,fragmentShaderSource:a}),O=e.RenderState.fromCache({depthTest:{enabled:true}}),q=this,Z={u_bgColor:function(){return q._lineColor},u_modelViewMatrix:function(){return z.uniformState.modelView}};this._drawLineCommand=new e.DrawCommand({boundingVolume:w,modelMatrix:q._modelMatrix,primitiveType:e.PrimitiveType.LINES,vertexArray:K,shaderProgram:R,castShadows:false,receiveShadows:false,uniformMap:Z,renderState:O,pass:e.Pass.OPAQUE});}this._hintLineUpdated=true;},e.Scene.ShadowPrimitive=r;},_installPointsPrimitive:function(){function o(n){n&&n.viewer&&n.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=n.viewer,this.build(n));}o.prototype={build:function(n){if(n.Cartesians&&n.Cartesians.length>=2){var a=[],r=[],i=[];if(n.Colors&&n.Colors.length===n.Cartesians.length*4){for(var l=0;l<n.Cartesians.length;l++)a.push(n.Cartesians[l].x),a.push(n.Cartesians[l].y),a.push(n.Cartesians[l].z);r=n.Colors;}else for(var s=0;s<n.Cartesians.length;s++)a.push(n.Cartesians[s].x),a.push(n.Cartesians[s].y),a.push(n.Cartesians[s].z),r.push(0),r.push(0),r.push(1),r.push(1);for(var c=0;c<n.Cartesians.length;c++)i.push(c);this.positionArr=new Float64Array(a),this.colorArr=new Float32Array(r),this.indiceArr=new Uint16Array(i);}else {var u=e.Cartesian3.fromDegrees(0,0,-10),d=e.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([u.x,u.y,u.z,d.x,d.y,d.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1]);}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},getVSPolylie:function(){return "in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return "in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(n,a){return new e.Appearance({renderState:{blending:e.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:true},depthMask:true},fragmentShaderSource:n,vertexShaderSource:a})},createGeometry:function(n,a,r){return new e.Geometry({attributes:{position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:a})},indices:r,primitiveType:e.PrimitiveType.POINTS,boundingSphere:e.BoundingSphere.fromVertices(n)})},remove:function(){this.primitive!=null&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null);},updateCartesianPosition:function(n){if(this.primitive!=null){if(this._viewer.scene.primitives.remove(this.primitive),n&&n.length<2)return;if(n.length===this.positionArr.length/3){var a=n[0],r=n[1];this.positionArr=new Float64Array([a.x,a.y,a.z,r.x,r.y,r.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var i=[],l=[],s=[],c=0;c<n.length;c++)i.push(n[c].x),i.push(n[c].y),i.push(n[c].z),l.push(0),l.push(0),l.push(1),l.push(1);for(var u=0;u<n.length;u++)s.push(u);this.positionArr=new Float64Array(i),this.colorArr=new Float32Array(l),this.indiceArr=new Uint16Array(s),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return},updateCartesianPositionColor:function(n,a){if(a.length===n.length*4)if(this.primitive!=null){if(viewer.scene.primitives.remove(this.primitive),n&&n.length<2)return;if(n.length===this.positionArr.length/3){var r=n[0],i=n[1];this.positionArr=new Float64Array([r.x,r.y,r.z,i.x,i.y,i.z]),this.colorArr=new Float32Array(a),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var l=[],s=[],c=0;c<n.length;c++)l.push(n[c].x),l.push(n[c].y),l.push(n[c].z);for(var c=0;c<n.length;c++)s.push(c);this.positionArr=new Float64Array(l),this.colorArr=new Float32Array(a),this.indiceArr=new Uint16Array(s),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return}},e.Scene.PointsPrimitive=o;},_installWaterPrimitive:function(){let o=this,n=function(a){this._positions=a.positions,this._url=a.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=a.frequency||1e3,this._animationSpeed=a.animationSpeed||.01,this._amplitude=a.amplitude||10,this._extrudedHeight=a.extrudedHeight||0,this._viewer=o._viewer,this._fs=this.getFS();};n.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({allowPicking:false,geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},n.prototype._createAppearence=function(){return new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},n.prototype._createGeometry=function(){return new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(e.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:true})},n.prototype.getFS=function(){var a=`
522
+ `;function r(i){i=a(i,a.EMPTY_OBJECT);var s=i.scene;if(!e.defined(s))throw new e.DeveloperError("scene is required.");this._scene=s;var l=s._context;if(!e.defined(l))throw new e.DeveloperError("context is required.");if(!e.defined(i.viewerPosition))throw new e.DeveloperError("this view position is required.");this._viewerPosition=i.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new e.Camera(s),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=a(i.horizontalFov,60),this._verticalFov=a(i.verticalFov,45),this._cameraUpdated=false,this._targetPoint=this._viewerPosition.clone();var c=new e.Cartesian3(0,0,100),h=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.multiplyByPoint(h,c,this._targetPoint),this._distance=100,this._cameraUpdated=false,this._modelMatrix=new e.Matrix4,this._shadowMap=new e.ShadowMap({context:l,enabled:true,lightCamera:this._depthCamera,cascadesEnabled:false}),this.show=true,this._invisiblyColor=e.Color.RED,this._visiblyColor=e.Color.GREEN,this._shadowMap.useCustomColor=true,this.shadowMap._customColor={invisibly:e.Color.RED,visibly:e.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var d=this._indices,m=0;d[m++]=0,d[m++]=1,d[m++]=0,d[m++]=21,d[m++]=0,d[m++]=85,d[m++]=0,d[m++]=105;for(var y=0,p=0;p<5;++p){y++;for(var g=0;g<20;++g)d[m++]=y++,d[m++]=y;}y++;for(var v=0;v<20;++v)for(var A=0;A<5;++A)d[m++]=y,d[m++]=5+y++;this._initialized=true;},this._debugLightFrustum=void 0,this._debugShow=true;}Object.defineProperties(r.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(i){this.shadowMap.debugShow=i,this._debugShow=i;}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(i){this._invisiblyColor=i;var s=this.shadowMap;s._customColor.invisibly=i;}},visiblyColor:{get:function(){return this._visiblyColor},set:function(i){this._visiblyColor=i;var s=this.shadowMap;s._customColor.visibly=i;}},viewerPosition:{get:function(){return this._viewerPosition},set:function(i){this._viewerPosition=i,this._cameraUpdated=false;}},direction:{get:function(){return this._direction},set:function(i){this._direction=i,this._cameraUpdated=false;}},pitch:{get:function(){return this._pitch},set:function(i){this._pitch=i,this._cameraUpdated=false;}},horizontalFov:{get:function(){return this._horizontalFov},set:function(i){this._horizontalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},verticalFov:{get:function(){return this._verticalFov},set:function(i){this._verticalFov=i,this._cameraUpdated=false,this._hintLineUpdated=false;}},distance:{get:function(){return this._distance},set:function(i){this._distance=i,this._cameraUpdated=false;}}}),r.prototype.setDebugFrustumEffect=function(i,s){if(this.debugShow){var l=this.debugLightFrustum._planesPrimitives,c=this.debugLightFrustum._outlinePrimitives;l.forEach(function(h){h.show=i;}),c.forEach(function(h){h.show=s;});}},r.prototype.update=function(i){if(this.show){this._cameraUpdated||(this._updateCamera(),this.debugShow&&(e.defined(this.debugLightFrustum)||(this._debugLightFrustum=new e.DebugCameraPrimitive({camera:this._depthCamera,color:e.Color.YELLOW,updateOnChange:true}),this.setDebugFrustumEffect(false,true))));var s=i.frustumSplits[1];i.frustumSplits[1]=this._distance,this._debugLightFrustum.update(i),i.frustumSplits[1]=s,i.shadowMaps.push(this.shadowMap);}},r.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=e.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:e.Math.toRadians(this._direction),pitch:e.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=true;},r.prototype.setPoseByTargetPoint=function(i){this.distance=e.Cartesian3.distance(this._viewerPosition,i);var s=new e.Cartesian3,l=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.inverse(l,l),e.Matrix4.multiplyByPoint(l,i,s),e.Cartesian3.normalize(s,s),this.direction=e.Math.toDegrees(Math.atan2(s.x,s.y)),this.pitch=e.Math.toDegrees(Math.asin(s.z));},r.prototype._updateHintLine=function(i){var s,l,c,h,d=this._positions,m=e.Math.toRadians(this._horizontalFov),y=e.Math.toRadians(this._verticalFov),p=Math.tan(.5*m),g=Math.tan(.5*y);l=this._distance*p,h=this._distance*g,s=-l,c=-h;var v=new e.Cartesian3(s,c,-this._distance),A=new e.Cartesian3(l,h,0);e.Matrix4.multiplyByPoint(this._modelMatrix,v,v),e.Matrix4.multiplyByPoint(this._modelMatrix,A,A);var w=e.BoundingSphere.fromCornerPoints(v,A);if(i.cullingVolume.computeVisibility(w)===Intersect.OUTSIDE)return void(this._valid=false);this._valid=true;var C=0;d[C++]=0,d[C++]=0,d[C++]=0;for(var b,P,_=Math.PI-.5*m,S=m/4,I=0;I<5;++I){b=_+I*S;for(var x=h/(this._distance/Math.cos(b)),M=Math.atan(x),T=-M,E=M/10,R=0;R<21;++R)P=T+R*E,d[C++]=this._distance*Math.cos(P)*Math.sin(b),d[C++]=this._distance*Math.sin(P),d[C++]=this._distance*Math.cos(P)*Math.cos(b);}S=m/20;for(var O=0;O<21;++O){b=_+O*S;for(var x=h/(this._distance/Math.cos(b)),M=Math.atan(x),T=-M,E=M/2,U=0;U<5;++U)P=T+U*E,d[C++]=this._distance*Math.cos(P)*Math.sin(b),d[C++]=this._distance*Math.sin(P),d[C++]=this._distance*Math.cos(P)*Math.cos(b);}var z=i.context,V=e.Buffer.createIndexBuffer({context:z,typedArray:new Uint32Array(this._indices),usage:e.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),j=e.Buffer.createVertexBuffer({context:z,typedArray:e.ComponentDatatype.createTypedArray(e.ComponentDatatype.FLOAT,this._positions),usage:e.BufferUsage.STATIC_DRAW}),H=[];H.push({index:0,vertexBuffer:j,componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:false});var q=new e.VertexArray({context:z,attributes:H,indexBuffer:V});if(e.defined(this._drawLineCommand))this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=q,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=w;else {var k=e.ShaderProgram.fromCache({context:z,vertexShaderSource:n,fragmentShaderSource:o}),G=e.RenderState.fromCache({depthTest:{enabled:true}}),Y=this,Q={u_bgColor:function(){return Y._lineColor},u_modelViewMatrix:function(){return z.uniformState.modelView}};this._drawLineCommand=new e.DrawCommand({boundingVolume:w,modelMatrix:Y._modelMatrix,primitiveType:e.PrimitiveType.LINES,vertexArray:q,shaderProgram:k,castShadows:false,receiveShadows:false,uniformMap:Q,renderState:G,pass:e.Pass.OPAQUE});}this._hintLineUpdated=true;},e.Scene.ShadowPrimitive=r;},_installPointsPrimitive:function(){function a(n){n&&n.viewer&&n.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=n.viewer,this.build(n));}a.prototype={build:function(n){if(n.Cartesians&&n.Cartesians.length>=2){var o=[],r=[],i=[];if(n.Colors&&n.Colors.length===n.Cartesians.length*4){for(var s=0;s<n.Cartesians.length;s++)o.push(n.Cartesians[s].x),o.push(n.Cartesians[s].y),o.push(n.Cartesians[s].z);r=n.Colors;}else for(var l=0;l<n.Cartesians.length;l++)o.push(n.Cartesians[l].x),o.push(n.Cartesians[l].y),o.push(n.Cartesians[l].z),r.push(0),r.push(0),r.push(1),r.push(1);for(var c=0;c<n.Cartesians.length;c++)i.push(c);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(r),this.indiceArr=new Uint16Array(i);}else {var h=e.Cartesian3.fromDegrees(0,0,-10),d=e.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([h.x,h.y,h.z,d.x,d.y,d.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1]);}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},getVSPolylie:function(){return "in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return "in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(n,o){return new e.Appearance({renderState:{blending:e.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:true},depthMask:true},fragmentShaderSource:n,vertexShaderSource:o})},createGeometry:function(n,o,r){return new e.Geometry({attributes:{position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:o})},indices:r,primitiveType:e.PrimitiveType.POINTS,boundingSphere:e.BoundingSphere.fromVertices(n)})},remove:function(){this.primitive!=null&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null);},updateCartesianPosition:function(n){if(this.primitive!=null){if(this._viewer.scene.primitives.remove(this.primitive),n&&n.length<2)return;if(n.length===this.positionArr.length/3){var o=n[0],r=n[1];this.positionArr=new Float64Array([o.x,o.y,o.z,r.x,r.y,r.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var i=[],s=[],l=[],c=0;c<n.length;c++)i.push(n[c].x),i.push(n[c].y),i.push(n[c].z),s.push(0),s.push(0),s.push(1),s.push(1);for(var h=0;h<n.length;h++)l.push(h);this.positionArr=new Float64Array(i),this.colorArr=new Float32Array(s),this.indiceArr=new Uint16Array(l),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return},updateCartesianPositionColor:function(n,o){if(o.length===n.length*4)if(this.primitive!=null){if(viewer.scene.primitives.remove(this.primitive),n&&n.length<2)return;if(n.length===this.positionArr.length/3){var r=n[0],i=n[1];this.positionArr=new Float64Array([r.x,r.y,r.z,i.x,i.y,i.z]),this.colorArr=new Float32Array(o),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var s=[],l=[],c=0;c<n.length;c++)s.push(n[c].x),s.push(n[c].y),s.push(n[c].z);for(var c=0;c<n.length;c++)l.push(c);this.positionArr=new Float64Array(s),this.colorArr=new Float32Array(o),this.indiceArr=new Uint16Array(l),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader);}this.primitive=viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));}else return}},e.Scene.PointsPrimitive=a;},_installWaterPrimitive:function(){let a=this,n=function(o){this._positions=o.positions,this._url=o.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=o.frequency||1e3,this._animationSpeed=o.animationSpeed||.01,this._amplitude=o.amplitude||10,this._extrudedHeight=o.extrudedHeight||0,this._viewer=a._viewer,this._fs=this.getFS();};n.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({allowPicking:false,geometryInstances:new e.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:false}));},n.prototype._createAppearence=function(){return new e.EllipsoidSurfaceAppearance({material:new e.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},n.prototype._createGeometry=function(){return new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(e.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:true})},n.prototype.getFS=function(){var o=`
523
523
  precision highp float;
524
524
  struct Light {
525
525
  vec3 position;
@@ -575,7 +575,7 @@ void main() {
575
575
  out_FragColor = vec4(reflectanceColor,1.0);
576
576
 
577
577
  }
578
- `;return a},n.prototype.getVS=function(){var a=" in vec3 normal;in vec2 st;in float batchId; out vec3 v_normalEC;uniform mat4 u_modelViewMatrix;uniform mat4 u_invWorldViewMatrix;uniform int u_clampToGroud;uniform vec3 u_camPos;uniform vec3 u_scale;out vec3 vToEye;out vec2 vUv;out vec4 vCoord;void main(void){v_normalEC = czm_normal * normal;if (u_clampToGroud == 1){} else {vCoord = gl_Position;}vUv = st;}";return a},n.prototype.getFS2=function(){return `in vec3 v_positionMC;
578
+ `;return o},n.prototype.getVS=function(){var o=" in vec3 normal;in vec2 st;in float batchId; out vec3 v_normalEC;uniform mat4 u_modelViewMatrix;uniform mat4 u_invWorldViewMatrix;uniform int u_clampToGroud;uniform vec3 u_camPos;uniform vec3 u_scale;out vec3 vToEye;out vec2 vUv;out vec4 vCoord;void main(void){v_normalEC = czm_normal * normal;if (u_clampToGroud == 1){} else {vCoord = gl_Position;}vUv = st;}";return o},n.prototype.getFS2=function(){return `in vec3 v_positionMC;
579
579
  in vec3 v_positionEC;
580
580
  in vec2 v_st;
581
581
 
@@ -601,7 +601,7 @@ void main() {
601
601
  out_FragColor.a = 0.5;
602
602
  #endif
603
603
  }
604
- `},y.prototype.updateDegreesPosition=function(a,r){if(this.primitive!=null){if(this._viewer.scene.primitives.remove(this.primitive),a&&a.length<3)return;var i=this._createGeometry(a,r||0);this.primitive=this._viewer.scene.primitives.add(new e.Primitive({allowPicking:false,geometryInstances:new e.GeometryInstance({geometry:i}),appearance:this._appearance,asynchronous:false}));}else return},e.Scene.WaterPrimitive=n;},_installTexturePrimitive:function(){function o(n){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=n.url,this._cartesians=n.cartesians,this._id=n.id||"";}o.prototype.build=function(){for(var n=[],a=[0,0,1,0,1,1,0,1],r=[0,1,2,0,2,3],i=0;i<this._cartesians.length;i++)n.push(this._cartesians[i].x),n.push(this._cartesians[i].y),n.push(this._cartesians[i].z);this._positionArr=new Float32Array(n),this._sts=new Uint8Array(a),this._indiceArr=new Uint16Array(r),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:false}));},o.prototype._createGeometry=function(){var n=new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new e.Geometry({attributes:{position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:n},indices:this._indices,primitiveType:e.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(positions)})},o.prototype._createAppearence=function(){return new e.Appearance({material:new e.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:true,faceForward:true,flat:true,translucent:false,renderState:{blending:e.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:true},depthMask:true},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},o.prototype.getVS=function(){return "in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},o.prototype.getFS=function(){return "in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},o.prototype.getMS=function(){return "czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},e.Scene.TexturePrimitive=o;},_installProbingPrimitive:function(){var o={color:new e.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:e.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},n=this._viewer;function a(r){this._viewer=n,this._length=r.length||o.length,this._center=r.center||o.center,this._color=r.color||o.color,this._repeat=r.repeat||o.repeat,this._offset=r.offset||o.offset,this._thickness=r.thickness||o.thickness,this._bottom=r.bottom||o.bottom,this._top=r.top||o.top,this._radar=void 0,this.build();}a.prototype.build=function(){var r=new e.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:e.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),i=new e.GeometryInstance({geometry:r,modelMatrix:this.getModelMatrix()}),l=new e.MaterialAppearance({material:this.getMaterial(),faceForward:false,closed:true}),s=this;this._radar=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:[i],appearance:l}));let c=function(){var u=s._radar.appearance.material.uniforms.offset;u-=.001,u>1&&(u=0),s._radar.appearance.material.uniforms.offset=u;};this._preUpdate=c,this._viewer.scene.preUpdate.addEventListener(c);},a.prototype.getModelMatrix=function(){return e.Matrix4.multiplyByTranslation(e.Transforms.eastNorthUpToFixedFrame(this._center),new e.Cartesian3(0,0,this._length*.5),new e.Matrix4)},a.prototype.updateModelMatrix=function(){},a.prototype.getMaterial=function(){var r=`uniform vec4 color;
604
+ `},f.prototype.updateDegreesPosition=function(o,r){if(this.primitive!=null){if(this._viewer.scene.primitives.remove(this.primitive),o&&o.length<3)return;var i=this._createGeometry(o,r||0);this.primitive=this._viewer.scene.primitives.add(new e.Primitive({allowPicking:false,geometryInstances:new e.GeometryInstance({geometry:i}),appearance:this._appearance,asynchronous:false}));}else return},e.Scene.WaterPrimitive=n;},_installTexturePrimitive:function(){function a(n){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=n.url,this._cartesians=n.cartesians,this._id=n.id||"";}a.prototype.build=function(){for(var n=[],o=[0,0,1,0,1,1,0,1],r=[0,1,2,0,2,3],i=0;i<this._cartesians.length;i++)n.push(this._cartesians[i].x),n.push(this._cartesians[i].y),n.push(this._cartesians[i].z);this._positionArr=new Float32Array(n),this._sts=new Uint8Array(o),this._indiceArr=new Uint16Array(r),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:false}));},a.prototype._createGeometry=function(){var n=new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new e.Geometry({attributes:{position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:n},indices:this._indices,primitiveType:e.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(positions)})},a.prototype._createAppearence=function(){return new e.Appearance({material:new e.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:true,faceForward:true,flat:true,translucent:false,renderState:{blending:e.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:true},depthMask:true},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},a.prototype.getVS=function(){return "in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},a.prototype.getFS=function(){return "in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},a.prototype.getMS=function(){return "czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},e.Scene.TexturePrimitive=a;},_installProbingPrimitive:function(){var a={color:new e.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:e.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},n=this._viewer;function o(r){this._viewer=n,this._length=r.length||a.length,this._center=r.center||a.center,this._color=r.color||a.color,this._repeat=r.repeat||a.repeat,this._offset=r.offset||a.offset,this._thickness=r.thickness||a.thickness,this._bottom=r.bottom||a.bottom,this._top=r.top||a.top,this._radar=void 0,this.build();}o.prototype.build=function(){var r=new e.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:e.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),i=new e.GeometryInstance({geometry:r,modelMatrix:this.getModelMatrix()}),s=new e.MaterialAppearance({material:this.getMaterial(),faceForward:false,closed:true}),l=this;this._radar=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:[i],appearance:s}));let c=function(){var h=l._radar.appearance.material.uniforms.offset;h-=.001,h>1&&(h=0),l._radar.appearance.material.uniforms.offset=h;};this._preUpdate=c,this._viewer.scene.preUpdate.addEventListener(c);},o.prototype.getModelMatrix=function(){return e.Matrix4.multiplyByTranslation(e.Transforms.eastNorthUpToFixedFrame(this._center),new e.Cartesian3(0,0,this._length*.5),new e.Matrix4)},o.prototype.updateModelMatrix=function(){},o.prototype.getMaterial=function(){var r=`uniform vec4 color;
605
605
  uniform float repeat;
606
606
  uniform float offset;
607
607
  uniform float thickness;
@@ -617,7 +617,7 @@ void main() {
617
617
  material.diffuse = color.rgb;
618
618
  material.alpha = a * color.a;
619
619
  return material;
620
- }`;return new e.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:r},translucent:false})},a.prototype.remove=function(){this._preUpdate&&(this._viewer.scene.preUpdate.removeEventListener(this._preUpdate),this._preUpdate=null),this._radar&&(this._viewer.scene.primitives.remove(this._radar),this._radar=void 0);},a.prototype.destroy=function(){this.remove(),this._destroyed=true;},a.prototype.isDestroyed=function(){return this._destroyed===true},e.Scene.ProbingPrimitive=a;},_initCustomPrimitive:function(o){let n=e;function a({img:r,center:i,height1:l=0,height2:s=3e5,scale:c=.003}){this.drawCommand=null,this._texture=null,this._image=null,this.img=r,this.center=i,this.height1=l,this.height2=s,this.scale=c;}return a.prototype.update=function(r){this._destroyed!==true&&(this.drawCommand===null&&this.createDrawCommand(r.context),this._texture===null&&this.createTexture(r.context),r.commandList.push(this.drawCommand));},a.prototype.isDestroyed=function(){return this._destroyed===true},a.prototype.destroy=function(){this._texture&&!this._texture.isDestroyed()&&this._texture.destroy(),this._texture=null,this.drawCommand&&this.drawCommand.vertexArray&&!this.drawCommand.vertexArray.isDestroyed()&&this.drawCommand.vertexArray.destroy(),this.drawCommand=null,this._destroyed=true;},a.prototype.createTexture=function(r){this._image===null&&(this._image=new Image,this._image.src=this.img||"static/data/images/Textures/beautiful.jpg",this._image.onload=()=>{this._texture=new n.Texture({context:r,source:this._image});});},a.prototype.createDrawCommand=function(r){let i=this.createPyramidGeometry(),l=n.VertexArray.fromGeometry({context:r,geometry:i,attributeLocations:n.GeometryPipeline.createAttributeLocations(i)}),s=n.ShaderProgram.fromCache({context:r,vertexShaderSource:tn,fragmentShaderSource:nn,attributeLocations:n.GeometryPipeline.createAttributeLocations(i)}),c=new n.Cartesian2(r.canvas.width,r.canvas.height),u={v1:()=>this.v1,v2:()=>this.v2,wenli:()=>this._texture!==null?this._texture:r.defaultTexture,iResolution:()=>c},d=n.RenderState.fromCache();this.drawCommand=new n.DrawCommand({vertexArray:l,shaderProgram:s,uniformMap:u,renderState:d,pass:n.Pass.OPAQUE});},a.prototype.createPyramidGeometry=function(){let r=this.height1,i=this.height2,l=this.scale,s=this.center||[104.057605,30.607196],c=A(s,[-l,l]),u=A(s,[l,l]),d=A(s,[-l,-l]),m=A(s,[l,l]),f=[],p=[0,1,3,0,1,2,0,2,4,0,3,4,1,2,3,2,3,4],g=[.5,.5,0,1,1,1,0,0,1,0];f.push(...v(s,r),...v(c),...v(u),...v(d),...v(m)),this.v1=new n.Cartesian3(...v(s,r)),this.v2=new n.Cartesian3(...v(s,i));function v(C,_=i){let P=n.Cartesian3.fromDegrees(...C,_);return [P.x,P.y,P.z]}function A(C,_){return [_[0]+C[0],_[1]+C[1]]}return new n.Geometry({attributes:{position:new n.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(f)}),st:new n.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(g)})},indices:p,boundingSphere:n.BoundingSphere.fromVertices(f)})},new a(o)},customPrimivive(o){return this._initCustomPrimitive(o)},_heatmap:function(){let o=null,n=1080,a=1920,r=[103.8258,30.58595,104.252263,30.87];return {getHeatmap({heatData:i,boundsArr:l,screenHeight:s,screenWidth:c}){r=l||r,s=s||n,c=c||a;let u=[];for(let m of i){let f=m.lng,p=m.lat,g=Math.round((f-r[0])/(r[2]-r[0])*a),v=n-Math.round((p-r[1])/(r[3]-r[1])*n);u.push({x:g,y:v,value:m.num});}return this.createHeatmap(u),this.createPrimitive()},createHeatmap(i){var l=document.createElement("div");l.setAttribute("style","width: "+a+"px; height: "+n+"px; margin: 0px; display: none;"),document.body.appendChild(l),o=rn.create({container:l,radius:24,maxOpacity:1,minOpacity:.1,blur:.85,gradient:{".2":"blue",".4":"green",".6":"yellow",".8":"orange",".9":"red"}}),o.setData({min:0,max:100,data:i});},createPrimitive(){let i=new e.ImageMaterialProperty({image:o._renderer.canvas}),l=this.generateGeometryInstance(),s=new e.MaterialAppearance({material:e.Material.fromType(e.Material.ImageType,i.getValue(new e.JulianDate))}),c={geometryInstances:l,appearance:s,allowPicking:false,asynchronous:false,show:false};return new e.Primitive(c)},generateGeometryInstance(){let i=r[2]-r[0],l=r[3]-r[1],s=r[0],c=r[1],u=.001,d=.001,m=0,f=5,p=Math.floor(i/u),g=Math.floor(l/d),v=[];for(let x=0;x<g+1;x++){let T=[];for(let S=0;S<p+1;S++){let M=s+(S==p?i:S*u),E=c+(x==g?l:x*d),I={x:Math.round((M-s)/i*a),y:n-Math.round((E-c)/l*n)},D=o.getValueAt(I),V=o._renderer.ctx.getImageData(I.x,I.y,1,1).data;T.push([M,E,m+D*f,V.map(W=>W/255),[(M-s)/i,(E-c)/l]]);}v.push(T);}let A=[],w=[],C=[],_=[],b=0;for(let x=0;x<g;x++)for(let T=0;T<p;T++){let S=v[x][T],M=v[x][T+1],E=v[x+1][T+1],I=v[x+1][T];this.addVertices(S,A,C,_),this.addVertices(M,A,C,_),this.addVertices(E,A,C,_),this.addVertices(S,A,C,_),this.addVertices(E,A,C,_),this.addVertices(I,A,C,_),w.push(b+0,b+1,b+2,b+3,b+4,b+5),b+=6;}return new e.GeometryInstance({geometry:e.GeometryPipeline.computeNormal(this.generateGeometry(A,C,w,_))})},addVertices(i,l,s,c){let u=e.Cartesian3.fromDegrees(i[0],i[1],i[2]);l.push(u.x,u.y,u.z),s.push(i[3][0],i[3][1],i[3][2],i[3][3]),c.push(i[4][0],i[4][1]);},generateGeometry(i,l,s,c){var u=new e.GeometryAttributes({position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(i)}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:new Float32Array(l)}),st:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(c)})});let d=e.BoundingSphere.fromVertices(i,new e.Cartesian3(0,0,0),3);return new e.Geometry({attributes:u,indices:s,primitiveType:e.PrimitiveType.TRIANGLES,boundingSphere:d})}}},createHeatmap3d(o){return this._heatmap().getHeatmap(o)}},y}var ut=re(ar);function or(){let e=null;class h{constructor(o,n){e=n,this._viewer=o,this._labelEntity=null,this.$graphics=new ye(o,n),this.isInit=false,se(this),ae(this,()=>{this._labelEntity&&this._viewer&&(this._viewer.entities.remove(this._labelEntity),this._labelEntity=null),Ce(this.$graphics);});}initTool(){this.isInit||(this._labelEntity=this._viewer.entities.add({position:e.Cartesian3.fromDegrees(0,0),label:this.$graphics.getLabelGraphics({l_text:"\u64CD\u4F5C\u63D0\u793A",l_fillColor:e.Color.CYAN,l_outlineColor:e.Color.BLACK})}),this._labelEntity.show=false,this.isInit=true);}setVisible(o){this.isInit&&(this._labelEntity.show=!!o);}showAt(o,n){if(this.isInit&&o&&n){this._labelEntity.show=true;var a=this._viewer.camera.pickEllipsoid(o,this._viewer.scene.globe.ellipsoid);a?(this._labelEntity.position=a,this._labelEntity.show=true,this._labelEntity.label.text=n):this._labelEntity.show=false;}}showAtCartesian(o,n){this.isInit&&o&&n&&(this._labelEntity.show=true,this._labelEntity.position=o,this._labelEntity.show=true,this._labelEntity.label.text=n);}}return h}var Ct=re(or);function lr(){let h=null,y=null,o=function(n,a,r){if(n){h=a,this._drawLayer=new h.CustomDataSource("drawLayer"),Ne(ye,ee),this.$graphics=new ye(n,a),n&&n.dataSources.add(this._drawLayer),this.tooltip=new Ct(n,a),this.tooltip.initTool();let i=this._drawLayer,l=this.$graphics,s=this.tooltip;se(this),ae(this,()=>{this.removeEventHandler(),this.removeAll(),Ce(s),Ce(l),this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._drawLayer===i&&(this._drawLayer=void 0));});}};return o.prototype={drawPointGraphics:function(n){if(n=n||{},n.style=n.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:true,scale:1,pixelOffset:new h.Cartesian2(0,-20)},this._viewer&&n){var a=new h.Entity,r,i=[],l,s=this,c=new h.ScreenSpaceEventHandler(this._viewer.scene.canvas);y=c,c.setInputAction(function(u){var d=s.getCatesian3FromPX(u.position);s.tooltip.showAtCartesian(d,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),d&&d.x&&(r=d,i.push(d));},h.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(u){var d=s.getCatesian3FromPX(u.endPosition);d&&d.x&&(i=[],r=d,i.push(d)),c.destroy(),c=null,s.tooltip.setVisible(false),typeof n.callback=="function"&&n.callback(s.transformCartesianArrayToWGS84Array(i),l);},h.ScreenSpaceEventType.RIGHT_CLICK),a.billboard=n.style,a.position=new h.CallbackProperty(function(){return r},false),l=this._drawLayer.entities.add(a);}},_drawComand:function(n,a){var r=[],i=this,l,s,c,u=false,d=new h.PolygonHierarchy,m=new h.ScreenSpaceEventHandler(this._viewer.scene.canvas);y=m;function f(v,A){let w=new h.Entity;return a=="line"?w.polyline={positions:v,width:n.width||5,granularity:i._objHasOwnProperty(n,"granularity",h.Math.RADIANS_PER_DEGREE),arcType:i._objHasOwnProperty(n,"arcType",h.ArcType.GEODESIC),material:n.material||h.Color.BLUE.withAlpha(.8),clampToGround:i._objHasOwnProperty(n,"clampToGround",false),clampToS3M:i._objHasOwnProperty(n,"clampToS3M",false)}:a==="polygon"&&(w.polyline=n.style,w.polyline.positions=v,w.polygon={hierarchy:A,material:n.material||h.Color.WHITE.withAlpha(.7),clampToGround:i._objHasOwnProperty(n,"clampToGround",false)},w.clampToS3M=true),i._drawLayer.entities.add(w)}function p(){a=="polygon"&&(r.push(r[0]),d.positions.push(r[0])),l=f(r,r),n.height&&(l.polygon.extrudedHeight=n.height,l.polygon.material=h.Color.BLUE.withAlpha(.5)),n.measure&&a=="polygon"&&g(r[0],true),typeof n.callback=="function"&&!u&&n.callback(i.transformCartesianArrayToWGS84Array(r),l),i._drawLayer.entities.remove(c),i._drawLayer.entities.remove(s),c=void 0,s=void 0,r=[];}let g=function(v,A=false,w=false){var C=new h.Entity;C.position=v,C.point={pixelSize:10,outlineColor:h.Color.BLUE,outlineWidth:5};var _="",P=i.transformCartesianArrayToWGS84Array(r)||[];return a==="line"?_=(i.getPositionDistance(P)/1e3).toFixed(4)+"\u516C\u91CC":a==="polygon"&&A&&(_=(i.getPositionsArea(P)/1e6).toFixed(4)+"\u5E73\u65B9\u516C\u91CC"),(a==="line"||a==="polygon"&&A)&&!w&&(C.label={text:_,show:true,showBackground:true,font:"14px monospace",horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.BOTTOM,pixelOffset:new h.Cartesian2(-20,-80)}),i._drawLayer.entities.add(C)};m.setInputAction(function(v){let A=i.getCatesian3FromPX(v.position);if(h.defined(A)){let w=A.clone();if(r.length===0){c=g(w,false,true),d.positions.push(A.clone()),r.push(w);let C=new h.CallbackProperty(function(){return r},false),_=new h.CallbackProperty(function(){return a==="polygon"?d:r},false);s=f(C,_);}d.positions.push(A.clone()),r.push(w),n.measure&&g(w),n.type==="straightLine"&&r.length==3&&(r.pop(),m.destroy(),m=null,i.tooltip.setVisible(false),typeof n.callback=="function"&&(r=i._excludeDuplicatesCartesian(r),u=true,n.callback(r,s),p()));}},h.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(v){var A=i.getCatesian3FromPX(v.endPosition);i.tooltip.showAtCartesian(A,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),h.defined(c)&&h.defined(A)&&(r.pop(),r.push(A.clone()),d.positions.pop(),d.positions.push(A.clone()),c.position.setValue(A));},h.ScreenSpaceEventType.MOUSE_MOVE),m.setInputAction(function(v){r=i._excludeDuplicatesCartesian(r),p(),l=void 0,i.tooltip.setVisible(false),m.destroy(),m=null;},h.ScreenSpaceEventType.RIGHT_CLICK);},_excludeDuplicatesCartesian(n){var a=n.reduce((r,i)=>{let l=r.length;return l<1||!r[l-1].equals(i)?r.concat(i):r},[]);return a},drawLineGraphics:function(n){n=n||{},this._viewer&&n&&this._drawComand(n,"line");},drawPolygonGraphics:function(n){n=n||{};let a={width:3,material:h.Color.BLUE.withAlpha(.8),clampToGround:true};n.style?n.style=Object.assign({},a,n.style):n.style=a,this._viewer&&n&&this._drawComand(n,"polygon");},drawRectangleGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:h.Color.BLUE.withAlpha(.5),clampToGround:true},this._viewer&&n){var a=[],r=new h.Entity,i=new h.Rectangle,l=this,s,c=new h.ScreenSpaceEventHandler(this._viewer.scene.canvas);y=c,c.setInputAction(function(u){var d=l.getCatesian3FromPX(u.position);d&&d.x&&(a.length==0?a.push(d.clone()):(c.destroy(),a.push(d.clone()),i=h.Rectangle.fromCartesianArray([...a,d],h.Ellipsoid.WGS84),typeof n.callback=="function"&&n.callback(l.transformCartesianArrayToWGS84Array(a),s)));},h.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(u){var d=l.getCatesian3FromPX(u.endPosition);d&&(i=h.Rectangle.fromCartesianArray([...a,d],h.Ellipsoid.WGS84));},h.ScreenSpaceEventType.MOUSE_MOVE),r.rectangle=n.style,n.height&&(r.rectangle.extrudedHeight=n.height),r.rectangle.coordinates=new h.CallbackProperty(function(){return i},false),s=this._drawLayer.entities.add(r);}},drawCircleGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:h.Color.BLUE.withAlpha(.5),clampToGround:true},this._viewer&&n){var a=void 0,r=new h.Entity,i=this,l,s=1,c=new h.ScreenSpaceEventHandler(this._viewer.scene.canvas);y=c;let u=function(m,f){let p=h.Cartographic.fromCartesian(m),g=h.Cartographic.fromCartesian(f),v=new h.EllipsoidGeodesic;v.setEndPoints(p,g);let A=v.surfaceDistance;s=Math.sqrt(Math.pow(A,2)+Math.pow(g.height-p.height,2));},d=function(){r.ellipse=n.style,r.ellipse.semiMajorAxis=new h.CallbackProperty(function(){return s},false),r.ellipse.semiMinorAxis=new h.CallbackProperty(function(){return s},false),r.position=new h.CallbackProperty(function(){return a},false),r.point={pixelSize:5,outlineColor:h.Color.RED,outlineWidth:3},n.height&&(r.ellipse.extrudedHeight=n.height),l=i._drawLayer.entities.add(r);};c.setInputAction(function(m){var f=i.getCatesian3FromPX(m.position);i.tooltip.showAtCartesian(f,"\u5DE6\u952E\u5355\u51FB\u7ED3\u675F!"),f&&f.x&&(a?(u(a,f),i.tooltip.setVisible(false),c.destroy(),typeof n.callback=="function"&&n.callback({center:a,radius:s},l)):(a=f,d()));},h.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(m){var f=i._viewer.scene.camera.pickEllipsoid(m.endPosition,i._viewer.scene.globe.ellipsoid);a&&f&&f.x&&u(a,f);},h.ScreenSpaceEventType.MOUSE_MOVE);}},drawTrianglesGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:h.Color.BLUE.withAlpha(.5)},this._viewer&&n){var a=new h.Entity,r=new h.Entity,i=new h.Entity,l=[],s=[],c=[],u=this,d=new h.ScreenSpaceEventHandler(this._viewer.scene.canvas);y=d;let m=function(p,g){if(!p&&!g||h.Cartesian3.equals(p,g))return 0;let v=h.Cartographic.fromCartesian(p);return (h.Cartographic.fromCartesian(g).height-v.height).toFixed(2)},f=function(p){let g=h.Cartographic.fromCartesian(p[0]),v=h.Cartographic.fromCartesian(p[1]);return h.Cartesian3.fromDegrees(h.Math.toDegrees(g.longitude),h.Math.toDegrees(g.latitude),v.height)};d.setInputAction(function(p){var g=u.getCatesian3FromPX(p.position);if(!g)return false;l.length==0?(l.push(g.clone()),l.push(g.clone()),s.push(g.clone()),s.push(g.clone())):(d.destroy(),typeof n.callback=="function"&&n.callback({e:a,e2:r,e3:i}));},h.ScreenSpaceEventType.LEFT_CLICK),d.setInputAction(function(p){var g=u.getCatesian3FromPX(p.endPosition);if(g&&l.length>0){l.pop(),l.push(g.clone());let v=f(l);s.pop(),s.push(v.clone()),c.pop(),c.pop(),c.push(g.clone()),c.push(v.clone());}},h.ScreenSpaceEventType.MOUSE_MOVE),a.polyline={positions:new h.CallbackProperty(function(){return l},false),...n.style},a.position=new h.CallbackProperty(function(){return l[0]},false),a.point={pixelSize:5,outlineColor:h.Color.BLUE,outlineWidth:5},a.label={text:new h.CallbackProperty(function(){return "\u76F4\u7EBF:"+u.getPositionDistance(u.transformCartesianArrayToWGS84Array(l))+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.BOTTOM,pixelOffset:new h.Cartesian2(50,-100)},r.polyline={positions:new h.CallbackProperty(function(){return s},false),...n.style},r.position=new h.CallbackProperty(function(){return c[1]},false),r.point={pixelSize:5,outlineColor:h.Color.BLUE,outlineWidth:5},r.label={text:new h.CallbackProperty(function(){return "\u9AD8\u5EA6:"+m(s[0],s[1])+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.BOTTOM,pixelOffset:new h.Cartesian2(-20,100)},i.polyline={positions:new h.CallbackProperty(function(){return c},false),...n.style},i.position=new h.CallbackProperty(function(){return l[1]},false),i.point={pixelSize:5,outlineColor:h.Color.BLUE,outlineWidth:5},i.label={text:new h.CallbackProperty(function(){return "\u6C34\u5E73\u8DDD\u79BB:"+u.getPositionDistance(u.transformCartesianArrayToWGS84Array(c))+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.BOTTOM,pixelOffset:new h.Cartesian2(-150,-20)},this._drawLayer.entities.add(i),this._drawLayer.entities.add(r),this._drawLayer.entities.add(a);}},drawWallGraphics:function(n){n=n||{};let a={material:h.Color.BLUE.withAlpha(.5),outline:true,outlineColor:h.Color.WHITE};if(n.style?n.style=Object.assign({},a,n.style):n.style=a,this._viewer&&n){var r=this;this.drawPolygonGraphics({clampToGround:r._objHasOwnProperty(n.style,"clampToGround",true),style:{material:n.style.material},callback:function(i,l){let s=r.transformWGS84ArrayToCartesianArray(i),c=[],u=[];if(n.style.maximumHeights){let m=0;for(;m<s.length;)c.push(n.style.maximumHeights[m%2]),m++;n.style.maximumHeights=c;}if(n.style.minimumHeights){let m=0;for(;m<s.length;)u.push(n.style.minimumHeights[m%2]),m++;n.style.minimumHeights=u;}var d=r._drawLayer.entities.add({wall:{positions:s,...n.style}});typeof n.callback=="function"&&n.callback(i,d);}});}},drawEllipsoidGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var a=this;this.drawCircleGraphics({callback:function(r,i){var l=a.createGraphics();l.ellipsoid=a.$graphics.getEllipsoidGraphics({radii:r.radius}),l.position=r.center,a._drawLayer.entities.remove(i);var s=a._drawLayer.entities.add(l);typeof n.callback=="function"&&n.callback({center:r.center,radius:r.radius},s);}});}},_objHasOwnProperty(n,a,r){return n&&n.hasOwnProperty(a)?n[a]:r},drawCylinderGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var a=this;this.drawCircleGraphics({callback:function(r,i){var l=a._drawLayer.entities.add({position:r.center,cylinder:{length:r.radius*2||n.length,topRadius:n.topRadius||r.radius,bottomRadius:n.bottomRadius||r.radius,material:h.Color.BLUE.withAlpha(.5),outline:true,outlineColor:h.Color.WHITE}});a._drawLayer.entities.remove(i),typeof n.callback=="function"&&n.callback({center:r.center,radius:r.radius},l);}});}},drawCorridorGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var a=this;a.drawLineGraphics({callback:function(r,i){var l=a.createGraphics();l.corridor={positions:a.transformWGS84ArrayToCartesianArray(r),height:n.height||1,width:n.width||100,cornerType:h.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:h.Color.BLUE.withAlpha(.5),outline:true,outlineColor:h.Color.WHITE},a._drawLayer.entities.remove(i);var s=a._drawLayer.entities.add(l);typeof n.callback=="function"&&n.callback(r,s);}});}},drawPolylineVolumeGraphics:function(n){n=n||{},n.style=n.style||{};let a=n.circleRadius||20,r=n.arms||7,i=n.rOuter||150,l=n.rInner||75;if(this._viewer&&n){var s=this;s.drawLineGraphics({callback:function(c,u){var d=s.createGraphics();let m=n.shape==="fivePoint"?s.computeStar2d(r,i,l):s.computeCircleShap(a);d.polylineVolume={positions:s.transformWGS84ArrayToCartesianArray(c),shape:m,cornerType:h.CornerType.MITERED,material:n.color||h.Color.RED},s._drawLayer.entities.remove(u);var f=s._drawLayer.entities.add(d);typeof n.callback=="function"&&n.callback(c,f);}});}},removeAll(){this._drawLayer.entities.removeAll();},removeEventHandler(){y&&!y.isDestroyed()&&(y.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),y.removeInputAction(h.ScreenSpaceEventType.RIGHT_CLICK),y.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),y.destroy()),y=null;}},o}var Ve=re(lr);function cr(){let e={};class h{constructor(o,n){o&&(this._viewer=o,e=n);}mathDistance2d(o,n){return Math.sqrt(Math.pow(o[0]-n[0],2)+Math.pow(o[1]-n[1],2))}getCirclePoints2d(o,n,a,r){let i=[],l=Math.PI/180*Math.round(360/r);for(let s=0;s<r;s++){let c=n+o*Math.sin(l*s),u=a+o*Math.cos(l*s);i.unshift({x:c,y:u});}return i}wholeDistance2d(o){let n=0;return o&&Array.isArray(o)&&o.length>0&&o.forEach((a,r)=>{r<o.length-1&&(n+=this.mathDistance2d(a,o[r+1]));}),n}getBaseLength2d(o){return Math.pow(this.wholeDistance2d(o),.99)}computeStar2d(o,n,a){let r=Math.PI/o,i=2*o,l=new Array(i);for(let s=0;s<i;s++){let c=s%2===0?n:a;l[s]=new e.Cartesian2(Math.cos(s*r)*c,Math.sin(s*r)*c);}return l}computeCircleShap(o){let n=[];for(let a=0;a<360;a++){let r=e.Math.toRadians(a);n.push(new e.Cartesian2(o*Math.cos(r),o*Math.sin(r)));}return n}mid2d(o,n){return [(o[0]+n[0])/2,(o[1]+n[1])/2]}getCircleCenterOfThreePoints2d(o,n,a){let r=[(o[0]+n[0])/2,(o[1]+n[1])/2],i=[r[0]-o[1]+n[1],r[1]+o[0]-n[0]],l=[(o[0]+a[0])/2,(o[1]+a[1])/2],s=[l[0]-o[1]+a[1],l[1]+o[0]-a[0]];return this.getIntersectPoint2d(r,i,l,s)}getIntersectPoint2d(o,n,a,r){if(o[1]===n[1]){let d=(r[0]-a[0])/(r[1]-a[1])*(o[1]-a[1])+a[0],m=o[1];return [d,m]}if(a[1]===r[1]){let d=(n[0]-o[0])/(n[1]-o[1])*(a[1]-o[1])+o[0],m=a[1];return [d,m]}let i=(n[0]-o[0])/(n[1]-o[1]),l=(r[0]-a[0])/(r[1]-a[1]),s=(i*o[1]-o[0]-l*a[1]+a[0])/(i-l);return [i*s-i*o[1]+o[0],s]}getAzimuth2d(o,n){let a,r=Math.asin(Math.abs(n[1]-o[1])/this.mathDistance2d(o,n));return n[1]>=o[1]&&n[0]>=o[0]?a=r+Math.PI:n[1]>=o[1]&&n[0]<o[0]?a=Math.PI*2-r:n[1]<o[1]&&n[0]<o[0]?a=r:a=Math.PI-r,a}getAngleOfThreePoints2d(o,n,a){let r=this.getAzimuth2d(n,o)-this.getAzimuth2d(n,a);return r<0?r+Math.PI*2:r}isClockWise2d(o,n,a){return (a[1]-o[1])*(n[0]-o[0])>(n[1]-o[1])*(a[0]-o[0])}isClockWise(o,n,a){return this.isClockWise2d(o,n,a)}getPointOnLine2d(o,n,a){let r=n[0]+o*(a[0]-n[0]),i=n[1]+o*(a[1]-n[1]);return [r,i]}getCubicValue2d(o,n,a,r,i){o=Math.max(Math.min(o,1),0);let l=1-o,s=o*o,c=s*o,u=l*l,d=u*l,m=d*n[0]+3*u*o*a[0]+3*l*s*r[0]+c*i[0],f=d*n[1]+3*u*o*a[1]+3*l*s*r[1]+c*i[1];return [m,f]}getThirdPoint2d(o,n,a,r,i){let l=this.getAzimuth2d(o,n),s=i?l+a:l-a,c=r*Math.cos(s),u=r*Math.sin(s);return [n[0]+c,n[1]+u]}inherits2d(o,n){function a(){}a.prototype=n.prototype,o.superClass_=n.prototype,o.prototype=new a,o.prototype.constructor=o,o.base=function(r,i,...l){let s=Array.prototype.slice.call(arguments,2);return n.prototype[i].apply(r,s)};}getArcPoints2d(o,n,a,r){let i,l,s=[],c=r-a;c=c<0?c+Math.PI*2:c;for(let u=0;u<=100;u++){let d=a+c*u/100;i=o[0]+n*Math.cos(d),l=o[1]+n*Math.sin(d),s.push([i,l]);}return s}getBisectorNormals2d(o,n,a,r){let i=this.getNormal2d(n,a,r),l,s,c,u,d,m=Math.sqrt(i[0]*i[0]+i[1]*i[1]),f=i[0]/m,p=i[1]/m,g=this.mathDistance2d(n,a),v=this.mathDistance2d(a,r);return m>1e-4?this.isClockWise(n,a,r)?(c=o*g,u=a[0]-c*p,d=a[1]+c*f,l=[u,d],c=o*v,u=a[0]+c*p,d=a[1]-c*f,s=[u,d]):(c=o*g,u=a[0]+c*p,d=a[1]-c*f,l=[u,d],c=o*v,u=a[0]-c*p,d=a[1]+c*f,s=[u,d]):(u=a[0]+o*(n[0]-a[0]),d=a[1]+o*(n[1]-a[1]),l=[u,d],u=a[0]+o*(r[0]-a[0]),d=a[1]+o*(r[1]-a[1]),s=[u,d]),[l,s]}getNormal2d(o,n,a){let r=o[0]-n[0],i=o[1]-n[1],l=Math.sqrt(r*r+i*i);r/=l,i/=l;let s=a[0]-n[0],c=a[1]-n[1],u=Math.sqrt(s*s+c*c);s/=u,c/=u;let d=r+s,m=i+c;return [d,m]}getLeftMostControlPoint2d(o,n){let a=o[0],r=o[1],i=o[2],l,s,u=this.getBisectorNormals2d(0,a,r,i)[0],d=this.getNormal2d(a,r,i);if(Math.sqrt(d[0]*d[0]+d[1]*d[1])>1e-4){let f=this.mid2d(a,r),p=a[0]-f[0],g=a[1]-f[1],A=2/this.mathDistance2d(a,r),w=-A*g,C=A*p,_=w*w-C*C,P=2*w*C,b=C*C-w*w,x=u[0]-f[0],T=u[1]-f[1];l=f[0]+_*x+P*T,s=f[1]+P*x+b*T;}else l=a[0]+n*(r[0]-a[0]),s=a[1]+n*(r[1]-a[1]);return [l,s]}getRightMostControlPoint2d(o,n){let a=o.length,r=o[a-3],i=o[a-2],l=o[a-1],c=this.getBisectorNormals2d(0,r,i,l)[1],u=this.getNormal2d(r,i,l),d=Math.sqrt(u[0]*u[0]+u[1]*u[1]),m,f;if(d>1e-4){let p=this.mid2d(i,l),g=l[0]-p[0],v=l[1]-p[1],w=2/this.mathDistance2d(i,l),C=-w*v,_=w*g,P=C*C-_*_,b=2*C*_,x=_*_-C*C,T=c[0]-p[0],S=c[1]-p[1];m=p[0]+P*T+b*S,f=p[1]+b*T+x*S;}else m=l[0]+n*(i[0]-l[0]),f=l[1]+n*(i[1]-l[1]);return [m,f]}getCurvePoints2d(o,n){let a=this.getLeftMostControlPoint2d(n,o),r,i,l,s=[a],c=[];for(let d=0;d<n.length-2;d++){r=n[d],i=n[d+1],l=n[d+2];let m=this.getBisectorNormals2d(o,r,i,l);s=s.concat(m);}let u=this.getRightMostControlPoint2d(n,o);u&&s.push(u);for(let d=0;d<n.length-1;d++){r=n[d],i=n[d+1],c.push(r);for(let m=0;m<100;m++){let f=this.getCubicValue2d(m/100,r,s[d*2],s[d*2+1],i);c.push(f);}c.push(i);}return c}getBezierPoints2d(o){if(o.length<=2)return o;{let n=[],a=o.length-1;for(let r=0;r<=1;r+=.01){let i=0,l=0;for(let s=0;s<=a;s++){let c=this.getBinomialFactor2d(a,s),u=Math.pow(r,s),d=Math.pow(1-r,a-s);i+=c*u*d*o[s][0],l+=c*u*d*o[s][1];}n.push([i,l]);}return n.push(o[a]),n}}getFactorial2d(o){let n=1;for(let a=1;a<=o;a++)n*=a;return n}getBinomialFactor2d(o,n){return this.getFactorial2d(o)/(this.getFactorial2d(n)*this.getFactorial2d(o-n))}getQBSplinePoints2d(o){if(o.length<=2)return o;{let a=[],r=o.length-2-1;a.push(o[0]);for(let i=0;i<=r;i++)for(let l=0;l<=1;l+=.05){let s=0,c=0;for(let u=0;u<=2;u++){let d=this.getQuadricBSplineFactor2d(u,l);s+=d*o[i+u][0],c+=d*o[i+u][1];}a.push([s,c]);}return a.push(o[o.length-1]),a}}getQuadricBSplineFactor2d(o,n){let a=0;return o===0?a=Math.pow(n-1,2)/2:o===1?a=(-2*Math.pow(n,2)+2*n+1)/2:o===2&&(a=Math.pow(n,2)/2),a}}return h}var He=re(cr);function ur(){let e=null,h=function(y,o){if(y){this._viewer=y,Ne(ye,ee),this.$graphics=new ye(y,o),e=o;let n=this.$graphics;se(this),ae(this,()=>{Ce(n);});}};return h.prototype={setCircleScanEffect:function(y){if(y&&y.position){var o=y.id||"CircleScan"+parseInt(Math.random()*1e3),n=y.position,a=y.radius,r=y.color||e.Color.RED,i=y.duration||1500,l=this,s=y.circleMode||"CircleScan",c=y.border||4,u=n,d=new e.Cartesian4(u.x,u.y,u.z,1),m=this.transformCartesianToWGS84(n),f=this.transformWGS84ToCartesian({lng:m.lng,lat:m.lat,alt:m.alt+500}),p=new e.Cartesian4(f.x,f.y,f.z,1),g=new Date().getTime(),v=new e.PostProcessStage({name:o,fragmentShader:this._getCircleScanShader({get:true,border:c}),uniforms:{u_scanCenterEC:function(){return e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,d,new e.Cartesian4)},u_scanPlaneNormalEC:function(){var A=e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,d,new e.Cartesian4),w=e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,p,new e.Cartesian4),C=new e.Cartesian3;return C.x=w.x-A.x,C.y=w.y-A.y,C.z=w.z-A.z,e.Cartesian3.normalize(C,C),C},u_radius:function(){return s=="CircleScan"?a*((new Date().getTime()-g)%i)/i:a},u_scanColor:r}});return this._viewer.scene.postProcessStages.add(v),v}},setRadarScanEffect:function(y){if(y&&y.position){var o=y.id||"radarScan"+parseInt(Math.random()*1e3),n=y.position,a=y.radius,r=y.color||e.Color.RED,i=y.duration||1500,l=this,s=y.border||1,c=y.width||3,u=n,d=new e.Cartesian4(u.x,u.y,u.z,1),m=this.transformCartesianToWGS84(n),f=this.transformWGS84ToCartesian({lng:m.lng,lat:m.lat,alt:m.alt+500}),p=new e.Cartesian4(f.x,f.y,f.z,1),g=this.transformWGS84ToCartesian({lng:m.lng+.001,lat:m.lat,alt:m.alt}),v=new e.Cartesian4(g.x,g.y,g.z,1),A=new Date().getTime(),w=new e.Quaternion,C=new e.Matrix3,_=new e.Cartesian4,P=new e.Cartesian4,b=new e.Cartesian4,x=new e.Cartesian3,T=new e.Cartesian3,S=new e.PostProcessStage({name:o,fragmentShader:this._getRadarScanShader({border:s,width:c,get:true}),uniforms:{u_scanCenterEC:function(){return e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,d,_)},u_scanPlaneNormalEC:function(){var M=e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,d,_),E=e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,p,P);return x.x=E.x-M.x,x.y=E.y-M.y,x.z=E.z-M.z,e.Cartesian3.normalize(x,x),x},u_scanLineNormalEC:function(){var M=e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,d,_),E=e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,p,P),I=e.Matrix4.multiplyByVector(l._viewer.camera._viewMatrix,v,b);x.x=E.x-M.x,x.y=E.y-M.y,x.z=E.z-M.z,e.Cartesian3.normalize(x,x),T.x=I.x-M.x,T.y=I.y-M.y,T.z=I.z-M.z;var D=(new Date().getTime()-A)%i/i;return e.Quaternion.fromAxisAngle(x,D*e.Math.PI*2,w),e.Matrix3.fromQuaternion(w,C),e.Matrix3.multiplyByVector(C,T,T),e.Cartesian3.normalize(T,T),T},u_radius:a,u_scanColor:r}});return this._viewer.scene.postProcessStages.add(S),S}},satelliteScan:function(y){if(y&&y.position){var o=e.Cartesian3,n=e.GeometryInstance,a=e.Primitive,c=e.MaterialAppearance,r=e.Material,i=e.Color,l=e.Matrix4,s=e.Transforms,c=e.MaterialAppearance,u=e.CylinderGeometry;let v=y.position||[116.39,39.9],A=y.length||4e4;var d=o.fromDegrees(v[0],v[1]),m=l.multiplyByTranslation(s.eastNorthUpToFixedFrame(d),new o(0,0,A*.5),new l),f=new u({length:A,topRadius:0,bottomRadius:A*.5,vertexFormat:c.MaterialSupport.TEXTURED.vertexFormat}),p=new n({geometry:f,modelMatrix:m}),g=this._viewer.scene.primitives.add(new a({geometryInstances:p,appearance:new c({material:new r({fabric:{uniforms:{color:y.color||new i(.2,1,0,1),repeat:y.repeat||30,offset:0,thickness:y.thickness||.2},source:`
620
+ }`;return new e.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:r},translucent:false})},o.prototype.remove=function(){this._preUpdate&&(this._viewer.scene.preUpdate.removeEventListener(this._preUpdate),this._preUpdate=null),this._radar&&(this._viewer.scene.primitives.remove(this._radar),this._radar=void 0);},o.prototype.destroy=function(){this.remove(),this._destroyed=true;},o.prototype.isDestroyed=function(){return this._destroyed===true},e.Scene.ProbingPrimitive=o;},_initCustomPrimitive:function(a){let n=e;function o({img:r,center:i,height1:s=0,height2:l=3e5,scale:c=.003}){this.drawCommand=null,this._texture=null,this._image=null,this.img=r,this.center=i,this.height1=s,this.height2=l,this.scale=c;}return o.prototype.update=function(r){this._destroyed!==true&&(this.drawCommand===null&&this.createDrawCommand(r.context),this._texture===null&&this.createTexture(r.context),r.commandList.push(this.drawCommand));},o.prototype.isDestroyed=function(){return this._destroyed===true},o.prototype.destroy=function(){this._texture&&!this._texture.isDestroyed()&&this._texture.destroy(),this._texture=null,this.drawCommand&&this.drawCommand.vertexArray&&!this.drawCommand.vertexArray.isDestroyed()&&this.drawCommand.vertexArray.destroy(),this.drawCommand=null,this._destroyed=true;},o.prototype.createTexture=function(r){this._image===null&&(this._image=new Image,this._image.src=this.img||"static/data/images/Textures/beautiful.jpg",this._image.onload=()=>{this._texture=new n.Texture({context:r,source:this._image});});},o.prototype.createDrawCommand=function(r){let i=this.createPyramidGeometry(),s=n.VertexArray.fromGeometry({context:r,geometry:i,attributeLocations:n.GeometryPipeline.createAttributeLocations(i)}),l=n.ShaderProgram.fromCache({context:r,vertexShaderSource:rn,fragmentShaderSource:an,attributeLocations:n.GeometryPipeline.createAttributeLocations(i)}),c=new n.Cartesian2(r.canvas.width,r.canvas.height),h={v1:()=>this.v1,v2:()=>this.v2,wenli:()=>this._texture!==null?this._texture:r.defaultTexture,iResolution:()=>c},d=n.RenderState.fromCache();this.drawCommand=new n.DrawCommand({vertexArray:s,shaderProgram:l,uniformMap:h,renderState:d,pass:n.Pass.OPAQUE});},o.prototype.createPyramidGeometry=function(){let r=this.height1,i=this.height2,s=this.scale,l=this.center||[104.057605,30.607196],c=A(l,[-s,s]),h=A(l,[s,s]),d=A(l,[-s,-s]),m=A(l,[s,s]),y=[],p=[0,1,3,0,1,2,0,2,4,0,3,4,1,2,3,2,3,4],g=[.5,.5,0,1,1,1,0,0,1,0];y.push(...v(l,r),...v(c),...v(h),...v(d),...v(m)),this.v1=new n.Cartesian3(...v(l,r)),this.v2=new n.Cartesian3(...v(l,i));function v(C,b=i){let P=n.Cartesian3.fromDegrees(...C,b);return [P.x,P.y,P.z]}function A(C,b){return [b[0]+C[0],b[1]+C[1]]}return new n.Geometry({attributes:{position:new n.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(y)}),st:new n.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(g)})},indices:p,boundingSphere:n.BoundingSphere.fromVertices(y)})},new o(a)},customPrimivive(a){return this._initCustomPrimitive(a)},_heatmap:function(){let a=null,n=1080,o=1920,r=[103.8258,30.58595,104.252263,30.87];return {getHeatmap({heatData:i,boundsArr:s,screenHeight:l,screenWidth:c}){r=s||r,l=l||n,c=c||o;let h=[];for(let m of i){let y=m.lng,p=m.lat,g=Math.round((y-r[0])/(r[2]-r[0])*o),v=n-Math.round((p-r[1])/(r[3]-r[1])*n);h.push({x:g,y:v,value:m.num});}return this.createHeatmap(h),this.createPrimitive()},createHeatmap(i){var s=document.createElement("div");s.setAttribute("style","width: "+o+"px; height: "+n+"px; margin: 0px; display: none;"),document.body.appendChild(s),a=on.create({container:s,radius:24,maxOpacity:1,minOpacity:.1,blur:.85,gradient:{".2":"blue",".4":"green",".6":"yellow",".8":"orange",".9":"red"}}),a.setData({min:0,max:100,data:i});},createPrimitive(){let i=new e.ImageMaterialProperty({image:a._renderer.canvas}),s=this.generateGeometryInstance(),l=new e.MaterialAppearance({material:e.Material.fromType(e.Material.ImageType,i.getValue(new e.JulianDate))}),c={geometryInstances:s,appearance:l,allowPicking:false,asynchronous:false,show:false};return new e.Primitive(c)},generateGeometryInstance(){let i=r[2]-r[0],s=r[3]-r[1],l=r[0],c=r[1],h=.001,d=.001,m=0,y=5,p=Math.floor(i/h),g=Math.floor(s/d),v=[];for(let S=0;S<g+1;S++){let I=[];for(let x=0;x<p+1;x++){let M=l+(x==p?i:x*h),T=c+(S==g?s:S*d),E={x:Math.round((M-l)/i*o),y:n-Math.round((T-c)/s*n)},R=a.getValueAt(E),O=a._renderer.ctx.getImageData(E.x,E.y,1,1).data;I.push([M,T,m+R*y,O.map(U=>U/255),[(M-l)/i,(T-c)/s]]);}v.push(I);}let A=[],w=[],C=[],b=[],_=0;for(let S=0;S<g;S++)for(let I=0;I<p;I++){let x=v[S][I],M=v[S][I+1],T=v[S+1][I+1],E=v[S+1][I];this.addVertices(x,A,C,b),this.addVertices(M,A,C,b),this.addVertices(T,A,C,b),this.addVertices(x,A,C,b),this.addVertices(T,A,C,b),this.addVertices(E,A,C,b),w.push(_+0,_+1,_+2,_+3,_+4,_+5),_+=6;}return new e.GeometryInstance({geometry:e.GeometryPipeline.computeNormal(this.generateGeometry(A,C,w,b))})},addVertices(i,s,l,c){let h=e.Cartesian3.fromDegrees(i[0],i[1],i[2]);s.push(h.x,h.y,h.z),l.push(i[3][0],i[3][1],i[3][2],i[3][3]),c.push(i[4][0],i[4][1]);},generateGeometry(i,s,l,c){var h=new e.GeometryAttributes({position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(i)}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:new Float32Array(s)}),st:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(c)})});let d=e.BoundingSphere.fromVertices(i,new e.Cartesian3(0,0,0),3);return new e.Geometry({attributes:h,indices:l,primitiveType:e.PrimitiveType.TRIANGLES,boundingSphere:d})}}},createHeatmap3d(a){return this._heatmap().getHeatmap(a)}},f}var ht=re(mr);function fr(){let e=null;class u{constructor(a,n){e=n,this._viewer=a,this._labelEntity=null,this.$graphics=new pe(a,n),this.isInit=false,se(this),oe(this,()=>{this._labelEntity&&this._viewer&&(this._viewer.entities.remove(this._labelEntity),this._labelEntity=null),Ce(this.$graphics);});}initTool(){this.isInit||(this._labelEntity=this._viewer.entities.add({position:e.Cartesian3.fromDegrees(0,0),label:this.$graphics.getLabelGraphics({l_text:"\u64CD\u4F5C\u63D0\u793A",l_fillColor:e.Color.CYAN,l_outlineColor:e.Color.BLACK})}),this._labelEntity.show=false,this.isInit=true);}setVisible(a){this.isInit&&(this._labelEntity.show=!!a);}showAt(a,n){if(this.isInit&&a&&n){this._labelEntity.show=true;var o=this._viewer.camera.pickEllipsoid(a,this._viewer.scene.globe.ellipsoid);o?(this._labelEntity.position=o,this._labelEntity.show=true,this._labelEntity.label.text=n):this._labelEntity.show=false;}}showAtCartesian(a,n){this.isInit&&a&&n&&(this._labelEntity.show=true,this._labelEntity.position=a,this._labelEntity.show=true,this._labelEntity.label.text=n);}}return u}var bt=re(fr);function pr(){let u=null,f=null,a=function(n,o,r){if(n){u=o,this._drawLayer=new u.CustomDataSource("drawLayer"),je(pe,ee),this.$graphics=new pe(n,o),n&&n.dataSources.add(this._drawLayer),this.tooltip=new bt(n,o),this.tooltip.initTool();let i=this._drawLayer,s=this.$graphics,l=this.tooltip;se(this),oe(this,()=>{this.removeEventHandler(),this.removeAll(),Ce(l),Ce(s),this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._drawLayer===i&&(this._drawLayer=void 0));});}};return a.prototype={drawPointGraphics:function(n){if(n=n||{},n.style=n.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:true,scale:1,pixelOffset:new u.Cartesian2(0,-20)},this._viewer&&n){var o=new u.Entity,r,i=[],s,l=this,c=new u.ScreenSpaceEventHandler(this._viewer.scene.canvas);f=c,c.setInputAction(function(h){var d=l.getCatesian3FromPX(h.position);l.tooltip.showAtCartesian(d,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),d&&d.x&&(r=d,i.push(d));},u.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(h){var d=l.getCatesian3FromPX(h.endPosition);d&&d.x&&(i=[],r=d,i.push(d)),c.destroy(),c=null,l.tooltip.setVisible(false),typeof n.callback=="function"&&n.callback(l.transformCartesianArrayToWGS84Array(i),s);},u.ScreenSpaceEventType.RIGHT_CLICK),o.billboard=n.style,o.position=new u.CallbackProperty(function(){return r},false),s=this._drawLayer.entities.add(o);}},_drawComand:function(n,o){var r=[],i=this,s,l,c,h=false,d=new u.PolygonHierarchy,m=new u.ScreenSpaceEventHandler(this._viewer.scene.canvas);f=m;function y(v,A){let w=new u.Entity;return o=="line"?w.polyline={positions:v,width:n.width||5,granularity:i._objHasOwnProperty(n,"granularity",u.Math.RADIANS_PER_DEGREE),arcType:i._objHasOwnProperty(n,"arcType",u.ArcType.GEODESIC),material:n.material||u.Color.BLUE.withAlpha(.8),clampToGround:i._objHasOwnProperty(n,"clampToGround",false),clampToS3M:i._objHasOwnProperty(n,"clampToS3M",false)}:o==="polygon"&&(w.polyline=n.style,w.polyline.positions=v,w.polygon={hierarchy:A,material:n.material||u.Color.WHITE.withAlpha(.7),clampToGround:i._objHasOwnProperty(n,"clampToGround",false)},w.clampToS3M=true),i._drawLayer.entities.add(w)}function p(){o=="polygon"&&(r.push(r[0]),d.positions.push(r[0])),s=y(r,r),n.height&&(s.polygon.extrudedHeight=n.height,s.polygon.material=u.Color.BLUE.withAlpha(.5)),n.measure&&o=="polygon"&&g(r[0],true),typeof n.callback=="function"&&!h&&n.callback(i.transformCartesianArrayToWGS84Array(r),s),i._drawLayer.entities.remove(c),i._drawLayer.entities.remove(l),c=void 0,l=void 0,r=[];}let g=function(v,A=false,w=false){var C=new u.Entity;C.position=v,C.point={pixelSize:10,outlineColor:u.Color.BLUE,outlineWidth:5};var b="",P=i.transformCartesianArrayToWGS84Array(r)||[];return o==="line"?b=(i.getPositionDistance(P)/1e3).toFixed(4)+"\u516C\u91CC":o==="polygon"&&A&&(b=(i.getPositionsArea(P)/1e6).toFixed(4)+"\u5E73\u65B9\u516C\u91CC"),(o==="line"||o==="polygon"&&A)&&!w&&(C.label={text:b,show:true,showBackground:true,font:"14px monospace",horizontalOrigin:u.HorizontalOrigin.LEFT,verticalOrigin:u.VerticalOrigin.BOTTOM,pixelOffset:new u.Cartesian2(-20,-80)}),i._drawLayer.entities.add(C)};m.setInputAction(function(v){let A=i.getCatesian3FromPX(v.position);if(u.defined(A)){let w=A.clone();if(r.length===0){c=g(w,false,true),d.positions.push(A.clone()),r.push(w);let C=new u.CallbackProperty(function(){return r},false),b=new u.CallbackProperty(function(){return o==="polygon"?d:r},false);l=y(C,b);}d.positions.push(A.clone()),r.push(w),n.measure&&g(w),n.type==="straightLine"&&r.length==3&&(r.pop(),m.destroy(),m=null,i.tooltip.setVisible(false),typeof n.callback=="function"&&(r=i._excludeDuplicatesCartesian(r),h=true,n.callback(r,l),p()));}},u.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(v){var A=i.getCatesian3FromPX(v.endPosition);i.tooltip.showAtCartesian(A,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),u.defined(c)&&u.defined(A)&&(r.pop(),r.push(A.clone()),d.positions.pop(),d.positions.push(A.clone()),c.position.setValue(A));},u.ScreenSpaceEventType.MOUSE_MOVE),m.setInputAction(function(v){r=i._excludeDuplicatesCartesian(r),p(),s=void 0,i.tooltip.setVisible(false),m.destroy(),m=null;},u.ScreenSpaceEventType.RIGHT_CLICK);},_excludeDuplicatesCartesian(n){var o=n.reduce((r,i)=>{let s=r.length;return s<1||!r[s-1].equals(i)?r.concat(i):r},[]);return o},drawLineGraphics:function(n){n=n||{},this._viewer&&n&&this._drawComand(n,"line");},drawPolygonGraphics:function(n){n=n||{};let o={width:3,material:u.Color.BLUE.withAlpha(.8),clampToGround:true};n.style?n.style=Object.assign({},o,n.style):n.style=o,this._viewer&&n&&this._drawComand(n,"polygon");},drawRectangleGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:u.Color.BLUE.withAlpha(.5),clampToGround:true},this._viewer&&n){var o=[],r=new u.Entity,i=new u.Rectangle,s=this,l,c=new u.ScreenSpaceEventHandler(this._viewer.scene.canvas);f=c,c.setInputAction(function(h){var d=s.getCatesian3FromPX(h.position);d&&d.x&&(o.length==0?o.push(d.clone()):(c.destroy(),o.push(d.clone()),i=u.Rectangle.fromCartesianArray([...o,d],u.Ellipsoid.WGS84),typeof n.callback=="function"&&n.callback(s.transformCartesianArrayToWGS84Array(o),l)));},u.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(h){var d=s.getCatesian3FromPX(h.endPosition);d&&(i=u.Rectangle.fromCartesianArray([...o,d],u.Ellipsoid.WGS84));},u.ScreenSpaceEventType.MOUSE_MOVE),r.rectangle=n.style,n.height&&(r.rectangle.extrudedHeight=n.height),r.rectangle.coordinates=new u.CallbackProperty(function(){return i},false),l=this._drawLayer.entities.add(r);}},drawCircleGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:u.Color.BLUE.withAlpha(.5),clampToGround:true},this._viewer&&n){var o=void 0,r=new u.Entity,i=this,s,l=1,c=new u.ScreenSpaceEventHandler(this._viewer.scene.canvas);f=c;let h=function(m,y){let p=u.Cartographic.fromCartesian(m),g=u.Cartographic.fromCartesian(y),v=new u.EllipsoidGeodesic;v.setEndPoints(p,g);let A=v.surfaceDistance;l=Math.sqrt(Math.pow(A,2)+Math.pow(g.height-p.height,2));},d=function(){r.ellipse=n.style,r.ellipse.semiMajorAxis=new u.CallbackProperty(function(){return l},false),r.ellipse.semiMinorAxis=new u.CallbackProperty(function(){return l},false),r.position=new u.CallbackProperty(function(){return o},false),r.point={pixelSize:5,outlineColor:u.Color.RED,outlineWidth:3},n.height&&(r.ellipse.extrudedHeight=n.height),s=i._drawLayer.entities.add(r);};c.setInputAction(function(m){var y=i.getCatesian3FromPX(m.position);i.tooltip.showAtCartesian(y,"\u5DE6\u952E\u5355\u51FB\u7ED3\u675F!"),y&&y.x&&(o?(h(o,y),i.tooltip.setVisible(false),c.destroy(),typeof n.callback=="function"&&n.callback({center:o,radius:l},s)):(o=y,d()));},u.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(m){var y=i._viewer.scene.camera.pickEllipsoid(m.endPosition,i._viewer.scene.globe.ellipsoid);o&&y&&y.x&&h(o,y);},u.ScreenSpaceEventType.MOUSE_MOVE);}},drawTrianglesGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:u.Color.BLUE.withAlpha(.5)},this._viewer&&n){var o=new u.Entity,r=new u.Entity,i=new u.Entity,s=[],l=[],c=[],h=this,d=new u.ScreenSpaceEventHandler(this._viewer.scene.canvas);f=d;let m=function(p,g){if(!p&&!g||u.Cartesian3.equals(p,g))return 0;let v=u.Cartographic.fromCartesian(p);return (u.Cartographic.fromCartesian(g).height-v.height).toFixed(2)},y=function(p){let g=u.Cartographic.fromCartesian(p[0]),v=u.Cartographic.fromCartesian(p[1]);return u.Cartesian3.fromDegrees(u.Math.toDegrees(g.longitude),u.Math.toDegrees(g.latitude),v.height)};d.setInputAction(function(p){var g=h.getCatesian3FromPX(p.position);if(!g)return false;s.length==0?(s.push(g.clone()),s.push(g.clone()),l.push(g.clone()),l.push(g.clone())):(d.destroy(),typeof n.callback=="function"&&n.callback({e:o,e2:r,e3:i}));},u.ScreenSpaceEventType.LEFT_CLICK),d.setInputAction(function(p){var g=h.getCatesian3FromPX(p.endPosition);if(g&&s.length>0){s.pop(),s.push(g.clone());let v=y(s);l.pop(),l.push(v.clone()),c.pop(),c.pop(),c.push(g.clone()),c.push(v.clone());}},u.ScreenSpaceEventType.MOUSE_MOVE),o.polyline={positions:new u.CallbackProperty(function(){return s},false),...n.style},o.position=new u.CallbackProperty(function(){return s[0]},false),o.point={pixelSize:5,outlineColor:u.Color.BLUE,outlineWidth:5},o.label={text:new u.CallbackProperty(function(){return "\u76F4\u7EBF:"+h.getPositionDistance(h.transformCartesianArrayToWGS84Array(s))+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:u.HorizontalOrigin.LEFT,verticalOrigin:u.VerticalOrigin.BOTTOM,pixelOffset:new u.Cartesian2(50,-100)},r.polyline={positions:new u.CallbackProperty(function(){return l},false),...n.style},r.position=new u.CallbackProperty(function(){return c[1]},false),r.point={pixelSize:5,outlineColor:u.Color.BLUE,outlineWidth:5},r.label={text:new u.CallbackProperty(function(){return "\u9AD8\u5EA6:"+m(l[0],l[1])+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:u.HorizontalOrigin.LEFT,verticalOrigin:u.VerticalOrigin.BOTTOM,pixelOffset:new u.Cartesian2(-20,100)},i.polyline={positions:new u.CallbackProperty(function(){return c},false),...n.style},i.position=new u.CallbackProperty(function(){return s[1]},false),i.point={pixelSize:5,outlineColor:u.Color.BLUE,outlineWidth:5},i.label={text:new u.CallbackProperty(function(){return "\u6C34\u5E73\u8DDD\u79BB:"+h.getPositionDistance(h.transformCartesianArrayToWGS84Array(c))+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:u.HorizontalOrigin.LEFT,verticalOrigin:u.VerticalOrigin.BOTTOM,pixelOffset:new u.Cartesian2(-150,-20)},this._drawLayer.entities.add(i),this._drawLayer.entities.add(r),this._drawLayer.entities.add(o);}},drawWallGraphics:function(n){n=n||{};let o={material:u.Color.BLUE.withAlpha(.5),outline:true,outlineColor:u.Color.WHITE};if(n.style?n.style=Object.assign({},o,n.style):n.style=o,this._viewer&&n){var r=this;this.drawPolygonGraphics({clampToGround:r._objHasOwnProperty(n.style,"clampToGround",true),style:{material:n.style.material},callback:function(i,s){let l=r.transformWGS84ArrayToCartesianArray(i),c=[],h=[];if(n.style.maximumHeights){let m=0;for(;m<l.length;)c.push(n.style.maximumHeights[m%2]),m++;n.style.maximumHeights=c;}if(n.style.minimumHeights){let m=0;for(;m<l.length;)h.push(n.style.minimumHeights[m%2]),m++;n.style.minimumHeights=h;}var d=r._drawLayer.entities.add({wall:{positions:l,...n.style}});typeof n.callback=="function"&&n.callback(i,d);}});}},drawEllipsoidGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var o=this;this.drawCircleGraphics({callback:function(r,i){var s=o.createGraphics();s.ellipsoid=o.$graphics.getEllipsoidGraphics({radii:r.radius}),s.position=r.center,o._drawLayer.entities.remove(i);var l=o._drawLayer.entities.add(s);typeof n.callback=="function"&&n.callback({center:r.center,radius:r.radius},l);}});}},_objHasOwnProperty(n,o,r){return n&&n.hasOwnProperty(o)?n[o]:r},drawCylinderGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var o=this;this.drawCircleGraphics({callback:function(r,i){var s=o._drawLayer.entities.add({position:r.center,cylinder:{length:r.radius*2||n.length,topRadius:n.topRadius||r.radius,bottomRadius:n.bottomRadius||r.radius,material:u.Color.BLUE.withAlpha(.5),outline:true,outlineColor:u.Color.WHITE}});o._drawLayer.entities.remove(i),typeof n.callback=="function"&&n.callback({center:r.center,radius:r.radius},s);}});}},drawCorridorGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var o=this;o.drawLineGraphics({callback:function(r,i){var s=o.createGraphics();s.corridor={positions:o.transformWGS84ArrayToCartesianArray(r),height:n.height||1,width:n.width||100,cornerType:u.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:u.Color.BLUE.withAlpha(.5),outline:true,outlineColor:u.Color.WHITE},o._drawLayer.entities.remove(i);var l=o._drawLayer.entities.add(s);typeof n.callback=="function"&&n.callback(r,l);}});}},drawPolylineVolumeGraphics:function(n){n=n||{},n.style=n.style||{};let o=n.circleRadius||20,r=n.arms||7,i=n.rOuter||150,s=n.rInner||75;if(this._viewer&&n){var l=this;l.drawLineGraphics({callback:function(c,h){var d=l.createGraphics();let m=n.shape==="fivePoint"?l.computeStar2d(r,i,s):l.computeCircleShap(o);d.polylineVolume={positions:l.transformWGS84ArrayToCartesianArray(c),shape:m,cornerType:u.CornerType.MITERED,material:n.color||u.Color.RED},l._drawLayer.entities.remove(h);var y=l._drawLayer.entities.add(d);typeof n.callback=="function"&&n.callback(c,y);}});}},removeAll(){this._drawLayer.entities.removeAll();},removeEventHandler(){f&&!f.isDestroyed()&&(f.removeInputAction(u.ScreenSpaceEventType.MOUSE_MOVE),f.removeInputAction(u.ScreenSpaceEventType.RIGHT_CLICK),f.removeInputAction(u.ScreenSpaceEventType.LEFT_CLICK),f.destroy()),f=null;}},a}var ze=re(pr);function gr(){let e={};class u{constructor(a,n){a&&(this._viewer=a,e=n);}mathDistance2d(a,n){return Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2))}getCirclePoints2d(a,n,o,r){let i=[],s=Math.PI/180*Math.round(360/r);for(let l=0;l<r;l++){let c=n+a*Math.sin(s*l),h=o+a*Math.cos(s*l);i.unshift({x:c,y:h});}return i}wholeDistance2d(a){let n=0;return a&&Array.isArray(a)&&a.length>0&&a.forEach((o,r)=>{r<a.length-1&&(n+=this.mathDistance2d(o,a[r+1]));}),n}getBaseLength2d(a){return Math.pow(this.wholeDistance2d(a),.99)}computeStar2d(a,n,o){let r=Math.PI/a,i=2*a,s=new Array(i);for(let l=0;l<i;l++){let c=l%2===0?n:o;s[l]=new e.Cartesian2(Math.cos(l*r)*c,Math.sin(l*r)*c);}return s}computeCircleShap(a){let n=[];for(let o=0;o<360;o++){let r=e.Math.toRadians(o);n.push(new e.Cartesian2(a*Math.cos(r),a*Math.sin(r)));}return n}mid2d(a,n){return [(a[0]+n[0])/2,(a[1]+n[1])/2]}getCircleCenterOfThreePoints2d(a,n,o){let r=[(a[0]+n[0])/2,(a[1]+n[1])/2],i=[r[0]-a[1]+n[1],r[1]+a[0]-n[0]],s=[(a[0]+o[0])/2,(a[1]+o[1])/2],l=[s[0]-a[1]+o[1],s[1]+a[0]-o[0]];return this.getIntersectPoint2d(r,i,s,l)}getIntersectPoint2d(a,n,o,r){if(a[1]===n[1]){let d=(r[0]-o[0])/(r[1]-o[1])*(a[1]-o[1])+o[0],m=a[1];return [d,m]}if(o[1]===r[1]){let d=(n[0]-a[0])/(n[1]-a[1])*(o[1]-a[1])+a[0],m=o[1];return [d,m]}let i=(n[0]-a[0])/(n[1]-a[1]),s=(r[0]-o[0])/(r[1]-o[1]),l=(i*a[1]-a[0]-s*o[1]+o[0])/(i-s);return [i*l-i*a[1]+a[0],l]}getAzimuth2d(a,n){let o,r=Math.asin(Math.abs(n[1]-a[1])/this.mathDistance2d(a,n));return n[1]>=a[1]&&n[0]>=a[0]?o=r+Math.PI:n[1]>=a[1]&&n[0]<a[0]?o=Math.PI*2-r:n[1]<a[1]&&n[0]<a[0]?o=r:o=Math.PI-r,o}getAngleOfThreePoints2d(a,n,o){let r=this.getAzimuth2d(n,a)-this.getAzimuth2d(n,o);return r<0?r+Math.PI*2:r}isClockWise2d(a,n,o){return (o[1]-a[1])*(n[0]-a[0])>(n[1]-a[1])*(o[0]-a[0])}isClockWise(a,n,o){return this.isClockWise2d(a,n,o)}getPointOnLine2d(a,n,o){let r=n[0]+a*(o[0]-n[0]),i=n[1]+a*(o[1]-n[1]);return [r,i]}getCubicValue2d(a,n,o,r,i){a=Math.max(Math.min(a,1),0);let s=1-a,l=a*a,c=l*a,h=s*s,d=h*s,m=d*n[0]+3*h*a*o[0]+3*s*l*r[0]+c*i[0],y=d*n[1]+3*h*a*o[1]+3*s*l*r[1]+c*i[1];return [m,y]}getThirdPoint2d(a,n,o,r,i){let s=this.getAzimuth2d(a,n),l=i?s+o:s-o,c=r*Math.cos(l),h=r*Math.sin(l);return [n[0]+c,n[1]+h]}inherits2d(a,n){function o(){}o.prototype=n.prototype,a.superClass_=n.prototype,a.prototype=new o,a.prototype.constructor=a,a.base=function(r,i,...s){let l=Array.prototype.slice.call(arguments,2);return n.prototype[i].apply(r,l)};}getArcPoints2d(a,n,o,r){let i,s,l=[],c=r-o;c=c<0?c+Math.PI*2:c;for(let h=0;h<=100;h++){let d=o+c*h/100;i=a[0]+n*Math.cos(d),s=a[1]+n*Math.sin(d),l.push([i,s]);}return l}getBisectorNormals2d(a,n,o,r){let i=this.getNormal2d(n,o,r),s,l,c,h,d,m=Math.sqrt(i[0]*i[0]+i[1]*i[1]),y=i[0]/m,p=i[1]/m,g=this.mathDistance2d(n,o),v=this.mathDistance2d(o,r);return m>1e-4?this.isClockWise(n,o,r)?(c=a*g,h=o[0]-c*p,d=o[1]+c*y,s=[h,d],c=a*v,h=o[0]+c*p,d=o[1]-c*y,l=[h,d]):(c=a*g,h=o[0]+c*p,d=o[1]-c*y,s=[h,d],c=a*v,h=o[0]-c*p,d=o[1]+c*y,l=[h,d]):(h=o[0]+a*(n[0]-o[0]),d=o[1]+a*(n[1]-o[1]),s=[h,d],h=o[0]+a*(r[0]-o[0]),d=o[1]+a*(r[1]-o[1]),l=[h,d]),[s,l]}getNormal2d(a,n,o){let r=a[0]-n[0],i=a[1]-n[1],s=Math.sqrt(r*r+i*i);r/=s,i/=s;let l=o[0]-n[0],c=o[1]-n[1],h=Math.sqrt(l*l+c*c);l/=h,c/=h;let d=r+l,m=i+c;return [d,m]}getLeftMostControlPoint2d(a,n){let o=a[0],r=a[1],i=a[2],s,l,h=this.getBisectorNormals2d(0,o,r,i)[0],d=this.getNormal2d(o,r,i);if(Math.sqrt(d[0]*d[0]+d[1]*d[1])>1e-4){let y=this.mid2d(o,r),p=o[0]-y[0],g=o[1]-y[1],A=2/this.mathDistance2d(o,r),w=-A*g,C=A*p,b=w*w-C*C,P=2*w*C,_=C*C-w*w,S=h[0]-y[0],I=h[1]-y[1];s=y[0]+b*S+P*I,l=y[1]+P*S+_*I;}else s=o[0]+n*(r[0]-o[0]),l=o[1]+n*(r[1]-o[1]);return [s,l]}getRightMostControlPoint2d(a,n){let o=a.length,r=a[o-3],i=a[o-2],s=a[o-1],c=this.getBisectorNormals2d(0,r,i,s)[1],h=this.getNormal2d(r,i,s),d=Math.sqrt(h[0]*h[0]+h[1]*h[1]),m,y;if(d>1e-4){let p=this.mid2d(i,s),g=s[0]-p[0],v=s[1]-p[1],w=2/this.mathDistance2d(i,s),C=-w*v,b=w*g,P=C*C-b*b,_=2*C*b,S=b*b-C*C,I=c[0]-p[0],x=c[1]-p[1];m=p[0]+P*I+_*x,y=p[1]+_*I+S*x;}else m=s[0]+n*(i[0]-s[0]),y=s[1]+n*(i[1]-s[1]);return [m,y]}getCurvePoints2d(a,n){let o=this.getLeftMostControlPoint2d(n,a),r,i,s,l=[o],c=[];for(let d=0;d<n.length-2;d++){r=n[d],i=n[d+1],s=n[d+2];let m=this.getBisectorNormals2d(a,r,i,s);l=l.concat(m);}let h=this.getRightMostControlPoint2d(n,a);h&&l.push(h);for(let d=0;d<n.length-1;d++){r=n[d],i=n[d+1],c.push(r);for(let m=0;m<100;m++){let y=this.getCubicValue2d(m/100,r,l[d*2],l[d*2+1],i);c.push(y);}c.push(i);}return c}getBezierPoints2d(a){if(a.length<=2)return a;{let n=[],o=a.length-1;for(let r=0;r<=1;r+=.01){let i=0,s=0;for(let l=0;l<=o;l++){let c=this.getBinomialFactor2d(o,l),h=Math.pow(r,l),d=Math.pow(1-r,o-l);i+=c*h*d*a[l][0],s+=c*h*d*a[l][1];}n.push([i,s]);}return n.push(a[o]),n}}getFactorial2d(a){let n=1;for(let o=1;o<=a;o++)n*=o;return n}getBinomialFactor2d(a,n){return this.getFactorial2d(a)/(this.getFactorial2d(n)*this.getFactorial2d(a-n))}getQBSplinePoints2d(a){if(a.length<=2)return a;{let o=[],r=a.length-2-1;o.push(a[0]);for(let i=0;i<=r;i++)for(let s=0;s<=1;s+=.05){let l=0,c=0;for(let h=0;h<=2;h++){let d=this.getQuadricBSplineFactor2d(h,s);l+=d*a[i+h][0],c+=d*a[i+h][1];}o.push([l,c]);}return o.push(a[a.length-1]),o}}getQuadricBSplineFactor2d(a,n){let o=0;return a===0?o=Math.pow(n-1,2)/2:a===1?o=(-2*Math.pow(n,2)+2*n+1)/2:a===2&&(o=Math.pow(n,2)/2),o}}return u}var We=re(gr);function vr(){let e=null,u=function(f,a){if(f){this._viewer=f,je(pe,ee),this.$graphics=new pe(f,a),e=a;let n=this.$graphics;se(this),oe(this,()=>{Ce(n);});}};return u.prototype={setCircleScanEffect:function(f){if(f&&f.position){var a=f.id||"CircleScan"+parseInt(Math.random()*1e3),n=f.position,o=f.radius,r=f.color||e.Color.RED,i=f.duration||1500,s=this,l=f.circleMode||"CircleScan",c=f.border||4,h=n,d=new e.Cartesian4(h.x,h.y,h.z,1),m=this.transformCartesianToWGS84(n),y=this.transformWGS84ToCartesian({lng:m.lng,lat:m.lat,alt:m.alt+500}),p=new e.Cartesian4(y.x,y.y,y.z,1),g=new Date().getTime(),v=new e.PostProcessStage({name:a,fragmentShader:this._getCircleScanShader({get:true,border:c}),uniforms:{u_scanCenterEC:function(){return e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,d,new e.Cartesian4)},u_scanPlaneNormalEC:function(){var A=e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,d,new e.Cartesian4),w=e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,p,new e.Cartesian4),C=new e.Cartesian3;return C.x=w.x-A.x,C.y=w.y-A.y,C.z=w.z-A.z,e.Cartesian3.normalize(C,C),C},u_radius:function(){return l=="CircleScan"?o*((new Date().getTime()-g)%i)/i:o},u_scanColor:r}});return this._viewer.scene.postProcessStages.add(v),v}},setRadarScanEffect:function(f){if(f&&f.position){var a=f.id||"radarScan"+parseInt(Math.random()*1e3),n=f.position,o=f.radius,r=f.color||e.Color.RED,i=f.duration||1500,s=this,l=f.border||1,c=f.width||3,h=n,d=new e.Cartesian4(h.x,h.y,h.z,1),m=this.transformCartesianToWGS84(n),y=this.transformWGS84ToCartesian({lng:m.lng,lat:m.lat,alt:m.alt+500}),p=new e.Cartesian4(y.x,y.y,y.z,1),g=this.transformWGS84ToCartesian({lng:m.lng+.001,lat:m.lat,alt:m.alt}),v=new e.Cartesian4(g.x,g.y,g.z,1),A=new Date().getTime(),w=new e.Quaternion,C=new e.Matrix3,b=new e.Cartesian4,P=new e.Cartesian4,_=new e.Cartesian4,S=new e.Cartesian3,I=new e.Cartesian3,x=new e.PostProcessStage({name:a,fragmentShader:this._getRadarScanShader({border:l,width:c,get:true}),uniforms:{u_scanCenterEC:function(){return e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,d,b)},u_scanPlaneNormalEC:function(){var M=e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,d,b),T=e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,p,P);return S.x=T.x-M.x,S.y=T.y-M.y,S.z=T.z-M.z,e.Cartesian3.normalize(S,S),S},u_scanLineNormalEC:function(){var M=e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,d,b),T=e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,p,P),E=e.Matrix4.multiplyByVector(s._viewer.camera._viewMatrix,v,_);S.x=T.x-M.x,S.y=T.y-M.y,S.z=T.z-M.z,e.Cartesian3.normalize(S,S),I.x=E.x-M.x,I.y=E.y-M.y,I.z=E.z-M.z;var R=(new Date().getTime()-A)%i/i;return e.Quaternion.fromAxisAngle(S,R*e.Math.PI*2,w),e.Matrix3.fromQuaternion(w,C),e.Matrix3.multiplyByVector(C,I,I),e.Cartesian3.normalize(I,I),I},u_radius:o,u_scanColor:r}});return this._viewer.scene.postProcessStages.add(x),x}},satelliteScan:function(f){if(f&&f.position){var a=e.Cartesian3,n=e.GeometryInstance,o=e.Primitive,c=e.MaterialAppearance,r=e.Material,i=e.Color,s=e.Matrix4,l=e.Transforms,c=e.MaterialAppearance,h=e.CylinderGeometry;let v=f.position||[116.39,39.9],A=f.length||4e4;var d=a.fromDegrees(v[0],v[1]),m=s.multiplyByTranslation(l.eastNorthUpToFixedFrame(d),new a(0,0,A*.5),new s),y=new h({length:A,topRadius:0,bottomRadius:A*.5,vertexFormat:c.MaterialSupport.TEXTURED.vertexFormat}),p=new n({geometry:y,modelMatrix:m}),g=this._viewer.scene.primitives.add(new o({geometryInstances:p,appearance:new c({material:new r({fabric:{uniforms:{color:f.color||new i(.2,1,0,1),repeat:f.repeat||30,offset:0,thickness:f.thickness||.2},source:`
621
621
  uniform vec4 color;
622
622
  uniform float repeat;
623
623
  uniform float offset;
@@ -654,7 +654,7 @@ void main() {
654
654
  v_normalEC = normal; // normal in world coordinates
655
655
  v_st = st;
656
656
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
657
- }`})}));let w=function(){var C=g.appearance.material.uniforms.offset;C-=.001,C>1&&(C=0),g.appearance.material.uniforms.offset=C;};return this._viewer.scene.preUpdate.addEventListener(w),ae(this,()=>{this._viewer.scene.preUpdate.removeEventListener(w);}),g}},lighitCentrumScanEffect:function(y){let o=this.createLightScan_getCirclePoints(y.circle[0],y.circle[1],y.circle[2],y.circle[3]),n=this.createLightScan_entityCList(this._viewer,o,y);for(let a=0;a<n.length;a++)a!==n.length-1?this.createLightScan_changeOnePosition(y,n[a],[o[a].x,o[a].y,o[a+1].x,o[a+1].y]):this.createLightScan_changeOnePosition(y,n[a],[o[a].x,o[a].y,o[0].x,o[0].y]);return n},createLightScan_getCirclePoints:function(y,o,n,a){let r=[],i=Math.PI/180*Math.round(360/a),l=0;for(;l<a;l++){let s=o+y*Math.sin(i*l),c=n+y*Math.cos(i*l);r.unshift({x:s,y:c});}return r},createLightScan_changeOnePosition:function(y,o,n){let a=y.positionList,r,i,l,s,c,u,d=0,m=0;function f(p){r=a[p+1][0]-a[p][0],i=a[p+1][1]-a[p][1],l=r/y.number,s=i/y.number,m=0;}f(d),o.polygon.hierarchy=new e.CallbackProperty(function(){return Math.abs(c)>=Math.abs(r)&&Math.abs(u)>=Math.abs(i)&&(d=d+1,d===a.length-1&&(d=0),n[0]=n[0]+c,n[1]=n[1]+u,n[2]=n[2]+c,n[3]=n[3]+u,f(d)),c=m*l,u=m*s,m++,new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([y.observer[0],y.observer[1],y.observer[2],n[0]+c,n[1]+u,0,n[2]+c,n[3]+u,0]))},false);},createLightScan_entityCList:function(y,o,n){let a=n.observer[0],r=n.observer[1],i=n.observer[2],l=[];for(let s=0;s<o.length;s++){let c;s===o.length-1?c=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([a,r,i,o[s].x,o[s].y,0,o[0].x,o[0].y,0])):c=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([a,r,i,o[s].x,o[s].y,0,o[s+1].x,o[s+1].y,0]));let u=y.entities.add({name:"\u4E09\u89D2\u5F62",polygon:{hierarchy:c,outline:false,perPositionHeight:true,material:n.material}});l.push(u);}return l},createFireParticleSystem(y){if(y&&y.position){let o=Object.assign({},{fireImage:"static/data/images/file/fire.png",startScale:3,endScale:1.5,minimumParticleLife:1.5,maximumParticleLife:1.8,minimumSpeed:7,maximumSpeed:9,particleSize:2,emissionRate:200,startColor:new e.Color(1,1,1,1),endColor:new e.Color(.5,0,0,0),emitter:new e.ConeEmitter(e.Math.toRadians(45))},y),{fireImage:n,startScale:a,endScale:r,minimumParticleLife:i,maximumParticleLife:l,minimumSpeed:s,maximumSpeed:c,particleSize:u,emissionRate:d,position:m,startColor:f,endColor:p,emitter:g}=o;return new e.ParticleSystem({image:n,startScale:a,endScale:r,minimumParticleLife:i,maximumParticleLife:l,minimumSpeed:s,maximumSpeed:c,emissionRate:d,startColor:f,endColor:p,emitter:g,imageSize:new e.Cartesian2(u,u),lifetime:16,loop:true,sizeInMeters:true,modelMatrix:e.Transforms.eastNorthUpToFixedFrame(m)})}}},h}var ht=re(ur);var an=`#ifdef GL_OES_standard_derivatives
657
+ }`})}));let w=function(){var C=g.appearance.material.uniforms.offset;C-=.001,C>1&&(C=0),g.appearance.material.uniforms.offset=C;};return this._viewer.scene.preUpdate.addEventListener(w),oe(this,()=>{this._viewer.scene.preUpdate.removeEventListener(w);}),g}},lighitCentrumScanEffect:function(f){let a=this.createLightScan_getCirclePoints(f.circle[0],f.circle[1],f.circle[2],f.circle[3]),n=this.createLightScan_entityCList(this._viewer,a,f);for(let o=0;o<n.length;o++)o!==n.length-1?this.createLightScan_changeOnePosition(f,n[o],[a[o].x,a[o].y,a[o+1].x,a[o+1].y]):this.createLightScan_changeOnePosition(f,n[o],[a[o].x,a[o].y,a[0].x,a[0].y]);return n},createLightScan_getCirclePoints:function(f,a,n,o){let r=[],i=Math.PI/180*Math.round(360/o),s=0;for(;s<o;s++){let l=a+f*Math.sin(i*s),c=n+f*Math.cos(i*s);r.unshift({x:l,y:c});}return r},createLightScan_changeOnePosition:function(f,a,n){let o=f.positionList,r,i,s,l,c,h,d=0,m=0;function y(p){r=o[p+1][0]-o[p][0],i=o[p+1][1]-o[p][1],s=r/f.number,l=i/f.number,m=0;}y(d),a.polygon.hierarchy=new e.CallbackProperty(function(){return Math.abs(c)>=Math.abs(r)&&Math.abs(h)>=Math.abs(i)&&(d=d+1,d===o.length-1&&(d=0),n[0]=n[0]+c,n[1]=n[1]+h,n[2]=n[2]+c,n[3]=n[3]+h,y(d)),c=m*s,h=m*l,m++,new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([f.observer[0],f.observer[1],f.observer[2],n[0]+c,n[1]+h,0,n[2]+c,n[3]+h,0]))},false);},createLightScan_entityCList:function(f,a,n){let o=n.observer[0],r=n.observer[1],i=n.observer[2],s=[];for(let l=0;l<a.length;l++){let c;l===a.length-1?c=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([o,r,i,a[l].x,a[l].y,0,a[0].x,a[0].y,0])):c=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([o,r,i,a[l].x,a[l].y,0,a[l+1].x,a[l+1].y,0]));let h=f.entities.add({name:"\u4E09\u89D2\u5F62",polygon:{hierarchy:c,outline:false,perPositionHeight:true,material:n.material}});s.push(h);}return s},createFireParticleSystem(f){if(f&&f.position){let a=Object.assign({},{fireImage:"static/data/images/file/fire.png",startScale:3,endScale:1.5,minimumParticleLife:1.5,maximumParticleLife:1.8,minimumSpeed:7,maximumSpeed:9,particleSize:2,emissionRate:200,startColor:new e.Color(1,1,1,1),endColor:new e.Color(.5,0,0,0),emitter:new e.ConeEmitter(e.Math.toRadians(45))},f),{fireImage:n,startScale:o,endScale:r,minimumParticleLife:i,maximumParticleLife:s,minimumSpeed:l,maximumSpeed:c,particleSize:h,emissionRate:d,position:m,startColor:y,endColor:p,emitter:g}=a;return new e.ParticleSystem({image:n,startScale:o,endScale:r,minimumParticleLife:i,maximumParticleLife:s,minimumSpeed:l,maximumSpeed:c,emissionRate:d,startColor:y,endColor:p,emitter:g,imageSize:new e.Cartesian2(h,h),lifetime:16,loop:true,sizeInMeters:true,modelMatrix:e.Transforms.eastNorthUpToFixedFrame(m)})}}},u}var dt=re(vr);var sn=`#ifdef GL_OES_standard_derivatives
658
658
  #extension GL_OES_standard_derivatives : enable
659
659
  #endif
660
660
 
@@ -778,7 +778,7 @@ void main() {
778
778
  // the floating point error.
779
779
  bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);
780
780
  out_FragColor = shade(isOnEllipsoid);
781
- }`,Gt=`in vec4 position;
781
+ }`,Ft=`in vec4 position;
782
782
  in vec3 normal;
783
783
 
784
784
  out vec3 v_position;
@@ -828,7 +828,7 @@ vec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) {
828
828
  s = s - floor(s);
829
829
 
830
830
  return vec2(s, t);
831
- }`,Ot=`#ifdef GL_OES_standard_derivatives
831
+ }`,Vt=`#ifdef GL_OES_standard_derivatives
832
832
  #extension GL_OES_standard_derivatives : enable
833
833
  #endif
834
834
 
@@ -960,7 +960,7 @@ void main() {
960
960
  }
961
961
  */
962
962
  out_FragColor = shade(isOnEllipsoid);
963
- }`;var Q={};function on(e){Q=e;var h=Q.BoundingSphere,y=Q.Cartesian3,o=Q.Color,n=Q.combine,a=Q.ComponentDatatype,r=Q.defaultValue||Q.Scene.defaultValue,i=Q.defined;Q.destroyObject;var c=Q.DeveloperError,M=Q.Matrix4,u=Q.PrimitiveType,d=Q.Buffer,m=Q.BufferUsage,f=Q.DrawCommand,p=Q.Pass,g=Q.RenderState,v=Q.ShaderProgram,A=Q.ShaderSource,w=Q.VertexArray,C=Q.BlendingState,_=Q.CullFace,P=Q.Material,b=Q.SceneMode,x=Q.VertexFormat,T=Q.Math,S=Q.Matrix3,M=Q.Matrix4,E=Q.JulianDate;Q.BoxGeometry;Q.EllipsoidGeometry;var V=Math.sin,W=Math.cos,z=Math.tan,G=Math.atan,j={position:0,normal:1};function K(L){var F=this;L=r(L,r.EMPTY_OBJECT),this.show=r(L.show,true),this.slice=r(L.slice,32),this.modelMatrix=M.clone(L.modelMatrix,new M),this._modelMatrix=new M,this._computedModelMatrix=new M,this._computedScanPlaneModelMatrix=new M,this.radius=r(L.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=r(L.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=r(L.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=r(L.lineColor,o.WHITE),this.showSectorLines=r(L.showSectorLines,true),this.showSectorSegmentLines=r(L.showSectorSegmentLines,true),this.showLateralSurfaces=r(L.showLateralSurfaces,true),this.material=i(L.material)?L.material:P.fromType(P.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=i(L.lateralSurfaceMaterial)?L.lateralSurfaceMaterial:P.fromType(P.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=r(L.showDomeSurfaces,true),this.domeSurfaceMaterial=i(L.domeSurfaceMaterial)?L.domeSurfaceMaterial:P.fromType(P.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=r(L.showDomeLines,true),this.showIntersection=r(L.showIntersection,true),this.intersectionColor=r(L.intersectionColor,o.WHITE),this.intersectionWidth=r(L.intersectionWidth,5),this.showThroughEllipsoid=r(L.showThroughEllipsoid,false),this._showThroughEllipsoid=void 0,this.showScanPlane=r(L.showScanPlane,true),this.scanPlaneColor=r(L.scanPlaneColor,o.WHITE),this.scanPlaneMode=r(L.scanPlaneMode,"horizontal"),this.scanPlaneRate=r(L.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=E.now(),this._boundingSphere=new h,this._boundingSphereWC=new h,this._sectorFrontCommand=new f({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new f({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new f({owner:this,primitiveType:u.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new f({owner:this,primitiveType:u.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new f({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new f({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new f({owner:this,primitiveType:u.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new f({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new f({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return F.xHalfAngle},u_yHalfAngle:function(){return F.yHalfAngle},u_radius:function(){return F.radius},u_showThroughEllipsoid:function(){return F.showThroughEllipsoid},u_showIntersection:function(){return F.showIntersection},u_intersectionColor:function(){return F.intersectionColor},u_intersectionWidth:function(){return F.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return F.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return F._scanePlaneXHalfAngle},u_yHalfAngle:function(){return F._scanePlaneYHalfAngle},u_radius:function(){return F.radius},u_color:function(){return F.scanPlaneColor},u_showThroughEllipsoid:function(){return F.showThroughEllipsoid},u_showIntersection:function(){return F.showIntersection},u_intersectionColor:function(){return F.intersectionColor},u_intersectionWidth:function(){return F.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return F.lineColor}};}K.prototype.update=function(L){var F=L.mode;if(!(!this.show||F!==b.SCENE3D)){var N=false,H=false,U=false,Y=this.xHalfAngle,ne=this.yHalfAngle;if(Y<0||ne<0)throw new c("halfAngle must be greater than or equal to zero.");if(!(Y==0||ne==0)){(this._xHalfAngle!==Y||this._yHalfAngle!==ne)&&(this._xHalfAngle=Y,this._yHalfAngle=ne,N=true);var J=this.radius;if(J<0)throw new c("this.radius must be greater than or equal to zero.");var $=false;this._radius!==J&&($=true,this._radius=J,this._boundingSphere=new h(y.ZERO,this.radius));var de=!M.equals(this.modelMatrix,this._modelMatrix);(de||$)&&(M.clone(this.modelMatrix,this._modelMatrix),M.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),h.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var be=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=be,H=true);var me=this.material;this._material!==me&&(this._material=me,H=true,U=true);var Se=me.isTranslucent();if(this._translucent!==Se&&(this._translucent=Se,H=true),this.showScanPlane){var st=L.time,Qt=E.secondsDifference(st,this._time);Qt<0&&(this._time=E.clone(st,this._time));var Jt=Math.max(Qt%this.scanPlaneRate/this.scanPlaneRate,0),Ke;if(this.scanPlaneMode=="horizontal"){Ke=2*ne*Jt-ne;var On=W(Ke),Fn=z(Y),Vn=G(On*Fn);this._scanePlaneXHalfAngle=Vn,this._scanePlaneYHalfAngle=Ke,Q.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,R);}else {Ke=2*Y*Jt-Y;var Hn=z(ne),zn=W(Ke),Wn=G(zn*Hn);this._scanePlaneXHalfAngle=Ke,this._scanePlaneYHalfAngle=Wn,Q.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,R);}Q.Matrix4.multiplyByMatrix3(this.modelMatrix,R,this._computedScanPlaneModelMatrix),M.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix);}N&&Me(this,L),H&&Je(this,be,Se),U&&ot(this,L,me),(H||U)&&Ie(this,Se);var Un=L.commandList,Nn=L.passes,Kt=this._colorCommands;if(Nn.render)for(var Et=0,Xn=Kt.length;Et<Xn;Et++){var jn=Kt[Et];Un.push(jn);}}}},K.prototype.isDestroyed=function(){return false};var R=new S,O=new y;function q(L,F,N){for(var H=L.slice,U=W(N),Y=z(N),ne=W(F),J=z(F),$=G(ne*Y),de=G(U*J),be=[],me=0;me<H;me++){var Se=2*$*me/(H-1)-$;be.push(new y(0,V(Se),W(Se)));}for(var st=[],me=0;me<H;me++){var Se=2*de*me/(H-1)-de;st.push(new y(V(Se),0,W(Se)));}return {zoy:be,zox:st}}function Z(L,F){var N=L.xHalfAngle,H=L.yHalfAngle,U=F.zoy,Y=F.zox,ne=[],J=S.fromRotationY(N,R);ne.push(U.map(function($){return S.multiplyByVector(J,$,new Q.Cartesian3)}));var J=S.fromRotationX(-H,R);ne.push(Y.map(function($){return S.multiplyByVector(J,$,new Q.Cartesian3)}).reverse());var J=S.fromRotationY(-N,R);ne.push(U.map(function($){return S.multiplyByVector(J,$,new Q.Cartesian3)}).reverse());var J=S.fromRotationX(H,R);return ne.push(Y.map(function($){return S.multiplyByVector(J,$,new Q.Cartesian3)})),ne}function le(L,F){for(var N=Array.prototype.concat.apply([],F).length-F.length,H=new Float32Array(18*N),U=0,Y=0,ne=F.length;Y<ne;Y++)for(var J=F[Y],$=y.normalize(y.cross(J[0],J[J.length-1],O),O),de=0,N=J.length-1;de<N;de++)H[U++]=0,H[U++]=0,H[U++]=0,H[U++]=-$.x,H[U++]=-$.y,H[U++]=-$.z,H[U++]=J[de].x,H[U++]=J[de].y,H[U++]=J[de].z,H[U++]=-$.x,H[U++]=-$.y,H[U++]=-$.z,H[U++]=J[de+1].x,H[U++]=J[de+1].y,H[U++]=J[de+1].z,H[U++]=-$.x,H[U++]=-$.y,H[U++]=-$.z;var be=d.createVertexBuffer({context:L,typedArray:H,usage:m.STATIC_DRAW}),me=6*Float32Array.BYTES_PER_ELEMENT,Se=[{index:j.position,vertexBuffer:be,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:me},{index:j.normal,vertexBuffer:be,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:me}];return new w({context:L,attributes:Se})}function ie(L,F){for(var N=F.length,H=new Float32Array(9*N),U=0,Y=0,ne=F.length;Y<ne;Y++){var J=F[Y];H[U++]=0,H[U++]=0,H[U++]=0,H[U++]=J[0].x,H[U++]=J[0].y,H[U++]=J[0].z;}var $=d.createVertexBuffer({context:L,typedArray:H,usage:m.STATIC_DRAW}),de=3*Float32Array.BYTES_PER_ELEMENT,be=[{index:j.position,vertexBuffer:$,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:de}];return new w({context:L,attributes:be})}function ce(L,F){for(var N=Array.prototype.concat.apply([],F).length-F.length,H=new Float32Array(9*N),U=0,Y=0,ne=F.length;Y<ne;Y++)for(var J=F[Y],$=0,N=J.length-1;$<N;$++)H[U++]=J[$].x,H[U++]=J[$].y,H[U++]=J[$].z,H[U++]=J[$+1].x,H[U++]=J[$+1].y,H[U++]=J[$+1].z;var de=d.createVertexBuffer({context:L,typedArray:H,usage:m.STATIC_DRAW}),be=3*Float32Array.BYTES_PER_ELEMENT,me=[{index:j.position,vertexBuffer:de,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:be}];return new w({context:L,attributes:me})}function ve(L){var F=Q.EllipsoidGeometry.createGeometry(new Q.EllipsoidGeometry({vertexFormat:x.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),N=w.fromGeometry({context:L,geometry:F,attributeLocations:j,bufferUsage:m.STATIC_DRAW,interleave:false});return N}function _e(L){var F=Q.EllipsoidOutlineGeometry.createGeometry(new Q.EllipsoidOutlineGeometry({vertexFormat:x.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),N=w.fromGeometry({context:L,geometry:F,attributeLocations:j,bufferUsage:m.STATIC_DRAW,interleave:false});return N}function Ae(L,F){for(var N=F.length-1,H=new Float32Array(9*N),U=0,Y=0;Y<N;Y++)H[U++]=0,H[U++]=0,H[U++]=0,H[U++]=F[Y].x,H[U++]=F[Y].y,H[U++]=F[Y].z,H[U++]=F[Y+1].x,H[U++]=F[Y+1].y,H[U++]=F[Y+1].z;var ne=d.createVertexBuffer({context:L,typedArray:H,usage:m.STATIC_DRAW}),J=3*Float32Array.BYTES_PER_ELEMENT,$=[{index:j.position,vertexBuffer:ne,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:J}];return new w({context:L,attributes:$})}function Me(L,F){var N=F.context,H=q(L,L.xHalfAngle,L.yHalfAngle),U=Z(L,H);if(L.showLateralSurfaces&&(L._sectorVA=le(N,U)),L.showSectorLines&&(L._sectorLineVA=ie(N,U)),L.showSectorSegmentLines&&(L._sectorSegmentLineVA=ce(N,U)),L.showDomeSurfaces&&(L._domeVA=ve(N)),L.showDomeLines&&(L._domeLineVA=_e(N)),L.showScanPlane)if(L.scanPlaneMode=="horizontal"){var Y=q(L,T.PI_OVER_TWO,0);L._scanPlaneVA=Ae(N,Y.zox);}else {var Y=q(L,0,T.PI_OVER_TWO);L._scanPlaneVA=Ae(N,Y.zoy);}}function we(L,F,N){var H=F.context,U=Gt,Y=new A({sources:[_t,N.shaderSource,Ot]});L._sp=v.replaceCache({context:H,shaderProgram:L._sp,vertexShaderSource:U,fragmentShaderSource:Y,attributeLocations:j});var ne=new A({sources:[_t,N.shaderSource,Ot],pickColorQualifier:"uniform"});L._pickSP=v.replaceCache({context:H,shaderProgram:L._pickSP,vertexShaderSource:U,fragmentShaderSource:ne,attributeLocations:j});}function Ge(L,F,N){var H=F.context,U=Gt,Y=new A({sources:[_t,N.shaderSource,an]});L._scanePlaneSP=v.replaceCache({context:H,shaderProgram:L._scanePlaneSP,vertexShaderSource:U,fragmentShaderSource:Y,attributeLocations:j});}function ot(L,F,N){we(L,F,N),L.showScanPlane&&Ge(L,F,N);}function Je(L,F,N){N?(L._frontFaceRS=g.fromCache({depthTest:{enabled:!F},depthMask:false,blending:C.ALPHA_BLEND,cull:{enabled:true,face:_.BACK}}),L._backFaceRS=g.fromCache({depthTest:{enabled:!F},depthMask:false,blending:C.ALPHA_BLEND,cull:{enabled:true,face:_.FRONT}}),L._pickRS=g.fromCache({depthTest:{enabled:!F},depthMask:false,blending:C.ALPHA_BLEND})):(L._frontFaceRS=g.fromCache({depthTest:{enabled:!F},depthMask:true}),L._pickRS=g.fromCache({depthTest:{enabled:true},depthMask:true}));}function xe(L,F,N,H,U,Y,ne,J,$,de,be,me){de&&N&&(N.vertexArray=ne,N.renderState=U,N.shaderProgram=Y,N.uniformMap=n(J,L._material._uniforms),N.uniformMap.u_normalDirection=function(){return -1},N.pass=be,N.modelMatrix=$,L._colorCommands.push(N)),F.vertexArray=ne,F.renderState=H,F.shaderProgram=Y,F.uniformMap=n(J,L._material._uniforms),me&&(F.uniformMap.u_type=function(){return 1}),F.pass=be,F.modelMatrix=$,L._colorCommands.push(F);}function Ie(L,F){L._colorCommands.length=0;var N=F?p.TRANSLUCENT:p.OPAQUE;L.showLateralSurfaces&&xe(L,L._sectorFrontCommand,L._sectorBackCommand,L._frontFaceRS,L._backFaceRS,L._sp,L._sectorVA,L._uniforms,L._computedModelMatrix,F,N),L.showSectorLines&&xe(L,L._sectorLineCommand,void 0,L._frontFaceRS,L._backFaceRS,L._sp,L._sectorLineVA,L._uniforms,L._computedModelMatrix,F,N,true),L.showSectorSegmentLines&&xe(L,L._sectorSegmentLineCommand,void 0,L._frontFaceRS,L._backFaceRS,L._sp,L._sectorSegmentLineVA,L._uniforms,L._computedModelMatrix,F,N,true),L.showDomeSurfaces&&xe(L,L._domeFrontCommand,L._domeBackCommand,L._frontFaceRS,L._backFaceRS,L._sp,L._domeVA,L._uniforms,L._computedModelMatrix,F,N),L.showDomeLines&&xe(L,L._domeLineCommand,void 0,L._frontFaceRS,L._backFaceRS,L._sp,L._domeLineVA,L._uniforms,L._computedModelMatrix,F,N,true),L.showScanPlane&&xe(L,L._scanPlaneFrontCommand,L._scanPlaneBackCommand,L._frontFaceRS,L._backFaceRS,L._scanePlaneSP,L._scanPlaneVA,L._scanUniforms,L._computedScanPlaneModelMatrix,F,N);}return K}var ze={};function sn(e){ze=e;var h=ze.defaultValue||ze.Scene.defaultValue,y=ze.defined,o=Object.defineProperties,n=ze.DeveloperError,a=ze.Event,r=ze.createMaterialPropertyDescriptor,i=ze.createPropertyDescriptor;function l(s){this._show=void 0,this._radius=void 0,this._xHalfAngle=void 0,this._yHalfAngle=void 0,this._lineColor=void 0,this._showSectorLines=void 0,this._showSectorSegmentLines=void 0,this._showLateralSurfaces=void 0,this._material=void 0,this._showDomeSurfaces=void 0,this._showDomeLines=void 0,this._showIntersection=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._showThroughEllipsoid=void 0,this._gaze=void 0,this._showScanPlane=void 0,this._scanPlaneColor=void 0,this._scanPlaneMode=void 0,this._scanPlaneRate=void 0,this._definitionChanged=new a,this.merge(h(s,h.EMPTY_OBJECT));}return o(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:i("show"),radius:i("radius"),xHalfAngle:i("xHalfAngle"),yHalfAngle:i("yHalfAngle"),lineColor:i("lineColor"),showSectorLines:i("showSectorLines"),showSectorSegmentLines:i("showSectorSegmentLines"),showLateralSurfaces:i("showLateralSurfaces"),material:r("material"),showDomeSurfaces:i("showDomeSurfaces"),showDomeLines:i("showDomeLines "),showIntersection:i("showIntersection"),intersectionColor:i("intersectionColor"),intersectionWidth:i("intersectionWidth"),showThroughEllipsoid:i("showThroughEllipsoid"),gaze:i("gaze"),showScanPlane:i("showScanPlane"),scanPlaneColor:i("scanPlaneColor"),scanPlaneMode:i("scanPlaneMode"),scanPlaneRate:i("scanPlaneRate")}),l.prototype.clone=function(s){return y(s)||(s=new l),s.show=this.show,s.radius=this.radius,s.xHalfAngle=this.xHalfAngle,s.yHalfAngle=this.yHalfAngle,s.lineColor=this.lineColor,s.showSectorLines=this.showSectorLines,s.showSectorSegmentLines=this.showSectorSegmentLines,s.showLateralSurfaces=this.showLateralSurfaces,s.material=this.material,s.showDomeSurfaces=this.showDomeSurfaces,s.showDomeLines=this.showDomeLines,s.showIntersection=this.showIntersection,s.intersectionColor=this.intersectionColor,s.intersectionWidth=this.intersectionWidth,s.showThroughEllipsoid=this.showThroughEllipsoid,s.gaze=this.gaze,s.showScanPlane=this.showScanPlane,s.scanPlaneColor=this.scanPlaneColor,s.scanPlaneMode=this.scanPlaneMode,s.scanPlaneRate=this.scanPlaneRate,s},l.prototype.merge=function(s){if(!y(s))throw new n("source is required.");this.show=h(this.show,s.show),this.radius=h(this.radius,s.radius),this.xHalfAngle=h(this.xHalfAngle,s.xHalfAngle),this.yHalfAngle=h(this.yHalfAngle,s.yHalfAngle),this.lineColor=h(this.lineColor,s.lineColor),this.showSectorLines=h(this.showSectorLines,s.showSectorLines),this.showSectorSegmentLines=h(this.showSectorSegmentLines,s.showSectorSegmentLines),this.showLateralSurfaces=h(this.showLateralSurfaces,s.showLateralSurfaces),this.material=h(this.material,s.material),this.showDomeSurfaces=h(this.showDomeSurfaces,s.showDomeSurfaces),this.showDomeLines=h(this.showDomeLines,s.showDomeLines),this.showIntersection=h(this.showIntersection,s.showIntersection),this.intersectionColor=h(this.intersectionColor,s.intersectionColor),this.intersectionWidth=h(this.intersectionWidth,s.intersectionWidth),this.showThroughEllipsoid=h(this.showThroughEllipsoid,s.showThroughEllipsoid),this.gaze=h(this.gaze,s.gaze),this.showScanPlane=h(this.showScanPlane,s.showScanPlane),this.scanPlaneColor=h(this.scanPlaneColor,s.scanPlaneColor),this.scanPlaneMode=h(this.scanPlaneMode,s.scanPlaneMode),this.scanPlaneRate=h(this.scanPlaneRate,s.scanPlaneRate);},l}var Pe={};function ln(e,h){if(e){let P=function(b,x,T){var S=x[b.id];if(a(S)){var M=S.primitive;T.remove(M),M&&!M.isDestroyed()&&M.destroy(),delete x[b.id];}};Pe=e;var y=Pe.AssociativeArray,o=Pe.Cartesian3,n=Pe.Color,a=Pe.defined,r=Pe.destroyObject,i=Pe.DeveloperError,l=Pe.Matrix3,s=Pe.Matrix4,c=Pe.Quaternion,u=Pe.MaterialProperty,d=Pe.Property,m=new l;new s;var p=new o,g=new o,v=new c,A=new o,w=new c,C=function(b,x){if(!a(b))throw new i("scene is required.");if(!a(x))throw new i("entityCollection is required.");x.collectionChanged.addEventListener(C.prototype._onCollectionChanged,this),this._scene=b,this._primitives=b.primitives,this._entityCollection=x,this._hash={},this._entitiesToVisualize=new y,this._onCollectionChanged(x,x.values,[],[]);};return C.prototype.update=function(b){if(!a(b))throw new i("time is required.");for(var x=this._entitiesToVisualize.values,T=this._hash,S=this._primitives,M=0,E=x.length;M<E;M++){var I=x[M],D=I._rectangularSensor,V,W,z,G,X,j=T[I.id],K=I.isShowing&&I.isAvailable(b)&&d.getValueOrDefault(D._show,b,true);if(K&&(V=d.getValueOrUndefined(I._position,b,p),W=d.getValueOrUndefined(I._orientation,b,v),z=d.getValueOrUndefined(D._radius,b),G=d.getValueOrUndefined(D._xHalfAngle,b),X=d.getValueOrUndefined(D._yHalfAngle,b),K=a(V)&&a(G)&&a(X)),!K){a(j)&&(j.primitive.show=false);continue}var R=a(j)?j.primitive:void 0;a(R)||(R=new h,R.id=I,S.add(R),j={primitive:R,position:void 0,orientation:void 0},T[I.id]=j);var O=d.getValueOrUndefined(D._gaze,b);if(a(O)){var q=d.getValueOrUndefined(O._position,b,g);if(!a(V)||!a(q))continue;var Z=o.subtract(V,q,A),le=o.angleBetween(Pe.Cartesian3.UNIT_Z,Z),ie=o.cross(Pe.Cartesian3.UNIT_Z,Z,A),W=c.fromAxisAngle(ie,le-Math.PI,w);z=o.distance(V,q),R.modelMatrix=s.fromRotationTranslation(l.fromQuaternion(W,m),V,R.modelMatrix);}else (!o.equals(V,j.position)||!c.equals(W,j.orientation))&&(a(W)?(R.modelMatrix=s.fromRotationTranslation(l.fromQuaternion(W,m),V,R.modelMatrix),j.position=o.clone(V,j.position),j.orientation=c.clone(W,j.orientation)):(R.modelMatrix=Pe.Transforms.eastNorthUpToFixedFrame(V),j.position=o.clone(V,j.position)));R.show=true,R.gaze=O,R.radius=z,R.xHalfAngle=G,R.yHalfAngle=X,R.lineColor=d.getValueOrDefault(D._lineColor,b,n.WHITE),R.showSectorLines=d.getValueOrDefault(D._showSectorLines,b,true),R.showSectorSegmentLines=d.getValueOrDefault(D._showSectorSegmentLines,b,true),R.showLateralSurfaces=d.getValueOrDefault(D._showLateralSurfaces,b,true),R.material=u.getValue(b,D._material,R.material),R.showDomeSurfaces=d.getValueOrDefault(D._showDomeSurfaces,b,true),R.showDomeLines=d.getValueOrDefault(D._showDomeLines,b,true),R.showIntersection=d.getValueOrDefault(D._showIntersection,b,true),R.intersectionColor=d.getValueOrDefault(D._intersectionColor,b,n.WHITE),R.intersectionWidth=d.getValueOrDefault(D._intersectionWidth,b,1),R.showThroughEllipsoid=d.getValueOrDefault(D._showThroughEllipsoid,b,true),R.scanPlaneMode=d.getValueOrDefault(D._scanPlaneMode,b),R.scanPlaneColor=d.getValueOrDefault(D._scanPlaneColor,b,n.WHITE),R.showScanPlane=d.getValueOrDefault(D._showScanPlane,b,true),R.scanPlaneRate=d.getValueOrDefault(D._scanPlaneRate,b,1);}return true},C.prototype.isDestroyed=function(){return false},C.prototype.destroy=function(){for(var b=this._entitiesToVisualize.values,x=this._hash,T=this._primitives,S=b.length-1;S>-1;S--)P(b[S],x,T);return r(this)},C.prototype._onCollectionChanged=function(b,x,T,S){var M,E,I=this._entitiesToVisualize,D=this._hash,V=this._primitives;for(M=x.length-1;M>-1;M--)E=x[M],a(E._rectangularSensor)&&a(E._position)&&I.set(E.id,E);for(M=S.length-1;M>-1;M--)E=S[M],a(E._rectangularSensor)&&a(E._position)?I.set(E.id,E):(P(E,D,V),I.remove(E.id));for(M=T.length-1;M>-1;M--)E=T[M],P(E,D,V),I.remove(E.id);},C}}var B=null,Ft=function(e,h){e&&(this.viewer=e,B=h,this._installPlugin());};Ft.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive();},_installCylinderGeometry:function(){function e(n){this.length=n.length,this.topRadius=n.topRadius,this.bottomRadius=n.bottomRadius,this.slices=n.slices?n.slices:64,this.zReverse=n.zReverse;}var h=new B.Cartesian2,y=new B.Cartesian3,o=new B.Ray;e._createGeometry=function(n){var a=n.length,r=n.topRadius,i=n.bottomRadius,l=n.slices,s=2*Math.PI/(l-1),c=n.zReverse,u=[],d=[],m=[],f=[],p=[i,r],g=[0,c?-a:a],v=0,A=Math.atan2(i-r,a),w=h;w.z=Math.sin(A);for(var C=Math.cos(A),_=0;_<g.length;_++){f[_]=[];for(var P=p[_],b=0;b<l;b++){f[_].push(v++);var x=s*b,T=P*Math.cos(x),S=P*Math.sin(x);u.push(T,S,g[_]),T=C*Math.cos(x),S=C*Math.sin(x),d.push(T,S,w.z),m.push(_/(g.length-1),0);}}for(var M=[],_=1;_<g.length;_++)for(var b=1;b<l;b++){var E=f[_-1][b-1],I=f[_][b-1],D=f[_][b],V=f[_-1][b];M.push(D),M.push(V),M.push(E),M.push(D),M.push(E),M.push(I),b==f[_].length-1&&(E=f[_-1][b],I=f[_][b],D=f[_][0],V=f[_-1][0],M.push(D),M.push(V),M.push(E),M.push(D),M.push(E),M.push(I));}M=new Int16Array(M),u=new Float32Array(u),d=new Float32Array(d),m=new Float32Array(m);var W={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),normal:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},z=B.BoundingSphere.fromVertices(u),G=new B.Geometry({attributes:W,indices:M,primitiveType:B.PrimitiveType.TRIANGLES,boundingSphere:z});return u=[],M=[],m=[],G},e.createGeometry=function(n,a){if(!a)return e._createGeometry(n);B.Matrix4.multiplyByPoint(a,B.Cartesian3.ZERO,y),y.clone(o.origin);var r=n.length,i=n.topRadius,l=(n.bottomRadius,n.slices),s=2*Math.PI/(l-1),c=n.zReverse,u=[],d=[],m=[],f=[],p=[0,c?-r:r],g=0,g=0;u.push(0,0,0),d.push(1,1),g++;for(var v=new B.Cartesian3,A=i/15,w=0;w<16;w++){for(var C=A*w,_=[],P=0;P<l;P++){var b=s*P,x=C*Math.cos(b),T=C*Math.sin(b);v.x=x,v.y=T,v.z=p[1];var S=(0, B.Scene.extend2Earth)(v,a,o);S?(_.push(g),u.push(x,T,p[1]),d.push(w/15,1),g++):(S=y,_.push(-1));}f.push(_);}for(var M,E,I=[0,f.length-1],D=0;D<I.length;D++)for(var w=I[D],P=1;P<f[w].length;P++)M=f[w][P-1],E=f[w][P],M>=0&&E>=0&&m.push(0,M,E);u=new Float32Array(u),m=new Int32Array(m),d=new Float32Array(d);var V={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})},W=B.BoundingSphere.fromVertices(u),z=new B.Geometry({attributes:V,indices:m,primitiveType:B.PrimitiveType.TRIANGLES,boundingSphere:W});return (0, B.Scene.computeVertexNormals)(z),u=[],m=[],z},e.createOutlineGeometry=function(n){var a=n.length,r=n.topRadius,i=n.bottomRadius,l=n.slices,s=2*Math.PI/(l-1),c=n.zReverse,u=[],d=[],m=[],f=[],p=[i,r],g=[0,c?-a:a],v=0,A=Math.atan2(i-r,a),w=h;w.z=Math.sin(A);for(var C=Math.cos(A),_=0;_<g.length;_++){f[_]=[];for(var P=p[_],b=0;b<l;b++){f[_].push(v++);var x=s*b,T=P*Math.cos(x),S=P*Math.sin(x);u.push(T,S,g[_]),T=C*Math.cos(x),S=C*Math.sin(x),d.push(T,S,w.z),m.push(_/(g.length-1),0);}}for(var M=[],_=1;_<g.length;_++)for(var b=1;b<l;b+=1){var E=f[_-1][b-1],I=f[_][b-1];f[_][b],f[_-1][b],b%8==1&&M.push(E,I);}M=new Int16Array(M),u=new Float32Array(u),d=new Float32Array(d),m=new Float32Array(m);var D={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),normal:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},V=B.BoundingSphere.fromVertices(u),W=new B.Geometry({attributes:D,indices:M,primitiveType:B.PrimitiveType.LINES,boundingSphere:V});return u=[],M=[],m=[],W},e.fromAngleAndLength=function(n,a,r){return n=B.Math.toRadians(n),new e({topRadius:Math.tan(n)*a/2,bottomRadius:0,length:a,zReverse:r})},B.Scene.CylinderGeometry=e;},_installRadarPrimitive:function(){var e;function h(o,n){let a=B.defaultValue||Re;n=n||{},e=o.scene.globe.ellipsoid,this._geometry=null,this._angle=n.angle,this._radius=n.radius?n.radius:5,this._position=n.position,this._rotation=n.rotation?n.rotation:{heading:0,pitch:0,roll:0},this._trackedEntity=n.trackedEntity,this.defaultColor=n.color?n.color:B.Color.YELLOW,this.defaultLineColor=n.lineColor?n.lineColor:this.defaultColor,this._show=a(n.show,true),this._outline=a(n.outline,false),this._topShow=a(n.top,true),this._topOutline=a(n.topOutline,true),this._modelMatrix=B.Matrix4.clone(B.Matrix4.IDENTITY),this._quaternion=new B.Quaternion,this._translation=new B.Cartesian3,this._scale=new B.Cartesian3(1,1,1),this._matrix=new B.Matrix4,this._inverseMatrix=new B.Matrix4,this._positionCartographic=new B.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=o,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=a(n.groundArea,false),this.addGroundAreaEntity(this._groundArea);}Object.defineProperties(h.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(o){this._trackedEntity=o;}},color:{get:function(){return this.defaultColor},set:function(o){this.defaultColor=o;}},lineColor:{get:function(){return this.defaultLineColor},set:function(o){this.defaultLineColor=o;}},show:{get:function(){return this._show},set:function(o){this._show=o;}},outline:{get:function(){return this._outline},set:function(o){this._outline=o,this.updateGeometry();}},top:{get:function(){return this._topShow},set:function(o){this._topShow=o,this.updateGeometry();}},topOutline:{get:function(){return this._topOutline},set:function(o){this._topOutline=o,this.updateGeometry();}},groundArea:{get:function(){return this._groundArea},set:function(o){this._groundArea=o,this.addGroundAreaEntity(this._groundArea);}},angle:{get:function(){return this._angle},set:function(o){this._angle=o,this.updateGroundCircleRadius(),this.updateGeometry();}},radius:{get:function(){return this._radius},set:function(o){this._radius=o,this.updateGroundCircleRadius(),this.updateGeometry();}},heading:{get:function(){return this._rotation.heading},set:function(o){this._rotation.heading=o;}},pitch:{get:function(){return this._rotation.pitch},set:function(o){this._rotation.pitch=o;}},roll:{get:function(){return this._rotation.roll},set:function(o){this._rotation.roll=o;}},position:{get:function(){return this._position},set:function(o){this._position=o;}}}),h.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(B.Math.toRadians(this._angle));},h.prototype.isDestroyed=function(){return false},h.prototype.addGroundAreaEntity=function(o){if(o&&!this.groundAreaEntity){var n=this;this.updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:this._rotation.pitch===0&&this._rotation.roll===0,semiMinorAxis:new B.CallbackProperty(function(a){return n._ground_radius},false),semiMajorAxis:new B.CallbackProperty(function(a){return n._ground_radius},false),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0),positions:new B.CallbackProperty(function(a){return n._trackedEntityPosition?B.Cartesian3.distance(n._position,n._trackedEntityPosition)>n._radius?[]:[n._position,n._trackedEntityPosition]:[]},false),followSurface:false,material:new B.PolylineDashMaterialProperty({color:B.Color.CYAN}),width:1}});}};var y=new B.Cartesian3;h.prototype.computeMatrix=function(o,n){if(this._positionCartesian||(this._positionCartesian=new B.Cartesian3),this.position instanceof B.Cartesian3?this._positionCartesian=this.position:typeof this.position.getValue=="function"?this._positionCartesian=this.position.getValue(o):this.position._value&&this.position._value instanceof B.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position){this._positionCartesian;var r=B.Property.getValueOrUndefined(this._trackedEntity.position,o,y);r&&(this._trackedEntityPosition=r,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0);}return this._modelMatrix=B.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,e,this._modelMatrix),this._positionCartographic=B.Cartographic.fromCartesian(this._positionCartesian,e,this._positionCartographic),B.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,e,this._modelMatrix),B.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=B.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),B.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),B.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},h.prototype.getTopGeometry=function(){for(var o=this.radius,n=[],a=[],r=[],i=[],l=90-parseInt(this.angle),s=l<1?l/8:1,c=2*Math.PI/127,u=0,d=this.angle;d<91;d+=s){var m=B.Math.toRadians(d<90?d:90);m=Math.cos(m)*o;for(var f=[],p=0;p<128;p++){var g=c*p,v=m*Math.cos(g),A=m*Math.sin(g),w=Math.sqrt(o*o-v*v-A*A);n.push(v,A,w),a.push(1,1),f.push(u++);}i.push(f);}for(var d=1;d<i.length;d++)for(var p=1;p<i[d].length;p++){var C=i[d-1][p-1],_=i[d][p-1],P=i[d][p],b=i[d-1][p];r.push(C,_,P),r.push(C,P,b);}n=new Float32Array(n),r=new Int32Array(r),a=new Float32Array(a);var x={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:a})},T=B.BoundingSphere.fromVertices(n),S=new B.Geometry({attributes:x,indices:r,primitiveType:B.PrimitiveType.TRIANGLES,boundingSphere:T});return (0, B.Scene.computeVertexNormals)(S),S},h.prototype.getTopOutlineGeometry=function(){for(var o=this.radius,n=[],a=[],r=[],i=[],l=90-parseInt(this.angle),s=l<1?l/8:1,c=2*Math.PI/127,u=0,d=this.angle;d<91;d+=s){var m=B.Math.toRadians(d<90?d:90);m=Math.cos(m)*o;for(var f=[],p=0;p<128;p++){var g=c*p,v=m*Math.cos(g),A=m*Math.sin(g),w=Math.sqrt(o*o-v*v-A*A);n.push(v,A,w),a.push(1,1),f.push(u++);}i.push(f);}for(var d=1;d<i.length;d++)for(var p=1;p<i[d].length;p++){var C=i[d-1][p-1],_=i[d][p-1],P=i[d][p];i[d-1][p],p%8==1&&r.push(C,_),d%8==1&&r.push(_,P);}n=new Float32Array(n),r=new Int32Array(r),a=new Float32Array(a);var b={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:a})},x=B.BoundingSphere.fromVertices(n),T=new B.Geometry({attributes:b,indices:r,primitiveType:B.PrimitiveType.LINES,boundingSphere:x});return (0, B.Scene.computeVertexNormals)(T),T},h.prototype.updateGeometry=function(){this._geometry=B.Scene.CylinderGeometry.createGeometry(new B.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(B.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(B.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=B.Scene.CylinderGeometry.createOutlineGeometry(new B.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(B.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(B.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var o=0;o<this._positions.length;o++)this._positions[o]=this._geometry.attributes.position.values[o];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(n){n.vertexArray=n.vertexArray&&n.vertexArray.destroy();}),this._drawCommands.splice(0,this._drawCommands.length));},h.prototype.update=function(o){this._show&&(this.computeMatrix(o.time),o.mode===B.SceneMode.SCENE3D?(this._geometry.boundingSphere=B.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,o)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,o)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,o)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,o)))),this._drawCommands.forEach(function(n){o.commandList.push(n);}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&this._rotation.pitch===0&&this._rotation.roll===0,this.groundAreaEntity.polyline.show=false)):(this.groundAreaEntity||this.addGroundAreaEntity(true),this.groundAreaEntity.ellipse.show=this._rotation.pitch===0&&this._rotation.roll===0,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0)));},h.prototype.getFragmentShaderSource=function(o){return `#version 300 es
963
+ }`;var K={};function ln(e){K=e;var u=K.BoundingSphere,f=K.Cartesian3,a=K.Color,n=K.combine,o=K.ComponentDatatype,r=K.defaultValue||K.Scene.defaultValue,i=K.defined;K.destroyObject;var c=K.DeveloperError,M=K.Matrix4,h=K.PrimitiveType,d=K.Buffer,m=K.BufferUsage,y=K.DrawCommand,p=K.Pass,g=K.RenderState,v=K.ShaderProgram,A=K.ShaderSource,w=K.VertexArray,C=K.BlendingState,b=K.CullFace,P=K.Material,_=K.SceneMode,S=K.VertexFormat,I=K.Math,x=K.Matrix3,M=K.Matrix4,T=K.JulianDate;K.BoxGeometry;K.EllipsoidGeometry;var O=Math.sin,U=Math.cos,z=Math.tan,V=Math.atan,H={position:0,normal:1};function q(L){var F=this;L=r(L,r.EMPTY_OBJECT),this.show=r(L.show,true),this.slice=r(L.slice,32),this.modelMatrix=M.clone(L.modelMatrix,new M),this._modelMatrix=new M,this._computedModelMatrix=new M,this._computedScanPlaneModelMatrix=new M,this.radius=r(L.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=r(L.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=r(L.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=r(L.lineColor,a.WHITE),this.showSectorLines=r(L.showSectorLines,true),this.showSectorSegmentLines=r(L.showSectorSegmentLines,true),this.showLateralSurfaces=r(L.showLateralSurfaces,true),this.material=i(L.material)?L.material:P.fromType(P.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=i(L.lateralSurfaceMaterial)?L.lateralSurfaceMaterial:P.fromType(P.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=r(L.showDomeSurfaces,true),this.domeSurfaceMaterial=i(L.domeSurfaceMaterial)?L.domeSurfaceMaterial:P.fromType(P.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=r(L.showDomeLines,true),this.showIntersection=r(L.showIntersection,true),this.intersectionColor=r(L.intersectionColor,a.WHITE),this.intersectionWidth=r(L.intersectionWidth,5),this.showThroughEllipsoid=r(L.showThroughEllipsoid,false),this._showThroughEllipsoid=void 0,this.showScanPlane=r(L.showScanPlane,true),this.scanPlaneColor=r(L.scanPlaneColor,a.WHITE),this.scanPlaneMode=r(L.scanPlaneMode,"horizontal"),this.scanPlaneRate=r(L.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=T.now(),this._boundingSphere=new u,this._boundingSphereWC=new u,this._sectorFrontCommand=new y({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new y({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new y({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new y({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new y({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new y({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new y({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new y({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new y({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return F.xHalfAngle},u_yHalfAngle:function(){return F.yHalfAngle},u_radius:function(){return F.radius},u_showThroughEllipsoid:function(){return F.showThroughEllipsoid},u_showIntersection:function(){return F.showIntersection},u_intersectionColor:function(){return F.intersectionColor},u_intersectionWidth:function(){return F.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return F.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return F._scanePlaneXHalfAngle},u_yHalfAngle:function(){return F._scanePlaneYHalfAngle},u_radius:function(){return F.radius},u_color:function(){return F.scanPlaneColor},u_showThroughEllipsoid:function(){return F.showThroughEllipsoid},u_showIntersection:function(){return F.showIntersection},u_intersectionColor:function(){return F.intersectionColor},u_intersectionWidth:function(){return F.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return F.lineColor}};}q.prototype.update=function(L){var F=L.mode;if(!(!this.show||F!==_.SCENE3D)){var X=false,W=false,N=false,J=this.xHalfAngle,ne=this.yHalfAngle;if(J<0||ne<0)throw new c("halfAngle must be greater than or equal to zero.");if(!(J==0||ne==0)){(this._xHalfAngle!==J||this._yHalfAngle!==ne)&&(this._xHalfAngle=J,this._yHalfAngle=ne,X=true);var Z=this.radius;if(Z<0)throw new c("this.radius must be greater than or equal to zero.");var $=false;this._radius!==Z&&($=true,this._radius=Z,this._boundingSphere=new u(f.ZERO,this.radius));var me=!M.equals(this.modelMatrix,this._modelMatrix);(me||$)&&(M.clone(this.modelMatrix,this._modelMatrix),M.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),u.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var _e=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=_e,W=true);var fe=this.material;this._material!==fe&&(this._material=fe,W=true,N=true);var Se=fe.isTranslucent();if(this._translucent!==Se&&(this._translucent=Se,W=true),this.showScanPlane){var lt=L.time,Kt=T.secondsDifference(lt,this._time);Kt<0&&(this._time=T.clone(lt,this._time));var Zt=Math.max(Kt%this.scanPlaneRate/this.scanPlaneRate,0),Ze;if(this.scanPlaneMode=="horizontal"){Ze=2*ne*Zt-ne;var Xn=U(Ze),jn=z(J),Yn=V(Xn*jn);this._scanePlaneXHalfAngle=Yn,this._scanePlaneYHalfAngle=Ze,K.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,k);}else {Ze=2*J*Zt-J;var qn=z(ne),Qn=U(Ze),Jn=V(Qn*qn);this._scanePlaneXHalfAngle=Ze,this._scanePlaneYHalfAngle=Jn,K.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,k);}K.Matrix4.multiplyByMatrix3(this.modelMatrix,k,this._computedScanPlaneModelMatrix),M.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix);}X&&Me(this,L),W&&Ke(this,_e,Se),N&&st(this,L,fe),(W||N)&&Ie(this,Se);var Kn=L.commandList,Zn=L.passes,$t=this._colorCommands;if(Zn.render)for(var kt=0,$n=$t.length;kt<$n;kt++){var er=$t[kt];Kn.push(er);}}}},q.prototype.isDestroyed=function(){return false};var k=new x,G=new f;function Y(L,F,X){for(var W=L.slice,N=U(X),J=z(X),ne=U(F),Z=z(F),$=V(ne*J),me=V(N*Z),_e=[],fe=0;fe<W;fe++){var Se=2*$*fe/(W-1)-$;_e.push(new f(0,O(Se),U(Se)));}for(var lt=[],fe=0;fe<W;fe++){var Se=2*me*fe/(W-1)-me;lt.push(new f(O(Se),0,U(Se)));}return {zoy:_e,zox:lt}}function Q(L,F){var X=L.xHalfAngle,W=L.yHalfAngle,N=F.zoy,J=F.zox,ne=[],Z=x.fromRotationY(X,k);ne.push(N.map(function($){return x.multiplyByVector(Z,$,new K.Cartesian3)}));var Z=x.fromRotationX(-W,k);ne.push(J.map(function($){return x.multiplyByVector(Z,$,new K.Cartesian3)}).reverse());var Z=x.fromRotationY(-X,k);ne.push(N.map(function($){return x.multiplyByVector(Z,$,new K.Cartesian3)}).reverse());var Z=x.fromRotationX(W,k);return ne.push(J.map(function($){return x.multiplyByVector(Z,$,new K.Cartesian3)})),ne}function ie(L,F){for(var X=Array.prototype.concat.apply([],F).length-F.length,W=new Float32Array(18*X),N=0,J=0,ne=F.length;J<ne;J++)for(var Z=F[J],$=f.normalize(f.cross(Z[0],Z[Z.length-1],G),G),me=0,X=Z.length-1;me<X;me++)W[N++]=0,W[N++]=0,W[N++]=0,W[N++]=-$.x,W[N++]=-$.y,W[N++]=-$.z,W[N++]=Z[me].x,W[N++]=Z[me].y,W[N++]=Z[me].z,W[N++]=-$.x,W[N++]=-$.y,W[N++]=-$.z,W[N++]=Z[me+1].x,W[N++]=Z[me+1].y,W[N++]=Z[me+1].z,W[N++]=-$.x,W[N++]=-$.y,W[N++]=-$.z;var _e=d.createVertexBuffer({context:L,typedArray:W,usage:m.STATIC_DRAW}),fe=6*Float32Array.BYTES_PER_ELEMENT,Se=[{index:H.position,vertexBuffer:_e,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:0,strideInBytes:fe},{index:H.normal,vertexBuffer:_e,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:fe}];return new w({context:L,attributes:Se})}function le(L,F){for(var X=F.length,W=new Float32Array(9*X),N=0,J=0,ne=F.length;J<ne;J++){var Z=F[J];W[N++]=0,W[N++]=0,W[N++]=0,W[N++]=Z[0].x,W[N++]=Z[0].y,W[N++]=Z[0].z;}var $=d.createVertexBuffer({context:L,typedArray:W,usage:m.STATIC_DRAW}),me=3*Float32Array.BYTES_PER_ELEMENT,_e=[{index:H.position,vertexBuffer:$,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:0,strideInBytes:me}];return new w({context:L,attributes:_e})}function ue(L,F){for(var X=Array.prototype.concat.apply([],F).length-F.length,W=new Float32Array(9*X),N=0,J=0,ne=F.length;J<ne;J++)for(var Z=F[J],$=0,X=Z.length-1;$<X;$++)W[N++]=Z[$].x,W[N++]=Z[$].y,W[N++]=Z[$].z,W[N++]=Z[$+1].x,W[N++]=Z[$+1].y,W[N++]=Z[$+1].z;var me=d.createVertexBuffer({context:L,typedArray:W,usage:m.STATIC_DRAW}),_e=3*Float32Array.BYTES_PER_ELEMENT,fe=[{index:H.position,vertexBuffer:me,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:0,strideInBytes:_e}];return new w({context:L,attributes:fe})}function ce(L){var F=K.EllipsoidGeometry.createGeometry(new K.EllipsoidGeometry({vertexFormat:S.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),X=w.fromGeometry({context:L,geometry:F,attributeLocations:H,bufferUsage:m.STATIC_DRAW,interleave:false});return X}function Ae(L){var F=K.EllipsoidOutlineGeometry.createGeometry(new K.EllipsoidOutlineGeometry({vertexFormat:S.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),X=w.fromGeometry({context:L,geometry:F,attributeLocations:H,bufferUsage:m.STATIC_DRAW,interleave:false});return X}function be(L,F){for(var X=F.length-1,W=new Float32Array(9*X),N=0,J=0;J<X;J++)W[N++]=0,W[N++]=0,W[N++]=0,W[N++]=F[J].x,W[N++]=F[J].y,W[N++]=F[J].z,W[N++]=F[J+1].x,W[N++]=F[J+1].y,W[N++]=F[J+1].z;var ne=d.createVertexBuffer({context:L,typedArray:W,usage:m.STATIC_DRAW}),Z=3*Float32Array.BYTES_PER_ELEMENT,$=[{index:H.position,vertexBuffer:ne,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:0,strideInBytes:Z}];return new w({context:L,attributes:$})}function Me(L,F){var X=F.context,W=Y(L,L.xHalfAngle,L.yHalfAngle),N=Q(L,W);if(L.showLateralSurfaces&&(L._sectorVA=ie(X,N)),L.showSectorLines&&(L._sectorLineVA=le(X,N)),L.showSectorSegmentLines&&(L._sectorSegmentLineVA=ue(X,N)),L.showDomeSurfaces&&(L._domeVA=ce(X)),L.showDomeLines&&(L._domeLineVA=Ae(X)),L.showScanPlane)if(L.scanPlaneMode=="horizontal"){var J=Y(L,I.PI_OVER_TWO,0);L._scanPlaneVA=be(X,J.zox);}else {var J=Y(L,0,I.PI_OVER_TWO);L._scanPlaneVA=be(X,J.zoy);}}function we(L,F,X){var W=F.context,N=Ft,J=new A({sources:[_t,X.shaderSource,Vt]});L._sp=v.replaceCache({context:W,shaderProgram:L._sp,vertexShaderSource:N,fragmentShaderSource:J,attributeLocations:H});var ne=new A({sources:[_t,X.shaderSource,Vt],pickColorQualifier:"uniform"});L._pickSP=v.replaceCache({context:W,shaderProgram:L._pickSP,vertexShaderSource:N,fragmentShaderSource:ne,attributeLocations:H});}function Fe(L,F,X){var W=F.context,N=Ft,J=new A({sources:[_t,X.shaderSource,sn]});L._scanePlaneSP=v.replaceCache({context:W,shaderProgram:L._scanePlaneSP,vertexShaderSource:N,fragmentShaderSource:J,attributeLocations:H});}function st(L,F,X){we(L,F,X),L.showScanPlane&&Fe(L,F,X);}function Ke(L,F,X){X?(L._frontFaceRS=g.fromCache({depthTest:{enabled:!F},depthMask:false,blending:C.ALPHA_BLEND,cull:{enabled:true,face:b.BACK}}),L._backFaceRS=g.fromCache({depthTest:{enabled:!F},depthMask:false,blending:C.ALPHA_BLEND,cull:{enabled:true,face:b.FRONT}}),L._pickRS=g.fromCache({depthTest:{enabled:!F},depthMask:false,blending:C.ALPHA_BLEND})):(L._frontFaceRS=g.fromCache({depthTest:{enabled:!F},depthMask:true}),L._pickRS=g.fromCache({depthTest:{enabled:true},depthMask:true}));}function xe(L,F,X,W,N,J,ne,Z,$,me,_e,fe){me&&X&&(X.vertexArray=ne,X.renderState=N,X.shaderProgram=J,X.uniformMap=n(Z,L._material._uniforms),X.uniformMap.u_normalDirection=function(){return -1},X.pass=_e,X.modelMatrix=$,L._colorCommands.push(X)),F.vertexArray=ne,F.renderState=W,F.shaderProgram=J,F.uniformMap=n(Z,L._material._uniforms),fe&&(F.uniformMap.u_type=function(){return 1}),F.pass=_e,F.modelMatrix=$,L._colorCommands.push(F);}function Ie(L,F){L._colorCommands.length=0;var X=F?p.TRANSLUCENT:p.OPAQUE;L.showLateralSurfaces&&xe(L,L._sectorFrontCommand,L._sectorBackCommand,L._frontFaceRS,L._backFaceRS,L._sp,L._sectorVA,L._uniforms,L._computedModelMatrix,F,X),L.showSectorLines&&xe(L,L._sectorLineCommand,void 0,L._frontFaceRS,L._backFaceRS,L._sp,L._sectorLineVA,L._uniforms,L._computedModelMatrix,F,X,true),L.showSectorSegmentLines&&xe(L,L._sectorSegmentLineCommand,void 0,L._frontFaceRS,L._backFaceRS,L._sp,L._sectorSegmentLineVA,L._uniforms,L._computedModelMatrix,F,X,true),L.showDomeSurfaces&&xe(L,L._domeFrontCommand,L._domeBackCommand,L._frontFaceRS,L._backFaceRS,L._sp,L._domeVA,L._uniforms,L._computedModelMatrix,F,X),L.showDomeLines&&xe(L,L._domeLineCommand,void 0,L._frontFaceRS,L._backFaceRS,L._sp,L._domeLineVA,L._uniforms,L._computedModelMatrix,F,X,true),L.showScanPlane&&xe(L,L._scanPlaneFrontCommand,L._scanPlaneBackCommand,L._frontFaceRS,L._backFaceRS,L._scanePlaneSP,L._scanPlaneVA,L._scanUniforms,L._computedScanPlaneModelMatrix,F,X);}return q}var Ue={};function cn(e){Ue=e;var u=Ue.defaultValue||Ue.Scene.defaultValue,f=Ue.defined,a=Object.defineProperties,n=Ue.DeveloperError,o=Ue.Event,r=Ue.createMaterialPropertyDescriptor,i=Ue.createPropertyDescriptor;function s(l){this._show=void 0,this._radius=void 0,this._xHalfAngle=void 0,this._yHalfAngle=void 0,this._lineColor=void 0,this._showSectorLines=void 0,this._showSectorSegmentLines=void 0,this._showLateralSurfaces=void 0,this._material=void 0,this._showDomeSurfaces=void 0,this._showDomeLines=void 0,this._showIntersection=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._showThroughEllipsoid=void 0,this._gaze=void 0,this._showScanPlane=void 0,this._scanPlaneColor=void 0,this._scanPlaneMode=void 0,this._scanPlaneRate=void 0,this._definitionChanged=new o,this.merge(u(l,u.EMPTY_OBJECT));}return a(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:i("show"),radius:i("radius"),xHalfAngle:i("xHalfAngle"),yHalfAngle:i("yHalfAngle"),lineColor:i("lineColor"),showSectorLines:i("showSectorLines"),showSectorSegmentLines:i("showSectorSegmentLines"),showLateralSurfaces:i("showLateralSurfaces"),material:r("material"),showDomeSurfaces:i("showDomeSurfaces"),showDomeLines:i("showDomeLines "),showIntersection:i("showIntersection"),intersectionColor:i("intersectionColor"),intersectionWidth:i("intersectionWidth"),showThroughEllipsoid:i("showThroughEllipsoid"),gaze:i("gaze"),showScanPlane:i("showScanPlane"),scanPlaneColor:i("scanPlaneColor"),scanPlaneMode:i("scanPlaneMode"),scanPlaneRate:i("scanPlaneRate")}),s.prototype.clone=function(l){return f(l)||(l=new s),l.show=this.show,l.radius=this.radius,l.xHalfAngle=this.xHalfAngle,l.yHalfAngle=this.yHalfAngle,l.lineColor=this.lineColor,l.showSectorLines=this.showSectorLines,l.showSectorSegmentLines=this.showSectorSegmentLines,l.showLateralSurfaces=this.showLateralSurfaces,l.material=this.material,l.showDomeSurfaces=this.showDomeSurfaces,l.showDomeLines=this.showDomeLines,l.showIntersection=this.showIntersection,l.intersectionColor=this.intersectionColor,l.intersectionWidth=this.intersectionWidth,l.showThroughEllipsoid=this.showThroughEllipsoid,l.gaze=this.gaze,l.showScanPlane=this.showScanPlane,l.scanPlaneColor=this.scanPlaneColor,l.scanPlaneMode=this.scanPlaneMode,l.scanPlaneRate=this.scanPlaneRate,l},s.prototype.merge=function(l){if(!f(l))throw new n("source is required.");this.show=u(this.show,l.show),this.radius=u(this.radius,l.radius),this.xHalfAngle=u(this.xHalfAngle,l.xHalfAngle),this.yHalfAngle=u(this.yHalfAngle,l.yHalfAngle),this.lineColor=u(this.lineColor,l.lineColor),this.showSectorLines=u(this.showSectorLines,l.showSectorLines),this.showSectorSegmentLines=u(this.showSectorSegmentLines,l.showSectorSegmentLines),this.showLateralSurfaces=u(this.showLateralSurfaces,l.showLateralSurfaces),this.material=u(this.material,l.material),this.showDomeSurfaces=u(this.showDomeSurfaces,l.showDomeSurfaces),this.showDomeLines=u(this.showDomeLines,l.showDomeLines),this.showIntersection=u(this.showIntersection,l.showIntersection),this.intersectionColor=u(this.intersectionColor,l.intersectionColor),this.intersectionWidth=u(this.intersectionWidth,l.intersectionWidth),this.showThroughEllipsoid=u(this.showThroughEllipsoid,l.showThroughEllipsoid),this.gaze=u(this.gaze,l.gaze),this.showScanPlane=u(this.showScanPlane,l.showScanPlane),this.scanPlaneColor=u(this.scanPlaneColor,l.scanPlaneColor),this.scanPlaneMode=u(this.scanPlaneMode,l.scanPlaneMode),this.scanPlaneRate=u(this.scanPlaneRate,l.scanPlaneRate);},s}var Pe={};function un(e,u){if(e){let P=function(_,S,I){var x=S[_.id];if(o(x)){var M=x.primitive;I.remove(M),M&&!M.isDestroyed()&&M.destroy(),delete S[_.id];}};Pe=e;var f=Pe.AssociativeArray,a=Pe.Cartesian3,n=Pe.Color,o=Pe.defined,r=Pe.destroyObject,i=Pe.DeveloperError,s=Pe.Matrix3,l=Pe.Matrix4,c=Pe.Quaternion,h=Pe.MaterialProperty,d=Pe.Property,m=new s;new l;var p=new a,g=new a,v=new c,A=new a,w=new c,C=function(_,S){if(!o(_))throw new i("scene is required.");if(!o(S))throw new i("entityCollection is required.");S.collectionChanged.addEventListener(C.prototype._onCollectionChanged,this),this._scene=_,this._primitives=_.primitives,this._entityCollection=S,this._hash={},this._entitiesToVisualize=new f,this._onCollectionChanged(S,S.values,[],[]);};return C.prototype.update=function(_){if(!o(_))throw new i("time is required.");for(var S=this._entitiesToVisualize.values,I=this._hash,x=this._primitives,M=0,T=S.length;M<T;M++){var E=S[M],R=E._rectangularSensor,O,U,z,V,j,H=I[E.id],q=E.isShowing&&E.isAvailable(_)&&d.getValueOrDefault(R._show,_,true);if(q&&(O=d.getValueOrUndefined(E._position,_,p),U=d.getValueOrUndefined(E._orientation,_,v),z=d.getValueOrUndefined(R._radius,_),V=d.getValueOrUndefined(R._xHalfAngle,_),j=d.getValueOrUndefined(R._yHalfAngle,_),q=o(O)&&o(V)&&o(j)),!q){o(H)&&(H.primitive.show=false);continue}var k=o(H)?H.primitive:void 0;o(k)||(k=new u,k.id=E,x.add(k),H={primitive:k,position:void 0,orientation:void 0},I[E.id]=H);var G=d.getValueOrUndefined(R._gaze,_);if(o(G)){var Y=d.getValueOrUndefined(G._position,_,g);if(!o(O)||!o(Y))continue;var Q=a.subtract(O,Y,A),ie=a.angleBetween(Pe.Cartesian3.UNIT_Z,Q),le=a.cross(Pe.Cartesian3.UNIT_Z,Q,A),U=c.fromAxisAngle(le,ie-Math.PI,w);z=a.distance(O,Y),k.modelMatrix=l.fromRotationTranslation(s.fromQuaternion(U,m),O,k.modelMatrix);}else (!a.equals(O,H.position)||!c.equals(U,H.orientation))&&(o(U)?(k.modelMatrix=l.fromRotationTranslation(s.fromQuaternion(U,m),O,k.modelMatrix),H.position=a.clone(O,H.position),H.orientation=c.clone(U,H.orientation)):(k.modelMatrix=Pe.Transforms.eastNorthUpToFixedFrame(O),H.position=a.clone(O,H.position)));k.show=true,k.gaze=G,k.radius=z,k.xHalfAngle=V,k.yHalfAngle=j,k.lineColor=d.getValueOrDefault(R._lineColor,_,n.WHITE),k.showSectorLines=d.getValueOrDefault(R._showSectorLines,_,true),k.showSectorSegmentLines=d.getValueOrDefault(R._showSectorSegmentLines,_,true),k.showLateralSurfaces=d.getValueOrDefault(R._showLateralSurfaces,_,true),k.material=h.getValue(_,R._material,k.material),k.showDomeSurfaces=d.getValueOrDefault(R._showDomeSurfaces,_,true),k.showDomeLines=d.getValueOrDefault(R._showDomeLines,_,true),k.showIntersection=d.getValueOrDefault(R._showIntersection,_,true),k.intersectionColor=d.getValueOrDefault(R._intersectionColor,_,n.WHITE),k.intersectionWidth=d.getValueOrDefault(R._intersectionWidth,_,1),k.showThroughEllipsoid=d.getValueOrDefault(R._showThroughEllipsoid,_,true),k.scanPlaneMode=d.getValueOrDefault(R._scanPlaneMode,_),k.scanPlaneColor=d.getValueOrDefault(R._scanPlaneColor,_,n.WHITE),k.showScanPlane=d.getValueOrDefault(R._showScanPlane,_,true),k.scanPlaneRate=d.getValueOrDefault(R._scanPlaneRate,_,1);}return true},C.prototype.isDestroyed=function(){return false},C.prototype.destroy=function(){for(var _=this._entitiesToVisualize.values,S=this._hash,I=this._primitives,x=_.length-1;x>-1;x--)P(_[x],S,I);return r(this)},C.prototype._onCollectionChanged=function(_,S,I,x){var M,T,E=this._entitiesToVisualize,R=this._hash,O=this._primitives;for(M=S.length-1;M>-1;M--)T=S[M],o(T._rectangularSensor)&&o(T._position)&&E.set(T.id,T);for(M=x.length-1;M>-1;M--)T=x[M],o(T._rectangularSensor)&&o(T._position)?E.set(T.id,T):(P(T,R,O),E.remove(T.id));for(M=I.length-1;M>-1;M--)T=I[M],P(T,R,O),E.remove(T.id);},C}}var B=null,Ht=function(e,u){e&&(this.viewer=e,B=u,this._installPlugin());};Ht.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive();},_installCylinderGeometry:function(){function e(n){this.length=n.length,this.topRadius=n.topRadius,this.bottomRadius=n.bottomRadius,this.slices=n.slices?n.slices:64,this.zReverse=n.zReverse;}var u=new B.Cartesian2,f=new B.Cartesian3,a=new B.Ray;e._createGeometry=function(n){var o=n.length,r=n.topRadius,i=n.bottomRadius,s=n.slices,l=2*Math.PI/(s-1),c=n.zReverse,h=[],d=[],m=[],y=[],p=[i,r],g=[0,c?-o:o],v=0,A=Math.atan2(i-r,o),w=u;w.z=Math.sin(A);for(var C=Math.cos(A),b=0;b<g.length;b++){y[b]=[];for(var P=p[b],_=0;_<s;_++){y[b].push(v++);var S=l*_,I=P*Math.cos(S),x=P*Math.sin(S);h.push(I,x,g[b]),I=C*Math.cos(S),x=C*Math.sin(S),d.push(I,x,w.z),m.push(b/(g.length-1),0);}}for(var M=[],b=1;b<g.length;b++)for(var _=1;_<s;_++){var T=y[b-1][_-1],E=y[b][_-1],R=y[b][_],O=y[b-1][_];M.push(R),M.push(O),M.push(T),M.push(R),M.push(T),M.push(E),_==y[b].length-1&&(T=y[b-1][_],E=y[b][_],R=y[b][0],O=y[b-1][0],M.push(R),M.push(O),M.push(T),M.push(R),M.push(T),M.push(E));}M=new Int16Array(M),h=new Float32Array(h),d=new Float32Array(d),m=new Float32Array(m);var U={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},z=B.BoundingSphere.fromVertices(h),V=new B.Geometry({attributes:U,indices:M,primitiveType:B.PrimitiveType.TRIANGLES,boundingSphere:z});return h=[],M=[],m=[],V},e.createGeometry=function(n,o){if(!o)return e._createGeometry(n);B.Matrix4.multiplyByPoint(o,B.Cartesian3.ZERO,f),f.clone(a.origin);var r=n.length,i=n.topRadius,s=(n.bottomRadius,n.slices),l=2*Math.PI/(s-1),c=n.zReverse,h=[],d=[],m=[],y=[],p=[0,c?-r:r],g=0,g=0;h.push(0,0,0),d.push(1,1),g++;for(var v=new B.Cartesian3,A=i/15,w=0;w<16;w++){for(var C=A*w,b=[],P=0;P<s;P++){var _=l*P,S=C*Math.cos(_),I=C*Math.sin(_);v.x=S,v.y=I,v.z=p[1];var x=(0, B.Scene.extend2Earth)(v,o,a);x?(b.push(g),h.push(S,I,p[1]),d.push(w/15,1),g++):(x=f,b.push(-1));}y.push(b);}for(var M,T,E=[0,y.length-1],R=0;R<E.length;R++)for(var w=E[R],P=1;P<y[w].length;P++)M=y[w][P-1],T=y[w][P],M>=0&&T>=0&&m.push(0,M,T);h=new Float32Array(h),m=new Int32Array(m),d=new Float32Array(d);var O={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})},U=B.BoundingSphere.fromVertices(h),z=new B.Geometry({attributes:O,indices:m,primitiveType:B.PrimitiveType.TRIANGLES,boundingSphere:U});return (0, B.Scene.computeVertexNormals)(z),h=[],m=[],z},e.createOutlineGeometry=function(n){var o=n.length,r=n.topRadius,i=n.bottomRadius,s=n.slices,l=2*Math.PI/(s-1),c=n.zReverse,h=[],d=[],m=[],y=[],p=[i,r],g=[0,c?-o:o],v=0,A=Math.atan2(i-r,o),w=u;w.z=Math.sin(A);for(var C=Math.cos(A),b=0;b<g.length;b++){y[b]=[];for(var P=p[b],_=0;_<s;_++){y[b].push(v++);var S=l*_,I=P*Math.cos(S),x=P*Math.sin(S);h.push(I,x,g[b]),I=C*Math.cos(S),x=C*Math.sin(S),d.push(I,x,w.z),m.push(b/(g.length-1),0);}}for(var M=[],b=1;b<g.length;b++)for(var _=1;_<s;_+=1){var T=y[b-1][_-1],E=y[b][_-1];y[b][_],y[b-1][_],_%8==1&&M.push(T,E);}M=new Int16Array(M),h=new Float32Array(h),d=new Float32Array(d),m=new Float32Array(m);var R={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},O=B.BoundingSphere.fromVertices(h),U=new B.Geometry({attributes:R,indices:M,primitiveType:B.PrimitiveType.LINES,boundingSphere:O});return h=[],M=[],m=[],U},e.fromAngleAndLength=function(n,o,r){return n=B.Math.toRadians(n),new e({topRadius:Math.tan(n)*o/2,bottomRadius:0,length:o,zReverse:r})},B.Scene.CylinderGeometry=e;},_installRadarPrimitive:function(){var e;function u(a,n){let o=B.defaultValue||Be;n=n||{},e=a.scene.globe.ellipsoid,this._geometry=null,this._angle=n.angle,this._radius=n.radius?n.radius:5,this._position=n.position,this._rotation=n.rotation?n.rotation:{heading:0,pitch:0,roll:0},this._trackedEntity=n.trackedEntity,this.defaultColor=n.color?n.color:B.Color.YELLOW,this.defaultLineColor=n.lineColor?n.lineColor:this.defaultColor,this._show=o(n.show,true),this._outline=o(n.outline,false),this._topShow=o(n.top,true),this._topOutline=o(n.topOutline,true),this._modelMatrix=B.Matrix4.clone(B.Matrix4.IDENTITY),this._quaternion=new B.Quaternion,this._translation=new B.Cartesian3,this._scale=new B.Cartesian3(1,1,1),this._matrix=new B.Matrix4,this._inverseMatrix=new B.Matrix4,this._positionCartographic=new B.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=a,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=o(n.groundArea,false),this.addGroundAreaEntity(this._groundArea);}Object.defineProperties(u.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(a){this._trackedEntity=a;}},color:{get:function(){return this.defaultColor},set:function(a){this.defaultColor=a;}},lineColor:{get:function(){return this.defaultLineColor},set:function(a){this.defaultLineColor=a;}},show:{get:function(){return this._show},set:function(a){this._show=a;}},outline:{get:function(){return this._outline},set:function(a){this._outline=a,this.updateGeometry();}},top:{get:function(){return this._topShow},set:function(a){this._topShow=a,this.updateGeometry();}},topOutline:{get:function(){return this._topOutline},set:function(a){this._topOutline=a,this.updateGeometry();}},groundArea:{get:function(){return this._groundArea},set:function(a){this._groundArea=a,this.addGroundAreaEntity(this._groundArea);}},angle:{get:function(){return this._angle},set:function(a){this._angle=a,this.updateGroundCircleRadius(),this.updateGeometry();}},radius:{get:function(){return this._radius},set:function(a){this._radius=a,this.updateGroundCircleRadius(),this.updateGeometry();}},heading:{get:function(){return this._rotation.heading},set:function(a){this._rotation.heading=a;}},pitch:{get:function(){return this._rotation.pitch},set:function(a){this._rotation.pitch=a;}},roll:{get:function(){return this._rotation.roll},set:function(a){this._rotation.roll=a;}},position:{get:function(){return this._position},set:function(a){this._position=a;}}}),u.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(B.Math.toRadians(this._angle));},u.prototype.isDestroyed=function(){return false},u.prototype.addGroundAreaEntity=function(a){if(a&&!this.groundAreaEntity){var n=this;this.updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:this._rotation.pitch===0&&this._rotation.roll===0,semiMinorAxis:new B.CallbackProperty(function(o){return n._ground_radius},false),semiMajorAxis:new B.CallbackProperty(function(o){return n._ground_radius},false),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0),positions:new B.CallbackProperty(function(o){return n._trackedEntityPosition?B.Cartesian3.distance(n._position,n._trackedEntityPosition)>n._radius?[]:[n._position,n._trackedEntityPosition]:[]},false),followSurface:false,material:new B.PolylineDashMaterialProperty({color:B.Color.CYAN}),width:1}});}};var f=new B.Cartesian3;u.prototype.computeMatrix=function(a,n){if(this._positionCartesian||(this._positionCartesian=new B.Cartesian3),this.position instanceof B.Cartesian3?this._positionCartesian=this.position:typeof this.position.getValue=="function"?this._positionCartesian=this.position.getValue(a):this.position._value&&this.position._value instanceof B.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position){this._positionCartesian;var r=B.Property.getValueOrUndefined(this._trackedEntity.position,a,f);r&&(this._trackedEntityPosition=r,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0);}return this._modelMatrix=B.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,e,this._modelMatrix),this._positionCartographic=B.Cartographic.fromCartesian(this._positionCartesian,e,this._positionCartographic),B.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,e,this._modelMatrix),B.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=B.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),B.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),B.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},u.prototype.getTopGeometry=function(){for(var a=this.radius,n=[],o=[],r=[],i=[],s=90-parseInt(this.angle),l=s<1?s/8:1,c=2*Math.PI/127,h=0,d=this.angle;d<91;d+=l){var m=B.Math.toRadians(d<90?d:90);m=Math.cos(m)*a;for(var y=[],p=0;p<128;p++){var g=c*p,v=m*Math.cos(g),A=m*Math.sin(g),w=Math.sqrt(a*a-v*v-A*A);n.push(v,A,w),o.push(1,1),y.push(h++);}i.push(y);}for(var d=1;d<i.length;d++)for(var p=1;p<i[d].length;p++){var C=i[d-1][p-1],b=i[d][p-1],P=i[d][p],_=i[d-1][p];r.push(C,b,P),r.push(C,P,_);}n=new Float32Array(n),r=new Int32Array(r),o=new Float32Array(o);var S={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:o})},I=B.BoundingSphere.fromVertices(n),x=new B.Geometry({attributes:S,indices:r,primitiveType:B.PrimitiveType.TRIANGLES,boundingSphere:I});return (0, B.Scene.computeVertexNormals)(x),x},u.prototype.getTopOutlineGeometry=function(){for(var a=this.radius,n=[],o=[],r=[],i=[],s=90-parseInt(this.angle),l=s<1?s/8:1,c=2*Math.PI/127,h=0,d=this.angle;d<91;d+=l){var m=B.Math.toRadians(d<90?d:90);m=Math.cos(m)*a;for(var y=[],p=0;p<128;p++){var g=c*p,v=m*Math.cos(g),A=m*Math.sin(g),w=Math.sqrt(a*a-v*v-A*A);n.push(v,A,w),o.push(1,1),y.push(h++);}i.push(y);}for(var d=1;d<i.length;d++)for(var p=1;p<i[d].length;p++){var C=i[d-1][p-1],b=i[d][p-1],P=i[d][p];i[d-1][p],p%8==1&&r.push(C,b),d%8==1&&r.push(b,P);}n=new Float32Array(n),r=new Int32Array(r),o=new Float32Array(o);var _={position:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),st:new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:o})},S=B.BoundingSphere.fromVertices(n),I=new B.Geometry({attributes:_,indices:r,primitiveType:B.PrimitiveType.LINES,boundingSphere:S});return (0, B.Scene.computeVertexNormals)(I),I},u.prototype.updateGeometry=function(){this._geometry=B.Scene.CylinderGeometry.createGeometry(new B.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(B.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(B.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=B.Scene.CylinderGeometry.createOutlineGeometry(new B.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(B.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(B.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var a=0;a<this._positions.length;a++)this._positions[a]=this._geometry.attributes.position.values[a];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(n){n.vertexArray=n.vertexArray&&n.vertexArray.destroy();}),this._drawCommands.splice(0,this._drawCommands.length));},u.prototype.update=function(a){this._show&&(this.computeMatrix(a.time),a.mode===B.SceneMode.SCENE3D?(this._geometry.boundingSphere=B.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,a)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,a)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,a)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,a)))),this._drawCommands.forEach(function(n){a.commandList.push(n);}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&this._rotation.pitch===0&&this._rotation.roll===0,this.groundAreaEntity.polyline.show=false)):(this.groundAreaEntity||this.addGroundAreaEntity(true),this.groundAreaEntity.ellipse.show=this._rotation.pitch===0&&this._rotation.roll===0,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0)));},u.prototype.getFragmentShaderSource=function(a){return `#version 300 es
964
964
  in vec3 v_position;
965
965
  in vec3 v_normal;
966
966
  uniform float picked;
@@ -996,7 +996,7 @@ out_FragColor = shade(isOnEllipsoid);
996
996
  }else {
997
997
  out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ;
998
998
  }
999
- }`},h.prototype.getVertexShaderSource=function(o){return `#version 300 es
999
+ }`},u.prototype.getVertexShaderSource=function(a){return `#version 300 es
1000
1000
  #ifdef GL_ES
1001
1001
  precision highp float;
1002
1002
  #endif
@@ -1021,12 +1021,12 @@ out_FragColor = shade(isOnEllipsoid);
1021
1021
  v_position = pos.xyz;
1022
1022
  v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);
1023
1023
  gl_Position = projectionMatrix * pos;
1024
- }`},h.prototype.createDrawCommand=function(o,n,a){var r=n.context,i=new B.Cartesian3;B.Matrix4.multiplyByPoint(this._matrix,o.boundingSphere.center,i);var l=new B.BoundingSphere(i,o.boundingSphere.radius),s=new B.DrawCommand({modelMatrix:a||this._matrix,owner:this,primitiveType:o.primitiveType,pass:B.Pass.TRANSLUCENT,boundingVolume:l}),c=this,u=B.GeometryPipeline.createAttributeLocations(o);return s.vertexArray=B.VertexArray.fromGeometry({context:r,geometry:o,attributeLocations:u,bufferUsage:B.BufferUsage.STATIC_DRAW}),s.vertexArray._attributeLocations=u,s.shaderProgram=B.ShaderProgram.replaceCache({context:r,vertexShaderSource:this.getVertexShaderSource(o),fragmentShaderSource:this.getFragmentShaderSource(o),attributeLocations:u}),s.renderState=B.RenderState.fromCache({blending:B.BlendingState.ALPHA_BLEND,depthTest:{enabled:true,func:B.DepthFunction.LESS},cull:{enabled:false,face:B.CullFace.BACK}}),s.uniformMap={},s.uniformMap.projectionMatrix=function(){return n.context.uniformState.projection},s.uniformMap.modelViewMatrix=function(){return n.context.uniformState.modelView},s.uniformMap.shininess=function(){return c.shininess||(c.shininess=0),c.shininess},s.uniformMap.emission=function(){return c.emission||(c.emission=new B.Cartesian3(.2,.2,.2)),c.emission},s.uniformMap.specular=function(){return c.specular||(c.specular=0),c.specular},s.uniformMap.isLine=function(){return o.primitiveType==B.PrimitiveType.LINES||o.primitiveType==B.PrimitiveType.LINE_STRIP},s.uniformMap.defaultColor=function(){return o.primitiveType==B.PrimitiveType.LINES||o.primitiveType==B.PrimitiveType.LINE_STRIP?(c.defaultLineColor||(c.defaultLineColor=new B.Color(1,1,0,1)),c.defaultLineColor):(c.defaultColor||(c.defaultColor=new B.Color(1,0,0,1)),c.defaultColor)},s.uniformMap.picked=function(){return c.picked||(c.picked=0),c.picked},s.uniformMap.pickedColor=function(){return c.pickedColor||(c.pickedColor=new B.Color(1,1,0,1)),c.pickedColor},s.uniformMap.normalMatrix=function(){return n.context.uniformState.normal},s.uniformMap.glowPower=function(){return .25},s},h.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity);},h.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity);},h.prototype.destroy=function(o){o&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(n){n.vertexArray=n.vertexArray&&n.vertexArray.destroy();}),this._drawCommands=[]);},B.Scene.ConeSensorPrimitive=h;},_installCounputeVertex:function(){function e(a){var r=a.indices,i=a.attributes,l=r.length;if(i.position){var s=i.position.values;if(i.normal===void 0)i.normal=new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(s.length)});else for(var c=i.normal.values,u=0;u<l;u++)c[u]=0;for(var d,m,f,p=i.normal.values,g=new B.Cartesian3,v=new B.Cartesian3,A=new B.Cartesian3,w=new B.Cartesian3,C=new B.Cartesian3,u=0;u<l;u+=3)d=3*r[u+0],m=3*r[u+1],f=3*r[u+2],B.Cartesian3.fromArray(s,d,g),B.Cartesian3.fromArray(s,m,v),B.Cartesian3.fromArray(s,f,A),B.Cartesian3.subtract(A,v,w),B.Cartesian3.subtract(g,v,C),B.Cartesian3.cross(w,C,w),p[d]+=w.x,p[d+1]+=w.y,p[d+2]+=w.z,p[m]+=w.x,p[m+1]+=w.y,p[m+2]+=w.z,p[f]+=w.x,p[f+1]+=w.y,p[f+2]+=w.z;h(a),i.normal.needsUpdate=true;}return a}function h(a){for(var r,i,l,s,c=a.attributes.normal.values,u=0;u<c.length;u+=3)r=c[u],i=c[u+1],l=c[u+2],s=1/Math.sqrt(r*r+i*i+l*l),c[u]=r*s,c[u+1]=i*s,c[u+2]=l*s;}function y(a,r,i,l){l=l||B.Ellipsoid.WGS84,B.Matrix4.multiplyByPoint(r,a,o),B.Cartesian3.subtract(o,i.origin,i.direction),B.Cartesian3.normalize(i.direction,i.direction);var s=B.IntersectionTests.rayEllipsoid(i,l),c=null;if(s&&(c=B.Ray.getPoint(i,s.start)),c)try{B.Cartographic.fromCartesian(c,null,n);}catch{return null}return c}var o=new B.Cartesian3,n=(new B.Ray,new B.Cartographic);B.Scene.computeVertexNormals=e,B.Scene.extend2Earth=y;}};function cn(e,h){if(h){new Ft(e,h);let n=new on(h),a=new sn(h),r=new ln(h,n);h.Scene.RectangularSensorPrimitive=n,h.Scene.RectangularSensorGraphics=a,h.Scene.RectangularSensorVisualizer=r;var y=h.DataSourceDisplay,o=y.defaultVisualizersCallback;y.defaultVisualizersCallback=function(i,l,s){var c=s.entities,u=o(i,l,s);return u.concat([new r(i,c)])};}}function hr(){let e=null,h=function(y,o){y&&(this._viewer=y,e=o,this._customPluginLayer=new e.CustomDataSource("_customPluginLayer"),new cn(y,o),y&&y.dataSources.add(this._customPluginLayer));};return h.prototype={createRectangularSensorGraphics:function(y){if(this._customPluginLayer&&y){let o=new e.HeadingPitchRoll(e.Math.toRadians(y.heading||90),e.Math.toRadians(y.pitch||0),e.Math.toRadians(y.roll||0)),n=y.position;return this._customPluginLayer.entities.add({position:n,orientation:e.Transforms.headingPitchRollQuaternion(n,o),rectangularSensor:new e.Scene.RectangularSensorGraphics({radius:y.radius||1e5,xHalfAngle:e.Math.toRadians(y.xHalfAngle||45),yHalfAngle:e.Math.toRadians(y.yHalfAngle||45),material:y.material||new e.Color(1,0,1,.4),lineColor:y.lineColor||new e.Color(1,0,1,1),showScanPlane:this._objHasOwnProperty(y,"showScanPlane",true),showSectorLines:this._objHasOwnProperty(y,"showSectorLines",true),showLateralSurfaces:this._objHasOwnProperty(y,"showLateralSurfaces",true),modelMatrix:y.modelMatrix||new e.Matrix4,scanPlaneColor:y.scanPlaneColor||new e.Color(1,0,1,1),scanPlaneMode:y.scanPlaneMode||"vertical",scanPlaneRate:y.scanPlaneRate||3,showThroughEllipsoid:this._objHasOwnProperty(y,"showThroughEllipsoid",false),show:this._objHasOwnProperty(y,"show",true)})})}},_objHasOwnProperty(y,o,n){return y.hasOwnProperty(o)?y.field:n},createSatelliteCoverageSimulationGraphics:function(y){if(y)return new e.Scene.SatelliteCoverageSimulation(this._viewer,{position:y.position,angle1:y.angle1||30,angle2:y.angle2||45,areaType:y.areaType||2,rotation:{heading:e.Math.toRadians(y.heading||0),pitch:e.Math.toRadians(y.pitch||0),roll:e.Math.toRadians(y.roll||0)},color:y.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(y){if(y)return new e.Scene.ConeSensorPrimitive(this._viewer,{position:y.position,angle:y.angle||80,radius:y.radius||7e5,rotation:{heading:e.Math.toRadians(y.heading||0),pitch:e.Math.toRadians(y.pitch||40),roll:e.Math.toRadians(y.roll||0)},color:y.color||{red:1,green:0,blue:0,alpha:.4},lineColor:y.lineColor||{red:1,green:1,blue:1,alpha:.9}})}},h}var dt=re(hr);function dr(){let e=null,h={},y,o,n="move",a=null,r=function(i,l){i&&(this._viewer=i,a=i,e=l,se(this),this._installFileDragDropHandler());};return r.prototype={_installFileDragDropHandler(){function i(s,c){var u=document.createElement("div");u.id="fileDragDrop",u.classList.add("filedragdrop"),u.innerHTML="\u8BF7\u5C06Json\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF",this._dragBox=u,this._viewer=c,this._parentDiv=s,s.appendChild(u),this.fileDragDropCallBack=void 0,this.callBackParms=void 0;}i.prototype.startuploadfile=function(){var s=this,c=s._dragBox,u=null;document.ondragover=function(){clearTimeout(u),u=setTimeout(function(){c.innerHTML="\u8BF7\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF";},200);},c.ondragenter=function(){c.innerHTML="\u8BF7\u91CA\u653E\u9F20\u6807";},c.ondragover=function(){return false},c.ondragleave=function(){c.innerHTML="\u8BF7\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF";},c.ondrop=function(d){d.preventDefault();var m=d.dataTransfer.files[0],f=new FileReader;return f.readAsText(m,"UTF-8"),f.onload=function(){var p=JSON.parse(this.result);s.fileDragDropCallBack&&s.fileDragDropCallBack(s.callBackParms,p,s._viewer);},f.onloadstart=function(){},f.onloadend=function(){},f.onabort=function(){alert("\u8BFB\u53D6\u6570\u636E\u4E2D\u65AD");},f.onerror=function(){alert("\u8BFB\u53D6\u6570\u636E\u5931\u8D25");},false};};function l(s){var c=new i(document.querySelector(".cesium-viewer"),s);Object.defineProperties(s,{fileDragDropMixin:{get:function(){return c}}});}e.Scene.FileDragDropMixin=l;},async showLoadDataToScenePanel(i){let l=await De();if(i=i||{},i){let s=new l.GUI,c=this._viewer,u=s.addFolder("\u52A0\u8F7D\u6570\u636E\u6587\u4EF6"),d=f=>{let p=document.createElement("input");p.type="file",p.className="datgui_upload",p.onchange=function(){typeof f=="function"&&p.files.length&&f(URL.createObjectURL(p.files[0]));},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(p),p.click();},m={point:()=>{d(f=>{var p=e.GeoJsonDataSource.load(f);p.then(function(g){c.dataSources.add(g);for(var v=g.entities.values,A=0;A<v.length;A++){var w=v[A];w.nameID=A,w.point={color:e.Color.BLUE};}c.flyTo(g);});});},polyline:()=>{d(f=>{var p=e.GeoJsonDataSource.load(f);p.then(function(g){c.dataSources.add(g);for(var v=g.entities.values,A=0;A<v.length;A++){var w=v[A];w.nameID=A,w.polyline.width=5,w.polyline.material=new e.PolylineGlowMaterialProperty({glowPower:.1,color:e.Color.ORANGERED.withAlpha(.9)});}c.flyTo(g);});});},polygon:()=>{d(f=>{var p=e.GeoJsonDataSource.load(f);p.then(function(g){c.dataSources.add(g);for(var v=g.entities.values,A=0;A<v.length;A++){var w=v[A];w.nameID=A,w.polygon.width=10,w.polygon.material=e.Color.BLUE.withAlpha(.9);}c.flyTo(g);});});},model:()=>{d(f=>{c.flyTo(d3kit.createModelGraphics({position:e.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:f}));});},czml:()=>{d(f=>{c.flyTo(c.dataSources.add(e.CzmlDataSource.load(f)));});},"3dtilset":()=>{d(f=>{c.flyTo(c.scene.primitives.add(new e.Cesium3DTileset({url:f})));});}};u.add(m,"point"),u.add(m,"polyline"),u.add(m,"polygon"),u.add(m,"model"),u.add(m,"czml"),u.add(m,"3dtilset"),u.open();}},async showPostProcessStagesPanel(i){let l=await De();i=i||{};let s=function(){this.blackAndWhiteShow=false,this.blackAndWhiteGradations=5,this.brightnessShow=false,this.brightnessValue=.5,this.nightVisionShow=false,this.silhouette=false;},c=null,u=new s;if(i&&i.elementId){c=new l.GUI({autoPlace:false});var d=document.getElementById(i.elementId);d.appendChild(c.domElement);}else c=new l.GUI;let f=this._viewer.scene.postProcessStages,p=f.add(e.PostProcessStageLibrary.createSilhouetteStage()),g=f.add(e.PostProcessStageLibrary.createBlackAndWhiteStage()),v=f.add(e.PostProcessStageLibrary.createBrightnessStage()),A=f.add(e.PostProcessStageLibrary.createNightVisionStage());p.uniforms.color=i.silhouetteColor||e.Color.YELLOW,p.enabled=false,g.enabled=false,g.uniforms.gradations=5,v.enabled=false,v.uniforms.brightness=.5,A.enabled=false,c.add(u,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(w){g.enabled=w;}),c.add(u,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(w){g.uniforms.gradations=w;}),c.add(u,"brightnessShow").name("brightnessShow").onChange(function(w){v.enabled=w;}),c.add(u,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(w){v.uniforms.brightness=w;}),c.add(u,"nightVisionShow").name("nightVisionShow").onChange(function(w){A.enabled=w;}),c.add(u,"silhouette").name("silhouette").onChange(function(w){p.enabled=w;});},async showSceneBloomPanel(i){let l=await De(),s=function(){this.contrast=128,this.brightness=-0.3,this.delta=1,this.gamma=3.5,this.enabled=false,this.highDynamicRange=false,this.shadows=false,this.glowOnly=false,this.sigma=1,this.stepSize=5;},c=null,u=new s;if(i&&i.elementId){c=new l.GUI({autoPlace:false});var d=document.getElementById(i.elementId);d.appendChild(c.domElement);}else c=new l.GUI;let m=this._viewer;c.__closeButton.innerHTML="\u6536\u7F29\u9762\u677F";let f=m.scene.postProcessStages.bloom;c.add(u,"enabled").name("bloom").onChange(function(p){f.enabled=p;}),c.add(u,"glowOnly").name("\u53D1\u5149").onChange(function(p){f.uniforms.glowOnly=p;}),c.add(u,"enabled").name("\u542F\u7528\u6A21\u7CCA").onChange(function(p){f.enabled=p;}),c.add(u,"contrast",-255,255,.01).name("\u5BF9\u6BD4\u5EA6").onChange(function(p){f.uniforms.contrast=p;}),c.add(u,"brightness",-1,1,.01).name("\u5149\u6CFD\u4EAE\u5EA6").onChange(function(p){f.uniforms.brightness=p;}),c.add(u,"delta",1,5,.01).name("\u56E0\u5B50").onChange(function(p){f.uniforms.delta=p;}),c.add(u,"sigma",1,10,.01).name("sigma").onChange(function(p){f.uniforms.sigma=p;}),c.add(u,"stepSize",.1,10).name("stepSize").onChange(function(p){f.uniforms.stepSize=p;}),c.add(u,"shadows").name("\u542F\u7528\u9634\u5F71").onChange(function(p){m.shadows=p;}),c.add(u,"highDynamicRange").name("\u9AD8\u52A8\u6001\u8303\u56F4").onChange(function(p){m.scene.highDynamicRange=p;}),c.add(u,"gamma",1,10,.01).name("\u4F3D\u9A6C\u4EAE\u5EA6").onChange(function(p){m.scene.gamma=p;});},async showPrimitiveMatrixPanel(i){let l=await De(),s=i.primitives._delegate||i.primitives,c=i.primitives;this._viewer;let m=null;if(i&&i.elementId){m=new l.GUI({autoPlace:false});var f=document.getElementById(i.elementId);f.appendChild(m.domElement);}else m=new l.GUI;let g={height:100},v=m.addFolder("\u79BB\u5730\u9AD8\u5EA6");v.add(g,"height",0,1e3,1).onChange(function(S){var M=c.boundingSphere,E=e.Cartographic.fromCartesian(M.center),I=e.Cartesian3.fromRadians(E.longitude,E.latitude,0),D=e.Cartesian3.fromRadians(E.longitude,E.latitude,S),V=e.Cartesian3.subtract(D,I,new e.Cartesian3);c.modelMatrix=e.Matrix4.fromTranslation(V);}),v.open();let A=m.addFolder("\u7F29\u653E\u5927\u5C0F"),w={"m+Scale":()=>{s.readyPromise.then(S=>{let M=S.root.transform;e.Matrix4.multiplyByUniformScale(M,1.2,M),S.root.transform=M;});},"m-Scale":()=>{s.readyPromise.then(S=>{let M=S.root.transform;e.Matrix4.multiplyByUniformScale(M,.8,M),S.root.transform=M;});}};A.add(w,"m+Scale"),A.add(w,"m-Scale"),A.open();let _={"x+Axis":()=>{let S=e.Matrix4.fromTranslation(new e.Cartesian3(20,0,0));e.Matrix4.multiply(s.modelMatrix,S,s.modelMatrix);},"x-Axis":()=>{let S=e.Matrix4.fromTranslation(new e.Cartesian3(-20,0,0));e.Matrix4.multiply(s.modelMatrix,S,s.modelMatrix);},"y+Axis":()=>{let S=e.Matrix4.fromTranslation(new e.Cartesian3(0,20,0));e.Matrix4.multiply(s.modelMatrix,S,s.modelMatrix);},"y-Axis":()=>{let S=e.Matrix4.fromTranslation(new e.Cartesian3(0,-20,0));e.Matrix4.multiply(s.modelMatrix,S,s.modelMatrix);},"z+Axis":()=>{let S=e.Matrix4.fromTranslation(new e.Cartesian3(0,0,20));e.Matrix4.multiply(s.modelMatrix,S,s.modelMatrix);},"z-Axis":()=>{let S=e.Matrix4.fromTranslation(new e.Cartesian3(0,0,-20));e.Matrix4.multiply(s.modelMatrix,S,s.modelMatrix);}},P=m.addFolder("\u77E9\u9635\u5E73\u79FB");P.add(_,"x+Axis"),P.add(_,"x-Axis"),P.add(_,"y+Axis"),P.add(_,"y-Axis"),P.add(_,"z+Axis"),P.add(_,"z-Axis"),P.open();let b={x:0,y:0,z:0},x={"x+Axis":()=>{b.x+=15,s.readyPromise.then(S=>{let M=e.Matrix3.fromRotationX(e.Math.toRadians(b.x)),E=e.Matrix4.fromRotationTranslation(M),I=e.Transforms.eastNorthUpToFixedFrame(S.boundingSphere.center);e.Matrix4.multiply(I,E,I),S._root.transform=I;});},"x-Axis":()=>{b.x-=15,s.readyPromise.then(S=>{let M=e.Matrix3.fromRotationX(e.Math.toRadians(b.x)),E=e.Matrix4.fromRotationTranslation(M),I=e.Transforms.eastNorthUpToFixedFrame(S.boundingSphere.center);e.Matrix4.multiply(I,E,I),S._root.transform=I;});},"y+Axis":()=>{b.y+=15,s.readyPromise.then(S=>{let M=e.Matrix3.fromRotationY(e.Math.toRadians(b.y)),E=e.Matrix4.fromRotationTranslation(M),I=e.Transforms.eastNorthUpToFixedFrame(S.boundingSphere.center);e.Matrix4.multiply(I,E,I),S._root.transform=I;});},"y-Axis":()=>{b.y-=15,s.readyPromise.then(S=>{let M=e.Matrix3.fromRotationY(e.Math.toRadians(b.y)),E=e.Matrix4.fromRotationTranslation(M),I=e.Transforms.eastNorthUpToFixedFrame(S.boundingSphere.center);e.Matrix4.multiply(I,E,I),S._root.transform=I;});},"z+Axis":()=>{b.z+=15,s.readyPromise.then(S=>{let M=e.Matrix3.fromRotationZ(e.Math.toRadians(b.z)),E=e.Matrix4.fromRotationTranslation(M),I=e.Transforms.eastNorthUpToFixedFrame(S.boundingSphere.center);e.Matrix4.multiply(I,E,I),S._root.transform=I;});},"z-Axis":()=>{b.z-=15,s.readyPromise.then(S=>{let M=e.Matrix3.fromRotationZ(e.Math.toRadians(b.z)),E=e.Matrix4.fromRotationTranslation(M),I=e.Transforms.eastNorthUpToFixedFrame(S.boundingSphere.center);e.Matrix4.multiply(I,E,I),S._root.transform=I;});}},T=m.addFolder("\u65CB\u8F6C\u77E9\u9635");if(T.add(x,"x+Axis"),T.add(x,"x-Axis"),T.add(x,"y+Axis"),T.add(x,"y-Axis"),T.add(x,"z+Axis"),T.add(x,"z-Axis"),T.open(),i.cb){let S=m.addFolder("\u83B7\u53D6\u8C03\u6574\u540E\u7684\u6A21\u578B\u77E9\u9635");S.add({getModelMaterix:()=>{s.readyPromise.then(M=>{let E=M.root.transform;i.cb({modelTransformMatrix:e.Matrix4.toArray(E),modelMatrix:e.Matrix4.toArray(c.modelMatrix)});});}},"getModelMaterix").name("\u83B7\u53D6\u6A21\u578B\u77E9\u9635"),S.open();}m.__closeButton.innerHTML="\u6536\u7F29\u9762\u677F";},showLayerParamPanel:async function(i,l){let s=await De();if(i){let m=null;if(l&&l.elementId){m=new s.GUI({autoPlace:false});var c=document.getElementById(l.elementId);c.appendChild(m.domElement);}else m=new s.GUI;var u=new(function(){this.alpha=i.alpha,this.brightness=i.brightness,this.contrast=i.contrast,this.gamma=i.gamma,this.hue=i.hue,this.dayAlpha=i.dayAlpha,this.nightAlpha=i.nightAlpha,this.saturation=i.saturation;}),d=m.addFolder("\u56FE\u5C42\u8C03\u6574");d.add(u,"alpha",0,1,.05).name("\u900F\u660E\u5EA6").onChange(function(f){i.alpha=f;}),d.add(u,"brightness",0,5,.05).name("\u4EAE\u5EA6").onChange(function(f){i.brightness=f;}),d.add(u,"contrast",0,5,.05).name("\u5BF9\u6BD4").onChange(function(f){i.contrast=f;}),d.add(u,"gamma",0,5,.05).name("\u4F3D\u9A6C").onChange(function(f){i.gamma=f;}),d.add(u,"hue",0,5,.05).name("\u8272\u8C03").onChange(function(f){i.hue=f;}),d.add(u,"dayAlpha",0,1,.05).name("\u767D\u5929\u900F\u660E").onChange(function(f){i.dayAlpha=f;}),d.add(u,"nightAlpha",0,1,.05).name("\u591C\u665A\u900F\u660E").onChange(function(f){i.nightAlpha=f;}),d.add(u,"saturation",0,5,.05).name("\u9971\u548C").onChange(function(f){i.saturation=f;}),d.open();}},showLayerSwitchPanel:async function(i,l,s){let c=await De();if(i&&i.length){let g=null;if(l&&l.elementId){g=new c.GUI({autoPlace:false});var u=document.getElementById(l.elementId);u.appendChild(g.domElement);}else g=new c.GUI;var d=new(function(){i.forEach(v=>{this[v.id]=v.show;});}),m=g.addFolder("\u56FE\u5C42\u5207\u6362");i.forEach(v=>{m.add(d,v.id).name(v.name).onChange(function(A){v.show=A,s&&s({key:v.id,val:A});});});var f=new(function(){i.forEach(v=>{this[v.id]=v.alpha;});}),p=g.addFolder("\u900F\u660E\u5EA6");i.forEach(v=>{p.add(f,v.id,0,1,.05).name(v.name).onChange(function(A){v.alpha=A;});}),m.open(),p.open();}},showSceneEffectEditPanel:async function(i){let l=await De();if(i=i||{},l.GUI&&this._viewer.scene.colorCorrection){var s=new l.GUI,c=this._viewer;c.scene.lightSource.ambientLightColor=i.ambientLightColor||new e.Color(.3,.3,.3,1),c.scene.colorCorrection.show=i.colorCorrection||false,c.scene.colorCorrection.saturation=i.saturation||3.1,c.scene.colorCorrection.brightness=i.brightness||1.8,c.scene.colorCorrection.contrast=i.contrast||1.2,c.scene.colorCorrection.hue=i.hue||0,c.scene.bloomEffect.show=i.bloomEffect||false,c.scene.hdrEnabled=i.hdrEnabled||true,c.scene.bloomEffect.threshold=i.threshold||1,c.scene.bloomEffect.bloomIntensity=i.bloomIntensity||2;var u=new(function(){this.bloomEffectShow=i.bloomEffect||false,this.bloomThreshold=i.threshold||1,this.bloomIntensity=i.bloomIntensity||2,this.ambientLightColor=i.ambientLightColor||.3,this.hdrEnabled=i.hdrEnabled||true,this.colorCorrectionShow=false,this.colorCorrectionSaturation=i.saturation||3.1,this.colorCorrectionBrightness=i.brightness||1.8,this.colorCorrectionContrast=i.contrast||1.2,this.colorCorrectionHue=i.hue||0;}),d=s.addFolder("\u573A\u666F\u6548\u679C");d.add(u,"bloomEffectShow").name("\u6CDB\u5149\u5F00\u5173").onChange(function(m){c.scene.bloomEffect.show=m,c.scene.bloomEffect.threshold=u.bloomThreshold,c.scene.bloomEffect.bloomIntensity=u.bloomIntensity;}),d.add(u,"bloomThreshold",0,1,.1).name("\u6CDB\u5149\u9608\u503C").onChange(function(m){c.scene.bloomEffect.threshold=m;}),d.add(u,"bloomIntensity",0,10,.1).name("\u6CDB\u5149\u5F3A\u5EA6").onChange(function(m){c.scene.bloomEffect.bloomIntensity=m;}),d.add(u,"hdrEnabled").name("HDR\u5F00\u5173").onChange(function(m){c.scene.hdrEnabled=m;}),d.add(u,"colorCorrectionShow").name("\u989C\u8272\u6821\u6B63").onChange(function(m){c.scene.colorCorrection.show=m;}),d.add(u,"colorCorrectionSaturation",0,5,.1).name("\u9971\u548C\u5EA6").onChange(function(m){c.scene.colorCorrection.saturation=m;}),d.add(u,"colorCorrectionBrightness",0,5,.1).name("\u4EAE\u5EA6").onChange(function(m){c.scene.colorCorrection.brightness=m;}),d.add(u,"colorCorrectionContrast",0,5,.1).name("\u5BF9\u6BD4\u5EA6").onChange(function(m){c.scene.colorCorrection.contrast=m;}),d.add(u,"colorCorrectionHue",0,5,.1).name("\u8272\u8C03").onChange(function(m){c.scene.hdrEnabled=m;}),d.add(u,"colorCorrectionHue",0,1,.1).name("\u73AF\u5883\u5149").onChange(function(m){c.scene.lightSource.ambientLightColor=new e.Color(m,m,m,1);}),d.open();}},showEntityOrientationEditPanel:async function(i={}){let l=await De();if(i.entity){let f=i.entity;var s=new l.GUI;if(i&&i.elementId){s=new l.GUI({autoPlace:false});var c=document.getElementById(i.elementId);c.appendChild(s.domElement);}else s=new l.GUI;var u=new(function(){this.heading=360,this.pitch=1,this.roll=1;}),d=s.addFolder("\u5B9E\u4F53\u59FF\u6001\u8C03\u6574"),m=this;d.add(u,"heading",0,360,1).name("\u89D2\u5EA6").onChange(function(p){u.heading=p;let g=e.Transforms.headingPitchRollQuaternion(f.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(u.heading),e.Math.toRadians(u.pitch),e.Math.toRadians(u.roll)));f.orientation=g,i.cb&&i.cb({orientation:g});}),d.add(u,"pitch",0,360,1).name("\u822A\u5411").onChange(function(p){u.pitch=p;let g=e.Transforms.headingPitchRollQuaternion(f.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(u.heading),e.Math.toRadians(u.pitch),e.Math.toRadians(u.roll)));f.orientation=g,i.cb&&i.cb({orientation:g});}),d.add(u,"roll",0,360,1).name("\u7FFB\u8F6C").onChange(function(p){u.roll=p;let g=e.Transforms.headingPitchRollQuaternion(f.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(u.heading),e.Math.toRadians(u.pitch),e.Math.toRadians(u.roll)));f.orientation=g,i.cb&&i.cb({orientation:g});}),d.open();}},definedMouseEvent({targetEntity:i,ctrlFlag:l}){o=i,h=l,this.bindHandleEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp});},defMouseMove(i){if(h.leftDown&&y){let l=a.camera.getPickRay(i.endPosition),s=a.scene.globe.pick(l,a.scene);if(document.body.style.cursor="pointer",y&&y.id&&n==="move"){let c=e.JulianDate.fromDate(new Date),u=o.position.getValue(c),d=e.Cartographic.fromCartesian(u),m=Number(d.height.toFixed(3));o.position=new e.CallbackProperty(()=>{let f=a.scene.globe.ellipsoid.cartesianToCartographic(s),p=e.Math.toDegrees(f.longitude),g=e.Math.toDegrees(f.latitude);return e.Cartesian3.fromDegrees(p,g,m)},false);}else if(y&&y.id&&n==="rotate"){let c=e.JulianDate.fromDate(new Date),u=o.position.getValue(c),d=a.scene.camera.pickEllipsoid(i.startPosition),m=a.scene.camera.pickEllipsoid(i.endPosition),f=e.Cartesian3.subtract(u,m,new e.Cartesian3),p=e.Cartesian3.normalize(f,new e.Cartesian3),g=e.Cartesian3.subtract(d,u,new e.Cartesian3),v=e.Cartesian3.subtract(m,u,new e.Cartesian3),A=e.Cartesian3.angleBetween(g,v),C=e.Quaternion.fromAxisAngle(p,A*100);o.orientation=C;}}},defLeftDown(i){y=a.scene.pick(i.position),e.defined(y)&&n?(h.selected=true,h.leftDown=true):h.selected=false;},defMouseWheel(i){if(y&&y.id&&n==="scale"){let l=e.JulianDate.fromDate(new Date),s=o.box.dimensions.getValue(l),c=i>0?2:.5;o.box.dimensions=new e.CallbackProperty(()=>e.Cartesian3.multiplyByScalar(s,c,new e.Cartesian3),false);}},defLeftUp(i){h.leftDown=false,document.body.style.cursor="default";},manualMoveModel:function(i){n=i,this._viewer.scene.screenSpaceCameraController.enableRotate=false,this._viewer.scene.screenSpaceCameraController.enableZoom=true;},manualRotateModel:function(i){n=i,this._viewer.scene.screenSpaceCameraController.enableRotate=false,this._viewer.scene.screenSpaceCameraController.enableZoom=true;},manualScaleModel:function(i){n=i,this._viewer.scene.screenSpaceCameraController.enableZoom=false;}},r}var mt=re(dr);function mr(e,h){var r,i,l,s,c;if(!h||typeof h!="object")return;let y=h;if(typeof y.x=="number"&&typeof y.y=="number"&&typeof y.z=="number"&&Number.isFinite(y.x)&&Number.isFinite(y.y)&&Number.isFinite(y.z))return e.Cartesian3.clone(y);let o,n,a;if(Array.isArray(h)?(o=Number(h[0]),n=Number(h[1]),a=h.length>2?Number(h[2]):0):(o=Number((i=(r=y.lng)!=null?r:y.lon)!=null?i:y.longitude),n=Number((l=y.lat)!=null?l:y.latitude),a=Number((c=(s=y.alt)!=null?s:y.height)!=null?c:0)),!(!Number.isFinite(o)||!Number.isFinite(n)||!Number.isFinite(a)))return e.Cartesian3.fromDegrees(o,n,a)}function Vt(e){var y,o,n,a,r;let h=[];if(!Array.isArray(e))return h;for(let i of e){if(!i||typeof i!="object")continue;let l=i;if(typeof l.x=="number"&&typeof l.z=="number")continue;let s=Number((o=(y=l.lng)!=null?y:l.lon)!=null?o:l.longitude),c=Number((n=l.lat)!=null?n:l.latitude),u=Number((r=(a=l.alt)!=null?a:l.height)!=null?r:0);!Number.isFinite(s)||!Number.isFinite(c)||!Number.isFinite(u)||h.push(s,c,u);}return h}function un(e,h,y=.001){let o=[];if(!Array.isArray(h))return o;for(let n=0;n<h.length;n++){let a=mr(e,h[n]);if(!a)continue;let r=o[o.length-1];r&&e.Cartesian3.distance(r,a)<y||o.push(a);}return o}function hn(e,h,y){let o=e.Cartesian3.subtract(y,h,{x:0,y:0,z:0});if(!Number.isFinite(o.x)||!Number.isFinite(o.y)||!Number.isFinite(o.z)||e.Cartesian3.magnitudeSquared(o)<1e-6)return null;let n=e.Cartesian3.normalize(o,{x:0,y:0,z:0}),a=e.Transforms.rotationMatrixFromPositionVelocity(h,n,e.Ellipsoid.WGS84);return e.Quaternion.fromRotationMatrix(a)}function dn(e,h,y,o=()=>new e.JulianDate,n=1/60){let a=h.getValue(y);if(!a)return null;let r=e.JulianDate.addSeconds(y,n,o()),i=h.getValue(r);if(i){let c=hn(e,a,i);if(c)return c}let l=e.JulianDate.addSeconds(y,-n,o()),s=h.getValue(l);return s?hn(e,s,a):null}var ge=3.141592653589793,bt=6378245,Pt=.006693421622965943;function fr(){let e=null,y=function(o,n,a){if(o){this._viewer=o,e=n,this._queryRouteKey="8dc49b1fa65a79d306ef12dae4229842",this._pluginLayer=new e.CustomDataSource("pluginLayer"),o&&o.dataSources.add(this._pluginLayer);let r=this._pluginLayer;se(this),ae(this,()=>{Ce(this.droneEntity),this._viewer&&r&&(this._viewer.dataSources.remove(r,true),this._pluginLayer===r&&(this._pluginLayer=void 0));}),this._installPlugin();}};return y.routeQueryType={DRIVE:"drive",WALK:"walk",CYCLE:"cycle"},y.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan(),this._installClusterLayer(),this._installBar3DLayer();},_installTerrainClipPlan:function(){let o=e.defaultValue||Re;function n(a,r){this.viewer=a,this.options=r||{},this._positions=r.positions,this._height=this.options.height||0,this.bottomImg=r.bottomImg,this.wallImg=r.wallImg,this.splitNum=o(r.splitNum,50),this._positions&&this._positions.length>0&&this.updateData(this._positions);}Object.defineProperties(n.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);}}}),n.prototype.updateData=function(a){var r=[],i=a.length-1,l=new e.Cartesian3,s=e.Cartesian3.subtract(a[0],a[1],l);s=s.x>0,this.excavateMinHeight=9999;for(var c=0;c<i;c++){var u=(c+1)%i,d=e.Cartesian3.midpoint(a[c],a[u],new e.Cartesian3),m=e.Cartographic.fromCartesian(a[c]),f=this.viewer.scene.globe.getHeight(m)||m.height;f<this.excavateMinHeight&&(this.excavateMinHeight=f);var p,g=e.Cartesian3.normalize(d,new e.Cartesian3);p=s?e.Cartesian3.subtract(a[c],d,new e.Cartesian3):e.Cartesian3.subtract(a[u],d,new e.Cartesian3),p=e.Cartesian3.normalize(p,p);var v=e.Cartesian3.cross(p,g,new e.Cartesian3);v=e.Cartesian3.normalize(v,v);var A=new e.Plane(v,0),w=e.Plane.getPointDistance(A,d);r.push(new e.ClippingPlane(v,w));}this.viewer.scene.globe.clippingPlanes=new e.ClippingPlaneCollection({planes:r,edgeWidth:1,edgeColor:e.Color.WHITE,enabled:true}),this._prepareWell(a),this._createWell(this.wellData);},n.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=false,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();},n.prototype._prepareWell=function(a){var r=this.splitNum,i=a.length;if(i!=0){for(var l=this.excavateMinHeight-this.height,s=[],c=[],u=[],d=0;d<i;d++){var m=d==i-1?0:d+1,f=e.Cartographic.fromCartesian(a[d]),p=e.Cartographic.fromCartesian(a[m]),g=[f.longitude,f.latitude],v=[p.longitude,p.latitude];d==0&&(u.push(new e.Cartographic(g[0],g[1])),c.push(e.Cartesian3.fromRadians(g[0],g[1],l)),s.push(e.Cartesian3.fromRadians(g[0],g[1],0)));for(var A=1;A<=r;A++){var w=e.Math.lerp(g[0],v[0],A/r),C=e.Math.lerp(g[1],v[1],A/r);d==i-1&&A==r||(u.push(new e.Cartographic(w,C)),c.push(e.Cartesian3.fromRadians(w,C,l)),s.push(e.Cartesian3.fromRadians(w,C,0)));}}this.wellData={lerp_pos:u,bottom_pos:c,no_height_top:s};}},n.prototype._createWell=function(a){if(this.viewer.terrainProvider._layers){var r=this;this._createBottomSurface(a.bottom_pos),e.sampleTerrainMostDetailed(this.viewer.terrainProvider,a.lerp_pos).then(function(i){for(var l=i.length,s=[],c=0;c<l;c++){var u=e.Cartesian3.fromRadians(i[c].longitude,i[c].latitude,i[c].height);s.push(u);}r._createWellWall(a.bottom_pos,s);});}else this._createBottomSurface(a.bottom_pos),this._createWellWall(a.bottom_pos,a.no_height_top);},n.prototype._getMinHeight=function(a){let r=5e6,i=null;for(let l=0;l<a.length;l++){let s=a[l].z;s<r&&(r=s,i=this._ellipsoidToLonLat(a[l]));}return i.altitude},n.prototype._ellipsoidToLonLat=function(a){let r=this.viewer.scene.globe.ellipsoid,i=new e.Cartesian3(a.x,a.y,a.z),l=r.cartesianToCartographic(i),s=e.Math.toDegrees(l.latitude),c=e.Math.toDegrees(l.longitude),u=l.height;return {longitude:c,latitude:s,altitude:u}},n.prototype._createBottomSurface=function(a){if(a.length){let l=this._getMinHeight(a),s=[];for(let d=0;d<a.length;d++){let m=this._ellipsoidToLonLat(a[d]);s.push(m.longitude),s.push(m.latitude),s.push(l);}let c=new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:true}),u=e.PolygonGeometry.createGeometry(c);var r=new e.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),i=new e.MaterialAppearance({translucent:false,flat:true,material:r});this.bottomSurface=new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:u}),appearance:i,asynchronous:false}),this.viewer.scene.primitives.add(this.bottomSurface);}},n.prototype._createWellWall=function(a,r){let i=this._getMinHeight(a),l=[],s=[];for(let f=0;f<r.length;f++)l.push(this._ellipsoidToLonLat(r[f]).altitude),s.push(i);let c=new e.WallGeometry({positions:r,maximumHeights:l,minimumHeights:s}),u=e.WallGeometry.createGeometry(c);var d=new e.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),m=new e.MaterialAppearance({translucent:false,flat:true,material:d});this.wellWall=new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:u,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(e.Color.GREY)},id:"PitWall"}),appearance:m,asynchronous:false}),this.viewer.scene.primitives.add(this.wellWall);},n.prototype._switchExcavate=function(a){a?(this.viewer.scene.globe.material=e.Material.fromType("WaJue"),this.wellWall.show=true,this.bottomSurface.show=true):(this.viewer.scene.globe.material=null,this.wellWall.show=false,this.bottomSurface.show=false);},n.prototype._updateExcavateDepth=function(a){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var r=this.wellData.lerp_pos,i=[],l=r.length,s=0;s<l;s++)i.push(e.Cartesian3.fromRadians(r[s].longitude,r[s].latitude,this.excavateMinHeight-a));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall);},e.Scene.TerrainClipPlan=n;},buildLightScanGraphics:function(o){if(this._viewer&&o){for(var n=this,a=function(u,d){for(var m=d.observer[0],f=d.observer[1],p=d.observer[2],g=[],v=0;v<u.length;v++){var A;v===u.length-1?A=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([m,f,p,u[v].x,u[v].y,0,u[0].x,u[0].y,0])):A=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([m,f,p,u[v].x,u[v].y,0,u[v+1].x,u[v+1].y,0]));var w=n._pluginLayer.entities.add({name:"\u4E09\u89D2\u5F62",polygon:{hierarchy:A,outline:false,perPositionHeight:true,material:d.material}});g.push(w);}return g},r=function(u,d,m){var f=u.positionList,p,g,v,A,w,C,_=0,P=0;function b(x){p=f[x+1][0]-f[x][0],g=f[x+1][1]-f[x][1],v=p/u.number,A=g/u.number,P=0;}b(_),d.polygon.hierarchy=new e.CallbackProperty(function(){return Math.abs(w)>=Math.abs(p)&&Math.abs(C)>=Math.abs(g)&&(_=_+1,_===f.length-1&&(_=0),m[0]=m[0]+w,m[1]=m[1]+C,m[2]=m[2]+w,m[3]=m[3]+C,b(_)),w=P*v,C=P*A,P++,new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([u.observer[0],u.observer[1],u.observer[2],m[0]+w,m[1]+C,0,m[2]+w,m[3]+C,0]))},false);},i=function(u,d,m,f){let p=[],g=Math.PI/180*Math.round(360/f),v=0;for(;v<f;v++){let A=d+u*Math.sin(g*v),w=m+u*Math.cos(g*v);p.unshift({x:A,y:w});}return p},l=i(o.circle[0],o.circle[1],o.circle[2],o.circle[3]),s=a(l,o),c=0;c<s.length;c++)c!==s.length-1?r(o,s[c],[l[c].x,l[c].y,l[c+1].x,l[c+1].y]):r(o,s[c],[l[c].x,l[c].y,l[0].x,l[0].y]);return s}},buildPathRoaming:function(o){if(this._viewer&&o&&o.paths){var n=this.createGraphics(),a=un(e,o.paths);if(a.length<2){pe(new oe("INVALID_ARGUMENT","buildPathRoaming \u81F3\u5C11\u9700\u8981 2 \u4E2A\u6709\u6548\u4E14\u4E92\u4E0D\u91CD\u5408\u7684\u8DEF\u5F84\u70B9\u3002",{details:{received:o.paths.length,valid:a.length}}),{scope:"plugin.buildPathRoaming"});return}if(n.position=this._createSampledPosition(a),n.name=o.name||"\u8DEF\u5F84\u6F2B\u6E38",n.availability=new e.TimeIntervalCollection([new e.TimeInterval({start:this.startTime,stop:this.stopTime})]),n.orientation=this._sampleOrientation(),o.polyline){let{width:r,material:i,clampToGround:l,...s}=o.polyline;n.polyline={positions:new e.CallbackProperty(function(){return a},false),width:r||10,material:i||new e.PolylineGlowMaterialProperty({glowPower:1,color:e.Color.RED}),clampToGround:l!==false,...s};}return o.model&&(n.model=this.getModelGraphics(o.model)),o.label&&(n.label=this.getLabelGraphics(o)),o.billboard&&(n.billboard=this.getBillboardGraphics(o)),this.droneEntity=n,this._beginRoamTrace(o),this._viewer.entities.add(n)}},_beginRoamTrace(o){let n=this._roamTick;n&&(this._viewer.clock.onTick.removeEventListener(n),this._roamTick=null);let a=()=>{if(this._viewer.clock.shouldAnimate){let r=this._viewer.clock.currentTime,i=this.droneEntity.position&&this.droneEntity.position.getValue(r),l=this.droneEntity.orientation&&this.droneEntity.orientation.getValue(r);if(i&&l){let s=e.Matrix4.fromRotationTranslation(e.Matrix3.fromQuaternion(l),i),c=typeof(o==null?void 0:o.cameraOffset)=="function"?o.cameraOffset():new e.HeadingPitchRange(0,e.Math.toRadians(-20),150);this._viewer.camera.lookAtTransform(s,c);}}};this._viewer.clock.onTick.addEventListener(a),this._roamTick=a,ae(this,()=>{this._viewer.clock.onTick.removeEventListener(a),this._roamTick===a&&(this._roamTick=null);});},_createSampledPosition(o){this.startTime=e.JulianDate.now(),this.stopTime=e.JulianDate.addSeconds(this.startTime,Math.max(o.length-1,1)*60,new e.JulianDate),this._viewer.clock.startTime=this.startTime.clone(),this._viewer.clock.stopTime=this.stopTime.clone(),this._viewer.clock.currentTime=this.startTime.clone(),this._viewer.clock.clockRange=e.ClockRange.CLAMPED;let n=new e.SampledPositionProperty;n.forwardExtrapolationType=e.ExtrapolationType.HOLD,n.backwardExtrapolationType=e.ExtrapolationType.HOLD;for(let a=0;a<o.length;a++){let r=e.JulianDate.addSeconds(this.startTime,a*60,new e.JulianDate),i=o[a];n.addSample(r,i);}return n},_sampleOrientation(){let o;return new e.CallbackProperty(n=>{let a=this.droneEntity&&this.droneEntity.position;if(!a)return o;let r=dn(e,a,n);return r&&(o=r),o},false)},_installCss3Renderer:function(){if(this._viewer){let a=function(r,i){this._scratch=new e.Cartesian2,this._viewer=o,this._scene=o.scene,this._camera=o.camera,this._container=null,this._elements=r,this._isBackHide=i,this._postBuildFun=null,this._parentEleId=r.length>0&&r[0].parentEleId||"info-warp",se(this),ae(this,()=>{this._postBuildFun&&(this._scene.postRender.removeEventListener(this._postBuildFun),this._postBuildFun=null),this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=null;}),this.init();};var o=this._viewer;a.prototype.init=function(){var r=document.createElement("div");r.className="ys-css3-container";let i=this._parentEleId,l=document.getElementById(i);l.appendChild(r),this._container=r,this._elements=this._elements.filter(m=>m.position),this._elements.forEach(function(m){r.insertAdjacentHTML("beforeend",m.element);});function s(m,f=document){return f.querySelectorAll(`.${m}`)}var c=this;c._scene.canvas.clientHeight;let d=new e.Cartesian2;this._postBuildFun=function(){var m=s("close__box__btn");m.forEach(function(v){v.style.position="absolute",v.style.top="5px",v.style.right="5px",v.style.cursor="pointer",v.style.color="#fff",v.addEventListener("click",function(){l.contains(r)&&(l.removeChild(r),c._postBuildFun&&c._scene.postRender.removeEventListener(c._postBuildFun));});});for(var f=0;f<r.children.length;f++){let v="",A=c._elements[f],w=A.position;w instanceof e.Cartesian3?v=w:v=e.Cartesian3.fromDegrees(w[0],w[1],w[2]||0),e.SceneTransforms.worldToWindowCoordinates(c._scene,v,d);let C=A.offset?A.offset[0]:0,_=A.offset?A.offset[1]:0;if(e.defined(d)){let P=r.children[f];if(P.style.position="absolute",P.style.zIndex=99,P.style.left=d.x+C+"px",P.style.top=d.y-P.offsetHeight+_+"px",c._isBackHide){var p=c._camera.position,g=c._scene.globe.ellipsoid.cartesianToCartographic(p).height;g+=1*c._scene.globe.ellipsoid.maximumRadius,e.Cartesian3.distance(p,v)>g?r.children[f].style.display="none":r.children[f].style.display="block";}}}},this._scene.postRender.addEventListener(this._postBuildFun);},a.prototype.remove=function(r){this._elements=this._elements.filter(function(i){i.id;}),this._container.removeChild(document.getElementById(r)),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},a.prototype.removeChild=function(){let r=document.getElementById(this._parentEleId);r.contains(this._container)&&r.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},a.prototype.close=function(){let r=document.getElementById(this._parentEleId);r.contains(this._container)&&r.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},a.prototype.append=function(r){this._elements.push(r),this._container.insertAdjacentHTML("beforeend",r.element);},a.prototype.removeEntityLayer=function(r){this._viewer.entities.removeById(r+"_1"),this._viewer.entities.removeById(r+"_2"),this._viewer.entities.removeById(r+"_3"),this.remove(r);},a.prototype.addEntityLayer=function(r){var i=r.position[0],l=r.position[1],c=this,u=.001,d=u,m=u,f=u;setTimeout(function(_){},300);var p=e.Math.toRadians(30),g=e.Math.toRadians(30),v=r.boxHeight||300,A=r.boxHeightMax||400,w=r.boxHeightDif||10,C=true;r.boxShow?this._viewer.entities.add({id:r.id+"_1",name:"\u7ACB\u65B9\u4F53\u76D2\u5B50",position:new e.CallbackProperty(function(){return v=v+w,v>=A&&(v=A),e.Cartesian3.fromDegrees(i,l,v/2)},false),box:{dimensions:new e.CallbackProperty(function(){return v=v+w,v>=A&&(v=A,C&&(C=false,c.append(r,true))),new e.Cartesian3(r.boxSide||100,r.boxSide||100,v)},false),material:r.boxMaterial||e.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){c.append(r,true);},100),r.circleShow&&(r.circleSize=r.circleSize||120,this._viewer.entities.add({id:r.id+"_2",name:"\u692D\u5706",position:e.Cartesian3.fromDegrees(i,l),ellipse:{semiMinorAxis:new e.CallbackProperty(function(){return u},false),semiMajorAxis:new e.CallbackProperty(function(){return d},false),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new e.CallbackProperty(function(){return p+=.05,p},false),stRotation:new e.CallbackProperty(function(){return p+=.05,p},false),zIndex:2}}),this._viewer.entities.add({id:r.id+"_3",name:"\u692D\u5706",position:e.Cartesian3.fromDegrees(i,l),ellipse:{semiMinorAxis:new e.CallbackProperty(function(){return m},false),semiMajorAxis:new e.CallbackProperty(function(){return f},false),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new e.CallbackProperty(function(){return g-=.03,g},false),stRotation:new e.CallbackProperty(function(){return g-=.03,g},false),zIndex:3}}));},e.Scene.Css3Renderer=a;}},_installClusterLayer:function(){if(this._viewer){let l=function(u,d){return typeof u!="object"&&(u={}),Array.isArray(d)?d.slice():(Object.keys(d).forEach(m=>{let f=d[m];typeof f=="object"?u[m]=l(u[m],f):u[m]=f;}),u)},s=function(u){if(u&&u.cluserColors&&!u.clusterColors){let{cluserColors:d,...m}=u;return {...m,clusterColors:d}}return u},c=function(u={}){this.style=l(i,s(u||{})),this.layer=null,this.unClusterLayer=null,this.lastCluster=[],this.cluserCanvasImages={},this._clusterEventHandler=null,se(this),ae(this,()=>{this.layer&&this._clusterEventHandler&&this.layer.clustering.clusterEvent.removeEventListener(this._clusterEventHandler),r&&(this.layer&&r.dataSources.remove(this.layer,true),this.unClusterLayer&&r.dataSources.remove(this.unClusterLayer,true));}),this._init();};let r=this._viewer,i={pixelRange:40,minimumClusterSize:5,image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABmDSURBVHgB7d0LdBTXeQfw/+gFkhEsCBACCa8BY2OcIAx2gh+x3MRpmpzEkDatSRwDTdLG6cOmdU6b06ZG7WnTJO3BSZr2tDkJwkmbJk1rktoxcZwix8bxCyPbGBts8GKBeIOMeEraub3fzC6a165eM/vS/3fO9Uq7s6thvPe7371z5w5AR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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHL+JwHeg+eol/LPAAAAAElFTkSuQmCC",scale:.7,type:0,clusterColors:[{value:40,color:"rgb(255,0,0)"},{value:30,color:"rgb(255,0,255)"},{value:20,color:"rgb(255,255,0)"},{value:10,color:"rgb(0,255,255)"},{value:1,color:"rgb(0,255,0)"}]};c.prototype._init=function(){this.layer=new e.CustomDataSource("clusterLayer"),this.unClusterLayer=new e.CustomDataSource("unClusterLayer"),r.dataSources.add(this.unClusterLayer),this.layer.clustering.enabled=true,this.layer.clustering.pixelRange=this.style.pixelRange,this.layer.clustering.minimumClusterSize=this.style.minimumClusterSize,this.setCanvasClusterEvent();},c.prototype.addDataToLayer=function(u){u.forEach(d=>{let m=new e.Entity({id:d.id?d.id:Math.random().toString(36).substring(2),props:d,position:e.Cartesian3.fromDegrees(d.position[0],d.position[1]),billboard:{image:this.style.image,scale:this.style.scale,disableDepthTestDistance:Number.POSITIVE_INFINITY}});u.otherProperty&&u.otherProperty!==null&&u.otherProperty!==void 0&&(m.otherProperty=u.otherProperty),m.layer=this.layer,this.layer.entities.add(m);});},c.prototype.manualRaiseClusterEvent=function(u=2e3){setTimeout(()=>{this.layer.clustering._cluster(1);},u);},c.prototype.setCanvasClusterEvent=function(){this._clusterEventHandler&&this.layer.clustering.clusterEvent.removeEventListener(this._clusterEventHandler);let u=(d,m)=>{this.unClusterLayer&&this.unClusterLayer.entities.removeAll(),m.label.show=false,m.layer=this.layer,m.billboard.show=true,m.billboard.id=m.label.id,m.billboard.verticalOrigin=e.VerticalOrigin.BOTTOM,m.billboard.disableDepthTestDistance=Number.POSITIVE_INFINITY;let f=null;switch(this.style.type){case 0:f=this.getCluserCanvasImage(d.length);break;case 1:f=this.getCluserCanvasImage2(d.length);break}m.billboard.image=f;};this._clusterEventHandler=u,this.layer.clustering.clusterEvent.addEventListener(u);},c.prototype.unClusterFn=function(u){u.primitive.show=false,u.id.forEach(d=>{this.unClusterLayer.entities.add(d);});},c.prototype.getCluserCanvasImage=function(u){if(this.cluserCanvasImages[u])return this.cluserCanvasImages[u];let d=document.createElement("canvas"),m=12*(u+"").length+50;d.width=d.height=m;let f=d.getContext("2d");f.beginPath(),f.globalAlpha=.5,f.fillStyle=this.getCluseColor(u),f.arc(m/2,m/2,m/2-5,0,2*Math.PI),f.fill(),f.beginPath(),f.globalAlpha=.8,f.fillStyle=this.getCluseColor(u),f.arc(m/2,m/2,m/2-10,0,2*Math.PI),f.fill(),f.font="20px alpht",f.globalAlpha=1,f.fillStyle="rgb(255,255,255)";let p=m/2-12*u.toString().length/2;return f.fillText(u,p,m/2+7),this.cluserCanvasImages[u]=d,d},c.prototype.getCluserCanvasImage2=function(u){if(this.cluserCanvasImages[u])return this.cluserCanvasImages[u];let d=document.createElement("canvas"),m=12*(u+"").length+50;d.width=d.height=m;let f=d.getContext("2d");f.translate(m/2,m/2),f.fillStyle=this.getCluseColor(u);let p=Math.PI/2,g=Math.PI/6,v=0,A=0;for(let C=0;C<3;C++)f.beginPath(),f.moveTo(0,0),f.globalAlpha=.5,v=A+g,A=v+p,f.arc(0,0,m/2-5,v,A),f.closePath(),f.fill();f.beginPath(),f.moveTo(0,0),f.globalAlpha=1,f.arc(0,0,m/4,0,2*Math.PI),f.fill(),f.translate(-m/2,-m/2),f.font="20px alpht",f.globalAlpha=1,f.fillStyle="rgb(255,255,255)";let w=m/2-12*u.toString().length/2;return f.fillText(u,w,m/2+7),this.cluserCanvasImages[u]=d,d},c.prototype.getCluseColor=function(u){let d=this.style.clusterColors||this.style.cluserColors||[];for(let m=0;m<d.length;m++){let f=d[m];if(u>=f.value)return f.color}},c.prototype.updateStyle=function(u){this.style=l(this.style,s(u)),this.layer.clustering.pixelRange=this.style.pixelRange,this.layer.clustering.minimumClusterSize=this.style.minimumClusterSize;},c.prototype.setType=function(u){this.style.type=u;},c.prototype.setSelectById=function(u,d){if(this.layer){let m=this.layer.entities.getById(u);m&&(m.billboard.image=d?this.style.selectImage:this.style.image);}},c.prototype.getEntityById=function(u){return this.layer.entities.getById(u)},c.prototype.clear=function(){this.cluserCanvasImages={},this.layer&&this.layer.entities.removeAll();},e.Scene.ClusterLayer=c;}},_installBar3DLayer:function(){if(this._viewer){let r=function(d,m){return typeof d!="object"&&(d={}),Array.isArray(m)?m.slice():(Object.keys(m).forEach(f=>{let p=m[f];typeof p=="object"?d[f]=r(d[f],p):d[f]=p;}),d)},u=function(d){this.barLayer=null,this.config=r(c,d||{}),this._init();};let a=this._viewer,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFCElEQVR4AexWWUjuVRCfz12v+5L7mqKmoqaCae744oJL+qKiSQgRET710Ms1CALlopIP6oNJoiCICylCoJQhKmIppKLmVi647+un2PzO9f/xrZp1I4r78c2ZOefMnPmdOXPm/PXoX/69BvDfikBFRYVlXV3dIPM7UHV19XF9ff1QS0vLj5WVlTdVVVXyhoaG35+SVn8qAo2NjWWtra0dJiYm27u7u0kREREEsrS0tDg6OopbW1t718XFRT8gIMBgc3PTrba2dpeBHjQ1Nf3S1tbW8hCgRwHU1NTMbmxsNC4sLLx3eXlpHBcXJ5wDAPfJ1taWcnJyKDk5mXx8fMjU1JSOj4/t2Kn1zc1N0MrKShEDOuvu7n6LxzT+DwJg9OOHh4cBcObp6Un29vYUGBhI+C0tLdHOzg4BEEcCQzQ8PCx08vPzKTc3lzIyMqigoICMjIzMtre3vxNKao1OAO3t7c/n5+cjo6KiKDw8nDjM5OzsrDDnOXJ3dyfJ+cTEBO3v71NMTIxiDMrsnMLCwoij6NrZ2ZmPMWXSCYDP+n0+V+EcO729vSVEQTI+PT0lV1dXqSsAQt/KykoxJgmwMzMzI7b5SBqTuE4ArOzs4eFB19fXdHJyIvT39vawEyFfXFzQs2fPhIxma2uLbGxsIGolJycnrOOvPqkVAF8xS3ZgzIlHzc3NNDg4KOxGRkaot7eXenp6iOdFwokJ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r:[],labelShow:true,label:{font:"bold 24px Arial",fillColor:e.Color.WHITE,showBackground:true,verticalOrigin:e.VerticalOrigin.BOTTOM,pixelOffset:new e.Cartesian2(0,0)},billboard:{width:25,height:25,pixelOffset:new e.Cartesian2(-35,0)}};u.prototype._init=function(){this.barLayer=new e.CustomDataSource("threeDimensionalBarLayer"),a.dataSources.add(this.barLayer);},u.prototype._findWeight=function(d){let m=Math.max(...d),f=Math.min(...d);return {max:m,min:f}},u.prototype._limitNumberWithinRange=function(d,m,f){let p=m||1,g=f||20,v=parseInt(d);return Math.min(Math.max(v,p),g)},u.prototype.addDataToLayer=function(d){let{barData:m,numField:f="count",multiple:p}=d,{max:g,min:v}=this._findWeight(m.map(C=>C[f])),A=this.config.iconUrlArr;A.length>0&&A.length<3&&(A.length<2?(A[1]=A[0],A[2]=A[0]):A.length<3&&(A[2]=A[0]));let w=(g-v)/2;m.forEach((C,_)=>{let P=C[f],b=null;this.config.icon&&(C.iconUrl?b=C.iconUrl:b=P>=g?A[0]||s:P>=P*(w/P/100)?A[1]||l:A[2]||i);let x=P>w?P*(w/P/100):(w-P)/100*5,T=1;e.defined(p)?T=p:T=this._limitNumberWithinRange(x,v,w),this._add3DBarWithIcon({id:C.name+_,value:P,color:C.color,imgSrc:b,position:C.center,weight:T});});},u.prototype.clear=function(){this.barLayer&&this.barLayer.entities.removeAll();},u.prototype._add3DBarWithIcon=function({id:d,value:m,color:f,imgSrc:p,position:g,weight:v=1}){let A=this,w=A.barLayer.entities.getById(d+"-icon");w&&A.barLayer.entities.remove(w);let C=A.config.boxWidth,_=A.config.boxDepth,P=m*v,b=0,x=0,T=null;f instanceof e.Color?T=f:T=e.Color.fromCssColorString(f).withAlpha(.85),A.barLayer.entities.add({id:d+"-bar",name:"3DBar",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],x/2)},false),box:{dimensions:new e.CallbackProperty(function(){return new e.Cartesian3(C,_,x)},false),material:T,outline:false},show:true});let S=null;f instanceof e.Color?S=f:S=e.Color.fromCssColorString(f).withAlpha(.7),A.config.labelShow&&A.barLayer.entities.add({id:d+"-label",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],x+3e3)},false),label:{text:m+"",backgroundColor:S,...A.config.label},show:true}),A.config.icon&&A.barLayer.entities.add({id:d+"-icon",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],x+22e3)},false),billboard:{image:p,...A.config.billboard},show:true});function M(){x=b+=A.config.duration,(A.config.loop||b<P)&&requestAnimationFrame(M);}M();},e.Scene.ThreeDimensionalBar=u;}},transformJD(o,n){var a=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return a+=(20*Math.sin(6*o*ge)+20*Math.sin(2*o*ge))*2/3,a+=(20*Math.sin(o*ge)+40*Math.sin(o/3*ge))*2/3,a+=(150*Math.sin(o/12*ge)+300*Math.sin(o/30*ge))*2/3,a},transformWD(o,n){var a=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return a+=(20*Math.sin(6*o*ge)+20*Math.sin(2*o*ge))*2/3,a+=(20*Math.sin(n*ge)+40*Math.sin(n/3*ge))*2/3,a+=(160*Math.sin(n/12*ge)+320*Math.sin(n*ge/30))*2/3,a},gcj2wgs(o){var n=Number(o[0]),a=Number(o[1]),r=this.transformWD(n-105,a-35),i=this.transformJD(n-105,a-35),l=a/180*ge,s=Math.sin(l);s=1-Pt*s*s;var c=Math.sqrt(s);r=r*180/(bt*(1-Pt)/(s*c)*ge),i=i*180/(bt/c*Math.cos(l)*ge);var u=a+r,d=n+i,m=n*2-d,f=a*2-u;return m=Number(m.toFixed(6)),f=Number(f.toFixed(6)),[m,f]},wgs2gcj(o){var n=Number(o[0]),a=Number(o[1]),r=this.transformWD(n-105,a-35),i=this.transformJD(n-105,a-35),l=a/180*ge,s=Math.sin(l);s=1-Pt*s*s;var c=Math.sqrt(s);r=r*180/(bt*(1-Pt)/(s*c)*ge),i=i*180/(bt/c*Math.cos(l)*ge);var u=a+r,d=n+i;return d=Number(d.toFixed(6)),u=Number(u.toFixed(6)),[d,u]},transformData(o,n,a){for(var r=this,i=a.paths,l=[],s=function(d){for(var m=i[d],f=[],p=[],g=m.distance,v=0;v<m.steps.length;v++){var A=m.steps[v],w=m.steps[v].instruction,C=A.polyline;C=C.split(";"),C.forEach(function(_){_=_.split(","),_=r.gcj2wgs(_),f.push([_[0],_[1]]);}),p.push(w);}f.unshift(o),f.push(n),l.push({lnglats:f,instructions:p,distance:g});},c=0;c<i.length;c++)s(c);return l},_queryDrivingRoute(o,n,a,r){if(n=n||{},!n.origin){alert("\u7F3A\u5C11\u8D77\u70B9\u5750\u6807\uFF01");return}if(!n.destination){alert("\u7F3A\u5C11\u7EC8\u70B9\u5750\u6807\uFF01");return}var i=n.key||this._queryRouteKey;delete n.key;var l=n.origin,s=this.wgs2gcj(l),c=s[0]+","+s[1];delete n.origin;var u=n.destination,d=this.wgs2gcj(u),m=d[0]+","+d[1];delete n.destination;var f="";if(n.avoidpolygons)for(var p=0;p<n.avoidpolygons.length;p++){for(var g=n.avoidpolygons[p],v="",A="",w=0;w<g.length;w++){var C=g[w];C=this.wgs2gcj(C),A+=C[0]+","+C[1]+",",w==0&&(v=C[0]+","+C[1]);}A=A+v,p==n.avoidpolygons.length-1?f+=A:f+=A+"|";}delete n.avoidpolygons;var _={key:i,origin:c,destination:m,strategy:0,avoidpolygons:f,show_fields:"polyline"};_=Object.assign(_,n||{});var P=this;let b="";Object.keys(_).map(x=>{b?b+=`&${x}=${_[x]}`:b+=`?${x}=${_[x]}`;}),fetch(o+b).then(function(x){return x.json()}).then(function(x){if(x.status!="1"||x.infocode!="10000"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01"),r&&r(x);return}var T=P.transformData(l,u,x.route);a&&a(T);});},queryPathPlan(o,n,a,r){let i;o===y.routeQueryType.DRIVE?(i=n.url||"https://restapi.amap.com/v5/direction/driving",delete n.url,this._queryDrivingRoute(i,n,a,r)):o===y.routeQueryType.WALK?(i=n.url||"https://restapi.amap.com/v3/direction/walking",delete n.url,this._queryWalkCycleRoute(i,n,a,r)):o===y.routeQueryType.CYCLE?(i=n.url||"https://restapi.amap.com/v5/direction/bicycling",delete n.url,this._queryWalkCycleRoute(i,n,a,r)):alert("\u67E5\u8BE2\u53C2\u6570type \u9519\u8BEF\uFF08walk:\u6B65\u884C\uFF0Ccycle:\u9A91\u884C\uFF09\uFF01");},_queryWalkCycleRoute(o,n,a,r){if(n=n||{},!n.origin){alert("\u7F3A\u5C11\u8D77\u70B9\u5750\u6807\uFF01");return}if(!n.destination){alert("\u7F3A\u5C11\u7EC8\u70B9\u5750\u6807\uFF01");return}var i=n.key||this._queryRouteKey;delete n.key;var l=n.origin;this.wgs2gcj(l);var s=l[0]+","+l[1];delete n.origin;var c=n.destination;this.wgs2gcj(c);var u=c[0]+","+c[1];delete n.destination;var d={key:i,origin:s,destination:u,show_fields:"polyline"};d=Object.assign(d,n||{});var m=this;let f="";var p;Object.keys(d).map(g=>{f?f+=`&${g}=${d[g]}`:f+=`?${g}=${d[g]}`;}),fetch(o+f).then(function(g){return g.json()}).then(function(g){if(g.hasOwnProperty("errcode")){if(g.errcode!=0||g.errmsg!="OK"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01",g.errdetail),r&&r(g);return}p=m.transformData(l,c,g.data),a&&a(p);}else if(g.hasOwnProperty("status")){if(g.status!="1"||g.infocode!="10000"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01",g.info),r&&r(g);return}p=m.transformData(l,c,g.route),a&&a(p);}else {console.log("\u67E5\u8BE2\u5931\u8D25,\u672A\u77E5\u9519\u8BEF\uFF01"),r&&r(g);return}});}},y}var We=re(fr);function yr(){let e=null,y=null;async function o(){return y||(y=await Zt()),y}let n=function(s,c,u){if(s){this._viewer=s,e=c,this._analysisLayer=new e.CustomDataSource("analysisLayer"),Ne(Te,ee),Ne(ye,ee),this.$math3d=new Te(s,c),this.$graphics=new ye(s,c),s&&s.dataSources.add(this._analysisLayer);let d=this._analysisLayer,m=this.$graphics,f=this.$math3d;se(this),ae(this,()=>{Ce(m),Ce(f),this._viewer&&d&&(this._viewer.dataSources.remove(d,true),this._analysisLayer===d&&(this._analysisLayer=void 0));});}};n.prototype={createVisibilityAnalysis:function(s){s=s||{};var c=this;c.drawLineGraphics({type:"straightLine",clampToGround:false,callback:function(u,d){var m=new a({positions:u,that:c});c._graphicsLayer&&c._graphicsLayer.entities.remove(d),typeof s.callback=="function"&&s.callback(m);}});},createLookAroundAnalysis:function(s){if(s=s||{},this._viewer&&s){var c=this;c.drawCircleGraphics({callback:function(u,d){c._drawLayer.entities.remove(d);let m=new r({that:c,radius:u.radius,center:u.center});typeof s.callback=="function"&&s.callback(m);}});}},createVisualFieldAnalysis:function(s){if(s=s||{},this._viewer&&s){var c=this,u=null;c.bindHandleEvent({leftClick:(function(m,f){var p=c._viewer.scene.pickPosition(m.position);p&&(e.defined(u)?(f.destroy(),f=null):(u=new e.Scene.ShadowPrimitive({scene:c._viewer.scene,viewerPosition:p}),c._analysisLayer._primitives.add(u)));}),mouseMove:(function(m){var f=c._viewer.scene.pickPosition(m.endPosition);f&&u&&u.setPoseByTargetPoint(f);})});}},createClipPlanAnalysis:function(s){if(s=s||{},this._viewer&&s){var c=this,u=s.height||30,d=s.splitNum||50,m=s.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",f=s.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg";c.drawPolygonGraphics({callback:function(p,g){c._drawLayer.entities.remove(g);let v=e.Cartesian3.fromDegreesArrayHeights(Vt(p)),A=new e.Scene.TerrainClipPlan(c._viewer,{height:u,splitNum:d,wallImg:m,bottomImg:f});A.updateData(v),typeof s.callback=="function"&&s.callback(A);}});}},createSubmergedAnalysis:function(s){if(s=s||{},this._viewer&&s){var c=this,u=s.maxH||15,d=s.speed||1,m=s.interval||10,f=s.matrialUrl||this.getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png";c.drawPolygonGraphics({height:1,callback:function(p,g){if(!c._viewer.scene.globe.depthTestAgainstTerrain)return alert("\u8BF7\u5F00\u542F\u6DF1\u5EA6\u68C0\u6D4B"),false;if(g){let v=g;setTimeout(()=>{v.polygon.heightReference=e.HeightReference.CLAMP_TO_GROUND,v.polygon.material=f;var A=0;v.polygon.extrudedHeight=A;var w=setInterval(function(){A=A+d,A>=u&&(A=u,clearTimeout(w)),v.polygon.extrudedHeight=A;},m);},2e3);}}});}},createSlopeAnalysis:function(s){s=s||{};var c=this;this._viewer&&s&&c.drawLineGraphics({type:"straightLine",clampToGround:false,callback:async function(u,d){await o();var m=new i({positions:u,that:c});c._graphicsLayer&&c._graphicsLayer.entities.remove(d),typeof s.callback=="function"&&s.callback(m);}});},createCutVolumeAnalysis:function(s){if(s=s||{},this._viewer&&s){var c=this;c.drawWallGraphics({callback:function(u){var d=new l({positions:e.Cartesian3.fromDegreesArrayHeights(Vt(u)),that:c});typeof s.callback=="function"&&s.callback(d);}});}}};function a(s){if(s&&s.positions){let C=function(){for(let S=0;S<v.length;++S){var P=v[S].object;if(P){if(P instanceof e.Cesium3DTileFeature)f.push(P),P.oldColor=P.color.clone(),P.color=e.Color.fromAlpha(e.Color.YELLOW,P.color.alpha);else if(P.id instanceof e.Entity){var b=P.id,x=b.polygon||b.polyline;f.push(b);var T=x.material.color.getValue();x.oldColor=T.clone(),x.material=e.Color.fromAlpha(e.Color.YELLOW,T.alpha);}}d.push(u._analysisLayer.entities.add({position:v[S].position,ellipsoid:{radii:new e.Cartesian3(.8,.8,.8),material:e.Color.RED}}));}},_=function(){for(let R=v.length-1;R>=0;R--){let O=v[R];e.defined(O.position)||v.splice(R,1);}if(!e.defined(v[0].position))throw new e.DeveloperError("position is undefined");var P=v[0].position,b=e.Cartesian3.distance(P,g),x=b<5,T=[p,v[0].position],S=u._analysisLayer.entities.add({polyline:{positions:T,width:10,arcType:e.ArcType.NONE,material:new e.PolylineArrowMaterialProperty(e.Color.GREEN)}});if(m.push(S),!x){var M=[v[0].position,g],E=u._analysisLayer.entities.add({polyline:{positions:M,width:10,arcType:e.ArcType.NONE,material:new e.PolylineArrowMaterialProperty(e.Color.RED)}});m.push(E);}C();var I=e.Cartographic.fromCartesian(p),D=e.Cartographic.fromCartesian(g),V={longitude:I.longitude/Math.PI*180,latitude:I.latitude/Math.PI*180,height:I.height},W={longitude:D.longitude/Math.PI*180,latitude:D.latitude/Math.PI*180,height:D.height},z=Math.sqrt(Math.pow(p.x-g.x,2)+Math.pow(p.y-g.y,2)+Math.pow(p.z-g.z,2)),G=Math.abs(W.height-V.height),X=Math.sqrt(Math.pow(z,2)+Math.pow(G,2)),j=x?"\u662F":"\u5426",K="\u8D77\u70B9\u5750\u6807: "+(" ("+V.longitude.toFixed(6))+"\xB0,"+V.latitude.toFixed(6)+"\xB0,"+V.height.toFixed(2)+`)
1025
- \u7EC8\u70B9\u5750\u6807: `+(" ("+W.longitude.toFixed(6))+"\xB0,"+W.latitude.toFixed(6)+"\xB0,"+W.height.toFixed(2)+`)
1026
- \u5782\u76F4\u8DDD\u79BB: `+G.toFixed(2)+`m
1024
+ }`},u.prototype.createDrawCommand=function(a,n,o){var r=n.context,i=new B.Cartesian3;B.Matrix4.multiplyByPoint(this._matrix,a.boundingSphere.center,i);var s=new B.BoundingSphere(i,a.boundingSphere.radius),l=new B.DrawCommand({modelMatrix:o||this._matrix,owner:this,primitiveType:a.primitiveType,pass:B.Pass.TRANSLUCENT,boundingVolume:s}),c=this,h=B.GeometryPipeline.createAttributeLocations(a);return l.vertexArray=B.VertexArray.fromGeometry({context:r,geometry:a,attributeLocations:h,bufferUsage:B.BufferUsage.STATIC_DRAW}),l.vertexArray._attributeLocations=h,l.shaderProgram=B.ShaderProgram.replaceCache({context:r,vertexShaderSource:this.getVertexShaderSource(a),fragmentShaderSource:this.getFragmentShaderSource(a),attributeLocations:h}),l.renderState=B.RenderState.fromCache({blending:B.BlendingState.ALPHA_BLEND,depthTest:{enabled:true,func:B.DepthFunction.LESS},cull:{enabled:false,face:B.CullFace.BACK}}),l.uniformMap={},l.uniformMap.projectionMatrix=function(){return n.context.uniformState.projection},l.uniformMap.modelViewMatrix=function(){return n.context.uniformState.modelView},l.uniformMap.shininess=function(){return c.shininess||(c.shininess=0),c.shininess},l.uniformMap.emission=function(){return c.emission||(c.emission=new B.Cartesian3(.2,.2,.2)),c.emission},l.uniformMap.specular=function(){return c.specular||(c.specular=0),c.specular},l.uniformMap.isLine=function(){return a.primitiveType==B.PrimitiveType.LINES||a.primitiveType==B.PrimitiveType.LINE_STRIP},l.uniformMap.defaultColor=function(){return a.primitiveType==B.PrimitiveType.LINES||a.primitiveType==B.PrimitiveType.LINE_STRIP?(c.defaultLineColor||(c.defaultLineColor=new B.Color(1,1,0,1)),c.defaultLineColor):(c.defaultColor||(c.defaultColor=new B.Color(1,0,0,1)),c.defaultColor)},l.uniformMap.picked=function(){return c.picked||(c.picked=0),c.picked},l.uniformMap.pickedColor=function(){return c.pickedColor||(c.pickedColor=new B.Color(1,1,0,1)),c.pickedColor},l.uniformMap.normalMatrix=function(){return n.context.uniformState.normal},l.uniformMap.glowPower=function(){return .25},l},u.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity);},u.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity);},u.prototype.destroy=function(a){a&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(n){n.vertexArray=n.vertexArray&&n.vertexArray.destroy();}),this._drawCommands=[]);},B.Scene.ConeSensorPrimitive=u;},_installCounputeVertex:function(){function e(o){var r=o.indices,i=o.attributes,s=r.length;if(i.position){var l=i.position.values;if(i.normal===void 0)i.normal=new B.GeometryAttribute({componentDatatype:B.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(l.length)});else for(var c=i.normal.values,h=0;h<s;h++)c[h]=0;for(var d,m,y,p=i.normal.values,g=new B.Cartesian3,v=new B.Cartesian3,A=new B.Cartesian3,w=new B.Cartesian3,C=new B.Cartesian3,h=0;h<s;h+=3)d=3*r[h+0],m=3*r[h+1],y=3*r[h+2],B.Cartesian3.fromArray(l,d,g),B.Cartesian3.fromArray(l,m,v),B.Cartesian3.fromArray(l,y,A),B.Cartesian3.subtract(A,v,w),B.Cartesian3.subtract(g,v,C),B.Cartesian3.cross(w,C,w),p[d]+=w.x,p[d+1]+=w.y,p[d+2]+=w.z,p[m]+=w.x,p[m+1]+=w.y,p[m+2]+=w.z,p[y]+=w.x,p[y+1]+=w.y,p[y+2]+=w.z;u(o),i.normal.needsUpdate=true;}return o}function u(o){for(var r,i,s,l,c=o.attributes.normal.values,h=0;h<c.length;h+=3)r=c[h],i=c[h+1],s=c[h+2],l=1/Math.sqrt(r*r+i*i+s*s),c[h]=r*l,c[h+1]=i*l,c[h+2]=s*l;}function f(o,r,i,s){s=s||B.Ellipsoid.WGS84,B.Matrix4.multiplyByPoint(r,o,a),B.Cartesian3.subtract(a,i.origin,i.direction),B.Cartesian3.normalize(i.direction,i.direction);var l=B.IntersectionTests.rayEllipsoid(i,s),c=null;if(l&&(c=B.Ray.getPoint(i,l.start)),c)try{B.Cartographic.fromCartesian(c,null,n);}catch{return null}return c}var a=new B.Cartesian3,n=(new B.Ray,new B.Cartographic);B.Scene.computeVertexNormals=e,B.Scene.extend2Earth=f;}};function hn(e,u){if(u){new Ht(e,u);let n=new ln(u),o=new cn(u),r=new un(u,n);u.Scene.RectangularSensorPrimitive=n,u.Scene.RectangularSensorGraphics=o,u.Scene.RectangularSensorVisualizer=r;var f=u.DataSourceDisplay,a=f.defaultVisualizersCallback;f.defaultVisualizersCallback=function(i,s,l){var c=l.entities,h=a(i,s,l);return h.concat([new r(i,c)])};}}function Ar(){let e=null,u=function(f,a){f&&(this._viewer=f,e=a,this._customPluginLayer=new e.CustomDataSource("_customPluginLayer"),new hn(f,a),f&&f.dataSources.add(this._customPluginLayer));};return u.prototype={createRectangularSensorGraphics:function(f){if(this._customPluginLayer&&f){let a=new e.HeadingPitchRoll(e.Math.toRadians(f.heading||90),e.Math.toRadians(f.pitch||0),e.Math.toRadians(f.roll||0)),n=f.position;return this._customPluginLayer.entities.add({position:n,orientation:e.Transforms.headingPitchRollQuaternion(n,a),rectangularSensor:new e.Scene.RectangularSensorGraphics({radius:f.radius||1e5,xHalfAngle:e.Math.toRadians(f.xHalfAngle||45),yHalfAngle:e.Math.toRadians(f.yHalfAngle||45),material:f.material||new e.Color(1,0,1,.4),lineColor:f.lineColor||new e.Color(1,0,1,1),showScanPlane:this._objHasOwnProperty(f,"showScanPlane",true),showSectorLines:this._objHasOwnProperty(f,"showSectorLines",true),showLateralSurfaces:this._objHasOwnProperty(f,"showLateralSurfaces",true),modelMatrix:f.modelMatrix||new e.Matrix4,scanPlaneColor:f.scanPlaneColor||new e.Color(1,0,1,1),scanPlaneMode:f.scanPlaneMode||"vertical",scanPlaneRate:f.scanPlaneRate||3,showThroughEllipsoid:this._objHasOwnProperty(f,"showThroughEllipsoid",false),show:this._objHasOwnProperty(f,"show",true)})})}},_objHasOwnProperty(f,a,n){return f.hasOwnProperty(a)?f.field:n},createSatelliteCoverageSimulationGraphics:function(f){if(f)return new e.Scene.SatelliteCoverageSimulation(this._viewer,{position:f.position,angle1:f.angle1||30,angle2:f.angle2||45,areaType:f.areaType||2,rotation:{heading:e.Math.toRadians(f.heading||0),pitch:e.Math.toRadians(f.pitch||0),roll:e.Math.toRadians(f.roll||0)},color:f.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(f){if(f)return new e.Scene.ConeSensorPrimitive(this._viewer,{position:f.position,angle:f.angle||80,radius:f.radius||7e5,rotation:{heading:e.Math.toRadians(f.heading||0),pitch:e.Math.toRadians(f.pitch||40),roll:e.Math.toRadians(f.roll||0)},color:f.color||{red:1,green:0,blue:0,alpha:.4},lineColor:f.lineColor||{red:1,green:1,blue:1,alpha:.9}})}},u}var mt=re(Ar);function wr(){let e=null,u={},f,a,n="move",o=null,r=function(i,s){i&&(this._viewer=i,o=i,e=s,se(this),this._installFileDragDropHandler());};return r.prototype={_installFileDragDropHandler(){function i(l,c){var h=document.createElement("div");h.id="fileDragDrop",h.classList.add("filedragdrop"),h.innerHTML="\u8BF7\u5C06Json\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF",this._dragBox=h,this._viewer=c,this._parentDiv=l,l.appendChild(h),this.fileDragDropCallBack=void 0,this.callBackParms=void 0;}i.prototype.startuploadfile=function(){var l=this,c=l._dragBox,h=null;document.ondragover=function(){clearTimeout(h),h=setTimeout(function(){c.innerHTML="\u8BF7\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF";},200);},c.ondragenter=function(){c.innerHTML="\u8BF7\u91CA\u653E\u9F20\u6807";},c.ondragover=function(){return false},c.ondragleave=function(){c.innerHTML="\u8BF7\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF";},c.ondrop=function(d){d.preventDefault();var m=d.dataTransfer.files[0],y=new FileReader;return y.readAsText(m,"UTF-8"),y.onload=function(){var p=JSON.parse(this.result);l.fileDragDropCallBack&&l.fileDragDropCallBack(l.callBackParms,p,l._viewer);},y.onloadstart=function(){},y.onloadend=function(){},y.onabort=function(){alert("\u8BFB\u53D6\u6570\u636E\u4E2D\u65AD");},y.onerror=function(){alert("\u8BFB\u53D6\u6570\u636E\u5931\u8D25");},false};};function s(l){var c=new i(document.querySelector(".cesium-viewer"),l);Object.defineProperties(l,{fileDragDropMixin:{get:function(){return c}}});}e.Scene.FileDragDropMixin=s;},async showLoadDataToScenePanel(i){let s=await Re();if(i=i||{},i){let l=new s.GUI,c=this._viewer,h=l.addFolder("\u52A0\u8F7D\u6570\u636E\u6587\u4EF6"),d=y=>{let p=document.createElement("input");p.type="file",p.className="datgui_upload",p.onchange=function(){typeof y=="function"&&p.files.length&&y(URL.createObjectURL(p.files[0]));},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(p),p.click();},m={point:()=>{d(y=>{var p=e.GeoJsonDataSource.load(y);p.then(function(g){c.dataSources.add(g);for(var v=g.entities.values,A=0;A<v.length;A++){var w=v[A];w.nameID=A,w.point={color:e.Color.BLUE};}c.flyTo(g);});});},polyline:()=>{d(y=>{var p=e.GeoJsonDataSource.load(y);p.then(function(g){c.dataSources.add(g);for(var v=g.entities.values,A=0;A<v.length;A++){var w=v[A];w.nameID=A,w.polyline.width=5,w.polyline.material=new e.PolylineGlowMaterialProperty({glowPower:.1,color:e.Color.ORANGERED.withAlpha(.9)});}c.flyTo(g);});});},polygon:()=>{d(y=>{var p=e.GeoJsonDataSource.load(y);p.then(function(g){c.dataSources.add(g);for(var v=g.entities.values,A=0;A<v.length;A++){var w=v[A];w.nameID=A,w.polygon.width=10,w.polygon.material=e.Color.BLUE.withAlpha(.9);}c.flyTo(g);});});},model:()=>{d(y=>{c.flyTo(d3kit.createModelGraphics({position:e.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:y}));});},czml:()=>{d(y=>{c.flyTo(c.dataSources.add(e.CzmlDataSource.load(y)));});},"3dtilset":()=>{d(y=>{c.flyTo(c.scene.primitives.add(new e.Cesium3DTileset({url:y})));});}};h.add(m,"point"),h.add(m,"polyline"),h.add(m,"polygon"),h.add(m,"model"),h.add(m,"czml"),h.add(m,"3dtilset"),h.open();}},async showPostProcessStagesPanel(i){let s=await Re();i=i||{};let l=function(){this.blackAndWhiteShow=false,this.blackAndWhiteGradations=5,this.brightnessShow=false,this.brightnessValue=.5,this.nightVisionShow=false,this.silhouette=false;},c=null,h=new l;if(i&&i.elementId){c=new s.GUI({autoPlace:false});var d=document.getElementById(i.elementId);d.appendChild(c.domElement);}else c=new s.GUI;let y=this._viewer.scene.postProcessStages,p=y.add(e.PostProcessStageLibrary.createSilhouetteStage()),g=y.add(e.PostProcessStageLibrary.createBlackAndWhiteStage()),v=y.add(e.PostProcessStageLibrary.createBrightnessStage()),A=y.add(e.PostProcessStageLibrary.createNightVisionStage());p.uniforms.color=i.silhouetteColor||e.Color.YELLOW,p.enabled=false,g.enabled=false,g.uniforms.gradations=5,v.enabled=false,v.uniforms.brightness=.5,A.enabled=false,c.add(h,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(w){g.enabled=w;}),c.add(h,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(w){g.uniforms.gradations=w;}),c.add(h,"brightnessShow").name("brightnessShow").onChange(function(w){v.enabled=w;}),c.add(h,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(w){v.uniforms.brightness=w;}),c.add(h,"nightVisionShow").name("nightVisionShow").onChange(function(w){A.enabled=w;}),c.add(h,"silhouette").name("silhouette").onChange(function(w){p.enabled=w;});},async showSceneBloomPanel(i){let s=await Re(),l=function(){this.contrast=128,this.brightness=-0.3,this.delta=1,this.gamma=3.5,this.enabled=false,this.highDynamicRange=false,this.shadows=false,this.glowOnly=false,this.sigma=1,this.stepSize=5;},c=null,h=new l;if(i&&i.elementId){c=new s.GUI({autoPlace:false});var d=document.getElementById(i.elementId);d.appendChild(c.domElement);}else c=new s.GUI;let m=this._viewer;c.__closeButton.innerHTML="\u6536\u7F29\u9762\u677F";let y=m.scene.postProcessStages.bloom;c.add(h,"enabled").name("bloom").onChange(function(p){y.enabled=p;}),c.add(h,"glowOnly").name("\u53D1\u5149").onChange(function(p){y.uniforms.glowOnly=p;}),c.add(h,"enabled").name("\u542F\u7528\u6A21\u7CCA").onChange(function(p){y.enabled=p;}),c.add(h,"contrast",-255,255,.01).name("\u5BF9\u6BD4\u5EA6").onChange(function(p){y.uniforms.contrast=p;}),c.add(h,"brightness",-1,1,.01).name("\u5149\u6CFD\u4EAE\u5EA6").onChange(function(p){y.uniforms.brightness=p;}),c.add(h,"delta",1,5,.01).name("\u56E0\u5B50").onChange(function(p){y.uniforms.delta=p;}),c.add(h,"sigma",1,10,.01).name("sigma").onChange(function(p){y.uniforms.sigma=p;}),c.add(h,"stepSize",.1,10).name("stepSize").onChange(function(p){y.uniforms.stepSize=p;}),c.add(h,"shadows").name("\u542F\u7528\u9634\u5F71").onChange(function(p){m.shadows=p;}),c.add(h,"highDynamicRange").name("\u9AD8\u52A8\u6001\u8303\u56F4").onChange(function(p){m.scene.highDynamicRange=p;}),c.add(h,"gamma",1,10,.01).name("\u4F3D\u9A6C\u4EAE\u5EA6").onChange(function(p){m.scene.gamma=p;});},async showPrimitiveMatrixPanel(i){let s=await Re(),l=i.primitives._delegate||i.primitives,c=i.primitives;this._viewer;let m=null;if(i&&i.elementId){m=new s.GUI({autoPlace:false});var y=document.getElementById(i.elementId);y.appendChild(m.domElement);}else m=new s.GUI;let g={height:100},v=m.addFolder("\u79BB\u5730\u9AD8\u5EA6");v.add(g,"height",0,1e3,1).onChange(function(x){var M=c.boundingSphere,T=e.Cartographic.fromCartesian(M.center),E=e.Cartesian3.fromRadians(T.longitude,T.latitude,0),R=e.Cartesian3.fromRadians(T.longitude,T.latitude,x),O=e.Cartesian3.subtract(R,E,new e.Cartesian3);c.modelMatrix=e.Matrix4.fromTranslation(O);}),v.open();let A=m.addFolder("\u7F29\u653E\u5927\u5C0F"),w={"m+Scale":()=>{l.readyPromise.then(x=>{let M=x.root.transform;e.Matrix4.multiplyByUniformScale(M,1.2,M),x.root.transform=M;});},"m-Scale":()=>{l.readyPromise.then(x=>{let M=x.root.transform;e.Matrix4.multiplyByUniformScale(M,.8,M),x.root.transform=M;});}};A.add(w,"m+Scale"),A.add(w,"m-Scale"),A.open();let b={"x+Axis":()=>{let x=e.Matrix4.fromTranslation(new e.Cartesian3(20,0,0));e.Matrix4.multiply(l.modelMatrix,x,l.modelMatrix);},"x-Axis":()=>{let x=e.Matrix4.fromTranslation(new e.Cartesian3(-20,0,0));e.Matrix4.multiply(l.modelMatrix,x,l.modelMatrix);},"y+Axis":()=>{let x=e.Matrix4.fromTranslation(new e.Cartesian3(0,20,0));e.Matrix4.multiply(l.modelMatrix,x,l.modelMatrix);},"y-Axis":()=>{let x=e.Matrix4.fromTranslation(new e.Cartesian3(0,-20,0));e.Matrix4.multiply(l.modelMatrix,x,l.modelMatrix);},"z+Axis":()=>{let x=e.Matrix4.fromTranslation(new e.Cartesian3(0,0,20));e.Matrix4.multiply(l.modelMatrix,x,l.modelMatrix);},"z-Axis":()=>{let x=e.Matrix4.fromTranslation(new e.Cartesian3(0,0,-20));e.Matrix4.multiply(l.modelMatrix,x,l.modelMatrix);}},P=m.addFolder("\u77E9\u9635\u5E73\u79FB");P.add(b,"x+Axis"),P.add(b,"x-Axis"),P.add(b,"y+Axis"),P.add(b,"y-Axis"),P.add(b,"z+Axis"),P.add(b,"z-Axis"),P.open();let _={x:0,y:0,z:0},S={"x+Axis":()=>{_.x+=15,l.readyPromise.then(x=>{let M=e.Matrix3.fromRotationX(e.Math.toRadians(_.x)),T=e.Matrix4.fromRotationTranslation(M),E=e.Transforms.eastNorthUpToFixedFrame(x.boundingSphere.center);e.Matrix4.multiply(E,T,E),x._root.transform=E;});},"x-Axis":()=>{_.x-=15,l.readyPromise.then(x=>{let M=e.Matrix3.fromRotationX(e.Math.toRadians(_.x)),T=e.Matrix4.fromRotationTranslation(M),E=e.Transforms.eastNorthUpToFixedFrame(x.boundingSphere.center);e.Matrix4.multiply(E,T,E),x._root.transform=E;});},"y+Axis":()=>{_.y+=15,l.readyPromise.then(x=>{let M=e.Matrix3.fromRotationY(e.Math.toRadians(_.y)),T=e.Matrix4.fromRotationTranslation(M),E=e.Transforms.eastNorthUpToFixedFrame(x.boundingSphere.center);e.Matrix4.multiply(E,T,E),x._root.transform=E;});},"y-Axis":()=>{_.y-=15,l.readyPromise.then(x=>{let M=e.Matrix3.fromRotationY(e.Math.toRadians(_.y)),T=e.Matrix4.fromRotationTranslation(M),E=e.Transforms.eastNorthUpToFixedFrame(x.boundingSphere.center);e.Matrix4.multiply(E,T,E),x._root.transform=E;});},"z+Axis":()=>{_.z+=15,l.readyPromise.then(x=>{let M=e.Matrix3.fromRotationZ(e.Math.toRadians(_.z)),T=e.Matrix4.fromRotationTranslation(M),E=e.Transforms.eastNorthUpToFixedFrame(x.boundingSphere.center);e.Matrix4.multiply(E,T,E),x._root.transform=E;});},"z-Axis":()=>{_.z-=15,l.readyPromise.then(x=>{let M=e.Matrix3.fromRotationZ(e.Math.toRadians(_.z)),T=e.Matrix4.fromRotationTranslation(M),E=e.Transforms.eastNorthUpToFixedFrame(x.boundingSphere.center);e.Matrix4.multiply(E,T,E),x._root.transform=E;});}},I=m.addFolder("\u65CB\u8F6C\u77E9\u9635");if(I.add(S,"x+Axis"),I.add(S,"x-Axis"),I.add(S,"y+Axis"),I.add(S,"y-Axis"),I.add(S,"z+Axis"),I.add(S,"z-Axis"),I.open(),i.cb){let x=m.addFolder("\u83B7\u53D6\u8C03\u6574\u540E\u7684\u6A21\u578B\u77E9\u9635");x.add({getModelMaterix:()=>{l.readyPromise.then(M=>{let T=M.root.transform;i.cb({modelTransformMatrix:e.Matrix4.toArray(T),modelMatrix:e.Matrix4.toArray(c.modelMatrix)});});}},"getModelMaterix").name("\u83B7\u53D6\u6A21\u578B\u77E9\u9635"),x.open();}m.__closeButton.innerHTML="\u6536\u7F29\u9762\u677F";},showLayerParamPanel:async function(i,s){let l=await Re();if(i){let m=null;if(s&&s.elementId){m=new l.GUI({autoPlace:false});var c=document.getElementById(s.elementId);c.appendChild(m.domElement);}else m=new l.GUI;var h=new(function(){this.alpha=i.alpha,this.brightness=i.brightness,this.contrast=i.contrast,this.gamma=i.gamma,this.hue=i.hue,this.dayAlpha=i.dayAlpha,this.nightAlpha=i.nightAlpha,this.saturation=i.saturation;}),d=m.addFolder("\u56FE\u5C42\u8C03\u6574");d.add(h,"alpha",0,1,.05).name("\u900F\u660E\u5EA6").onChange(function(y){i.alpha=y;}),d.add(h,"brightness",0,5,.05).name("\u4EAE\u5EA6").onChange(function(y){i.brightness=y;}),d.add(h,"contrast",0,5,.05).name("\u5BF9\u6BD4").onChange(function(y){i.contrast=y;}),d.add(h,"gamma",0,5,.05).name("\u4F3D\u9A6C").onChange(function(y){i.gamma=y;}),d.add(h,"hue",0,5,.05).name("\u8272\u8C03").onChange(function(y){i.hue=y;}),d.add(h,"dayAlpha",0,1,.05).name("\u767D\u5929\u900F\u660E").onChange(function(y){i.dayAlpha=y;}),d.add(h,"nightAlpha",0,1,.05).name("\u591C\u665A\u900F\u660E").onChange(function(y){i.nightAlpha=y;}),d.add(h,"saturation",0,5,.05).name("\u9971\u548C").onChange(function(y){i.saturation=y;}),d.open();}},showLayerSwitchPanel:async function(i,s,l){let c=await Re();if(i&&i.length){let g=null;if(s&&s.elementId){g=new c.GUI({autoPlace:false});var h=document.getElementById(s.elementId);h.appendChild(g.domElement);}else g=new c.GUI;var d=new(function(){i.forEach(v=>{this[v.id]=v.show;});}),m=g.addFolder("\u56FE\u5C42\u5207\u6362");i.forEach(v=>{m.add(d,v.id).name(v.name).onChange(function(A){v.show=A,l&&l({key:v.id,val:A});});});var y=new(function(){i.forEach(v=>{this[v.id]=v.alpha;});}),p=g.addFolder("\u900F\u660E\u5EA6");i.forEach(v=>{p.add(y,v.id,0,1,.05).name(v.name).onChange(function(A){v.alpha=A;});}),m.open(),p.open();}},showSceneEffectEditPanel:async function(i){let s=await Re();if(i=i||{},s.GUI&&this._viewer.scene.colorCorrection){var l=new s.GUI,c=this._viewer;c.scene.lightSource.ambientLightColor=i.ambientLightColor||new e.Color(.3,.3,.3,1),c.scene.colorCorrection.show=i.colorCorrection||false,c.scene.colorCorrection.saturation=i.saturation||3.1,c.scene.colorCorrection.brightness=i.brightness||1.8,c.scene.colorCorrection.contrast=i.contrast||1.2,c.scene.colorCorrection.hue=i.hue||0,c.scene.bloomEffect.show=i.bloomEffect||false,c.scene.hdrEnabled=i.hdrEnabled||true,c.scene.bloomEffect.threshold=i.threshold||1,c.scene.bloomEffect.bloomIntensity=i.bloomIntensity||2;var h=new(function(){this.bloomEffectShow=i.bloomEffect||false,this.bloomThreshold=i.threshold||1,this.bloomIntensity=i.bloomIntensity||2,this.ambientLightColor=i.ambientLightColor||.3,this.hdrEnabled=i.hdrEnabled||true,this.colorCorrectionShow=false,this.colorCorrectionSaturation=i.saturation||3.1,this.colorCorrectionBrightness=i.brightness||1.8,this.colorCorrectionContrast=i.contrast||1.2,this.colorCorrectionHue=i.hue||0;}),d=l.addFolder("\u573A\u666F\u6548\u679C");d.add(h,"bloomEffectShow").name("\u6CDB\u5149\u5F00\u5173").onChange(function(m){c.scene.bloomEffect.show=m,c.scene.bloomEffect.threshold=h.bloomThreshold,c.scene.bloomEffect.bloomIntensity=h.bloomIntensity;}),d.add(h,"bloomThreshold",0,1,.1).name("\u6CDB\u5149\u9608\u503C").onChange(function(m){c.scene.bloomEffect.threshold=m;}),d.add(h,"bloomIntensity",0,10,.1).name("\u6CDB\u5149\u5F3A\u5EA6").onChange(function(m){c.scene.bloomEffect.bloomIntensity=m;}),d.add(h,"hdrEnabled").name("HDR\u5F00\u5173").onChange(function(m){c.scene.hdrEnabled=m;}),d.add(h,"colorCorrectionShow").name("\u989C\u8272\u6821\u6B63").onChange(function(m){c.scene.colorCorrection.show=m;}),d.add(h,"colorCorrectionSaturation",0,5,.1).name("\u9971\u548C\u5EA6").onChange(function(m){c.scene.colorCorrection.saturation=m;}),d.add(h,"colorCorrectionBrightness",0,5,.1).name("\u4EAE\u5EA6").onChange(function(m){c.scene.colorCorrection.brightness=m;}),d.add(h,"colorCorrectionContrast",0,5,.1).name("\u5BF9\u6BD4\u5EA6").onChange(function(m){c.scene.colorCorrection.contrast=m;}),d.add(h,"colorCorrectionHue",0,5,.1).name("\u8272\u8C03").onChange(function(m){c.scene.hdrEnabled=m;}),d.add(h,"colorCorrectionHue",0,1,.1).name("\u73AF\u5883\u5149").onChange(function(m){c.scene.lightSource.ambientLightColor=new e.Color(m,m,m,1);}),d.open();}},showEntityOrientationEditPanel:async function(i={}){let s=await Re();if(i.entity){let y=i.entity;var l=new s.GUI;if(i&&i.elementId){l=new s.GUI({autoPlace:false});var c=document.getElementById(i.elementId);c.appendChild(l.domElement);}else l=new s.GUI;var h=new(function(){this.heading=360,this.pitch=1,this.roll=1;}),d=l.addFolder("\u5B9E\u4F53\u59FF\u6001\u8C03\u6574"),m=this;d.add(h,"heading",0,360,1).name("\u89D2\u5EA6").onChange(function(p){h.heading=p;let g=e.Transforms.headingPitchRollQuaternion(y.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(h.heading),e.Math.toRadians(h.pitch),e.Math.toRadians(h.roll)));y.orientation=g,i.cb&&i.cb({orientation:g});}),d.add(h,"pitch",0,360,1).name("\u822A\u5411").onChange(function(p){h.pitch=p;let g=e.Transforms.headingPitchRollQuaternion(y.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(h.heading),e.Math.toRadians(h.pitch),e.Math.toRadians(h.roll)));y.orientation=g,i.cb&&i.cb({orientation:g});}),d.add(h,"roll",0,360,1).name("\u7FFB\u8F6C").onChange(function(p){h.roll=p;let g=e.Transforms.headingPitchRollQuaternion(y.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(h.heading),e.Math.toRadians(h.pitch),e.Math.toRadians(h.roll)));y.orientation=g,i.cb&&i.cb({orientation:g});}),d.open();}},definedMouseEvent({targetEntity:i,ctrlFlag:s}){a=i,u=s,this.bindHandleEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp});},defMouseMove(i){if(u.leftDown&&f){let s=o.camera.getPickRay(i.endPosition),l=o.scene.globe.pick(s,o.scene);if(document.body.style.cursor="pointer",f&&f.id&&n==="move"){let c=e.JulianDate.fromDate(new Date),h=a.position.getValue(c),d=e.Cartographic.fromCartesian(h),m=Number(d.height.toFixed(3));a.position=new e.CallbackProperty(()=>{let y=o.scene.globe.ellipsoid.cartesianToCartographic(l),p=e.Math.toDegrees(y.longitude),g=e.Math.toDegrees(y.latitude);return e.Cartesian3.fromDegrees(p,g,m)},false);}else if(f&&f.id&&n==="rotate"){let c=e.JulianDate.fromDate(new Date),h=a.position.getValue(c),d=o.scene.camera.pickEllipsoid(i.startPosition),m=o.scene.camera.pickEllipsoid(i.endPosition),y=e.Cartesian3.subtract(h,m,new e.Cartesian3),p=e.Cartesian3.normalize(y,new e.Cartesian3),g=e.Cartesian3.subtract(d,h,new e.Cartesian3),v=e.Cartesian3.subtract(m,h,new e.Cartesian3),A=e.Cartesian3.angleBetween(g,v),C=e.Quaternion.fromAxisAngle(p,A*100);a.orientation=C;}}},defLeftDown(i){f=o.scene.pick(i.position),e.defined(f)&&n?(u.selected=true,u.leftDown=true):u.selected=false;},defMouseWheel(i){if(f&&f.id&&n==="scale"){let s=e.JulianDate.fromDate(new Date),l=a.box.dimensions.getValue(s),c=i>0?2:.5;a.box.dimensions=new e.CallbackProperty(()=>e.Cartesian3.multiplyByScalar(l,c,new e.Cartesian3),false);}},defLeftUp(i){u.leftDown=false,document.body.style.cursor="default";},manualMoveModel:function(i){n=i,this._viewer.scene.screenSpaceCameraController.enableRotate=false,this._viewer.scene.screenSpaceCameraController.enableZoom=true;},manualRotateModel:function(i){n=i,this._viewer.scene.screenSpaceCameraController.enableRotate=false,this._viewer.scene.screenSpaceCameraController.enableZoom=true;},manualScaleModel:function(i){n=i,this._viewer.scene.screenSpaceCameraController.enableZoom=false;}},r}var ft=re(wr);function Cr(e,u){var r,i,s,l,c;if(!u||typeof u!="object")return;let f=u;if(typeof f.x=="number"&&typeof f.y=="number"&&typeof f.z=="number"&&Number.isFinite(f.x)&&Number.isFinite(f.y)&&Number.isFinite(f.z))return e.Cartesian3.clone(f);let a,n,o;if(Array.isArray(u)?(a=Number(u[0]),n=Number(u[1]),o=u.length>2?Number(u[2]):0):(a=Number((i=(r=f.lng)!=null?r:f.lon)!=null?i:f.longitude),n=Number((s=f.lat)!=null?s:f.latitude),o=Number((c=(l=f.alt)!=null?l:f.height)!=null?c:0)),!(!Number.isFinite(a)||!Number.isFinite(n)||!Number.isFinite(o)))return e.Cartesian3.fromDegrees(a,n,o)}function zt(e){var f,a,n,o,r;let u=[];if(!Array.isArray(e))return u;for(let i of e){if(!i||typeof i!="object")continue;let s=i;if(typeof s.x=="number"&&typeof s.z=="number")continue;let l=Number((a=(f=s.lng)!=null?f:s.lon)!=null?a:s.longitude),c=Number((n=s.lat)!=null?n:s.latitude),h=Number((r=(o=s.alt)!=null?o:s.height)!=null?r:0);!Number.isFinite(l)||!Number.isFinite(c)||!Number.isFinite(h)||u.push(l,c,h);}return u}function dn(e,u,f=.001){let a=[];if(!Array.isArray(u))return a;for(let n=0;n<u.length;n++){let o=Cr(e,u[n]);if(!o)continue;let r=a[a.length-1];r&&e.Cartesian3.distance(r,o)<f||a.push(o);}return a}function mn(e,u,f){let a=e.Cartesian3.subtract(f,u,{x:0,y:0,z:0});if(!Number.isFinite(a.x)||!Number.isFinite(a.y)||!Number.isFinite(a.z)||e.Cartesian3.magnitudeSquared(a)<1e-6)return null;let n=e.Cartesian3.normalize(a,{x:0,y:0,z:0}),o=e.Transforms.rotationMatrixFromPositionVelocity(u,n,e.Ellipsoid.WGS84);return e.Quaternion.fromRotationMatrix(o)}function fn(e,u,f,a=()=>new e.JulianDate,n=1/60){let o=u.getValue(f);if(!o)return null;let r=e.JulianDate.addSeconds(f,n,a()),i=u.getValue(r);if(i){let c=mn(e,o,i);if(c)return c}let s=e.JulianDate.addSeconds(f,-n,a()),l=u.getValue(s);return l?mn(e,l,o):null}var ve=3.141592653589793,Pt=6378245,xt=.006693421622965943;function br(){let e=null,f=function(a,n,o){if(a){this._viewer=a,e=n,this._queryRouteKey="8dc49b1fa65a79d306ef12dae4229842",this._pluginLayer=new e.CustomDataSource("pluginLayer"),a&&a.dataSources.add(this._pluginLayer);let r=this._pluginLayer;se(this),oe(this,()=>{Ce(this.droneEntity),this._viewer&&r&&(this._viewer.dataSources.remove(r,true),this._pluginLayer===r&&(this._pluginLayer=void 0));}),this._installPlugin();}};return f.routeQueryType={DRIVE:"drive",WALK:"walk",CYCLE:"cycle"},f.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan(),this._installClusterLayer(),this._installBar3DLayer();},_installTerrainClipPlan:function(){let a=e.defaultValue||Be;function n(o,r){this.viewer=o,this.options=r||{},this._positions=r.positions,this._height=this.options.height||0,this.bottomImg=r.bottomImg,this.wallImg=r.wallImg,this.splitNum=a(r.splitNum,50),this._positions&&this._positions.length>0&&this.updateData(this._positions);}Object.defineProperties(n.prototype,{show:{get:function(){return this._show},set:function(o){this._show=o,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=o),this._switchExcavate(o);}},height:{get:function(){return this._height},set:function(o){this._height=o,this._updateExcavateDepth(o);}}}),n.prototype.updateData=function(o){var r=[],i=o.length-1,s=new e.Cartesian3,l=e.Cartesian3.subtract(o[0],o[1],s);l=l.x>0,this.excavateMinHeight=9999;for(var c=0;c<i;c++){var h=(c+1)%i,d=e.Cartesian3.midpoint(o[c],o[h],new e.Cartesian3),m=e.Cartographic.fromCartesian(o[c]),y=this.viewer.scene.globe.getHeight(m)||m.height;y<this.excavateMinHeight&&(this.excavateMinHeight=y);var p,g=e.Cartesian3.normalize(d,new e.Cartesian3);p=l?e.Cartesian3.subtract(o[c],d,new e.Cartesian3):e.Cartesian3.subtract(o[h],d,new e.Cartesian3),p=e.Cartesian3.normalize(p,p);var v=e.Cartesian3.cross(p,g,new e.Cartesian3);v=e.Cartesian3.normalize(v,v);var A=new e.Plane(v,0),w=e.Plane.getPointDistance(A,d);r.push(new e.ClippingPlane(v,w));}this.viewer.scene.globe.clippingPlanes=new e.ClippingPlaneCollection({planes:r,edgeWidth:1,edgeColor:e.Color.WHITE,enabled:true}),this._prepareWell(o),this._createWell(this.wellData);},n.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=false,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();},n.prototype._prepareWell=function(o){var r=this.splitNum,i=o.length;if(i!=0){for(var s=this.excavateMinHeight-this.height,l=[],c=[],h=[],d=0;d<i;d++){var m=d==i-1?0:d+1,y=e.Cartographic.fromCartesian(o[d]),p=e.Cartographic.fromCartesian(o[m]),g=[y.longitude,y.latitude],v=[p.longitude,p.latitude];d==0&&(h.push(new e.Cartographic(g[0],g[1])),c.push(e.Cartesian3.fromRadians(g[0],g[1],s)),l.push(e.Cartesian3.fromRadians(g[0],g[1],0)));for(var A=1;A<=r;A++){var w=e.Math.lerp(g[0],v[0],A/r),C=e.Math.lerp(g[1],v[1],A/r);d==i-1&&A==r||(h.push(new e.Cartographic(w,C)),c.push(e.Cartesian3.fromRadians(w,C,s)),l.push(e.Cartesian3.fromRadians(w,C,0)));}}this.wellData={lerp_pos:h,bottom_pos:c,no_height_top:l};}},n.prototype._createWell=function(o){if(this.viewer.terrainProvider._layers){var r=this;this._createBottomSurface(o.bottom_pos),e.sampleTerrainMostDetailed(this.viewer.terrainProvider,o.lerp_pos).then(function(i){for(var s=i.length,l=[],c=0;c<s;c++){var h=e.Cartesian3.fromRadians(i[c].longitude,i[c].latitude,i[c].height);l.push(h);}r._createWellWall(o.bottom_pos,l);});}else this._createBottomSurface(o.bottom_pos),this._createWellWall(o.bottom_pos,o.no_height_top);},n.prototype._getMinHeight=function(o){let r=5e6,i=null;for(let s=0;s<o.length;s++){let l=o[s].z;l<r&&(r=l,i=this._ellipsoidToLonLat(o[s]));}return i.altitude},n.prototype._ellipsoidToLonLat=function(o){let r=this.viewer.scene.globe.ellipsoid,i=new e.Cartesian3(o.x,o.y,o.z),s=r.cartesianToCartographic(i),l=e.Math.toDegrees(s.latitude),c=e.Math.toDegrees(s.longitude),h=s.height;return {longitude:c,latitude:l,altitude:h}},n.prototype._createBottomSurface=function(o){if(o.length){let s=this._getMinHeight(o),l=[];for(let d=0;d<o.length;d++){let m=this._ellipsoidToLonLat(o[d]);l.push(m.longitude),l.push(m.latitude),l.push(s);}let c=new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights(l)),perPositionHeight:true}),h=e.PolygonGeometry.createGeometry(c);var r=new e.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),i=new e.MaterialAppearance({translucent:false,flat:true,material:r});this.bottomSurface=new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:h}),appearance:i,asynchronous:false}),this.viewer.scene.primitives.add(this.bottomSurface);}},n.prototype._createWellWall=function(o,r){let i=this._getMinHeight(o),s=[],l=[];for(let y=0;y<r.length;y++)s.push(this._ellipsoidToLonLat(r[y]).altitude),l.push(i);let c=new e.WallGeometry({positions:r,maximumHeights:s,minimumHeights:l}),h=e.WallGeometry.createGeometry(c);var d=new e.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),m=new e.MaterialAppearance({translucent:false,flat:true,material:d});this.wellWall=new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:h,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(e.Color.GREY)},id:"PitWall"}),appearance:m,asynchronous:false}),this.viewer.scene.primitives.add(this.wellWall);},n.prototype._switchExcavate=function(o){o?(this.viewer.scene.globe.material=e.Material.fromType("WaJue"),this.wellWall.show=true,this.bottomSurface.show=true):(this.viewer.scene.globe.material=null,this.wellWall.show=false,this.bottomSurface.show=false);},n.prototype._updateExcavateDepth=function(o){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var r=this.wellData.lerp_pos,i=[],s=r.length,l=0;l<s;l++)i.push(e.Cartesian3.fromRadians(r[l].longitude,r[l].latitude,this.excavateMinHeight-o));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall);},e.Scene.TerrainClipPlan=n;},buildLightScanGraphics:function(a){if(this._viewer&&a){for(var n=this,o=function(h,d){for(var m=d.observer[0],y=d.observer[1],p=d.observer[2],g=[],v=0;v<h.length;v++){var A;v===h.length-1?A=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([m,y,p,h[v].x,h[v].y,0,h[0].x,h[0].y,0])):A=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([m,y,p,h[v].x,h[v].y,0,h[v+1].x,h[v+1].y,0]));var w=n._pluginLayer.entities.add({name:"\u4E09\u89D2\u5F62",polygon:{hierarchy:A,outline:false,perPositionHeight:true,material:d.material}});g.push(w);}return g},r=function(h,d,m){var y=h.positionList,p,g,v,A,w,C,b=0,P=0;function _(S){p=y[S+1][0]-y[S][0],g=y[S+1][1]-y[S][1],v=p/h.number,A=g/h.number,P=0;}_(b),d.polygon.hierarchy=new e.CallbackProperty(function(){return Math.abs(w)>=Math.abs(p)&&Math.abs(C)>=Math.abs(g)&&(b=b+1,b===y.length-1&&(b=0),m[0]=m[0]+w,m[1]=m[1]+C,m[2]=m[2]+w,m[3]=m[3]+C,_(b)),w=P*v,C=P*A,P++,new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([h.observer[0],h.observer[1],h.observer[2],m[0]+w,m[1]+C,0,m[2]+w,m[3]+C,0]))},false);},i=function(h,d,m,y){let p=[],g=Math.PI/180*Math.round(360/y),v=0;for(;v<y;v++){let A=d+h*Math.sin(g*v),w=m+h*Math.cos(g*v);p.unshift({x:A,y:w});}return p},s=i(a.circle[0],a.circle[1],a.circle[2],a.circle[3]),l=o(s,a),c=0;c<l.length;c++)c!==l.length-1?r(a,l[c],[s[c].x,s[c].y,s[c+1].x,s[c+1].y]):r(a,l[c],[s[c].x,s[c].y,s[0].x,s[0].y]);return l}},buildPathRoaming:function(a){if(this._viewer&&a&&a.paths){var n=this.createGraphics(),o=dn(e,a.paths);if(o.length<2){ge(new ae("INVALID_ARGUMENT","buildPathRoaming \u81F3\u5C11\u9700\u8981 2 \u4E2A\u6709\u6548\u4E14\u4E92\u4E0D\u91CD\u5408\u7684\u8DEF\u5F84\u70B9\u3002",{details:{received:a.paths.length,valid:o.length}}),{scope:"plugin.buildPathRoaming"});return}if(n.position=this._createSampledPosition(o),n.name=a.name||"\u8DEF\u5F84\u6F2B\u6E38",n.availability=new e.TimeIntervalCollection([new e.TimeInterval({start:this.startTime,stop:this.stopTime})]),n.orientation=this._sampleOrientation(),a.polyline){let{width:r,material:i,clampToGround:s,...l}=a.polyline;n.polyline={positions:new e.CallbackProperty(function(){return o},false),width:r||10,material:i||new e.PolylineGlowMaterialProperty({glowPower:1,color:e.Color.RED}),clampToGround:s!==false,...l};}return a.model&&(n.model=this.getModelGraphics(a.model)),a.label&&(n.label=this.getLabelGraphics(a)),a.billboard&&(n.billboard=this.getBillboardGraphics(a)),this.droneEntity=n,this._beginRoamTrace(a),this._viewer.entities.add(n)}},_beginRoamTrace(a){let n=this._roamTick;n&&(this._viewer.clock.onTick.removeEventListener(n),this._roamTick=null);let o=()=>{if(this._viewer.clock.shouldAnimate){let r=this._viewer.clock.currentTime,i=this.droneEntity.position&&this.droneEntity.position.getValue(r),s=this.droneEntity.orientation&&this.droneEntity.orientation.getValue(r);if(i&&s){let l=e.Matrix4.fromRotationTranslation(e.Matrix3.fromQuaternion(s),i),c=typeof(a==null?void 0:a.cameraOffset)=="function"?a.cameraOffset():new e.HeadingPitchRange(0,e.Math.toRadians(-20),150);this._viewer.camera.lookAtTransform(l,c);}}};this._viewer.clock.onTick.addEventListener(o),this._roamTick=o,oe(this,()=>{this._viewer.clock.onTick.removeEventListener(o),this._roamTick===o&&(this._roamTick=null);});},_createSampledPosition(a){this.startTime=e.JulianDate.now(),this.stopTime=e.JulianDate.addSeconds(this.startTime,Math.max(a.length-1,1)*60,new e.JulianDate),this._viewer.clock.startTime=this.startTime.clone(),this._viewer.clock.stopTime=this.stopTime.clone(),this._viewer.clock.currentTime=this.startTime.clone(),this._viewer.clock.clockRange=e.ClockRange.CLAMPED;let n=new e.SampledPositionProperty;n.forwardExtrapolationType=e.ExtrapolationType.HOLD,n.backwardExtrapolationType=e.ExtrapolationType.HOLD;for(let o=0;o<a.length;o++){let r=e.JulianDate.addSeconds(this.startTime,o*60,new e.JulianDate),i=a[o];n.addSample(r,i);}return n},_sampleOrientation(){let a;return new e.CallbackProperty(n=>{let o=this.droneEntity&&this.droneEntity.position;if(!o)return a;let r=fn(e,o,n);return r&&(a=r),a},false)},_installCss3Renderer:function(){if(this._viewer){let o=function(r,i){this._scratch=new e.Cartesian2,this._viewer=a,this._scene=a.scene,this._camera=a.camera,this._container=null,this._elements=r,this._isBackHide=i,this._postBuildFun=null,this._parentEleId=r.length>0&&r[0].parentEleId||"info-warp",se(this),oe(this,()=>{this._postBuildFun&&(this._scene.postRender.removeEventListener(this._postBuildFun),this._postBuildFun=null),this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=null;}),this.init();};var a=this._viewer;o.prototype.init=function(){var r=document.createElement("div");r.className="ys-css3-container";let i=this._parentEleId,s=document.getElementById(i);s.appendChild(r),this._container=r,this._elements=this._elements.filter(m=>m.position),this._elements.forEach(function(m){r.insertAdjacentHTML("beforeend",m.element);});function l(m,y=document){return y.querySelectorAll(`.${m}`)}var c=this;c._scene.canvas.clientHeight;let d=new e.Cartesian2;this._postBuildFun=function(){var m=l("close__box__btn");m.forEach(function(v){v.style.position="absolute",v.style.top="5px",v.style.right="5px",v.style.cursor="pointer",v.style.color="#fff",v.addEventListener("click",function(){s.contains(r)&&(s.removeChild(r),c._postBuildFun&&c._scene.postRender.removeEventListener(c._postBuildFun));});});for(var y=0;y<r.children.length;y++){let v="",A=c._elements[y],w=A.position;w instanceof e.Cartesian3?v=w:v=e.Cartesian3.fromDegrees(w[0],w[1],w[2]||0),e.SceneTransforms.worldToWindowCoordinates(c._scene,v,d);let C=A.offset?A.offset[0]:0,b=A.offset?A.offset[1]:0;if(e.defined(d)){let P=r.children[y];if(P.style.position="absolute",P.style.zIndex=99,P.style.left=d.x+C+"px",P.style.top=d.y-P.offsetHeight+b+"px",c._isBackHide){var p=c._camera.position,g=c._scene.globe.ellipsoid.cartesianToCartographic(p).height;g+=1*c._scene.globe.ellipsoid.maximumRadius,e.Cartesian3.distance(p,v)>g?r.children[y].style.display="none":r.children[y].style.display="block";}}}},this._scene.postRender.addEventListener(this._postBuildFun);},o.prototype.remove=function(r){this._elements=this._elements.filter(function(i){i.id;}),this._container.removeChild(document.getElementById(r)),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},o.prototype.removeChild=function(){let r=document.getElementById(this._parentEleId);r.contains(this._container)&&r.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},o.prototype.close=function(){let r=document.getElementById(this._parentEleId);r.contains(this._container)&&r.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},o.prototype.append=function(r){this._elements.push(r),this._container.insertAdjacentHTML("beforeend",r.element);},o.prototype.removeEntityLayer=function(r){this._viewer.entities.removeById(r+"_1"),this._viewer.entities.removeById(r+"_2"),this._viewer.entities.removeById(r+"_3"),this.remove(r);},o.prototype.addEntityLayer=function(r){var i=r.position[0],s=r.position[1],c=this,h=.001,d=h,m=h,y=h;setTimeout(function(b){},300);var p=e.Math.toRadians(30),g=e.Math.toRadians(30),v=r.boxHeight||300,A=r.boxHeightMax||400,w=r.boxHeightDif||10,C=true;r.boxShow?this._viewer.entities.add({id:r.id+"_1",name:"\u7ACB\u65B9\u4F53\u76D2\u5B50",position:new e.CallbackProperty(function(){return v=v+w,v>=A&&(v=A),e.Cartesian3.fromDegrees(i,s,v/2)},false),box:{dimensions:new e.CallbackProperty(function(){return v=v+w,v>=A&&(v=A,C&&(C=false,c.append(r,true))),new e.Cartesian3(r.boxSide||100,r.boxSide||100,v)},false),material:r.boxMaterial||e.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){c.append(r,true);},100),r.circleShow&&(r.circleSize=r.circleSize||120,this._viewer.entities.add({id:r.id+"_2",name:"\u692D\u5706",position:e.Cartesian3.fromDegrees(i,s),ellipse:{semiMinorAxis:new e.CallbackProperty(function(){return h},false),semiMajorAxis:new e.CallbackProperty(function(){return d},false),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new e.CallbackProperty(function(){return p+=.05,p},false),stRotation:new e.CallbackProperty(function(){return p+=.05,p},false),zIndex:2}}),this._viewer.entities.add({id:r.id+"_3",name:"\u692D\u5706",position:e.Cartesian3.fromDegrees(i,s),ellipse:{semiMinorAxis:new e.CallbackProperty(function(){return m},false),semiMajorAxis:new e.CallbackProperty(function(){return y},false),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new e.CallbackProperty(function(){return g-=.03,g},false),stRotation:new e.CallbackProperty(function(){return g-=.03,g},false),zIndex:3}}));},e.Scene.Css3Renderer=o;}},_installClusterLayer:function(){if(this._viewer){let s=function(h,d){return typeof h!="object"&&(h={}),Array.isArray(d)?d.slice():(Object.keys(d).forEach(m=>{let y=d[m];typeof y=="object"?h[m]=s(h[m],y):h[m]=y;}),h)},l=function(h){if(h&&h.cluserColors&&!h.clusterColors){let{cluserColors:d,...m}=h;return {...m,clusterColors:d}}return h},c=function(h={}){this.style=s(i,l(h||{})),this.layer=null,this.unClusterLayer=null,this.lastCluster=[],this.cluserCanvasImages={},this._clusterEventHandler=null,se(this),oe(this,()=>{this.layer&&this._clusterEventHandler&&this.layer.clustering.clusterEvent.removeEventListener(this._clusterEventHandler),r&&(this.layer&&r.dataSources.remove(this.layer,true),this.unClusterLayer&&r.dataSources.remove(this.unClusterLayer,true));}),this._init();};let r=this._viewer,i={pixelRange:40,minimumClusterSize:5,image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABmDSURBVHgB7d0LdBTXeQfw/+gFkhEsCBACCa8BY2OcIAx2gh+x3MRpmpzEkDatSRwDTdLG6cOmdU6b06ZG7WnTJO3BSZr2tDkJwkmbJk1rktoxcZwix8bxCyPbGBts8GKBeIOMeEraub3fzC6a165eM/vS/3fO9Uq7s6thvPe7371z5w5ARERERERERGOBASp5avu/xAEzBlSkHoOUdevXdEHCWHxXAjQmMACUGPXsN5tRbrSgrGyR/rVZPxPXj7ERfJQOBkYHytCBfnMfzGSHce0ftYNKCgNAkVPb18dgVq7WFf5m/VuL/l86kso+DEY7ynRg6O37MQNC8WMAKEIDlR63QenWPn8S+hvUrjOEjQwGxYkBoIio59a3oKLyNphqNUaW1kfISOj/tOvMoNVYtjYBKgoMAEXAqvjlFfdBSYo/DOXjgKpaoHoaUKNLRep3eV6KU++p1GMPcOGUXeS5c8eA5AUMUxt6kwwERYABoICpZ9c36/72ev1jy5DeUDEemDTHruzyOG4iQnHuKNBzwC6n9wP954f2PkMCgWIgKGAMAAXI7uPjPl3uGXRjadXrrtIdgrlAbSNyonuPXY7tHHxbQ48TmGarcd2ftoEKDgNAgVHPfbUFqnyD/j8Tz7qhVPbYPLvyV4xDXkg3oUdnBAd/Zf+cjQSCvgu3GMu+kAAVDAaAAqG2r4uhv1b6+dlb/domYNb1Q2/tpf/ee1qn8cftPn2f7uMne+3iVF5ll0oZM5hqjxFUT/GPFWRy7BWgSwLB29m26tYDmK3Guz9/P6ggMAAUAPWrL8X1IN+DsCbuZFA1CZjzATsAZCMV/u2E7qt32UUG9Uajug6YMNMul8wcPNuQQHDgKf13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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHL+JwHeg+eol/LPAAAAAElFTkSuQmCC",scale:.7,type:0,clusterColors:[{value:40,color:"rgb(255,0,0)"},{value:30,color:"rgb(255,0,255)"},{value:20,color:"rgb(255,255,0)"},{value:10,color:"rgb(0,255,255)"},{value:1,color:"rgb(0,255,0)"}]};c.prototype._init=function(){this.layer=new e.CustomDataSource("clusterLayer"),this.unClusterLayer=new e.CustomDataSource("unClusterLayer"),r.dataSources.add(this.unClusterLayer),this.layer.clustering.enabled=true,this.layer.clustering.pixelRange=this.style.pixelRange,this.layer.clustering.minimumClusterSize=this.style.minimumClusterSize,this.setCanvasClusterEvent();},c.prototype.addDataToLayer=function(h){h.forEach(d=>{let m=new e.Entity({id:d.id?d.id:Math.random().toString(36).substring(2),props:d,position:e.Cartesian3.fromDegrees(d.position[0],d.position[1]),billboard:{image:this.style.image,scale:this.style.scale,disableDepthTestDistance:Number.POSITIVE_INFINITY}});h.otherProperty&&h.otherProperty!==null&&h.otherProperty!==void 0&&(m.otherProperty=h.otherProperty),m.layer=this.layer,this.layer.entities.add(m);});},c.prototype.manualRaiseClusterEvent=function(h=2e3){setTimeout(()=>{this.layer.clustering._cluster(1);},h);},c.prototype.setCanvasClusterEvent=function(){this._clusterEventHandler&&this.layer.clustering.clusterEvent.removeEventListener(this._clusterEventHandler);let h=(d,m)=>{this.unClusterLayer&&this.unClusterLayer.entities.removeAll(),m.label.show=false,m.layer=this.layer,m.billboard.show=true,m.billboard.id=m.label.id,m.billboard.verticalOrigin=e.VerticalOrigin.BOTTOM,m.billboard.disableDepthTestDistance=Number.POSITIVE_INFINITY;let y=null;switch(this.style.type){case 0:y=this.getCluserCanvasImage(d.length);break;case 1:y=this.getCluserCanvasImage2(d.length);break}m.billboard.image=y;};this._clusterEventHandler=h,this.layer.clustering.clusterEvent.addEventListener(h);},c.prototype.unClusterFn=function(h){h.primitive.show=false,h.id.forEach(d=>{this.unClusterLayer.entities.add(d);});},c.prototype.getCluserCanvasImage=function(h){if(this.cluserCanvasImages[h])return this.cluserCanvasImages[h];let d=document.createElement("canvas"),m=12*(h+"").length+50;d.width=d.height=m;let y=d.getContext("2d");y.beginPath(),y.globalAlpha=.5,y.fillStyle=this.getCluseColor(h),y.arc(m/2,m/2,m/2-5,0,2*Math.PI),y.fill(),y.beginPath(),y.globalAlpha=.8,y.fillStyle=this.getCluseColor(h),y.arc(m/2,m/2,m/2-10,0,2*Math.PI),y.fill(),y.font="20px alpht",y.globalAlpha=1,y.fillStyle="rgb(255,255,255)";let p=m/2-12*h.toString().length/2;return y.fillText(h,p,m/2+7),this.cluserCanvasImages[h]=d,d},c.prototype.getCluserCanvasImage2=function(h){if(this.cluserCanvasImages[h])return this.cluserCanvasImages[h];let d=document.createElement("canvas"),m=12*(h+"").length+50;d.width=d.height=m;let y=d.getContext("2d");y.translate(m/2,m/2),y.fillStyle=this.getCluseColor(h);let p=Math.PI/2,g=Math.PI/6,v=0,A=0;for(let C=0;C<3;C++)y.beginPath(),y.moveTo(0,0),y.globalAlpha=.5,v=A+g,A=v+p,y.arc(0,0,m/2-5,v,A),y.closePath(),y.fill();y.beginPath(),y.moveTo(0,0),y.globalAlpha=1,y.arc(0,0,m/4,0,2*Math.PI),y.fill(),y.translate(-m/2,-m/2),y.font="20px alpht",y.globalAlpha=1,y.fillStyle="rgb(255,255,255)";let w=m/2-12*h.toString().length/2;return y.fillText(h,w,m/2+7),this.cluserCanvasImages[h]=d,d},c.prototype.getCluseColor=function(h){let d=this.style.clusterColors||this.style.cluserColors||[];for(let m=0;m<d.length;m++){let y=d[m];if(h>=y.value)return y.color}},c.prototype.updateStyle=function(h){this.style=s(this.style,l(h)),this.layer.clustering.pixelRange=this.style.pixelRange,this.layer.clustering.minimumClusterSize=this.style.minimumClusterSize;},c.prototype.setType=function(h){this.style.type=h;},c.prototype.setSelectById=function(h,d){if(this.layer){let m=this.layer.entities.getById(h);m&&(m.billboard.image=d?this.style.selectImage:this.style.image);}},c.prototype.getEntityById=function(h){return this.layer.entities.getById(h)},c.prototype.clear=function(){this.cluserCanvasImages={},this.layer&&this.layer.entities.removeAll();},e.Scene.ClusterLayer=c;}},_installBar3DLayer:function(){if(this._viewer){let r=function(d,m){return typeof d!="object"&&(d={}),Array.isArray(m)?m.slice():(Object.keys(m).forEach(y=>{let p=m[y];typeof p=="object"?d[y]=r(d[y],p):d[y]=p;}),d)},h=function(d){this.barLayer=null,this.config=r(c,d||{}),this._init();};let o=this._viewer,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFCElEQVR4AexWWUjuVRCfz12v+5L7mqKmoqaCae744oJL+qKiSQgRET710Ms1CALlopIP6oNJoiCICylCoJQhKmIppKLmVi647+un2PzO9f/xrZp1I4r78c2ZOefMnPmdOXPm/PXoX/69BvDfikBFRYVlXV3dIPM7UHV19XF9ff1QS0vLj5WVlTdVVVXyhoaG35+SVn8qAo2NjWWtra0dJiYm27u7u0kREREEsrS0tDg6OopbW1t718XFRT8gIMBgc3PTrba2dpeBHjQ1Nf3S1tbW8hCgRwHU1NTMbmxsNC4sLLx3eXlpHBcXJ5wDAPfJ1taWcnJ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fIPMQ4CksBirq68nKL/Iy/x6E3EC5wdD5w+0eRr4FX15DbuDV4KAbyckrGxp/hdyAyWqV+KednwmpgaKyssdjNht5lN+cT8nv+RmY8bgH+D+ZG2ElUple3wN6Y/X6Pmle3mvQL8nNHQCD0TrdEKfTDXNa7XuxVjtCuGc2xyF6L3gJFhRt4Gpq9yNF8jOjwJe27596sJLz43b7OXD2m91+xjY5eRqcmnA4ToLjdqezeMrpPIaCc9jhch0iIGM66AR/FG2AvK2QkktzFGcgNZwVhC0u2sDivw7i6FIhPwEAAP//c8uOZAAAAAZJREFUAwAS2vhBEdJeLwAAAABJRU5ErkJggg==",c={duration:2e3,loop:false,boxWidth:4e4,boxDepth:4e4,icon:true,iconUrlArr:[],labelShow:true,label:{font:"bold 24px Arial",fillColor:e.Color.WHITE,showBackground:true,verticalOrigin:e.VerticalOrigin.BOTTOM,pixelOffset:new e.Cartesian2(0,0)},billboard:{width:25,height:25,pixelOffset:new e.Cartesian2(-35,0)}};h.prototype._init=function(){this.barLayer=new e.CustomDataSource("threeDimensionalBarLayer"),o.dataSources.add(this.barLayer);},h.prototype._findWeight=function(d){let m=Math.max(...d),y=Math.min(...d);return {max:m,min:y}},h.prototype._limitNumberWithinRange=function(d,m,y){let p=m||1,g=y||20,v=parseInt(d);return Math.min(Math.max(v,p),g)},h.prototype.addDataToLayer=function(d){let{barData:m,numField:y="count",multiple:p}=d,{max:g,min:v}=this._findWeight(m.map(C=>C[y])),A=this.config.iconUrlArr;A.length>0&&A.length<3&&(A.length<2?(A[1]=A[0],A[2]=A[0]):A.length<3&&(A[2]=A[0]));let w=(g-v)/2;m.forEach((C,b)=>{let P=C[y],_=null;this.config.icon&&(C.iconUrl?_=C.iconUrl:_=P>=g?A[0]||l:P>=P*(w/P/100)?A[1]||s:A[2]||i);let S=P>w?P*(w/P/100):(w-P)/100*5,I=1;e.defined(p)?I=p:I=this._limitNumberWithinRange(S,v,w),this._add3DBarWithIcon({id:C.name+b,value:P,color:C.color,imgSrc:_,position:C.center,weight:I});});},h.prototype.clear=function(){this.barLayer&&this.barLayer.entities.removeAll();},h.prototype._add3DBarWithIcon=function({id:d,value:m,color:y,imgSrc:p,position:g,weight:v=1}){let A=this,w=A.barLayer.entities.getById(d+"-icon");w&&A.barLayer.entities.remove(w);let C=A.config.boxWidth,b=A.config.boxDepth,P=m*v,_=0,S=0,I=null;y instanceof e.Color?I=y:I=e.Color.fromCssColorString(y).withAlpha(.85),A.barLayer.entities.add({id:d+"-bar",name:"3DBar",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],S/2)},false),box:{dimensions:new e.CallbackProperty(function(){return new e.Cartesian3(C,b,S)},false),material:I,outline:false},show:true});let x=null;y instanceof e.Color?x=y:x=e.Color.fromCssColorString(y).withAlpha(.7),A.config.labelShow&&A.barLayer.entities.add({id:d+"-label",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],S+3e3)},false),label:{text:m+"",backgroundColor:x,...A.config.label},show:true}),A.config.icon&&A.barLayer.entities.add({id:d+"-icon",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],S+22e3)},false),billboard:{image:p,...A.config.billboard},show:true});function M(){S=_+=A.config.duration,(A.config.loop||_<P)&&requestAnimationFrame(M);}M();},e.Scene.ThreeDimensionalBar=h;}},transformJD(a,n){var o=300+a+2*n+.1*a*a+.1*a*n+.1*Math.sqrt(Math.abs(a));return o+=(20*Math.sin(6*a*ve)+20*Math.sin(2*a*ve))*2/3,o+=(20*Math.sin(a*ve)+40*Math.sin(a/3*ve))*2/3,o+=(150*Math.sin(a/12*ve)+300*Math.sin(a/30*ve))*2/3,o},transformWD(a,n){var o=-100+2*a+3*n+.2*n*n+.1*a*n+.2*Math.sqrt(Math.abs(a));return o+=(20*Math.sin(6*a*ve)+20*Math.sin(2*a*ve))*2/3,o+=(20*Math.sin(n*ve)+40*Math.sin(n/3*ve))*2/3,o+=(160*Math.sin(n/12*ve)+320*Math.sin(n*ve/30))*2/3,o},gcj2wgs(a){var n=Number(a[0]),o=Number(a[1]),r=this.transformWD(n-105,o-35),i=this.transformJD(n-105,o-35),s=o/180*ve,l=Math.sin(s);l=1-xt*l*l;var c=Math.sqrt(l);r=r*180/(Pt*(1-xt)/(l*c)*ve),i=i*180/(Pt/c*Math.cos(s)*ve);var h=o+r,d=n+i,m=n*2-d,y=o*2-h;return m=Number(m.toFixed(6)),y=Number(y.toFixed(6)),[m,y]},wgs2gcj(a){var n=Number(a[0]),o=Number(a[1]),r=this.transformWD(n-105,o-35),i=this.transformJD(n-105,o-35),s=o/180*ve,l=Math.sin(s);l=1-xt*l*l;var c=Math.sqrt(l);r=r*180/(Pt*(1-xt)/(l*c)*ve),i=i*180/(Pt/c*Math.cos(s)*ve);var h=o+r,d=n+i;return d=Number(d.toFixed(6)),h=Number(h.toFixed(6)),[d,h]},transformData(a,n,o){for(var r=this,i=o.paths,s=[],l=function(d){for(var m=i[d],y=[],p=[],g=m.distance,v=0;v<m.steps.length;v++){var A=m.steps[v],w=m.steps[v].instruction,C=A.polyline;C=C.split(";"),C.forEach(function(b){b=b.split(","),b=r.gcj2wgs(b),y.push([b[0],b[1]]);}),p.push(w);}y.unshift(a),y.push(n),s.push({lnglats:y,instructions:p,distance:g});},c=0;c<i.length;c++)l(c);return s},_queryDrivingRoute(a,n,o,r){if(n=n||{},!n.origin){alert("\u7F3A\u5C11\u8D77\u70B9\u5750\u6807\uFF01");return}if(!n.destination){alert("\u7F3A\u5C11\u7EC8\u70B9\u5750\u6807\uFF01");return}var i=n.key||this._queryRouteKey;delete n.key;var s=n.origin,l=this.wgs2gcj(s),c=l[0]+","+l[1];delete n.origin;var h=n.destination,d=this.wgs2gcj(h),m=d[0]+","+d[1];delete n.destination;var y="";if(n.avoidpolygons)for(var p=0;p<n.avoidpolygons.length;p++){for(var g=n.avoidpolygons[p],v="",A="",w=0;w<g.length;w++){var C=g[w];C=this.wgs2gcj(C),A+=C[0]+","+C[1]+",",w==0&&(v=C[0]+","+C[1]);}A=A+v,p==n.avoidpolygons.length-1?y+=A:y+=A+"|";}delete n.avoidpolygons;var b={key:i,origin:c,destination:m,strategy:0,avoidpolygons:y,show_fields:"polyline"};b=Object.assign(b,n||{});var P=this;let _="";Object.keys(b).map(S=>{_?_+=`&${S}=${b[S]}`:_+=`?${S}=${b[S]}`;}),fetch(a+_).then(function(S){return S.json()}).then(function(S){if(S.status!="1"||S.infocode!="10000"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01"),r&&r(S);return}var I=P.transformData(s,h,S.route);o&&o(I);});},queryPathPlan(a,n,o,r){let i;a===f.routeQueryType.DRIVE?(i=n.url||"https://restapi.amap.com/v5/direction/driving",delete n.url,this._queryDrivingRoute(i,n,o,r)):a===f.routeQueryType.WALK?(i=n.url||"https://restapi.amap.com/v3/direction/walking",delete n.url,this._queryWalkCycleRoute(i,n,o,r)):a===f.routeQueryType.CYCLE?(i=n.url||"https://restapi.amap.com/v5/direction/bicycling",delete n.url,this._queryWalkCycleRoute(i,n,o,r)):alert("\u67E5\u8BE2\u53C2\u6570type \u9519\u8BEF\uFF08walk:\u6B65\u884C\uFF0Ccycle:\u9A91\u884C\uFF09\uFF01");},_queryWalkCycleRoute(a,n,o,r){if(n=n||{},!n.origin){alert("\u7F3A\u5C11\u8D77\u70B9\u5750\u6807\uFF01");return}if(!n.destination){alert("\u7F3A\u5C11\u7EC8\u70B9\u5750\u6807\uFF01");return}var i=n.key||this._queryRouteKey;delete n.key;var s=n.origin;this.wgs2gcj(s);var l=s[0]+","+s[1];delete n.origin;var c=n.destination;this.wgs2gcj(c);var h=c[0]+","+c[1];delete n.destination;var d={key:i,origin:l,destination:h,show_fields:"polyline"};d=Object.assign(d,n||{});var m=this;let y="";var p;Object.keys(d).map(g=>{y?y+=`&${g}=${d[g]}`:y+=`?${g}=${d[g]}`;}),fetch(a+y).then(function(g){return g.json()}).then(function(g){if(g.hasOwnProperty("errcode")){if(g.errcode!=0||g.errmsg!="OK"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01",g.errdetail),r&&r(g);return}p=m.transformData(s,c,g.data),o&&o(p);}else if(g.hasOwnProperty("status")){if(g.status!="1"||g.infocode!="10000"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01",g.info),r&&r(g);return}p=m.transformData(s,c,g.route),o&&o(p);}else {console.log("\u67E5\u8BE2\u5931\u8D25,\u672A\u77E5\u9519\u8BEF\uFF01"),r&&r(g);return}});}},f}var Ne=re(br);function _r(){let e=null,f=null;async function a(){return f||(f=await en()),f}let n=function(l,c,h){if(l){this._viewer=l,e=c,this._analysisLayer=new e.CustomDataSource("analysisLayer"),je(Te,ee),je(pe,ee),this.$math3d=new Te(l,c),this.$graphics=new pe(l,c),l&&l.dataSources.add(this._analysisLayer);let d=this._analysisLayer,m=this.$graphics,y=this.$math3d;se(this),oe(this,()=>{Ce(m),Ce(y),this._viewer&&d&&(this._viewer.dataSources.remove(d,true),this._analysisLayer===d&&(this._analysisLayer=void 0));});}};n.prototype={createVisibilityAnalysis:function(l){l=l||{};var c=this;c.drawLineGraphics({type:"straightLine",clampToGround:false,callback:function(h,d){var m=new o({positions:h,that:c});c._graphicsLayer&&c._graphicsLayer.entities.remove(d),typeof l.callback=="function"&&l.callback(m);}});},createLookAroundAnalysis:function(l){if(l=l||{},this._viewer&&l){var c=this;c.drawCircleGraphics({callback:function(h,d){c._drawLayer.entities.remove(d);let m=new r({that:c,radius:h.radius,center:h.center});typeof l.callback=="function"&&l.callback(m);}});}},createVisualFieldAnalysis:function(l){if(l=l||{},this._viewer&&l){var c=this,h=null;c.bindHandleEvent({leftClick:(function(m,y){var p=c._viewer.scene.pickPosition(m.position);p&&(e.defined(h)?(y.destroy(),y=null):(h=new e.Scene.ShadowPrimitive({scene:c._viewer.scene,viewerPosition:p}),c._analysisLayer._primitives.add(h)));}),mouseMove:(function(m){var y=c._viewer.scene.pickPosition(m.endPosition);y&&h&&h.setPoseByTargetPoint(y);})});}},createClipPlanAnalysis:function(l){if(l=l||{},this._viewer&&l){var c=this,h=l.height||30,d=l.splitNum||50,m=l.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",y=l.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg";c.drawPolygonGraphics({callback:function(p,g){c._drawLayer.entities.remove(g);let v=e.Cartesian3.fromDegreesArrayHeights(zt(p)),A=new e.Scene.TerrainClipPlan(c._viewer,{height:h,splitNum:d,wallImg:m,bottomImg:y});A.updateData(v),typeof l.callback=="function"&&l.callback(A);}});}},createSubmergedAnalysis:function(l){if(l=l||{},this._viewer&&l){var c=this,h=l.maxH||15,d=l.speed||1,m=l.interval||10,y=l.matrialUrl||this.getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png";c.drawPolygonGraphics({height:1,callback:function(p,g){if(!c._viewer.scene.globe.depthTestAgainstTerrain)return alert("\u8BF7\u5F00\u542F\u6DF1\u5EA6\u68C0\u6D4B"),false;if(g){let v=g;setTimeout(()=>{v.polygon.heightReference=e.HeightReference.CLAMP_TO_GROUND,v.polygon.material=y;var A=0;v.polygon.extrudedHeight=A;var w=setInterval(function(){A=A+d,A>=h&&(A=h,clearTimeout(w)),v.polygon.extrudedHeight=A;},m);},2e3);}}});}},createSlopeAnalysis:function(l){l=l||{};var c=this;this._viewer&&l&&c.drawLineGraphics({type:"straightLine",clampToGround:false,callback:async function(h,d){await a();var m=new i({positions:h,that:c});c._graphicsLayer&&c._graphicsLayer.entities.remove(d),typeof l.callback=="function"&&l.callback(m);}});},createCutVolumeAnalysis:function(l){if(l=l||{},this._viewer&&l){var c=this;c.drawWallGraphics({callback:function(h){var d=new s({positions:e.Cartesian3.fromDegreesArrayHeights(zt(h)),that:c});typeof l.callback=="function"&&l.callback(d);}});}}};function o(l){if(l&&l.positions){let C=function(){for(let x=0;x<v.length;++x){var P=v[x].object;if(P){if(P instanceof e.Cesium3DTileFeature)y.push(P),P.oldColor=P.color.clone(),P.color=e.Color.fromAlpha(e.Color.YELLOW,P.color.alpha);else if(P.id instanceof e.Entity){var _=P.id,S=_.polygon||_.polyline;y.push(_);var I=S.material.color.getValue();S.oldColor=I.clone(),S.material=e.Color.fromAlpha(e.Color.YELLOW,I.alpha);}}d.push(h._analysisLayer.entities.add({position:v[x].position,ellipsoid:{radii:new e.Cartesian3(.8,.8,.8),material:e.Color.RED}}));}},b=function(){for(let k=v.length-1;k>=0;k--){let G=v[k];e.defined(G.position)||v.splice(k,1);}if(!e.defined(v[0].position))throw new e.DeveloperError("position is undefined");var P=v[0].position,_=e.Cartesian3.distance(P,g),S=_<5,I=[p,v[0].position],x=h._analysisLayer.entities.add({polyline:{positions:I,width:10,arcType:e.ArcType.NONE,material:new e.PolylineArrowMaterialProperty(e.Color.GREEN)}});if(m.push(x),!S){var M=[v[0].position,g],T=h._analysisLayer.entities.add({polyline:{positions:M,width:10,arcType:e.ArcType.NONE,material:new e.PolylineArrowMaterialProperty(e.Color.RED)}});m.push(T);}C();var E=e.Cartographic.fromCartesian(p),R=e.Cartographic.fromCartesian(g),O={longitude:E.longitude/Math.PI*180,latitude:E.latitude/Math.PI*180,height:E.height},U={longitude:R.longitude/Math.PI*180,latitude:R.latitude/Math.PI*180,height:R.height},z=Math.sqrt(Math.pow(p.x-g.x,2)+Math.pow(p.y-g.y,2)+Math.pow(p.z-g.z,2)),V=Math.abs(U.height-O.height),j=Math.sqrt(Math.pow(z,2)+Math.pow(V,2)),H=S?"\u662F":"\u5426",q="\u8D77\u70B9\u5750\u6807: "+(" ("+O.longitude.toFixed(6))+"\xB0,"+O.latitude.toFixed(6)+"\xB0,"+O.height.toFixed(2)+`)
1025
+ \u7EC8\u70B9\u5750\u6807: `+(" ("+U.longitude.toFixed(6))+"\xB0,"+U.latitude.toFixed(6)+"\xB0,"+U.height.toFixed(2)+`)
1026
+ \u5782\u76F4\u8DDD\u79BB: `+V.toFixed(2)+`m
1027
1027
  \u6C34\u5E73\u8DDD\u79BB: `+z.toFixed(2)+`m
1028
- \u7A7A\u95F4\u8DDD\u79BB: `+X.toFixed(2)+`m
1029
- \u662F\u5426\u53EF\u89C6: `+j;d&&d[0]&&(d[0].label={text:K,showBackground:true,font:"14px monospace",fillColor:e.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:e.VerticalOrigin.BOTTOM,horizontalOrigin:e.HorizontalOrigin.LEFT});};var c=s.positions,u=s.that,d=[],m=[],f=[],p=c[0],g=c[1];d=u.$graphics.createPointsGraphics({point:true,positions:[p,g]});var v=u.$math3d.getIntersectObj(p,g,d,true);if(!v||v.length===0)return alert("\u6CA1\u6709\u53D6\u5230\u76F8\u4EA4\u70B9 , \u8BF7\u68C0\u67E5\u662F\u5426\u5F00\u542F\u6DF1\u5EA6\u68C0\u6D4B\u3002"),false;_();}a.prototype.remove=function(){};}function r(s){if(!s&&!s.center&&!s.radius&&s.that)return alert("\u6CA1\u6709\u83B7\u53D6\u5230\u5206\u6790\u53C2\u6570"),false;var c=s.that,u=this;if(!c._viewer.scene.globe.depthTestAgainstTerrain)return alert("\u8BF7\u5F00\u542F\u6DF1\u5EA6\u68C0\u6D4B"),false;var d=s.viewHeight||10,m=e.Cartographic.fromCartesian(s.center);try{var f=s.radius,p={semiMinorAxis:f,semiMajorAxis:f,rotation:0,center:s.center,granularity:Math.PI/30};let g=c.computeEllipseEdgePositions(p);for(let v=0;v<g.outerPositions.length;v+=3){let A=new e.Cartesian3(g.outerPositions[v],g.outerPositions[v+1],g.outerPositions[v+2]),w=e.Cartographic.fromCartesian(A),C=5e-4*Math.PI/180,_=c.computeInterpolateLineCartographic(m,w,C);c.computeCartographicPointsTerrainData(_||[],function(P){if(P.length>0){let b=!0,x=[],T=[];for(let S=1;S<P.length;S++){let M=!0;if(S>1){let I=new e.Cartographic(P[0].longitude,P[0].latitude,P[0].height+d);if(b)c.computeInterpolateIndexLineHeightCartographic(I,P[S],S,S-1).height>=P[S-1].height?(b=!0,M=!0):(b=!1,M=!1);else {let D=c.computeInterpolateIndexLineHeightCartographic(I,P[S],S,S-1);for(let V=0;V<D.length;V++)if(D[V].height>=P[V].height)b=!0,M=!0;else {b=!1,M=!1;break}}}let E=e.Cartesian3.fromRadians(P[S].longitude,P[S].latitude,P[S].height+1);x.push(E),M?(T.push(0),T.push(0),T.push(1),T.push(1)):(T.push(1),T.push(0),T.push(0),T.push(1));}u._pointsKSYResult=new e.Scene.PointsPrimitive({viewer:c._viewer,Cartesians:x,Colors:T});}else alert("\u9AD8\u7A0B\u5F02\u5E38\uFF01");});}}catch(g){console.log(g);}r.prototype.remove=function(){};}function i(s){if(s&&s.positions){let p=function(g,v){for(var A=e.Cartographic.fromCartesian(g),w=[A],C=10,_=new e.Cartesian3,P=[0],b=[0],x=0,T=1;T<=C;T++){e.Cartesian3.lerp(g,v,T/C,_);var S=e.Cartographic.fromCartesian(_),M=u._viewer.scene.globe.getHeight(S);S.height=M,w.push(S);var E=w[T-1],I=e.Cartesian3.distance(e.Cartographic.toCartesian(E),e.Cartographic.toCartesian(S));b.push(b[T-1]+I),x=Math.asin((S.height-E.height)/I),P.push(Math.tan(x)*100);}var D=document.createElement("div");D.className="echart-viewer",u._viewer.container.appendChild(D),D.style.position="absolute",D.style.left="20px",D.style.bottom="20px",D.style.height="300px",D.style.width="640px",D.style.overflow="hidden",D.style.zIndex="9999",D.style.opacity="0.9";var V=y.init(D),W={title:{text:"\u5256\u9762\u793A\u610F\u56FE",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:false,feature:{mark:{show:true},dataView:{show:true,readOnly:false},magicType:{show:true,type:["line","bar"]},restore:{show:true},saveAsImage:{show:true}}},calculable:true,xAxis:[{type:"category",name:"\u957F\u5EA6(\u7C73)",boundaryGap:false,data:b,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"\u5761\u5EA6\uFF08%\uFF09",axisLabel:{formatter:function(z){return z.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"\u5761\u5EA6",type:"line",areaStyle:{},smooth:true,data:P,markPoint:{data:[{type:"max",name:"\u6700\u5927\u503C"},{type:"min",name:"\u6700\u5C0F\u503C"}]},markLine:{data:[{type:"average",name:"\u5E73\u5747\u503C"}]}}]};return V.setOption(W),V};var c=s.positions,u=s.that,d=c[0],m=c[1];p(d,m);}i.prototype.remove=function(){};}function l(s){if(s&&s.positions&&s.that){var c=s.that,u=s.positions,d=true,m=this;g(u);}function f(v){for(var A=[],w=[],C=0;C<v.length;C++){var _=e.Cartographic.fromCartesian(v[C]);A.push(_.longitude),w.push(_.latitude);}var P=0,b=0,x=0,T=0,S=0,M=0,E=0,I=0;for(C=0;C<v.length;C++)P=A[C],b=w[C],C==v.length-1?(x=A[0],T=w[0]):(x=A[C+1],T=w[C+1]),M=P*T-x*b,S+=M,E+=(P+x)*M,I+=(b+T)*M;return S*=.5,E/=6*S,I/=6*S,new e.Cartographic(E,I)}function p(v,A,w){var C=e.Cartesian3.distance(v,A),_=e.Cartesian3.distance(A,w),P=e.Cartesian3.distance(w,v),b=(C+_+P)/2;return Math.sqrt(b*(b-C)*(b-_)*(b-P))}function g(v){var A=c._viewer.terrainProvider.availability;if(!A)return alert("\u672A\u83B7\u53D6\u5230\u5730\u5F62"),false;var C=15e3,_=Math.PI/Math.pow(2,11);_=_/64;var P=e.PolygonGeometry.fromPositions({positions:v,vertexFormat:e.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:_}),b=e.PolygonGeometry.createGeometry(P),x=0,T=0,S,M,E,I,D,V,W,z,G,X,j,K,R=new e.Cartesian3,O,q,Z;for(let ve=0;ve<b.indices.length;ve+=3)if(S=b.indices[ve],M=b.indices[ve+1],E=b.indices[ve+2],Z=b.attributes.position.values,R.x=Z[S*3],R.y=Z[S*3+1],R.z=Z[S*3+2],O=e.Cartographic.fromCartesian(R),I=c._viewer.scene.globe.getHeight(O),W=e.Cartesian3.fromRadians(O.longitude,O.latitude,I),X=e.Cartesian3.fromRadians(O.longitude,O.latitude,0),T<I&&(T=I),R.x=Z[M*3],R.y=Z[M*3+1],R.z=Z[M*3+2],O=e.Cartographic.fromCartesian(R),D=c._viewer.scene.globe.getHeight(O),z=e.Cartesian3.fromRadians(O.longitude,O.latitude,D),j=e.Cartesian3.fromRadians(O.longitude,O.latitude,0),T<D&&(T=D),R.x=Z[E*3],R.y=Z[E*3+1],R.z=Z[E*3+2],O=e.Cartographic.fromCartesian(R),V=c._viewer.scene.globe.getHeight(O),G=e.Cartesian3.fromRadians(O.longitude,O.latitude,V),K=e.Cartesian3.fromRadians(O.longitude,O.latitude,0),T<V&&(T=V),q=p(X,j,K),x=x+q*(I-C+D-C+V-C)/3,d){var le=[];le.push(W),le.push(z),le.push(G);var ie={polygon:{hierarchy:{positions:le},extrudedHeight:0,perPositionHeight:true,material:e.Color.fromRandom().withAlpha(.5),outline:true,closeTop:true,closeBottom:true,outlineColor:e.Color.WHITE,outlineWidth:2}};c._analysisLayer.entities.add(ie);}var ce=f(v);return m._volumeLabel=c._analysisLayer.entities.add({position:e.Cartesian3.fromRadians(ce.longitude,ce.latitude,T+1e3),label:{text:"Cut Volume "+x.toString()+"m3"}}),T}l.prototype.remove=function(){};}return n}var ft=re(yr);var Ee={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},pr={},k={PlotUtils:pr,Constants:Ee};k.PlotUtils.distance=function(e,h){return Math.sqrt(Math.pow(e[0]-h[0],2)+Math.pow(e[1]-h[1],2))};k.PlotUtils.wholeDistance=function(e){let h=0;for(let y=0;y<e.length-1;y++)h+=k.PlotUtils.distance(e[y],e[y+1]);return h};k.PlotUtils.getBaseLength=function(e){return Math.pow(k.PlotUtils.wholeDistance(e),.99)};k.PlotUtils.mid=function(e,h){return [(e[0]+h[0])/2,(e[1]+h[1])/2]};k.PlotUtils.getCircleCenterOfThreePoints=function(e,h,y){let o=[(e[0]+h[0])/2,(e[1]+h[1])/2],n=[o[0]-e[1]+h[1],o[1]+e[0]-h[0]],a=[(e[0]+y[0])/2,(e[1]+y[1])/2],r=[a[0]-e[1]+y[1],a[1]+e[0]-y[0]];return k.PlotUtils.getIntersectPoint(o,n,a,r)};k.PlotUtils.getIntersectPoint=function(e,h,y,o){let n,a,r,i;return e[1]==h[1]?(i=(o[0]-y[0])/(o[1]-y[1]),n=i*(e[1]-y[1])+y[0],a=e[1],[n,a]):y[1]==o[1]?(r=(h[0]-e[0])/(h[1]-e[1]),n=r*(y[1]-e[1])+e[0],a=y[1],[n,a]):(r=(h[0]-e[0])/(h[1]-e[1]),i=(o[0]-y[0])/(o[1]-y[1]),a=(r*e[1]-e[0]-i*y[1]+y[0])/(r-i),n=r*a-r*e[1]+e[0],[n,a])};k.PlotUtils.getAzimuth=function(e,h){let y=0,o=Math.asin(Math.abs(h[1]-e[1])/k.PlotUtils.distance(e,h));return h[1]>=e[1]&&h[0]>=e[0]?y=o+Math.PI:h[1]>=e[1]&&h[0]<e[0]?y=Ee.TWO_PI-o:h[1]<e[1]&&h[0]<e[0]?y=o:h[1]<e[1]&&h[0]>=e[0]&&(y=Math.PI-o),y};k.PlotUtils.getAngleOfThreePoints=function(e,h,y){let o=k.PlotUtils.getAzimuth(h,e)-k.PlotUtils.getAzimuth(h,y);return 0>o?o+Ee.TWO_PI:o};k.PlotUtils.isClockWise=function(e,h,y){return (y[1]-e[1])*(h[0]-e[0])>(h[1]-e[1])*(y[0]-e[0])};k.PlotUtils.getPointOnLine=function(e,h,y){let o=h[0]+e*(y[0]-h[0]),n=h[1]+e*(y[1]-h[1]);return [o,n]};k.PlotUtils.getCubicValue=function(e,h,y,o,n){e=Math.max(Math.min(e,1),0);let a=1-e,r=e*e,i=r*e,l=a*a,s=l*a,c=s*h[0]+3*l*e*y[0]+3*a*r*o[0]+i*n[0],u=s*h[1]+3*l*e*y[1]+3*a*r*o[1]+i*n[1];return [c,u]};k.PlotUtils.getThirdPoint=function(e,h,y,o,n){let a=k.PlotUtils.getAzimuth(e,h),r=n?a+y:a-y,i=o*Math.cos(r),l=o*Math.sin(r);return [h[0]+i,h[1]+l]};k.PlotUtils.getArcPoints=function(e,h,y,o){let n,a,r=[],i=o-y;i=0>i?i+Ee.TWO_PI:i;for(let l=0;l<=Ee.FITTING_COUNT;l++){let s=y+i*l/Ee.FITTING_COUNT;n=e[0]+h*Math.cos(s),a=e[1]+h*Math.sin(s),r.push([n,a]);}return r};k.PlotUtils.getBisectorNormals=function(e,h,y,o){let n,a,r=k.PlotUtils.getNormal(h,y,o),i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),l=r[0]/i,s=r[1]/i,c=k.PlotUtils.distance(h,y),u=k.PlotUtils.distance(y,o),d,m,f;return i>Ee.ZERO_TOLERANCE?k.PlotUtils.isClockWise(h,y,o)?(d=e*c,m=y[0]-d*s,f=y[1]+d*l,n=[m,f],d=e*u,m=y[0]+d*s,f=y[1]-d*l,a=[m,f]):(d=e*c,m=y[0]+d*s,f=y[1]-d*l,n=[m,f],d=e*u,m=y[0]-d*s,f=y[1]+d*l,a=[m,f]):(m=y[0]+e*(h[0]-y[0]),f=y[1]+e*(h[1]-y[1]),n=[m,f],m=y[0]+e*(o[0]-y[0]),f=y[1]+e*(o[1]-y[1]),a=[m,f]),[n,a]};k.PlotUtils.getNormal=function(e,h,y){let o=e[0]-h[0],n=e[1]-h[1],a=Math.sqrt(o*o+n*n);o/=a,n/=a;let r=y[0]-h[0],i=y[1]-h[1],l=Math.sqrt(r*r+i*i);r/=l,i/=l;let s=o+r,c=n+i;return [s,c]};k.PlotUtils.getCurvePoints=function(e,h){let y,o,n,a,i=[k.PlotUtils.getLeftMostControlPoint(h)],l=0;for(l=0;l<h.length-2;l++)y=h[l],o=h[l+1],n=h[l+2],a=k.PlotUtils.getBisectorNormals(e,y,o,n),i=i.concat(a);let s=k.PlotUtils.getRightMostControlPoint(h);i.push(s);let c=[];for(l=0;l<h.length-1;l++){y=h[l],o=h[l+1],c.push(y);for(let u=0;u<Ee.FITTING_COUNT;u++){let d=k.PlotUtils.getCubicValue(u/Ee.FITTING_COUNT,y,i[2*l],i[2*l+1],o);c.push(d);}c.push(o);}return c};k.PlotUtils.getLeftMostControlPoint=function(e){let h=e[0],y=e[1],o=e[2],a=k.PlotUtils.getBisectorNormals(0,h,y,o)[0],r=k.PlotUtils.getNormal(h,y,o),i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),l,s;if(i>Ee.ZERO_TOLERANCE){let c=k.PlotUtils.mid(h,y),u=h[0]-c[0],d=h[1]-c[1],f=2/k.PlotUtils.distance(h,y),p=-f*d,g=f*u,v=p*p-g*g,A=2*p*g,w=g*g-p*p,C=a[0]-c[0],_=a[1]-c[1];l=c[0]+v*C+A*_,s=c[1]+A*C+w*_;}else l=h[0]+t*(y[0]-h[0]),s=h[1]+t*(y[1]-h[1]);return [l,s]};k.PlotUtils.getRightMostControlPoint=function(e){let h=e.length,y=e[h-3],o=e[h-2],n=e[h-1],r=k.PlotUtils.getBisectorNormals(0,y,o,n)[1],i=k.PlotUtils.getNormal(y,o,n),l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s,c;if(l>Ee.ZERO_TOLERANCE){let u=k.PlotUtils.mid(o,n),d=n[0]-u[0],m=n[1]-u[1],p=2/k.PlotUtils.distance(o,n),g=-p*m,v=p*d,A=g*g-v*v,w=2*g*v,C=v*v-g*g,_=r[0]-u[0],P=r[1]-u[1];s=u[0]+A*_+w*P,c=u[1]+w*_+C*P;}else s=n[0]+t*(o[0]-n[0]),c=n[1]+t*(o[1]-n[1]);return [s,c]};k.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;let h=[],y=e.length-1;for(let o=0;1>=o;o+=.01){let n=0,a=0;for(let r=0;y>=r;r++){let i=k.PlotUtils.getBinomialFactor(y,r),l=Math.pow(o,r),s=Math.pow(1-o,y-r);n+=i*l*s*e[r][0],a+=i*l*s*e[r][1];}h.push([n,a]);}return h.push(e[y]),h};k.PlotUtils.getBinomialFactor=function(e,h){return k.PlotUtils.getFactorial(e)/(k.PlotUtils.getFactorial(h)*k.PlotUtils.getFactorial(e-h))};k.PlotUtils.getFactorial=function(e){if(1>=e)return 1;if(e==2)return 2;if(e==3)return 6;if(e==4)return 24;if(e==5)return 120;let h=1;for(let y=1;e>=y;y++)h*=y;return h};k.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;let h=2,y=[],o=e.length-h-1;y.push(e[0]);for(let n=0;o>=n;n++)for(let a=0;1>=a;a+=.05){let r=0,i=0;for(let l=0;h>=l;l++){let s=k.PlotUtils.getQuadricBSplineFactor(l,a);r+=s*e[n+l][0],i+=s*e[n+l][1];}y.push([r,i]);}return y.push(e[e.length-1]),y};k.PlotUtils.getQuadricBSplineFactor=function(e,h){return e==0?Math.pow(h-1,2)/2:e==1?(-2*Math.pow(h,2)+2*h+1)/2:e==2?Math.pow(h,2)/2:0};var te={version:"1.0.0",createTime:"2018.6.19",author:"xupinhui",algorithm:{}},et={headHeightFactor:.25,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15},xt={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},yt={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};te.algorithm.doubleArrow=function(e,h){let y=e,o={controlPoint:null,polygonalPoint:null},n=e.length;if(!(2>n)){if(n==2)return e;let a=y[0],r=y[1],i=y[2],l;n==3?l=te.algorithm.getTempPoint4(a,r,i):l=y[3];let s;n==3||n==4?s=k.PlotUtils.mid(a,r):s=y[4];let c,u;k.PlotUtils.isClockWise(a,r,i)?(c=te.algorithm.getArrowPoints(a,s,l,false),u=te.algorithm.getArrowPoints(s,r,i,true)):(c=te.algorithm.getArrowPoints(r,s,i,false),u=te.algorithm.getArrowPoints(s,a,l,true));let d=c.length,m=(d-5)/2,f=c.slice(0,m),p=c.slice(m,m+5),g=c.slice(m+5,d),v=u.slice(0,m),A=u.slice(m,m+5),w=u.slice(m+5,d);v=k.PlotUtils.getBezierPoints(v);let C=k.PlotUtils.getBezierPoints(w.concat(f.slice(1)));g=k.PlotUtils.getBezierPoints(g);let _=v.concat(A,C,p,g),P=te.algorithm.array2Dto1D(_);o.controlPoint=[a,r,i,l,s],o.polygonalPoint=h.Cartesian3.fromDegreesArray(P);}return o};te.algorithm.threeArrow=function(e){let h=e,y={controlPoint:null,polygonalPoint:null},o=e.length;if(o>=2){if(o==2)return e;let n=h[0],a=h[1],r=h[2],i,l;o==3?(i=te.algorithm.getTempPoint4(n,a,r),l=k.PlotUtils.mid(r,i)):(i=h[3],l=h[4]);let s;o<6?s=k.PlotUtils.mid(n,a):s=h[5];let c,u;k.PlotUtils.isClockWise(n,a,r)?(c=te.algorithm.getArrowPoints(n,s,i,false),u=te.algorithm.getArrowPoints(s,a,r,true)):(c=te.algorithm.getArrowPoints(a,s,r,false),u=te.algorithm.getArrowPoints(s,n,i,true));let d=c.length,m=(d-5)/2,f=c.slice(0,m),p=c.slice(m,m+5),g=c.slice(m+5,d),v=u.slice(0,m),A=u.slice(m,m+5),w=u.slice(m+5,d);v=k.PlotUtils.getBezierPoints(v);let C=k.PlotUtils.getBezierPoints(w.concat(f.slice(1)));g=k.PlotUtils.getBezierPoints(g);let _=v.concat(A,C,p,g),P=te.algorithm.array2Dto1D(_);y.controlPoint=[n,a,r,i,l,s],y.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(P);}return y};te.algorithm.array2Dto1D=function(e){let h=[];return e.forEach(function(y){h.push(y[0]),h.push(y[1]);}),h};te.algorithm.getArrowPoints=function(e,h,y,o){let n=et.headHeightFactor,a=et.headWidthFactor,r=et.neckHeightFactor,i=et.neckWidthFactor,l=k.PlotUtils.mid(e,h),s=k.PlotUtils.distance(l,y),c=k.PlotUtils.getThirdPoint(y,l,0,.3*s,true),u=k.PlotUtils.getThirdPoint(y,l,0,.5*s,true);c=k.PlotUtils.getThirdPoint(l,c,k.Constants.HALF_PI,s/5,o),u=k.PlotUtils.getThirdPoint(l,u,k.Constants.HALF_PI,s/4,o);let d=[l,c,u,y],m=te.algorithm.getArrowHeadPoints(d,n,a,r,i),f=m[0],p=m[4],g=k.PlotUtils.distance(e,h)/k.PlotUtils.getBaseLength(d)/2,v=te.algorithm.getArrowBodyPoints(d,f,p,g),A=v.length,w=v.slice(0,A/2),C=v.slice(A/2,A);return w.push(f),C.push(p),w=w.reverse(),w.push(h),C=C.reverse(),C.push(e),w.reverse().concat(m,C)};te.algorithm.getArrowHeadPoints=function(e,h,y,o,n){let a=et.headHeightFactor,r=et.headWidthFactor,l=k.PlotUtils.getBaseLength(e)*a,s=e[e.length-1],c=l*r,u=l*n,d=l*o,m=k.PlotUtils.getThirdPoint(e[e.length-2],s,0,l,true),f=k.PlotUtils.getThirdPoint(e[e.length-2],s,0,d,true),p=k.PlotUtils.getThirdPoint(s,m,k.Constants.HALF_PI,c,false),g=k.PlotUtils.getThirdPoint(s,m,k.Constants.HALF_PI,c,true),v=k.PlotUtils.getThirdPoint(s,f,k.Constants.HALF_PI,u,false),A=k.PlotUtils.getThirdPoint(s,f,k.Constants.HALF_PI,u,true);return [v,p,s,g,A]};te.algorithm.getArrowBodyPoints=function(e,h,y,o){let n=k.PlotUtils.wholeDistance(e),r=k.PlotUtils.getBaseLength(e)*o,i=k.PlotUtils.distance(h,y),l=(r-i)/2,s=0,c=[],u=[];for(let d=1;d<e.length-1;d++){let m=k.PlotUtils.getAngleOfThreePoints(e[d-1],e[d],e[d+1])/2;s+=k.PlotUtils.distance(e[d-1],e[d]);let f=(r/2-s/n*l)/Math.sin(m),p=k.PlotUtils.getThirdPoint(e[d-1],e[d],Math.PI-m,f,true),g=k.PlotUtils.getThirdPoint(e[d-1],e[d],m,f,false);c.push(p),u.push(g);}return c.concat(u)};te.algorithm.getTempPoint4=function(e,h,y){let o,n,a,r,i=k.PlotUtils.mid(e,h),l=k.PlotUtils.distance(i,y),s=k.PlotUtils.getAngleOfThreePoints(e,i,y);return s<k.Constants.HALF_PI?(n=l*Math.sin(s),a=l*Math.cos(s),r=k.PlotUtils.getThirdPoint(e,i,k.Constants.HALF_PI,n,false),o=k.PlotUtils.getThirdPoint(i,r,k.Constants.HALF_PI,a,true)):s>=k.Constants.HALF_PI&&s<Math.PI?(n=l*Math.sin(Math.PI-s),a=l*Math.cos(Math.PI-s),r=k.PlotUtils.getThirdPoint(e,i,k.Constants.HALF_PI,n,false),o=k.PlotUtils.getThirdPoint(i,r,k.Constants.HALF_PI,a,false)):s>=Math.PI&&s<1.5*Math.PI?(n=l*Math.sin(s-Math.PI),a=l*Math.cos(s-Math.PI),r=k.PlotUtils.getThirdPoint(e,i,k.Constants.HALF_PI,n,true),o=k.PlotUtils.getThirdPoint(i,r,k.Constants.HALF_PI,a,true)):(n=l*Math.sin(2*Math.PI-s),a=l*Math.cos(2*Math.PI-s),r=k.PlotUtils.getThirdPoint(e,i,k.Constants.HALF_PI,n,true),o=k.PlotUtils.getThirdPoint(i,r,k.Constants.HALF_PI,a,false)),o};te.algorithm.tailedAttackArrow=function(e,h){e=te.algorithm.dereplication(e);let y=xt.tailWidthFactor,o=xt.swallowTailFactor,n=xt.swallowTailPnt||null,a={controlPoint:null,polygonalPoint:null};if(a.controlPoint=e,!(2>e.length)){if(e.length==2)return a.polygonalPoint=e,a;let i=e,l=i[0],s=i[1];k.PlotUtils.isClockWise(i[0],i[1],i[2])&&(l=i[1],s=i[0]);let u=[k.PlotUtils.mid(l,s)].concat(i.slice(2)),d=te.algorithm.getAttackArrowHeadPoints(u,l,s,xt),m=d[0],f=d[4],p=k.PlotUtils.distance(l,s),g=k.PlotUtils.getBaseLength(u),v=g*y*o;n=k.PlotUtils.getThirdPoint(u[1],u[0],0,v,true);let A=p/g,w=te.algorithm.getAttackArrowBodyPoints(u,m,f,A),C=w.length,_=[l].concat(w.slice(0,C/2));_.push(m);let P=[s].concat(w.slice(C/2,C));P.push(f),_=k.PlotUtils.getQBSplinePoints(_),P=k.PlotUtils.getQBSplinePoints(P);let b=te.algorithm.array2Dto1D(_.concat(d,P.reverse(),[n,_[0]]));a.polygonalPoint=h.Cartesian3.fromDegreesArray(b);}return a};te.algorithm.getAttackArrowHeadPoints=function(e,h,y,o){let n=o.headHeightFactor,a=o.headTailFactor,r=o.headWidthFactor,i=o.neckWidthFactor,l=o.neckHeightFactor,s=k.PlotUtils.getBaseLength(e),c=s*n,u=e[e.length-1];s=k.PlotUtils.distance(u,e[e.length-2]);let d=k.PlotUtils.distance(h,y);c>d*a&&(c=d*a);let m=c*r,f=c*i;c>s&&(c=s);let p=c*l,g=k.PlotUtils.getThirdPoint(e[e.length-2],u,0,c,true),v=k.PlotUtils.getThirdPoint(e[e.length-2],u,0,p,true),A=k.PlotUtils.getThirdPoint(u,g,k.Constants.HALF_PI,m,false),w=k.PlotUtils.getThirdPoint(u,g,k.Constants.HALF_PI,m,true),C=k.PlotUtils.getThirdPoint(u,v,k.Constants.HALF_PI,f,false),_=k.PlotUtils.getThirdPoint(u,v,k.Constants.HALF_PI,f,true);return [C,A,u,w,_]};te.algorithm.getAttackArrowBodyPoints=function(e,h,y,o){let n=k.PlotUtils.wholeDistance(e),r=k.PlotUtils.getBaseLength(e)*o,i=k.PlotUtils.distance(h,y),l=(r-i)/2,s=0,c=[],u=[];for(let d=1;d<e.length-1;d++){let m=k.PlotUtils.getAngleOfThreePoints(e[d-1],e[d],e[d+1])/2;s+=k.PlotUtils.distance(e[d-1],e[d]);let f=(r/2-s/n*l)/Math.sin(m),p=k.PlotUtils.getThirdPoint(e[d-1],e[d],Math.PI-m,f,true),g=k.PlotUtils.getThirdPoint(e[d-1],e[d],m,f,false);c.push(p),u.push(g);}return c.concat(u)};te.algorithm.dereplication=function(e){let h=e[e.length-1],y=false,o=[];return o=e.filter(function(n){return n[0]!=h[0]&&n[1]!=h[1]?true:(y=true,false)}),y&&o.push(h),o};te.algorithm.fineArrow=function(e,h,y){if(e.length<2||h.length<2)return;let o=yt.tailWidthFactor,n=yt.neckWidthFactor,a=yt.headWidthFactor,r=yt.headAngle,i=yt.neckAngle,l=[];l[0]=e,l[1]=h;let s=l[0],c=l[1],u=k.PlotUtils.getBaseLength(l),d=u*o,m=u*n,f=u*a,p=k.PlotUtils.getThirdPoint(c,s,k.Constants.HALF_PI,d,true),g=k.PlotUtils.getThirdPoint(c,s,k.Constants.HALF_PI,d,false),v=k.PlotUtils.getThirdPoint(s,c,r,f,false),A=k.PlotUtils.getThirdPoint(s,c,r,f,true),w=k.PlotUtils.getThirdPoint(s,c,i,m,false),C=k.PlotUtils.getThirdPoint(s,c,i,m,true),_=[];return _.push(p[0],p[1],w[0],w[1],v[0],v[1],c[0],c[1],A[0],A[1],C[0],C[1],g[0],g[1],s[0],s[1]),_.some(b=>isNaN(b))?"":y.Cartesian3.fromDegreesArray(_)};var Le=function(e,h){this.viewer=e,this._Cesium=h,this.handler=new this._Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=this._Cesium.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=te,this.tooltip=new Ct(e,h),this.tooltip.initTool();};Le.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1;};Le.prototype.disableHandler=function(){this._Cesium;this.handler&&(this.handler.destroy(),this.handler=new this._Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null);};var tt=function(e,h){Le.call(this,e,h),this._Cesium=h,this.type="AttackArrow",this.fillMaterial=this._Cesium.Color.RED.withAlpha(.5);};tt.prototype={disable:function(){var e=this._Cesium;this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var h=0;h<this.pointArr.length;h++)this.pointArr[h]&&this.viewer.entities.remove(this.pointArr[h]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var h=this._Cesium;let y=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,y=e.callback):y=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var o=this;this.state=1,this.handler||(this.handler=new h.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var a=pt(n.position,o.viewer);if(a){o.positions.length==0&&(o.floatPoint=o.creatPoint(a),o.floatPoint.wz=-1),o.positions.push(a);var r=o.creatPoint(a);o.positions.length>2?r.wz=o.positions.length-1:r.wz=o.positions.length,o.pointArr.push(r);}},h.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(!o.floatPoint||o.positions.length<2)){var a=pt(n.endPosition,o.viewer);a&&(o.floatPoint.position.setValue(a),o.tooltip.showAtCartesian(a,"\u53F3\u952E\u7ED3\u675F!"),o.positions.length>=2&&(h.defined(o.arrowEntity)?(o.positions.pop(),o.positions.push(a)):(o.positions.push(a),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId,y&&y(o.objId))));}},h.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){var a=pt(n.position,o.viewer);if(a){for(var r=0;r<o.pointArr.length;r++)o.pointArr[r].show=false;o.floatPoint.show=false,o.viewer.entities.remove(o.floatPoint),o.floatPoint=null;var i=o.creatPoint(a);i.show=false,i.wz=o.positions.length,o.pointArr.push(i),o.handler.destroy(),o.handler=null,o.tooltip.setVisible(false),o.arrowEntity=null;}},h.ScreenSpaceEventType.RIGHT_CLICK);},createByData:function(e){var h=this._Cesium;this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var y=[],o=0;o<e.length;o++){var n=h.Cartesian3.fromDegrees(e[o][0],e[o][1]);y.push(n);}this.positions=y;for(var o=0;o<this.positions.length;o++){var a=this.creatPoint(this.positions[o]);a.show=false,a.wz=o+1,this.pointArr.push(a);}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId;},startModify:function(){var e=this._Cesium;this.state=2;for(var h=this,y=0;y<h.pointArr.length;y++)h.pointArr[y].show=true;this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(o){var n=h.viewer.scene.pick(o.position);if(e.defined(n)&&n.id)h.clickStep++,n.id.objId||(h.selectPoint=n.id);else {for(var a=0;a<h.pointArr.length;a++)h.pointArr[a].show=false;h.floatPoint&&(h.floatPoint.show=false),h.state=-1,h.modifyHandler.destroy(),h.modifyHandler=null,h.tooltip.setVisible(false);}if(h.clickStep==2){h.clickStep=0;var r=pt(o.position,h.viewer);if(!r)return;h.selectPoint&&(h.selectPoint.position.setValue(r),h.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(o){var n=pt(o.endPosition,h.viewer);if(n)if(h.tooltip.showAtCartesian(n,"\u5DE6\u952E\u9009\u53D6\u5706\u70B9\u5F00\u59CB\u4FEE\u6539\uFF0C\u5355\u51FB\u505C\u6B62\u4FEE\u6539\uFF0C\u70B9\u51FB\u56FE\u5F62\u4E4B\u5916\u7ED3\u675F!"),h.selectPoint)h.selectPoint.position.setValue(n),h.positions[h.selectPoint.wz-1]=n;else return},e.ScreenSpaceEventType.MOUSE_MOVE);},getLnglats:function(){for(var e=[],h=0;h<this.positions.length;h++){var y=this.cartesianToLatlng(this.positions[h]);e.push(y);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var h=this._Cesium,y=this.viewer.entities.add({position:e,point:{pixelSize:10,color:h.Color.YELLOW}});return y.attr="editPoint",y},showArrowOnMap:function(e){var h=this._Cesium,y=this,o=function(){if(e.length<3)return null;for(var n=[],a=0;a<e.length;a++){var r=y.cartesianToLatlng(e[a]);n.push(r);}var i=y.xp.algorithm.tailedAttackArrow(n,h),l=JSON.stringify(i.polygonalPoint).indexOf("null"),s=[];return l==-1&&(s=i.polygonalPoint),new h.PolygonHierarchy(s)};return this.viewer.entities.add({id:y.objId,polygon:new h.PolygonGraphics({hierarchy:new h.CallbackProperty(o,false),show:true,fill:true,material:y.fillMaterial})})},cartesianToLatlng:function(e){var h=this._Cesium,y=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),o=h.Math.toDegrees(y.latitude),n=h.Math.toDegrees(y.longitude);return [n,o]}};tt.prototype=Object.create(Object.assign({},tt.prototype,Le.prototype));tt.prototype.constructor=tt;function pt(e,h){var y,o=h.camera.getPickRay(e);return o?(y=h.scene.globe.pick(o,h.scene),y):null}var Xe=tt;var nt=function(e,h){Le.call(this,e,h),this._Cesium=h,this.type="StraightArrow",this.fillMaterial=this._Cesium.Color.fromCssColorString("#0000FF").withAlpha(.8);};nt.prototype={disable:function(){var e=this._Cesium;this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var h=this._Cesium;let y=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,y=e.callback):y=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var o=this;this.state=1,this.handler||(this.handler=new h.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var a=St(n.position,o.viewer);a&&(o.positions.length==0&&(o.firstPoint=o.creatPoint(a),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(a),o.floatPoint.type="floatPoint",o.positions.push(a),o.firstPoint.position.setValue(a),o.firstPoint.show=true),o.positions&&o.positions.length==3&&(o.firstPoint.show=false,o.floatPoint.show=false,o.handler.destroy(),o.handler=null,o.tooltip.setVisible(false),o.arrowEntity=null),o.positions.push(a.clone()));},h.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(o.positions.length<1)){var a=St(n.endPosition,o.viewer);a&&(o.tooltip.showAtCartesian(a,"\u5DE6\u952E\u5355\u51FB\u7ED3\u675F!"),o.floatPoint.position.setValue(a),o.positions.length>=2&&(h.defined(o.arrowEntity)?(o.positions.pop(),o.positions.push(a)):(o.positions.push(a),o.arrowEntity=o.showArrowOnMap(o.positions),y&&y(o.objId))));}},h.ScreenSpaceEventType.MOUSE_MOVE);},startModify:function(){var e=this._Cesium;this.state=2,this.firstPoint.show=true,this.floatPoint.show=true;var h=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(y){var o=h.viewer.scene.pick(y.position);if(e.defined(o)&&o.id?(h.clickStep++,o.id.objId||(h.selectPoint=o.id)):(h.modifyHandler.destroy(),h.modifyHandler=null,h.firstPoint.show=false,h.floatPoint.show=false,h.state=-1,h.tooltip.setVisible(false)),h.clickStep==2){h.clickStep=0;var n=St(y.position,h.viewer);if(!n)return;h.selectPoint&&h.selectPoint.position&&(h.selectPoint.position.setValue(n),h.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(y){var o=St(y.endPosition,h.viewer);if(o)if(h.tooltip.showAtCartesian(o,"\u5DE6\u952E\u9009\u53D6\u5706\u70B9\u5F00\u59CB\u4FEE\u6539\uFF0C\u5355\u51FB\u505C\u6B62\u4FEE\u6539\uFF0C\u70B9\u51FB\u56FE\u5F62\u4E4B\u5916\u7ED3\u675F!"),h.selectPoint&&h.selectPoint.position)h.selectPoint.position.setValue(o),h.selectPoint.type=="firstPoint"&&(h.positions[1]=o),h.selectPoint.type=="floatPoint"&&(h.positions[2]=o);else return},e.ScreenSpaceEventType.MOUSE_MOVE);},createByData:function(e){var h=this._Cesium;this.state=-1,this.positions=[];for(var y=[],o=0;o<e.length;o++){var n=h.Cartesian3.fromDegrees(e[o][0],e[o][1]);y.push(n);}this.positions=y,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=false,this.floatPoint.show=false,this.arrowEntity.objId=this.objId;},getLnglats:function(){for(var e=[],h=0;h<this.positions.length;h++){var y=this.cartesianToLatlng(this.positions[h]);e.push(y);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var h=this._Cesium,y=this.viewer.entities.add({position:e,point:{pixelSize:10,color:h.Color.RED}});return y.attr="editPoint",y},showArrowOnMap:function(e){var h=this._Cesium,y=this,o=function(){if(e.length<2)return null;var n=e[1],a=e[2],r=y.cartesianToLatlng(n),i=y.cartesianToLatlng(a),l=[],s=y.xp.algorithm.fineArrow([r[0],r[1]],[i[0],i[1]],h),c=JSON.stringify(s).indexOf("null");if(c!=-1)return [];for(var u=s,d=0;d<u.length;d++){var m=new h.Cartesian3(u[d].x,u[d].y,u[d].z);l.push(m);}return new h.PolygonHierarchy(l)};return this.viewer.entities.add({id:y.objId,polygon:new h.PolygonGraphics({hierarchy:new h.CallbackProperty(o,false),show:true,fill:true,material:y.fillMaterial})})},cartesianToLatlng:function(e){var h=this._Cesium,y=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),o=h.Math.toDegrees(y.latitude),n=h.Math.toDegrees(y.longitude);return [n,o]}};nt.prototype=Object.create(Object.assign({},nt.prototype,Le.prototype));nt.prototype.constructor=nt;function St(e,h){var y,o=h.camera.getPickRay(e);return o?(y=h.scene.globe.pick(o,h.scene),y):null}var je=nt;var rt=function(e,h){Le.call(this,e,h),this._Cesium=h,this.type="PincerArrow",this.fillMaterial=this._Cesium.Color.YELLOW.withAlpha(.8);};rt.prototype={disable:function(){var e=this._Cesium;this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var h=0;h<this.pointArr.length;h++)this.pointArr[h]&&this.viewer.entities.remove(this.pointArr[h]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var h=this._Cesium;let y=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,y=e.callback):y=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var o=this;this.state=1,this.handler||(this.handler=new h.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var a=gt(n.position,o.viewer);if(a)if(o.positions.length==0&&(o.floatPoint=o.creatPoint(a)),o.positions.length>4){var r=o.creatPoint(a);r.wz=o.positions.length,o.pointArr.push(r);for(var i=0;i<o.pointArr.length;i++)o.pointArr[i].show=false;o.floatPoint&&(o.floatPoint.show=false,o.viewer.entities.remove(o.floatPoint),o.floatPoint=null);}else {o.positions.push(a);var r=o.creatPoint(a);o.positions.length>2?r.wz=o.positions.length-1:r.wz=o.positions.length,o.pointArr.push(r);}},h.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(!o.floatPoint||o.positions.length<2)){var a=gt(n.endPosition,o.viewer);a&&(o.floatPoint.position.setValue(a),o.tooltip.showAtCartesian(a,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),o.positions.length>=2&&(h.defined(o.arrowEntity)?(o.positions.pop(),o.positions.push(a)):(o.positions.push(a),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId,y&&y(o.objId))));}},h.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){if(o.positions.length>=4){var a=gt(n.position,o.viewer);if(!a)return;for(var r=0;r<o.pointArr.length;r++)o.pointArr[r].show=false;o.floatPoint&&(o.floatPoint.show=false),o.viewer.entities.remove(o.floatPoint),o.floatPoint=null;var i=o.creatPoint(a);i.show=false,i.wz=o.positions.length,o.pointArr.push(i),o.handler.destroy(),o.handler=null,o.tooltip.setVisible(false),o.arrowEntity=null;}},h.ScreenSpaceEventType.RIGHT_CLICK);},createByData:function(e){var h=this._Cesium;this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var y=[],o=0;o<e.length;o++){var n=h.Cartesian3.fromDegrees(e[o][0],e[o][1]);y.push(n);}this.positions=y;for(var o=0;o<this.positions.length;o++){var a=this.creatPoint(this.positions[o]);a.show=false,a.wz=o+1,this.pointArr.push(a);}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId;},startModify:function(){var e=this._Cesium;this.state=2;var h=this;for(let y=0;y<h.pointArr.length;y++)h.pointArr[y].show=true;this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(y){var o=h.viewer.scene.pick(y.position);if(e.defined(o)&&o.id)h.clickStep++,o.id.objId||(h.selectPoint=o.id);else {for(let a=0;a<h.pointArr.length;a++)h.pointArr[a].show=false;h.state=-1,h.modifyHandler.destroy(),h.modifyHandler=null,h.tooltip.setVisible(false);}if(h.clickStep==2){h.clickStep=0;var n=gt(y.position,h.viewer);if(!n)return;h.selectPoint&&(h.selectPoint.position.setValue(n),h.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(y){var o=gt(y.endPosition,h.viewer);if(o)if(h.tooltip.showAtCartesian(o,"\u5DE6\u952E\u9009\u53D6\u5706\u70B9\u5F00\u59CB\u4FEE\u6539\uFF0C\u5355\u51FB\u505C\u6B62\u4FEE\u6539\uFF0C\u70B9\u51FB\u56FE\u5F62\u4E4B\u5916\u7ED3\u675F!"),h.selectPoint)h.selectPoint.position.setValue(o),h.positions[h.selectPoint.wz-1]=o;else return},e.ScreenSpaceEventType.MOUSE_MOVE);},getLnglats:function(){for(var e=[],h=0;h<this.positions.length;h++){var y=this.cartesianToLatlng(this.positions[h]);e.push(y);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var h=this._Cesium;return this.viewer.entities.add({position:e,point:{pixelSize:10,color:h.Color.RED},show:true})},showArrowOnMap:function(e){var h=this._Cesium,y=this,o=function(){if(e.length<3)return null;for(var n=[],a=0;a<e.length;a++){var r=y.cartesianToLatlng(e[a]);n.push(r);}var i=y.xp.algorithm.doubleArrow(n,h),l=[],s=JSON.stringify(i.polygonalPoint).indexOf("null");return s==-1&&(l=i.polygonalPoint),new h.PolygonHierarchy(l)};return this.viewer.entities.add({id:y.objId,polygon:new h.PolygonGraphics({hierarchy:new h.CallbackProperty(o,false),show:true,fill:true,material:y.fillMaterial})})},cartesianToLatlng:function(e){var h=this._Cesium,y=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),o=h.Math.toDegrees(y.latitude),n=h.Math.toDegrees(y.longitude);return [n,o]}};rt.prototype=Object.create(Object.assign({},rt.prototype,Le.prototype));rt.prototype.constructor=rt;function gt(e,h){var y,o=h.camera.getPickRay(e);return o?(y=h.scene.globe.pick(o,h.scene),y):null}var Ye=rt;function mn({THREE:e,Cesium:h,viewer:y}){function o(a,r){r||(r=new e.BufferGeometry);let i=a.attributes;for(let c in i)if(i.hasOwnProperty(c)&&i[c]){var l=i[c],s=l.values;s instanceof Float64Array&&(s=new Float32Array(s));let u=new e.BufferAttribute(s,l.componentsPerAttribute,l.normalize);r.setAttribute(c,u);}if(i.st&&(r.attributes.uv=r.attributes.st,r.deleteAttribute("st")),a.indices){let c=new e.BufferAttribute(a.indices,1,false);r.setIndex(c);}if(a.boundingSphere){let c=a.boundingSphere;r.boundingSphere||(r.boundingSphere=new e.Sphere),r.boundingSphere.center.copy(c.center),r.boundingSphere.radius=c.radius;}return r}class n extends e.Scene{constructor(r={}){if(super(),this.type="ThreeCesiumScene",!r.cesiumDom)throw new Error("THREE.ThreeCesiumScene not found cesiumDom.");if(!r.camera||!(r.camera instanceof e.PerspectiveCamera))throw new Error("THREE.ThreeCesiumScene (not found cesiumDom) OR ( not THREE.PerspectiveCamera ).");if(!r.renderer)throw new Error("THREE.ThreeCesiumScene not found THREE.WebGLRender.");this.options=r,this.cesiumViewer=y;let l=(typeof r.cesiumDom=="string"?document.getElementById(r.cesiumDom):r.cesiumDom).children[0].children;for(let w=0;w<l.length;w++)w!==0&&(l[w].style.zIndex="100");this.ellipsoid=this.cesiumViewer.scene.globe.ellipsoid,r.threeHabit&&(this.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes=[h.CameraEventType.LEFT_DRAG],this.cesiumViewer.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.WHEEL,h.CameraEventType.PINCH],this.cesiumViewer.scene.screenSpaceCameraController.rotateEventTypes=[h.CameraEventType.RIGHT_DRAG]),this.camera=r.camera,this.cameraOffset=new e.Vector3,this.renderer=r.renderer,this.lngLat=r.lngLat&&r.lngLat.length>1?r.lngLat:[114.23,31.55],this.cameraCenter=new e.Vector3(0,0,0);let s=new h.EllipsoidGeometry({vertexFormat:h.VertexFormat.POSITION_ONLY,radii:new h.Cartesian3(this.ellipsoid.maximumRadius-1,this.ellipsoid.maximumRadius-1,this.ellipsoid.minimumRadius-1),slicePartitions:1024,stackPartitions:1024}),c=o(h.EllipsoidGeometry.createGeometry(s)),u=new e.MeshBasicMaterial({color:"#ff00ff",blending:e.MultiplyBlending}),d=new e.Mesh(c,u);r.axesHelper&&d.add(new e.AxesHelper(8e6)),super.add(d),this.sphere=d;let m=new e.Group;super.add(m),this.syncGroup=m;let f=new e.SphereGeometry(this.ellipsoid.minimumRadius,512,256,0,Math.PI*2,3.1,Math.PI-3.1),p=new e.MeshBasicMaterial({color:"#fff00f",blending:e.MultiplyBlending}),g=new e.Mesh(f,p);g.rotateX(90*Math.PI/180),g.position.z=this.ellipsoid.minimumRadius,this.sphere3=g;let v=new e.Group;v.rotateX(-90*Math.PI/180),v.position.z=-1,this.syncGroup=m,this.childrenGroup=v,this.sunUp=new e.Group,this.sunLightColor=new e.Color,this.sunLightIntensity=1;let A=this.cesiumViewer.scene.light;if(this.sunLightColor.r=A.color.red,this.sunLightColor.g=A.color.green,this.sunLightColor.b=A.color.blue,this.sunLightIntensity=A.intensity,this.sun=new e.DirectionalLight(this.sunLightColor,this.sunLightIntensity),this.sun.castShadow=true,this.sun.shadow.camera.far=Math.pow(10,14),this.sun.position.set(0,0,this.ellipsoid.maximumRadius*2+1e3),this.sun.target=this.childrenGroup,this.sunUp.add(this.sun),m.add(g),m.add(v),m.add(this.sunUp),this._enableLighting=false,Object.defineProperty(this,"enableLighting",{get(){return this._enableLighting},set(w){if(this.cesiumViewer.scene.globe.enableLighting=w,this._enableLighting=w,w){this.sun.visible=true;return}this.sun.visible=false;}}),r.enableLighting!==void 0&&r.enableLighting!==null&&(this.enableLighting=r.enableLighting),r.cesiumLayers&&r.cesiumLayers.length>0)for(let w=0;w<r.cesiumLayers.length;w++)this.addImageryProvider(r.cesiumLayers[w].type,r.cesiumLayers[w].option);}renderCesium(){return this.cesiumViewer.isDestroyed()||this.cesiumViewer.resize(),this.cesiumViewer.render(),this}renderThree(){return this.renderer.render(this,this.camera),this}updateSunMatrix(){if(this.isColumbusViewMode())return this;let r=this.cesiumViewer.scene.sun._boundingVolume.center,i=this.cartesian3ToVector(r);return this.sunUp.lookAt(i.x-this.cameraOffset.x,i.y-this.cameraOffset.y,-(i.z-this.cameraOffset.z)),this}updateCameraMatrix(){this.camera.fov=h.Math.toDegrees(this.cesiumViewer.camera.frustum.fovy),this.camera.updateProjectionMatrix(),this.camera.matrixAutoUpdate=false;let r=this.cesiumViewer.camera.viewMatrix,i=this.cesiumViewer.camera.inverseViewMatrix;this.camera.lookAt(this.cameraCenter),this.camera.matrixWorld.set(i[0],i[4],i[8],i[12]-this.cameraOffset.x,i[1],i[5],i[9],i[13]-this.cameraOffset.y,i[2],i[6],i[10],i[14]-this.cameraOffset.z,i[3],i[7],i[11],i[15]),this.camera.matrixWorldInverse.set(r[0],r[4],r[8],r[12]-this.cameraOffset.x,r[1],r[5],r[9],r[13]-this.cameraOffset.y,r[2],r[6],r[10],r[14]-this.cameraOffset.z,r[3],r[7],r[11],r[15]);let l=this.cesiumViewer.scene.canvas.clientWidth,s=this.cesiumViewer.scene.canvas.clientHeight;return this.camera.aspect=l/s,this.camera.updateProjectionMatrix(),this.renderer.setSize(l,s),this}isColumbusViewMode(){return this.cesiumViewer.scene.mode===h.SceneMode.COLUMBUS_VIEW}isThreeRenderable(){let r=this.cesiumViewer.scene;return r.mode===h.SceneMode.SCENE2D?false:Math.abs(r.morphTime)<h.Math.EPSILON6||Math.abs(r.morphTime-1)<h.Math.EPSILON6}getSceneOriginPosition(){return this.isColumbusViewMode()?this.cartesianToCVWorld(h.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)):h.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)}cartesianToCVWorld(r){let i=this.cesiumViewer.scene.mapProjection.project(h.Cartographic.fromCartesian(r));return new e.Vector3(i.z,i.x,i.y)}updateGroupMatrixWorld(){if(this.isColumbusViewMode())return this.cameraOffset.copy(this.getSceneOriginPosition()),this.syncGroup.rotation.set(-Math.PI/2,-Math.PI/2,0),this.syncGroup.updateMatrix(),this.syncGroup.up.set(1,0,0),this.up.set(1,0,0),this.sphere.visible=false,this.sphere3.visible=false,this;this.sphere.visible=true,this.sphere3.visible=true;let r=this.cartesian3ToVector(h.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)),i=this.cartesian3ToVector(h.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],2)),l=new e.Vector3().subVectors(r,i).normalize();return this.syncGroup.up.set(0,0,-1),this.syncGroup.lookAt(l),this.syncGroup.up.copy(l),this.syncGroup.updateMatrix(),this.cameraOffset.copy(r),this.syncGroup.up.set(0,0,-1),this.up.set(0,0,-1),this}update(){this.updateSunMatrix(),this.updateGroupMatrixWorld(),this.renderCesium(),this.updateCameraMatrix(),this.isThreeRenderable()?this.renderThree():this.renderer.clear();}add(r){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.childrenGroup.add(arguments[i]);return this}return r===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",r),this):(r&&r.isObject3D?(r.parent!==null&&r.parent.remove(r),r.parent=this.childrenGroup,this.childrenGroup.children.push(r),r.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",r),this)}remove(r){if(arguments.length>1){for(let l=0;l<arguments.length;l++)this.childrenGroup.remove(arguments[l]);return this}let i=this.childrenGroup.children.indexOf(r);return i!==-1&&(r.parent=null,this.childrenGroup.children.splice(i,1),r.dispatchEvent({type:"removed"})),this}clear(){for(let r=0;r<this.childrenGroup.children.length;r++){let i=this.childrenGroup.children[r];i.parent=null,i.dispatchEvent({type:"removed"});}return this.childrenGroup.children.length=0,this}traverse(r){r(this.childrenGroup);let i=this.childrenGroup.children;for(let l=0,s=i.length;l<s;l++)i[l].traverse(r);}traverseVisible(r){if(this.visible===false||this.childrenGroup.visible===false)return;r(this.childrenGroup);let i=this.childrenGroup.children;for(let l=0,s=i.length;l<s;l++)i[l].traverseVisible(r);}toJSON(r){let i=r===void 0||typeof r=="string",l={};i&&(r={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{},options:{}},l.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let s={};if(s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===true&&(s.castShadow=true),this.receiveShadow===true&&(s.receiveShadow=true),this.visible===false&&(s.visible=false),this.frustumCulled===false&&(s.frustumCulled=false),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),this.matrixAutoUpdate===false&&(s.matrixAutoUpdate=false),this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(r).uuid)),this.environment&&this.environment.isTexture&&(s.environment=this.environment.toJSON(r).uuid),this.fog!==null&&(s.fog=this.fog.toJSON()),this.options){s.options={};for(let u in this.options)["camera","renderer"].includes(u)||(s.options[u]=this.options[u]);}if(this.childrenGroup.children.length>0){s.children=[];for(let u=0;u<this.childrenGroup.children.length;u++)s.children.push(this.childrenGroup.children[u].toJSON(r).object);}if(i){let u=c(r.geometries),d=c(r.materials),m=c(r.textures),f=c(r.images),p=c(r.shapes),g=c(r.skeletons),v=c(r.animations),A=c(r.nodes);u.length>0&&(l.geometries=u),d.length>0&&(l.materials=d),m.length>0&&(l.textures=m),f.length>0&&(l.images=f),p.length>0&&(l.shapes=p),g.length>0&&(l.skeletons=g),v.length>0&&(l.animations=v),A.length>0&&(l.nodes=A);}return s.isGIS=true,l.object=s,l;function c(u){let d=[];for(let m in u){let f=u[m];delete f.metadata,d.push(f);}return d}}dispose(){this.update=()=>{},this.renderCesium=()=>{},this.renderThree=()=>{},this.updateSunMatrix=()=>{},this.updateCameraMatrix=()=>{},this.updateGroupMatrixWorld=()=>{},this.cesiumViewer.destroy();}cartesian3ToVector(r){return new e.Vector3(r.x,r.y,r.z)}positionToCartesian(r){if(Array.isArray(r))return h.Cartesian3.fromDegrees(r[0],r[1],r.length>2?r[2]:0);if(r&&typeof r=="object"){if(typeof r.longitude=="number"&&typeof r.latitude=="number")return h.Cartesian3.fromRadians(r.longitude,r.latitude,r.height||0);if(typeof r.x=="number"&&typeof r.y=="number"&&typeof r.z=="number")return new h.Cartesian3(r.x,r.y,r.z)}throw new Error("THREE.ThreeCesiumScene: invalid position, expect [lng, lat, height] | Cesium.Cartesian3 | Cesium.Cartographic.")}positionToWorldVector(r){let i=this.positionToCartesian(r),l=this.getSceneOriginPosition();if(this.isColumbusViewMode()){let s=this.cartesianToCVWorld(i);return new e.Vector3(s.x-l.x,s.y-l.y,s.z-l.z)}return new e.Vector3(i.x-l.x,i.y-l.y,i.z-l.z)}setObjectPosition(r,i){if(!r||!r.isObject3D)return console.error("THREE.ThreeCesiumScene.setObjectPosition: object must be an instance of THREE.Object3D.",r),this;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let l=this.positionToWorldVector(i);return r.position.copy(this.childrenGroup.worldToLocal(l)),this}getObjectPosition(r){if(!r||!r.isObject3D)return console.error("THREE.ThreeCesiumScene.getObjectPosition: object must be an instance of THREE.Object3D.",r),null;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let i=this.getSceneOriginPosition(),l=this.childrenGroup.localToWorld(r.position.clone()),s=new h.Cartesian3(l.x+i.x,l.y+i.y,l.z+i.z),c;return this.isColumbusViewMode()?c=this.cesiumViewer.scene.mapProjection.unproject(new h.Cartesian3(s.y,s.z,s.x)):c=h.Cartographic.fromCartesian(s),[h.Math.toDegrees(c.longitude),h.Math.toDegrees(c.latitude),c.height]}}return n.prototype.isScene=true,n.prototype.isGIS=true,n}function gr(){let e=null,h=null,y=function(o,n,a,r){if(o&&r){let{threeGlobal:i,containerId:l,threeContainerId:s}=r;e=n,h=i,this._viewer=o,this._containerId=l,this._threeContainerId=s,this._Scene=mn({THREE:h,Cesium:e,viewer:o}),this._initContainer(),se(this),ae(this,()=>{this.destroyThreeJS();});}};return y.prototype={_initContainer:function(){if(this.cesiumContainer=void 0,this.threeContainer=void 0,this.cesiumContainer=document.getElementById(this._containerId),this.threeContainer=document.getElementById(this._threeContainerId),this.cesiumContainer)this.cesiumContainer.style.position!=="absolute"&&(this.cesiumContainer.style.position="absolute",this.cesiumContainer.style.top=0,this.cesiumContainer.style.left=0,this.cesiumContainer.style.height="100%",this.cesiumContainer.style.width="100%",this.cesiumContainer.style.margin=0,this.cesiumContainer.style.overflow="hidden",this.cesiumContainer.style.padding=0,this.cesiumContainer.style.fontFamily="sans-serif");else return alert("\u672A\u83B7\u53D6\u5230 cesiumContainer \u5BB9\u5668!"),false;if(!this.threeContainer){var o=document.getElementsByTagName("body")[0];o&&(this.threeContainer=document.createElement("div"),this.threeContainer.id=this._threeContainerId,this.threeContainer.style.position="absolute",this.threeContainer.style.top=0,this.threeContainer.style.left=0,this.threeContainer.style.height="100%",this.threeContainer.style.width="100%",this.threeContainer.style.margin=0,this.threeContainer.style.overflow="hidden",this.threeContainer.style.padding=0,this.threeContainer.style.fontFamily="sans-serif",this.threeContainer.style.pointerEvents="none",o.appendChild(this.threeContainer));}},initThree:function(o){var n=o.fov||45,a=window.innerWidth,r=window.innerHeight,i=o.aspect||a/r,l=o.near||1,s=o.far||10*1e3*1e3;return this._three={renderer:null,camera:null,scene:null},this._three.camera=new h.PerspectiveCamera(n,i,l,s),this._three.renderer=new h.WebGLRenderer({alpha:true,antialias:true,logarithmicDepthBuffer:true,stencil:true,depth:true}),this._three.renderer.outputEncoding=h.sRGBEncoding,this._three.renderer.shadowMap.enabled=true,this._three.renderer.shadowMap.type=h.PCFSoftShadowMap,this._three.scene=new this._Scene({cesiumDom:this._containerId,threeHabit:this._objHasOwnProperty(o,"threeHabit",true),enableLighting:this._objHasOwnProperty(o,"enableLighting",true),axesHelper:this._objHasOwnProperty(o,"axesHelper",false),camera:this._three.camera,renderer:this._three.renderer,lngLat:o.center||[104.081701757991,30.627042558105988]}),this.threeContainer&&this.threeContainer.appendChild(this._three.renderer.domElement),this._three},loop(o){let n=a=>{this._rafId=requestAnimationFrame(n),o&&o(a);};this._rafId=requestAnimationFrame(n);},setPosition(o,n){return !this._three||!this._three.scene?(console.error("ThreeJs.setPosition: please call initThree first."),this):(this._three.scene.setObjectPosition(o,n),this)},getPosition(o){return !this._three||!this._three.scene?(console.error("ThreeJs.getPosition: please call initThree first."),null):this._three.scene.getObjectPosition(o)},_objHasOwnProperty(o,n,a){return o.hasOwnProperty(n)?o[n]:a},destroyThreeJS(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._three&&this._three.scene&&typeof this._three.scene.dispose=="function"&&this._three.scene.dispose();}},y}var vt=re(gr);var ke=111319.49079327358,vr=0;function qe(e){return ke*Math.cos(e*Math.PI/180)}function ue(e,h,y){return e<h?h:e>y?y:e}function Ar(e){let h=ue(e,0,1);return h*h*(3-2*h)}function pn(e){let h=1/0,y=1/0,o=-1/0,n=-1/0;for(let a of e)a&&(a.lng<h&&(h=a.lng),a.lng>o&&(o=a.lng),a.lat<y&&(y=a.lat),a.lat>n&&(n=a.lat));return Number.isFinite(h)?{minLng:h,minLat:y,maxLng:o,maxLat:n}:{minLng:0,minLat:0,maxLng:0,maxLat:0}}function zt(e){let h=pn(e);return {lng:(h.minLng+h.maxLng)/2,lat:(h.minLat+h.maxLat)/2}}function gn(e,h,y){let o=false,n=y.length;for(let a=0,r=n-1;a<n;r=a++){let i=y[a].lng,l=y[a].lat,s=y[r].lng,c=y[r].lat;l>h!=c>h&&e<(s-i)*(h-l)/(c-l||1e-12)+i&&(o=!o);}return o}function wr(e,h,y){let o=qe(h),n=ke,a=1/0,r=y.length;for(let l=0,s=r-1;l<r;s=l++){let c=(y[s].lng-e)*o,u=(y[s].lat-h)*n,d=(y[l].lng-e)*o,m=(y[l].lat-h)*n,f=d-c,p=m-u,g=f*f+p*p,v=g>0?ue(-(c*f+u*p)/g,0,1):0,A=c+v*f,w=u+v*p,C=Math.sqrt(A*A+w*w);C<a&&(a=C);}return Number.isFinite(a)||(a=0),gn(e,h,y)?a:-a}function Wt(e){if(e.length<3)return 0;let h=zt(e).lat,y=qe(h),o=ke,n=0;for(let a=0,r=e.length-1;a<e.length;r=a++)n+=e[r].lng*y*(e[a].lat*o)-e[a].lng*y*(e[r].lat*o);return Math.abs(n)/2}function Cr(e,h){let y=new Uint8Array(e.length);if(h<3)return y;let o=new Uint8Array(e.length),n=new Int32Array(e.length),a=0,r=0,i=l=>{e[l]||o[l]||(o[l]=1,n[r++]=l);};for(let l=0;l<h;l++)i(l),i((h-1)*h+l);for(let l=0;l<h;l++)i(l*h),i(l*h+h-1);for(;a<r;){let l=n[a++],s=l/h|0,c=l-s*h;s>0&&i(l-h),s<h-1&&i(l+h),c>0&&i(l-1),c<h-1&&i(l+1);}for(let l=0;l<e.length;l++)e[l]||o[l]||(e[l]=1,y[l]=1);return y}function vn(e,h={}){var S,M,E;if(!e||e.length<3)throw new Error("buildTerrainGrid: \u81F3\u5C11\u9700\u8981 3 \u4E2A\u9876\u70B9");let y=Math.round(ue((S=h.segments)!=null?S:64,8,256)),o=ue((M=h.padRatio)!=null?M:.06,0,.5),n=y+1,a=pn(e),r=(a.maxLng-a.minLng)*o,i=(a.maxLat-a.minLat)*o,l=a.minLng-r,s=a.maxLng+r,c=a.minLat-i,u=a.maxLat+i,d=(s-l)/y,m=(u-c)/y,f=(c+u)/2,p=qe(f),g=Math.max(d*p,m*ke),v=(s-l)*p,A=(u-c)*ke,w=ue((E=h.slopeWidth)!=null?E:Math.max(12,Math.min(v,A)*.12),4,Math.min(v,A)*.6),C=n*n,_=new Uint8Array(C),P=new Float32Array(C),b=new Float32Array(C),x=new Float32Array(C),T=new Float32Array(C);for(let I=0;I<n;I++){let D=c+I*m;for(let V=0;V<n;V++){let W=l+V*d,z=I*n+V;if(!gn(W,D,e))continue;let G=wr(W,D,e);_[z]=1,P[z]=G,b[z]=Ar(G/w);}}if(h.fillHoles!==false){let I=Cr(_,n);for(let D=0;D<C;D++)I[D]&&(P[D]=w,b[D]=1);}return {segments:y,stride:n,bounds:{minLng:l,minLat:c,maxLng:s,maxLat:u},dLng:d,dLat:m,vertexCount:C,inside:_,distance:P,weight:b,base:x,current:T,slopeWidth:w,cellSize:g,cellArea:g*g}}function It(e,h){let y=Math.floor(h/e.stride),o=h%e.stride;return {lng:e.bounds.minLng+o*e.dLng,lat:e.bounds.minLat+y*e.dLat}}function _r(e,h){let y=0,o=0;for(let n=0;n<e.vertexCount;n++)e.weight[n]<.85||(y+=h[n],o++);if(o===0)for(let n=0;n<e.vertexCount;n++)e.inside[n]&&(y+=h[n],o++);return o?y/o:0}function Ut(e,h=e.current){let y=1/0,o=-1/0,n=0,a=0;for(let r=0;r<e.vertexCount;r++){if(e.weight[r]<.85)continue;let i=h[r];i<y&&(y=i),i>o&&(o=i),n+=i,a++;}return a?{min:y,max:o,average:n/a}:{min:0,max:0,average:0}}function br(e,h){let{stride:y}=e,o=new Float32Array(h);for(let n=1;n<y-1;n++)for(let a=1;a<y-1;a++){let r=n*y+a;if(!e.inside[r])continue;let i=0,l=0;for(let s=-1;s<=1;s++)for(let c=-1;c<=1;c++){let u=(n+s)*y+(a+c);e.inside[u]&&(i+=h[u],l++);}l&&(o[r]=i/l);}return o}function An(e,h={}){var l,s,c,u,d,m;let y=(l=h.mode)!=null?l:"sink",o=Math.abs((s=h.depth)!=null?s:30),n=(c=h.depth)!=null?c:0,a=Math.max(0,(u=h.stepHeight)!=null?u:0),r=new Float32Array(e.current);if(y==="smooth"){let f=Math.max(1,Math.round((d=h.smoothIterations)!=null?d:2)),p=new Float32Array(e.current);for(let g=0;g<f;g++){let v=br(e,p);for(let A=0;A<e.vertexCount;A++){let w=e.weight[A];w<=0||(p[A]=p[A]*(1-w*.85)+v[A]*(w*.85));}}return p}let i=(m=h.flattenHeight)!=null?m:_r(e,e.current);for(let f=0;f<e.vertexCount;f++){let p=e.weight[f];if(p<=0)continue;let g=e.current[f],v=g;if(y==="raise"?v=g+o*p:y==="flatten"?v=g+(i+n-g)*p:v=g-o*p,a>0){let A=v-g,w=Math.round(A/a)*a;v=g+w;}r[f]=v;}return r}function Tt(e,h,y=e.current){let o=1/0,n=-1/0,a=0,r=0,i=0;for(let l=0;l<e.vertexCount;l++){if(!e.inside[l])continue;i++;let s=y[l];s<o&&(o=s),s>n&&(n=s);let c=s-e.base[l];c<0?a-=c*e.cellArea:r+=c*e.cellArea;}return Number.isFinite(o)||(o=0),Number.isFinite(n)||(n=0),{area:Wt(h),minHeight:o,maxHeight:n,cutVolume:a,fillVolume:r,vertexCount:i,cellSize:e.cellSize}}var Ue=[{stop:0,color:[.4,.42,.3]},{stop:.35,color:[.46,.38,.28]},{stop:.7,color:[.32,.3,.27]},{stop:1,color:[.17,.19,.22]}],Ht=[.1,.34,.5];function wn(e,h=.5,y=false){let o=ue(e,0,1),n=Ue[0],a=Ue[Ue.length-1];for(let d=0;d<Ue.length-1;d++)if(o>=Ue[d].stop&&o<=Ue[d+1].stop){n=Ue[d],a=Ue[d+1];break}let r=a.stop-n.stop||1,i=ue((o-n.stop)/r,0,1),l=n.color[0]+(a.color[0]-n.color[0])*i,s=n.color[1]+(a.color[1]-n.color[1])*i,c=n.color[2]+(a.color[2]-n.color[2])*i;y&&(l=l*.45+Ht[0]*.55,s=s*.45+Ht[1]*.55,c=c*.45+Ht[2]*.55);let u=.92+(h-.5)*.16;return [ue(l*u,0,1),ue(s*u,0,1),ue(c*u,0,1)]}function it(e,h){let y=Math.sin(e*127.1+h*311.7)*43758.5453;return y-Math.floor(y)}function fn(e,h){let y=Math.floor(e),o=Math.floor(h),n=e-y,a=h-o,r=n*n*(3-2*n),i=a*a*(3-2*a),l=it(y,o),s=it(y+1,o),c=it(y,o+1),u=it(y+1,o+1);return l+(s-l)*r+(c-l)*i+(l-s-c+u)*r*i}function Nt(e,h=1e-9){let y=[];for(let o of e){let n=y[y.length-1];n&&Math.abs(n.lng-o.lng)<h&&Math.abs(n.lat-o.lat)<h||y.push(o);}if(y.length>1){let o=y[0],n=y[y.length-1];Math.abs(o.lng-n.lng)<h&&Math.abs(o.lat-n.lat)<h&&y.pop();}return y}var Pr=.9,xr=.9,Sr=.28,Mr=34,Ir=1;function Mt(e,h,y){return h>0?y<0?Math.floor(e/h)*h:Math.ceil(e/h)*h:e}function yn(e,h,y,o=e.current){let{bounds:n,stride:a,segments:r}=e,i=o;if(r<1)return i[0]||0;let l=(h-n.minLng)/(n.maxLng-n.minLng)*r,s=(y-n.minLat)/(n.maxLat-n.minLat)*r,c=Math.max(0,Math.min(r-1,Math.floor(l))),u=Math.max(0,Math.min(r-1,Math.floor(s))),d=ue(l-c,0,1),m=ue(s-u,0,1),f=u*a+c,p=i[f]*(1-d)+i[f+1]*d,g=i[f+a]*(1-d)+i[f+a+1]*d;return p*(1-m)+g*m}function Tr(e,h,y,o,n,a,r,i,l,s){let c=e.stride,u=e.current,d=e.bounds,m=Math.max(0,h.minRow),f=Math.min(c-1,h.maxRow),p=Math.max(0,h.minCol),g=Math.min(c-1,h.maxCol),v=g-p+1,A=f-m+1,w={minRow:m,maxRow:f,minCol:p,maxCol:g,changed:0};if(v<2||A<2)return w;let C=new Uint8Array(v*A);for(let E=0;E<y.length;E++){let I=y[E],D=I/c|0,V=I-D*c;D<m||D>f||V<p||V>g||(C[(D-m)*v+(V-p)]=1);}let _=a*a,P=0,b=1/0,x=-1/0,T=1/0,S=-1/0,M=(E,I,D,V)=>{let W=E*c+I,z=D*c+V;if(!e.inside[W])return;let G=(E-m)*v+(I-p),X=(D-m)*v+(V-p);if(!C[G]&&!C[X])return;let j=u[W],K=u[z];if(n){if(K-j<=o)return;if(a>0){let R=(d.minLng+I*e.dLng-r)*l,O=(d.minLat+E*e.dLat-i)*ke;if(R*R+O*O>_)return}u[W]=K-o;}else {if(j-K<=o)return;if(a>0){let R=(d.minLng+I*e.dLng-r)*l,O=(d.minLat+E*e.dLat-i)*ke;if(R*R+O*O>_)return}u[W]=K+o;}C[G]=1,P++,E<b&&(b=E),E>x&&(x=E),I<T&&(T=I),I>S&&(S=I);};for(let E=0;E<s;E++){for(let I=m;I<=f;I++)for(let D=p;D<=g;D++)I>m&&M(I,D,I-1,D),D>p&&M(I,D,I,D-1);for(let I=f;I>=m;I--)for(let D=g;D>=p;D--)I<f&&M(I,D,I+1,D),D<g&&M(I,D,I,D+1);}return P?{minRow:b,maxRow:x,minCol:T,maxCol:S,changed:P}:w}function Cn(e,h){var K,R,O,q,Z,le;let y=h.mode,o=Math.max(.5,h.radius),n=ue((K=h.strength)!=null?K:Ir,.01,1),a=Math.max(.01,(R=h.maxDelta)!=null?R:4),r=ue((O=h.hardness)!=null?O:Pr,0,.95),i=ue((q=h.reposeDeg)!=null?q:Mr,5,80),l=Math.max(0,Math.min(500,(Z=h.strokeLimit)!=null?Z:vr)),s=qe(h.lat),c=y==="smooth"?0:ue((le=h.roughness)!=null?le:Sr,0,1),u=Math.max(e.dLat*ke,Math.abs(e.dLng)*s)||1,d=Math.max(o*.55,u*2.4),m=Math.max(o*.38,u*3.5),f=c>0,p=ue(Math.max(a*xr,u*.6),u*.45,o*.35),g=y==="smooth",v=g?0:Math.min(o*r,o-p),A=g?o:v+p,w=A*(1+c*.55),C=w/s,_=w/ke,P=e.bounds;if(h.lng<P.minLng-C||h.lng>P.maxLng+C||h.lat<P.minLat-_||h.lat>P.maxLat+_)return null;let b=Math.max(0,Math.floor((h.lng-C-P.minLng)/e.dLng)),x=Math.min(e.stride-1,Math.ceil((h.lng+C-P.minLng)/e.dLng)),T=Math.max(0,Math.floor((h.lat-_-P.minLat)/e.dLat)),S=Math.min(e.stride-1,Math.ceil((h.lat+_-P.minLat)/e.dLat)),M=yn(e,h.lng,h.lat),E=h.targetHeight;(E==null||!Number.isFinite(E))&&(y==="lower"?E=Mt(M-a,a,-1):y==="raise"?E=Mt(M+a,a,1):E=M);let I=E,D=0,V=0,W=[];for(let ie=T;ie<=S;ie++){let ce=P.minLat+ie*e.dLat,ve=(ce-h.lat)*ke;for(let _e=b;_e<=x;_e++){let Ae=ie*e.stride+_e;if(!e.inside[Ae])continue;let Me=P.minLng+_e*e.dLng,we=(Me-h.lng)*s,Ge=Math.sqrt(we*we+ve*ve);if(Ge>w)continue;let ot=o;if(f){let F=Me*s,N=ce*ke,U=(fn(F/d,N/d)-.5)*2,Y=1-Math.abs(U),ne=(fn(F/m+37.2,N/m+11.9)-.5)*2;ot=o*(1+c*(.3*U-.16*Y*Y+.22*ne));}if(Ge>ot)continue;let Je=ue(g?1-Ge/ot:(A-Ge)/p,0,1);if(Je<=0)continue;let xe=e.current[Ae],Ie;if(y==="smooth"){let F=Er(e,ie,_e);Ie=xe+(F-xe)*ue(Je*1.4,0,1);}else if(Ie=xe+(I-xe)*Je*n,Je>=1){let F=Math.abs(Ie-I);F>V&&(V=F);}let L=h.strokeBase;if(L&&l>0){let F=a*l;Ie>L[Ae]+F?Ie=L[Ae]+F:Ie<L[Ae]-F&&(Ie=L[Ae]-F);}Ie!==xe&&(e.current[Ae]=Ie,D++,W.push(Ae));}}let z=T,G=S,X=b,j=x;if(y!=="smooth"&&W.length){let ie=Math.tan(i*Math.PI/180),ce=Math.max(.05,u*ie),ve=yn(e,h.lng,h.lat,e.base),_e=Math.abs(ve-I),Ae=Math.min(o*3,o+_e/ie+u*2),Me=Math.ceil(Ae/u)+1,we=Tr(e,{minRow:T-Me,maxRow:S+Me,minCol:b-Me,maxCol:x+Me},W,ce,y==="raise",Ae,h.lng,h.lat,s,Math.max(2,Math.min(12,Math.ceil(_e/ce)+1)));we.changed>0&&(D+=we.changed,we.minRow<z&&(z=we.minRow),we.maxRow>G&&(G=we.maxRow),we.minCol<X&&(X=we.minCol),we.maxCol>j&&(j=we.maxCol));}return {minRow:z,maxRow:G,minCol:X,maxCol:j,changed:D,target:I,gap:V}}function Er(e,h,y){let o=e.stride,n=0,a=0;for(let r=-1;r<=1;r++){let i=h+r;if(!(i<0||i>=o))for(let l=-1;l<=1;l++){let s=y+l;if(s<0||s>=o)continue;let c=i*o+s;e.inside[c]&&(n+=e.current[c],a++);}}return a?n/a:e.current[h*o+y]}function _n(e,h=12){let y=Math.max(.2,e/Math.max(1,h)),o=Math.pow(10,Math.floor(Math.log10(y))),n=y/o;return (n<=1?1:n<=2?2:n<=5?5:10)*o}function bn(e,h,y=e.current){let o=h>0?h:5,n=e.stride,a=[],r=(i,l,s,c)=>{i===0?a.push(l,s+c):i===1?a.push(l+c,s+1):i===2?a.push(l+1,s+c):a.push(l+c,s);};for(let i=0;i<e.segments;i++)for(let l=0;l<e.segments;l++){let s=i*n+l,c=s+1,u=s+n,d=u+1;if(!(e.inside[s]&&e.inside[c]&&e.inside[u]&&e.inside[d]))continue;let m=y[s],f=y[c],p=y[u],g=y[d],v=Math.min(m,f,p,g),A=Math.max(m,f,p,g);if(A-v<1e-6)continue;let w=Math.ceil(v/o),C=Math.floor(A/o);for(let _=w;_<=C;_++){let P=_*o;if(P<=v||P>=A)continue;let b=[],x=(T,S,M)=>{if(S<P&&M>=P||M<P&&S>=P){let E=(P-S)/(M-S);E>=0&&E<=1&&b.push(T,E);}};x(0,m,f),x(1,f,g),x(2,p,g),x(3,m,p),b.length===4?(r(b[0],i,l,b[1]),r(b[2],i,l,b[3])):b.length>=8&&(r(b[0],i,l,b[1]),r(b[2],i,l,b[3]),r(b[4],i,l,b[5]),r(b[6],i,l,b[7]));}}return new Float32Array(a)}var Lr=156543.03392804097;function Xt(e,h,y){return e<h?h:e>y?y:e}async function kr(e,h,y,o={}){var D,V,W;if(typeof document=="undefined")return null;let n=h&&(h.imageryProvider||h.provider);if(!n||typeof n.requestImage!="function"||!n.tilingScheme)return null;let a=n.tilingScheme;if(typeof a.positionToTileXY!="function"||typeof a.tileXYToRectangle!="function")return null;if(n.readyPromise&&n.ready===false)try{await n.readyPromise;}catch{return null}let r=y.maxLng-y.minLng,i=y.maxLat-y.minLat;if(!(r>0)||!(i>0))return null;let l=Xt(Math.round((D=o.maxSize)!=null?D:2048),256,4096),s=Xt(Math.round((V=o.maxTiles)!=null?V:64),1,256),c=Math.max(.05,(W=o.metersPerPixel)!=null?W:1.2),u=(y.minLat+y.maxLat)/2,d=r*111319.49*Math.cos(u*Math.PI/180),m=i*111319.49,f=(z,G)=>e.Cartographic.fromRadians(z*Math.PI/180,G*Math.PI/180,0),p=Math.log2(Lr*Math.cos(u*Math.PI/180)/c),g=n.maximumLevel!=null?n.maximumLevel:19,v=n.minimumLevel!=null?n.minimumLevel:0,A=Xt(Math.floor(p),v,Math.min(g,19)),w=z=>{let G=a.positionToTileXY(f(y.minLng,y.minLat),z),X=a.positionToTileXY(f(y.maxLng,y.maxLat),z);return !G||!X?null:{x0:Math.min(G.x,X.x),x1:Math.max(G.x,X.x),y0:Math.min(G.y,X.y),y1:Math.max(G.y,X.y)}},C=w(A);for(;C&&(C.x1-C.x0+1)*(C.y1-C.y0+1)>s&&A>v;)A--,C=w(A);if(!C)return null;let _=m/Math.max(1,d),P=Math.round(d>=m?l:l/Math.max(.05,_)),b=Math.round(P*_),x=document.createElement("canvas");x.width=Math.max(64,P),x.height=Math.max(64,b);let T=x.getContext("2d");if(!T)return null;T.fillStyle="#6b6f5f",T.fillRect(0,0,x.width,x.height);let S=z=>z*180/Math.PI,M=[],E=0;for(let z=C.y0;z<=C.y1;z++)for(let G=C.x0;G<=C.x1;G++){let X=a.tileXYToRectangle(G,z,A);if(!X)continue;let j=S(X.west),K=S(X.east),R=S(X.south),O=S(X.north),q=(j-y.minLng)/r*x.width,Z=(y.maxLat-O)/i*x.height,le=(K-j)/r*x.width,ie=(O-R)/i*x.height;q+le<0||q>x.width||Z+ie<0||Z>x.height||M.push(Promise.resolve().then(()=>n.requestImage(G,z,A)).then(ce=>{if(!ce)return;let ve=ce.width||ce.naturalWidth||0,_e=ce.height||ce.naturalHeight||0;if(!(!ve||!_e))try{T.drawImage(ce,0,0,ve,_e,q,Z,le,ie),E++;}catch{}}).catch(()=>{}));}if(await Promise.all(M),!E)return null;let I=(z,G)=>[(z-y.minLng)/r,(G-y.minLat)/i];return {canvas:x,width:x.width,height:x.height,level:A,tiles:E,uv:I}}async function Pn(e,h,y,o={}){for(let n of h||[])if(!(!n||n.show===false))try{let a=await kr(e,n,y,o);if(a)return a}catch{}return null}var Dr=140,Rr=250,Br=.1,Gr=1,at={x:.35,y:1,z:.3},Or=`
1028
+ \u7A7A\u95F4\u8DDD\u79BB: `+j.toFixed(2)+`m
1029
+ \u662F\u5426\u53EF\u89C6: `+H;d&&d[0]&&(d[0].label={text:q,showBackground:true,font:"14px monospace",fillColor:e.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:e.VerticalOrigin.BOTTOM,horizontalOrigin:e.HorizontalOrigin.LEFT});};var c=l.positions,h=l.that,d=[],m=[],y=[],p=c[0],g=c[1];d=h.$graphics.createPointsGraphics({point:true,positions:[p,g]});var v=h.$math3d.getIntersectObj(p,g,d,true);if(!v||v.length===0)return alert("\u6CA1\u6709\u53D6\u5230\u76F8\u4EA4\u70B9 , \u8BF7\u68C0\u67E5\u662F\u5426\u5F00\u542F\u6DF1\u5EA6\u68C0\u6D4B\u3002"),false;b();}o.prototype.remove=function(){};}function r(l){if(!l&&!l.center&&!l.radius&&l.that)return alert("\u6CA1\u6709\u83B7\u53D6\u5230\u5206\u6790\u53C2\u6570"),false;var c=l.that,h=this;if(!c._viewer.scene.globe.depthTestAgainstTerrain)return alert("\u8BF7\u5F00\u542F\u6DF1\u5EA6\u68C0\u6D4B"),false;var d=l.viewHeight||10,m=e.Cartographic.fromCartesian(l.center);try{var y=l.radius,p={semiMinorAxis:y,semiMajorAxis:y,rotation:0,center:l.center,granularity:Math.PI/30};let g=c.computeEllipseEdgePositions(p);for(let v=0;v<g.outerPositions.length;v+=3){let A=new e.Cartesian3(g.outerPositions[v],g.outerPositions[v+1],g.outerPositions[v+2]),w=e.Cartographic.fromCartesian(A),C=5e-4*Math.PI/180,b=c.computeInterpolateLineCartographic(m,w,C);c.computeCartographicPointsTerrainData(b||[],function(P){if(P.length>0){let _=!0,S=[],I=[];for(let x=1;x<P.length;x++){let M=!0;if(x>1){let E=new e.Cartographic(P[0].longitude,P[0].latitude,P[0].height+d);if(_)c.computeInterpolateIndexLineHeightCartographic(E,P[x],x,x-1).height>=P[x-1].height?(_=!0,M=!0):(_=!1,M=!1);else {let R=c.computeInterpolateIndexLineHeightCartographic(E,P[x],x,x-1);for(let O=0;O<R.length;O++)if(R[O].height>=P[O].height)_=!0,M=!0;else {_=!1,M=!1;break}}}let T=e.Cartesian3.fromRadians(P[x].longitude,P[x].latitude,P[x].height+1);S.push(T),M?(I.push(0),I.push(0),I.push(1),I.push(1)):(I.push(1),I.push(0),I.push(0),I.push(1));}h._pointsKSYResult=new e.Scene.PointsPrimitive({viewer:c._viewer,Cartesians:S,Colors:I});}else alert("\u9AD8\u7A0B\u5F02\u5E38\uFF01");});}}catch(g){console.log(g);}r.prototype.remove=function(){};}function i(l){if(l&&l.positions){let p=function(g,v){for(var A=e.Cartographic.fromCartesian(g),w=[A],C=10,b=new e.Cartesian3,P=[0],_=[0],S=0,I=1;I<=C;I++){e.Cartesian3.lerp(g,v,I/C,b);var x=e.Cartographic.fromCartesian(b),M=h._viewer.scene.globe.getHeight(x);x.height=M,w.push(x);var T=w[I-1],E=e.Cartesian3.distance(e.Cartographic.toCartesian(T),e.Cartographic.toCartesian(x));_.push(_[I-1]+E),S=Math.asin((x.height-T.height)/E),P.push(Math.tan(S)*100);}var R=document.createElement("div");R.className="echart-viewer",h._viewer.container.appendChild(R),R.style.position="absolute",R.style.left="20px",R.style.bottom="20px",R.style.height="300px",R.style.width="640px",R.style.overflow="hidden",R.style.zIndex="9999",R.style.opacity="0.9";var O=f.init(R),U={title:{text:"\u5256\u9762\u793A\u610F\u56FE",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:false,feature:{mark:{show:true},dataView:{show:true,readOnly:false},magicType:{show:true,type:["line","bar"]},restore:{show:true},saveAsImage:{show:true}}},calculable:true,xAxis:[{type:"category",name:"\u957F\u5EA6(\u7C73)",boundaryGap:false,data:_,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"\u5761\u5EA6\uFF08%\uFF09",axisLabel:{formatter:function(z){return z.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"\u5761\u5EA6",type:"line",areaStyle:{},smooth:true,data:P,markPoint:{data:[{type:"max",name:"\u6700\u5927\u503C"},{type:"min",name:"\u6700\u5C0F\u503C"}]},markLine:{data:[{type:"average",name:"\u5E73\u5747\u503C"}]}}]};return O.setOption(U),O};var c=l.positions,h=l.that,d=c[0],m=c[1];p(d,m);}i.prototype.remove=function(){};}function s(l){if(l&&l.positions&&l.that){var c=l.that,h=l.positions,d=true,m=this;g(h);}function y(v){for(var A=[],w=[],C=0;C<v.length;C++){var b=e.Cartographic.fromCartesian(v[C]);A.push(b.longitude),w.push(b.latitude);}var P=0,_=0,S=0,I=0,x=0,M=0,T=0,E=0;for(C=0;C<v.length;C++)P=A[C],_=w[C],C==v.length-1?(S=A[0],I=w[0]):(S=A[C+1],I=w[C+1]),M=P*I-S*_,x+=M,T+=(P+S)*M,E+=(_+I)*M;return x*=.5,T/=6*x,E/=6*x,new e.Cartographic(T,E)}function p(v,A,w){var C=e.Cartesian3.distance(v,A),b=e.Cartesian3.distance(A,w),P=e.Cartesian3.distance(w,v),_=(C+b+P)/2;return Math.sqrt(_*(_-C)*(_-b)*(_-P))}function g(v){var A=c._viewer.terrainProvider.availability;if(!A)return alert("\u672A\u83B7\u53D6\u5230\u5730\u5F62"),false;var C=15e3,b=Math.PI/Math.pow(2,11);b=b/64;var P=e.PolygonGeometry.fromPositions({positions:v,vertexFormat:e.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:b}),_=e.PolygonGeometry.createGeometry(P),S=0,I=0,x,M,T,E,R,O,U,z,V,j,H,q,k=new e.Cartesian3,G,Y,Q;for(let ce=0;ce<_.indices.length;ce+=3)if(x=_.indices[ce],M=_.indices[ce+1],T=_.indices[ce+2],Q=_.attributes.position.values,k.x=Q[x*3],k.y=Q[x*3+1],k.z=Q[x*3+2],G=e.Cartographic.fromCartesian(k),E=c._viewer.scene.globe.getHeight(G),U=e.Cartesian3.fromRadians(G.longitude,G.latitude,E),j=e.Cartesian3.fromRadians(G.longitude,G.latitude,0),I<E&&(I=E),k.x=Q[M*3],k.y=Q[M*3+1],k.z=Q[M*3+2],G=e.Cartographic.fromCartesian(k),R=c._viewer.scene.globe.getHeight(G),z=e.Cartesian3.fromRadians(G.longitude,G.latitude,R),H=e.Cartesian3.fromRadians(G.longitude,G.latitude,0),I<R&&(I=R),k.x=Q[T*3],k.y=Q[T*3+1],k.z=Q[T*3+2],G=e.Cartographic.fromCartesian(k),O=c._viewer.scene.globe.getHeight(G),V=e.Cartesian3.fromRadians(G.longitude,G.latitude,O),q=e.Cartesian3.fromRadians(G.longitude,G.latitude,0),I<O&&(I=O),Y=p(j,H,q),S=S+Y*(E-C+R-C+O-C)/3,d){var ie=[];ie.push(U),ie.push(z),ie.push(V);var le={polygon:{hierarchy:{positions:ie},extrudedHeight:0,perPositionHeight:true,material:e.Color.fromRandom().withAlpha(.5),outline:true,closeTop:true,closeBottom:true,outlineColor:e.Color.WHITE,outlineWidth:2}};c._analysisLayer.entities.add(le);}var ue=y(v);return m._volumeLabel=c._analysisLayer.entities.add({position:e.Cartesian3.fromRadians(ue.longitude,ue.latitude,I+1e3),label:{text:"Cut Volume "+S.toString()+"m3"}}),I}s.prototype.remove=function(){};}return n}var yt=re(_r);var Ee={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},Pr={},D={PlotUtils:Pr,Constants:Ee};D.PlotUtils.distance=function(e,u){return Math.sqrt(Math.pow(e[0]-u[0],2)+Math.pow(e[1]-u[1],2))};D.PlotUtils.wholeDistance=function(e){let u=0;for(let f=0;f<e.length-1;f++)u+=D.PlotUtils.distance(e[f],e[f+1]);return u};D.PlotUtils.getBaseLength=function(e){return Math.pow(D.PlotUtils.wholeDistance(e),.99)};D.PlotUtils.mid=function(e,u){return [(e[0]+u[0])/2,(e[1]+u[1])/2]};D.PlotUtils.getCircleCenterOfThreePoints=function(e,u,f){let a=[(e[0]+u[0])/2,(e[1]+u[1])/2],n=[a[0]-e[1]+u[1],a[1]+e[0]-u[0]],o=[(e[0]+f[0])/2,(e[1]+f[1])/2],r=[o[0]-e[1]+f[1],o[1]+e[0]-f[0]];return D.PlotUtils.getIntersectPoint(a,n,o,r)};D.PlotUtils.getIntersectPoint=function(e,u,f,a){let n,o,r,i;return e[1]==u[1]?(i=(a[0]-f[0])/(a[1]-f[1]),n=i*(e[1]-f[1])+f[0],o=e[1],[n,o]):f[1]==a[1]?(r=(u[0]-e[0])/(u[1]-e[1]),n=r*(f[1]-e[1])+e[0],o=f[1],[n,o]):(r=(u[0]-e[0])/(u[1]-e[1]),i=(a[0]-f[0])/(a[1]-f[1]),o=(r*e[1]-e[0]-i*f[1]+f[0])/(r-i),n=r*o-r*e[1]+e[0],[n,o])};D.PlotUtils.getAzimuth=function(e,u){let f=0,a=Math.asin(Math.abs(u[1]-e[1])/D.PlotUtils.distance(e,u));return u[1]>=e[1]&&u[0]>=e[0]?f=a+Math.PI:u[1]>=e[1]&&u[0]<e[0]?f=Ee.TWO_PI-a:u[1]<e[1]&&u[0]<e[0]?f=a:u[1]<e[1]&&u[0]>=e[0]&&(f=Math.PI-a),f};D.PlotUtils.getAngleOfThreePoints=function(e,u,f){let a=D.PlotUtils.getAzimuth(u,e)-D.PlotUtils.getAzimuth(u,f);return 0>a?a+Ee.TWO_PI:a};D.PlotUtils.isClockWise=function(e,u,f){return (f[1]-e[1])*(u[0]-e[0])>(u[1]-e[1])*(f[0]-e[0])};D.PlotUtils.getPointOnLine=function(e,u,f){let a=u[0]+e*(f[0]-u[0]),n=u[1]+e*(f[1]-u[1]);return [a,n]};D.PlotUtils.getCubicValue=function(e,u,f,a,n){e=Math.max(Math.min(e,1),0);let o=1-e,r=e*e,i=r*e,s=o*o,l=s*o,c=l*u[0]+3*s*e*f[0]+3*o*r*a[0]+i*n[0],h=l*u[1]+3*s*e*f[1]+3*o*r*a[1]+i*n[1];return [c,h]};D.PlotUtils.getThirdPoint=function(e,u,f,a,n){let o=D.PlotUtils.getAzimuth(e,u),r=n?o+f:o-f,i=a*Math.cos(r),s=a*Math.sin(r);return [u[0]+i,u[1]+s]};D.PlotUtils.getArcPoints=function(e,u,f,a){let n,o,r=[],i=a-f;i=0>i?i+Ee.TWO_PI:i;for(let s=0;s<=Ee.FITTING_COUNT;s++){let l=f+i*s/Ee.FITTING_COUNT;n=e[0]+u*Math.cos(l),o=e[1]+u*Math.sin(l),r.push([n,o]);}return r};D.PlotUtils.getBisectorNormals=function(e,u,f,a){let n,o,r=D.PlotUtils.getNormal(u,f,a),i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),s=r[0]/i,l=r[1]/i,c=D.PlotUtils.distance(u,f),h=D.PlotUtils.distance(f,a),d,m,y;return i>Ee.ZERO_TOLERANCE?D.PlotUtils.isClockWise(u,f,a)?(d=e*c,m=f[0]-d*l,y=f[1]+d*s,n=[m,y],d=e*h,m=f[0]+d*l,y=f[1]-d*s,o=[m,y]):(d=e*c,m=f[0]+d*l,y=f[1]-d*s,n=[m,y],d=e*h,m=f[0]-d*l,y=f[1]+d*s,o=[m,y]):(m=f[0]+e*(u[0]-f[0]),y=f[1]+e*(u[1]-f[1]),n=[m,y],m=f[0]+e*(a[0]-f[0]),y=f[1]+e*(a[1]-f[1]),o=[m,y]),[n,o]};D.PlotUtils.getNormal=function(e,u,f){let a=e[0]-u[0],n=e[1]-u[1],o=Math.sqrt(a*a+n*n);a/=o,n/=o;let r=f[0]-u[0],i=f[1]-u[1],s=Math.sqrt(r*r+i*i);r/=s,i/=s;let l=a+r,c=n+i;return [l,c]};D.PlotUtils.getCurvePoints=function(e,u){let f,a,n,o,i=[D.PlotUtils.getLeftMostControlPoint(u)],s=0;for(s=0;s<u.length-2;s++)f=u[s],a=u[s+1],n=u[s+2],o=D.PlotUtils.getBisectorNormals(e,f,a,n),i=i.concat(o);let l=D.PlotUtils.getRightMostControlPoint(u);i.push(l);let c=[];for(s=0;s<u.length-1;s++){f=u[s],a=u[s+1],c.push(f);for(let h=0;h<Ee.FITTING_COUNT;h++){let d=D.PlotUtils.getCubicValue(h/Ee.FITTING_COUNT,f,i[2*s],i[2*s+1],a);c.push(d);}c.push(a);}return c};D.PlotUtils.getLeftMostControlPoint=function(e){let u=e[0],f=e[1],a=e[2],o=D.PlotUtils.getBisectorNormals(0,u,f,a)[0],r=D.PlotUtils.getNormal(u,f,a),i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),s,l;if(i>Ee.ZERO_TOLERANCE){let c=D.PlotUtils.mid(u,f),h=u[0]-c[0],d=u[1]-c[1],y=2/D.PlotUtils.distance(u,f),p=-y*d,g=y*h,v=p*p-g*g,A=2*p*g,w=g*g-p*p,C=o[0]-c[0],b=o[1]-c[1];s=c[0]+v*C+A*b,l=c[1]+A*C+w*b;}else s=u[0]+t*(f[0]-u[0]),l=u[1]+t*(f[1]-u[1]);return [s,l]};D.PlotUtils.getRightMostControlPoint=function(e){let u=e.length,f=e[u-3],a=e[u-2],n=e[u-1],r=D.PlotUtils.getBisectorNormals(0,f,a,n)[1],i=D.PlotUtils.getNormal(f,a,n),s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l,c;if(s>Ee.ZERO_TOLERANCE){let h=D.PlotUtils.mid(a,n),d=n[0]-h[0],m=n[1]-h[1],p=2/D.PlotUtils.distance(a,n),g=-p*m,v=p*d,A=g*g-v*v,w=2*g*v,C=v*v-g*g,b=r[0]-h[0],P=r[1]-h[1];l=h[0]+A*b+w*P,c=h[1]+w*b+C*P;}else l=n[0]+t*(a[0]-n[0]),c=n[1]+t*(a[1]-n[1]);return [l,c]};D.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;let u=[],f=e.length-1;for(let a=0;1>=a;a+=.01){let n=0,o=0;for(let r=0;f>=r;r++){let i=D.PlotUtils.getBinomialFactor(f,r),s=Math.pow(a,r),l=Math.pow(1-a,f-r);n+=i*s*l*e[r][0],o+=i*s*l*e[r][1];}u.push([n,o]);}return u.push(e[f]),u};D.PlotUtils.getBinomialFactor=function(e,u){return D.PlotUtils.getFactorial(e)/(D.PlotUtils.getFactorial(u)*D.PlotUtils.getFactorial(e-u))};D.PlotUtils.getFactorial=function(e){if(1>=e)return 1;if(e==2)return 2;if(e==3)return 6;if(e==4)return 24;if(e==5)return 120;let u=1;for(let f=1;e>=f;f++)u*=f;return u};D.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;let u=2,f=[],a=e.length-u-1;f.push(e[0]);for(let n=0;a>=n;n++)for(let o=0;1>=o;o+=.05){let r=0,i=0;for(let s=0;u>=s;s++){let l=D.PlotUtils.getQuadricBSplineFactor(s,o);r+=l*e[n+s][0],i+=l*e[n+s][1];}f.push([r,i]);}return f.push(e[e.length-1]),f};D.PlotUtils.getQuadricBSplineFactor=function(e,u){return e==0?Math.pow(u-1,2)/2:e==1?(-2*Math.pow(u,2)+2*u+1)/2:e==2?Math.pow(u,2)/2:0};var te={version:"1.0.0",createTime:"2018.6.19",author:"xupinhui",algorithm:{}},tt={headHeightFactor:.25,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15},St={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},pt={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};te.algorithm.doubleArrow=function(e,u){let f=e,a={controlPoint:null,polygonalPoint:null},n=e.length;if(!(2>n)){if(n==2)return e;let o=f[0],r=f[1],i=f[2],s;n==3?s=te.algorithm.getTempPoint4(o,r,i):s=f[3];let l;n==3||n==4?l=D.PlotUtils.mid(o,r):l=f[4];let c,h;D.PlotUtils.isClockWise(o,r,i)?(c=te.algorithm.getArrowPoints(o,l,s,false),h=te.algorithm.getArrowPoints(l,r,i,true)):(c=te.algorithm.getArrowPoints(r,l,i,false),h=te.algorithm.getArrowPoints(l,o,s,true));let d=c.length,m=(d-5)/2,y=c.slice(0,m),p=c.slice(m,m+5),g=c.slice(m+5,d),v=h.slice(0,m),A=h.slice(m,m+5),w=h.slice(m+5,d);v=D.PlotUtils.getBezierPoints(v);let C=D.PlotUtils.getBezierPoints(w.concat(y.slice(1)));g=D.PlotUtils.getBezierPoints(g);let b=v.concat(A,C,p,g),P=te.algorithm.array2Dto1D(b);a.controlPoint=[o,r,i,s,l],a.polygonalPoint=u.Cartesian3.fromDegreesArray(P);}return a};te.algorithm.threeArrow=function(e){let u=e,f={controlPoint:null,polygonalPoint:null},a=e.length;if(a>=2){if(a==2)return e;let n=u[0],o=u[1],r=u[2],i,s;a==3?(i=te.algorithm.getTempPoint4(n,o,r),s=D.PlotUtils.mid(r,i)):(i=u[3],s=u[4]);let l;a<6?l=D.PlotUtils.mid(n,o):l=u[5];let c,h;D.PlotUtils.isClockWise(n,o,r)?(c=te.algorithm.getArrowPoints(n,l,i,false),h=te.algorithm.getArrowPoints(l,o,r,true)):(c=te.algorithm.getArrowPoints(o,l,r,false),h=te.algorithm.getArrowPoints(l,n,i,true));let d=c.length,m=(d-5)/2,y=c.slice(0,m),p=c.slice(m,m+5),g=c.slice(m+5,d),v=h.slice(0,m),A=h.slice(m,m+5),w=h.slice(m+5,d);v=D.PlotUtils.getBezierPoints(v);let C=D.PlotUtils.getBezierPoints(w.concat(y.slice(1)));g=D.PlotUtils.getBezierPoints(g);let b=v.concat(A,C,p,g),P=te.algorithm.array2Dto1D(b);f.controlPoint=[n,o,r,i,s,l],f.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(P);}return f};te.algorithm.array2Dto1D=function(e){let u=[];return e.forEach(function(f){u.push(f[0]),u.push(f[1]);}),u};te.algorithm.getArrowPoints=function(e,u,f,a){let n=tt.headHeightFactor,o=tt.headWidthFactor,r=tt.neckHeightFactor,i=tt.neckWidthFactor,s=D.PlotUtils.mid(e,u),l=D.PlotUtils.distance(s,f),c=D.PlotUtils.getThirdPoint(f,s,0,.3*l,true),h=D.PlotUtils.getThirdPoint(f,s,0,.5*l,true);c=D.PlotUtils.getThirdPoint(s,c,D.Constants.HALF_PI,l/5,a),h=D.PlotUtils.getThirdPoint(s,h,D.Constants.HALF_PI,l/4,a);let d=[s,c,h,f],m=te.algorithm.getArrowHeadPoints(d,n,o,r,i),y=m[0],p=m[4],g=D.PlotUtils.distance(e,u)/D.PlotUtils.getBaseLength(d)/2,v=te.algorithm.getArrowBodyPoints(d,y,p,g),A=v.length,w=v.slice(0,A/2),C=v.slice(A/2,A);return w.push(y),C.push(p),w=w.reverse(),w.push(u),C=C.reverse(),C.push(e),w.reverse().concat(m,C)};te.algorithm.getArrowHeadPoints=function(e,u,f,a,n){let o=tt.headHeightFactor,r=tt.headWidthFactor,s=D.PlotUtils.getBaseLength(e)*o,l=e[e.length-1],c=s*r,h=s*n,d=s*a,m=D.PlotUtils.getThirdPoint(e[e.length-2],l,0,s,true),y=D.PlotUtils.getThirdPoint(e[e.length-2],l,0,d,true),p=D.PlotUtils.getThirdPoint(l,m,D.Constants.HALF_PI,c,false),g=D.PlotUtils.getThirdPoint(l,m,D.Constants.HALF_PI,c,true),v=D.PlotUtils.getThirdPoint(l,y,D.Constants.HALF_PI,h,false),A=D.PlotUtils.getThirdPoint(l,y,D.Constants.HALF_PI,h,true);return [v,p,l,g,A]};te.algorithm.getArrowBodyPoints=function(e,u,f,a){let n=D.PlotUtils.wholeDistance(e),r=D.PlotUtils.getBaseLength(e)*a,i=D.PlotUtils.distance(u,f),s=(r-i)/2,l=0,c=[],h=[];for(let d=1;d<e.length-1;d++){let m=D.PlotUtils.getAngleOfThreePoints(e[d-1],e[d],e[d+1])/2;l+=D.PlotUtils.distance(e[d-1],e[d]);let y=(r/2-l/n*s)/Math.sin(m),p=D.PlotUtils.getThirdPoint(e[d-1],e[d],Math.PI-m,y,true),g=D.PlotUtils.getThirdPoint(e[d-1],e[d],m,y,false);c.push(p),h.push(g);}return c.concat(h)};te.algorithm.getTempPoint4=function(e,u,f){let a,n,o,r,i=D.PlotUtils.mid(e,u),s=D.PlotUtils.distance(i,f),l=D.PlotUtils.getAngleOfThreePoints(e,i,f);return l<D.Constants.HALF_PI?(n=s*Math.sin(l),o=s*Math.cos(l),r=D.PlotUtils.getThirdPoint(e,i,D.Constants.HALF_PI,n,false),a=D.PlotUtils.getThirdPoint(i,r,D.Constants.HALF_PI,o,true)):l>=D.Constants.HALF_PI&&l<Math.PI?(n=s*Math.sin(Math.PI-l),o=s*Math.cos(Math.PI-l),r=D.PlotUtils.getThirdPoint(e,i,D.Constants.HALF_PI,n,false),a=D.PlotUtils.getThirdPoint(i,r,D.Constants.HALF_PI,o,false)):l>=Math.PI&&l<1.5*Math.PI?(n=s*Math.sin(l-Math.PI),o=s*Math.cos(l-Math.PI),r=D.PlotUtils.getThirdPoint(e,i,D.Constants.HALF_PI,n,true),a=D.PlotUtils.getThirdPoint(i,r,D.Constants.HALF_PI,o,true)):(n=s*Math.sin(2*Math.PI-l),o=s*Math.cos(2*Math.PI-l),r=D.PlotUtils.getThirdPoint(e,i,D.Constants.HALF_PI,n,true),a=D.PlotUtils.getThirdPoint(i,r,D.Constants.HALF_PI,o,false)),a};te.algorithm.tailedAttackArrow=function(e,u){e=te.algorithm.dereplication(e);let f=St.tailWidthFactor,a=St.swallowTailFactor,n=St.swallowTailPnt||null,o={controlPoint:null,polygonalPoint:null};if(o.controlPoint=e,!(2>e.length)){if(e.length==2)return o.polygonalPoint=e,o;let i=e,s=i[0],l=i[1];D.PlotUtils.isClockWise(i[0],i[1],i[2])&&(s=i[1],l=i[0]);let h=[D.PlotUtils.mid(s,l)].concat(i.slice(2)),d=te.algorithm.getAttackArrowHeadPoints(h,s,l,St),m=d[0],y=d[4],p=D.PlotUtils.distance(s,l),g=D.PlotUtils.getBaseLength(h),v=g*f*a;n=D.PlotUtils.getThirdPoint(h[1],h[0],0,v,true);let A=p/g,w=te.algorithm.getAttackArrowBodyPoints(h,m,y,A),C=w.length,b=[s].concat(w.slice(0,C/2));b.push(m);let P=[l].concat(w.slice(C/2,C));P.push(y),b=D.PlotUtils.getQBSplinePoints(b),P=D.PlotUtils.getQBSplinePoints(P);let _=te.algorithm.array2Dto1D(b.concat(d,P.reverse(),[n,b[0]]));o.polygonalPoint=u.Cartesian3.fromDegreesArray(_);}return o};te.algorithm.getAttackArrowHeadPoints=function(e,u,f,a){let n=a.headHeightFactor,o=a.headTailFactor,r=a.headWidthFactor,i=a.neckWidthFactor,s=a.neckHeightFactor,l=D.PlotUtils.getBaseLength(e),c=l*n,h=e[e.length-1];l=D.PlotUtils.distance(h,e[e.length-2]);let d=D.PlotUtils.distance(u,f);c>d*o&&(c=d*o);let m=c*r,y=c*i;c>l&&(c=l);let p=c*s,g=D.PlotUtils.getThirdPoint(e[e.length-2],h,0,c,true),v=D.PlotUtils.getThirdPoint(e[e.length-2],h,0,p,true),A=D.PlotUtils.getThirdPoint(h,g,D.Constants.HALF_PI,m,false),w=D.PlotUtils.getThirdPoint(h,g,D.Constants.HALF_PI,m,true),C=D.PlotUtils.getThirdPoint(h,v,D.Constants.HALF_PI,y,false),b=D.PlotUtils.getThirdPoint(h,v,D.Constants.HALF_PI,y,true);return [C,A,h,w,b]};te.algorithm.getAttackArrowBodyPoints=function(e,u,f,a){let n=D.PlotUtils.wholeDistance(e),r=D.PlotUtils.getBaseLength(e)*a,i=D.PlotUtils.distance(u,f),s=(r-i)/2,l=0,c=[],h=[];for(let d=1;d<e.length-1;d++){let m=D.PlotUtils.getAngleOfThreePoints(e[d-1],e[d],e[d+1])/2;l+=D.PlotUtils.distance(e[d-1],e[d]);let y=(r/2-l/n*s)/Math.sin(m),p=D.PlotUtils.getThirdPoint(e[d-1],e[d],Math.PI-m,y,true),g=D.PlotUtils.getThirdPoint(e[d-1],e[d],m,y,false);c.push(p),h.push(g);}return c.concat(h)};te.algorithm.dereplication=function(e){let u=e[e.length-1],f=false,a=[];return a=e.filter(function(n){return n[0]!=u[0]&&n[1]!=u[1]?true:(f=true,false)}),f&&a.push(u),a};te.algorithm.fineArrow=function(e,u,f){if(e.length<2||u.length<2)return;let a=pt.tailWidthFactor,n=pt.neckWidthFactor,o=pt.headWidthFactor,r=pt.headAngle,i=pt.neckAngle,s=[];s[0]=e,s[1]=u;let l=s[0],c=s[1],h=D.PlotUtils.getBaseLength(s),d=h*a,m=h*n,y=h*o,p=D.PlotUtils.getThirdPoint(c,l,D.Constants.HALF_PI,d,true),g=D.PlotUtils.getThirdPoint(c,l,D.Constants.HALF_PI,d,false),v=D.PlotUtils.getThirdPoint(l,c,r,y,false),A=D.PlotUtils.getThirdPoint(l,c,r,y,true),w=D.PlotUtils.getThirdPoint(l,c,i,m,false),C=D.PlotUtils.getThirdPoint(l,c,i,m,true),b=[];return b.push(p[0],p[1],w[0],w[1],v[0],v[1],c[0],c[1],A[0],A[1],C[0],C[1],g[0],g[1],l[0],l[1]),b.some(_=>isNaN(_))?"":f.Cartesian3.fromDegreesArray(b)};var Le=function(e,u){this.viewer=e,this._Cesium=u,this.handler=new this._Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=this._Cesium.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=te,this.tooltip=new bt(e,u),this.tooltip.initTool();};Le.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1;};Le.prototype.disableHandler=function(){this._Cesium;this.handler&&(this.handler.destroy(),this.handler=new this._Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null);};var nt=function(e,u){Le.call(this,e,u),this._Cesium=u,this.type="AttackArrow",this.fillMaterial=this._Cesium.Color.RED.withAlpha(.5);};nt.prototype={disable:function(){var e=this._Cesium;this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var u=0;u<this.pointArr.length;u++)this.pointArr[u]&&this.viewer.entities.remove(this.pointArr[u]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var u=this._Cesium;let f=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,f=e.callback):f=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var a=this;this.state=1,this.handler||(this.handler=new u.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var o=gt(n.position,a.viewer);if(o){a.positions.length==0&&(a.floatPoint=a.creatPoint(o),a.floatPoint.wz=-1),a.positions.push(o);var r=a.creatPoint(o);a.positions.length>2?r.wz=a.positions.length-1:r.wz=a.positions.length,a.pointArr.push(r);}},u.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(!a.floatPoint||a.positions.length<2)){var o=gt(n.endPosition,a.viewer);o&&(a.floatPoint.position.setValue(o),a.tooltip.showAtCartesian(o,"\u53F3\u952E\u7ED3\u675F!"),a.positions.length>=2&&(u.defined(a.arrowEntity)?(a.positions.pop(),a.positions.push(o)):(a.positions.push(o),a.arrowEntity=a.showArrowOnMap(a.positions),a.arrowEntity.objId=a.objId,f&&f(a.objId))));}},u.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){var o=gt(n.position,a.viewer);if(o){for(var r=0;r<a.pointArr.length;r++)a.pointArr[r].show=false;a.floatPoint.show=false,a.viewer.entities.remove(a.floatPoint),a.floatPoint=null;var i=a.creatPoint(o);i.show=false,i.wz=a.positions.length,a.pointArr.push(i),a.handler.destroy(),a.handler=null,a.tooltip.setVisible(false),a.arrowEntity=null;}},u.ScreenSpaceEventType.RIGHT_CLICK);},createByData:function(e){var u=this._Cesium;this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var f=[],a=0;a<e.length;a++){var n=u.Cartesian3.fromDegrees(e[a][0],e[a][1]);f.push(n);}this.positions=f;for(var a=0;a<this.positions.length;a++){var o=this.creatPoint(this.positions[a]);o.show=false,o.wz=a+1,this.pointArr.push(o);}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId;},startModify:function(){var e=this._Cesium;this.state=2;for(var u=this,f=0;f<u.pointArr.length;f++)u.pointArr[f].show=true;this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(a){var n=u.viewer.scene.pick(a.position);if(e.defined(n)&&n.id)u.clickStep++,n.id.objId||(u.selectPoint=n.id);else {for(var o=0;o<u.pointArr.length;o++)u.pointArr[o].show=false;u.floatPoint&&(u.floatPoint.show=false),u.state=-1,u.modifyHandler.destroy(),u.modifyHandler=null,u.tooltip.setVisible(false);}if(u.clickStep==2){u.clickStep=0;var r=gt(a.position,u.viewer);if(!r)return;u.selectPoint&&(u.selectPoint.position.setValue(r),u.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(a){var n=gt(a.endPosition,u.viewer);if(n)if(u.tooltip.showAtCartesian(n,"\u5DE6\u952E\u9009\u53D6\u5706\u70B9\u5F00\u59CB\u4FEE\u6539\uFF0C\u5355\u51FB\u505C\u6B62\u4FEE\u6539\uFF0C\u70B9\u51FB\u56FE\u5F62\u4E4B\u5916\u7ED3\u675F!"),u.selectPoint)u.selectPoint.position.setValue(n),u.positions[u.selectPoint.wz-1]=n;else return},e.ScreenSpaceEventType.MOUSE_MOVE);},getLnglats:function(){for(var e=[],u=0;u<this.positions.length;u++){var f=this.cartesianToLatlng(this.positions[u]);e.push(f);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var u=this._Cesium,f=this.viewer.entities.add({position:e,point:{pixelSize:10,color:u.Color.YELLOW}});return f.attr="editPoint",f},showArrowOnMap:function(e){var u=this._Cesium,f=this,a=function(){if(e.length<3)return null;for(var n=[],o=0;o<e.length;o++){var r=f.cartesianToLatlng(e[o]);n.push(r);}var i=f.xp.algorithm.tailedAttackArrow(n,u),s=JSON.stringify(i.polygonalPoint).indexOf("null"),l=[];return s==-1&&(l=i.polygonalPoint),new u.PolygonHierarchy(l)};return this.viewer.entities.add({id:f.objId,polygon:new u.PolygonGraphics({hierarchy:new u.CallbackProperty(a,false),show:true,fill:true,material:f.fillMaterial})})},cartesianToLatlng:function(e){var u=this._Cesium,f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),a=u.Math.toDegrees(f.latitude),n=u.Math.toDegrees(f.longitude);return [n,a]}};nt.prototype=Object.create(Object.assign({},nt.prototype,Le.prototype));nt.prototype.constructor=nt;function gt(e,u){var f,a=u.camera.getPickRay(e);return a?(f=u.scene.globe.pick(a,u.scene),f):null}var Ye=nt;var rt=function(e,u){Le.call(this,e,u),this._Cesium=u,this.type="StraightArrow",this.fillMaterial=this._Cesium.Color.fromCssColorString("#0000FF").withAlpha(.8);};rt.prototype={disable:function(){var e=this._Cesium;this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var u=this._Cesium;let f=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,f=e.callback):f=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var a=this;this.state=1,this.handler||(this.handler=new u.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var o=Mt(n.position,a.viewer);o&&(a.positions.length==0&&(a.firstPoint=a.creatPoint(o),a.firstPoint.type="firstPoint",a.floatPoint=a.creatPoint(o),a.floatPoint.type="floatPoint",a.positions.push(o),a.firstPoint.position.setValue(o),a.firstPoint.show=true),a.positions&&a.positions.length==3&&(a.firstPoint.show=false,a.floatPoint.show=false,a.handler.destroy(),a.handler=null,a.tooltip.setVisible(false),a.arrowEntity=null),a.positions.push(o.clone()));},u.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(a.positions.length<1)){var o=Mt(n.endPosition,a.viewer);o&&(a.tooltip.showAtCartesian(o,"\u5DE6\u952E\u5355\u51FB\u7ED3\u675F!"),a.floatPoint.position.setValue(o),a.positions.length>=2&&(u.defined(a.arrowEntity)?(a.positions.pop(),a.positions.push(o)):(a.positions.push(o),a.arrowEntity=a.showArrowOnMap(a.positions),f&&f(a.objId))));}},u.ScreenSpaceEventType.MOUSE_MOVE);},startModify:function(){var e=this._Cesium;this.state=2,this.firstPoint.show=true,this.floatPoint.show=true;var u=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){var a=u.viewer.scene.pick(f.position);if(e.defined(a)&&a.id?(u.clickStep++,a.id.objId||(u.selectPoint=a.id)):(u.modifyHandler.destroy(),u.modifyHandler=null,u.firstPoint.show=false,u.floatPoint.show=false,u.state=-1,u.tooltip.setVisible(false)),u.clickStep==2){u.clickStep=0;var n=Mt(f.position,u.viewer);if(!n)return;u.selectPoint&&u.selectPoint.position&&(u.selectPoint.position.setValue(n),u.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){var a=Mt(f.endPosition,u.viewer);if(a)if(u.tooltip.showAtCartesian(a,"\u5DE6\u952E\u9009\u53D6\u5706\u70B9\u5F00\u59CB\u4FEE\u6539\uFF0C\u5355\u51FB\u505C\u6B62\u4FEE\u6539\uFF0C\u70B9\u51FB\u56FE\u5F62\u4E4B\u5916\u7ED3\u675F!"),u.selectPoint&&u.selectPoint.position)u.selectPoint.position.setValue(a),u.selectPoint.type=="firstPoint"&&(u.positions[1]=a),u.selectPoint.type=="floatPoint"&&(u.positions[2]=a);else return},e.ScreenSpaceEventType.MOUSE_MOVE);},createByData:function(e){var u=this._Cesium;this.state=-1,this.positions=[];for(var f=[],a=0;a<e.length;a++){var n=u.Cartesian3.fromDegrees(e[a][0],e[a][1]);f.push(n);}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=false,this.floatPoint.show=false,this.arrowEntity.objId=this.objId;},getLnglats:function(){for(var e=[],u=0;u<this.positions.length;u++){var f=this.cartesianToLatlng(this.positions[u]);e.push(f);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var u=this._Cesium,f=this.viewer.entities.add({position:e,point:{pixelSize:10,color:u.Color.RED}});return f.attr="editPoint",f},showArrowOnMap:function(e){var u=this._Cesium,f=this,a=function(){if(e.length<2)return null;var n=e[1],o=e[2],r=f.cartesianToLatlng(n),i=f.cartesianToLatlng(o),s=[],l=f.xp.algorithm.fineArrow([r[0],r[1]],[i[0],i[1]],u),c=JSON.stringify(l).indexOf("null");if(c!=-1)return [];for(var h=l,d=0;d<h.length;d++){var m=new u.Cartesian3(h[d].x,h[d].y,h[d].z);s.push(m);}return new u.PolygonHierarchy(s)};return this.viewer.entities.add({id:f.objId,polygon:new u.PolygonGraphics({hierarchy:new u.CallbackProperty(a,false),show:true,fill:true,material:f.fillMaterial})})},cartesianToLatlng:function(e){var u=this._Cesium,f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),a=u.Math.toDegrees(f.latitude),n=u.Math.toDegrees(f.longitude);return [n,a]}};rt.prototype=Object.create(Object.assign({},rt.prototype,Le.prototype));rt.prototype.constructor=rt;function Mt(e,u){var f,a=u.camera.getPickRay(e);return a?(f=u.scene.globe.pick(a,u.scene),f):null}var qe=rt;var it=function(e,u){Le.call(this,e,u),this._Cesium=u,this.type="PincerArrow",this.fillMaterial=this._Cesium.Color.YELLOW.withAlpha(.8);};it.prototype={disable:function(){var e=this._Cesium;this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var u=0;u<this.pointArr.length;u++)this.pointArr[u]&&this.viewer.entities.remove(this.pointArr[u]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var u=this._Cesium;let f=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,f=e.callback):f=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var a=this;this.state=1,this.handler||(this.handler=new u.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var o=vt(n.position,a.viewer);if(o)if(a.positions.length==0&&(a.floatPoint=a.creatPoint(o)),a.positions.length>4){var r=a.creatPoint(o);r.wz=a.positions.length,a.pointArr.push(r);for(var i=0;i<a.pointArr.length;i++)a.pointArr[i].show=false;a.floatPoint&&(a.floatPoint.show=false,a.viewer.entities.remove(a.floatPoint),a.floatPoint=null);}else {a.positions.push(o);var r=a.creatPoint(o);a.positions.length>2?r.wz=a.positions.length-1:r.wz=a.positions.length,a.pointArr.push(r);}},u.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(!a.floatPoint||a.positions.length<2)){var o=vt(n.endPosition,a.viewer);o&&(a.floatPoint.position.setValue(o),a.tooltip.showAtCartesian(o,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),a.positions.length>=2&&(u.defined(a.arrowEntity)?(a.positions.pop(),a.positions.push(o)):(a.positions.push(o),a.arrowEntity=a.showArrowOnMap(a.positions),a.arrowEntity.objId=a.objId,f&&f(a.objId))));}},u.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){if(a.positions.length>=4){var o=vt(n.position,a.viewer);if(!o)return;for(var r=0;r<a.pointArr.length;r++)a.pointArr[r].show=false;a.floatPoint&&(a.floatPoint.show=false),a.viewer.entities.remove(a.floatPoint),a.floatPoint=null;var i=a.creatPoint(o);i.show=false,i.wz=a.positions.length,a.pointArr.push(i),a.handler.destroy(),a.handler=null,a.tooltip.setVisible(false),a.arrowEntity=null;}},u.ScreenSpaceEventType.RIGHT_CLICK);},createByData:function(e){var u=this._Cesium;this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var f=[],a=0;a<e.length;a++){var n=u.Cartesian3.fromDegrees(e[a][0],e[a][1]);f.push(n);}this.positions=f;for(var a=0;a<this.positions.length;a++){var o=this.creatPoint(this.positions[a]);o.show=false,o.wz=a+1,this.pointArr.push(o);}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId;},startModify:function(){var e=this._Cesium;this.state=2;var u=this;for(let f=0;f<u.pointArr.length;f++)u.pointArr[f].show=true;this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){var a=u.viewer.scene.pick(f.position);if(e.defined(a)&&a.id)u.clickStep++,a.id.objId||(u.selectPoint=a.id);else {for(let o=0;o<u.pointArr.length;o++)u.pointArr[o].show=false;u.state=-1,u.modifyHandler.destroy(),u.modifyHandler=null,u.tooltip.setVisible(false);}if(u.clickStep==2){u.clickStep=0;var n=vt(f.position,u.viewer);if(!n)return;u.selectPoint&&(u.selectPoint.position.setValue(n),u.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){var a=vt(f.endPosition,u.viewer);if(a)if(u.tooltip.showAtCartesian(a,"\u5DE6\u952E\u9009\u53D6\u5706\u70B9\u5F00\u59CB\u4FEE\u6539\uFF0C\u5355\u51FB\u505C\u6B62\u4FEE\u6539\uFF0C\u70B9\u51FB\u56FE\u5F62\u4E4B\u5916\u7ED3\u675F!"),u.selectPoint)u.selectPoint.position.setValue(a),u.positions[u.selectPoint.wz-1]=a;else return},e.ScreenSpaceEventType.MOUSE_MOVE);},getLnglats:function(){for(var e=[],u=0;u<this.positions.length;u++){var f=this.cartesianToLatlng(this.positions[u]);e.push(f);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var u=this._Cesium;return this.viewer.entities.add({position:e,point:{pixelSize:10,color:u.Color.RED},show:true})},showArrowOnMap:function(e){var u=this._Cesium,f=this,a=function(){if(e.length<3)return null;for(var n=[],o=0;o<e.length;o++){var r=f.cartesianToLatlng(e[o]);n.push(r);}var i=f.xp.algorithm.doubleArrow(n,u),s=[],l=JSON.stringify(i.polygonalPoint).indexOf("null");return l==-1&&(s=i.polygonalPoint),new u.PolygonHierarchy(s)};return this.viewer.entities.add({id:f.objId,polygon:new u.PolygonGraphics({hierarchy:new u.CallbackProperty(a,false),show:true,fill:true,material:f.fillMaterial})})},cartesianToLatlng:function(e){var u=this._Cesium,f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),a=u.Math.toDegrees(f.latitude),n=u.Math.toDegrees(f.longitude);return [n,a]}};it.prototype=Object.create(Object.assign({},it.prototype,Le.prototype));it.prototype.constructor=it;function vt(e,u){var f,a=u.camera.getPickRay(e);return a?(f=u.scene.globe.pick(a,u.scene),f):null}var Qe=it;function yn({THREE:e,Cesium:u,viewer:f}){function a(o,r){r||(r=new e.BufferGeometry);let i=o.attributes;for(let c in i)if(i.hasOwnProperty(c)&&i[c]){var s=i[c],l=s.values;l instanceof Float64Array&&(l=new Float32Array(l));let h=new e.BufferAttribute(l,s.componentsPerAttribute,s.normalize);r.setAttribute(c,h);}if(i.st&&(r.attributes.uv=r.attributes.st,r.deleteAttribute("st")),o.indices){let c=new e.BufferAttribute(o.indices,1,false);r.setIndex(c);}if(o.boundingSphere){let c=o.boundingSphere;r.boundingSphere||(r.boundingSphere=new e.Sphere),r.boundingSphere.center.copy(c.center),r.boundingSphere.radius=c.radius;}return r}class n extends e.Scene{constructor(r={}){if(super(),this.type="ThreeCesiumScene",!r.cesiumDom)throw new Error("THREE.ThreeCesiumScene not found cesiumDom.");if(!r.camera||!(r.camera instanceof e.PerspectiveCamera))throw new Error("THREE.ThreeCesiumScene (not found cesiumDom) OR ( not THREE.PerspectiveCamera ).");if(!r.renderer)throw new Error("THREE.ThreeCesiumScene not found THREE.WebGLRender.");this.options=r,this.cesiumViewer=f;let s=(typeof r.cesiumDom=="string"?document.getElementById(r.cesiumDom):r.cesiumDom).children[0].children;for(let w=0;w<s.length;w++)w!==0&&(s[w].style.zIndex="100");this.ellipsoid=this.cesiumViewer.scene.globe.ellipsoid,r.threeHabit&&(this.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes=[u.CameraEventType.LEFT_DRAG],this.cesiumViewer.scene.screenSpaceCameraController.zoomEventTypes=[u.CameraEventType.MIDDLE_DRAG,u.CameraEventType.WHEEL,u.CameraEventType.PINCH],this.cesiumViewer.scene.screenSpaceCameraController.rotateEventTypes=[u.CameraEventType.RIGHT_DRAG]),this.camera=r.camera,this.cameraOffset=new e.Vector3,this.renderer=r.renderer,this.lngLat=r.lngLat&&r.lngLat.length>1?r.lngLat:[114.23,31.55],this.cameraCenter=new e.Vector3(0,0,0);let l=new u.EllipsoidGeometry({vertexFormat:u.VertexFormat.POSITION_ONLY,radii:new u.Cartesian3(this.ellipsoid.maximumRadius-1,this.ellipsoid.maximumRadius-1,this.ellipsoid.minimumRadius-1),slicePartitions:1024,stackPartitions:1024}),c=a(u.EllipsoidGeometry.createGeometry(l)),h=new e.MeshBasicMaterial({color:"#ff00ff",blending:e.MultiplyBlending}),d=new e.Mesh(c,h);r.axesHelper&&d.add(new e.AxesHelper(8e6)),super.add(d),this.sphere=d;let m=new e.Group;super.add(m),this.syncGroup=m;let y=new e.SphereGeometry(this.ellipsoid.minimumRadius,512,256,0,Math.PI*2,3.1,Math.PI-3.1),p=new e.MeshBasicMaterial({color:"#fff00f",blending:e.MultiplyBlending}),g=new e.Mesh(y,p);g.rotateX(90*Math.PI/180),g.position.z=this.ellipsoid.minimumRadius,this.sphere3=g;let v=new e.Group;v.rotateX(-90*Math.PI/180),v.position.z=-1,this.syncGroup=m,this.childrenGroup=v,this.sunUp=new e.Group,this.sunLightColor=new e.Color,this.sunLightIntensity=1;let A=this.cesiumViewer.scene.light;if(this.sunLightColor.r=A.color.red,this.sunLightColor.g=A.color.green,this.sunLightColor.b=A.color.blue,this.sunLightIntensity=A.intensity,this.sun=new e.DirectionalLight(this.sunLightColor,this.sunLightIntensity),this.sun.castShadow=true,this.sun.shadow.camera.far=Math.pow(10,14),this.sun.position.set(0,0,this.ellipsoid.maximumRadius*2+1e3),this.sun.target=this.childrenGroup,this.sunUp.add(this.sun),m.add(g),m.add(v),m.add(this.sunUp),this._enableLighting=false,Object.defineProperty(this,"enableLighting",{get(){return this._enableLighting},set(w){if(this.cesiumViewer.scene.globe.enableLighting=w,this._enableLighting=w,w){this.sun.visible=true;return}this.sun.visible=false;}}),r.enableLighting!==void 0&&r.enableLighting!==null&&(this.enableLighting=r.enableLighting),r.cesiumLayers&&r.cesiumLayers.length>0)for(let w=0;w<r.cesiumLayers.length;w++)this.addImageryProvider(r.cesiumLayers[w].type,r.cesiumLayers[w].option);}renderCesium(){return this.cesiumViewer.isDestroyed()||this.cesiumViewer.resize(),this.cesiumViewer.render(),this}renderThree(){return this.renderer.render(this,this.camera),this}updateSunMatrix(){if(this.isColumbusViewMode())return this;let r=this.cesiumViewer.scene.sun._boundingVolume.center,i=this.cartesian3ToVector(r);return this.sunUp.lookAt(i.x-this.cameraOffset.x,i.y-this.cameraOffset.y,-(i.z-this.cameraOffset.z)),this}updateCameraMatrix(){this.camera.fov=u.Math.toDegrees(this.cesiumViewer.camera.frustum.fovy),this.camera.updateProjectionMatrix(),this.camera.matrixAutoUpdate=false;let r=this.cesiumViewer.camera.viewMatrix,i=this.cesiumViewer.camera.inverseViewMatrix;this.camera.lookAt(this.cameraCenter),this.camera.matrixWorld.set(i[0],i[4],i[8],i[12]-this.cameraOffset.x,i[1],i[5],i[9],i[13]-this.cameraOffset.y,i[2],i[6],i[10],i[14]-this.cameraOffset.z,i[3],i[7],i[11],i[15]),this.camera.matrixWorldInverse.set(r[0],r[4],r[8],r[12]-this.cameraOffset.x,r[1],r[5],r[9],r[13]-this.cameraOffset.y,r[2],r[6],r[10],r[14]-this.cameraOffset.z,r[3],r[7],r[11],r[15]);let s=this.cesiumViewer.scene.canvas.clientWidth,l=this.cesiumViewer.scene.canvas.clientHeight;return this.camera.aspect=s/l,this.camera.updateProjectionMatrix(),this.renderer.setSize(s,l),this}isColumbusViewMode(){return this.cesiumViewer.scene.mode===u.SceneMode.COLUMBUS_VIEW}isThreeRenderable(){let r=this.cesiumViewer.scene;return r.mode===u.SceneMode.SCENE2D?false:Math.abs(r.morphTime)<u.Math.EPSILON6||Math.abs(r.morphTime-1)<u.Math.EPSILON6}getSceneOriginPosition(){return this.isColumbusViewMode()?this.cartesianToCVWorld(u.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)):u.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)}cartesianToCVWorld(r){let i=this.cesiumViewer.scene.mapProjection.project(u.Cartographic.fromCartesian(r));return new e.Vector3(i.z,i.x,i.y)}updateGroupMatrixWorld(){if(this.isColumbusViewMode())return this.cameraOffset.copy(this.getSceneOriginPosition()),this.syncGroup.rotation.set(-Math.PI/2,-Math.PI/2,0),this.syncGroup.updateMatrix(),this.syncGroup.up.set(1,0,0),this.up.set(1,0,0),this.sphere.visible=false,this.sphere3.visible=false,this;this.sphere.visible=true,this.sphere3.visible=true;let r=this.cartesian3ToVector(u.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)),i=this.cartesian3ToVector(u.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],2)),s=new e.Vector3().subVectors(r,i).normalize();return this.syncGroup.up.set(0,0,-1),this.syncGroup.lookAt(s),this.syncGroup.up.copy(s),this.syncGroup.updateMatrix(),this.cameraOffset.copy(r),this.syncGroup.up.set(0,0,-1),this.up.set(0,0,-1),this}update(){this.updateSunMatrix(),this.updateGroupMatrixWorld(),this.renderCesium(),this.updateCameraMatrix(),this.isThreeRenderable()?this.renderThree():this.renderer.clear();}add(r){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.childrenGroup.add(arguments[i]);return this}return r===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",r),this):(r&&r.isObject3D?(r.parent!==null&&r.parent.remove(r),r.parent=this.childrenGroup,this.childrenGroup.children.push(r),r.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",r),this)}remove(r){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.childrenGroup.remove(arguments[s]);return this}let i=this.childrenGroup.children.indexOf(r);return i!==-1&&(r.parent=null,this.childrenGroup.children.splice(i,1),r.dispatchEvent({type:"removed"})),this}clear(){for(let r=0;r<this.childrenGroup.children.length;r++){let i=this.childrenGroup.children[r];i.parent=null,i.dispatchEvent({type:"removed"});}return this.childrenGroup.children.length=0,this}traverse(r){r(this.childrenGroup);let i=this.childrenGroup.children;for(let s=0,l=i.length;s<l;s++)i[s].traverse(r);}traverseVisible(r){if(this.visible===false||this.childrenGroup.visible===false)return;r(this.childrenGroup);let i=this.childrenGroup.children;for(let s=0,l=i.length;s<l;s++)i[s].traverseVisible(r);}toJSON(r){let i=r===void 0||typeof r=="string",s={};i&&(r={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{},options:{}},s.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let l={};if(l.uuid=this.uuid,l.type=this.type,this.name!==""&&(l.name=this.name),this.castShadow===true&&(l.castShadow=true),this.receiveShadow===true&&(l.receiveShadow=true),this.visible===false&&(l.visible=false),this.frustumCulled===false&&(l.frustumCulled=false),this.renderOrder!==0&&(l.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(l.userData=this.userData),l.layers=this.layers.mask,l.matrix=this.matrix.toArray(),this.matrixAutoUpdate===false&&(l.matrixAutoUpdate=false),this.background&&(this.background.isColor?l.background=this.background.toJSON():this.background.isTexture&&(l.background=this.background.toJSON(r).uuid)),this.environment&&this.environment.isTexture&&(l.environment=this.environment.toJSON(r).uuid),this.fog!==null&&(l.fog=this.fog.toJSON()),this.options){l.options={};for(let h in this.options)["camera","renderer"].includes(h)||(l.options[h]=this.options[h]);}if(this.childrenGroup.children.length>0){l.children=[];for(let h=0;h<this.childrenGroup.children.length;h++)l.children.push(this.childrenGroup.children[h].toJSON(r).object);}if(i){let h=c(r.geometries),d=c(r.materials),m=c(r.textures),y=c(r.images),p=c(r.shapes),g=c(r.skeletons),v=c(r.animations),A=c(r.nodes);h.length>0&&(s.geometries=h),d.length>0&&(s.materials=d),m.length>0&&(s.textures=m),y.length>0&&(s.images=y),p.length>0&&(s.shapes=p),g.length>0&&(s.skeletons=g),v.length>0&&(s.animations=v),A.length>0&&(s.nodes=A);}return l.isGIS=true,s.object=l,s;function c(h){let d=[];for(let m in h){let y=h[m];delete y.metadata,d.push(y);}return d}}dispose(){this.update=()=>{},this.renderCesium=()=>{},this.renderThree=()=>{},this.updateSunMatrix=()=>{},this.updateCameraMatrix=()=>{},this.updateGroupMatrixWorld=()=>{},this.cesiumViewer.destroy();}cartesian3ToVector(r){return new e.Vector3(r.x,r.y,r.z)}positionToCartesian(r){if(Array.isArray(r))return u.Cartesian3.fromDegrees(r[0],r[1],r.length>2?r[2]:0);if(r&&typeof r=="object"){if(typeof r.longitude=="number"&&typeof r.latitude=="number")return u.Cartesian3.fromRadians(r.longitude,r.latitude,r.height||0);if(typeof r.x=="number"&&typeof r.y=="number"&&typeof r.z=="number")return new u.Cartesian3(r.x,r.y,r.z)}throw new Error("THREE.ThreeCesiumScene: invalid position, expect [lng, lat, height] | Cesium.Cartesian3 | Cesium.Cartographic.")}positionToWorldVector(r){let i=this.positionToCartesian(r),s=this.getSceneOriginPosition();if(this.isColumbusViewMode()){let l=this.cartesianToCVWorld(i);return new e.Vector3(l.x-s.x,l.y-s.y,l.z-s.z)}return new e.Vector3(i.x-s.x,i.y-s.y,i.z-s.z)}setObjectPosition(r,i){if(!r||!r.isObject3D)return console.error("THREE.ThreeCesiumScene.setObjectPosition: object must be an instance of THREE.Object3D.",r),this;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let s=this.positionToWorldVector(i);return r.position.copy(this.childrenGroup.worldToLocal(s)),this}getObjectPosition(r){if(!r||!r.isObject3D)return console.error("THREE.ThreeCesiumScene.getObjectPosition: object must be an instance of THREE.Object3D.",r),null;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let i=this.getSceneOriginPosition(),s=this.childrenGroup.localToWorld(r.position.clone()),l=new u.Cartesian3(s.x+i.x,s.y+i.y,s.z+i.z),c;return this.isColumbusViewMode()?c=this.cesiumViewer.scene.mapProjection.unproject(new u.Cartesian3(l.y,l.z,l.x)):c=u.Cartographic.fromCartesian(l),[u.Math.toDegrees(c.longitude),u.Math.toDegrees(c.latitude),c.height]}}return n.prototype.isScene=true,n.prototype.isGIS=true,n}function xr(){let e=null,u=null,f=function(a,n,o,r){if(a&&r){let{threeGlobal:i,containerId:s,threeContainerId:l}=r;e=n,u=i,this._viewer=a,this._containerId=s,this._threeContainerId=l,this._Scene=yn({THREE:u,Cesium:e,viewer:a}),this._initContainer(),se(this),oe(this,()=>{this.destroyThreeJS();});}};return f.prototype={_initContainer:function(){if(this.cesiumContainer=void 0,this.threeContainer=void 0,this.cesiumContainer=document.getElementById(this._containerId),this.threeContainer=document.getElementById(this._threeContainerId),this.cesiumContainer)this.cesiumContainer.style.position!=="absolute"&&(this.cesiumContainer.style.position="absolute",this.cesiumContainer.style.top=0,this.cesiumContainer.style.left=0,this.cesiumContainer.style.height="100%",this.cesiumContainer.style.width="100%",this.cesiumContainer.style.margin=0,this.cesiumContainer.style.overflow="hidden",this.cesiumContainer.style.padding=0,this.cesiumContainer.style.fontFamily="sans-serif");else return alert("\u672A\u83B7\u53D6\u5230 cesiumContainer \u5BB9\u5668!"),false;if(!this.threeContainer){var a=document.getElementsByTagName("body")[0];a&&(this.threeContainer=document.createElement("div"),this.threeContainer.id=this._threeContainerId,this.threeContainer.style.position="absolute",this.threeContainer.style.top=0,this.threeContainer.style.left=0,this.threeContainer.style.height="100%",this.threeContainer.style.width="100%",this.threeContainer.style.margin=0,this.threeContainer.style.overflow="hidden",this.threeContainer.style.padding=0,this.threeContainer.style.fontFamily="sans-serif",this.threeContainer.style.pointerEvents="none",a.appendChild(this.threeContainer));}},initThree:function(a){var n=a.fov||45,o=window.innerWidth,r=window.innerHeight,i=a.aspect||o/r,s=a.near||1,l=a.far||10*1e3*1e3;return this._three={renderer:null,camera:null,scene:null},this._three.camera=new u.PerspectiveCamera(n,i,s,l),this._three.renderer=new u.WebGLRenderer({alpha:true,antialias:true,logarithmicDepthBuffer:true,stencil:true,depth:true}),this._three.renderer.outputEncoding=u.sRGBEncoding,this._three.renderer.shadowMap.enabled=true,this._three.renderer.shadowMap.type=u.PCFSoftShadowMap,this._three.scene=new this._Scene({cesiumDom:this._containerId,threeHabit:this._objHasOwnProperty(a,"threeHabit",true),enableLighting:this._objHasOwnProperty(a,"enableLighting",true),axesHelper:this._objHasOwnProperty(a,"axesHelper",false),camera:this._three.camera,renderer:this._three.renderer,lngLat:a.center||[104.081701757991,30.627042558105988]}),this.threeContainer&&this.threeContainer.appendChild(this._three.renderer.domElement),this._three},loop(a){let n=o=>{this._rafId=requestAnimationFrame(n),a&&a(o);};this._rafId=requestAnimationFrame(n);},setPosition(a,n){return !this._three||!this._three.scene?(console.error("ThreeJs.setPosition: please call initThree first."),this):(this._three.scene.setObjectPosition(a,n),this)},getPosition(a){return !this._three||!this._three.scene?(console.error("ThreeJs.getPosition: please call initThree first."),null):this._three.scene.getObjectPosition(a)},_objHasOwnProperty(a,n,o){return a.hasOwnProperty(n)?a[n]:o},destroyThreeJS(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._three&&this._three.scene&&typeof this._three.scene.dispose=="function"&&this._three.scene.dispose();}},f}var At=re(xr);var ke=111319.49079327358,Sr=0;function Oe(e){return ke*Math.cos(e*Math.PI/180)}function he(e,u,f){return e<u?u:e>f?f:e}function Mr(e){let u=he(e,0,1);return u*u*(3-2*u)}function vn(e){let u=1/0,f=1/0,a=-1/0,n=-1/0;for(let o of e)o&&(o.lng<u&&(u=o.lng),o.lng>a&&(a=o.lng),o.lat<f&&(f=o.lat),o.lat>n&&(n=o.lat));return Number.isFinite(u)?{minLng:u,minLat:f,maxLng:a,maxLat:n}:{minLng:0,minLat:0,maxLng:0,maxLat:0}}function Ut(e){let u=vn(e);return {lng:(u.minLng+u.maxLng)/2,lat:(u.minLat+u.maxLat)/2}}function An(e,u,f){let a=false,n=f.length;for(let o=0,r=n-1;o<n;r=o++){let i=f[o].lng,s=f[o].lat,l=f[r].lng,c=f[r].lat;s>u!=c>u&&e<(l-i)*(u-s)/(c-s||1e-12)+i&&(a=!a);}return a}function Ir(e,u,f){let a=Oe(u),n=ke,o=1/0,r=f.length;for(let s=0,l=r-1;s<r;l=s++){let c=(f[l].lng-e)*a,h=(f[l].lat-u)*n,d=(f[s].lng-e)*a,m=(f[s].lat-u)*n,y=d-c,p=m-h,g=y*y+p*p,v=g>0?he(-(c*y+h*p)/g,0,1):0,A=c+v*y,w=h+v*p,C=Math.sqrt(A*A+w*w);C<o&&(o=C);}return Number.isFinite(o)||(o=0),An(e,u,f)?o:-o}function Nt(e){if(e.length<3)return 0;let u=Ut(e).lat,f=Oe(u),a=ke,n=0;for(let o=0,r=e.length-1;o<e.length;r=o++)n+=e[r].lng*f*(e[o].lat*a)-e[o].lng*f*(e[r].lat*a);return Math.abs(n)/2}function Tr(e,u){let f=new Uint8Array(e.length);if(u<3)return f;let a=new Uint8Array(e.length),n=new Int32Array(e.length),o=0,r=0,i=s=>{e[s]||a[s]||(a[s]=1,n[r++]=s);};for(let s=0;s<u;s++)i(s),i((u-1)*u+s);for(let s=0;s<u;s++)i(s*u),i(s*u+u-1);for(;o<r;){let s=n[o++],l=s/u|0,c=s-l*u;l>0&&i(s-u),l<u-1&&i(s+u),c>0&&i(s-1),c<u-1&&i(s+1);}for(let s=0;s<e.length;s++)e[s]||a[s]||(e[s]=1,f[s]=1);return f}function Tt(e,u={}){var x,M,T;if(!e||e.length<3)throw new Error("buildTerrainGrid: \u81F3\u5C11\u9700\u8981 3 \u4E2A\u9876\u70B9");let f=Math.round(he((x=u.segments)!=null?x:64,8,256)),a=he((M=u.padRatio)!=null?M:.06,0,.5),n=f+1,o=vn(e),r=(o.maxLng-o.minLng)*a,i=(o.maxLat-o.minLat)*a,s=o.minLng-r,l=o.maxLng+r,c=o.minLat-i,h=o.maxLat+i,d=(l-s)/f,m=(h-c)/f,y=(c+h)/2,p=Oe(y),g=Math.max(d*p,m*ke),v=(l-s)*p,A=(h-c)*ke,w=he((T=u.slopeWidth)!=null?T:Math.max(12,Math.min(v,A)*.12),4,Math.min(v,A)*.6),C=n*n,b=new Uint8Array(C),P=new Float32Array(C),_=new Float32Array(C),S=new Float32Array(C),I=new Float32Array(C);for(let E=0;E<n;E++){let R=c+E*m;for(let O=0;O<n;O++){let U=s+O*d,z=E*n+O;if(!An(U,R,e))continue;let V=Ir(U,R,e);b[z]=1,P[z]=V,_[z]=Mr(V/w);}}if(u.fillHoles!==false){let E=Tr(b,n);for(let R=0;R<C;R++)E[R]&&(P[R]=w,_[R]=1);}return {segments:f,stride:n,bounds:{minLng:s,minLat:c,maxLng:l,maxLat:h},dLng:d,dLat:m,vertexCount:C,inside:b,distance:P,weight:_,base:S,current:I,slopeWidth:w,cellSize:g,cellArea:g*g}}function Et(e,u){let f=Math.floor(u/e.stride),a=u%e.stride;return {lng:e.bounds.minLng+a*e.dLng,lat:e.bounds.minLat+f*e.dLat}}function Er(e,u){let f=0,a=0;for(let n=0;n<e.vertexCount;n++)e.weight[n]<.85||(f+=u[n],a++);if(a===0)for(let n=0;n<e.vertexCount;n++)e.inside[n]&&(f+=u[n],a++);return a?f/a:0}function Xt(e,u=e.current){let f=1/0,a=-1/0,n=0,o=0;for(let r=0;r<e.vertexCount;r++){if(e.weight[r]<.85)continue;let i=u[r];i<f&&(f=i),i>a&&(a=i),n+=i,o++;}return o?{min:f,max:a,average:n/o}:{min:0,max:0,average:0}}function Lr(e,u){let{stride:f}=e,a=new Float32Array(u);for(let n=1;n<f-1;n++)for(let o=1;o<f-1;o++){let r=n*f+o;if(!e.inside[r])continue;let i=0,s=0;for(let l=-1;l<=1;l++)for(let c=-1;c<=1;c++){let h=(n+l)*f+(o+c);e.inside[h]&&(i+=u[h],s++);}s&&(a[r]=i/s);}return a}function wn(e,u={}){var s,l,c,h,d,m;let f=(s=u.mode)!=null?s:"sink",a=Math.abs((l=u.depth)!=null?l:30),n=(c=u.depth)!=null?c:0,o=Math.max(0,(h=u.stepHeight)!=null?h:0),r=new Float32Array(e.current);if(f==="smooth"){let y=Math.max(1,Math.round((d=u.smoothIterations)!=null?d:2)),p=new Float32Array(e.current);for(let g=0;g<y;g++){let v=Lr(e,p);for(let A=0;A<e.vertexCount;A++){let w=e.weight[A];w<=0||(p[A]=p[A]*(1-w*.85)+v[A]*(w*.85));}}return p}let i=(m=u.flattenHeight)!=null?m:Er(e,e.current);for(let y=0;y<e.vertexCount;y++){let p=e.weight[y];if(p<=0)continue;let g=e.current[y],v=g;if(f==="raise"?v=g+a*p:f==="flatten"?v=g+(i+n-g)*p:v=g-a*p,o>0){let A=v-g,w=Math.round(A/o)*o;v=g+w;}r[y]=v;}return r}function Lt(e,u,f=e.current){let a=1/0,n=-1/0,o=0,r=0,i=0;for(let s=0;s<e.vertexCount;s++){if(!e.inside[s])continue;i++;let l=f[s];l<a&&(a=l),l>n&&(n=l);let c=l-e.base[s];c<0?o-=c*e.cellArea:r+=c*e.cellArea;}return Number.isFinite(a)||(a=0),Number.isFinite(n)||(n=0),{area:Nt(u),minHeight:a,maxHeight:n,cutVolume:o,fillVolume:r,vertexCount:i,cellSize:e.cellSize}}var Xe=[{stop:0,color:[.4,.42,.3]},{stop:.35,color:[.46,.38,.28]},{stop:.7,color:[.32,.3,.27]},{stop:1,color:[.17,.19,.22]}],Wt=[.1,.34,.5];function Cn(e,u=.5,f=false){let a=he(e,0,1),n=Xe[0],o=Xe[Xe.length-1];for(let d=0;d<Xe.length-1;d++)if(a>=Xe[d].stop&&a<=Xe[d+1].stop){n=Xe[d],o=Xe[d+1];break}let r=o.stop-n.stop||1,i=he((a-n.stop)/r,0,1),s=n.color[0]+(o.color[0]-n.color[0])*i,l=n.color[1]+(o.color[1]-n.color[1])*i,c=n.color[2]+(o.color[2]-n.color[2])*i;f&&(s=s*.45+Wt[0]*.55,l=l*.45+Wt[1]*.55,c=c*.45+Wt[2]*.55);let h=.92+(u-.5)*.16;return [he(s*h,0,1),he(l*h,0,1),he(c*h,0,1)]}function at(e,u){let f=Math.sin(e*127.1+u*311.7)*43758.5453;return f-Math.floor(f)}function pn(e,u){let f=Math.floor(e),a=Math.floor(u),n=e-f,o=u-a,r=n*n*(3-2*n),i=o*o*(3-2*o),s=at(f,a),l=at(f+1,a),c=at(f,a+1),h=at(f+1,a+1);return s+(l-s)*r+(c-s)*i+(s-l-c+h)*r*i}function jt(e,u=1e-9){let f=[];for(let a of e){let n=f[f.length-1];n&&Math.abs(n.lng-a.lng)<u&&Math.abs(n.lat-a.lat)<u||f.push(a);}if(f.length>1){let a=f[0],n=f[f.length-1];Math.abs(a.lng-n.lng)<u&&Math.abs(a.lat-n.lat)<u&&f.pop();}return f}var kr=.9,Dr=.9,Rr=.28,Br=34,Gr=1;function It(e,u,f){return u>0?f<0?Math.floor(e/u)*u:Math.ceil(e/u)*u:e}function gn(e,u,f,a=e.current){let{bounds:n,stride:o,segments:r}=e,i=a;if(r<1)return i[0]||0;let s=(u-n.minLng)/(n.maxLng-n.minLng)*r,l=(f-n.minLat)/(n.maxLat-n.minLat)*r,c=Math.max(0,Math.min(r-1,Math.floor(s))),h=Math.max(0,Math.min(r-1,Math.floor(l))),d=he(s-c,0,1),m=he(l-h,0,1),y=h*o+c,p=i[y]*(1-d)+i[y+1]*d,g=i[y+o]*(1-d)+i[y+o+1]*d;return p*(1-m)+g*m}function Or(e,u,f,a,n,o,r,i,s,l){let c=e.stride,h=e.current,d=e.bounds,m=Math.max(0,u.minRow),y=Math.min(c-1,u.maxRow),p=Math.max(0,u.minCol),g=Math.min(c-1,u.maxCol),v=g-p+1,A=y-m+1,w={minRow:m,maxRow:y,minCol:p,maxCol:g,changed:0};if(v<2||A<2)return w;let C=new Uint8Array(v*A);for(let T=0;T<f.length;T++){let E=f[T],R=E/c|0,O=E-R*c;R<m||R>y||O<p||O>g||(C[(R-m)*v+(O-p)]=1);}let b=o*o,P=0,_=1/0,S=-1/0,I=1/0,x=-1/0,M=(T,E,R,O)=>{let U=T*c+E,z=R*c+O;if(!e.inside[U])return;let V=(T-m)*v+(E-p),j=(R-m)*v+(O-p);if(!C[V]&&!C[j])return;let H=h[U],q=h[z];if(n){if(q-H<=a)return;if(o>0){let k=(d.minLng+E*e.dLng-r)*s,G=(d.minLat+T*e.dLat-i)*ke;if(k*k+G*G>b)return}h[U]=q-a;}else {if(H-q<=a)return;if(o>0){let k=(d.minLng+E*e.dLng-r)*s,G=(d.minLat+T*e.dLat-i)*ke;if(k*k+G*G>b)return}h[U]=q+a;}C[V]=1,P++,T<_&&(_=T),T>S&&(S=T),E<I&&(I=E),E>x&&(x=E);};for(let T=0;T<l;T++){for(let E=m;E<=y;E++)for(let R=p;R<=g;R++)E>m&&M(E,R,E-1,R),R>p&&M(E,R,E,R-1);for(let E=y;E>=m;E--)for(let R=g;R>=p;R--)E<y&&M(E,R,E+1,R),R<g&&M(E,R,E,R+1);}return P?{minRow:_,maxRow:S,minCol:I,maxCol:x,changed:P}:w}function bn(e,u){var q,k,G,Y,Q,ie;let f=u.mode,a=Math.max(.5,u.radius),n=he((q=u.strength)!=null?q:Gr,.01,1),o=Math.max(.01,(k=u.maxDelta)!=null?k:4),r=he((G=u.hardness)!=null?G:kr,0,.95),i=he((Y=u.reposeDeg)!=null?Y:Br,5,80),s=Math.max(0,Math.min(500,(Q=u.strokeLimit)!=null?Q:Sr)),l=Oe(u.lat),c=f==="smooth"?0:he((ie=u.roughness)!=null?ie:Rr,0,1),h=Math.max(e.dLat*ke,Math.abs(e.dLng)*l)||1,d=Math.max(a*.55,h*2.4),m=Math.max(a*.38,h*3.5),y=c>0,p=he(Math.max(o*Dr,h*.6),h*.45,a*.35),g=f==="smooth",v=g?0:Math.min(a*r,a-p),A=g?a:v+p,w=A*(1+c*.55),C=w/l,b=w/ke,P=e.bounds;if(u.lng<P.minLng-C||u.lng>P.maxLng+C||u.lat<P.minLat-b||u.lat>P.maxLat+b)return null;let _=Math.max(0,Math.floor((u.lng-C-P.minLng)/e.dLng)),S=Math.min(e.stride-1,Math.ceil((u.lng+C-P.minLng)/e.dLng)),I=Math.max(0,Math.floor((u.lat-b-P.minLat)/e.dLat)),x=Math.min(e.stride-1,Math.ceil((u.lat+b-P.minLat)/e.dLat)),M=gn(e,u.lng,u.lat),T=u.targetHeight;(T==null||!Number.isFinite(T))&&(f==="lower"?T=It(M-o,o,-1):f==="raise"?T=It(M+o,o,1):T=M);let E=T,R=0,O=0,U=[];for(let le=I;le<=x;le++){let ue=P.minLat+le*e.dLat,ce=(ue-u.lat)*ke;for(let Ae=_;Ae<=S;Ae++){let be=le*e.stride+Ae;if(!e.inside[be])continue;let Me=P.minLng+Ae*e.dLng,we=(Me-u.lng)*l,Fe=Math.sqrt(we*we+ce*ce);if(Fe>w)continue;let st=a;if(y){let F=Me*l,X=ue*ke,N=(pn(F/d,X/d)-.5)*2,J=1-Math.abs(N),ne=(pn(F/m+37.2,X/m+11.9)-.5)*2;st=Math.min(a,a*(1+c*(.3*N-.16*J*J+.22*ne)));}if(Fe>st)continue;let Ke=he(g?1-Fe/st:(A-Fe)/p,0,1);if(Ke<=0)continue;let xe=e.current[be],Ie;if(f==="smooth"){let F=Fr(e,le,Ae);Ie=xe+(F-xe)*he(Ke*1.4,0,1);}else if(Ie=xe+(E-xe)*Ke*n,Ke>=1){let F=Math.abs(Ie-E);F>O&&(O=F);}let L=u.strokeBase;if(L&&s>0){let F=o*s;Ie>L[be]+F?Ie=L[be]+F:Ie<L[be]-F&&(Ie=L[be]-F);}Ie!==xe&&(e.current[be]=Ie,R++,U.push(be));}}let z=I,V=x,j=_,H=S;if(f!=="smooth"&&U.length){let le=Math.tan(i*Math.PI/180),ue=Math.max(.05,h*le),ce=a,Ae=gn(e,u.lng,u.lat,e.base),be=Math.abs(Ae-E),Me=Math.ceil(ce/h)+1,we=Or(e,{minRow:I-Me,maxRow:x+Me,minCol:_-Me,maxCol:S+Me},U,ue,f==="raise",ce,u.lng,u.lat,l,Math.max(2,Math.min(12,Math.ceil(be/ue)+1)));we.changed>0&&(R+=we.changed,we.minRow<z&&(z=we.minRow),we.maxRow>V&&(V=we.maxRow),we.minCol<j&&(j=we.minCol),we.maxCol>H&&(H=we.maxCol));}return {minRow:z,maxRow:V,minCol:j,maxCol:H,changed:R,target:E,gap:O}}function Fr(e,u,f){let a=e.stride,n=0,o=0;for(let r=-1;r<=1;r++){let i=u+r;if(!(i<0||i>=a))for(let s=-1;s<=1;s++){let l=f+s;if(l<0||l>=a)continue;let c=i*a+l;e.inside[c]&&(n+=e.current[c],o++);}}return o?n/o:e.current[u*a+f]}function _n(e,u=12){let f=Math.max(.2,e/Math.max(1,u)),a=Math.pow(10,Math.floor(Math.log10(f))),n=f/a;return (n<=1?1:n<=2?2:n<=5?5:10)*a}function Pn(e,u,f=e.current){let a=u>0?u:5,n=e.stride,o=[],r=(i,s,l,c)=>{i===0?o.push(s,l+c):i===1?o.push(s+c,l+1):i===2?o.push(s+1,l+c):o.push(s+c,l);};for(let i=0;i<e.segments;i++)for(let s=0;s<e.segments;s++){let l=i*n+s,c=l+1,h=l+n,d=h+1;if(!(e.inside[l]&&e.inside[c]&&e.inside[h]&&e.inside[d]))continue;let m=f[l],y=f[c],p=f[h],g=f[d],v=Math.min(m,y,p,g),A=Math.max(m,y,p,g);if(A-v<1e-6)continue;let w=Math.ceil(v/a),C=Math.floor(A/a);for(let b=w;b<=C;b++){let P=b*a;if(P<=v||P>=A)continue;let _=[],S=(I,x,M)=>{if(x<P&&M>=P||M<P&&x>=P){let T=(P-x)/(M-x);T>=0&&T<=1&&_.push(I,T);}};S(0,m,y),S(1,y,g),S(2,p,g),S(3,m,p),_.length===4?(r(_[0],i,s,_[1]),r(_[2],i,s,_[3])):_.length>=8&&(r(_[0],i,s,_[1]),r(_[2],i,s,_[3]),r(_[4],i,s,_[5]),r(_[6],i,s,_[7]));}}return new Float32Array(o)}function xn(e,u,f,a,n){let o=n||{east:0,north:0},r=u*u+f*f;if(r<=1e-10||Math.abs(e)<=1e-6)return o.east=0,o.north=0,o;let i=Math.sqrt(r),s=Math.min(1,Math.max(0,(i-.75)/.15)),l=1-s*s*(3-2*s);if(l<=1e-4)return o.east=0,o.north=0,o;let c=-e*Math.max(0,1-Math.abs(a))*l/r;return o.east=c*u,o.north=c*f,o}var Vr=156543.03392804097;function Yt(e,u,f){return e<u?u:e>f?f:e}async function Hr(e,u,f,a={}){var R,O,U;if(typeof document=="undefined")return null;let n=u&&(u.imageryProvider||u.provider);if(!n||typeof n.requestImage!="function"||!n.tilingScheme)return null;let o=n.tilingScheme;if(typeof o.positionToTileXY!="function"||typeof o.tileXYToRectangle!="function")return null;if(n.readyPromise&&n.ready===false)try{await n.readyPromise;}catch{return null}let r=f.maxLng-f.minLng,i=f.maxLat-f.minLat;if(!(r>0)||!(i>0))return null;let s=Yt(Math.round((R=a.maxSize)!=null?R:2048),256,4096),l=Yt(Math.round((O=a.maxTiles)!=null?O:64),1,256),c=Math.max(.05,(U=a.metersPerPixel)!=null?U:1.2),h=(f.minLat+f.maxLat)/2,d=r*111319.49*Math.cos(h*Math.PI/180),m=i*111319.49,y=(z,V)=>e.Cartographic.fromRadians(z*Math.PI/180,V*Math.PI/180,0),p=Math.log2(Vr*Math.cos(h*Math.PI/180)/c),g=n.maximumLevel!=null?n.maximumLevel:19,v=n.minimumLevel!=null?n.minimumLevel:0,A=Yt(Math.floor(p),v,Math.min(g,19)),w=z=>{let V=o.positionToTileXY(y(f.minLng,f.minLat),z),j=o.positionToTileXY(y(f.maxLng,f.maxLat),z);return !V||!j?null:{x0:Math.min(V.x,j.x),x1:Math.max(V.x,j.x),y0:Math.min(V.y,j.y),y1:Math.max(V.y,j.y)}},C=w(A);for(;C&&(C.x1-C.x0+1)*(C.y1-C.y0+1)>l&&A>v;)A--,C=w(A);if(!C)return null;let b=m/Math.max(1,d),P=Math.round(d>=m?s:s/Math.max(.05,b)),_=Math.round(P*b),S=document.createElement("canvas");S.width=Math.max(64,P),S.height=Math.max(64,_);let I=S.getContext("2d");if(!I)return null;I.fillStyle="#6b6f5f",I.fillRect(0,0,S.width,S.height);let x=z=>z*180/Math.PI,M=[],T=0;for(let z=C.y0;z<=C.y1;z++)for(let V=C.x0;V<=C.x1;V++){let j=o.tileXYToRectangle(V,z,A);if(!j)continue;let H=x(j.west),q=x(j.east),k=x(j.south),G=x(j.north),Y=(H-f.minLng)/r*S.width,Q=(f.maxLat-G)/i*S.height,ie=(q-H)/r*S.width,le=(G-k)/i*S.height;Y+ie<0||Y>S.width||Q+le<0||Q>S.height||M.push(Promise.resolve().then(()=>n.requestImage(V,z,A)).then(ue=>{if(!ue)return;let ce=ue.width||ue.naturalWidth||0,Ae=ue.height||ue.naturalHeight||0;if(!(!ce||!Ae))try{I.drawImage(ue,0,0,ce,Ae,Y,Q,ie,le),T++;}catch{}}).catch(()=>{}));}if(await Promise.all(M),!T)return null;let E=(z,V)=>[(z-f.minLng)/r,(V-f.minLat)/i];return {canvas:S,width:S.width,height:S.height,level:A,tiles:T,uv:E}}async function Sn(e,u,f,a={}){for(let n of u||[])if(!(!n||n.show===false))try{let o=await Hr(e,n,f,a);if(o)return o}catch{}return null}var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zr=(()=>{let e=new Int16Array(128).fill(-1);for(let u=0;u<De.length;u++)e[De.charCodeAt(u)]=u;return e})();function Wr(e){let u=e.length,f=[],a=0;for(;a+2<u;a+=3){let o=e[a]<<16|e[a+1]<<8|e[a+2];f.push(De[o>>>18&63]+De[o>>>12&63]+De[o>>>6&63]+De[o&63]);}let n=u-a;if(n===1){let o=e[a]<<16;f.push(De[o>>>18&63]+De[o>>>12&63]+"==");}else if(n===2){let o=e[a]<<16|e[a+1]<<8;f.push(De[o>>>18&63]+De[o>>>12&63]+De[o>>>6&63]+"=");}return f.join("")}function Ur(e){let u=e.replace(/[^A-Za-z0-9+/]/g,"");if(!u.length)throw new Error("\u9AD8\u5EA6\u6570\u636E\u4E3A\u7A7A");let f=new Uint8Array(Math.floor(u.length*3/4)),a=0,n=0,o=0;for(let r=0;r<u.length;r++){let i=u.charCodeAt(r),s=i<128?zr[i]:-1;if(s<0)throw new Error("\u9AD8\u5EA6\u6570\u636E\u4E0D\u662F\u5408\u6CD5\u7684 base64");a=a<<6|s,n+=6,n>=8&&(n-=8,f[o++]=a>>>n&255,a&=(1<<n)-1);}return o===f.length?f:f.subarray(0,o)}function Mn(e){let u=new Uint8Array(e.length*4),f=new DataView(u.buffer);for(let a=0;a<e.length;a++)f.setFloat32(a*4,e[a],true);return Wr(u)}function In(e,u,f="\u9AD8\u5EA6"){if(typeof e!="string"||!e)throw new Error(`${f}\u9AD8\u5EA6\u6570\u636E\u7F3A\u5931`);let a=Ur(e);if(a.length!==u*4)throw new Error(`${f}\u9AD8\u5EA6\u6570\u636E\u957F\u5EA6\u4E0D\u5339\u914D\uFF1A\u671F\u671B ${u} \u4E2A\u70B9\uFF0C\u5B9E\u9645 ${a.length/4} \u4E2A\u70B9`);let n=new DataView(a.buffer,a.byteOffset,a.byteLength),o=new Float32Array(u);for(let r=0;r<u;r++){let i=n.getFloat32(r*4,true);if(!Number.isFinite(i))throw new Error(`${f}\u9AD8\u5EA6\u6570\u636E\u5305\u542B\u975E\u6CD5\u503C\uFF08\u7B2C ${r} \u4E2A\u70B9\uFF09`);o[r]=i;}return o}function Tn(e,u={}){return {segments:e.segments,slopeWidth:e.slopeWidth,fillHoles:u.fillHoles!==false,bounds:{...e.bounds},base:Mn(e.base),current:Mn(e.current)}}function En(e,u){if(!u||typeof u!="object")throw new Error("\u7F3A\u5C11\u9AD8\u5EA6\u573A\u6570\u636E");let f=Number(u.segments);if(!Number.isFinite(f)||f<8||f>256)throw new Error(`\u683C\u7F51\u5206\u6BB5\u975E\u6CD5\uFF1A${u.segments}`);let a=Tt(e,{segments:f,slopeWidth:typeof u.slopeWidth=="number"?u.slopeWidth:void 0,fillHoles:u.fillHoles!==false}),n=u.bounds;if(n&&typeof n.minLng=="number"&&typeof n.maxLat=="number"){let o=Math.max(1e-9,a.bounds.maxLng-a.bounds.minLng,a.bounds.maxLat-a.bounds.minLat),r=Math.max(1e-9,o*1e-6);if(Math.max(Math.abs(n.minLng-a.bounds.minLng),Math.abs(n.minLat-a.bounds.minLat),Math.abs(n.maxLng-a.bounds.maxLng),Math.abs(n.maxLat-a.bounds.maxLat))>r)throw new Error("\u8303\u56F4\u4E0E\u9AD8\u5EA6\u573A\u4E0D\u5339\u914D\uFF0C\u8BF7\u4F7F\u7528\u5BFC\u51FA\u65F6\u7684\u90A3\u4EFD polygon")}return a.base.set(In(u.base,a.vertexCount,"\u539F\u59CB")),a.current.set(In(u.current,a.vertexCount,"\u7F16\u8F91\u540E")),a}var Nr=140,Xr=250,jr=.1,Yr=1,Ln="cesium-dev-kit:terrain-edit",kn=1,ot={x:.35,y:1,z:.3},qr=`
1030
1030
  varying float vCut;
1031
1031
  varying vec3 vLocalPos;
1032
1032
  float teHash(vec3 p) {
@@ -1055,7 +1055,7 @@ float teFbm(vec3 p) {
1055
1055
  }
1056
1056
  return sum;
1057
1057
  }
1058
- `,Fr=`
1058
+ `,Qr=`
1059
1059
  {
1060
1060
  float teAmt = clamp(abs(vCut), 0.0, 1.0);
1061
1061
  if (teAmt > 0.004) {
@@ -1101,12 +1101,12 @@ float teFbm(vec3 p) {
1101
1101
  diffuseColor.rgb = mix(diffuseColor.rgb, rock, teAmt);
1102
1102
  }
1103
1103
  }
1104
- `;function Vr(e,h){let y=111319.49079327358,o=y*Math.cos((e.lat+h.lat)/2*Math.PI/180),n=(h.lng-e.lng)*o,a=(h.lat-e.lat)*y;return Math.sqrt(n*n+a*a)}function Hr(){let e=null,h=null,y=64,o=20,n="cesium-dev-kit-terrain-edit",a=function(r,i,l,s,c){if(!r)throw new oe("INVALID_ARGUMENT","TerrainEdit \u9700\u8981\u4F20\u5165 viewer");if(!i)throw new oe("INVALID_ARGUMENT","TerrainEdit \u9700\u8981\u4F20\u5165 Cesium \u5168\u5C40\u5BF9\u8C61");e=i,h=l||null,this._viewer=r,this._threeJs=s||c&&c.threeJs||null,this._options=c||{},this._polygon=[],this._polygonHeight=[],this._grid=null,this._history=[],this._root=null,this._waterLevel=null,this._stepHeight=0,this._showGrid=true,this._brush={mode:"lower",radius:110,strength:1,hardness:.9,roughness:.28,maxDelta:3,strokeLimit:0,targetHeight:null},this._brushEnabled=false,this._brushHandler=null,this._stroking=false,this._brushCursor=null,this._brushPointer=null,this._sprayTimer=null,this._sprayAt=null,this._onWindowUp=null,this._onCanvasLeave=null,this._lastMoveAt=0,this._lastHit=null,this._lastMovePos=null,this._strokeDist=0,this._strokeBase=null,this._strokeTarget=null,this._sprayTick=false,this._targetAuto=false,this._useTexture=true,this._cutSurface=false,this._texture=null,this._surface=null,this._localXZ=null,this._baseColors=null,this._lastContourAt=0,this._up=null,this._areaMode=false,this._textureToken=0,this._contourInterval=0,this._dirty=false,this._prevController=void 0,this._drawing=false,this._draftPoints=[],this._handler=null,this._draftSource=null,this._disposed=false,se(this),ae(this,()=>this.dispose());};return a.prototype={_getScene(){let r=this._threeJs,i=r&&r._three&&r._three.scene;if(!i)throw new oe("INVALID_ARGUMENT","TerrainEdit \u9700\u8981 three.js \u573A\u666F\uFF1A\u8BF7\u5148 createKit({ three: THREE })\uFF0C\u518D\u8C03\u7528 kit.threeJs.initThree({ center })");return i},_toLocal(r,i,l){let s=this._getScene(),c=s.positionToWorldVector([r,i,l]);return s.childrenGroup.worldToLocal(c.clone())},_normalizePositions(r){let i=[];for(let l of r||[])if(l){if(Array.isArray(l)){if(l.length<2)continue;let s=Number(l[0]),c=Number(l[1]),u=l.length>2?Number(l[2]):0;if(!Number.isFinite(s)||!Number.isFinite(c))continue;i.push({lng:s,lat:c,height:Number.isFinite(u)?u:0});continue}if(typeof l.longitude=="number"&&typeof l.latitude=="number"){let s=e.Cartographic.fromRadians(l.longitude,l.latitude,l.height||0);i.push({lng:e.Math.toDegrees(s.longitude),lat:e.Math.toDegrees(s.latitude),height:s.height||0});continue}if(typeof l.lng=="number"&&typeof l.lat=="number"){i.push({lng:l.lng,lat:l.lat,height:Number(l.height)||0});continue}if(typeof l.x=="number"&&typeof l.y=="number"&&typeof l.z=="number"){let s=e.Cartographic.fromCartesian(l);i.push({lng:e.Math.toDegrees(s.longitude),lat:e.Math.toDegrees(s.latitude),height:s.height||0});}}return i},_pickTerrain(r){let i=this._viewer,l=i.scene,s=null;try{l.pickPositionSupported&&l.globe.depthTestAgainstTerrain&&(s=l.pickPosition(r));}catch{s=null;}if(!s){let c=i.camera.getPickRay(r);c&&(s=l.globe.pick(c,l));}return s||(s=i.camera.pickEllipsoid(r,l.globe.ellipsoid)),s},_ensureDraftSource(){if(this._draftSource)return this._draftSource;let r=new e.CustomDataSource(n);return this._viewer.dataSources.add(r),this._draftSource=r,r},_draftCartesians(r,i){let l=this._draftPoints.slice();return r&&this._draftCursor&&l.push(this._draftCursor),l.length<i?[]:l.map(s=>e.Cartesian3.fromDegrees(s.lng,s.lat,0))},_ensureDraftGraphics(){if(this._draftOutline)return;let r=this._ensureDraftSource(),i=e.Color.fromCssColorString(this._drawColor||"#7defff");this._draftOutline=r.entities.add({name:"terrain-edit-outline",polyline:{positions:new e.CallbackProperty(()=>this._draftCartesians(true,2),false),width:this._drawWidth||4,clampToGround:true,material:new e.PolylineGlowMaterialProperty({glowPower:.18,color:i})}});},_ensureDraftFill(){if(this._draftFill)return;let r=this._ensureDraftSource(),i=e.Color.fromCssColorString(this._drawColor||"#3fd8ff");this._draftFill=r.entities.add({name:"terrain-edit-fill",polygon:{hierarchy:new e.CallbackProperty(()=>new e.PolygonHierarchy(this._draftCartesians(true,3)),false),material:i.withAlpha(.16),classificationType:e.ClassificationType.BOTH,perPositionHeight:false}});},_addDraftVertex(r){let i=this._ensureDraftSource();this._draftPoints.push(r),this._draftCursor=null,i.entities.add({name:"terrain-edit-vertex",position:e.Cartesian3.fromDegrees(r.lng,r.lat,0),point:{pixelSize:this._draftPoints.length===1?10:8,color:e.Color.fromCssColorString(this._draftPoints.length===1?"#ffe066":"#ffffff"),outlineColor:e.Color.fromCssColorString("#0b2a3a"),outlineWidth:2,heightReference:e.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._draftPoints.length>=3&&this._ensureDraftFill();},_clearDraft(){this._draftSource&&this._viewer&&!this._viewer.isDestroyed()&&this._draftSource.entities.removeAll(),this._draftPoints=[],this._draftCursor=null,this._draftOutline=null,this._draftFill=null;},_destroyHandler(){let r=this._handler;if(this._handler=null,r)try{r.isDestroyed()||r.destroy();}catch(i){pe(i,{scope:"TerrainEdit.destroyHandler"});}},beginDraw(r){if(this._disposed)return this;this.cancelDraw(),this._drawing=true,this._draftPoints=[],this._drawColor=r&&r.color||this._options.color||"#7defff",this._drawWidth=r&&r.width||4,this._drawSegments=r&&r.segments||this._options.segments||y,this._drawCallback=r&&r.callback,this._draftCursor=null,this._ensureDraftSource(),this._ensureDraftGraphics();let i=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas);return this._handler=i,i.setInputAction(l=>{let s=this._pickTerrain(l.position);if(!s)return;let c=e.Cartographic.fromCartesian(s);c&&this._addDraftVertex({lng:e.Math.toDegrees(c.longitude),lat:e.Math.toDegrees(c.latitude),height:c.height||0});},e.ScreenSpaceEventType.LEFT_CLICK),i.setInputAction(l=>{if(!this._draftPoints.length)return;let s=this._pickTerrain(l.endPosition);if(!s){this._draftCursor=null;return}let c=e.Cartographic.fromCartesian(s);c&&(this._draftCursor={lng:e.Math.toDegrees(c.longitude),lat:e.Math.toDegrees(c.latitude),height:c.height||0});},e.ScreenSpaceEventType.MOUSE_MOVE),i.setInputAction(()=>this.finishDraw(),e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i.setInputAction(()=>this.finishDraw(),e.ScreenSpaceEventType.RIGHT_CLICK),this},finishDraw(){if(!this._drawing)return this;let r=this._draftPoints.slice(),i=Nt(r,1e-7);if(this._drawing=false,this._destroyHandler(),i.length<3)return this._clearDraft(),pe(new oe("INVALID_ARGUMENT","\u5730\u5F62\u7F16\u8F91\u81F3\u5C11\u9700\u8981 3 \u4E2A\u9876\u70B9\uFF0C\u8BF7\u91CD\u65B0\u7ED8\u5236"),{scope:"TerrainEdit.finishDraw"}),this;this._clearDraft();let l=this._drawCallback;return this.setPolygon(i,{segments:this._drawSegments,slopeWidth:this._options.slopeWidth}).then(()=>{typeof l=="function"&&l(this.getPolygon());}).catch(c=>pe(c,{scope:"TerrainEdit.finishDraw"})),this},cancelDraw(){return this._drawing=false,this._destroyHandler(),this._clearDraft(),this},async _sampleHeights(r){let i=[],l=[];for(let c=0;c<r.vertexCount;c++){if(!r.inside[c])continue;let{lng:u,lat:d}=It(r,c);i.push(e.Cartographic.fromDegrees(u,d)),l.push(c);}let s=null;if(i.length){let c=this._viewer.terrainProvider;if(!(!c||e.EllipsoidTerrainProvider&&c instanceof e.EllipsoidTerrainProvider))try{s=(await e.sampleTerrainMostDetailed(c,i)).map(m=>m.height||0);}catch{try{s=(await e.sampleTerrain(c,13,i)).map(f=>f.height||0);}catch(m){pe(m,{scope:"TerrainEdit.sampleHeights"});}}}for(let c=0;c<l.length;c++){let u=l[c];r.base[u]=s&&s[c]||0;}return r.current=new Float32Array(r.base),r},async setPolygon(r,i){let l=Nt(this._normalizePositions(r),1e-9);if(l.length<3)throw new oe("INVALID_ARGUMENT","\u5730\u5F62\u7F16\u8F91\u81F3\u5C11\u9700\u8981 3 \u4E2A\u6709\u6548\u9876\u70B9");let s=i&&i.segments||this._options.segments||y,c=i&&i.slopeWidth||this._options.slopeWidth,u=vn(l,{segments:s,slopeWidth:c,fillHoles:i?i.fillHoles:void 0});return await this._sampleHeights(u),this._polygon=l.map(d=>({lng:d.lng,lat:d.lat})),this._polygonHeight=l.map(d=>d.height||0),this._grid=u,this._history=[],this._waterLevel=null,this._texture=null,this._textureToken++,this._rebuild(),this._renderBoundary(),this._useTexture&&this._requestTexture(),this},_renderBoundary(){if(!this._polygon.length||this._areaMode)return;let r=this._ensureDraftSource();this._boundaryEntity&&(r.entities.remove(this._boundaryEntity),this._boundaryEntity=null);let i=this._polygon.map(l=>e.Cartesian3.fromDegrees(l.lng,l.lat,0));i.push(i[0]),this._boundaryEntity=r.entities.add({name:"terrain-edit-boundary",polyline:{positions:i,width:3,clampToGround:true,material:new e.PolylineGlowMaterialProperty({glowPower:.12,color:e.Color.fromCssColorString("#9ff6ff")})}});},_heightAt(r,i){let l=this._grid;if(!l)return 0;let{bounds:s,stride:c,segments:u,current:d}=l,m=(r-s.minLng)/(s.maxLng-s.minLng)*u,f=(i-s.minLat)/(s.maxLat-s.minLat)*u,p=Math.max(0,Math.min(u-1,Math.floor(m))),g=Math.max(0,Math.min(u-1,Math.floor(f))),v=Math.max(0,Math.min(1,m-p)),A=Math.max(0,Math.min(1,f-g)),w=g*c+p,C=w+1,_=w+c,P=_+1,b=d[w]*(1-v)+d[C]*v,x=d[_]*(1-v)+d[P]*v;return b*(1-A)+x*A},_clearMeshes(){let r=this._root,i=this._threeJs&&this._threeJs._three&&this._threeJs._three.scene;r&&(r.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material:[l.material]).forEach(c=>c&&c.dispose&&c.dispose());}),i&&i.remove&&i.remove(r),this._root=null);},_rebuild(){if(!this._grid||!h||!this._polygon.length)return this;let r=this._getScene(),i=zt(this._polygon);r.lngLat=[i.lng,i.lat],r.updateGroupMatrixWorld(),r.updateMatrixWorld(true),this._clearMeshes();let l=new h.Group;l.name="terrain-edit-root",r.add(l),this._root=l;let s=this._grid,c=Tt(s,this._polygon,s.current),u=this._waterLevel,d=Math.max(1,c.maxHeight-c.minHeight),m=s.stride,f=this._toLocal(i.lng,i.lat,0),p=this._toLocal(i.lng,i.lat,100),g=new h.Vector3().subVectors(p,f).normalize();this._up=g;let v=new Float32Array(s.vertexCount*3),A=new Float32Array(s.vertexCount*3),w=new Float32Array(s.vertexCount*2),C=new Float32Array(s.vertexCount),_=new Float32Array(s.vertexCount*3),P=this._texture,b=!!(P&&P.canvas);for(let G=0;G<s.vertexCount;G++){let X=Math.floor(G/m),j=G%m,{lng:K,lat:R}=It(s,G),O=this._toLocal(K,R,0);_[G*3]=O.x,_[G*3+1]=O.y,_[G*3+2]=O.z;let q=s.current[G];if(v[G*3]=O.x+g.x*q,v[G*3+1]=O.y+g.y*q,v[G*3+2]=O.z+g.z*q,P&&P.uv){let ce=P.uv(K,R);w[G*2]=ce[0],w[G*2+1]=ce[1];}let Z=(c.maxHeight-q)/d,le=u!=null&&q<u,ie=b?[1,1,1]:wn(Z,it(j,X),le);A[G*3]=ie[0],A[G*3+1]=ie[1],A[G*3+2]=ie[2];}this._localXZ=_;let x=[];for(let G=0;G<s.segments;G++)for(let X=0;X<s.segments;X++){let j=G*m+X,K=j+1,R=j+m,O=R+1;s.inside[j]&&s.inside[K]&&s.inside[R]&&s.inside[O]&&x.push(j,R,K,K,R,O);}if(!x.length)return this;let T=new h.Vector3(v[x[0]*3],v[x[0]*3+1],v[x[0]*3+2]),S=new h.Vector3(v[x[1]*3],v[x[1]*3+1],v[x[1]*3+2]),M=new h.Vector3(v[x[2]*3],v[x[2]*3+1],v[x[2]*3+2]);if(new h.Vector3().subVectors(S,T).cross(new h.Vector3().subVectors(M,T)).dot(g)<0)for(let G=0;G<x.length;G+=3){let X=x[G+1];x[G+1]=x[G+2],x[G+2]=X;}let I=new h.BufferGeometry;I.setAttribute("position",new h.BufferAttribute(v,3)),I.setAttribute("color",new h.BufferAttribute(A,3)),I.setAttribute("uv",new h.BufferAttribute(w,2)),I.setAttribute("aCut",new h.BufferAttribute(C,1)),I.setIndex(x),I.computeVertexNormals(),I.computeBoundingSphere(),this._baseColors=I.getAttribute("color").array.slice(),this._bakeShading(I);let D=this._makeSurfaceMaterial(P&&P.canvas),V=new h.Mesh(I,D);V.name="terrain-edit-surface",l.add(V),this._surface=V;let W=new h.HemisphereLight(16777215,5924210,1);W.name="terrain-edit-hemi";let z=new h.DirectionalLight(16777215,.55);if(z.position.set(.35,1,.3),z.name="terrain-edit-sun",l.add(W),l.add(z),this._buildContours(),!this._areaMode){let G=[];if(this._polygon.forEach(X=>{let j=this._toLocal(X.lng,X.lat,this._heightAt(X.lng,X.lat)+.6);G.push(j.x,j.y,j.z);}),G.length>=6){let X=new h.BufferGeometry;X.setAttribute("position",new h.Float32BufferAttribute(G,3));let j=new h.LineBasicMaterial({color:12908543,transparent:true,opacity:.95}),K=new h.LineLoop(X,j);K.name="terrain-edit-rim",l.add(K);}}return u!=null&&this._buildWater(u),this},_buildContours(){if(!this._root||!this._grid||!h)return this;let r=this._root.getObjectByName("terrain-edit-contour");if(r&&(r.geometry&&r.geometry.dispose(),r.material&&r.material.dispose(),this._root.remove(r)),!this._showGrid)return this;let i=this._grid,l=Tt(i,this._polygon),s=this._stepHeight>0?this._stepHeight:_n(Math.max(1,l.maxHeight-l.minHeight),26),c=bn(i,s,i.current);if(!c.length)return this;let u=c.length/4,d=new Float32Array(u*6),m=Math.max(.35,s*.03),f=0;for(let A=0;A<c.length;A+=4)for(let w=0;w<2;w++){let C=c[A+w*2],_=c[A+w*2+1],P=this._sampleGrid(C,_);d[f++]=P.x,d[f++]=P.y+m,d[f++]=P.z;}let p=new h.BufferGeometry;p.setAttribute("position",new h.BufferAttribute(d,3)),p.computeBoundingSphere();let g=new h.LineBasicMaterial({color:1911322,transparent:true,opacity:.42,depthWrite:false}),v=new h.LineSegments(p,g);return v.name="terrain-edit-contour",v.renderOrder=5,this._root.add(v),this._contourInterval=s,this},_sampleGrid(r,i){let l=this._grid,s=this._localXZ,c=this._up,u=l.segments,d=l.segments,m=Math.min(Math.max(r,0),u),f=Math.min(Math.max(i,0),d),p=Math.min(Math.floor(m),u-(u>0?1:0)),g=Math.min(Math.floor(f),d-(d>0?1:0)),v=m-p,A=f-g,w=p*l.stride+g,C=w+1,_=w+l.stride,P=_+1,b=(1-v)*(1-A),x=(1-v)*A,T=v*(1-A),S=v*A,M=l.current[w]*b+l.current[C]*x+l.current[_]*T+l.current[P]*S,E=s[w*3]*b+s[C*3]*x+s[_*3]*T+s[P*3]*S,I=s[w*3+1]*b+s[C*3+1]*x+s[_*3+1]*T+s[P*3+1]*S,D=s[w*3+2]*b+s[C*3+2]*x+s[_*3+2]*T+s[P*3+2]*S;return {x:E+c.x*M,y:I+c.y*M,z:D+c.z*M,h:M}},_sampleHeightAt(r,i){let l=this._grid;if(!l)return this._heightAt(r,i);let s=l.bounds,c=(r-s.minLng)/l.dLng,u=(i-s.minLat)/l.dLat;return c<0||c>l.segments||u<0||u>l.segments?this._heightAt(r,i):this._sampleGrid(u,c).h},_updateSurface(){let r=this._surface,i=this._grid;if(!r||!i)return this;let l=r.geometry.getAttribute("position"),s=l.array,c=this._localXZ,u=this._up;for(let d=0;d<i.vertexCount;d++){let m=i.current[d];s[d*3]=c[d*3]+u.x*m,s[d*3+1]=c[d*3+1]+u.y*m,s[d*3+2]=c[d*3+2]+u.z*m;}return l.needsUpdate=true,r.geometry.computeVertexNormals(),this._bakeShading(r.geometry),r.geometry.computeBoundingSphere(),this},_makeSurfaceMaterial(r){let i={vertexColors:true,side:h.DoubleSide,transparent:true},l=new h.MeshBasicMaterial(i);if(r){let s=new h.CanvasTexture(r);"colorSpace"in s&&h.SRGBColorSpace!==void 0?s.colorSpace=h.SRGBColorSpace:h.sRGBEncoding!=null&&(s.encoding=h.sRGBEncoding),s.minFilter=h.LinearMipmapLinearFilter,s.magFilter=h.LinearFilter,s.generateMipmaps=true,s.anisotropy=this._maxAnisotropy(),s.needsUpdate=true,i.map=s,l.map=s;let c=this._makeEdgeAlphaMap();c&&(i.alphaMap=c,l.alphaMap=c),l.onBeforeCompile=u=>{u.vertexShader=u.vertexShader.replace("#include <common>",`#include <common>
1104
+ `;function Jr(e,u){let f=111319.49079327358,a=f*Math.cos((e.lat+u.lat)/2*Math.PI/180),n=(u.lng-e.lng)*a,o=(u.lat-e.lat)*f;return Math.sqrt(n*n+o*o)}function Kr(){let e=null,u=null,f=64,a=20,n="cesium-dev-kit-terrain-edit",o=function(r,i,s,l,c){if(!r)throw new ae("INVALID_ARGUMENT","TerrainEdit \u9700\u8981\u4F20\u5165 viewer");if(!i)throw new ae("INVALID_ARGUMENT","TerrainEdit \u9700\u8981\u4F20\u5165 Cesium \u5168\u5C40\u5BF9\u8C61");e=i,u=s||null,this._viewer=r,this._threeJs=l||c&&c.threeJs||null,this._options=c||{},this._polygon=[],this._polygonHeight=[],this._grid=null,this._history=[],this._root=null,this._waterLevel=null,this._stepHeight=0,this._showGrid=true,this._brush={mode:"lower",radius:110,strength:1,hardness:.9,roughness:.28,maxDelta:3,strokeLimit:0,targetHeight:null},this._brushEnabled=false,this._brushHandler=null,this._stroking=false,this._brushCursor=null,this._brushPointer=null,this._sprayTimer=null,this._sprayAt=null,this._onWindowUp=null,this._onCanvasLeave=null,this._lastMoveAt=0,this._lastHit=null,this._lastMovePos=null,this._strokeDist=0,this._strokeBase=null,this._strokeTarget=null,this._sprayTick=false,this._targetAuto=false,this._useTexture=true,this._cutSurface=true,this._texture=null,this._surface=null,this._localXZ=null,this._baseColors=null,this._lastContourAt=0,this._up=null,this._east=null,this._north=null,this._areaMode=false,this._areaInfo=null,this._fillHoles=true,this._textureToken=0,this._contourInterval=0,this._dirty=false,this._prevController=void 0,this._drawing=false,this._draftPoints=[],this._handler=null,this._draftSource=null,this._disposed=false,se(this),oe(this,()=>this.dispose());};return o.prototype={_getScene(){let r=this._threeJs,i=r&&r._three&&r._three.scene;if(!i)throw new ae("INVALID_ARGUMENT","TerrainEdit \u9700\u8981 three.js \u573A\u666F\uFF1A\u8BF7\u5148 createKit({ three: THREE })\uFF0C\u518D\u8C03\u7528 kit.threeJs.initThree({ center })");return i},_toLocal(r,i,s){let l=this._getScene(),c=l.positionToWorldVector([r,i,s]);return l.childrenGroup.worldToLocal(c.clone())},_normalizePositions(r){let i=[];for(let s of r||[])if(s){if(Array.isArray(s)){if(s.length<2)continue;let l=Number(s[0]),c=Number(s[1]),h=s.length>2?Number(s[2]):0;if(!Number.isFinite(l)||!Number.isFinite(c))continue;i.push({lng:l,lat:c,height:Number.isFinite(h)?h:0});continue}if(typeof s.longitude=="number"&&typeof s.latitude=="number"){let l=e.Cartographic.fromRadians(s.longitude,s.latitude,s.height||0);i.push({lng:e.Math.toDegrees(l.longitude),lat:e.Math.toDegrees(l.latitude),height:l.height||0});continue}if(typeof s.lng=="number"&&typeof s.lat=="number"){i.push({lng:s.lng,lat:s.lat,height:Number(s.height)||0});continue}if(typeof s.x=="number"&&typeof s.y=="number"&&typeof s.z=="number"){let l=e.Cartographic.fromCartesian(s);i.push({lng:e.Math.toDegrees(l.longitude),lat:e.Math.toDegrees(l.latitude),height:l.height||0});}}return i},_pickTerrain(r){let i=this._viewer,s=i.scene,l=null;try{s.pickPositionSupported&&s.globe.depthTestAgainstTerrain&&(l=s.pickPosition(r));}catch{l=null;}if(!l){let c=i.camera.getPickRay(r);c&&(l=s.globe.pick(c,s));}return l||(l=i.camera.pickEllipsoid(r,s.globe.ellipsoid)),l},_ensureDraftSource(){if(this._draftSource)return this._draftSource;let r=new e.CustomDataSource(n);return this._viewer.dataSources.add(r),this._draftSource=r,r},_draftCartesians(r,i){let s=this._draftPoints.slice();return r&&this._draftCursor&&s.push(this._draftCursor),s.length<i?[]:s.map(l=>e.Cartesian3.fromDegrees(l.lng,l.lat,0))},_ensureDraftGraphics(){if(this._draftOutline)return;let r=this._ensureDraftSource(),i=e.Color.fromCssColorString(this._drawColor||"#7defff");this._draftOutline=r.entities.add({name:"terrain-edit-outline",polyline:{positions:new e.CallbackProperty(()=>this._draftCartesians(true,2),false),width:this._drawWidth||4,clampToGround:true,material:new e.PolylineGlowMaterialProperty({glowPower:.18,color:i})}});},_ensureDraftFill(){if(this._draftFill)return;let r=this._ensureDraftSource(),i=e.Color.fromCssColorString(this._drawColor||"#3fd8ff");this._draftFill=r.entities.add({name:"terrain-edit-fill",polygon:{hierarchy:new e.CallbackProperty(()=>new e.PolygonHierarchy(this._draftCartesians(true,3)),false),material:i.withAlpha(.16),classificationType:e.ClassificationType.BOTH,perPositionHeight:false}});},_addDraftVertex(r){let i=this._ensureDraftSource();this._draftPoints.push(r),this._draftCursor=null,i.entities.add({name:"terrain-edit-vertex",position:e.Cartesian3.fromDegrees(r.lng,r.lat,0),point:{pixelSize:this._draftPoints.length===1?10:8,color:e.Color.fromCssColorString(this._draftPoints.length===1?"#ffe066":"#ffffff"),outlineColor:e.Color.fromCssColorString("#0b2a3a"),outlineWidth:2,heightReference:e.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._draftPoints.length>=3&&this._ensureDraftFill();},_clearDraft(){this._draftSource&&this._viewer&&!this._viewer.isDestroyed()&&this._draftSource.entities.removeAll(),this._draftPoints=[],this._draftCursor=null,this._draftOutline=null,this._draftFill=null;},_destroyHandler(){let r=this._handler;if(this._handler=null,r)try{r.isDestroyed()||r.destroy();}catch(i){ge(i,{scope:"TerrainEdit.destroyHandler"});}},beginDraw(r){if(this._disposed)return this;this.cancelDraw(),this._drawing=true,this._draftPoints=[],this._drawColor=r&&r.color||this._options.color||"#7defff",this._drawWidth=r&&r.width||4,this._drawSegments=r&&r.segments||this._options.segments||f,this._drawCallback=r&&r.callback,this._draftCursor=null,this._ensureDraftSource(),this._ensureDraftGraphics();let i=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas);return this._handler=i,i.setInputAction(s=>{let l=this._pickTerrain(s.position);if(!l)return;let c=e.Cartographic.fromCartesian(l);c&&this._addDraftVertex({lng:e.Math.toDegrees(c.longitude),lat:e.Math.toDegrees(c.latitude),height:c.height||0});},e.ScreenSpaceEventType.LEFT_CLICK),i.setInputAction(s=>{if(!this._draftPoints.length)return;let l=this._pickTerrain(s.endPosition);if(!l){this._draftCursor=null;return}let c=e.Cartographic.fromCartesian(l);c&&(this._draftCursor={lng:e.Math.toDegrees(c.longitude),lat:e.Math.toDegrees(c.latitude),height:c.height||0});},e.ScreenSpaceEventType.MOUSE_MOVE),i.setInputAction(()=>this.finishDraw(),e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i.setInputAction(()=>this.finishDraw(),e.ScreenSpaceEventType.RIGHT_CLICK),this},finishDraw(){if(!this._drawing)return this;let r=this._draftPoints.slice(),i=jt(r,1e-7);if(this._drawing=false,this._destroyHandler(),i.length<3)return this._clearDraft(),ge(new ae("INVALID_ARGUMENT","\u5730\u5F62\u7F16\u8F91\u81F3\u5C11\u9700\u8981 3 \u4E2A\u9876\u70B9\uFF0C\u8BF7\u91CD\u65B0\u7ED8\u5236"),{scope:"TerrainEdit.finishDraw"}),this;this._clearDraft();let s=this._drawCallback;return this.setPolygon(i,{segments:this._drawSegments,slopeWidth:this._options.slopeWidth}).then(()=>{typeof s=="function"&&s(this.getPolygon());}).catch(c=>ge(c,{scope:"TerrainEdit.finishDraw"})),this},cancelDraw(){return this._drawing=false,this._destroyHandler(),this._clearDraft(),this},async _sampleHeights(r){let i=[],s=[];for(let c=0;c<r.vertexCount;c++){if(!r.inside[c])continue;let{lng:h,lat:d}=Et(r,c);i.push(e.Cartographic.fromDegrees(h,d)),s.push(c);}let l=null;if(i.length){let c=this._viewer.terrainProvider;if(!(!c||e.EllipsoidTerrainProvider&&c instanceof e.EllipsoidTerrainProvider))try{l=(await e.sampleTerrainMostDetailed(c,i)).map(m=>m.height||0);}catch{try{l=(await e.sampleTerrain(c,13,i)).map(y=>y.height||0);}catch(m){ge(m,{scope:"TerrainEdit.sampleHeights"});}}}for(let c=0;c<s.length;c++){let h=s[c];r.base[h]=l&&l[c]||0;}return r.current=new Float32Array(r.base),r},async setPolygon(r,i){let s=jt(this._normalizePositions(r),1e-9);if(s.length<3)throw new ae("INVALID_ARGUMENT","\u5730\u5F62\u7F16\u8F91\u81F3\u5C11\u9700\u8981 3 \u4E2A\u6709\u6548\u9876\u70B9");let l=i&&i.segments||this._options.segments||f,c=i&&i.slopeWidth||this._options.slopeWidth,h=Tt(s,{segments:l,slopeWidth:c,fillHoles:i?i.fillHoles:void 0});return await this._sampleHeights(h),this._polygon=s.map(d=>({lng:d.lng,lat:d.lat})),this._polygonHeight=s.map(d=>d.height||0),this._grid=h,this._fillHoles=!(i&&i.fillHoles===false),this._areaInfo=null,this._areaMode=false,this._history=[],this._waterLevel=null,this._texture=null,this._textureToken++,this._rebuild(),this._renderBoundary(),this._useTexture&&this._requestTexture(),this},_renderBoundary(){if(!this._polygon.length||(this._boundaryEntity&&this._draftSource&&this._draftSource.entities.remove(this._boundaryEntity),this._boundaryEntity=null,this._areaMode))return;let r=this._ensureDraftSource(),i=this._polygon.map(s=>e.Cartesian3.fromDegrees(s.lng,s.lat,0));i.push(i[0]),this._boundaryEntity=r.entities.add({name:"terrain-edit-boundary",polyline:{positions:i,width:3,clampToGround:true,material:new e.PolylineGlowMaterialProperty({glowPower:.12,color:e.Color.fromCssColorString("#9ff6ff")})}});},_heightAt(r,i){let s=this._grid;if(!s)return 0;let{bounds:l,stride:c,segments:h,current:d}=s,m=(r-l.minLng)/(l.maxLng-l.minLng)*h,y=(i-l.minLat)/(l.maxLat-l.minLat)*h,p=Math.max(0,Math.min(h-1,Math.floor(m))),g=Math.max(0,Math.min(h-1,Math.floor(y))),v=Math.max(0,Math.min(1,m-p)),A=Math.max(0,Math.min(1,y-g)),w=g*c+p,C=w+1,b=w+c,P=b+1,_=d[w]*(1-v)+d[C]*v,S=d[b]*(1-v)+d[P]*v;return _*(1-A)+S*A},_clearMeshes(){let r=this._root,i=this._threeJs&&this._threeJs._three&&this._threeJs._three.scene;r&&(r.traverse(s=>{s.geometry&&s.geometry.dispose(),s.material&&(Array.isArray(s.material)?s.material:[s.material]).forEach(c=>c&&c.dispose&&c.dispose());}),i&&i.remove&&i.remove(r),this._root=null);},_rebuild(){if(!this._grid||!u||!this._polygon.length)return this;let r=this._getScene(),i=Ut(this._polygon);r.lngLat=[i.lng,i.lat],r.updateGroupMatrixWorld(),r.updateMatrixWorld(true),this._clearMeshes();let s=new u.Group;s.name="terrain-edit-root",r.add(s),this._root=s;let l=this._grid,c=Lt(l,this._polygon,l.current),h=this._waterLevel,d=Math.max(1,c.maxHeight-c.minHeight),m=l.stride,y=this._toLocal(i.lng,i.lat,0),p=this._toLocal(i.lng,i.lat,100),g=new u.Vector3().subVectors(p,y).normalize();this._up=g;let v=this._toLocal(i.lng+1e-5,i.lat,0),A=this._toLocal(i.lng,i.lat+1e-5,0);this._east=new u.Vector3().subVectors(v,y).normalize(),this._north=new u.Vector3().subVectors(A,y).normalize();let w=new Float32Array(l.vertexCount*3),C=new Float32Array(l.vertexCount*3),b=new Float32Array(l.vertexCount*2),P=new Float32Array(l.vertexCount),_=new Float32Array(l.vertexCount*3),S=this._texture,I=!!(S&&S.canvas);for(let H=0;H<l.vertexCount;H++){let q=Math.floor(H/m),k=H%m,{lng:G,lat:Y}=Et(l,H),Q=this._toLocal(G,Y,0);_[H*3]=Q.x,_[H*3+1]=Q.y,_[H*3+2]=Q.z;let ie=l.current[H];if(w[H*3]=Q.x+g.x*ie,w[H*3+1]=Q.y+g.y*ie,w[H*3+2]=Q.z+g.z*ie,S&&S.uv){let Ae=S.uv(G,Y);b[H*2]=Ae[0],b[H*2+1]=Ae[1];}let le=(c.maxHeight-ie)/d,ue=h!=null&&ie<h,ce=I?[1,1,1]:Cn(le,at(k,q),ue);C[H*3]=ce[0],C[H*3+1]=ce[1],C[H*3+2]=ce[2];}this._localXZ=_;let x=[];for(let H=0;H<l.segments;H++)for(let q=0;q<l.segments;q++){let k=H*m+q,G=k+1,Y=k+m,Q=Y+1;l.inside[k]&&l.inside[G]&&l.inside[Y]&&l.inside[Q]&&x.push(k,Y,G,G,Y,Q);}if(!x.length)return this;let M=new u.Vector3(w[x[0]*3],w[x[0]*3+1],w[x[0]*3+2]),T=new u.Vector3(w[x[1]*3],w[x[1]*3+1],w[x[1]*3+2]),E=new u.Vector3(w[x[2]*3],w[x[2]*3+1],w[x[2]*3+2]);if(new u.Vector3().subVectors(T,M).cross(new u.Vector3().subVectors(E,M)).dot(g)<0)for(let H=0;H<x.length;H+=3){let q=x[H+1];x[H+1]=x[H+2],x[H+2]=q;}let O=new u.BufferGeometry;O.setAttribute("position",new u.BufferAttribute(w,3)),O.setAttribute("color",new u.BufferAttribute(C,3)),O.setAttribute("uv",new u.BufferAttribute(b,2)),O.setAttribute("aCut",new u.BufferAttribute(P,1)),O.setIndex(x),O.computeVertexNormals(),this._updateSurfaceUVs(O),O.computeBoundingSphere(),this._baseColors=O.getAttribute("color").array.slice(),this._bakeShading(O);let U=this._makeSurfaceMaterial(S&&S.canvas),z=new u.Mesh(O,U);z.name="terrain-edit-surface",s.add(z),this._surface=z;let V=new u.HemisphereLight(16777215,5924210,1);V.name="terrain-edit-hemi";let j=new u.DirectionalLight(16777215,.55);if(j.position.set(.35,1,.3),j.name="terrain-edit-sun",s.add(V),s.add(j),this._buildContours(),!this._areaMode){let H=[];if(this._polygon.forEach(q=>{let k=this._toLocal(q.lng,q.lat,this._heightAt(q.lng,q.lat)+.6);H.push(k.x,k.y,k.z);}),H.length>=6){let q=new u.BufferGeometry;q.setAttribute("position",new u.Float32BufferAttribute(H,3));let k=new u.LineBasicMaterial({color:12908543,transparent:true,opacity:.95}),G=new u.LineLoop(q,k);G.name="terrain-edit-rim",s.add(G);}}return h!=null&&this._buildWater(h),this},_buildContours(){if(!this._root||!this._grid||!u)return this;let r=this._root.getObjectByName("terrain-edit-contour");if(r&&(r.geometry&&r.geometry.dispose(),r.material&&r.material.dispose(),this._root.remove(r)),!this._showGrid)return this;let i=this._grid,s=Lt(i,this._polygon),l=this._stepHeight>0?this._stepHeight:_n(Math.max(1,s.maxHeight-s.minHeight),26),c=Pn(i,l,i.current);if(!c.length)return this;let h=c.length/4,d=new Float32Array(h*6),m=Math.max(.35,l*.03),y=0;for(let A=0;A<c.length;A+=4)for(let w=0;w<2;w++){let C=c[A+w*2],b=c[A+w*2+1],P=this._sampleGrid(C,b);d[y++]=P.x,d[y++]=P.y+m,d[y++]=P.z;}let p=new u.BufferGeometry;p.setAttribute("position",new u.BufferAttribute(d,3)),p.computeBoundingSphere();let g=new u.LineBasicMaterial({color:1911322,transparent:true,opacity:.42,depthWrite:false}),v=new u.LineSegments(p,g);return v.name="terrain-edit-contour",v.renderOrder=5,this._root.add(v),this._contourInterval=l,this},_sampleGrid(r,i){let s=this._grid,l=this._localXZ,c=this._up,h=s.segments,d=s.segments,m=Math.min(Math.max(r,0),h),y=Math.min(Math.max(i,0),d),p=Math.min(Math.floor(m),h-(h>0?1:0)),g=Math.min(Math.floor(y),d-(d>0?1:0)),v=m-p,A=y-g,w=p*s.stride+g,C=w+1,b=w+s.stride,P=b+1,_=(1-v)*(1-A),S=(1-v)*A,I=v*(1-A),x=v*A,M=s.current[w]*_+s.current[C]*S+s.current[b]*I+s.current[P]*x,T=l[w*3]*_+l[C*3]*S+l[b*3]*I+l[P*3]*x,E=l[w*3+1]*_+l[C*3+1]*S+l[b*3+1]*I+l[P*3+1]*x,R=l[w*3+2]*_+l[C*3+2]*S+l[b*3+2]*I+l[P*3+2]*x;return {x:T+c.x*M,y:E+c.y*M,z:R+c.z*M,h:M}},_sampleHeightAt(r,i){let s=this._grid;if(!s)return this._heightAt(r,i);let l=s.bounds,c=(r-l.minLng)/s.dLng,h=(i-l.minLat)/s.dLat;return c<0||c>s.segments||h<0||h>s.segments?this._heightAt(r,i):this._sampleGrid(h,c).h},_updateSurface(){let r=this._surface,i=this._grid;if(!r||!i)return this;let s=r.geometry.getAttribute("position"),l=s.array,c=this._localXZ,h=this._up;for(let d=0;d<i.vertexCount;d++){let m=i.current[d];l[d*3]=c[d*3]+h.x*m,l[d*3+1]=c[d*3+1]+h.y*m,l[d*3+2]=c[d*3+2]+h.z*m;}return s.needsUpdate=true,r.geometry.computeVertexNormals(),this._updateSurfaceUVs(r.geometry),this._bakeShading(r.geometry),r.geometry.computeBoundingSphere(),this},_updateSurfaceUVs(r){let i=r||this._surface&&this._surface.geometry,s=this._texture,l=this._grid,c=this._up,h=this._east,d=this._north;if(!i||!s||!s.uv||!l||!c||!h||!d)return this;let m=i.getAttribute("normal"),y=i.getAttribute("uv");if(!m||!y)return this;let p=y.array,g=l.current,v=l.base,A=l.stride,w=l.dLng,C=l.dLat,b=l.bounds,P=111319.49079327358,_=Oe(b.minLat),S={east:0,north:0};for(let I=0;I<l.vertexCount;I++){let x=Math.floor(I/A),M=I%A,T=b.minLng+M*w,E=b.minLat+x*C;M===0&&(_=Oe(E));let R=0,O=0,U=g[I]-v[I];if(Math.abs(U)>.001){let V=m.getX(I),j=m.getY(I),H=m.getZ(I),q=V*h.x+j*h.y+H*h.z,k=V*d.x+j*d.y+H*d.z,G=Math.abs(V*c.x+j*c.y+H*c.z);xn(U,q,k,G,S),R=S.east/_,O=S.north/P;}let z=s.uv(T+R,E+O);p[I*2]=z[0],p[I*2+1]=z[1];}return y.needsUpdate=true,this},_makeSurfaceMaterial(r){let i={vertexColors:true,side:u.DoubleSide,transparent:true},s=new u.MeshBasicMaterial(i);if(r){let l=new u.CanvasTexture(r);"colorSpace"in l&&u.SRGBColorSpace!==void 0?l.colorSpace=u.SRGBColorSpace:u.sRGBEncoding!=null&&(l.encoding=u.sRGBEncoding),l.minFilter=u.LinearMipmapLinearFilter,l.magFilter=u.LinearFilter,l.generateMipmaps=true,l.anisotropy=this._maxAnisotropy(),l.needsUpdate=true,i.map=l,s.map=l;let c=this._makeEdgeAlphaMap();c&&(i.alphaMap=c,s.alphaMap=c),s.onBeforeCompile=h=>{h.vertexShader=h.vertexShader.replace("#include <common>",`#include <common>
1105
1105
  attribute float aCut;
1106
1106
  varying float vCut;
1107
1107
  varying vec3 vLocalPos;`).replace("#include <begin_vertex>",`#include <begin_vertex>
1108
1108
  vCut = aCut;
1109
- vLocalPos = position;`),u.fragmentShader=u.fragmentShader.replace("#include <common>",`#include <common>
1110
- `+Or).replace("#include <map_fragment>",`#include <map_fragment>
1111
- `+Fr);},l.customProgramCacheKey=()=>"terrain-edit-earth";}return l},_maxAnisotropy(){try{let r=this._threeJs&&this._threeJs._three&&this._threeJs._three.renderer,i=r&&r.capabilities,l=i&&typeof i.getMaxAnisotropy=="function"?i.getMaxAnisotropy():4;return Math.max(4,Math.min(16,Number(l)||4))}catch{return 4}},_makeEdgeAlphaMap(){if(typeof document=="undefined")return null;let r=256,i=document.createElement("canvas");i.width=r,i.height=r;let l=i.getContext("2d");if(!l)return null;let s=l.createImageData(r,r),c=s.data,u=r*.1,d=(f,p)=>{let g=Math.sin(f*12.9898+p*78.233)*43758.5453;return g-Math.floor(g)};for(let f=0;f<r;f++)for(let p=0;p<r;p++){let g=Math.min(p+.5,r-p-.5,f+.5,r-f-.5),v=Math.sin(p*.11)*.42+Math.sin(f*.073+1.7)*.36+Math.sin((p+f)*.041+.6)*.5,A=(g+v*u*.55)/u;A=A<=0?0:A>=1?1:A*A*(3-2*A),A*=.9+.1*d(p,f);let w=(f*r+p)*4,C=Math.round(A*255);c[w]=C,c[w+1]=C,c[w+2]=C,c[w+3]=255;}l.putImageData(s,0,0);let m=new h.CanvasTexture(i);return "colorSpace"in m&&h.NoColorSpace!==void 0&&(m.colorSpace=h.NoColorSpace),m.needsUpdate=true,m},_bakeShading(r){let i=r||this._surface&&this._surface.geometry,l=this._baseColors,s=this._up;if(!i||!l||!s||!this._grid)return this;let c=i.getAttribute("normal"),u=i.getAttribute("color"),d=i.getAttribute("aCut");if(!c||!u)return this;let m=u.array,f=d?d.array:null,p=this._grid.vertexCount,g=this._grid.current,v=this._grid.base,A=Math.hypot(at.x,at.y,at.z)||1,w=at.x/A,C=at.y/A,_=at.z/A;for(let P=0;P<p;P++){let b=c.getX(P),x=c.getY(P),T=c.getZ(P),S=Math.abs(b*s.x+x*s.y+T*s.z),M=.84+.16*Math.min(1,S),E=Math.abs(g[P]-v[P]);if(E>.001){let D=b*w+x*C+T*_;M*=1+Math.min(1,E/6)*.3*D;}let I=0;if(f){let D=g[P]-v[P];if(this._cutSurface&&E>2){let V=Math.min(1,(E-2)/6),W=Math.min(1,Math.max(0,(.8-S)/.22)),z=Math.min(1,Math.max(0,(E-60)/160)),G=V*Math.max(W,z*.85);if(G=Math.pow(G,.7),G>.002){let X=Math.min(1,Math.max(0,b*w+x*C+T*_));M*=1-G*(1-(.34+.66*X)),M*=1-.22*Math.min(1,E/320)*G,I=D<0?-G:G;}}f[P]=I;}m[P*3]=l[P*3]*M,m[P*3+1]=l[P*3+1]*M,m[P*3+2]=l[P*3+2]*M;}return u.needsUpdate=true,d&&(d.needsUpdate=true),this},async _requestTexture(){if(!this._grid||!this._useTexture)return this;let r=this._viewer.imageryLayers,i=[];for(let f=0;f<r.length;f++){let p=r.get(f);p&&p.show!==false&&i.push(p);}let l=this._grid.bounds,s=++this._textureToken,c=(l.minLat+l.maxLat)/2,u=Math.max((l.maxLng-l.minLng)*111319.49*Math.cos(c*Math.PI/180),(l.maxLat-l.minLat)*111319.49),d=u>3500?{maxSize:4096,maxTiles:256,metersPerPixel:.9}:u>1200?{maxSize:3072,maxTiles:144,metersPerPixel:.8}:{maxSize:2048,maxTiles:96,metersPerPixel:.5},m=null;for(let f=0;f<5&&!m;f++){try{m=await Pn(e,i,{minLng:l.minLng,minLat:l.minLat,maxLng:l.maxLng,maxLat:l.maxLat},d);}catch{m=null;}if(s!==this._textureToken||this._disposed)return this;if(!m&&f<2&&(await new Promise(p=>setTimeout(p,700)),s!==this._textureToken||this._disposed))return this}return s!==this._textureToken||this._disposed?this:(m&&(this._texture=m,this._rebuild()),this)},_buildWater(r){if(!this._root||!this._grid||!this._polygon.length)return;let i=this._grid,l=i.stride,s=new Float32Array(i.vertexCount*3);for(let f=0;f<i.vertexCount;f++){let{lng:p,lat:g}=It(i,f),v=this._toLocal(p,g,r);s[f*3]=v.x,s[f*3+1]=v.y,s[f*3+2]=v.z;}let c=[];for(let f=0;f<i.segments;f++)for(let p=0;p<i.segments;p++){let g=f*l+p,v=g+1,A=g+l,w=A+1;i.inside[g]&&i.inside[v]&&i.inside[A]&&i.inside[w]&&(i.current[g]>=r||i.current[v]>=r||i.current[A]>=r||i.current[w]>=r||c.push(g,A,v,v,A,w));}if(!c.length)return;let u=new h.BufferGeometry;u.setAttribute("position",new h.BufferAttribute(s,3)),u.setIndex(c),u.computeVertexNormals();let d=new h.MeshStandardMaterial({color:2068422,transparent:true,opacity:.82,roughness:.16,metalness:.32,side:h.DoubleSide,depthWrite:false}),m=new h.Mesh(u,d);m.name="terrain-edit-water",this._root.add(m);},_resolveWaterLevel(r){if(r==null||!this._grid)return null;let i=r==="auto"?.6:Number(r);if(!Number.isFinite(i))return null;if(i>1)return i;let l=this._grid,s=Ut(l,l.current).min,c=Ut(l,l.base).average;return c>s?s+(c-s)*i:s},async setArea(r,i={}){var m,f,p;let l=this._normalizePositions([r])[0],c=Math.max(200,(m=i.size)!=null?m:2e3)/2,u=c/111319.49079327358,d=c/qe(l.lat);return this._areaMode=true,this._useTexture=i.texture!==false,i.cutSurface!==void 0&&(this._cutSurface=i.cutSurface!==false),await this.setPolygon([[l.lng-d,l.lat-u],[l.lng+d,l.lat-u],[l.lng+d,l.lat+u],[l.lng-d,l.lat+u]],{segments:(f=i.segments)!=null?f:160,slopeWidth:(p=i.feather)!=null?p:80,fillHoles:i.fillHoles}),this},setBrush(r={}){var l,s,c,u,d,m;let i=this._brush;return this._brush={mode:r.mode||i.mode,radius:Math.max(1,(l=r.radius)!=null?l:i.radius),strength:Math.min(1,Math.max(.01,(s=r.strength)!=null?s:i.strength)),hardness:Math.min(.95,Math.max(0,(c=r.hardness)!=null?c:i.hardness)),roughness:Math.min(1,Math.max(0,(u=r.roughness)!=null?u:i.roughness)),maxDelta:Math.max(.5,(d=r.maxDelta)!=null?d:i.maxDelta),strokeLimit:Math.max(0,Math.min(200,(m=r.strokeLimit)!=null?m:i.strokeLimit)),targetHeight:r.targetHeight===void 0?i.targetHeight:r.targetHeight},r.targetHeight!==void 0&&(this._targetAuto=false),this},getBrush(){return {...this._brush}},enableBrush(r){let i=!!r;if(i&&!this._grid)throw new oe("INVALID_ARGUMENT","\u8BF7\u5148\u8C03\u7528 setArea \u6216 setPolygon \u5708\u5B9A\u53EF\u7F16\u8F91\u8303\u56F4");if(i===this._brushEnabled)return i&&this._ensureBrushHandler(),this;this._brushEnabled=i;let l=this._viewer.scene.screenSpaceCameraController,s=c=>c==null?void 0:Array.isArray(c)?c.slice():[c];if(i)this._prevController===void 0&&(this._prevController={enableRotate:l.enableRotate,enableTilt:l.enableTilt,rotateEventTypes:s(l.rotateEventTypes),tiltEventTypes:s(l.tiltEventTypes)}),l.enableRotate=true,l.enableTilt=true,l.rotateEventTypes=[e.ScreenSpaceEventType.RIGHT_DOWN],l.tiltEventTypes=[e.ScreenSpaceEventType.MIDDLE_DOWN],this._ensureBrushHandler();else {this._finishStroke(),this._destroyBrushHandler(),this._removeBrushCursor(),this._prevController&&(l.enableRotate=this._prevController.enableRotate,l.enableTilt=this._prevController.enableTilt,this._prevController.rotateEventTypes!=null&&(l.rotateEventTypes=s(this._prevController.rotateEventTypes)),this._prevController.tiltEventTypes!=null&&(l.tiltEventTypes=s(this._prevController.tiltEventTypes)),this._prevController=void 0),l.enableRotate=true,l.enableTilt=true;let c=e.ScreenSpaceEventType.LEFT_DOWN,u=s(l.rotateEventTypes);(Array.isArray(u)?u.some(m=>m===c||m&&m.eventType===c):u===c)||(l.rotateEventTypes=Array.isArray(u)&&u.length?[c,...u]:[c]);}return this},beginStroke(){return this._grid?(this._stroking=true,this._strokeBase=new Float32Array(this._grid.current),this._strokeTarget=null,this._sprayTick=false,this._popStrokeSnapshot(),this):this},strokeAt(r,i){if(!this._grid)return this;this._stroking||this.beginStroke();let l=this._brush,s=l.targetHeight;if(l.mode==="level"&&s==null&&(s=this._heightAt(r,i),this._brush.targetHeight=s,this._targetAuto=true),l.mode==="lower"||l.mode==="raise"){let u=l.mode==="lower"?-1:1,d=Math.max(.5,l.maxDelta);this._strokeTarget==null?this._strokeTarget=Mt(this._heightAt(r,i)+u*d,d,u):this._sprayTick&&(this._strokeTarget+=u*d),s=this._strokeTarget;}this._sprayTick=false;let c=Cn(this._grid,{mode:l.mode,lng:r,lat:i,radius:l.radius,strength:l.strength,hardness:l.hardness,roughness:l.roughness,maxDelta:l.maxDelta,strokeLimit:l.strokeLimit,targetHeight:s==null?void 0:s,strokeBase:this._strokeBase});if(c&&c.changed){this._dirty=true,this._updateSurface();let u=typeof performance!="undefined"?performance.now():Date.now();u-(this._lastContourAt||0)>120&&(this._lastContourAt=u,this._buildContours());}return this},endStroke(){return this._stroking?(this._stroking=false,this._strokeBase=null,this._strokeTarget=null,this._sprayTick=false,this._lastContourAt=0,this._targetAuto&&(this._brush.targetHeight=null,this._targetAuto=false),this._dirty&&(this._dirty=false,this._buildContours()),this):this},setCutSurfaceEnabled(r){let i=!!r;return i===this._cutSurface?this:(this._cutSurface=i,this._surface&&this._bakeShading(this._surface.geometry),this)},setTextureEnabled(r){let i=!!r;return i===this._useTexture?this:(this._useTexture=i,i?this._requestTexture():(this._texture=null,this._rebuild()),this)},async refreshTexture(){return this._texture=null,this._useTexture=true,await this._requestTexture(),this},_pickLngLat(r){let i=this._viewer.scene,l=this._viewer.camera.getPickRay(r);if(!l||!i.globe)return null;let s=i.globe.pick(l,i);if(!s)return null;let c=e.Cartographic.fromCartesian(s);return c?{lng:e.Math.toDegrees(c.longitude),lat:e.Math.toDegrees(c.latitude)}:null},_ensureBrushHandler(){if(this._brushHandler)return this;let r=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas);if(this._brushHandler=r,r.setInputAction(l=>{if(!this._brushEnabled)return;let s=this._pickLngLat(l.position);this._updateBrushCursor(s),s&&(this._sprayAt={lng:s.lng,lat:s.lat},this._lastHit={lng:s.lng,lat:s.lat},this._lastMovePos={x:l.position.x,y:l.position.y},this._strokeDist=0,this._lastMoveAt=typeof performance!="undefined"?performance.now():Date.now(),this.beginStroke().strokeAt(s.lng,s.lat),this._startSpray());},e.ScreenSpaceEventType.LEFT_DOWN),r.setInputAction(l=>{if(!this._brushEnabled)return;let s=l.endPosition,c=typeof performance!="undefined"?performance.now():Date.now(),u=this._lastMovePos;if((u?Math.hypot(s.x-u.x,s.y-u.y):1/0)<Gr)return;this._lastMoveAt=c,this._lastMovePos={x:s.x,y:s.y};let m=this._pickLngLat(s);if(this._updateBrushCursor(m),!this._stroking)return;if(!m){this._stopSpray(),this._sprayAt=null,this._lastHit=null;return}this._sprayAt={lng:m.lng,lat:m.lat};let f=this._lastHit;this._strokeDist+=f?Vr(f,m):0,this._lastHit={lng:m.lng,lat:m.lat};let p=Math.max(1,(this._brush.radius||100)*Br);this._strokeDist>=p&&(this._strokeDist-=p,this.strokeAt(m.lng,m.lat)),this._startSpray();},e.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(()=>{this._brushEnabled&&this._finishStroke();},e.ScreenSpaceEventType.LEFT_UP),typeof window!="undefined"){let l=()=>{this._brushEnabled&&this._stroking&&this._finishStroke();};this._onWindowUp=l,window.addEventListener("mouseup",l);}let i=this._viewer.scene.canvas;if(i&&typeof i.addEventListener=="function"){let l=()=>this._stopSpray();this._onCanvasLeave=l,i.addEventListener("mouseleave",l);}return this},_finishStroke(){return this._stopSpray(),this._sprayAt=null,this._lastHit=null,this._lastMovePos=null,this._strokeDist=0,this.endStroke(),this},_startSpray(){return this._sprayTimer?this:typeof window=="undefined"?this:(this._sprayTimer=window.setInterval(()=>{!this._brushEnabled||!this._stroking||!this._sprayAt||(typeof performance!="undefined"?performance.now():Date.now())-(this._lastMoveAt||0)<Rr||(this._sprayTick=true,this.strokeAt(this._sprayAt.lng,this._sprayAt.lat));},Dr),this)},_stopSpray(){return this._sprayTimer&&(typeof window!="undefined"?window.clearInterval(this._sprayTimer):clearInterval(this._sprayTimer),this._sprayTimer=null),this},_destroyBrushHandler(){let r=this._brushHandler;this._brushHandler=null,this._stroking=false,this._stopSpray(),this._sprayAt=null,this._lastHit=null,this._lastMovePos=null,this._strokeDist=0,this._onWindowUp&&typeof window!="undefined"&&window.removeEventListener("mouseup",this._onWindowUp),this._onWindowUp=null;let i=this._viewer&&this._viewer.scene&&this._viewer.scene.canvas;if(this._onCanvasLeave&&i&&typeof i.removeEventListener=="function"&&i.removeEventListener("mouseleave",this._onCanvasLeave),this._onCanvasLeave=null,!r)return this;try{r.destroy();}catch(l){pe(l,{scope:"TerrainEdit.destroyBrushHandler"});}return this},_ensureBrushCursor(){if(this._brushCursor||!h)return this._brushCursor;let r=96,i=new Float32Array(r*3),l=new h.BufferGeometry;l.setAttribute("position",new h.BufferAttribute(i,3));let s=new h.LineLoop(l,new h.LineBasicMaterial({color:16777215,transparent:true,opacity:.85,depthTest:false}));s.renderOrder=900;let c=new Float32Array((r+1)*3),u=[];for(let g=0;g<r;g++)u.push(0,g+1,(g+1)%r+1);let d=new h.BufferGeometry;d.setAttribute("position",new h.BufferAttribute(c,3)),d.setIndex(u);let m=new h.Mesh(d,new h.MeshBasicMaterial({color:16777215,transparent:true,opacity:.12,depthTest:false,side:h.DoubleSide}));m.renderOrder=899;let f=new h.Group;return f.name="terrain-edit-brush",f.add(m),f.add(s),this._getScene().add(f),this._brushCursor=f,f},_updateBrushCursor(r){if(!this._brushEnabled||!this._grid)return this;if(!r)return this._removeBrushCursor(),this;let i=this._ensureBrushCursor();if(!i)return this;let l=this._brush.radius,s=qe(r.lat),c=i.children[1],u=i.children[0],d=c.geometry.getAttribute("position"),m=u.geometry.getAttribute("position"),f=d.count,p=this._up||{x:0,y:1,z:0},g=1.2,v=(A,w,C,_=1)=>{let P=r.lng+Math.cos(C)*l*_/s,b=r.lat+Math.sin(C)*l*_/111319.49079327358,x=(P-this._grid.bounds.minLng)/this._grid.dLng,T=(b-this._grid.bounds.minLat)/this._grid.dLat,S,M,E;if(x>=0&&x<=this._grid.segments&&T>=0&&T<=this._grid.segments){let I=this._sampleGrid(T,x);S=I.x,M=I.y,E=I.z;}else {let I=this._toLocal(P,b,this._heightAt(P,b));S=I.x,M=I.y,E=I.z;}A.array[w*3]=S+p.x*g,A.array[w*3+1]=M+p.y*g,A.array[w*3+2]=E+p.z*g;};for(let A=0;A<f;A++)v(d,A,A/f*Math.PI*2);v(m,0,0,0);for(let A=0;A<f;A++)v(m,A+1,A/f*Math.PI*2);return d.needsUpdate=true,m.needsUpdate=true,c.geometry.computeBoundingSphere(),u.geometry.computeBoundingSphere(),i.visible=true,this},_removeBrushCursor(){var l,s;let r=this._brushCursor;if(!r)return this;let i=(s=(l=this._threeJs)==null?void 0:l._three)==null?void 0:s.scene;return i&&i.remove(r),r.traverse(c=>{c.geometry&&c.geometry.dispose(),c.material&&c.material.dispose();}),this._brushCursor=null,this},_popStrokeSnapshot(){this._grid&&(this._history.push(new Float32Array(this._grid.current)),this._history.length>o&&this._history.shift());},apply(r){if(!this._grid)throw new oe("INVALID_ARGUMENT","\u8BF7\u5148\u8C03\u7528 setPolygon \u6216 beginDraw \u5708\u5B9A\u7F16\u8F91\u8303\u56F4");let i=r||{};return this._history.push(new Float32Array(this._grid.current)),this._history.length>o&&this._history.shift(),this._grid.current=An(this._grid,i),this._stepHeight=i.stepHeight&&i.stepHeight>0?i.stepHeight:0,Object.prototype.hasOwnProperty.call(i,"waterLevel")&&(this._waterLevel=this._resolveWaterLevel(i.waterLevel)),this._rebuild(),this},setWaterLevel(r){return this._grid?(this._waterLevel=this._resolveWaterLevel(r),this._rebuild(),this):this},setContourVisible(r){return this._showGrid=!!r,this._rebuild(),this},undo(){return !this._grid||!this._history.length?this:(this._grid.current=this._history.pop(),this._rebuild(),this)},clear(){if(this.cancelDraw(),this.enableBrush(false),this._clearMeshes(),this._draftSource&&!this._viewer.isDestroyed())try{this._viewer.dataSources.remove(this._draftSource,!0);}catch(r){pe(r,{scope:"TerrainEdit.clear"});}return this._draftSource=null,this._grid=null,this._polygon=[],this._polygonHeight=[],this._history=[],this._waterLevel=null,this._texture=null,this._surface=null,this._localXZ=null,this._baseColors=null,this._areaMode=false,this._strokeBase=null,this._targetAuto&&(this._brush.targetHeight=null,this._targetAuto=false),this._textureToken++,this},getStats(){if(!this._grid)return null;let r=Tt(this._grid,this._polygon,this._grid.current);return {...r,area:r.area||Wt(this._polygon),waterLevel:this._waterLevel,vertices:this._grid.vertexCount}},getPolygon(){return this._polygon.map((r,i)=>({lng:r.lng,lat:r.lat,height:this._polygonHeight[i]||0}))},dispose(){if(!this._disposed){if(this._disposed=true,this._destroyBrushHandler(),this.enableBrush(false),this._removeBrushCursor(),this.cancelDraw(),this._clearMeshes(),this._draftSource&&this._viewer&&!this._viewer.isDestroyed())try{this._viewer.dataSources.remove(this._draftSource,!0);}catch(r){pe(r,{scope:"TerrainEdit.dispose"});}this._draftSource=null,this._grid=null,this._polygon=[],this._polygonHeight=[],this._history=[];}}},a}var At=re(Hr);var Qe=class{constructor(h){this.viewer=null;this.Cesium=h,this.init_data();}init_data(){this.viewer=null;}init({containerId:h,viewerConfig:y,extraConfig:o,MapImageryList:n,imageryProvider:a,viewer:r}){let i=h,l={contextOptions:{webgl:{alpha:false}},animation:false,timeline:false,fullscreenButton:false,geocoder:false,homeButton:false,selectionIndicator:false,shadow:true,sceneMode:this.Cesium.SceneMode.SCENE3D,infoBox:false,sceneModePicker:false,navigationHelpButton:false,projectionPicker:false,baseLayerPicker:false,shouldAnimate:true,navigation:false,showRenderLoopErrors:true},s=this.findCesiumProvider(a),c=o==null?void 0:o.AccessToken;c&&(this.Cesium.Ion.defaultAccessToken=c),l=Object.assign(l,y);let u=r||new this.Cesium.Viewer(i,{...l,...s});if(o&&!o.logo){let d=u.cesiumWidget.creditContainer;d.style.display="none";}if(o&&o.depthTest&&(u.scene.globe.depthTestAgainstTerrain=true),n&&n.length>0)for(let d=0;d<n.length;d++)this.addImageryProvider(u,n[d].type,n[d].option||n[d].classConfig);if(!r){let d=typeof document=="undefined"?null:i&&i.nodeType===1?i:document.getElementById(i);this.bindContainerResize(u,d);}return this.viewer=u,u}bindContainerResize(h,y){if(typeof ResizeObserver=="undefined"||!y)return;let o=()=>{try{(typeof h.isDestroyed!="function"||!h.isDestroyed())&&h.resize();}catch(r){pe(r,{scope:"Controller.bindContainerResize"});}},n=new ResizeObserver(o);n.observe(y),typeof requestAnimationFrame=="function"&&requestAnimationFrame(o);let a=h.destroy.bind(h);h.destroy=function(){try{n.disconnect();}catch(r){pe(r,{scope:"Controller.bindContainerResize.disconnect"});}return a()};}addImageryProvider(h,y,o){h.imageryLayers.addImageryProvider(this.createCesiumProvider({type:y,option:o}));}findCesiumProvider(h){let y={};if(!h)return y;for(let o in h){let n=h[o];if(n&&n.type){y[o]=this.createCesiumProvider(n);continue}y[o]=h[o];}return y}createCesiumProvider(h){switch(h.type){case "WebMapTileServiceImageryProvider":return new this.Cesium[h.type](h.option);case "UrlTemplateImageryProvider":return new this.Cesium[h.type](h.option);case "TileMapServiceImageryProvider":return new this.Cesium[h.type](h.option)}}};function xn(){return typeof window!="undefined"&&typeof document!="undefined"}function Sn(e){if(!xn())throw new oe("UNSUPPORTED_ENVIRONMENT",`${e} \u9700\u8981 DOM \u73AF\u5883\uFF0C\u5F53\u524D\u770B\u8D77\u6765\u662F Node/SSR\u3002\u8BF7\u628A\u8C03\u7528\u653E\u5230\u6D4F\u89C8\u5668\u751F\u547D\u5468\u671F\uFF08\u5982 onMounted / useEffect\uFF09\u91CC\u3002`,{details:{feature:e}})}function zr(e){return e.defaultStatic?e.defaultStatic:typeof e.assetsBaseUrl=="string"?fe(e.assetsBaseUrl):fe()}function jt(e){var a,r,i;let h=(a=e.cesiumGlobal)!=null?a:e.Cesium,y=(r=e.threeGlobal)!=null?r:e.three;if(!h)throw new oe("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!e.containerId&&!e.viewer)throw new oe("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");e.viewer||Sn("createKit / initCesium"),e.onError&&Lt(e.onError);let o=zr(e),n=e.viewer;try{if(!n)n=new Qe(h).init({containerId:e.containerId,viewerConfig:e.viewerConfig,extraConfig:e.extraConfig,MapImageryList:e.MapImageryList,imageryProvider:e.imageryProvider});else if(e.MapImageryList&&e.MapImageryList.length>0){let l=new Qe(h);e.MapImageryList.forEach(s=>{l.addImageryProvider(n,s.type,s.option||s.classConfig);});}}catch(l){throw lt(l)?l:new oe("INTERNAL","\u521B\u5EFA Cesium viewer \u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5 containerId \u4E0E viewerConfig\u3002",{cause:l,details:{containerId:e.containerId}})}return {Cesium:h,viewer:n,defaultStatic:o,assetsBaseUrl:(i=o.baseService)!=null?i:"",three:y,ownsViewer:!e.viewer,containerId:e.containerId,threeContainerId:e.threeContainerId}}function Yt(e){!e||!e.ownsViewer||Ze(e.viewer);}function Wr(e,h,y){function o(n,a){let r=null,i=Fe(a),l=[];if(Array.isArray(n))n.forEach(c=>{let u=Fe(c),d=new u(e,h,y);s(u,i),l.push(d);}),r=new i(e,h,y),l.forEach(c=>Object.assign(r,c)),l.forEach(c=>$e(c,r));else {let c=Fe(n),u=new c(e,h,y);s(c,i),r=new i(e,h,y),Object.assign(r,u),$e(u,r);}function s(c,u){let d=Object.getOwnPropertyNames(c.prototype);for(let m=0,f=d.length;m<f;m++)d[m]!=="constructor"&&(u.prototype[d[m]]=c.prototype[d[m]]);}return r}return o}function qt(e){let h=jt(e),{viewer:y,Cesium:o,defaultStatic:n,three:a}=h,r=Wr(y,o,n),i=r([ee,Be],ct),l=r(ee,ye),s=r(ee,Te),c=new He(y,o),u=r(ee,ut),d=r([ee,Te,He],Ve),m=r([ee,Be],ht),f=r(ee,dt),p=r(ee,mt),g=r([ee,ye],We),v=new ee(y,o),A=r([ee,Ve,We],ft),w=new Xe(y,o),C=new je(y,o),_=new Ye(y,o),P=a?{threeGlobal:a,containerId:h.containerId,threeContainerId:h.threeContainerId}:"",b=new vt(y,o,n,P),x=new At(y,o,a,b),T=[x,b,A,d,g,m,f,p,u,l,i,s,c,v,w,C,_],S=false;return {viewer:y,context:h,material:i,graphics:l,math3d:s,math2d:c,primitive:u,draw:d,passEffect:m,customCesiumPlugin:f,control:p,plugin:g,base:v,analysis:A,attackArrowObj:w,straightArrowObj:C,pincerArrowObj:_,threeJs:b,terrainEdit:x,dispose:()=>{S||(S=true,T.forEach(E=>{try{E&&typeof E.destroy=="function"?E.destroy():Ce(E);}catch(I){pe(I,{scope:"createKit.dispose"});}}),h.ownsViewer?Ze(y):Yt(h));},isDisposed:()=>S}}function Ur(e){return qt(e)}var Nr=Ur;function Xr(e,h,y,o){function n(a,r){let i={},l=Fe(r),s=[];if(Array.isArray(a))a.forEach(u=>{let d=Fe(u),m=new d(e,h,y,o);c(d,l),s.push(m);}),i=new l(e,h,y,o),s.forEach(u=>Object.assign(i,u)),s.forEach(u=>$e(u,i));else {let u=Fe(a),d=new u(e,h,y,o);c(u,l),i=new l(e,h,y,o),Object.assign(i,d),$e(d,i);}function c(u,d){let m=Object.getOwnPropertyNames(u.prototype);for(let f=0,p=m.length;f<p;f++)m[f]!=="constructor"&&(d.prototype[m[f]]=u.prototype[m[f]]);}return i}return n}function jr({cesiumGlobal:e,threeGlobal:h,containerId:y,threeContainerId:o,viewerConfig:n={},extraConfig:a={},MapImageryList:r=[],defaultStatic:i,baseExtendsCom:l=[],extendsCom:s,extendsComName:c,viewer:u}){if(!e)throw new oe("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!y&&!u)throw new oe("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");let m=new Qe(e).init({containerId:y,viewerConfig:n,extraConfig:a,MapImageryList:r,viewer:u}),f=!u,v=Xr(m,e,i,h?{threeGlobal:h,containerId:y,threeContainerId:o}:"")(l,s),A=false;return {viewer:m,[c]:v,dispose:()=>{if(!A){A=true;try{typeof v.destroy=="function"?v.destroy():Ce(v);}catch(w){pe(w,{scope:"singleImport.dispose"});}f&&Ze(m);}}}}function he(e,h,y){function o(n){return jr({...n,baseExtendsCom:e,extendsCom:h,extendsComName:y})}return o}var Mn=he([ee],ye,"graphics");var In=he([ee,Be],ct,"material");var Tn=he([ee],ut,"primitive");var Yr=he([ee,Te,He],Ve,"draw");function qr(e){let h=new Yr(e),y=new Xe(h.viewer,e.cesiumGlobal),o=new je(h.viewer,e.cesiumGlobal),n=new Ye(h.viewer,e.cesiumGlobal);return {...h,attackArrowObj:y,straightArrowObj:o,pincerArrowObj:n}}var En=qr;var Ln=he([ee,Ve,We],ft,"analysis");var kn=he(ee,dt,"customCesiumPlugin");var Dn=he([ee,Be],ht,"passEffect");var Rn=he([ee,ye],We,"plugin");var Bn=he([],vt,"threeJs");var Gn=he([ee],mt,"control");export{Ln as Analysis,Xe as AttackArrow,oe as CesiumDevKitError,Gn as Control,kn as CustomCesiumPlugin,Qn as DEFAULT_STATIC_BASE,En as Draw,Mn as Graphics,In as Material,He as Math2d,Te as Math3d,Dn as PassEffect,Ye as PincerArrow,Rn as Plugin,Tn as Primitive,je as StraightArrow,At as TerrainEdit,Bn as ThreeJs,Sn as assertBrowser,jt as createContext,fe as createDefaultStatic,qt as createKit,Jn as defaultStatic,Yt as disposeContext,Yn as getErrorHandler,Nr as initCesium,xn as isBrowser,lt as isCesiumDevKitError,pe as reportError,Lt as setErrorHandler};//# sourceMappingURL=index.mjs.map
1109
+ vLocalPos = position;`),h.fragmentShader=h.fragmentShader.replace("#include <common>",`#include <common>
1110
+ `+qr).replace("#include <map_fragment>",`#include <map_fragment>
1111
+ `+Qr);},s.customProgramCacheKey=()=>"terrain-edit-earth";}return s},_maxAnisotropy(){try{let r=this._threeJs&&this._threeJs._three&&this._threeJs._three.renderer,i=r&&r.capabilities,s=i&&typeof i.getMaxAnisotropy=="function"?i.getMaxAnisotropy():4;return Math.max(4,Math.min(16,Number(s)||4))}catch{return 4}},_makeEdgeAlphaMap(){if(typeof document=="undefined")return null;let r=256,i=document.createElement("canvas");i.width=r,i.height=r;let s=i.getContext("2d");if(!s)return null;let l=s.createImageData(r,r),c=l.data,h=r*.1,d=(y,p)=>{let g=Math.sin(y*12.9898+p*78.233)*43758.5453;return g-Math.floor(g)};for(let y=0;y<r;y++)for(let p=0;p<r;p++){let g=Math.min(p+.5,r-p-.5,y+.5,r-y-.5),v=Math.sin(p*.11)*.42+Math.sin(y*.073+1.7)*.36+Math.sin((p+y)*.041+.6)*.5,A=(g+v*h*.55)/h;A=A<=0?0:A>=1?1:A*A*(3-2*A),A*=.9+.1*d(p,y);let w=(y*r+p)*4,C=Math.round(A*255);c[w]=C,c[w+1]=C,c[w+2]=C,c[w+3]=255;}s.putImageData(l,0,0);let m=new u.CanvasTexture(i);return "colorSpace"in m&&u.NoColorSpace!==void 0&&(m.colorSpace=u.NoColorSpace),m.needsUpdate=true,m},_bakeShading(r){let i=r||this._surface&&this._surface.geometry,s=this._baseColors,l=this._up;if(!i||!s||!l||!this._grid)return this;let c=i.getAttribute("normal"),h=i.getAttribute("color"),d=i.getAttribute("aCut");if(!c||!h)return this;let m=h.array,y=d?d.array:null,p=this._grid.vertexCount,g=this._grid.current,v=this._grid.base,A=Math.hypot(ot.x,ot.y,ot.z)||1,w=ot.x/A,C=ot.y/A,b=ot.z/A;for(let P=0;P<p;P++){let _=c.getX(P),S=c.getY(P),I=c.getZ(P),x=Math.abs(_*l.x+S*l.y+I*l.z),M=.84+.16*Math.min(1,x),T=Math.abs(g[P]-v[P]);if(T>.001){let R=_*w+S*C+I*b;M*=1+Math.min(1,T/6)*.3*R;}let E=0;if(y){let R=g[P]-v[P];if(this._cutSurface&&T>2){let O=Math.min(1,(T-2)/6),U=Math.min(1,Math.max(0,(.8-x)/.22)),z=Math.min(1,Math.max(0,(T-60)/160)),V=O*Math.max(U,R<0?z*.85:0);if(V=Math.pow(V,.7),V>.002){let j=Math.min(1,Math.max(0,_*w+S*C+I*b));M*=1-V*(1-(.34+.66*j)),M*=1-.22*Math.min(1,T/320)*V,E=R<0?-V:V;}}y[P]=E;}m[P*3]=s[P*3]*M,m[P*3+1]=s[P*3+1]*M,m[P*3+2]=s[P*3+2]*M;}return h.needsUpdate=true,d&&(d.needsUpdate=true),this},async _requestTexture(){if(!this._grid||!this._useTexture)return this;let r=this._viewer.imageryLayers,i=[];for(let y=0;y<r.length;y++){let p=r.get(y);p&&p.show!==false&&i.push(p);}let s=this._grid.bounds,l=++this._textureToken,c=(s.minLat+s.maxLat)/2,h=Math.max((s.maxLng-s.minLng)*111319.49*Math.cos(c*Math.PI/180),(s.maxLat-s.minLat)*111319.49),d=h>3500?{maxSize:4096,maxTiles:256,metersPerPixel:.9}:h>1200?{maxSize:3072,maxTiles:144,metersPerPixel:.8}:{maxSize:2048,maxTiles:96,metersPerPixel:.5},m=null;for(let y=0;y<5&&!m;y++){try{m=await Sn(e,i,{minLng:s.minLng,minLat:s.minLat,maxLng:s.maxLng,maxLat:s.maxLat},d);}catch{m=null;}if(l!==this._textureToken||this._disposed)return this;if(!m&&y<2&&(await new Promise(p=>setTimeout(p,700)),l!==this._textureToken||this._disposed))return this}return l!==this._textureToken||this._disposed?this:(m&&(this._texture=m,this._rebuild()),this)},_buildWater(r){if(!this._root||!this._grid||!this._polygon.length)return;let i=this._grid,s=i.stride,l=new Float32Array(i.vertexCount*3);for(let y=0;y<i.vertexCount;y++){let{lng:p,lat:g}=Et(i,y),v=this._toLocal(p,g,r);l[y*3]=v.x,l[y*3+1]=v.y,l[y*3+2]=v.z;}let c=[];for(let y=0;y<i.segments;y++)for(let p=0;p<i.segments;p++){let g=y*s+p,v=g+1,A=g+s,w=A+1;i.inside[g]&&i.inside[v]&&i.inside[A]&&i.inside[w]&&(i.current[g]>=r||i.current[v]>=r||i.current[A]>=r||i.current[w]>=r||c.push(g,A,v,v,A,w));}if(!c.length)return;let h=new u.BufferGeometry;h.setAttribute("position",new u.BufferAttribute(l,3)),h.setIndex(c),h.computeVertexNormals();let d=new u.MeshStandardMaterial({color:2068422,transparent:true,opacity:.82,roughness:.16,metalness:.32,side:u.DoubleSide,depthWrite:false}),m=new u.Mesh(h,d);m.name="terrain-edit-water",this._root.add(m);},_resolveWaterLevel(r){if(r==null||!this._grid)return null;let i=r==="auto"?.6:Number(r);if(!Number.isFinite(i))return null;if(i>1)return i;let s=this._grid,l=Xt(s,s.current).min,c=Xt(s,s.base).average;return c>l?l+(c-l)*i:l},async setArea(r,i={}){var p,g,v;let s=this._normalizePositions([r])[0],l=Math.max(200,(p=i.size)!=null?p:2e3),c=l/2,h=c/111319.49079327358,d=c/Oe(s.lat),m=(g=i.segments)!=null?g:160,y=(v=i.feather)!=null?v:80;return this._useTexture=i.texture!==false,i.cutSurface!==void 0&&(this._cutSurface=i.cutSurface!==false),await this.setPolygon([[s.lng-d,s.lat-h],[s.lng+d,s.lat-h],[s.lng+d,s.lat+h],[s.lng-d,s.lat+h]],{segments:m,slopeWidth:y,fillHoles:i.fillHoles}),this._areaMode=true,this._areaInfo={center:{lng:s.lng,lat:s.lat},size:l,segments:m,feather:y},this._renderBoundary(),this},setBrush(r={}){var s,l,c,h,d,m;let i=this._brush;return this._brush={mode:r.mode||i.mode,radius:Math.max(1,(s=r.radius)!=null?s:i.radius),strength:Math.min(1,Math.max(.01,(l=r.strength)!=null?l:i.strength)),hardness:Math.min(.95,Math.max(0,(c=r.hardness)!=null?c:i.hardness)),roughness:Math.min(1,Math.max(0,(h=r.roughness)!=null?h:i.roughness)),maxDelta:Math.max(.5,(d=r.maxDelta)!=null?d:i.maxDelta),strokeLimit:Math.max(0,Math.min(200,(m=r.strokeLimit)!=null?m:i.strokeLimit)),targetHeight:r.targetHeight===void 0?i.targetHeight:r.targetHeight},r.targetHeight!==void 0&&(this._targetAuto=false),this},getBrush(){return {...this._brush}},enableBrush(r){let i=!!r;if(i&&!this._grid)throw new ae("INVALID_ARGUMENT","\u8BF7\u5148\u8C03\u7528 setArea \u6216 setPolygon \u5708\u5B9A\u53EF\u7F16\u8F91\u8303\u56F4");if(i===this._brushEnabled)return i&&this._ensureBrushHandler(),this;this._brushEnabled=i;let s=this._viewer.scene.screenSpaceCameraController,l=c=>c==null?void 0:Array.isArray(c)?c.slice():[c];if(i)this._prevController===void 0&&(this._prevController={enableRotate:s.enableRotate,enableTilt:s.enableTilt,rotateEventTypes:l(s.rotateEventTypes),tiltEventTypes:l(s.tiltEventTypes)}),s.enableRotate=true,s.enableTilt=true,s.rotateEventTypes=[e.ScreenSpaceEventType.RIGHT_DOWN],s.tiltEventTypes=[e.ScreenSpaceEventType.MIDDLE_DOWN],this._ensureBrushHandler();else {this._finishStroke(),this._destroyBrushHandler(),this._removeBrushCursor(),this._prevController&&(s.enableRotate=this._prevController.enableRotate,s.enableTilt=this._prevController.enableTilt,this._prevController.rotateEventTypes!=null&&(s.rotateEventTypes=l(this._prevController.rotateEventTypes)),this._prevController.tiltEventTypes!=null&&(s.tiltEventTypes=l(this._prevController.tiltEventTypes)),this._prevController=void 0),s.enableRotate=true,s.enableTilt=true;let c=e.ScreenSpaceEventType.LEFT_DOWN,h=l(s.rotateEventTypes);(Array.isArray(h)?h.some(m=>m===c||m&&m.eventType===c):h===c)||(s.rotateEventTypes=Array.isArray(h)&&h.length?[c,...h]:[c]);}return this},beginStroke(){return this._grid?(this._stroking=true,this._strokeBase=new Float32Array(this._grid.current),this._strokeTarget=null,this._sprayTick=false,this._popStrokeSnapshot(),this):this},strokeAt(r,i){if(!this._grid)return this;this._stroking||this.beginStroke();let s=this._brush,l=s.targetHeight;if(s.mode==="level"&&l==null&&(l=this._heightAt(r,i),this._brush.targetHeight=l,this._targetAuto=true),s.mode==="lower"||s.mode==="raise"){let h=s.mode==="lower"?-1:1,d=Math.max(.5,s.maxDelta);this._strokeTarget==null?this._strokeTarget=It(this._heightAt(r,i)+h*d,d,h):this._sprayTick&&(this._strokeTarget+=h*d),l=this._strokeTarget;}this._sprayTick=false;let c=bn(this._grid,{mode:s.mode,lng:r,lat:i,radius:s.radius,strength:s.strength,hardness:s.hardness,roughness:s.roughness,maxDelta:s.maxDelta,strokeLimit:s.strokeLimit,targetHeight:l==null?void 0:l,strokeBase:this._strokeBase});if(c&&c.changed){this._dirty=true,this._updateSurface();let h=typeof performance!="undefined"?performance.now():Date.now();h-(this._lastContourAt||0)>120&&(this._lastContourAt=h,this._buildContours());}return this},endStroke(){return this._stroking?(this._stroking=false,this._strokeBase=null,this._strokeTarget=null,this._sprayTick=false,this._lastContourAt=0,this._targetAuto&&(this._brush.targetHeight=null,this._targetAuto=false),this._dirty&&(this._dirty=false,this._buildContours()),this):this},setCutSurfaceEnabled(r){let i=!!r;return i===this._cutSurface?this:(this._cutSurface=i,this._surface&&this._bakeShading(this._surface.geometry),this)},setTextureEnabled(r){let i=!!r;return i===this._useTexture?this:(this._useTexture=i,i?this._requestTexture():(this._texture=null,this._rebuild()),this)},async refreshTexture(){return this._texture=null,this._useTexture=true,await this._requestTexture(),this},_pickLngLat(r){let i=this._viewer.scene,s=this._viewer.camera.getPickRay(r);if(!s||!i.globe)return null;let l=i.globe.pick(s,i);if(!l)return null;let c=e.Cartographic.fromCartesian(l);if(!c)return null;let h=this._pickEditedSurface(s,l);return h&&(c=h),{lng:e.Math.toDegrees(c.longitude),lat:e.Math.toDegrees(c.latitude)}},_pickEditedSurface(r,i){let s=this._grid;if(!s||!e)return null;let l=s.bounds,c=e.Math.toDegrees,h=s.dLng,d=s.dLat,m=(b,P)=>b>=l.minLng-h&&b<=l.maxLng+h&&P>=l.minLat-d&&P<=l.maxLat+d,y=e.Cartesian3.distance(r.origin,i);if(!Number.isFinite(y)||y<=0)return null;let p=y+2e4,g=new e.Cartesian3,v=new e.Cartesian3,A=null,w=1/0,C=1/0;for(let b=0;b<8;b++){e.Cartesian3.multiplyByScalar(r.direction,y,g),e.Cartesian3.add(r.origin,g,g);let P=e.Cartographic.fromCartesian(g);if(!P)break;let _=c(P.longitude),S=c(P.latitude);if(!m(_,S))break;let I=this._heightAt(_,S),x=Math.abs(I-P.height);if(b===0&&(C=x),x<w&&(w=x,A=P),x<.05)break;e.Ellipsoid.WGS84.geodeticSurfaceNormal(g,v);let M=e.Cartesian3.dot(r.direction,v);if(!Number.isFinite(M)||Math.abs(M)<1e-6)break;let T=y+(I-P.height)/M;if(!Number.isFinite(T)||T<0||T>p||Math.abs(T-y)<.01)break;y=T;}return !A||w>s.cellSize&&w>=C?null:A},_ensureBrushHandler(){if(this._brushHandler)return this;let r=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas);if(this._brushHandler=r,r.setInputAction(s=>{if(!this._brushEnabled)return;let l=this._pickLngLat(s.position);this._updateBrushCursor(l),l&&(this._sprayAt={lng:l.lng,lat:l.lat},this._lastHit={lng:l.lng,lat:l.lat},this._lastMovePos={x:s.position.x,y:s.position.y},this._strokeDist=0,this._lastMoveAt=typeof performance!="undefined"?performance.now():Date.now(),this.beginStroke().strokeAt(l.lng,l.lat),this._startSpray());},e.ScreenSpaceEventType.LEFT_DOWN),r.setInputAction(s=>{if(!this._brushEnabled)return;let l=s.endPosition,c=typeof performance!="undefined"?performance.now():Date.now(),h=this._lastMovePos;if((h?Math.hypot(l.x-h.x,l.y-h.y):1/0)<Yr)return;this._lastMoveAt=c,this._lastMovePos={x:l.x,y:l.y};let m=this._pickLngLat(l);if(this._updateBrushCursor(m),!this._stroking)return;if(!m){this._stopSpray(),this._sprayAt=null,this._lastHit=null;return}this._sprayAt={lng:m.lng,lat:m.lat};let y=this._lastHit;this._strokeDist+=y?Jr(y,m):0,this._lastHit={lng:m.lng,lat:m.lat};let p=Math.max(1,(this._brush.radius||100)*jr);this._strokeDist>=p&&(this._strokeDist-=p,this.strokeAt(m.lng,m.lat)),this._startSpray();},e.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(()=>{this._brushEnabled&&this._finishStroke();},e.ScreenSpaceEventType.LEFT_UP),typeof window!="undefined"){let s=()=>{this._brushEnabled&&this._stroking&&this._finishStroke();};this._onWindowUp=s,window.addEventListener("mouseup",s);}let i=this._viewer.scene.canvas;if(i&&typeof i.addEventListener=="function"){let s=()=>this._stopSpray();this._onCanvasLeave=s,i.addEventListener("mouseleave",s);}return this},_finishStroke(){return this._stopSpray(),this._sprayAt=null,this._lastHit=null,this._lastMovePos=null,this._strokeDist=0,this.endStroke(),this},_startSpray(){return this._sprayTimer?this:typeof window=="undefined"?this:(this._sprayTimer=window.setInterval(()=>{!this._brushEnabled||!this._stroking||!this._sprayAt||(typeof performance!="undefined"?performance.now():Date.now())-(this._lastMoveAt||0)<Xr||(this._sprayTick=true,this.strokeAt(this._sprayAt.lng,this._sprayAt.lat));},Nr),this)},_stopSpray(){return this._sprayTimer&&(typeof window!="undefined"?window.clearInterval(this._sprayTimer):clearInterval(this._sprayTimer),this._sprayTimer=null),this},_destroyBrushHandler(){let r=this._brushHandler;this._brushHandler=null,this._stroking=false,this._stopSpray(),this._sprayAt=null,this._lastHit=null,this._lastMovePos=null,this._strokeDist=0,this._onWindowUp&&typeof window!="undefined"&&window.removeEventListener("mouseup",this._onWindowUp),this._onWindowUp=null;let i=this._viewer&&this._viewer.scene&&this._viewer.scene.canvas;if(this._onCanvasLeave&&i&&typeof i.removeEventListener=="function"&&i.removeEventListener("mouseleave",this._onCanvasLeave),this._onCanvasLeave=null,!r)return this;try{r.destroy();}catch(s){ge(s,{scope:"TerrainEdit.destroyBrushHandler"});}return this},_ensureBrushCursor(){if(this._brushCursor||!u)return this._brushCursor;let r=96,i=new Float32Array(r*3),s=new u.BufferGeometry;s.setAttribute("position",new u.BufferAttribute(i,3));let l=new u.LineLoop(s,new u.LineBasicMaterial({color:16777215,transparent:true,opacity:.85,depthTest:false}));l.renderOrder=900;let c=new Float32Array((r+1)*3),h=[];for(let g=0;g<r;g++)h.push(0,g+1,(g+1)%r+1);let d=new u.BufferGeometry;d.setAttribute("position",new u.BufferAttribute(c,3)),d.setIndex(h);let m=new u.Mesh(d,new u.MeshBasicMaterial({color:16777215,transparent:true,opacity:.12,depthTest:false,side:u.DoubleSide}));m.renderOrder=899;let y=new u.Group;return y.name="terrain-edit-brush",y.add(m),y.add(l),this._getScene().add(y),this._brushCursor=y,y},_updateBrushCursor(r){if(!this._brushEnabled||!this._grid)return this;if(!r)return this._removeBrushCursor(),this;let i=this._ensureBrushCursor();if(!i)return this;let s=this._brush.radius,l=Oe(r.lat),c=i.children[1],h=i.children[0],d=c.geometry.getAttribute("position"),m=h.geometry.getAttribute("position"),y=d.count,p=this._up||{x:0,y:1,z:0},g=1.2,v=(A,w,C,b=1)=>{let P=r.lng+Math.cos(C)*s*b/l,_=r.lat+Math.sin(C)*s*b/111319.49079327358,S=(P-this._grid.bounds.minLng)/this._grid.dLng,I=(_-this._grid.bounds.minLat)/this._grid.dLat,x,M,T;if(S>=0&&S<=this._grid.segments&&I>=0&&I<=this._grid.segments){let E=this._sampleGrid(I,S);x=E.x,M=E.y,T=E.z;}else {let E=this._toLocal(P,_,this._heightAt(P,_));x=E.x,M=E.y,T=E.z;}A.array[w*3]=x+p.x*g,A.array[w*3+1]=M+p.y*g,A.array[w*3+2]=T+p.z*g;};for(let A=0;A<y;A++)v(d,A,A/y*Math.PI*2);v(m,0,0,0);for(let A=0;A<y;A++)v(m,A+1,A/y*Math.PI*2);return d.needsUpdate=true,m.needsUpdate=true,c.geometry.computeBoundingSphere(),h.geometry.computeBoundingSphere(),i.visible=true,this},_removeBrushCursor(){var s,l;let r=this._brushCursor;if(!r)return this;let i=(l=(s=this._threeJs)==null?void 0:s._three)==null?void 0:l.scene;return i&&i.remove(r),r.traverse(c=>{c.geometry&&c.geometry.dispose(),c.material&&c.material.dispose();}),this._brushCursor=null,this},_popStrokeSnapshot(){this._grid&&(this._history.push(new Float32Array(this._grid.current)),this._history.length>a&&this._history.shift());},apply(r){if(!this._grid)throw new ae("INVALID_ARGUMENT","\u8BF7\u5148\u8C03\u7528 setPolygon \u6216 beginDraw \u5708\u5B9A\u7F16\u8F91\u8303\u56F4");let i=r||{};return this._history.push(new Float32Array(this._grid.current)),this._history.length>a&&this._history.shift(),this._grid.current=wn(this._grid,i),this._stepHeight=i.stepHeight&&i.stepHeight>0?i.stepHeight:0,Object.prototype.hasOwnProperty.call(i,"waterLevel")&&(this._waterLevel=this._resolveWaterLevel(i.waterLevel)),this._rebuild(),this},setWaterLevel(r){return this._grid?(this._waterLevel=this._resolveWaterLevel(r),this._rebuild(),this):this},setContourVisible(r){return this._showGrid=!!r,this._rebuild(),this},undo(){return !this._grid||!this._history.length?this:(this._grid.current=this._history.pop(),this._rebuild(),this)},clear(){if(this.cancelDraw(),this.enableBrush(false),this._clearMeshes(),this._draftSource&&!this._viewer.isDestroyed())try{this._viewer.dataSources.remove(this._draftSource,!0);}catch(r){ge(r,{scope:"TerrainEdit.clear"});}return this._draftSource=null,this._grid=null,this._polygon=[],this._polygonHeight=[],this._history=[],this._waterLevel=null,this._texture=null,this._surface=null,this._localXZ=null,this._baseColors=null,this._east=null,this._north=null,this._areaMode=false,this._areaInfo=null,this._fillHoles=true,this._strokeBase=null,this._targetAuto&&(this._brush.targetHeight=null,this._targetAuto=false),this._textureToken++,this},getStats(){if(!this._grid)return null;let r=Lt(this._grid,this._polygon,this._grid.current);return {...r,area:r.area||Nt(this._polygon),waterLevel:this._waterLevel,vertices:this._grid.vertexCount}},getPolygon(){return this._polygon.map((r,i)=>({lng:r.lng,lat:r.lat,height:this._polygonHeight[i]||0}))},exportData(){if(!this._grid)return null;let r=this._brush,i=this._areaInfo;return {kind:Ln,version:kn,createdAt:new Date().toISOString(),mode:this._areaMode?"area":"polygon",area:i?{center:{lng:i.center.lng,lat:i.center.lat},size:i.size,segments:i.segments,feather:i.feather}:null,polygon:this.getPolygon(),grid:Tn(this._grid,{fillHoles:this._fillHoles}),view:{waterLevel:this._waterLevel,contour:this._showGrid,contourInterval:this._stepHeight,texture:this._useTexture,cutSurface:this._cutSurface},brush:{mode:r.mode,radius:r.radius,strength:r.strength,hardness:r.hardness,roughness:r.roughness,maxDelta:r.maxDelta,strokeLimit:r.strokeLimit},stats:this.getStats()}},importData(r){let i=d=>new ae("INVALID_ARGUMENT",d),s=r;if(typeof s=="string")try{s=JSON.parse(s);}catch(d){throw i("\u5730\u5F62\u6570\u636E\u4E0D\u662F\u5408\u6CD5 JSON\uFF1A"+(d&&d.message?d.message:String(d)))}if(!s||typeof s!="object")throw i("\u5730\u5F62\u6570\u636E\u4E3A\u7A7A");if(s.kind!==Ln)throw i("\u4E0D\u662F TerrainEdit.exportData() \u5BFC\u51FA\u7684\u6570\u636E");if(s.version!==kn)throw i(`\u5730\u5F62\u6570\u636E\u7248\u672C\u4E0D\u652F\u6301\uFF1A${s.version}`);let l=this._normalizePositions(s.polygon||[]);if(l.length<3)throw i("\u5730\u5F62\u6570\u636E\u91CC\u7684 polygon \u5C11\u4E8E 3 \u4E2A\u9876\u70B9");let c;try{c=En(l,s.grid);}catch(d){throw i("\u5730\u5F62\u6570\u636E\u65E0\u6CD5\u8FD8\u539F\uFF1A"+(d&&d.message?d.message:String(d)))}this._stroking&&this._finishStroke(),this._polygon=l.map(d=>({lng:d.lng,lat:d.lat})),this._polygonHeight=l.map(d=>d.height||0),this._grid=c,this._fillHoles=s.grid.fillHoles!==false,this._areaMode=s.mode==="area",this._areaInfo=s.area&&s.area.center?{center:{lng:Number(s.area.center.lng),lat:Number(s.area.center.lat)},size:Number(s.area.size)||0,segments:Number(s.area.segments)||c.segments,feather:Number(s.area.feather)||c.slopeWidth}:null;let h=s.view||{};return this._useTexture=h.texture!==false,this._cutSurface=h.cutSurface!==false,this._showGrid=h.contour!==false,this._stepHeight=Number(h.contourInterval)||0,this._waterLevel=typeof h.waterLevel=="number"?h.waterLevel:null,this._history=[],this._texture=null,this._textureToken++,this._strokeBase=null,this._strokeTarget=null,this._targetAuto=false,s.brush?this.setBrush({...s.brush,targetHeight:null}):this._brush.targetHeight=null,this._rebuild(),this._renderBoundary(),this._useTexture&&this._requestTexture(),this},getHeightField(){let r=this._grid;return r?{segments:r.segments,bounds:{...r.bounds},base:new Float32Array(r.base),current:new Float32Array(r.current)}:null},dispose(){if(!this._disposed){if(this._disposed=true,this._destroyBrushHandler(),this.enableBrush(false),this._removeBrushCursor(),this.cancelDraw(),this._clearMeshes(),this._draftSource&&this._viewer&&!this._viewer.isDestroyed())try{this._viewer.dataSources.remove(this._draftSource,!0);}catch(r){ge(r,{scope:"TerrainEdit.dispose"});}this._draftSource=null,this._grid=null,this._polygon=[],this._polygonHeight=[],this._history=[];}}},o}var wt=re(Kr);var Je=class{constructor(u){this.viewer=null;this.Cesium=u,this.init_data();}init_data(){this.viewer=null;}init({containerId:u,viewerConfig:f,extraConfig:a,MapImageryList:n,imageryProvider:o,viewer:r}){let i=u,s={contextOptions:{webgl:{alpha:false}},animation:false,timeline:false,fullscreenButton:false,geocoder:false,homeButton:false,selectionIndicator:false,shadow:true,sceneMode:this.Cesium.SceneMode.SCENE3D,infoBox:false,sceneModePicker:false,navigationHelpButton:false,projectionPicker:false,baseLayerPicker:false,shouldAnimate:true,navigation:false,showRenderLoopErrors:true},l=this.findCesiumProvider(o),c=a==null?void 0:a.AccessToken;c&&(this.Cesium.Ion.defaultAccessToken=c),s=Object.assign(s,f);let h=r||new this.Cesium.Viewer(i,{...s,...l});if(a&&!a.logo){let d=h.cesiumWidget.creditContainer;d.style.display="none";}if(a&&a.depthTest&&(h.scene.globe.depthTestAgainstTerrain=true),n&&n.length>0)for(let d=0;d<n.length;d++)this.addImageryProvider(h,n[d].type,n[d].option||n[d].classConfig);if(!r){let d=typeof document=="undefined"?null:i&&i.nodeType===1?i:document.getElementById(i);this.bindContainerResize(h,d);}return this.viewer=h,h}bindContainerResize(u,f){if(typeof ResizeObserver=="undefined"||!f)return;let a=()=>{try{(typeof u.isDestroyed!="function"||!u.isDestroyed())&&u.resize();}catch(r){ge(r,{scope:"Controller.bindContainerResize"});}},n=new ResizeObserver(a);n.observe(f),typeof requestAnimationFrame=="function"&&requestAnimationFrame(a);let o=u.destroy.bind(u);u.destroy=function(){try{n.disconnect();}catch(r){ge(r,{scope:"Controller.bindContainerResize.disconnect"});}return o()};}addImageryProvider(u,f,a){u.imageryLayers.addImageryProvider(this.createCesiumProvider({type:f,option:a}));}findCesiumProvider(u){let f={};if(!u)return f;for(let a in u){let n=u[a];if(n&&n.type){f[a]=this.createCesiumProvider(n);continue}f[a]=u[a];}return f}createCesiumProvider(u){switch(u.type){case "WebMapTileServiceImageryProvider":return new this.Cesium[u.type](u.option);case "UrlTemplateImageryProvider":return new this.Cesium[u.type](u.option);case "TileMapServiceImageryProvider":return new this.Cesium[u.type](u.option)}}};function Dn(){return typeof window!="undefined"&&typeof document!="undefined"}function Rn(e){if(!Dn())throw new ae("UNSUPPORTED_ENVIRONMENT",`${e} \u9700\u8981 DOM \u73AF\u5883\uFF0C\u5F53\u524D\u770B\u8D77\u6765\u662F Node/SSR\u3002\u8BF7\u628A\u8C03\u7528\u653E\u5230\u6D4F\u89C8\u5668\u751F\u547D\u5468\u671F\uFF08\u5982 onMounted / useEffect\uFF09\u91CC\u3002`,{details:{feature:e}})}function Zr(e){return e.defaultStatic?e.defaultStatic:typeof e.assetsBaseUrl=="string"?ye(e.assetsBaseUrl):ye()}function qt(e){var o,r,i;let u=(o=e.cesiumGlobal)!=null?o:e.Cesium,f=(r=e.threeGlobal)!=null?r:e.three;if(!u)throw new ae("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!e.containerId&&!e.viewer)throw new ae("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");e.viewer||Rn("createKit / initCesium"),e.onError&&Dt(e.onError);let a=Zr(e),n=e.viewer;try{if(!n)n=new Je(u).init({containerId:e.containerId,viewerConfig:e.viewerConfig,extraConfig:e.extraConfig,MapImageryList:e.MapImageryList,imageryProvider:e.imageryProvider});else if(e.MapImageryList&&e.MapImageryList.length>0){let s=new Je(u);e.MapImageryList.forEach(l=>{s.addImageryProvider(n,l.type,l.option||l.classConfig);});}}catch(s){throw ct(s)?s:new ae("INTERNAL","\u521B\u5EFA Cesium viewer \u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5 containerId \u4E0E viewerConfig\u3002",{cause:s,details:{containerId:e.containerId}})}return {Cesium:u,viewer:n,defaultStatic:a,assetsBaseUrl:(i=a.baseService)!=null?i:"",three:f,ownsViewer:!e.viewer,containerId:e.containerId,threeContainerId:e.threeContainerId}}function Qt(e){!e||!e.ownsViewer||$e(e.viewer);}function $r(e,u,f){function a(n,o){let r=null,i=He(o),s=[];if(Array.isArray(n))n.forEach(c=>{let h=He(c),d=new h(e,u,f);l(h,i),s.push(d);}),r=new i(e,u,f),s.forEach(c=>Object.assign(r,c)),s.forEach(c=>et(c,r));else {let c=He(n),h=new c(e,u,f);l(c,i),r=new i(e,u,f),Object.assign(r,h),et(h,r);}function l(c,h){let d=Object.getOwnPropertyNames(c.prototype);for(let m=0,y=d.length;m<y;m++)d[m]!=="constructor"&&(h.prototype[d[m]]=c.prototype[d[m]]);}return r}return a}function Jt(e){let u=qt(e),{viewer:f,Cesium:a,defaultStatic:n,three:o}=u,r=$r(f,a,n),i=r([ee,Ge],ut),s=r(ee,pe),l=r(ee,Te),c=new We(f,a),h=r(ee,ht),d=r([ee,Te,We],ze),m=r([ee,Ge],dt),y=r(ee,mt),p=r(ee,ft),g=r([ee,pe],Ne),v=new ee(f,a),A=r([ee,ze,Ne],yt),w=new Ye(f,a),C=new qe(f,a),b=new Qe(f,a),P=o?{threeGlobal:o,containerId:u.containerId,threeContainerId:u.threeContainerId}:"",_=new At(f,a,n,P),S=new wt(f,a,o,_),I=[S,_,A,d,g,m,y,p,h,s,i,l,c,v,w,C,b],x=false;return {viewer:f,context:u,material:i,graphics:s,math3d:l,math2d:c,primitive:h,draw:d,passEffect:m,customCesiumPlugin:y,control:p,plugin:g,base:v,analysis:A,attackArrowObj:w,straightArrowObj:C,pincerArrowObj:b,threeJs:_,terrainEdit:S,dispose:()=>{x||(x=true,I.forEach(T=>{try{T&&typeof T.destroy=="function"?T.destroy():Ce(T);}catch(E){ge(E,{scope:"createKit.dispose"});}}),u.ownsViewer?$e(f):Qt(u));},isDisposed:()=>x}}function ei(e){return Jt(e)}var ti=ei;function ni(e,u,f,a){function n(o,r){let i={},s=He(r),l=[];if(Array.isArray(o))o.forEach(h=>{let d=He(h),m=new d(e,u,f,a);c(d,s),l.push(m);}),i=new s(e,u,f,a),l.forEach(h=>Object.assign(i,h)),l.forEach(h=>et(h,i));else {let h=He(o),d=new h(e,u,f,a);c(h,s),i=new s(e,u,f,a),Object.assign(i,d),et(d,i);}function c(h,d){let m=Object.getOwnPropertyNames(h.prototype);for(let y=0,p=m.length;y<p;y++)m[y]!=="constructor"&&(d.prototype[m[y]]=h.prototype[m[y]]);}return i}return n}function ri({cesiumGlobal:e,threeGlobal:u,containerId:f,threeContainerId:a,viewerConfig:n={},extraConfig:o={},MapImageryList:r=[],defaultStatic:i,baseExtendsCom:s=[],extendsCom:l,extendsComName:c,viewer:h}){if(!e)throw new ae("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!f&&!h)throw new ae("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");let m=new Je(e).init({containerId:f,viewerConfig:n,extraConfig:o,MapImageryList:r,viewer:h}),y=!h,v=ni(m,e,i,u?{threeGlobal:u,containerId:f,threeContainerId:a}:"")(s,l),A=false;return {viewer:m,[c]:v,dispose:()=>{if(!A){A=true;try{typeof v.destroy=="function"?v.destroy():Ce(v);}catch(w){ge(w,{scope:"singleImport.dispose"});}y&&$e(m);}}}}function de(e,u,f){function a(n){return ri({...n,baseExtendsCom:e,extendsCom:u,extendsComName:f})}return a}var Bn=de([ee],pe,"graphics");var Gn=de([ee,Ge],ut,"material");var On=de([ee],ht,"primitive");var ii=de([ee,Te,We],ze,"draw");function ai(e){let u=new ii(e),f=new Ye(u.viewer,e.cesiumGlobal),a=new qe(u.viewer,e.cesiumGlobal),n=new Qe(u.viewer,e.cesiumGlobal);return {...u,attackArrowObj:f,straightArrowObj:a,pincerArrowObj:n}}var Fn=ai;var Vn=de([ee,ze,Ne],yt,"analysis");var Hn=de(ee,mt,"customCesiumPlugin");var zn=de([ee,Ge],dt,"passEffect");var Wn=de([ee,pe],Ne,"plugin");var Un=de([],At,"threeJs");var Nn=de([ee],ft,"control");export{Vn as Analysis,Ye as AttackArrow,ae as CesiumDevKitError,Nn as Control,Hn as CustomCesiumPlugin,rr as DEFAULT_STATIC_BASE,Fn as Draw,Bn as Graphics,Gn as Material,We as Math2d,Te as Math3d,zn as PassEffect,Qe as PincerArrow,Wn as Plugin,On as Primitive,qe as StraightArrow,wt as TerrainEdit,Un as ThreeJs,Rn as assertBrowser,qt as createContext,ye as createDefaultStatic,Jt as createKit,ir as defaultStatic,Qt as disposeContext,tr as getErrorHandler,ti as initCesium,Dn as isBrowser,ct as isCesiumDevKitError,ge as reportError,Dt as setErrorHandler};//# sourceMappingURL=index.mjs.map
1112
1112
  //# sourceMappingURL=index.mjs.map