cesium_dev_kit 1.1.23 → 1.1.24
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/CHANGELOG.md +32 -2
- package/README.md +12 -6
- package/README.zh-CN.md +11 -6
- package/dist/control.cjs +2 -2
- package/dist/control.mjs +2 -2
- package/dist/custom-cesium-plugin.cjs +5 -5
- package/dist/custom-cesium-plugin.mjs +5 -5
- package/dist/graphics.cjs +2 -2
- package/dist/graphics.mjs +2 -2
- package/dist/index.cjs +113 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +338 -2
- package/dist/index.d.ts +338 -2
- package/dist/index.mjs +113 -31
- package/dist/index.mjs.map +1 -1
- package/dist/pass-effect.cjs +5 -5
- package/dist/pass-effect.mjs +5 -5
- package/dist/plugin.cjs +2 -2
- package/dist/plugin.mjs +2 -2
- package/dist/primitive.cjs +6 -6
- package/dist/primitive.cjs.map +1 -1
- package/dist/primitive.mjs +6 -6
- package/dist/primitive.mjs.map +1 -1
- package/dist/three.cjs +2 -2
- package/dist/three.cjs.map +1 -1
- package/dist/three.mjs +2 -2
- package/dist/three.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var me=class extends Error{constructor(d,p,r={}){super(`[cesium_dev_kit:${d}] ${p}`),this.name="CesiumDevKitError",this.code=d,this.details=r.details,this.cause=r.cause,Object.setPrototypeOf(this,new.target.prototype);}};function qe(e){return e instanceof me?true:!!e&&typeof e=="object"&&e.name==="CesiumDevKitError"&&typeof e.code=="string"}var ot=null;function vt(e){ot=e;}function wn(){return ot}function Ce(e,d){if(ot)try{ot(e,d);return}catch(r){console.error("[cesium_dev_kit] error handler threw:",r);}let p=d!=null&&d.scope?`[cesium_dev_kit:${d.scope}]`:"[cesium_dev_kit]";console.warn(p,e,d!=null?d:"");}var At=null,wt=null,Ct=null;function Cn(e){return e&&typeof e=="object"&&e.default?e.default:e}function Pt(e,d){return d().then(Cn).catch(p=>{throw qe(p)?p:new me("OPTIONAL_DEPENDENCY_MISSING",`\u8BE5\u529F\u80FD\u9700\u8981\u53EF\u9009\u4F9D\u8D56 "${e}"\uFF0C\u8BF7\u5148\u5B89\u88C5\uFF1Anpm i ${e}`,{cause:p,details:{package:e}})})}function Lt(){return At||(At=Pt("echarts",()=>import('echarts'))),At}function _e(){return wt||(wt=Pt("dat.gui",()=>import('dat.gui'))),wt}function Gt(){return Ct||(Ct=Pt("libgif",()=>import('libgif'))),Ct}var Pn="";function Rt(e,d){if(!d)return "";if(/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(d)||d.startsWith("data:")||d.startsWith("/"))return d;let p=(e||"").replace(/\/+$/,"");return p?p+"/"+d.replace(/^\/+/,""):d}function ce(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 bn=ce();var _n=Object.assign((e,d)=>e!=null?e:d,{EMPTY_OBJECT:Object.freeze({})}),xe=_n;function te(e){function d(...p){let r=e();return new r(...p)}return d.prototype=e().prototype,Object.defineProperty(d,"__cesiumDevKitCreateModule",{value:e,enumerable:false,configurable:false,writable:false}),d}function Me(e){let d=e==null?void 0:e.__cesiumDevKitCreateModule;return typeof d=="function"?d():e}function He(e){if(e)try{if(typeof e.isDestroyed=="function"&&e.isDestroyed())return;typeof e.destroy=="function"&&e.destroy();}catch(d){console.warn("[cesium_dev_kit] failed to dispose viewer:",d);}}var Ie=new WeakMap;function ie(e,d){if(!e||typeof d!="function")return;let p=Ie.get(e);p?p.push(d):Ie.set(e,[d]);}function We(e,d){if(!e||!d||e===d)return;let p=Ie.get(e);if(!p||p.length===0)return;Ie.delete(e);let r=Ie.get(d);r?r.push(...p):Ie.set(d,p);}function de(e){if(!e||typeof e!="object"&&typeof e!="function")return;let d=Ie.get(e);if(d){Ie.delete(e);for(let p=d.length-1;p>=0;p--)try{d[p]();}catch(r){console.warn("[cesium_dev_kit] cleanup failed:",r);}}}function ae(e){e&&typeof e.destroy!="function"&&Object.defineProperty(e,"destroy",{value:function(){de(this);},enumerable:false,configurable:true,writable:true});}function Le(e,d){Object.getOwnPropertyNames(d.prototype).forEach(p=>{p!=="constructor"&&(e.prototype[p]=d.prototype[p]);});}function xn(){let e={},d;class p{constructor(n,a,i){if(n){this._viewer=n,e=a,d=i||ce(),this._drawLayer=new e.CustomDataSource("drawLayer"),n&&n.dataSources.add(this._drawLayer);let o=this._drawLayer;ae(this),ie(this,()=>{this._viewer&&o&&(this._viewer.dataSources.remove(o,true),this._drawLayer===o&&(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,i){return n.hasOwnProperty(a)?n[a]:i}getDfSt(n){if(!d)return;let a=d,i=n.reduce((o,h)=>o?o[h]:a[h],void 0);if(i!=null)return typeof i!="string"?i:Rt(a.baseService,i)}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
|
+
'use strict';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;
|
|
2
2
|
in vec2 v_textureCoordinates;
|
|
3
3
|
uniform float scale;
|
|
4
4
|
uniform vec3 offset;
|
|
@@ -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,i,o;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((o=(i=n.alt)!=null?i:n.height)!=null?o:0)};let h=e.Cartographic.fromCartesian(n);return {lng:e.Math.toDegrees(h.longitude),lat:e.Math.toDegrees(h.latitude),alt:h.height}}}transformWGS84ArrayToCartesianArray(n,a){if(this._viewer&&n){var i=this;return n?n.map(function(o){return i.transformWGS84ToCartesian(o,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(i){return a.transformCartesianToWGS84(i)}).filter(function(i){return !!i}):[]}}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 i=0;i<n.length;i++){let o=e.Cartesian3.fromDegrees(Number(n[i][0]),Number(n[i][1]),Number(n[i][2]||0));a.push(o);}return a}setCameraEotateHeading(n){if(n){let a=this._viewer,i=e.Cartesian3.fromDegrees(n.lng,n.lat,n.height),o=e.Math.toRadians(-30),h=360/30,s=5e3,l=e.JulianDate.fromDate(new Date);a.clock.startTime=l.clone(),a.clock.currentTime=l.clone(),a.clock.clockRange=e.ClockRange.CLAMPED,a.clock.clockStep=e.ClockStep.SYSTEM_CLOCK;let u=a.camera.heading,c=function(){let y=e.JulianDate.secondsDifference(a.clock.currentTime,a.clock.startTime),f=e.Math.toRadians(y*h)+u;a.scene.camera.setView({destination:i,orientation:{heading:f,pitch:o}}),a.scene.camera.moveBackward(s),e.JulianDate.compare(a.clock.currentTime,a.clock.stopTime)>=0&&a.clock.onTick.removeEventListener(c);};a.clock.onTick.addEventListener(c),ie(this,()=>{a.clock.onTick.removeEventListener(c);});}}getCatesian3FromPX(n){if(this._viewer&&n){var a=this._viewer.scene.pick(n),i=null,o=false,h=false;if(a instanceof e.Cesium3DTileFeature&&(o=true),o&&(i=this._viewer.scene.pickPosition(n),i)){let l=e.Cartographic.fromCartesian(i);l.height<0&&(l.height=0);let u=e.Math.toDegrees(l.longitude),c=e.Math.toDegrees(l.latitude),m=l.height;i=this.transformWGS84ToCartesian({lng:u,lat:c,alt:m});}if(!a){var s=this._viewer.scene.camera.getPickRay(n);if(!s)return null;i=this._viewer.scene.globe.pick(s,this._viewer.scene),h=true;}if(a&&!o&&(i=this._viewer.scene.pickPosition(n),i)){let l=e.Cartographic.fromCartesian(i);l.height<0&&(l.height=0);let u=e.Math.toDegrees(l.longitude),c=e.Math.toDegrees(l.latitude),m=l.height;i=this.transformWGS84ToCartesian({lng:u,lat:c,alt:m});}if(!o&&!h&&!a&&(i=this._viewer.scene.camera.pickEllipsoid(n,this._viewer.scene.globe.ellipsoid)),i){let l=this.transformCartesianToWGS84(i);return l.alt<0&&(i=this.transformWGS84ToCartesian(l,.1)),i}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),i=a.longitude*180/Math.PI,o=a.latitude*180/Math.PI,h=this._viewer.camera._direction,s=e.Math.toDegrees(h.x),l=e.Math.toDegrees(h.y),u=e.Math.toDegrees(h.z),c=this._viewer.camera.positionCartographic.height,m=e.Math.toDegrees(this._viewer.camera.heading),y=e.Math.toDegrees(this._viewer.camera.pitch),f=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,P=(v+w)/2,x=(A+C)/2;return {lon:i,lat:o,height:c,heading:m,pitch:y,roll:f,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:P,y:x},direction:new e.Cartesian3(s,l,u)}}}}pickUpPosition(n){return this.getCatesian3FromPX(n.position)}getHandlerClickPosition(n){if(this._viewer){let a=this._viewer.scene,i=this._viewer,o=a.camera.pickEllipsoid(n.position,a.globe.elliposid),h={cameraPosistion:i.camera.position,heading:i.camera.heading,pitch:i.camera.pitch,roll:i.camera.roll},s=e.Cartographic.fromCartesian(o);s.height<0&&(s.height=0);let l={alt:s.height,lat:e.Math.toDegrees(s.latitude),lon:e.Math.toDegrees(s.longitude)},u=a.pickPosition(n.position),c=e.Cartographic.fromCartesian(u),m={height:c.height,latitude:e.Math.toDegrees(c.latitude),longitude:e.Math.toDegrees(c.longitude)};return {wgs84Coor:l,graphicCoor:m,cameraPosition:h}}}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:i,leftDown:o,mouseWheel:h,leftUp:s}){if(this._viewer){var l=new e.ScreenSpaceEventHandler(this._viewer.canvas);ie(this,()=>{l&&!l.isDestroyed()&&l.destroy();}),n&&l.setInputAction(function(u){n(u,l);},e.ScreenSpaceEventType.LEFT_CLICK),a&&l.setInputAction(function(u){a(u,l);},e.ScreenSpaceEventType.MOUSE_MOVE),i&&l.setInputAction(function(u){i(u,l);},e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),o&&l.setInputAction(function(u){o(u,l);},e.ScreenSpaceEventType.LEFT_DOWN),h&&l.setInputAction(function(u){h(u,l);},e.ScreenSpaceEventType.WHEEL),s&&l.setInputAction(function(u){s(u,l);},e.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(n){return this.bindHandleEvent(n)}getHandlePosition(n){if(this._viewer){var a=new e.ScreenSpaceEventHandler(this._viewer.scene.canvas),i=this;ie(this,()=>{a&&!a.isDestroyed()&&a.destroy();}),a.setInputAction(function(o){var h=i._viewer.scene.camera.pickEllipsoid(o.endPosition,i._viewer.scene.globe.ellipsoid);typeof n=="function"&&n(i.transformCartesianToWGS84(h),a);},e.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(n){return this.getHandlePosition(n)}saveSceneImages(){if(this._viewer){let s=function(l){for(var u=l.split(","),c=u[0].match(/:(.*?);/)[1],m=atob(u[1]),y=m.length,f=new Uint8Array(y);y--;)f[y]=m.charCodeAt(y);return new Blob([f],{type:c})};var n=this._viewer.scene.canvas,a=n.toDataURL("image/png").replace("image/png","image/octet-stream"),i=document.createElement("a"),o=s(a),h=URL.createObjectURL(o);i.download="scene.png",i.href=h,i.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 i(o){return o.url=o.style==="img"?n:a,o.subdomains||(o.subdomains=["01","02","03","04"]),new e.UrlTemplateImageryProvider(o)}e.Scene.AmapImageryProvider=i;}_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(i){return new e.WebMapTileServiceImageryProvider({url:n.replace(/\{layer\}/g,i.style||"vec").replace(/\{key\}/g,i.key||""),layer:i.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 i(o){return o.layer==="img"?(o.url||(o.url=n),o.subdomains||(o.subdomains=["0","1","2"]),o.customTags={sx(h,s,l,u){return s>>4},sy(h,s,l,u){return (1<<u)-l>>4}}):o.url||(o.url=a),new e.UrlTemplateImageryProvider(o)}e.Scene.TencentImageryProvider=i;}_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",i="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 o(h){return h.url=h.style==="img"?a:h.style==="ter"?i:n,h.subdomains||(h.subdomains=["1","2","3","4","5"]),new e.UrlTemplateImageryProvider(h)}e.Scene.GoogleImageryProvider=o;}_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(o){n=o.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=o.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 i(o,h,s,l,u){var c=o._url+"&x={x}&y={y}&z={z}&customid={style}",m=o._tilingScheme.getNumberOfXTilesAtLevel(l),y=o._tilingScheme.getNumberOfYTilesAtLevel(l);return c=c.replace("{x}",String(h-m/2)).replace("{y}",String(y/2-s-1)).replace("{z}",String(l)).replace("{style}",u),c}a.prototype.getTileCredits=function(o,h,s){},a.prototype.requestImage=function(o,h,s){if(!this.ready)throw new e.DeveloperError("requestImage must not be called before the imagery provider is ready.");var l=i(this,o,h,s,this._style);return e.ImageryProvider.loadImage(this,l)},e.Scene.BaiduImageryProvider=a;}_installGroundSkyBox(){var n=e.BoxGeometry,a=e.Cartesian3,i=e.defaultValue||xe,o=e.defined,h=e.destroyObject,s=e.DeveloperError,l=e.GeometryPipeline,u=e.Matrix3,c=e.Matrix4,m=e.Transforms,y=e.VertexFormat,f=e.BufferUsage,g=e.CubeMap,v=e.DrawCommand,A=e.loadCubeMap,w=e.RenderState,C=e.VertexArray,P=e.BlendingState,x=e.SceneMode,b=e.ShaderProgram,M=e.ShaderSource,k=`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(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;
|
|
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
|
-
`,
|
|
130
|
+
`,S=`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
|
-
`,S=typeof c.getRotation=="function"?c.getRotation.bind(c):c.getMatrix3.bind(c);function L(R){this.sources=R.sources,this._sources=void 0,this.show=i(R.show,true),this._command=new v({modelMatrix:c.clone(c.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var G=new u;L.prototype.update=function(R,z){var U=this;if(this.show&&!(R.mode!==x.SCENE3D&&R.mode!==x.MORPHING)&&R.passes.render){var K=R.context;if(this._sources!==this.sources){this._sources=this.sources;var W=this.sources;if(!o(W.positiveX)||!o(W.negativeX)||!o(W.positiveY)||!o(W.negativeY)||!o(W.positiveZ)||!o(W.negativeZ))throw new s("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof W.positiveX!=typeof W.negativeX||typeof W.positiveX!=typeof W.positiveY||typeof W.positiveX!=typeof W.negativeY||typeof W.positiveX!=typeof W.positiveZ||typeof W.positiveX!=typeof W.negativeZ)throw new s("this.sources properties must all be the same type.");typeof W.positiveX=="string"?A(K,this._sources).then(function(O){U._cubeMap=U._cubeMap&&U._cubeMap.destroy(),U._cubeMap=O;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new g({context:K,source:W}));}var ne=this._command;if(ne.modelMatrix=m.eastNorthUpToFixedFrame(R.camera._positionWC),!o(ne.vertexArray)){ne.uniformMap={u_cubeMap(){return U._cubeMap},u_rotateMatrix(){return S(ne.modelMatrix,G)}};var q=n.createGeometry(n.fromDimensions({dimensions:new a(2,2,2),vertexFormat:y.POSITION_ONLY})),oe=this._attributeLocations=l.createAttributeLocations(q);ne.vertexArray=C.fromGeometry({context:K,geometry:q,attributeLocations:oe,bufferUsage:f._DRAW}),ne.renderState=w.fromCache({blending:P.ALPHA_BLEND});}if(!o(ne.shaderProgram)||this._useHdr!==z){var D=new M({defines:[z?"HDR":""],sources:[k]});ne.shaderProgram=b.fromCache({context:K,vertexShaderSource:_,fragmentShaderSource:D,attributeLocations:this._attributeLocations}),this._useHdr=z;}if(o(this._cubeMap))return ne}},L.prototype.isDestroyed=function(){return false},L.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(),h(this)},e.Scene.GroundSkyBox=L;}removeHandlerByName(n=[]){n.forEach(a=>{this._viewer.screenSpaceEventHandler.removeInputAction(e.ScreenSpaceEventType[a]);});}}return p}var Q=te(xn);function Sn(){let e=null;class p{constructor(n,a,i){if(n){e=a,this._viewer=n,this._graphicsLayer=new e.CustomDataSource("graphicsLayer"),this._drawLayer=this._graphicsLayer,n&&n.dataSources.add(this._graphicsLayer);let o=this._graphicsLayer;ae(this),ie(this,()=>{this._viewer&&o&&(this._viewer.dataSources.remove(o,true),this._graphicsLayer===o&&(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 i in n.positions){let o=n.positions[i],h=this.createGraphics();h.name=n.name||"",h.oid=n.oid||"point",h.position=o,n.point&&(h.point=this.getPointGraphics()),n.billboard&&(h.billboard=this.getBillboardGraphics(n.billboard)),n.label&&(h.label=this.getLabelGraphics(n.label)),a.push(this._graphicsLayer.entities.add(h));}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:i,height:o,width:h,material:s,...l}=n;var a=this.createGraphics();return o=o===void 0?6:o,h=h===void 0?15:h,a.corridor={positions:i,height:o,width:h,...l,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 i=n.entity,o=n.cylinder,h=this;return a.cylinder=this.getCylinderGraphics(o),a.position=new e.CallbackProperty(function(){var s=i.position.getValue(h._viewer.clock.currentTime),l=h._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),u=e.Math.toDegrees(l.latitude),c=e.Math.toDegrees(l.longitude);return e.Cartesian3.fromDegrees(c,u,0)},false),a.cylinder.length=new e.CallbackProperty(function(){var s=i.position.getValue(h._viewer.clock.currentTime),l=h._viewer.scene.globe.ellipsoid.cartesianToCartographic(s);return l.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(),i=n.alp||1,o=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 o?(i=i-.05,i<=0&&(o=false)):(i=i+.05,i>=1&&(o=true)),e.Color.RED.withAlpha(i)},false))},this._graphicsLayer.entities.add(a)}}craeteDynamicCricleGraphics(n){var C,P;if(n&&n.center){var a=this.createGraphics(),i=this,o=n.center,h=n.radius||800,s=n.rotateAmount||.05,l=0,u=n.height||1,c=0,m=0,y=0,f=(C=n.scale)!=null?C:0,g=(P=n.scale2)!=null?P: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 i.transformWGS84ToCartesian(o)},false),a.orientation=new e.CallbackProperty(function(){return e.Transforms.headingPitchRollQuaternion(i.transformWGS84ToCartesian(o),new e.HeadingPitchRoll(e.Math.toRadians(c),e.Math.toRadians(m),e.Math.toRadians(y)))},false);let x=h,b=false;var A=()=>{(h>=f||h<=x)&&(b=!b),b?h+=2:h-=2;},w=()=>{g>=h?h+=2:h=x;};return a.ellipse={material:v,height:u,semiMajorAxis:new e.CallbackProperty(function(){return h},false),semiMinorAxis:new e.CallbackProperty(function(){return h},false),stRotation:new e.CallbackProperty(function(){return s>0&&(l+=s,l>=360&&(l=0)),f&&A(),g&&w(),l},false)},this._graphicsLayer.entities.add(a)}}craeteDynamicShadeWallGraphics(n){if(n&&n.positions){var a=n.alp||1,i=n.num||20,o=n.color||e.Color.RED,h=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 i%2===0?a-=h:a+=h,(a<=.1||a>=1)&&i++,o.withAlpha(a)},false)})},this._graphicsLayer.entities.add(s)}}createCustomDefBillboardGraphics(n){if(n&&n.position){var a=this,i=document.createElement("img");i.src=n.image||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";let o=function(h){if(h.image){var s=document.createElement("canvas");s.width=h.width||150,s.height=h.height||80;var l=s.getContext("2d");l.drawImage(h.image,0,0);var u=h.text;return l.font="15px bold \u5B8B\u4F53",l.fillStyle="#f4fff0",l.fillText(u,55,36),s}};i.onload=function(){n.image=i;var h=a._graphicsLayer.entities.add({position:n.position,billboard:{image:o(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(h);};}}craeteRotatePlaneGraphics(n){if(n&&n.center&&n.positions){var a=this.createGraphics(),i=0,o=n.positions,h=o[0];return a.position=new e.CallbackProperty(function(){return i==0?(h=o[0],i+=1):i<o.length-1?(h=o[i],i+=1):i==o.length-1&&(h=o[i],i=0),h},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 Gt();if(n&&n.position){var i=[],o=n.url,h=0,s=6;return function(u,c){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 y=new a({gif:m});return new Promise(f=>{y.load(()=>{for(let g=1;g<=y.get_length();g++)y.move_to(g),c.push(y.get_canvas().toDataURL());f(c);});})}(o,i),this._graphicsLayer.entities.add({position:n.position,billboard:{verticalOrigin:e.VerticalOrigin.BASELINE,image:new e.CallbackProperty(function(){return i.length?(h<s*(i.length-1)?h++:h=0,i[Math.floor(h/s)]):o},false),scale:.2}})}}setGraphicsRotate(n){if(n&&n.entity&&n.rotateAmount){var a=n.entity,i=n.rotateAmount,o=n.position,h=this;o.heading=0,o.pitch=0,o.roll=0,a.position=new e.CallbackProperty(function(){return h.transformWGS84ToCartesian(o)},false),a.orientation=new e.CallbackProperty(function(){return i>0&&(o.heading+=i,o.heading===360&&(o.heading=0)),e.Transforms.headingPitchRollQuaternion(h.transformWGS84ToCartesian(o),new e.HeadingPitchRoll(e.Math.toRadians(o.heading),e.Math.toRadians(o.pitch),e.Math.toRadians(o.roll)))},false);}}setGraphicsFloat(n){if(n&&n.entity&&n.maxHeiht)try{var a=n.entity,i=n.minHeiht||5,o=n.maxHeiht||100,h=n.cartesians,s=n.speed||.06,l=this,u=i,c=!1;h.length?a.positions=new e.CallbackProperty(function(){var m=l.transformCartesianArrayToWGS84Array(h);for(var y in m){var f=m[y];(i>=o||i<=u)&&(c=!c),c?i+=s:i-=s,f.alt=i;}return l.transformWGS84ArrayToCartesianArray(m,0)},!1):a.position=new e.CallbackProperty(function(){var m=l.transformCartesianToWGS84(h);return (i>=o||i<=u)&&(c=!c),c?i+=s:i-=s,m.alt=i,l.transformWGS84ToCartesian(m)},!1);}catch(m){console.log(m);}}createCanvasGraphics(n){if(n&&n.positions){let a=function(){var i=0,o=document.createElement("canvas"),h=o.getContext("2d"),s=new Image;s.src=n.img||"../../images/ysCesium/logo.png";let l=n.cwidth||0;if(h.clearRect(0,0,l,n.cheight||0),i<=l)h.drawImage(s,i,0);else return i=0,i+=3,o};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:i,alt:o,custMaterial:h,speed:s=0,direction:l="+"}){if(n){var u=this.createGraphics(),c=0,m=this._calcPoints(a,i,o,c);u.wall={positions:new e.CallbackProperty(()=>e.Cartesian3.fromDegreesArrayHeights(m),false),material:h||e.Color.AQUAMARINE.withAlpha(.5)};let y=()=>{s>0&&(c+=s,m=this._calcPoints(a,i,o,Number(l+c)));};return n.clock.onTick.addEventListener(y),ie(this,()=>{n.clock.onTick.removeEventListener(y);}),this._graphicsLayer.entities.add(u)}}_computeCirclularFlight(n,a,i,o,h,s){let l=[];l.push(n),l.push(a),l.push(0);var u=e.Cartesian3.distance(e.Cartesian3.fromDegrees(n,a),e.Cartesian3.fromDegrees(i,o));for(let c=h;c<=h+s;c++){let m=u*Math.sin(c*Math.PI/180),y=Math.cos(c*Math.PI/180),f=(i-n)*y+n,g=(o-a)*y+a;l.push(f),l.push(g),l.push(m);}return l}_objHasOwnProperty(n,a,i){let o=n;return o&&o.hasOwnProperty(a)?o[a]:i}_calcPoints(n,a,i,o){var h=e.Transforms.eastNorthUpToFixedFrame(e.Cartesian3.fromDegrees(n,a)),s=i*Math.cos(o*Math.PI/180),l=i*Math.sin(o*Math.PI/180),u=e.Cartesian3.fromElements(s,l,0),c=e.Matrix4.multiplyByPoint(h,u,new e.Cartesian3),m=e.Cartographic.fromCartesian(c),y=e.Math.toDegrees(m.longitude),f=e.Math.toDegrees(m.latitude);return this._computeCirclularFlight(n,a,y,f,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 p}var ue=te(Sn);function In(){let e=null;class p{constructor(n,a,i){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,i=e.defaultValue,o=e.defined,h=Object.defineProperties,s=e.Event,l=e.createPropertyDescriptor,u=e.Property,c=e.Material,m=a.WHITE,y=n.MaterialType||"wallType"+parseInt(String(Math.random()*1e3));let f=function(g){g=i(g,i.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 h(f.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:l("color")}),f.prototype.getType=function(){return y},f.prototype.getValue=function(g,v){return o(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},f.prototype.equals=function(g){return this===g||g instanceof f&&u.equals(this._color,g._color)},c._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 f(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,i=e.defaultValue,o=e.defined,h=Object.defineProperties,s=e.Event,l=e.createPropertyDescriptor,u=e.Property,c=e.Material,m=n.MaterialType||"wallType"+parseInt(String(Math.random()*1e3));let y=function(f){f=i(f,i.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this.color=f.color||a.BLUE,this.duration=f.duration||3e3,this._time=new Date().getTime();};return h(y.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}},color:l("color")}),y.prototype.getType=function(){return m},y.prototype.getValue=function(f,g){return o(g)||(g={}),g.color=u.getValueOrClonedDefault(this._color,f,a.WHITE,g.color),g.image=n.image,g.time=(new Date().getTime()-this._time)%this.duration/this.duration,g},y.prototype.equals=function(f){return this===f||f instanceof y&&u.equals(this._color,f._color)},c._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 y(n)}_installWaveCircleMaterial(){var n=this,a=e.Color,i=e.defaultValue,o=Object.defineProperties,h=e.Event,s=e.Property,l=e.Material;function u(c){c=c||{},this._definitionChanged=new h,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=i(c.color,a.fromBytes(0,255,255,255)),this.duration=i(c.duration,45),this.count=Math.max(i(c.count,2),1),this.gradient=i(c.gradient,.1),this.gradient<0?this.gradient=0:this.gradient>1&&(this.gradient=1);}o(u.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),u.prototype.getType=function(){return l.CircleWaveType},u.prototype.getValue=function(c,m){return m||(m={}),m.color=s.getValueOrUndefined(this._color,c),m.duration=this._duration,m.count=this.count,m.gradient=this.gradient,m},u.prototype.equals=function(c){return this===c||c instanceof u&&s.equals(this._color,c._color)},o(u.prototype,{color:e.createPropertyDescriptor("color"),duration:e.createPropertyDescriptor("duration")}),e.Scene.CircleWaveMaterialProperty=u,l.CircleWaveType="CircleWave",l._materialCache.addMaterial(l.CircleWaveType,{fabric:{type:l.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,i=Object.defineProperties,o=e.Event,h=e.Property,s=e.Material,l=new n(0,0,0,0);function u(c){c=a(c,a.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=a(c.color,l),this._duration=c.duration||1e3,this._time=void 0;}i(u.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),u.prototype.getType=function(){return s.CircleFadeMaterialType},u.prototype.getValue=function(c,m){return m||(m={}),m.color=h.getValueOrClonedDefault(this._color,c,l,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(c){return this===c||c instanceof u&&h.equals(this._color,c._color)},i(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,i=e.defined,o=Object.defineProperties,h=e.Event,s=e.createPropertyDescriptor,l=e.Property,u=e.Material,c=n.WHITE;function m(y){y=a(y,a.EMPTY_OBJECT),this._definitionChanged=new h,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||u.PolylineCityLinkImage;}o(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(y,f){return i(f)||(f={}),f.color=l.getValueOrClonedDefault(this._color,y,c,f.color),f.image=this._img,this._time===void 0&&(this._time=y.secondsOfDay),f.time=(y.secondsOfDay-this._time)*1e3/this.duration,f},m.prototype.equals=function(y){return this===y||y instanceof m&&l.equals(this._color,y._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,i=e.defined,o=Object.defineProperties,h=e.Event,s=e.createPropertyDescriptor,l=e.Property,u=e.Material;function c(m){m=a(m,a.EMPTY_OBJECT),this._definitionChanged=new h,this._color=void 0,this._colorSubscription=void 0,this.color=m.color||n.BLUE,this.duration=m.duration||3e3,this._time=new Date().getTime();}o(c.prototype,{isvarant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.getType=function(){return u.WarnLinkType},c.prototype.getValue=function(m,y){return i(y)||(y={}),y.color=l.getValueOrClonedDefault(this._color,m,n.WHITE,y.color),y.image=u.WarnLinkImage,y.time=(new Date().getTime()-this._time)%this.duration/this.duration,y},c.prototype.equals=function(m){return this===m||m instanceof c&&l.equals(this._color,m._color)},o(c.prototype,{color:s("color")}),e.Scene.WarnLinkMaterialProperty=c,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,i=Object.defineProperties,o=e.Event,h=e.createPropertyDescriptor,s=e.Property,l=e.Material;function u(c){c=a(c,a.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=c.color||n.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=a(c.duration,45);}i(u.prototype,{isConstant:{get:function(){return false}},definitionChanged:{get:function(){return this._definitionChanged}}}),u.prototype.getType=function(){return l.PolylineFlowType},u.prototype.getValue=function(c,m){return m||(m={}),m.color=s.getValueOrClonedDefault(this._color,c,e.Color.WHITE,m.color),m.duration=this._duration,m},u.prototype.equals=function(c){return this===c||c instanceof u&&s.equals(this._color,c._color)},i(u.prototype,{color:h("color"),duration:h("duration")}),e.Scene.PolylineFlowMaterialProperty=u,l.PolylineFlowType="PolylineFlow",l._materialCache.addMaterial(l.PolylineFlowType,{fabric:{type:l.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,i=Object.defineProperties,o=e.createPropertyDescriptor,h=e.Event,s=e.Property,l=e.Material,u=this.getDfSt(["primitive","WaterPrimitive"]);function c(m){m=a(m,a.EMPTY_OBJECT),this._definitionChanged=new h,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};}i(c.prototype,{isConstant:{get:function(){return false},configurable:true},definitionChanged:{get:function(){return this._definitionChanged},configurable:true},color:o("color"),duration:o("duration")}),c.prototype.getType=function(){return l.PolylineTrailLinkType},c.prototype.getValue=function(m,y){return e.defined(y)||(y={}),y.color=s.getValueOrClonedDefault(this._color,m,this.color,y.color),y.image=l.PolylineTrailLinkImage,y.time=(new Date().getTime()-this._time)%this.duration/this.duration*this.speed,y},c.prototype.equals=function(m){return this===m||m instanceof c&&s.equals(this._color,m._color)},l.PolylineTrailLinkSource=`
|
|
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=`
|
|
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=c
|
|
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;
|
|
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
|
|
200
|
+
`},_getDirectionWallShader:function(e){if(e&&e.get){var h=`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"?
|
|
206
|
-
`:
|
|
207
|
-
`,
|
|
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;
|
|
208
208
|
fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;
|
|
209
209
|
fragColor = czm_gammaCorrect(fragColor);
|
|
210
|
-
`,
|
|
210
|
+
`,h+=` 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
|
-
`,
|
|
216
|
+
`,h}},_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
|
|
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;
|
|
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
|
-
}`,
|
|
444
|
+
}`,tn=nr;var rr=`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
|
-
`,Ot=En;var kn=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:{}},d=(function(){var h=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 h.prototype={_organiseData:function(l,u){var c=l[this._xField],m=l[this._yField],y=this._radi,f=this._data,g=this._max,v=this._min,A=l[this._valueField]||1,w=l.radius||this._cfgRadius||s;return f[c]||(f[c]=[],y[c]=[]),f[c][m]?f[c][m]+=A:(f[c][m]=A,y[c][m]=w),f[c][m]>g?(u?this.setDataMax(f[c][m]):this._max=f[c][m],false):{x:c,y:m,value:A,radius:w,min:v,max:g}},_unOrganizeData:function(){var l=[],u=this._data,c=this._radi;for(var m in u)for(var y in u[m])l.push({x:m,y,radius:c[m][y],value:u[m][y]});return {min:this._min,max:this._max,data:l}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max});},addData:function(){if(arguments[0].length>0)for(var l=arguments[0],u=l.length;u--;)this.addData.call(this,l[u]);else {var c=this._organiseData(arguments[0],true);c&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[c]});}return this},setData:function(l){var u=l.data,c=u.length;this._data=[],this._radi=[];for(var m=0;m<c;m++)this._organiseData(u[m],false);return this._max=l.max,this._min=l.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(l){return this._max=l,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(l){return this._min=l,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(l){this._coordinator=l;},_getInternalData:function(){return {max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},h})(),p=(function(){var h=function(c){var m=c.gradient||c.defaultGradient,y=document.createElement("canvas"),f=y.getContext("2d");y.width=256,y.height=1;var g=f.createLinearGradient(0,0,256,1);for(var v in m)g.addColorStop(v,m[v]);return f.fillStyle=g,f.fillRect(0,0,256,1),f.getImageData(0,0,256,1).data},s=function(c,m){var y=document.createElement("canvas"),f=y.getContext("2d"),g=c,v=c;if(y.width=y.height=c*2,m==1)f.beginPath(),f.arc(g,v,c,0,2*Math.PI,false),f.fillStyle="rgba(0,0,0,1)",f.fill();else {var A=f.createRadialGradient(g,v,c*m,g,v,c);A.addColorStop(0,"rgba(0,0,0,1)"),A.addColorStop(1,"rgba(0,0,0,0)"),f.fillStyle=A,f.fillRect(0,0,2*c,2*c);}return y},l=function(v){for(var m=[],y=v.min,f=v.max,g=v.radi,v=v.data,A=Object.keys(v),w=A.length;w--;)for(var C=A[w],P=Object.keys(v[C]),x=P.length;x--;){var b=P[x],M=v[C][b],k=g[C][b];m.push({x:C,y:b,value:M,radius:k});}return {min:y,max:f,data:m}};function u(c){var m=c.container,y=this.shadowCanvas=document.createElement("canvas"),f=this.canvas=c.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var v=getComputedStyle(c.container)||{};f.className="heatmap-canvas",this._width=f.width=y.width=c.width||+v.width.replace(/px/,""),this._height=f.height=y.height=c.height||+v.height.replace(/px/,""),this.shadowCtx=y.getContext("2d"),this.ctx=f.getContext("2d"),f.style.cssText=y.style.cssText="position:absolute;left:0;top:0;",m.style.position="relative",m.appendChild(f),this._palette=h(c),this._templates={},this._setStyles(c);}return u.prototype={renderPartial:function(c){c.data.length>0&&(this._drawAlpha(c),this._colorize());},renderAll:function(c){this._clear(),c.data.length>0&&(this._drawAlpha(l(c)),this._colorize());},_updateGradient:function(c){this._palette=h(c);},updateConfig:function(c){c.gradient&&this._updateGradient(c),this._setStyles(c);},setDimensions:function(c,m){this._width=c,this._height=m,this.canvas.width=this.shadowCanvas.width=c,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(c){this._blur=c.blur==0?0:c.blur||c.defaultBlur,c.backgroundColor&&(this.canvas.style.backgroundColor=c.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=c.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=c.height||this._height,this._opacity=(c.opacity||0)*255,this._maxOpacity=(c.maxOpacity||c.defaultMaxOpacity)*255,this._minOpacity=(c.minOpacity||c.defaultMinOpacity)*255,this._useGradientOpacity=!!c.useGradientOpacity;},_drawAlpha:function(f){for(var m=this._min=f.min,y=this._max=f.max,f=f.data||[],g=f.length,v=1-this._blur;g--;){var A=f[g],w=A.x,C=A.y,P=A.radius,x=Math.min(A.value,y),b=w-P,M=C-P,k=this.shadowCtx,_;this._templates[P]?_=this._templates[P]:this._templates[P]=_=s(P,v);var S=(x-m)/(y-m);k.globalAlpha=S<.01?.01:S,k.drawImage(_,b,M),b<this._renderBoundaries[0]&&(this._renderBoundaries[0]=b),M<this._renderBoundaries[1]&&(this._renderBoundaries[1]=M),b+2*P>this._renderBoundaries[2]&&(this._renderBoundaries[2]=b+2*P),M+2*P>this._renderBoundaries[3]&&(this._renderBoundaries[3]=M+2*P);}},_colorize:function(){var c=this._renderBoundaries[0],m=this._renderBoundaries[1],y=this._renderBoundaries[2]-c,f=this._renderBoundaries[3]-m,g=this._width,v=this._height,A=this._opacity,w=this._maxOpacity,C=this._minOpacity,P=this._useGradientOpacity;c<0&&(c=0),m<0&&(m=0),c+y>g&&(y=g-c),m+f>v&&(f=v-m);for(var x=this.shadowCtx.getImageData(c,m,y,f),b=x.data,M=b.length,k=this._palette,_=3;_<M;_+=4){var S=b[_],L=S*4;if(L){var G;A>0?G=A:S<w?S<C?G=C:G=S:G=w,b[_-3]=k[L],b[_-2]=k[L+1],b[_-1]=k[L+2],b[_]=P?k[L+3]:G;}}this.ctx.putImageData(x,c,m),this._renderBoundaries=[1e3,1e3,0,0];},getValueAt:function(c){var m,y=this.shadowCtx,f=y.getImageData(c.x,c.y,1,1),g=f.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})(),r=(function(){var h=false;return e.defaultRenderer==="canvas2d"&&(h=p),h})(),n={merge:function(){for(var o={},h=arguments.length,s=0;s<h;s++){var l=arguments[s];for(var u in l)o[u]=l[u];}return o}},a=(function(){var h=(function(){function c(){this.cStore={};}return c.prototype={on:function(m,y,f){var g=this.cStore;g[m]||(g[m]=[]),g[m].push(function(v){return y.call(f,v)});},emit:function(m,y){var f=this.cStore;if(f[m])for(var g=f[m].length,v=0;v<g;v++){var A=f[m][v];A(y);}}},c})(),s=function(u){var c=u._renderer,m=u._coordinator,y=u._store;m.on("renderpartial",c.renderPartial,c),m.on("renderall",c.renderAll,c),m.on("extremachange",function(f){u._config.onExtremaChange&&u._config.onExtremaChange({min:f.min,max:f.max,gradient:u._config.gradient||u._config.defaultGradient});}),y.setCoordinator(m);};function l(){var u=this._config=n.merge(e,arguments[0]||{});if(this._coordinator=new h,u.plugin){var c=u.plugin;if(e.plugins[c]){var m=e.plugins[c];this._renderer=new m.renderer(u),this._store=new m.store(u);}else throw new Error("Plugin '"+c+"' not found. Maybe it was not registered.")}else this._renderer=new r(u),this._store=new d(u);s(this);}return l.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}},l})(),i={create:function(o){return new a(o)},register:function(o,h){e.plugins[o]=h;}};return i},Vt=kn();function Dn(){let e=null,p=function(r,n,a){r&&(this._viewer=r,e=n,ae(this),this._installPrimitives());};return p.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive();},_installTetrahedronPrimitive:function(){try{var r=e.Cartesian3,n=e.ComponentDatatype,a=e.PrimitiveType,i=e.BoundingSphere,o=e.GeometryAttribute,h=e.GeometryPipeline,s=e.Geometry,l=e.defined,u=e.RenderState,c=e.ShaderSource,m=e.ShaderProgram,y=e.DrawCommand,f=e.Pass,g=e.Appearance,v=e.BufferUsage,A=e.Color,w=e.VertexArray,C=e.buildModuleUrl,P=e.Matrix4,x=e.Matrix3,b=e.Texture,M=e.Resource,k=e.Transforms,_=e.defaultValue||xe,S=this._viewer,L=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";let G=function(D){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=D.position,this._createCommand=R,this._angle=0,this._distance=_(D.distance,1),this._setInterval=void 0,this._viewer=S,this._speed=_(D.speed,1),this._color=_(D.color,new A(1,1,0,.8)),this._scale=_(D.scale,new r(10,10,15)),this._texture=void 0,this._imageUrl=L,this._modelMatrix=q(this),this._height=oe(this),ne(this);};G.prototype.update=function(D){this.show&&(l(this._command)||(this._command=this._createCommand(D.context,this)),l(this._command)&&D.commandList.push(this._command));},G.prototype.isDestroyed=function(){return !1},G.prototype.destroy=function(){return l(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},G.prototype.startAnimate=function(){let D=this;this._setInterval=setInterval(O,5);function O(){D._angle=D._angle+.01,Math.sin(D._angle)>0?D._height=.01:D._height=-.01;let J=new e.Cartesian3(0,0,D._height);P.multiplyByTranslation(D._modelMatrix,J,D._modelMatrix);let $=P.fromRotationTranslation(x.fromRotationZ(e.Math.toRadians(D._speed)));P.multiply(D._modelMatrix,$,D._modelMatrix);}},G.prototype.closeAnimate=function(){clearInterval(this._setInterval);};let R=function(D,O){var J=!1,$=!0,fe=K(),Pe=W(),Ve=g.getDefaultRenderState(J,$,void 0),be=u.fromCache(Ve),mt=new c({sources:[fe]}),rt=new c({sources:[Pe]}),yt={color:function(){return O._color},myImage:function(){return l(O._texture)?O._texture:O._viewer.scene.context.defaultTexture}};let pt={position:0,textureCoordinates:1};var ft=m.fromCache({context:D,vertexShaderSource:mt,fragmentShaderSource:rt,attributeLocations:pt});return new y({vertexArray:z(D),primitiveType:a.TRIANGLES,renderState:be,shaderProgram:ft,uniformMap:yt,owner:this,pass:f.TRANSLUCENT,modelMatrix:O._modelMatrix})},z=function(D){let O={position:0,textureCoordinates:1};var J=U(),$=new s({attributes:{position:new o({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:J.positions}),textureCoordinates:new o({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:J.sts})},indices:J.indices,primitiveType:a.TRIANGLES,boundingSphere:i.fromVertices(J.positions)}),fe=h.computeNormal($),Pe=w.fromGeometry({context:D,geometry:fe,attributeLocations:O,bufferUsage:v.STATIC_DRAW});return Pe},U=function(){var D=new Float64Array(15);D[0]=0,D[1]=1,D[2]=0,D[3]=-1,D[4]=0,D[5]=0,D[6]=0,D[7]=-1,D[8]=0,D[9]=1,D[10]=0,D[11]=0,D[12]=0,D[13]=0,D[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 J=new Float32Array([0,0,1,0,1,1,0,1,.5,.5]);return {indices:O,positions:D,sts:J}},K=function(){var D=`#version 300 es
|
|
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
|
|
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
|
|
478
|
+
`;return R},G=function(){var R=`#version 300 es
|
|
479
479
|
precision mediump float;
|
|
480
480
|
in vec3 v_positionEC;
|
|
481
481
|
in vec3 v_normalEC;
|
|
@@ -508,7 +508,7 @@ void main() {
|
|
|
508
508
|
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
509
509
|
#endif
|
|
510
510
|
}
|
|
511
|
-
`;return
|
|
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;
|
|
512
512
|
uniform mat4 u_modelViewMatrix;
|
|
513
513
|
void main()
|
|
514
514
|
{
|
|
@@ -519,7 +519,7 @@ void main() {
|
|
|
519
519
|
{
|
|
520
520
|
out_FragColor = u_bgColor;
|
|
521
521
|
}
|
|
522
|
-
`;function i(o){o=r(o,r.EMPTY_OBJECT);var h=o.scene;if(!e.defined(h))throw new e.DeveloperError("scene is required.");this._scene=h;var s=h._context;if(!e.defined(s))throw new e.DeveloperError("context is required.");if(!e.defined(o.viewerPosition))throw new e.DeveloperError("this view position is required.");this._viewerPosition=o.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new e.Camera(h),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=r(o.horizontalFov,60),this._verticalFov=r(o.verticalFov,45),this._cameraUpdated=false,this._targetPoint=this._viewerPosition.clone();var l=new e.Cartesian3(0,0,100),u=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.multiplyByPoint(u,l,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 c=this._indices,m=0;c[m++]=0,c[m++]=1,c[m++]=0,c[m++]=21,c[m++]=0,c[m++]=85,c[m++]=0,c[m++]=105;for(var y=0,f=0;f<5;++f){y++;for(var g=0;g<20;++g)c[m++]=y++,c[m++]=y;}y++;for(var v=0;v<20;++v)for(var A=0;A<5;++A)c[m++]=y,c[m++]=5+y++;this._initialized=true;},this._debugLightFrustum=void 0,this._debugShow=true;}Object.defineProperties(i.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(o){this.shadowMap.debugShow=o,this._debugShow=o;}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(o){this._invisiblyColor=o;var h=this.shadowMap;h._customColor.invisibly=o;}},visiblyColor:{get:function(){return this._visiblyColor},set:function(o){this._visiblyColor=o;var h=this.shadowMap;h._customColor.visibly=o;}},viewerPosition:{get:function(){return this._viewerPosition},set:function(o){this._viewerPosition=o,this._cameraUpdated=false;}},direction:{get:function(){return this._direction},set:function(o){this._direction=o,this._cameraUpdated=false;}},pitch:{get:function(){return this._pitch},set:function(o){this._pitch=o,this._cameraUpdated=false;}},horizontalFov:{get:function(){return this._horizontalFov},set:function(o){this._horizontalFov=o,this._cameraUpdated=false,this._hintLineUpdated=false;}},verticalFov:{get:function(){return this._verticalFov},set:function(o){this._verticalFov=o,this._cameraUpdated=false,this._hintLineUpdated=false;}},distance:{get:function(){return this._distance},set:function(o){this._distance=o,this._cameraUpdated=false;}}}),i.prototype.setDebugFrustumEffect=function(o,h){if(this.debugShow){var s=this.debugLightFrustum._planesPrimitives,l=this.debugLightFrustum._outlinePrimitives;s.forEach(function(u){u.show=o;}),l.forEach(function(u){u.show=h;});}},i.prototype.update=function(o){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 h=o.frustumSplits[1];o.frustumSplits[1]=this._distance,this._debugLightFrustum.update(o),o.frustumSplits[1]=h,o.shadowMaps.push(this.shadowMap);}},i.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;},i.prototype.setPoseByTargetPoint=function(o){this.distance=e.Cartesian3.distance(this._viewerPosition,o);var h=new e.Cartesian3,s=e.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);e.Matrix4.inverse(s,s),e.Matrix4.multiplyByPoint(s,o,h),e.Cartesian3.normalize(h,h),this.direction=e.Math.toDegrees(Math.atan2(h.x,h.y)),this.pitch=e.Math.toDegrees(Math.asin(h.z));},i.prototype._updateHintLine=function(o){var h,s,l,u,c=this._positions,m=e.Math.toRadians(this._horizontalFov),y=e.Math.toRadians(this._verticalFov),f=Math.tan(.5*m),g=Math.tan(.5*y);s=this._distance*f,u=this._distance*g,h=-s,l=-u;var v=new e.Cartesian3(h,l,-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(o.cullingVolume.computeVisibility(w)===Intersect.OUTSIDE)return void(this._valid=false);this._valid=true;var C=0;c[C++]=0,c[C++]=0,c[C++]=0;for(var P,x,b=Math.PI-.5*m,M=m/4,k=0;k<5;++k){P=b+k*M;for(var _=u/(this._distance/Math.cos(P)),S=Math.atan(_),L=-S,G=S/10,R=0;R<21;++R)x=L+R*G,c[C++]=this._distance*Math.cos(x)*Math.sin(P),c[C++]=this._distance*Math.sin(x),c[C++]=this._distance*Math.cos(x)*Math.cos(P);}M=m/20;for(var z=0;z<21;++z){P=b+z*M;for(var _=u/(this._distance/Math.cos(P)),S=Math.atan(_),L=-S,G=S/2,U=0;U<5;++U)x=L+U*G,c[C++]=this._distance*Math.cos(x)*Math.sin(P),c[C++]=this._distance*Math.sin(x),c[C++]=this._distance*Math.cos(x)*Math.cos(P);}var K=o.context,W=e.Buffer.createIndexBuffer({context:K,typedArray:new Uint32Array(this._indices),usage:e.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),ne=e.Buffer.createVertexBuffer({context:K,typedArray:e.ComponentDatatype.createTypedArray(e.ComponentDatatype.FLOAT,this._positions),usage:e.BufferUsage.STATIC_DRAW}),q=[];q.push({index:0,vertexBuffer:ne,componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:false});var oe=new e.VertexArray({context:K,attributes:q,indexBuffer:W});if(e.defined(this._drawLineCommand))this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=oe,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=w;else {var D=e.ShaderProgram.fromCache({context:K,vertexShaderSource:n,fragmentShaderSource:a}),O=e.RenderState.fromCache({depthTest:{enabled:true}}),J=this,$={u_bgColor:function(){return J._lineColor},u_modelViewMatrix:function(){return K.uniformState.modelView}};this._drawLineCommand=new e.DrawCommand({boundingVolume:w,modelMatrix:J._modelMatrix,primitiveType:e.PrimitiveType.LINES,vertexArray:oe,shaderProgram:D,castShadows:false,receiveShadows:false,uniformMap:$,renderState:O,pass:e.Pass.OPAQUE});}this._hintLineUpdated=true;},e.Scene.ShadowPrimitive=i;},_installPointsPrimitive:function(){function r(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));}r.prototype={build:function(n){if(n.Cartesians&&n.Cartesians.length>=2){var a=[],i=[],o=[];if(n.Colors&&n.Colors.length===n.Cartesians.length*4){for(var h=0;h<n.Cartesians.length;h++)a.push(n.Cartesians[h].x),a.push(n.Cartesians[h].y),a.push(n.Cartesians[h].z);i=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),i.push(0),i.push(0),i.push(1),i.push(1);for(var l=0;l<n.Cartesians.length;l++)o.push(l);this.positionArr=new Float64Array(a),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(o);}else {var u=e.Cartesian3.fromDegrees(0,0,-10),c=e.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([u.x,u.y,u.z,c.x,c.y,c.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,i){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:i,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],i=n[1];this.positionArr=new Float64Array([a.x,a.y,a.z,i.x,i.y,i.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var o=[],h=[],s=[],l=0;l<n.length;l++)o.push(n[l].x),o.push(n[l].y),o.push(n[l].z),h.push(0),h.push(0),h.push(1),h.push(1);for(var u=0;u<n.length;u++)s.push(u);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(h),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 i=n[0],o=n[1];this.positionArr=new Float64Array([i.x,i.y,i.z,o.x,o.y,o.z]),this.colorArr=new Float32Array(a),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr);}else {for(var h=[],s=[],l=0;l<n.length;l++)h.push(n[l].x),h.push(n[l].y),h.push(n[l].z);for(var l=0;l<n.length;l++)s.push(l);this.positionArr=new Float64Array(h),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=r;},_installWaterPrimitive:function(){let r=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=r._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=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=`
|
|
523
523
|
precision highp float;
|
|
524
524
|
struct Light {
|
|
525
525
|
vec3 position;
|
|
@@ -601,7 +601,7 @@ void main() {
|
|
|
601
601
|
out_FragColor.a = 0.5;
|
|
602
602
|
#endif
|
|
603
603
|
}
|
|
604
|
-
`},
|
|
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;
|
|
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:i},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(r){let n=e;function a({img:i,center:o,height1:h=0,height2:s=3e5,scale:l=.003}){this.drawCommand=null,this._texture=null,this._image=null,this.img=i,this.center=o,this.height1=h,this.height2=s,this.scale=l;}return a.prototype.update=function(i){this._destroyed!==true&&(this.drawCommand===null&&this.createDrawCommand(i.context),this._texture===null&&this.createTexture(i.context),i.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(i){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:i,source:this._image});});},a.prototype.createDrawCommand=function(i){let o=this.createPyramidGeometry(),h=n.VertexArray.fromGeometry({context:i,geometry:o,attributeLocations:n.GeometryPipeline.createAttributeLocations(o)}),s=n.ShaderProgram.fromCache({context:i,vertexShaderSource:Bt,fragmentShaderSource:Ot,attributeLocations:n.GeometryPipeline.createAttributeLocations(o)}),l=new n.Cartesian2(i.canvas.width,i.canvas.height),u={v1:()=>this.v1,v2:()=>this.v2,wenli:()=>this._texture!==null?this._texture:i.defaultTexture,iResolution:()=>l},c=n.RenderState.fromCache();this.drawCommand=new n.DrawCommand({vertexArray:h,shaderProgram:s,uniformMap:u,renderState:c,pass:n.Pass.OPAQUE});},a.prototype.createPyramidGeometry=function(){let i=this.height1,o=this.height2,h=this.scale,s=this.center||[104.057605,30.607196],l=A(s,[-h,h]),u=A(s,[h,h]),c=A(s,[-h,-h]),m=A(s,[h,h]),y=[],f=[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(s,i),...v(l),...v(u),...v(c),...v(m)),this.v1=new n.Cartesian3(...v(s,i)),this.v2=new n.Cartesian3(...v(s,o));function v(C,P=o){let x=n.Cartesian3.fromDegrees(...C,P);return [x.x,x.y,x.z]}function A(C,P){return [P[0]+C[0],P[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:f,boundingSphere:n.BoundingSphere.fromVertices(y)})},new a(r)},customPrimivive(r){return this._initCustomPrimitive(r)},_heatmap:function(){let r=null,n=1080,a=1920,i=[103.8258,30.58595,104.252263,30.87];return {getHeatmap({heatData:o,boundsArr:h,screenHeight:s,screenWidth:l}){i=h||i,s=s||n,l=l||a;let u=[];for(let m of o){let y=m.lng,f=m.lat,g=Math.round((y-i[0])/(i[2]-i[0])*a),v=n-Math.round((f-i[1])/(i[3]-i[1])*n);u.push({x:g,y:v,value:m.num});}return this.createHeatmap(u),this.createPrimitive()},createHeatmap(o){var h=document.createElement("div");h.setAttribute("style","width: "+a+"px; height: "+n+"px; margin: 0px; display: none;"),document.body.appendChild(h),r=Vt.create({container:h,radius:24,maxOpacity:1,minOpacity:.1,blur:.85,gradient:{".2":"blue",".4":"green",".6":"yellow",".8":"orange",".9":"red"}}),r.setData({min:0,max:100,data:o});},createPrimitive(){let o=new e.ImageMaterialProperty({image:r._renderer.canvas}),h=this.generateGeometryInstance(),s=new e.MaterialAppearance({material:e.Material.fromType(e.Material.ImageType,o.getValue(new e.JulianDate))}),l={geometryInstances:h,appearance:s,allowPicking:false,asynchronous:false,show:false};return new e.Primitive(l)},generateGeometryInstance(){let o=i[2]-i[0],h=i[3]-i[1],s=i[0],l=i[1],u=.001,c=.001,m=0,y=5,f=Math.floor(o/u),g=Math.floor(h/c),v=[];for(let M=0;M<g+1;M++){let k=[];for(let _=0;_<f+1;_++){let S=s+(_==f?o:_*u),L=l+(M==g?h:M*c),G={x:Math.round((S-s)/o*a),y:n-Math.round((L-l)/h*n)},R=r.getValueAt(G),z=r._renderer.ctx.getImageData(G.x,G.y,1,1).data;k.push([S,L,m+R*y,z.map(U=>U/255),[(S-s)/o,(L-l)/h]]);}v.push(k);}let A=[],w=[],C=[],P=[],b=0;for(let M=0;M<g;M++)for(let k=0;k<f;k++){let _=v[M][k],S=v[M][k+1],L=v[M+1][k+1],G=v[M+1][k];this.addVertices(_,A,C,P),this.addVertices(S,A,C,P),this.addVertices(L,A,C,P),this.addVertices(_,A,C,P),this.addVertices(L,A,C,P),this.addVertices(G,A,C,P),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,P))})},addVertices(o,h,s,l){let u=e.Cartesian3.fromDegrees(o[0],o[1],o[2]);h.push(u.x,u.y,u.z),s.push(o[3][0],o[3][1],o[3][2],o[3][3]),l.push(o[4][0],o[4][1]);},generateGeometry(o,h,s,l){var u=new e.GeometryAttributes({position:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(o)}),color:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:new Float32Array(h)}),st:new e.GeometryAttribute({componentDatatype:e.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(l)})});let c=e.BoundingSphere.fromVertices(o,new e.Cartesian3(0,0,0),3);return new e.Geometry({attributes:u,indices:s,primitiveType:e.PrimitiveType.TRIANGLES,boundingSphere:c})}}},createHeatmap3d(r){return this._heatmap().getHeatmap(r)}},p}var Ke=te(Dn);function Ln(){let e=null;class d{constructor(r,n){e=n,this._viewer=r,this._labelEntity=null,this.$graphics=new ue(r,n),this.isInit=false,ae(this),ie(this,()=>{this._labelEntity&&this._viewer&&(this._viewer.entities.remove(this._labelEntity),this._labelEntity=null),de(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(r){this.isInit&&(this._labelEntity.show=!!r);}showAt(r,n){if(this.isInit&&r&&n){this._labelEntity.show=true;var a=this._viewer.camera.pickEllipsoid(r,this._viewer.scene.globe.ellipsoid);a?(this._labelEntity.position=a,this._labelEntity.show=true,this._labelEntity.label.text=n):this._labelEntity.show=false;}}showAtCartesian(r,n){this.isInit&&r&&n&&(this._labelEntity.show=true,this._labelEntity.position=r,this._labelEntity.show=true,this._labelEntity.label.text=n);}}return d}var st=te(Ln);function Rn(){let d=null,p=null,r=function(n,a,i){if(n){d=a,this._drawLayer=new d.CustomDataSource("drawLayer"),Le(ue,Q),this.$graphics=new ue(n,a),n&&n.dataSources.add(this._drawLayer),this.tooltip=new st(n,a),this.tooltip.initTool();let o=this._drawLayer,h=this.$graphics,s=this.tooltip;ae(this),ie(this,()=>{this.removeEventHandler(),this.removeAll(),de(s),de(h),this._viewer&&o&&(this._viewer.dataSources.remove(o,true),this._drawLayer===o&&(this._drawLayer=void 0));});}};return r.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 d.Cartesian2(0,-20)},this._viewer&&n){var a=new d.Entity,i,o=[],h,s=this,l=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);p=l,l.setInputAction(function(u){var c=s.getCatesian3FromPX(u.position);s.tooltip.showAtCartesian(c,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),c&&c.x&&(i=c,o.push(c));},d.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(u){var c=s.getCatesian3FromPX(u.endPosition);c&&c.x&&(o=[],i=c,o.push(c)),l.destroy(),l=null,s.tooltip.setVisible(false),typeof n.callback=="function"&&n.callback(s.transformCartesianArrayToWGS84Array(o),h);},d.ScreenSpaceEventType.RIGHT_CLICK),a.billboard=n.style,a.position=new d.CallbackProperty(function(){return i},false),h=this._drawLayer.entities.add(a);}},_drawComand:function(n,a){var i=[],o=this,h,s,l,u=false,c=new d.PolygonHierarchy,m=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);p=m;function y(v,A){let w=new d.Entity;return a=="line"?w.polyline={positions:v,width:n.width||5,granularity:o._objHasOwnProperty(n,"granularity",d.Math.RADIANS_PER_DEGREE),arcType:o._objHasOwnProperty(n,"arcType",d.ArcType.GEODESIC),material:n.material||d.Color.BLUE.withAlpha(.8),clampToGround:o._objHasOwnProperty(n,"clampToGround",false),clampToS3M:o._objHasOwnProperty(n,"clampToS3M",false)}:a==="polygon"&&(w.polyline=n.style,w.polyline.positions=v,w.polygon={hierarchy:A,material:n.material||d.Color.WHITE.withAlpha(.7),clampToGround:o._objHasOwnProperty(n,"clampToGround",false)},w.clampToS3M=true),o._drawLayer.entities.add(w)}function f(){a=="polygon"&&(i.push(i[0]),c.positions.push(i[0])),h=y(i,i),n.height&&(h.polygon.extrudedHeight=n.height,h.polygon.material=d.Color.BLUE.withAlpha(.5)),n.measure&&a=="polygon"&&g(i[0],true),typeof n.callback=="function"&&!u&&n.callback(o.transformCartesianArrayToWGS84Array(i),h),o._drawLayer.entities.remove(l),o._drawLayer.entities.remove(s),l=void 0,s=void 0,i=[];}let g=function(v,A=false,w=false){var C=new d.Entity;C.position=v,C.point={pixelSize:10,outlineColor:d.Color.BLUE,outlineWidth:5};var P="",x=o.transformCartesianArrayToWGS84Array(i)||[];return a==="line"?P=(o.getPositionDistance(x)/1e3).toFixed(4)+"\u516C\u91CC":a==="polygon"&&A&&(P=(o.getPositionsArea(x)/1e6).toFixed(4)+"\u5E73\u65B9\u516C\u91CC"),(a==="line"||a==="polygon"&&A)&&!w&&(C.label={text:P,show:true,showBackground:true,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(-20,-80)}),o._drawLayer.entities.add(C)};m.setInputAction(function(v){let A=o.getCatesian3FromPX(v.position);if(d.defined(A)){let w=A.clone();if(i.length===0){l=g(w,false,true),c.positions.push(A.clone()),i.push(w);let C=new d.CallbackProperty(function(){return i},false),P=new d.CallbackProperty(function(){return a==="polygon"?c:i},false);s=y(C,P);}c.positions.push(A.clone()),i.push(w),n.measure&&g(w),n.type==="straightLine"&&i.length==3&&(i.pop(),m.destroy(),m=null,o.tooltip.setVisible(false),typeof n.callback=="function"&&(i=o._excludeDuplicatesCartesian(i),u=true,n.callback(i,s),f()));}},d.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(v){var A=o.getCatesian3FromPX(v.endPosition);o.tooltip.showAtCartesian(A,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),d.defined(l)&&d.defined(A)&&(i.pop(),i.push(A.clone()),c.positions.pop(),c.positions.push(A.clone()),l.position.setValue(A));},d.ScreenSpaceEventType.MOUSE_MOVE),m.setInputAction(function(v){i=o._excludeDuplicatesCartesian(i),f(),h=void 0,o.tooltip.setVisible(false),m.destroy(),m=null;},d.ScreenSpaceEventType.RIGHT_CLICK);},_excludeDuplicatesCartesian(n){var a=n.reduce((i,o)=>{let h=i.length;return h<1||!i[h-1].equals(o)?i.concat(o):i},[]);return a},drawLineGraphics:function(n){n=n||{},this._viewer&&n&&this._drawComand(n,"line");},drawPolygonGraphics:function(n){n=n||{};let a={width:3,material:d.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:d.Color.BLUE.withAlpha(.5),clampToGround:true},this._viewer&&n){var a=[],i=new d.Entity,o=new d.Rectangle,h=this,s,l=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);p=l,l.setInputAction(function(u){var c=h.getCatesian3FromPX(u.position);c&&c.x&&(a.length==0?a.push(c.clone()):(l.destroy(),a.push(c.clone()),o=d.Rectangle.fromCartesianArray([...a,c],d.Ellipsoid.WGS84),typeof n.callback=="function"&&n.callback(h.transformCartesianArrayToWGS84Array(a),s)));},d.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(u){var c=h.getCatesian3FromPX(u.endPosition);c&&(o=d.Rectangle.fromCartesianArray([...a,c],d.Ellipsoid.WGS84));},d.ScreenSpaceEventType.MOUSE_MOVE),i.rectangle=n.style,n.height&&(i.rectangle.extrudedHeight=n.height),i.rectangle.coordinates=new d.CallbackProperty(function(){return o},false),s=this._drawLayer.entities.add(i);}},drawCircleGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:d.Color.BLUE.withAlpha(.5),clampToGround:true},this._viewer&&n){var a=void 0,i=new d.Entity,o=this,h,s=1,l=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);p=l;let u=function(m,y){let f=d.Cartographic.fromCartesian(m),g=d.Cartographic.fromCartesian(y),v=new d.EllipsoidGeodesic;v.setEndPoints(f,g);let A=v.surfaceDistance;s=Math.sqrt(Math.pow(A,2)+Math.pow(g.height-f.height,2));},c=function(){i.ellipse=n.style,i.ellipse.semiMajorAxis=new d.CallbackProperty(function(){return s},false),i.ellipse.semiMinorAxis=new d.CallbackProperty(function(){return s},false),i.position=new d.CallbackProperty(function(){return a},false),i.point={pixelSize:5,outlineColor:d.Color.RED,outlineWidth:3},n.height&&(i.ellipse.extrudedHeight=n.height),h=o._drawLayer.entities.add(i);};l.setInputAction(function(m){var y=o.getCatesian3FromPX(m.position);o.tooltip.showAtCartesian(y,"\u5DE6\u952E\u5355\u51FB\u7ED3\u675F!"),y&&y.x&&(a?(u(a,y),o.tooltip.setVisible(false),l.destroy(),typeof n.callback=="function"&&n.callback({center:a,radius:s},h)):(a=y,c()));},d.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(m){var y=o._viewer.scene.camera.pickEllipsoid(m.endPosition,o._viewer.scene.globe.ellipsoid);a&&y&&y.x&&u(a,y);},d.ScreenSpaceEventType.MOUSE_MOVE);}},drawTrianglesGraphics:function(n){if(n=n||{},n.style=n.style||{width:3,material:d.Color.BLUE.withAlpha(.5)},this._viewer&&n){var a=new d.Entity,i=new d.Entity,o=new d.Entity,h=[],s=[],l=[],u=this,c=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);p=c;let m=function(f,g){if(!f&&!g||d.Cartesian3.equals(f,g))return 0;let v=d.Cartographic.fromCartesian(f);return (d.Cartographic.fromCartesian(g).height-v.height).toFixed(2)},y=function(f){let g=d.Cartographic.fromCartesian(f[0]),v=d.Cartographic.fromCartesian(f[1]);return d.Cartesian3.fromDegrees(d.Math.toDegrees(g.longitude),d.Math.toDegrees(g.latitude),v.height)};c.setInputAction(function(f){var g=u.getCatesian3FromPX(f.position);if(!g)return false;h.length==0?(h.push(g.clone()),h.push(g.clone()),s.push(g.clone()),s.push(g.clone())):(c.destroy(),typeof n.callback=="function"&&n.callback({e:a,e2:i,e3:o}));},d.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(f){var g=u.getCatesian3FromPX(f.endPosition);if(g&&h.length>0){h.pop(),h.push(g.clone());let v=y(h);s.pop(),s.push(v.clone()),l.pop(),l.pop(),l.push(g.clone()),l.push(v.clone());}},d.ScreenSpaceEventType.MOUSE_MOVE),a.polyline={positions:new d.CallbackProperty(function(){return h},false),...n.style},a.position=new d.CallbackProperty(function(){return h[0]},false),a.point={pixelSize:5,outlineColor:d.Color.BLUE,outlineWidth:5},a.label={text:new d.CallbackProperty(function(){return "\u76F4\u7EBF:"+u.getPositionDistance(u.transformCartesianArrayToWGS84Array(h))+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(50,-100)},i.polyline={positions:new d.CallbackProperty(function(){return s},false),...n.style},i.position=new d.CallbackProperty(function(){return l[1]},false),i.point={pixelSize:5,outlineColor:d.Color.BLUE,outlineWidth:5},i.label={text:new d.CallbackProperty(function(){return "\u9AD8\u5EA6:"+m(s[0],s[1])+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(-20,100)},o.polyline={positions:new d.CallbackProperty(function(){return l},false),...n.style},o.position=new d.CallbackProperty(function(){return h[1]},false),o.point={pixelSize:5,outlineColor:d.Color.BLUE,outlineWidth:5},o.label={text:new d.CallbackProperty(function(){return "\u6C34\u5E73\u8DDD\u79BB:"+u.getPositionDistance(u.transformCartesianArrayToWGS84Array(l))+"\u7C73"},false),show:true,showBackground:true,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(-150,-20)},this._drawLayer.entities.add(o),this._drawLayer.entities.add(i),this._drawLayer.entities.add(a);}},drawWallGraphics:function(n){n=n||{};let a={material:d.Color.BLUE.withAlpha(.5),outline:true,outlineColor:d.Color.WHITE};if(n.style?n.style=Object.assign({},a,n.style):n.style=a,this._viewer&&n){var i=this;this.drawPolygonGraphics({clampToGround:i._objHasOwnProperty(n.style,"clampToGround",true),style:{material:n.style.material},callback:function(o,h){let s=i.transformWGS84ArrayToCartesianArray(o),l=[],u=[];if(n.style.maximumHeights){let m=0;for(;m<s.length;)l.push(n.style.maximumHeights[m%2]),m++;n.style.maximumHeights=l;}if(n.style.minimumHeights){let m=0;for(;m<s.length;)u.push(n.style.minimumHeights[m%2]),m++;n.style.minimumHeights=u;}var c=i._drawLayer.entities.add({wall:{positions:s,...n.style}});typeof n.callback=="function"&&n.callback(o,c);}});}},drawEllipsoidGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var a=this;this.drawCircleGraphics({callback:function(i,o){var h=a.createGraphics();h.ellipsoid=a.$graphics.getEllipsoidGraphics({radii:i.radius}),h.position=i.center,a._drawLayer.entities.remove(o);var s=a._drawLayer.entities.add(h);typeof n.callback=="function"&&n.callback({center:i.center,radius:i.radius},s);}});}},_objHasOwnProperty(n,a,i){return n&&n.hasOwnProperty(a)?n[a]:i},drawCylinderGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var a=this;this.drawCircleGraphics({callback:function(i,o){var h=a._drawLayer.entities.add({position:i.center,cylinder:{length:i.radius*2||n.length,topRadius:n.topRadius||i.radius,bottomRadius:n.bottomRadius||i.radius,material:d.Color.BLUE.withAlpha(.5),outline:true,outlineColor:d.Color.WHITE}});a._drawLayer.entities.remove(o),typeof n.callback=="function"&&n.callback({center:i.center,radius:i.radius},h);}});}},drawCorridorGraphics:function(n){if(n=n||{},n.style=n.style||{},this._viewer&&n){var a=this;a.drawLineGraphics({callback:function(i,o){var h=a.createGraphics();h.corridor={positions:a.transformWGS84ArrayToCartesianArray(i),height:n.height||1,width:n.width||100,cornerType:d.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:d.Color.BLUE.withAlpha(.5),outline:true,outlineColor:d.Color.WHITE},a._drawLayer.entities.remove(o);var s=a._drawLayer.entities.add(h);typeof n.callback=="function"&&n.callback(i,s);}});}},drawPolylineVolumeGraphics:function(n){n=n||{},n.style=n.style||{};let a=n.circleRadius||20,i=n.arms||7,o=n.rOuter||150,h=n.rInner||75;if(this._viewer&&n){var s=this;s.drawLineGraphics({callback:function(l,u){var c=s.createGraphics();let m=n.shape==="fivePoint"?s.computeStar2d(i,o,h):s.computeCircleShap(a);c.polylineVolume={positions:s.transformWGS84ArrayToCartesianArray(l),shape:m,cornerType:d.CornerType.MITERED,material:n.color||d.Color.RED},s._drawLayer.entities.remove(u);var y=s._drawLayer.entities.add(c);typeof n.callback=="function"&&n.callback(l,y);}});}},removeAll(){this._drawLayer.entities.removeAll();},removeEventHandler(){p&&!p.isDestroyed()&&(p.removeInputAction(d.ScreenSpaceEventType.MOUSE_MOVE),p.removeInputAction(d.ScreenSpaceEventType.RIGHT_CLICK),p.removeInputAction(d.ScreenSpaceEventType.LEFT_CLICK),p.destroy()),p=null;}},r}var Te=te(Rn);function Bn(){let e={};class d{constructor(r,n){r&&(this._viewer=r,e=n);}mathDistance2d(r,n){return Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2))}getCirclePoints2d(r,n,a,i){let o=[],h=Math.PI/180*Math.round(360/i);for(let s=0;s<i;s++){let l=n+r*Math.sin(h*s),u=a+r*Math.cos(h*s);o.unshift({x:l,y:u});}return o}wholeDistance2d(r){let n=0;return r&&Array.isArray(r)&&r.length>0&&r.forEach((a,i)=>{i<r.length-1&&(n+=this.mathDistance2d(a,r[i+1]));}),n}getBaseLength2d(r){return Math.pow(this.wholeDistance2d(r),.99)}computeStar2d(r,n,a){let i=Math.PI/r,o=2*r,h=new Array(o);for(let s=0;s<o;s++){let l=s%2===0?n:a;h[s]=new e.Cartesian2(Math.cos(s*i)*l,Math.sin(s*i)*l);}return h}computeCircleShap(r){let n=[];for(let a=0;a<360;a++){let i=e.Math.toRadians(a);n.push(new e.Cartesian2(r*Math.cos(i),r*Math.sin(i)));}return n}mid2d(r,n){return [(r[0]+n[0])/2,(r[1]+n[1])/2]}getCircleCenterOfThreePoints2d(r,n,a){let i=[(r[0]+n[0])/2,(r[1]+n[1])/2],o=[i[0]-r[1]+n[1],i[1]+r[0]-n[0]],h=[(r[0]+a[0])/2,(r[1]+a[1])/2],s=[h[0]-r[1]+a[1],h[1]+r[0]-a[0]];return this.getIntersectPoint2d(i,o,h,s)}getIntersectPoint2d(r,n,a,i){if(r[1]===n[1]){let c=(i[0]-a[0])/(i[1]-a[1])*(r[1]-a[1])+a[0],m=r[1];return [c,m]}if(a[1]===i[1]){let c=(n[0]-r[0])/(n[1]-r[1])*(a[1]-r[1])+r[0],m=a[1];return [c,m]}let o=(n[0]-r[0])/(n[1]-r[1]),h=(i[0]-a[0])/(i[1]-a[1]),s=(o*r[1]-r[0]-h*a[1]+a[0])/(o-h);return [o*s-o*r[1]+r[0],s]}getAzimuth2d(r,n){let a,i=Math.asin(Math.abs(n[1]-r[1])/this.mathDistance2d(r,n));return n[1]>=r[1]&&n[0]>=r[0]?a=i+Math.PI:n[1]>=r[1]&&n[0]<r[0]?a=Math.PI*2-i:n[1]<r[1]&&n[0]<r[0]?a=i:a=Math.PI-i,a}getAngleOfThreePoints2d(r,n,a){let i=this.getAzimuth2d(n,r)-this.getAzimuth2d(n,a);return i<0?i+Math.PI*2:i}isClockWise2d(r,n,a){return (a[1]-r[1])*(n[0]-r[0])>(n[1]-r[1])*(a[0]-r[0])}isClockWise(r,n,a){return this.isClockWise2d(r,n,a)}getPointOnLine2d(r,n,a){let i=n[0]+r*(a[0]-n[0]),o=n[1]+r*(a[1]-n[1]);return [i,o]}getCubicValue2d(r,n,a,i,o){r=Math.max(Math.min(r,1),0);let h=1-r,s=r*r,l=s*r,u=h*h,c=u*h,m=c*n[0]+3*u*r*a[0]+3*h*s*i[0]+l*o[0],y=c*n[1]+3*u*r*a[1]+3*h*s*i[1]+l*o[1];return [m,y]}getThirdPoint2d(r,n,a,i,o){let h=this.getAzimuth2d(r,n),s=o?h+a:h-a,l=i*Math.cos(s),u=i*Math.sin(s);return [n[0]+l,n[1]+u]}inherits2d(r,n){function a(){}a.prototype=n.prototype,r.superClass_=n.prototype,r.prototype=new a,r.prototype.constructor=r,r.base=function(i,o,...h){let s=Array.prototype.slice.call(arguments,2);return n.prototype[o].apply(i,s)};}getArcPoints2d(r,n,a,i){let o,h,s=[],l=i-a;l=l<0?l+Math.PI*2:l;for(let u=0;u<=100;u++){let c=a+l*u/100;o=r[0]+n*Math.cos(c),h=r[1]+n*Math.sin(c),s.push([o,h]);}return s}getBisectorNormals2d(r,n,a,i){let o=this.getNormal2d(n,a,i),h,s,l,u,c,m=Math.sqrt(o[0]*o[0]+o[1]*o[1]),y=o[0]/m,f=o[1]/m,g=this.mathDistance2d(n,a),v=this.mathDistance2d(a,i);return m>1e-4?this.isClockWise(n,a,i)?(l=r*g,u=a[0]-l*f,c=a[1]+l*y,h=[u,c],l=r*v,u=a[0]+l*f,c=a[1]-l*y,s=[u,c]):(l=r*g,u=a[0]+l*f,c=a[1]-l*y,h=[u,c],l=r*v,u=a[0]-l*f,c=a[1]+l*y,s=[u,c]):(u=a[0]+r*(n[0]-a[0]),c=a[1]+r*(n[1]-a[1]),h=[u,c],u=a[0]+r*(i[0]-a[0]),c=a[1]+r*(i[1]-a[1]),s=[u,c]),[h,s]}getNormal2d(r,n,a){let i=r[0]-n[0],o=r[1]-n[1],h=Math.sqrt(i*i+o*o);i/=h,o/=h;let s=a[0]-n[0],l=a[1]-n[1],u=Math.sqrt(s*s+l*l);s/=u,l/=u;let c=i+s,m=o+l;return [c,m]}getLeftMostControlPoint2d(r,n){let a=r[0],i=r[1],o=r[2],h,s,u=this.getBisectorNormals2d(0,a,i,o)[0],c=this.getNormal2d(a,i,o);if(Math.sqrt(c[0]*c[0]+c[1]*c[1])>1e-4){let y=this.mid2d(a,i),f=a[0]-y[0],g=a[1]-y[1],A=2/this.mathDistance2d(a,i),w=-A*g,C=A*f,P=w*w-C*C,x=2*w*C,b=C*C-w*w,M=u[0]-y[0],k=u[1]-y[1];h=y[0]+P*M+x*k,s=y[1]+x*M+b*k;}else h=a[0]+n*(i[0]-a[0]),s=a[1]+n*(i[1]-a[1]);return [h,s]}getRightMostControlPoint2d(r,n){let a=r.length,i=r[a-3],o=r[a-2],h=r[a-1],l=this.getBisectorNormals2d(0,i,o,h)[1],u=this.getNormal2d(i,o,h),c=Math.sqrt(u[0]*u[0]+u[1]*u[1]),m,y;if(c>1e-4){let f=this.mid2d(o,h),g=h[0]-f[0],v=h[1]-f[1],w=2/this.mathDistance2d(o,h),C=-w*v,P=w*g,x=C*C-P*P,b=2*C*P,M=P*P-C*C,k=l[0]-f[0],_=l[1]-f[1];m=f[0]+x*k+b*_,y=f[1]+b*k+M*_;}else m=h[0]+n*(o[0]-h[0]),y=h[1]+n*(o[1]-h[1]);return [m,y]}getCurvePoints2d(r,n){let a=this.getLeftMostControlPoint2d(n,r),i,o,h,s=[a],l=[];for(let c=0;c<n.length-2;c++){i=n[c],o=n[c+1],h=n[c+2];let m=this.getBisectorNormals2d(r,i,o,h);s=s.concat(m);}let u=this.getRightMostControlPoint2d(n,r);u&&s.push(u);for(let c=0;c<n.length-1;c++){i=n[c],o=n[c+1],l.push(i);for(let m=0;m<100;m++){let y=this.getCubicValue2d(m/100,i,s[c*2],s[c*2+1],o);l.push(y);}l.push(o);}return l}getBezierPoints2d(r){if(r.length<=2)return r;{let n=[],a=r.length-1;for(let i=0;i<=1;i+=.01){let o=0,h=0;for(let s=0;s<=a;s++){let l=this.getBinomialFactor2d(a,s),u=Math.pow(i,s),c=Math.pow(1-i,a-s);o+=l*u*c*r[s][0],h+=l*u*c*r[s][1];}n.push([o,h]);}return n.push(r[a]),n}}getFactorial2d(r){let n=1;for(let a=1;a<=r;a++)n*=a;return n}getBinomialFactor2d(r,n){return this.getFactorial2d(r)/(this.getFactorial2d(n)*this.getFactorial2d(r-n))}getQBSplinePoints2d(r){if(r.length<=2)return r;{let a=[],i=r.length-2-1;a.push(r[0]);for(let o=0;o<=i;o++)for(let h=0;h<=1;h+=.05){let s=0,l=0;for(let u=0;u<=2;u++){let c=this.getQuadricBSplineFactor2d(u,h);s+=c*r[o+u][0],l+=c*r[o+u][1];}a.push([s,l]);}return a.push(r[r.length-1]),a}}getQuadricBSplineFactor2d(r,n){let a=0;return r===0?a=Math.pow(n-1,2)/2:r===1?a=(-2*Math.pow(n,2)+2*n+1)/2:r===2&&(a=Math.pow(n,2)/2),a}}return d}var Ee=te(Bn);function On(){let e=null,d=function(p,r){if(p){this._viewer=p,Le(ue,Q),this.$graphics=new ue(p,r),e=r;let n=this.$graphics;ae(this),ie(this,()=>{de(n);});}};return d.prototype={setCircleScanEffect:function(p){if(p&&p.position){var r=p.id||"CircleScan"+parseInt(Math.random()*1e3),n=p.position,a=p.radius,i=p.color||e.Color.RED,o=p.duration||1500,h=this,s=p.circleMode||"CircleScan",l=p.border||4,u=n,c=new e.Cartesian4(u.x,u.y,u.z,1),m=this.transformCartesianToWGS84(n),y=this.transformWGS84ToCartesian({lng:m.lng,lat:m.lat,alt:m.alt+500}),f=new e.Cartesian4(y.x,y.y,y.z,1),g=new Date().getTime(),v=new e.PostProcessStage({name:r,fragmentShader:this._getCircleScanShader({get:true,border:l}),uniforms:{u_scanCenterEC:function(){return e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,c,new e.Cartesian4)},u_scanPlaneNormalEC:function(){var A=e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,c,new e.Cartesian4),w=e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,f,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)%o)/o:a},u_scanColor:i}});return this._viewer.scene.postProcessStages.add(v),v}},setRadarScanEffect:function(p){if(p&&p.position){var r=p.id||"radarScan"+parseInt(Math.random()*1e3),n=p.position,a=p.radius,i=p.color||e.Color.RED,o=p.duration||1500,h=this,s=p.border||1,l=p.width||3,u=n,c=new e.Cartesian4(u.x,u.y,u.z,1),m=this.transformCartesianToWGS84(n),y=this.transformWGS84ToCartesian({lng:m.lng,lat:m.lat,alt:m.alt+500}),f=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,P=new e.Cartesian4,x=new e.Cartesian4,b=new e.Cartesian4,M=new e.Cartesian3,k=new e.Cartesian3,_=new e.PostProcessStage({name:r,fragmentShader:this._getRadarScanShader({border:s,width:l,get:true}),uniforms:{u_scanCenterEC:function(){return e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,c,P)},u_scanPlaneNormalEC:function(){var S=e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,c,P),L=e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,f,x);return M.x=L.x-S.x,M.y=L.y-S.y,M.z=L.z-S.z,e.Cartesian3.normalize(M,M),M},u_scanLineNormalEC:function(){var S=e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,c,P),L=e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,f,x),G=e.Matrix4.multiplyByVector(h._viewer.camera._viewMatrix,v,b);M.x=L.x-S.x,M.y=L.y-S.y,M.z=L.z-S.z,e.Cartesian3.normalize(M,M),k.x=G.x-S.x,k.y=G.y-S.y,k.z=G.z-S.z;var R=(new Date().getTime()-A)%o/o;return e.Quaternion.fromAxisAngle(M,R*e.Math.PI*2,w),e.Matrix3.fromQuaternion(w,C),e.Matrix3.multiplyByVector(C,k,k),e.Cartesian3.normalize(k,k),k},u_radius:a,u_scanColor:i}});return this._viewer.scene.postProcessStages.add(_),_}},satelliteScan:function(p){if(p&&p.position){var r=e.Cartesian3,n=e.GeometryInstance,a=e.Primitive,l=e.MaterialAppearance,i=e.Material,o=e.Color,h=e.Matrix4,s=e.Transforms,l=e.MaterialAppearance,u=e.CylinderGeometry;let v=p.position||[116.39,39.9],A=p.length||4e4;var c=r.fromDegrees(v[0],v[1]),m=h.multiplyByTranslation(s.eastNorthUpToFixedFrame(c),new r(0,0,A*.5),new h),y=new u({length:A,topRadius:0,bottomRadius:A*.5,vertexFormat:l.MaterialSupport.TEXTURED.vertexFormat}),f=new n({geometry:y,modelMatrix:m}),g=this._viewer.scene.primitives.add(new a({geometryInstances:f,appearance:new l({material:new i({fabric:{uniforms:{color:p.color||new o(.2,1,0,1),repeat:p.repeat||30,offset:0,thickness:p.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})},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:`
|
|
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),
|
|
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
|
|
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
|
-
}`,
|
|
781
|
+
}`,Gt=`in vec4 position;
|
|
782
782
|
in vec3 normal;
|
|
783
783
|
|
|
784
784
|
out vec3 v_position;
|
|
@@ -792,7 +792,7 @@ void main() {
|
|
|
792
792
|
v_positionWC = (czm_model * position).xyz;
|
|
793
793
|
v_positionEC = (czm_modelView * position).xyz;
|
|
794
794
|
v_normalEC = czm_normal * normal;
|
|
795
|
-
}`,
|
|
795
|
+
}`,_t=`uniform vec4 u_intersectionColor;
|
|
796
796
|
uniform float u_intersectionWidth;
|
|
797
797
|
uniform vec4 u_lineColor;
|
|
798
798
|
|
|
@@ -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
|
-
}`,
|
|
831
|
+
}`,Ot=`#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 X={};function zt(e){X=e;var d=X.BoundingSphere,p=X.Cartesian3,r=X.Color,n=X.combine,a=X.ComponentDatatype,i=X.defaultValue||X.Scene.defaultValue,o=X.defined;X.destroyObject;var l=X.DeveloperError,S=X.Matrix4,u=X.PrimitiveType,c=X.Buffer,m=X.BufferUsage,y=X.DrawCommand,f=X.Pass,g=X.RenderState,v=X.ShaderProgram,A=X.ShaderSource,w=X.VertexArray,C=X.BlendingState,P=X.CullFace,x=X.Material,b=X.SceneMode,M=X.VertexFormat,k=X.Math,_=X.Matrix3,S=X.Matrix4,L=X.JulianDate;X.BoxGeometry;X.EllipsoidGeometry;var z=Math.sin,U=Math.cos,K=Math.tan,W=Math.atan,q={position:0,normal:1};function oe(I){var B=this;I=i(I,i.EMPTY_OBJECT),this.show=i(I.show,true),this.slice=i(I.slice,32),this.modelMatrix=S.clone(I.modelMatrix,new S),this._modelMatrix=new S,this._computedModelMatrix=new S,this._computedScanPlaneModelMatrix=new S,this.radius=i(I.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=i(I.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=i(I.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=i(I.lineColor,r.WHITE),this.showSectorLines=i(I.showSectorLines,true),this.showSectorSegmentLines=i(I.showSectorSegmentLines,true),this.showLateralSurfaces=i(I.showLateralSurfaces,true),this.material=o(I.material)?I.material:x.fromType(x.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=o(I.lateralSurfaceMaterial)?I.lateralSurfaceMaterial:x.fromType(x.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=i(I.showDomeSurfaces,true),this.domeSurfaceMaterial=o(I.domeSurfaceMaterial)?I.domeSurfaceMaterial:x.fromType(x.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=i(I.showDomeLines,true),this.showIntersection=i(I.showIntersection,true),this.intersectionColor=i(I.intersectionColor,r.WHITE),this.intersectionWidth=i(I.intersectionWidth,5),this.showThroughEllipsoid=i(I.showThroughEllipsoid,false),this._showThroughEllipsoid=void 0,this.showScanPlane=i(I.showScanPlane,true),this.scanPlaneColor=i(I.scanPlaneColor,r.WHITE),this.scanPlaneMode=i(I.scanPlaneMode,"horizontal"),this.scanPlaneRate=i(I.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=L.now(),this._boundingSphere=new d,this._boundingSphereWC=new d,this._sectorFrontCommand=new y({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new y({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new y({owner:this,primitiveType:u.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new y({owner:this,primitiveType:u.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new y({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new y({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new y({owner:this,primitiveType:u.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new y({owner:this,primitiveType:u.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new y({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 B.xHalfAngle},u_yHalfAngle:function(){return B.yHalfAngle},u_radius:function(){return B.radius},u_showThroughEllipsoid:function(){return B.showThroughEllipsoid},u_showIntersection:function(){return B.showIntersection},u_intersectionColor:function(){return B.intersectionColor},u_intersectionWidth:function(){return B.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return B.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return B._scanePlaneXHalfAngle},u_yHalfAngle:function(){return B._scanePlaneYHalfAngle},u_radius:function(){return B.radius},u_color:function(){return B.scanPlaneColor},u_showThroughEllipsoid:function(){return B.showThroughEllipsoid},u_showIntersection:function(){return B.showIntersection},u_intersectionColor:function(){return B.intersectionColor},u_intersectionWidth:function(){return B.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return B.lineColor}};}oe.prototype.update=function(I){var B=I.mode;if(!(!this.show||B!==b.SCENE3D)){var H=false,V=false,F=false,N=this.xHalfAngle,ee=this.yHalfAngle;if(N<0||ee<0)throw new l("halfAngle must be greater than or equal to zero.");if(!(N==0||ee==0)){(this._xHalfAngle!==N||this._yHalfAngle!==ee)&&(this._xHalfAngle=N,this._yHalfAngle=ee,H=true);var j=this.radius;if(j<0)throw new l("this.radius must be greater than or equal to zero.");var Y=false;this._radius!==j&&(Y=true,this._radius=j,this._boundingSphere=new d(p.ZERO,this.radius));var se=!S.equals(this.modelMatrix,this._modelMatrix);(se||Y)&&(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),d.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var ye=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=ye,V=true);var le=this.material;this._material!==le&&(this._material=le,V=true,F=true);var ge=le.isTranslucent();if(this._translucent!==ge&&(this._translucent=ge,V=true),this.showScanPlane){var Ye=I.time,Et=L.secondsDifference(Ye,this._time);Et<0&&(this._time=L.clone(Ye,this._time));var kt=Math.max(Et%this.scanPlaneRate/this.scanPlaneRate,0),ze;if(this.scanPlaneMode=="horizontal"){ze=2*ee*kt-ee;var un=U(ze),hn=K(N),dn=W(un*hn);this._scanePlaneXHalfAngle=dn,this._scanePlaneYHalfAngle=ze,X.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,D);}else {ze=2*N*kt-N;var mn=K(ee),yn=U(ze),pn=W(yn*mn);this._scanePlaneXHalfAngle=ze,this._scanePlaneYHalfAngle=pn,X.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,D);}X.Matrix4.multiplyByMatrix3(this.modelMatrix,D,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix);}H&&yt(this,I),V&&ln(this,ye,ge),F&&sn(this,I,le),(V||F)&&cn(this,ge);var fn=I.commandList,gn=I.passes,Dt=this._colorCommands;if(gn.render)for(var gt=0,vn=Dt.length;gt<vn;gt++){var An=Dt[gt];fn.push(An);}}}},oe.prototype.isDestroyed=function(){return false};var D=new _,O=new p;function J(I,B,H){for(var V=I.slice,F=U(H),N=K(H),ee=U(B),j=K(B),Y=W(ee*N),se=W(F*j),ye=[],le=0;le<V;le++){var ge=2*Y*le/(V-1)-Y;ye.push(new p(0,z(ge),U(ge)));}for(var Ye=[],le=0;le<V;le++){var ge=2*se*le/(V-1)-se;Ye.push(new p(z(ge),0,U(ge)));}return {zoy:ye,zox:Ye}}function $(I,B){var H=I.xHalfAngle,V=I.yHalfAngle,F=B.zoy,N=B.zox,ee=[],j=_.fromRotationY(H,D);ee.push(F.map(function(Y){return _.multiplyByVector(j,Y,new X.Cartesian3)}));var j=_.fromRotationX(-V,D);ee.push(N.map(function(Y){return _.multiplyByVector(j,Y,new X.Cartesian3)}).reverse());var j=_.fromRotationY(-H,D);ee.push(F.map(function(Y){return _.multiplyByVector(j,Y,new X.Cartesian3)}).reverse());var j=_.fromRotationX(V,D);return ee.push(N.map(function(Y){return _.multiplyByVector(j,Y,new X.Cartesian3)})),ee}function fe(I,B){for(var H=Array.prototype.concat.apply([],B).length-B.length,V=new Float32Array(18*H),F=0,N=0,ee=B.length;N<ee;N++)for(var j=B[N],Y=p.normalize(p.cross(j[0],j[j.length-1],O),O),se=0,H=j.length-1;se<H;se++)V[F++]=0,V[F++]=0,V[F++]=0,V[F++]=-Y.x,V[F++]=-Y.y,V[F++]=-Y.z,V[F++]=j[se].x,V[F++]=j[se].y,V[F++]=j[se].z,V[F++]=-Y.x,V[F++]=-Y.y,V[F++]=-Y.z,V[F++]=j[se+1].x,V[F++]=j[se+1].y,V[F++]=j[se+1].z,V[F++]=-Y.x,V[F++]=-Y.y,V[F++]=-Y.z;var ye=c.createVertexBuffer({context:I,typedArray:V,usage:m.STATIC_DRAW}),le=6*Float32Array.BYTES_PER_ELEMENT,ge=[{index:q.position,vertexBuffer:ye,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:le},{index:q.normal,vertexBuffer:ye,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:le}];return new w({context:I,attributes:ge})}function Pe(I,B){for(var H=B.length,V=new Float32Array(9*H),F=0,N=0,ee=B.length;N<ee;N++){var j=B[N];V[F++]=0,V[F++]=0,V[F++]=0,V[F++]=j[0].x,V[F++]=j[0].y,V[F++]=j[0].z;}var Y=c.createVertexBuffer({context:I,typedArray:V,usage:m.STATIC_DRAW}),se=3*Float32Array.BYTES_PER_ELEMENT,ye=[{index:q.position,vertexBuffer:Y,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:se}];return new w({context:I,attributes:ye})}function Ve(I,B){for(var H=Array.prototype.concat.apply([],B).length-B.length,V=new Float32Array(9*H),F=0,N=0,ee=B.length;N<ee;N++)for(var j=B[N],Y=0,H=j.length-1;Y<H;Y++)V[F++]=j[Y].x,V[F++]=j[Y].y,V[F++]=j[Y].z,V[F++]=j[Y+1].x,V[F++]=j[Y+1].y,V[F++]=j[Y+1].z;var se=c.createVertexBuffer({context:I,typedArray:V,usage:m.STATIC_DRAW}),ye=3*Float32Array.BYTES_PER_ELEMENT,le=[{index:q.position,vertexBuffer:se,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:ye}];return new w({context:I,attributes:le})}function be(I){var B=X.EllipsoidGeometry.createGeometry(new X.EllipsoidGeometry({vertexFormat:M.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),H=w.fromGeometry({context:I,geometry:B,attributeLocations:q,bufferUsage:m.STATIC_DRAW,interleave:false});return H}function mt(I){var B=X.EllipsoidOutlineGeometry.createGeometry(new X.EllipsoidOutlineGeometry({vertexFormat:M.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),H=w.fromGeometry({context:I,geometry:B,attributeLocations:q,bufferUsage:m.STATIC_DRAW,interleave:false});return H}function rt(I,B){for(var H=B.length-1,V=new Float32Array(9*H),F=0,N=0;N<H;N++)V[F++]=0,V[F++]=0,V[F++]=0,V[F++]=B[N].x,V[F++]=B[N].y,V[F++]=B[N].z,V[F++]=B[N+1].x,V[F++]=B[N+1].y,V[F++]=B[N+1].z;var ee=c.createVertexBuffer({context:I,typedArray:V,usage:m.STATIC_DRAW}),j=3*Float32Array.BYTES_PER_ELEMENT,Y=[{index:q.position,vertexBuffer:ee,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:j}];return new w({context:I,attributes:Y})}function yt(I,B){var H=B.context,V=J(I,I.xHalfAngle,I.yHalfAngle),F=$(I,V);if(I.showLateralSurfaces&&(I._sectorVA=fe(H,F)),I.showSectorLines&&(I._sectorLineVA=Pe(H,F)),I.showSectorSegmentLines&&(I._sectorSegmentLineVA=Ve(H,F)),I.showDomeSurfaces&&(I._domeVA=be(H)),I.showDomeLines&&(I._domeLineVA=mt(H)),I.showScanPlane)if(I.scanPlaneMode=="horizontal"){var N=J(I,k.PI_OVER_TWO,0);I._scanPlaneVA=rt(H,N.zox);}else {var N=J(I,0,k.PI_OVER_TWO);I._scanPlaneVA=rt(H,N.zoy);}}function pt(I,B,H){var V=B.context,F=bt,N=new A({sources:[lt,H.shaderSource,_t]});I._sp=v.replaceCache({context:V,shaderProgram:I._sp,vertexShaderSource:F,fragmentShaderSource:N,attributeLocations:q});var ee=new A({sources:[lt,H.shaderSource,_t],pickColorQualifier:"uniform"});I._pickSP=v.replaceCache({context:V,shaderProgram:I._pickSP,vertexShaderSource:F,fragmentShaderSource:ee,attributeLocations:q});}function ft(I,B,H){var V=B.context,F=bt,N=new A({sources:[lt,H.shaderSource,Ft]});I._scanePlaneSP=v.replaceCache({context:V,shaderProgram:I._scanePlaneSP,vertexShaderSource:F,fragmentShaderSource:N,attributeLocations:q});}function sn(I,B,H){pt(I,B,H),I.showScanPlane&&ft(I,B,H);}function ln(I,B,H){H?(I._frontFaceRS=g.fromCache({depthTest:{enabled:!B},depthMask:false,blending:C.ALPHA_BLEND,cull:{enabled:true,face:P.BACK}}),I._backFaceRS=g.fromCache({depthTest:{enabled:!B},depthMask:false,blending:C.ALPHA_BLEND,cull:{enabled:true,face:P.FRONT}}),I._pickRS=g.fromCache({depthTest:{enabled:!B},depthMask:false,blending:C.ALPHA_BLEND})):(I._frontFaceRS=g.fromCache({depthTest:{enabled:!B},depthMask:true}),I._pickRS=g.fromCache({depthTest:{enabled:true},depthMask:true}));}function Fe(I,B,H,V,F,N,ee,j,Y,se,ye,le){se&&H&&(H.vertexArray=ee,H.renderState=F,H.shaderProgram=N,H.uniformMap=n(j,I._material._uniforms),H.uniformMap.u_normalDirection=function(){return -1},H.pass=ye,H.modelMatrix=Y,I._colorCommands.push(H)),B.vertexArray=ee,B.renderState=V,B.shaderProgram=N,B.uniformMap=n(j,I._material._uniforms),le&&(B.uniformMap.u_type=function(){return 1}),B.pass=ye,B.modelMatrix=Y,I._colorCommands.push(B);}function cn(I,B){I._colorCommands.length=0;var H=B?f.TRANSLUCENT:f.OPAQUE;I.showLateralSurfaces&&Fe(I,I._sectorFrontCommand,I._sectorBackCommand,I._frontFaceRS,I._backFaceRS,I._sp,I._sectorVA,I._uniforms,I._computedModelMatrix,B,H),I.showSectorLines&&Fe(I,I._sectorLineCommand,void 0,I._frontFaceRS,I._backFaceRS,I._sp,I._sectorLineVA,I._uniforms,I._computedModelMatrix,B,H,true),I.showSectorSegmentLines&&Fe(I,I._sectorSegmentLineCommand,void 0,I._frontFaceRS,I._backFaceRS,I._sp,I._sectorSegmentLineVA,I._uniforms,I._computedModelMatrix,B,H,true),I.showDomeSurfaces&&Fe(I,I._domeFrontCommand,I._domeBackCommand,I._frontFaceRS,I._backFaceRS,I._sp,I._domeVA,I._uniforms,I._computedModelMatrix,B,H),I.showDomeLines&&Fe(I,I._domeLineCommand,void 0,I._frontFaceRS,I._backFaceRS,I._sp,I._domeLineVA,I._uniforms,I._computedModelMatrix,B,H,true),I.showScanPlane&&Fe(I,I._scanPlaneFrontCommand,I._scanPlaneBackCommand,I._frontFaceRS,I._backFaceRS,I._scanePlaneSP,I._scanPlaneVA,I._scanUniforms,I._computedScanPlaneModelMatrix,B,H);}return oe}var ke={};function Ht(e){ke=e;var d=ke.defaultValue||ke.Scene.defaultValue,p=ke.defined,r=Object.defineProperties,n=ke.DeveloperError,a=ke.Event,i=ke.createMaterialPropertyDescriptor,o=ke.createPropertyDescriptor;function h(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(d(s,d.EMPTY_OBJECT));}return r(h.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),radius:o("radius"),xHalfAngle:o("xHalfAngle"),yHalfAngle:o("yHalfAngle"),lineColor:o("lineColor"),showSectorLines:o("showSectorLines"),showSectorSegmentLines:o("showSectorSegmentLines"),showLateralSurfaces:o("showLateralSurfaces"),material:i("material"),showDomeSurfaces:o("showDomeSurfaces"),showDomeLines:o("showDomeLines "),showIntersection:o("showIntersection"),intersectionColor:o("intersectionColor"),intersectionWidth:o("intersectionWidth"),showThroughEllipsoid:o("showThroughEllipsoid"),gaze:o("gaze"),showScanPlane:o("showScanPlane"),scanPlaneColor:o("scanPlaneColor"),scanPlaneMode:o("scanPlaneMode"),scanPlaneRate:o("scanPlaneRate")}),h.prototype.clone=function(s){return p(s)||(s=new h),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},h.prototype.merge=function(s){if(!p(s))throw new n("source is required.");this.show=d(this.show,s.show),this.radius=d(this.radius,s.radius),this.xHalfAngle=d(this.xHalfAngle,s.xHalfAngle),this.yHalfAngle=d(this.yHalfAngle,s.yHalfAngle),this.lineColor=d(this.lineColor,s.lineColor),this.showSectorLines=d(this.showSectorLines,s.showSectorLines),this.showSectorSegmentLines=d(this.showSectorSegmentLines,s.showSectorSegmentLines),this.showLateralSurfaces=d(this.showLateralSurfaces,s.showLateralSurfaces),this.material=d(this.material,s.material),this.showDomeSurfaces=d(this.showDomeSurfaces,s.showDomeSurfaces),this.showDomeLines=d(this.showDomeLines,s.showDomeLines),this.showIntersection=d(this.showIntersection,s.showIntersection),this.intersectionColor=d(this.intersectionColor,s.intersectionColor),this.intersectionWidth=d(this.intersectionWidth,s.intersectionWidth),this.showThroughEllipsoid=d(this.showThroughEllipsoid,s.showThroughEllipsoid),this.gaze=d(this.gaze,s.gaze),this.showScanPlane=d(this.showScanPlane,s.showScanPlane),this.scanPlaneColor=d(this.scanPlaneColor,s.scanPlaneColor),this.scanPlaneMode=d(this.scanPlaneMode,s.scanPlaneMode),this.scanPlaneRate=d(this.scanPlaneRate,s.scanPlaneRate);},h}var pe={};function Wt(e,d){if(e){let x=function(b,M,k){var _=M[b.id];if(a(_)){var S=_.primitive;k.remove(S),S&&!S.isDestroyed()&&S.destroy(),delete M[b.id];}};pe=e;var p=pe.AssociativeArray,r=pe.Cartesian3,n=pe.Color,a=pe.defined,i=pe.destroyObject,o=pe.DeveloperError,h=pe.Matrix3,s=pe.Matrix4,l=pe.Quaternion,u=pe.MaterialProperty,c=pe.Property,m=new h;new s;var f=new r,g=new r,v=new l,A=new r,w=new l,C=function(b,M){if(!a(b))throw new o("scene is required.");if(!a(M))throw new o("entityCollection is required.");M.collectionChanged.addEventListener(C.prototype._onCollectionChanged,this),this._scene=b,this._primitives=b.primitives,this._entityCollection=M,this._hash={},this._entitiesToVisualize=new p,this._onCollectionChanged(M,M.values,[],[]);};return C.prototype.update=function(b){if(!a(b))throw new o("time is required.");for(var M=this._entitiesToVisualize.values,k=this._hash,_=this._primitives,S=0,L=M.length;S<L;S++){var G=M[S],R=G._rectangularSensor,z,U,K,W,ne,q=k[G.id],oe=G.isShowing&&G.isAvailable(b)&&c.getValueOrDefault(R._show,b,true);if(oe&&(z=c.getValueOrUndefined(G._position,b,f),U=c.getValueOrUndefined(G._orientation,b,v),K=c.getValueOrUndefined(R._radius,b),W=c.getValueOrUndefined(R._xHalfAngle,b),ne=c.getValueOrUndefined(R._yHalfAngle,b),oe=a(z)&&a(W)&&a(ne)),!oe){a(q)&&(q.primitive.show=false);continue}var D=a(q)?q.primitive:void 0;a(D)||(D=new d,D.id=G,_.add(D),q={primitive:D,position:void 0,orientation:void 0},k[G.id]=q);var O=c.getValueOrUndefined(R._gaze,b);if(a(O)){var J=c.getValueOrUndefined(O._position,b,g);if(!a(z)||!a(J))continue;var $=r.subtract(z,J,A),fe=r.angleBetween(pe.Cartesian3.UNIT_Z,$),Pe=r.cross(pe.Cartesian3.UNIT_Z,$,A),U=l.fromAxisAngle(Pe,fe-Math.PI,w);K=r.distance(z,J),D.modelMatrix=s.fromRotationTranslation(h.fromQuaternion(U,m),z,D.modelMatrix);}else (!r.equals(z,q.position)||!l.equals(U,q.orientation))&&(a(U)?(D.modelMatrix=s.fromRotationTranslation(h.fromQuaternion(U,m),z,D.modelMatrix),q.position=r.clone(z,q.position),q.orientation=l.clone(U,q.orientation)):(D.modelMatrix=pe.Transforms.eastNorthUpToFixedFrame(z),q.position=r.clone(z,q.position)));D.show=true,D.gaze=O,D.radius=K,D.xHalfAngle=W,D.yHalfAngle=ne,D.lineColor=c.getValueOrDefault(R._lineColor,b,n.WHITE),D.showSectorLines=c.getValueOrDefault(R._showSectorLines,b,true),D.showSectorSegmentLines=c.getValueOrDefault(R._showSectorSegmentLines,b,true),D.showLateralSurfaces=c.getValueOrDefault(R._showLateralSurfaces,b,true),D.material=u.getValue(b,R._material,D.material),D.showDomeSurfaces=c.getValueOrDefault(R._showDomeSurfaces,b,true),D.showDomeLines=c.getValueOrDefault(R._showDomeLines,b,true),D.showIntersection=c.getValueOrDefault(R._showIntersection,b,true),D.intersectionColor=c.getValueOrDefault(R._intersectionColor,b,n.WHITE),D.intersectionWidth=c.getValueOrDefault(R._intersectionWidth,b,1),D.showThroughEllipsoid=c.getValueOrDefault(R._showThroughEllipsoid,b,true),D.scanPlaneMode=c.getValueOrDefault(R._scanPlaneMode,b),D.scanPlaneColor=c.getValueOrDefault(R._scanPlaneColor,b,n.WHITE),D.showScanPlane=c.getValueOrDefault(R._showScanPlane,b,true),D.scanPlaneRate=c.getValueOrDefault(R._scanPlaneRate,b,1);}return true},C.prototype.isDestroyed=function(){return false},C.prototype.destroy=function(){for(var b=this._entitiesToVisualize.values,M=this._hash,k=this._primitives,_=b.length-1;_>-1;_--)x(b[_],M,k);return i(this)},C.prototype._onCollectionChanged=function(b,M,k,_){var S,L,G=this._entitiesToVisualize,R=this._hash,z=this._primitives;for(S=M.length-1;S>-1;S--)L=M[S],a(L._rectangularSensor)&&a(L._position)&&G.set(L.id,L);for(S=_.length-1;S>-1;S--)L=_[S],a(L._rectangularSensor)&&a(L._position)?G.set(L.id,L):(x(L,R,z),G.remove(L.id));for(S=k.length-1;S>-1;S--)L=k[S],x(L,R,z),G.remove(L.id);},C}}var E=null,xt=function(e,d){e&&(this.viewer=e,E=d,this._installPlugin());};xt.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 d=new E.Cartesian2,p=new E.Cartesian3,r=new E.Ray;e._createGeometry=function(n){var a=n.length,i=n.topRadius,o=n.bottomRadius,h=n.slices,s=2*Math.PI/(h-1),l=n.zReverse,u=[],c=[],m=[],y=[],f=[o,i],g=[0,l?-a:a],v=0,A=Math.atan2(o-i,a),w=d;w.z=Math.sin(A);for(var C=Math.cos(A),P=0;P<g.length;P++){y[P]=[];for(var x=f[P],b=0;b<h;b++){y[P].push(v++);var M=s*b,k=x*Math.cos(M),_=x*Math.sin(M);u.push(k,_,g[P]),k=C*Math.cos(M),_=C*Math.sin(M),c.push(k,_,w.z),m.push(P/(g.length-1),0);}}for(var S=[],P=1;P<g.length;P++)for(var b=1;b<h;b++){var L=y[P-1][b-1],G=y[P][b-1],R=y[P][b],z=y[P-1][b];S.push(R),S.push(z),S.push(L),S.push(R),S.push(L),S.push(G),b==y[P].length-1&&(L=y[P-1][b],G=y[P][b],R=y[P][0],z=y[P-1][0],S.push(R),S.push(z),S.push(L),S.push(R),S.push(L),S.push(G));}S=new Int16Array(S),u=new Float32Array(u),c=new Float32Array(c),m=new Float32Array(m);var U={position:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),normal:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c}),st:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},K=E.BoundingSphere.fromVertices(u),W=new E.Geometry({attributes:U,indices:S,primitiveType:E.PrimitiveType.TRIANGLES,boundingSphere:K});return u=[],S=[],m=[],W},e.createGeometry=function(n,a){if(!a)return e._createGeometry(n);E.Matrix4.multiplyByPoint(a,E.Cartesian3.ZERO,p),p.clone(r.origin);var i=n.length,o=n.topRadius,h=(n.bottomRadius,n.slices),s=2*Math.PI/(h-1),l=n.zReverse,u=[],c=[],m=[],y=[],f=[0,l?-i:i],g=0,g=0;u.push(0,0,0),c.push(1,1),g++;for(var v=new E.Cartesian3,A=o/15,w=0;w<16;w++){for(var C=A*w,P=[],x=0;x<h;x++){var b=s*x,M=C*Math.cos(b),k=C*Math.sin(b);v.x=M,v.y=k,v.z=f[1];var _=(0, E.Scene.extend2Earth)(v,a,r);_?(P.push(g),u.push(M,k,f[1]),c.push(w/15,1),g++):(_=p,P.push(-1));}y.push(P);}for(var S,L,G=[0,y.length-1],R=0;R<G.length;R++)for(var w=G[R],x=1;x<y[w].length;x++)S=y[w][x-1],L=y[w][x],S>=0&&L>=0&&m.push(0,S,L);u=new Float32Array(u),m=new Int32Array(m),c=new Float32Array(c);var z={position:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),st:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c})},U=E.BoundingSphere.fromVertices(u),K=new E.Geometry({attributes:z,indices:m,primitiveType:E.PrimitiveType.TRIANGLES,boundingSphere:U});return (0, E.Scene.computeVertexNormals)(K),u=[],m=[],K},e.createOutlineGeometry=function(n){var a=n.length,i=n.topRadius,o=n.bottomRadius,h=n.slices,s=2*Math.PI/(h-1),l=n.zReverse,u=[],c=[],m=[],y=[],f=[o,i],g=[0,l?-a:a],v=0,A=Math.atan2(o-i,a),w=d;w.z=Math.sin(A);for(var C=Math.cos(A),P=0;P<g.length;P++){y[P]=[];for(var x=f[P],b=0;b<h;b++){y[P].push(v++);var M=s*b,k=x*Math.cos(M),_=x*Math.sin(M);u.push(k,_,g[P]),k=C*Math.cos(M),_=C*Math.sin(M),c.push(k,_,w.z),m.push(P/(g.length-1),0);}}for(var S=[],P=1;P<g.length;P++)for(var b=1;b<h;b+=1){var L=y[P-1][b-1],G=y[P][b-1];y[P][b],y[P-1][b],b%8==1&&S.push(L,G);}S=new Int16Array(S),u=new Float32Array(u),c=new Float32Array(c),m=new Float32Array(m);var R={position:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),normal:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c}),st:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},z=E.BoundingSphere.fromVertices(u),U=new E.Geometry({attributes:R,indices:S,primitiveType:E.PrimitiveType.LINES,boundingSphere:z});return u=[],S=[],m=[],U},e.fromAngleAndLength=function(n,a,i){return n=E.Math.toRadians(n),new e({topRadius:Math.tan(n)*a/2,bottomRadius:0,length:a,zReverse:i})},E.Scene.CylinderGeometry=e;},_installRadarPrimitive:function(){var e;function d(r,n){let a=E.defaultValue||xe;n=n||{},e=r.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:E.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=E.Matrix4.clone(E.Matrix4.IDENTITY),this._quaternion=new E.Quaternion,this._translation=new E.Cartesian3,this._scale=new E.Cartesian3(1,1,1),this._matrix=new E.Matrix4,this._inverseMatrix=new E.Matrix4,this._positionCartographic=new E.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=r,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=a(n.groundArea,false),this.addGroundAreaEntity(this._groundArea);}Object.defineProperties(d.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(r){this._trackedEntity=r;}},color:{get:function(){return this.defaultColor},set:function(r){this.defaultColor=r;}},lineColor:{get:function(){return this.defaultLineColor},set:function(r){this.defaultLineColor=r;}},show:{get:function(){return this._show},set:function(r){this._show=r;}},outline:{get:function(){return this._outline},set:function(r){this._outline=r,this.updateGeometry();}},top:{get:function(){return this._topShow},set:function(r){this._topShow=r,this.updateGeometry();}},topOutline:{get:function(){return this._topOutline},set:function(r){this._topOutline=r,this.updateGeometry();}},groundArea:{get:function(){return this._groundArea},set:function(r){this._groundArea=r,this.addGroundAreaEntity(this._groundArea);}},angle:{get:function(){return this._angle},set:function(r){this._angle=r,this.updateGroundCircleRadius(),this.updateGeometry();}},radius:{get:function(){return this._radius},set:function(r){this._radius=r,this.updateGroundCircleRadius(),this.updateGeometry();}},heading:{get:function(){return this._rotation.heading},set:function(r){this._rotation.heading=r;}},pitch:{get:function(){return this._rotation.pitch},set:function(r){this._rotation.pitch=r;}},roll:{get:function(){return this._rotation.roll},set:function(r){this._rotation.roll=r;}},position:{get:function(){return this._position},set:function(r){this._position=r;}}}),d.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(E.Math.toRadians(this._angle));},d.prototype.isDestroyed=function(){return false},d.prototype.addGroundAreaEntity=function(r){if(r&&!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 E.CallbackProperty(function(a){return n._ground_radius},false),semiMajorAxis:new E.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 E.CallbackProperty(function(a){return n._trackedEntityPosition?E.Cartesian3.distance(n._position,n._trackedEntityPosition)>n._radius?[]:[n._position,n._trackedEntityPosition]:[]},false),followSurface:false,material:new E.PolylineDashMaterialProperty({color:E.Color.CYAN}),width:1}});}};var p=new E.Cartesian3;d.prototype.computeMatrix=function(r,n){if(this._positionCartesian||(this._positionCartesian=new E.Cartesian3),this.position instanceof E.Cartesian3?this._positionCartesian=this.position:typeof this.position.getValue=="function"?this._positionCartesian=this.position.getValue(r):this.position._value&&this.position._value instanceof E.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position){this._positionCartesian;var i=E.Property.getValueOrUndefined(this._trackedEntity.position,r,p);i&&(this._trackedEntityPosition=i,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0);}return this._modelMatrix=E.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,e,this._modelMatrix),this._positionCartographic=E.Cartographic.fromCartesian(this._positionCartesian,e,this._positionCartographic),E.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,e,this._modelMatrix),E.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=E.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),E.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),E.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},d.prototype.getTopGeometry=function(){for(var r=this.radius,n=[],a=[],i=[],o=[],h=90-parseInt(this.angle),s=h<1?h/8:1,l=2*Math.PI/127,u=0,c=this.angle;c<91;c+=s){var m=E.Math.toRadians(c<90?c:90);m=Math.cos(m)*r;for(var y=[],f=0;f<128;f++){var g=l*f,v=m*Math.cos(g),A=m*Math.sin(g),w=Math.sqrt(r*r-v*v-A*A);n.push(v,A,w),a.push(1,1),y.push(u++);}o.push(y);}for(var c=1;c<o.length;c++)for(var f=1;f<o[c].length;f++){var C=o[c-1][f-1],P=o[c][f-1],x=o[c][f],b=o[c-1][f];i.push(C,P,x),i.push(C,x,b);}n=new Float32Array(n),i=new Int32Array(i),a=new Float32Array(a);var M={position:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),st:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:a})},k=E.BoundingSphere.fromVertices(n),_=new E.Geometry({attributes:M,indices:i,primitiveType:E.PrimitiveType.TRIANGLES,boundingSphere:k});return (0, E.Scene.computeVertexNormals)(_),_},d.prototype.getTopOutlineGeometry=function(){for(var r=this.radius,n=[],a=[],i=[],o=[],h=90-parseInt(this.angle),s=h<1?h/8:1,l=2*Math.PI/127,u=0,c=this.angle;c<91;c+=s){var m=E.Math.toRadians(c<90?c:90);m=Math.cos(m)*r;for(var y=[],f=0;f<128;f++){var g=l*f,v=m*Math.cos(g),A=m*Math.sin(g),w=Math.sqrt(r*r-v*v-A*A);n.push(v,A,w),a.push(1,1),y.push(u++);}o.push(y);}for(var c=1;c<o.length;c++)for(var f=1;f<o[c].length;f++){var C=o[c-1][f-1],P=o[c][f-1],x=o[c][f];o[c-1][f],f%8==1&&i.push(C,P),c%8==1&&i.push(P,x);}n=new Float32Array(n),i=new Int32Array(i),a=new Float32Array(a);var b={position:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n}),st:new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:a})},M=E.BoundingSphere.fromVertices(n),k=new E.Geometry({attributes:b,indices:i,primitiveType:E.PrimitiveType.LINES,boundingSphere:M});return (0, E.Scene.computeVertexNormals)(k),k},d.prototype.updateGeometry=function(){this._geometry=E.Scene.CylinderGeometry.createGeometry(new E.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(E.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(E.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=E.Scene.CylinderGeometry.createOutlineGeometry(new E.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(E.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(E.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var r=0;r<this._positions.length;r++)this._positions[r]=this._geometry.attributes.position.values[r];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(n){n.vertexArray=n.vertexArray&&n.vertexArray.destroy();}),this._drawCommands.splice(0,this._drawCommands.length));},d.prototype.update=function(r){this._show&&(this.computeMatrix(r.time),r.mode===E.SceneMode.SCENE3D?(this._geometry.boundingSphere=E.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,r)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,r)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,r)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,r)))),this._drawCommands.forEach(function(n){r.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)));},d.prototype.getFragmentShaderSource=function(r){return `#version 300 es
|
|
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
|
|
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
|
-
}`},
|
|
999
|
+
}`},h.prototype.getVertexShaderSource=function(o){return `#version 300 es
|
|
1000
1000
|
#ifdef GL_ES
|
|
1001
1001
|
precision highp float;
|
|
1002
1002
|
#endif
|
|
@@ -1021,10 +1021,92 @@ 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
|
-
}`},d.prototype.createDrawCommand=function(r,n,a){var i=n.context,o=new E.Cartesian3;E.Matrix4.multiplyByPoint(this._matrix,r.boundingSphere.center,o);var h=new E.BoundingSphere(o,r.boundingSphere.radius),s=new E.DrawCommand({modelMatrix:a||this._matrix,owner:this,primitiveType:r.primitiveType,pass:E.Pass.TRANSLUCENT,boundingVolume:h}),l=this,u=E.GeometryPipeline.createAttributeLocations(r);return s.vertexArray=E.VertexArray.fromGeometry({context:i,geometry:r,attributeLocations:u,bufferUsage:E.BufferUsage.STATIC_DRAW}),s.vertexArray._attributeLocations=u,s.shaderProgram=E.ShaderProgram.replaceCache({context:i,vertexShaderSource:this.getVertexShaderSource(r),fragmentShaderSource:this.getFragmentShaderSource(r),attributeLocations:u}),s.renderState=E.RenderState.fromCache({blending:E.BlendingState.ALPHA_BLEND,depthTest:{enabled:true,func:E.DepthFunction.LESS},cull:{enabled:false,face:E.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 l.shininess||(l.shininess=0),l.shininess},s.uniformMap.emission=function(){return l.emission||(l.emission=new E.Cartesian3(.2,.2,.2)),l.emission},s.uniformMap.specular=function(){return l.specular||(l.specular=0),l.specular},s.uniformMap.isLine=function(){return r.primitiveType==E.PrimitiveType.LINES||r.primitiveType==E.PrimitiveType.LINE_STRIP},s.uniformMap.defaultColor=function(){return r.primitiveType==E.PrimitiveType.LINES||r.primitiveType==E.PrimitiveType.LINE_STRIP?(l.defaultLineColor||(l.defaultLineColor=new E.Color(1,1,0,1)),l.defaultLineColor):(l.defaultColor||(l.defaultColor=new E.Color(1,0,0,1)),l.defaultColor)},s.uniformMap.picked=function(){return l.picked||(l.picked=0),l.picked},s.uniformMap.pickedColor=function(){return l.pickedColor||(l.pickedColor=new E.Color(1,1,0,1)),l.pickedColor},s.uniformMap.normalMatrix=function(){return n.context.uniformState.normal},s.uniformMap.glowPower=function(){return .25},s},d.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity);},d.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity);},d.prototype.destroy=function(r){r&&(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=[]);},E.Scene.ConeSensorPrimitive=d;},_installCounputeVertex:function(){function e(a){var i=a.indices,o=a.attributes,h=i.length;if(o.position){var s=o.position.values;if(o.normal===void 0)o.normal=new E.GeometryAttribute({componentDatatype:E.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(s.length)});else for(var l=o.normal.values,u=0;u<h;u++)l[u]=0;for(var c,m,y,f=o.normal.values,g=new E.Cartesian3,v=new E.Cartesian3,A=new E.Cartesian3,w=new E.Cartesian3,C=new E.Cartesian3,u=0;u<h;u+=3)c=3*i[u+0],m=3*i[u+1],y=3*i[u+2],E.Cartesian3.fromArray(s,c,g),E.Cartesian3.fromArray(s,m,v),E.Cartesian3.fromArray(s,y,A),E.Cartesian3.subtract(A,v,w),E.Cartesian3.subtract(g,v,C),E.Cartesian3.cross(w,C,w),f[c]+=w.x,f[c+1]+=w.y,f[c+2]+=w.z,f[m]+=w.x,f[m+1]+=w.y,f[m+2]+=w.z,f[y]+=w.x,f[y+1]+=w.y,f[y+2]+=w.z;d(a),o.normal.needsUpdate=true;}return a}function d(a){for(var i,o,h,s,l=a.attributes.normal.values,u=0;u<l.length;u+=3)i=l[u],o=l[u+1],h=l[u+2],s=1/Math.sqrt(i*i+o*o+h*h),l[u]=i*s,l[u+1]=o*s,l[u+2]=h*s;}function p(a,i,o,h){h=h||E.Ellipsoid.WGS84,E.Matrix4.multiplyByPoint(i,a,r),E.Cartesian3.subtract(r,o.origin,o.direction),E.Cartesian3.normalize(o.direction,o.direction);var s=E.IntersectionTests.rayEllipsoid(o,h),l=null;if(s&&(l=E.Ray.getPoint(o,s.start)),l)try{E.Cartographic.fromCartesian(l,null,n);}catch{return null}return l}var r=new E.Cartesian3,n=(new E.Ray,new E.Cartographic);E.Scene.computeVertexNormals=e,E.Scene.extend2Earth=p;}};function Ut(e,d){if(d){new xt(e,d);let n=new zt(d),a=new Ht(d),i=new Wt(d,n);d.Scene.RectangularSensorPrimitive=n,d.Scene.RectangularSensorGraphics=a,d.Scene.RectangularSensorVisualizer=i;var p=d.DataSourceDisplay,r=p.defaultVisualizersCallback;p.defaultVisualizersCallback=function(o,h,s){var l=s.entities,u=r(o,h,s);return u.concat([new i(o,l)])};}}function Vn(){let e=null,d=function(p,r){p&&(this._viewer=p,e=r,this._customPluginLayer=new e.CustomDataSource("_customPluginLayer"),new Ut(p,r),p&&p.dataSources.add(this._customPluginLayer));};return d.prototype={createRectangularSensorGraphics:function(p){if(this._customPluginLayer&&p){let r=new e.HeadingPitchRoll(e.Math.toRadians(p.heading||90),e.Math.toRadians(p.pitch||0),e.Math.toRadians(p.roll||0)),n=p.position;return this._customPluginLayer.entities.add({position:n,orientation:e.Transforms.headingPitchRollQuaternion(n,r),rectangularSensor:new e.Scene.RectangularSensorGraphics({radius:p.radius||1e5,xHalfAngle:e.Math.toRadians(p.xHalfAngle||45),yHalfAngle:e.Math.toRadians(p.yHalfAngle||45),material:p.material||new e.Color(1,0,1,.4),lineColor:p.lineColor||new e.Color(1,0,1,1),showScanPlane:this._objHasOwnProperty(p,"showScanPlane",true),showSectorLines:this._objHasOwnProperty(p,"showSectorLines",true),showLateralSurfaces:this._objHasOwnProperty(p,"showLateralSurfaces",true),modelMatrix:p.modelMatrix||new e.Matrix4,scanPlaneColor:p.scanPlaneColor||new e.Color(1,0,1,1),scanPlaneMode:p.scanPlaneMode||"vertical",scanPlaneRate:p.scanPlaneRate||3,showThroughEllipsoid:this._objHasOwnProperty(p,"showThroughEllipsoid",false),show:this._objHasOwnProperty(p,"show",true)})})}},_objHasOwnProperty(p,r,n){return p.hasOwnProperty(r)?p.field:n},createSatelliteCoverageSimulationGraphics:function(p){if(p)return new e.Scene.SatelliteCoverageSimulation(this._viewer,{position:p.position,angle1:p.angle1||30,angle2:p.angle2||45,areaType:p.areaType||2,rotation:{heading:e.Math.toRadians(p.heading||0),pitch:e.Math.toRadians(p.pitch||0),roll:e.Math.toRadians(p.roll||0)},color:p.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(p){if(p)return new e.Scene.ConeSensorPrimitive(this._viewer,{position:p.position,angle:p.angle||80,radius:p.radius||7e5,rotation:{heading:e.Math.toRadians(p.heading||0),pitch:e.Math.toRadians(p.pitch||40),roll:e.Math.toRadians(p.roll||0)},color:p.color||{red:1,green:0,blue:0,alpha:.4},lineColor:p.lineColor||{red:1,green:1,blue:1,alpha:.9}})}},d}var Ze=te(Vn);function Fn(){let e=null,d={},p,r,n="move",a=null,i=function(o,h){o&&(this._viewer=o,a=o,e=h,ae(this),this._installFileDragDropHandler());};return i.prototype={_installFileDragDropHandler(){function o(s,l){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=l,this._parentDiv=s,s.appendChild(u),this.fileDragDropCallBack=void 0,this.callBackParms=void 0;}o.prototype.startuploadfile=function(){var s=this,l=s._dragBox,u=null;document.ondragover=function(){clearTimeout(u),u=setTimeout(function(){l.innerHTML="\u8BF7\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF";},200);},l.ondragenter=function(){l.innerHTML="\u8BF7\u91CA\u653E\u9F20\u6807";},l.ondragover=function(){return false},l.ondragleave=function(){l.innerHTML="\u8BF7\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF";},l.ondrop=function(c){c.preventDefault();var m=c.dataTransfer.files[0],y=new FileReader;return y.readAsText(m,"UTF-8"),y.onload=function(){var f=JSON.parse(this.result);s.fileDragDropCallBack&&s.fileDragDropCallBack(s.callBackParms,f,s._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 h(s){var l=new o(document.querySelector(".cesium-viewer"),s);Object.defineProperties(s,{fileDragDropMixin:{get:function(){return l}}});}e.Scene.FileDragDropMixin=h;},async showLoadDataToScenePanel(o){let h=await _e();if(o=o||{},o){let s=new h.GUI,l=this._viewer,u=s.addFolder("\u52A0\u8F7D\u6570\u636E\u6587\u4EF6"),c=y=>{let f=document.createElement("input");f.type="file",f.className="datgui_upload",f.onchange=function(){typeof y=="function"&&f.files.length&&y(URL.createObjectURL(f.files[0]));},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(f),f.click();},m={point:()=>{c(y=>{var f=e.GeoJsonDataSource.load(y);f.then(function(g){l.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};}l.flyTo(g);});});},polyline:()=>{c(y=>{var f=e.GeoJsonDataSource.load(y);f.then(function(g){l.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)});}l.flyTo(g);});});},polygon:()=>{c(y=>{var f=e.GeoJsonDataSource.load(y);f.then(function(g){l.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);}l.flyTo(g);});});},model:()=>{c(y=>{l.flyTo(d3kit.createModelGraphics({position:e.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:y}));});},czml:()=>{c(y=>{l.flyTo(l.dataSources.add(e.CzmlDataSource.load(y)));});},"3dtilset":()=>{c(y=>{l.flyTo(l.scene.primitives.add(new e.Cesium3DTileset({url:y})));});}};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(o){let h=await _e();o=o||{};let s=function(){this.blackAndWhiteShow=false,this.blackAndWhiteGradations=5,this.brightnessShow=false,this.brightnessValue=.5,this.nightVisionShow=false,this.silhouette=false;},l=null,u=new s;if(o&&o.elementId){l=new h.GUI({autoPlace:false});var c=document.getElementById(o.elementId);c.appendChild(l.domElement);}else l=new h.GUI;let y=this._viewer.scene.postProcessStages,f=y.add(e.PostProcessStageLibrary.createSilhouetteStage()),g=y.add(e.PostProcessStageLibrary.createBlackAndWhiteStage()),v=y.add(e.PostProcessStageLibrary.createBrightnessStage()),A=y.add(e.PostProcessStageLibrary.createNightVisionStage());f.uniforms.color=o.silhouetteColor||e.Color.YELLOW,f.enabled=false,g.enabled=false,g.uniforms.gradations=5,v.enabled=false,v.uniforms.brightness=.5,A.enabled=false,l.add(u,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(w){g.enabled=w;}),l.add(u,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(w){g.uniforms.gradations=w;}),l.add(u,"brightnessShow").name("brightnessShow").onChange(function(w){v.enabled=w;}),l.add(u,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(w){v.uniforms.brightness=w;}),l.add(u,"nightVisionShow").name("nightVisionShow").onChange(function(w){A.enabled=w;}),l.add(u,"silhouette").name("silhouette").onChange(function(w){f.enabled=w;});},async showSceneBloomPanel(o){let h=await _e(),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;},l=null,u=new s;if(o&&o.elementId){l=new h.GUI({autoPlace:false});var c=document.getElementById(o.elementId);c.appendChild(l.domElement);}else l=new h.GUI;let m=this._viewer;l.__closeButton.innerHTML="\u6536\u7F29\u9762\u677F";let y=m.scene.postProcessStages.bloom;l.add(u,"enabled").name("bloom").onChange(function(f){y.enabled=f;}),l.add(u,"glowOnly").name("\u53D1\u5149").onChange(function(f){y.uniforms.glowOnly=f;}),l.add(u,"enabled").name("\u542F\u7528\u6A21\u7CCA").onChange(function(f){y.enabled=f;}),l.add(u,"contrast",-255,255,.01).name("\u5BF9\u6BD4\u5EA6").onChange(function(f){y.uniforms.contrast=f;}),l.add(u,"brightness",-1,1,.01).name("\u5149\u6CFD\u4EAE\u5EA6").onChange(function(f){y.uniforms.brightness=f;}),l.add(u,"delta",1,5,.01).name("\u56E0\u5B50").onChange(function(f){y.uniforms.delta=f;}),l.add(u,"sigma",1,10,.01).name("sigma").onChange(function(f){y.uniforms.sigma=f;}),l.add(u,"stepSize",.1,10).name("stepSize").onChange(function(f){y.uniforms.stepSize=f;}),l.add(u,"shadows").name("\u542F\u7528\u9634\u5F71").onChange(function(f){m.shadows=f;}),l.add(u,"highDynamicRange").name("\u9AD8\u52A8\u6001\u8303\u56F4").onChange(function(f){m.scene.highDynamicRange=f;}),l.add(u,"gamma",1,10,.01).name("\u4F3D\u9A6C\u4EAE\u5EA6").onChange(function(f){m.scene.gamma=f;});},async showPrimitiveMatrixPanel(o){let h=await _e(),s=o.primitives._delegate||o.primitives,l=o.primitives;this._viewer;let m=null;if(o&&o.elementId){m=new h.GUI({autoPlace:false});var y=document.getElementById(o.elementId);y.appendChild(m.domElement);}else m=new h.GUI;let g={height:100},v=m.addFolder("\u79BB\u5730\u9AD8\u5EA6");v.add(g,"height",0,1e3,1).onChange(function(_){var S=l.boundingSphere,L=e.Cartographic.fromCartesian(S.center),G=e.Cartesian3.fromRadians(L.longitude,L.latitude,0),R=e.Cartesian3.fromRadians(L.longitude,L.latitude,_),z=e.Cartesian3.subtract(R,G,new e.Cartesian3);l.modelMatrix=e.Matrix4.fromTranslation(z);}),v.open();let A=m.addFolder("\u7F29\u653E\u5927\u5C0F"),w={"m+Scale":()=>{s.readyPromise.then(_=>{let S=_.root.transform;e.Matrix4.multiplyByUniformScale(S,1.2,S),_.root.transform=S;});},"m-Scale":()=>{s.readyPromise.then(_=>{let S=_.root.transform;e.Matrix4.multiplyByUniformScale(S,.8,S),_.root.transform=S;});}};A.add(w,"m+Scale"),A.add(w,"m-Scale"),A.open();let P={"x+Axis":()=>{let _=e.Matrix4.fromTranslation(new e.Cartesian3(20,0,0));e.Matrix4.multiply(s.modelMatrix,_,s.modelMatrix);},"x-Axis":()=>{let _=e.Matrix4.fromTranslation(new e.Cartesian3(-20,0,0));e.Matrix4.multiply(s.modelMatrix,_,s.modelMatrix);},"y+Axis":()=>{let _=e.Matrix4.fromTranslation(new e.Cartesian3(0,20,0));e.Matrix4.multiply(s.modelMatrix,_,s.modelMatrix);},"y-Axis":()=>{let _=e.Matrix4.fromTranslation(new e.Cartesian3(0,-20,0));e.Matrix4.multiply(s.modelMatrix,_,s.modelMatrix);},"z+Axis":()=>{let _=e.Matrix4.fromTranslation(new e.Cartesian3(0,0,20));e.Matrix4.multiply(s.modelMatrix,_,s.modelMatrix);},"z-Axis":()=>{let _=e.Matrix4.fromTranslation(new e.Cartesian3(0,0,-20));e.Matrix4.multiply(s.modelMatrix,_,s.modelMatrix);}},x=m.addFolder("\u77E9\u9635\u5E73\u79FB");x.add(P,"x+Axis"),x.add(P,"x-Axis"),x.add(P,"y+Axis"),x.add(P,"y-Axis"),x.add(P,"z+Axis"),x.add(P,"z-Axis"),x.open();let b={x:0,y:0,z:0},M={"x+Axis":()=>{b.x+=15,s.readyPromise.then(_=>{let S=e.Matrix3.fromRotationX(e.Math.toRadians(b.x)),L=e.Matrix4.fromRotationTranslation(S),G=e.Transforms.eastNorthUpToFixedFrame(_.boundingSphere.center);e.Matrix4.multiply(G,L,G),_._root.transform=G;});},"x-Axis":()=>{b.x-=15,s.readyPromise.then(_=>{let S=e.Matrix3.fromRotationX(e.Math.toRadians(b.x)),L=e.Matrix4.fromRotationTranslation(S),G=e.Transforms.eastNorthUpToFixedFrame(_.boundingSphere.center);e.Matrix4.multiply(G,L,G),_._root.transform=G;});},"y+Axis":()=>{b.y+=15,s.readyPromise.then(_=>{let S=e.Matrix3.fromRotationY(e.Math.toRadians(b.y)),L=e.Matrix4.fromRotationTranslation(S),G=e.Transforms.eastNorthUpToFixedFrame(_.boundingSphere.center);e.Matrix4.multiply(G,L,G),_._root.transform=G;});},"y-Axis":()=>{b.y-=15,s.readyPromise.then(_=>{let S=e.Matrix3.fromRotationY(e.Math.toRadians(b.y)),L=e.Matrix4.fromRotationTranslation(S),G=e.Transforms.eastNorthUpToFixedFrame(_.boundingSphere.center);e.Matrix4.multiply(G,L,G),_._root.transform=G;});},"z+Axis":()=>{b.z+=15,s.readyPromise.then(_=>{let S=e.Matrix3.fromRotationZ(e.Math.toRadians(b.z)),L=e.Matrix4.fromRotationTranslation(S),G=e.Transforms.eastNorthUpToFixedFrame(_.boundingSphere.center);e.Matrix4.multiply(G,L,G),_._root.transform=G;});},"z-Axis":()=>{b.z-=15,s.readyPromise.then(_=>{let S=e.Matrix3.fromRotationZ(e.Math.toRadians(b.z)),L=e.Matrix4.fromRotationTranslation(S),G=e.Transforms.eastNorthUpToFixedFrame(_.boundingSphere.center);e.Matrix4.multiply(G,L,G),_._root.transform=G;});}},k=m.addFolder("\u65CB\u8F6C\u77E9\u9635");if(k.add(M,"x+Axis"),k.add(M,"x-Axis"),k.add(M,"y+Axis"),k.add(M,"y-Axis"),k.add(M,"z+Axis"),k.add(M,"z-Axis"),k.open(),o.cb){let _=m.addFolder("\u83B7\u53D6\u8C03\u6574\u540E\u7684\u6A21\u578B\u77E9\u9635");_.add({getModelMaterix:()=>{s.readyPromise.then(S=>{let L=S.root.transform;o.cb({modelTransformMatrix:e.Matrix4.toArray(L),modelMatrix:e.Matrix4.toArray(l.modelMatrix)});});}},"getModelMaterix").name("\u83B7\u53D6\u6A21\u578B\u77E9\u9635"),_.open();}m.__closeButton.innerHTML="\u6536\u7F29\u9762\u677F";},showLayerParamPanel:async function(o,h){let s=await _e();if(o){let m=null;if(h&&h.elementId){m=new s.GUI({autoPlace:false});var l=document.getElementById(h.elementId);l.appendChild(m.domElement);}else m=new s.GUI;var u=new(function(){this.alpha=o.alpha,this.brightness=o.brightness,this.contrast=o.contrast,this.gamma=o.gamma,this.hue=o.hue,this.dayAlpha=o.dayAlpha,this.nightAlpha=o.nightAlpha,this.saturation=o.saturation;}),c=m.addFolder("\u56FE\u5C42\u8C03\u6574");c.add(u,"alpha",0,1,.05).name("\u900F\u660E\u5EA6").onChange(function(y){o.alpha=y;}),c.add(u,"brightness",0,5,.05).name("\u4EAE\u5EA6").onChange(function(y){o.brightness=y;}),c.add(u,"contrast",0,5,.05).name("\u5BF9\u6BD4").onChange(function(y){o.contrast=y;}),c.add(u,"gamma",0,5,.05).name("\u4F3D\u9A6C").onChange(function(y){o.gamma=y;}),c.add(u,"hue",0,5,.05).name("\u8272\u8C03").onChange(function(y){o.hue=y;}),c.add(u,"dayAlpha",0,1,.05).name("\u767D\u5929\u900F\u660E").onChange(function(y){o.dayAlpha=y;}),c.add(u,"nightAlpha",0,1,.05).name("\u591C\u665A\u900F\u660E").onChange(function(y){o.nightAlpha=y;}),c.add(u,"saturation",0,5,.05).name("\u9971\u548C").onChange(function(y){o.saturation=y;}),c.open();}},showLayerSwitchPanel:async function(o,h,s){let l=await _e();if(o&&o.length){let g=null;if(h&&h.elementId){g=new l.GUI({autoPlace:false});var u=document.getElementById(h.elementId);u.appendChild(g.domElement);}else g=new l.GUI;var c=new(function(){o.forEach(v=>{this[v.id]=v.show;});}),m=g.addFolder("\u56FE\u5C42\u5207\u6362");o.forEach(v=>{m.add(c,v.id).name(v.name).onChange(function(A){v.show=A,s&&s({key:v.id,val:A});});});var y=new(function(){o.forEach(v=>{this[v.id]=v.alpha;});}),f=g.addFolder("\u900F\u660E\u5EA6");o.forEach(v=>{f.add(y,v.id,0,1,.05).name(v.name).onChange(function(A){v.alpha=A;});}),m.open(),f.open();}},showSceneEffectEditPanel:async function(o){let h=await _e();if(o=o||{},h.GUI&&this._viewer.scene.colorCorrection){var s=new h.GUI,l=this._viewer;l.scene.lightSource.ambientLightColor=o.ambientLightColor||new e.Color(.3,.3,.3,1),l.scene.colorCorrection.show=o.colorCorrection||false,l.scene.colorCorrection.saturation=o.saturation||3.1,l.scene.colorCorrection.brightness=o.brightness||1.8,l.scene.colorCorrection.contrast=o.contrast||1.2,l.scene.colorCorrection.hue=o.hue||0,l.scene.bloomEffect.show=o.bloomEffect||false,l.scene.hdrEnabled=o.hdrEnabled||true,l.scene.bloomEffect.threshold=o.threshold||1,l.scene.bloomEffect.bloomIntensity=o.bloomIntensity||2;var u=new(function(){this.bloomEffectShow=o.bloomEffect||false,this.bloomThreshold=o.threshold||1,this.bloomIntensity=o.bloomIntensity||2,this.ambientLightColor=o.ambientLightColor||.3,this.hdrEnabled=o.hdrEnabled||true,this.colorCorrectionShow=false,this.colorCorrectionSaturation=o.saturation||3.1,this.colorCorrectionBrightness=o.brightness||1.8,this.colorCorrectionContrast=o.contrast||1.2,this.colorCorrectionHue=o.hue||0;}),c=s.addFolder("\u573A\u666F\u6548\u679C");c.add(u,"bloomEffectShow").name("\u6CDB\u5149\u5F00\u5173").onChange(function(m){l.scene.bloomEffect.show=m,l.scene.bloomEffect.threshold=u.bloomThreshold,l.scene.bloomEffect.bloomIntensity=u.bloomIntensity;}),c.add(u,"bloomThreshold",0,1,.1).name("\u6CDB\u5149\u9608\u503C").onChange(function(m){l.scene.bloomEffect.threshold=m;}),c.add(u,"bloomIntensity",0,10,.1).name("\u6CDB\u5149\u5F3A\u5EA6").onChange(function(m){l.scene.bloomEffect.bloomIntensity=m;}),c.add(u,"hdrEnabled").name("HDR\u5F00\u5173").onChange(function(m){l.scene.hdrEnabled=m;}),c.add(u,"colorCorrectionShow").name("\u989C\u8272\u6821\u6B63").onChange(function(m){l.scene.colorCorrection.show=m;}),c.add(u,"colorCorrectionSaturation",0,5,.1).name("\u9971\u548C\u5EA6").onChange(function(m){l.scene.colorCorrection.saturation=m;}),c.add(u,"colorCorrectionBrightness",0,5,.1).name("\u4EAE\u5EA6").onChange(function(m){l.scene.colorCorrection.brightness=m;}),c.add(u,"colorCorrectionContrast",0,5,.1).name("\u5BF9\u6BD4\u5EA6").onChange(function(m){l.scene.colorCorrection.contrast=m;}),c.add(u,"colorCorrectionHue",0,5,.1).name("\u8272\u8C03").onChange(function(m){l.scene.hdrEnabled=m;}),c.add(u,"colorCorrectionHue",0,1,.1).name("\u73AF\u5883\u5149").onChange(function(m){l.scene.lightSource.ambientLightColor=new e.Color(m,m,m,1);}),c.open();}},showEntityOrientationEditPanel:async function(o={}){let h=await _e();if(o.entity){let y=o.entity;var s=new h.GUI;if(o&&o.elementId){s=new h.GUI({autoPlace:false});var l=document.getElementById(o.elementId);l.appendChild(s.domElement);}else s=new h.GUI;var u=new(function(){this.heading=360,this.pitch=1,this.roll=1;}),c=s.addFolder("\u5B9E\u4F53\u59FF\u6001\u8C03\u6574"),m=this;c.add(u,"heading",0,360,1).name("\u89D2\u5EA6").onChange(function(f){u.heading=f;let g=e.Transforms.headingPitchRollQuaternion(y.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(u.heading),e.Math.toRadians(u.pitch),e.Math.toRadians(u.roll)));y.orientation=g,o.cb&&o.cb({orientation:g});}),c.add(u,"pitch",0,360,1).name("\u822A\u5411").onChange(function(f){u.pitch=f;let g=e.Transforms.headingPitchRollQuaternion(y.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(u.heading),e.Math.toRadians(u.pitch),e.Math.toRadians(u.roll)));y.orientation=g,o.cb&&o.cb({orientation:g});}),c.add(u,"roll",0,360,1).name("\u7FFB\u8F6C").onChange(function(f){u.roll=f;let g=e.Transforms.headingPitchRollQuaternion(y.position.getValue(m._viewer.clock.currentTime),new e.HeadingPitchRoll(e.Math.toRadians(u.heading),e.Math.toRadians(u.pitch),e.Math.toRadians(u.roll)));y.orientation=g,o.cb&&o.cb({orientation:g});}),c.open();}},definedMouseEvent({targetEntity:o,ctrlFlag:h}){r=o,d=h,this.bindHandleEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp});},defMouseMove(o){if(d.leftDown&&p){let h=a.camera.getPickRay(o.endPosition),s=a.scene.globe.pick(h,a.scene);if(document.body.style.cursor="pointer",p&&p.id&&n==="move"){let l=e.JulianDate.fromDate(new Date),u=r.position.getValue(l),c=e.Cartographic.fromCartesian(u),m=Number(c.height.toFixed(3));r.position=new e.CallbackProperty(()=>{let y=a.scene.globe.ellipsoid.cartesianToCartographic(s),f=e.Math.toDegrees(y.longitude),g=e.Math.toDegrees(y.latitude);return e.Cartesian3.fromDegrees(f,g,m)},false);}else if(p&&p.id&&n==="rotate"){let l=e.JulianDate.fromDate(new Date),u=r.position.getValue(l),c=a.scene.camera.pickEllipsoid(o.startPosition),m=a.scene.camera.pickEllipsoid(o.endPosition),y=e.Cartesian3.subtract(u,m,new e.Cartesian3),f=e.Cartesian3.normalize(y,new e.Cartesian3),g=e.Cartesian3.subtract(c,u,new e.Cartesian3),v=e.Cartesian3.subtract(m,u,new e.Cartesian3),A=e.Cartesian3.angleBetween(g,v),C=e.Quaternion.fromAxisAngle(f,A*100);r.orientation=C;}}},defLeftDown(o){p=a.scene.pick(o.position),e.defined(p)&&n?(d.selected=true,d.leftDown=true):d.selected=false;},defMouseWheel(o){if(p&&p.id&&n==="scale"){let h=e.JulianDate.fromDate(new Date),s=r.box.dimensions.getValue(h),l=o>0?2:.5;r.box.dimensions=new e.CallbackProperty(()=>e.Cartesian3.multiplyByScalar(s,l,new e.Cartesian3),false);}},defLeftUp(o){d.leftDown=false,document.body.style.cursor="default";},manualMoveModel:function(o){n=o,this._viewer.scene.screenSpaceCameraController.enableRotate=false,this._viewer.scene.screenSpaceCameraController.enableZoom=true;},manualRotateModel:function(o){n=o,this._viewer.scene.screenSpaceCameraController.enableRotate=false,this._viewer.scene.screenSpaceCameraController.enableZoom=true;},manualScaleModel:function(o){n=o,this._viewer.scene.screenSpaceCameraController.enableZoom=false;}},i}var $e=te(Fn);function zn(e,d){var i,o,h,s,l;if(!d||typeof d!="object")return;let p=d;if(typeof p.x=="number"&&typeof p.y=="number"&&typeof p.z=="number"&&Number.isFinite(p.x)&&Number.isFinite(p.y)&&Number.isFinite(p.z))return e.Cartesian3.clone(p);let r,n,a;if(Array.isArray(d)?(r=Number(d[0]),n=Number(d[1]),a=d.length>2?Number(d[2]):0):(r=Number((o=(i=p.lng)!=null?i:p.lon)!=null?o:p.longitude),n=Number((h=p.lat)!=null?h:p.latitude),a=Number((l=(s=p.alt)!=null?s:p.height)!=null?l:0)),!(!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(a)))return e.Cartesian3.fromDegrees(r,n,a)}function St(e){var p,r,n,a,i;let d=[];if(!Array.isArray(e))return d;for(let o of e){if(!o||typeof o!="object")continue;let h=o;if(typeof h.x=="number"&&typeof h.z=="number")continue;let s=Number((r=(p=h.lng)!=null?p:h.lon)!=null?r:h.longitude),l=Number((n=h.lat)!=null?n:h.latitude),u=Number((i=(a=h.alt)!=null?a:h.height)!=null?i:0);!Number.isFinite(s)||!Number.isFinite(l)||!Number.isFinite(u)||d.push(s,l,u);}return d}function Nt(e,d,p=.001){let r=[];if(!Array.isArray(d))return r;for(let n=0;n<d.length;n++){let a=zn(e,d[n]);if(!a)continue;let i=r[r.length-1];i&&e.Cartesian3.distance(i,a)<p||r.push(a);}return r}function Xt(e,d,p){let r=e.Cartesian3.subtract(p,d,{x:0,y:0,z:0});if(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.z)||e.Cartesian3.magnitudeSquared(r)<1e-6)return null;let n=e.Cartesian3.normalize(r,{x:0,y:0,z:0}),a=e.Transforms.rotationMatrixFromPositionVelocity(d,n,e.Ellipsoid.WGS84);return e.Quaternion.fromRotationMatrix(a)}function jt(e,d,p,r=()=>new e.JulianDate,n=1/60){let a=d.getValue(p);if(!a)return null;let i=e.JulianDate.addSeconds(p,n,r()),o=d.getValue(i);if(o){let l=Xt(e,a,o);if(l)return l}let h=e.JulianDate.addSeconds(p,-n,r()),s=d.getValue(h);return s?Xt(e,s,a):null}var he=3.141592653589793,ct=6378245,ut=.006693421622965943;function Hn(){let e=null,p=function(r,n,a){if(r){this._viewer=r,e=n,this._queryRouteKey="8dc49b1fa65a79d306ef12dae4229842",this._pluginLayer=new e.CustomDataSource("pluginLayer"),r&&r.dataSources.add(this._pluginLayer);let i=this._pluginLayer;ae(this),ie(this,()=>{de(this.droneEntity),this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._pluginLayer===i&&(this._pluginLayer=void 0));}),this._installPlugin();}};return p.routeQueryType={DRIVE:"drive",WALK:"walk",CYCLE:"cycle"},p.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan(),this._installClusterLayer(),this._installBar3DLayer();},_installTerrainClipPlan:function(){let r=e.defaultValue||xe;function n(a,i){this.viewer=a,this.options=i||{},this._positions=i.positions,this._height=this.options.height||0,this.bottomImg=i.bottomImg,this.wallImg=i.wallImg,this.splitNum=r(i.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 i=[],o=a.length-1,h=new e.Cartesian3,s=e.Cartesian3.subtract(a[0],a[1],h);s=s.x>0,this.excavateMinHeight=9999;for(var l=0;l<o;l++){var u=(l+1)%o,c=e.Cartesian3.midpoint(a[l],a[u],new e.Cartesian3),m=e.Cartographic.fromCartesian(a[l]),y=this.viewer.scene.globe.getHeight(m)||m.height;y<this.excavateMinHeight&&(this.excavateMinHeight=y);var f,g=e.Cartesian3.normalize(c,new e.Cartesian3);f=s?e.Cartesian3.subtract(a[l],c,new e.Cartesian3):e.Cartesian3.subtract(a[u],c,new e.Cartesian3),f=e.Cartesian3.normalize(f,f);var v=e.Cartesian3.cross(f,g,new e.Cartesian3);v=e.Cartesian3.normalize(v,v);var A=new e.Plane(v,0),w=e.Plane.getPointDistance(A,c);i.push(new e.ClippingPlane(v,w));}this.viewer.scene.globe.clippingPlanes=new e.ClippingPlaneCollection({planes:i,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 i=this.splitNum,o=a.length;if(o!=0){for(var h=this.excavateMinHeight-this.height,s=[],l=[],u=[],c=0;c<o;c++){var m=c==o-1?0:c+1,y=e.Cartographic.fromCartesian(a[c]),f=e.Cartographic.fromCartesian(a[m]),g=[y.longitude,y.latitude],v=[f.longitude,f.latitude];c==0&&(u.push(new e.Cartographic(g[0],g[1])),l.push(e.Cartesian3.fromRadians(g[0],g[1],h)),s.push(e.Cartesian3.fromRadians(g[0],g[1],0)));for(var A=1;A<=i;A++){var w=e.Math.lerp(g[0],v[0],A/i),C=e.Math.lerp(g[1],v[1],A/i);c==o-1&&A==i||(u.push(new e.Cartographic(w,C)),l.push(e.Cartesian3.fromRadians(w,C,h)),s.push(e.Cartesian3.fromRadians(w,C,0)));}}this.wellData={lerp_pos:u,bottom_pos:l,no_height_top:s};}},n.prototype._createWell=function(a){if(this.viewer.terrainProvider._layers){var i=this;this._createBottomSurface(a.bottom_pos),e.sampleTerrainMostDetailed(this.viewer.terrainProvider,a.lerp_pos).then(function(o){for(var h=o.length,s=[],l=0;l<h;l++){var u=e.Cartesian3.fromRadians(o[l].longitude,o[l].latitude,o[l].height);s.push(u);}i._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 i=5e6,o=null;for(let h=0;h<a.length;h++){let s=a[h].z;s<i&&(i=s,o=this._ellipsoidToLonLat(a[h]));}return o.altitude},n.prototype._ellipsoidToLonLat=function(a){let i=this.viewer.scene.globe.ellipsoid,o=new e.Cartesian3(a.x,a.y,a.z),h=i.cartesianToCartographic(o),s=e.Math.toDegrees(h.latitude),l=e.Math.toDegrees(h.longitude),u=h.height;return {longitude:l,latitude:s,altitude:u}},n.prototype._createBottomSurface=function(a){if(a.length){let h=this._getMinHeight(a),s=[];for(let c=0;c<a.length;c++){let m=this._ellipsoidToLonLat(a[c]);s.push(m.longitude),s.push(m.latitude),s.push(h);}let l=new e.PolygonGeometry({polygonHierarchy:new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:true}),u=e.PolygonGeometry.createGeometry(l);var i=new e.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),o=new e.MaterialAppearance({translucent:false,flat:true,material:i});this.bottomSurface=new e.Primitive({geometryInstances:new e.GeometryInstance({geometry:u}),appearance:o,asynchronous:false}),this.viewer.scene.primitives.add(this.bottomSurface);}},n.prototype._createWellWall=function(a,i){let o=this._getMinHeight(a),h=[],s=[];for(let y=0;y<i.length;y++)h.push(this._ellipsoidToLonLat(i[y]).altitude),s.push(o);let l=new e.WallGeometry({positions:i,maximumHeights:h,minimumHeights:s}),u=e.WallGeometry.createGeometry(l);var c=new e.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),m=new e.MaterialAppearance({translucent:false,flat:true,material:c});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 i=this.wellData.lerp_pos,o=[],h=i.length,s=0;s<h;s++)o.push(e.Cartesian3.fromRadians(i[s].longitude,i[s].latitude,this.excavateMinHeight-a));this.wellData.bottom_pos=o,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall);},e.Scene.TerrainClipPlan=n;},buildLightScanGraphics:function(r){if(this._viewer&&r){for(var n=this,a=function(u,c){for(var m=c.observer[0],y=c.observer[1],f=c.observer[2],g=[],v=0;v<u.length;v++){var A;v===u.length-1?A=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([m,y,f,u[v].x,u[v].y,0,u[0].x,u[0].y,0])):A=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([m,y,f,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:c.material}});g.push(w);}return g},i=function(u,c,m){var y=u.positionList,f,g,v,A,w,C,P=0,x=0;function b(M){f=y[M+1][0]-y[M][0],g=y[M+1][1]-y[M][1],v=f/u.number,A=g/u.number,x=0;}b(P),c.polygon.hierarchy=new e.CallbackProperty(function(){return Math.abs(w)>=Math.abs(f)&&Math.abs(C)>=Math.abs(g)&&(P=P+1,P===y.length-1&&(P=0),m[0]=m[0]+w,m[1]=m[1]+C,m[2]=m[2]+w,m[3]=m[3]+C,b(P)),w=x*v,C=x*A,x++,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);},o=function(u,c,m,y){let f=[],g=Math.PI/180*Math.round(360/y),v=0;for(;v<y;v++){let A=c+u*Math.sin(g*v),w=m+u*Math.cos(g*v);f.unshift({x:A,y:w});}return f},h=o(r.circle[0],r.circle[1],r.circle[2],r.circle[3]),s=a(h,r),l=0;l<s.length;l++)l!==s.length-1?i(r,s[l],[h[l].x,h[l].y,h[l+1].x,h[l+1].y]):i(r,s[l],[h[l].x,h[l].y,h[0].x,h[0].y]);return s}},buildPathRoaming:function(r){if(this._viewer&&r&&r.paths){var n=this.createGraphics(),a=Nt(e,r.paths);if(a.length<2){Ce(new me("INVALID_ARGUMENT","buildPathRoaming \u81F3\u5C11\u9700\u8981 2 \u4E2A\u6709\u6548\u4E14\u4E92\u4E0D\u91CD\u5408\u7684\u8DEF\u5F84\u70B9\u3002",{details:{received:r.paths.length,valid:a.length}}),{scope:"plugin.buildPathRoaming"});return}if(n.position=this._createSampledPosition(a),n.name=r.name||"\u8DEF\u5F84\u6F2B\u6E38",n.availability=new e.TimeIntervalCollection([new e.TimeInterval({start:this.startTime,stop:this.stopTime})]),n.orientation=this._sampleOrientation(),r.polyline){let{width:i,material:o,clampToGround:h,...s}=r.polyline;n.polyline={positions:new e.CallbackProperty(function(){return a},false),width:i||10,material:o||new e.PolylineGlowMaterialProperty({glowPower:1,color:e.Color.RED}),clampToGround:h!==false,...s};}return r.model&&(n.model=this.getModelGraphics(r.model)),r.label&&(n.label=this.getLabelGraphics(r)),r.billboard&&(n.billboard=this.getBillboardGraphics(r)),this.droneEntity=n,this._beginRoamTrace(r),this._viewer.entities.add(n)}},_beginRoamTrace(r){let n=this._roamTick;n&&(this._viewer.clock.onTick.removeEventListener(n),this._roamTick=null);let a=()=>{if(this._viewer.clock.shouldAnimate){let i=this._viewer.clock.currentTime,o=this.droneEntity.position&&this.droneEntity.position.getValue(i),h=this.droneEntity.orientation&&this.droneEntity.orientation.getValue(i);if(o&&h){let s=e.Matrix4.fromRotationTranslation(e.Matrix3.fromQuaternion(h),o),l=typeof(r==null?void 0:r.cameraOffset)=="function"?r.cameraOffset():new e.HeadingPitchRange(0,e.Math.toRadians(-20),150);this._viewer.camera.lookAtTransform(s,l);}}};this._viewer.clock.onTick.addEventListener(a),this._roamTick=a,ie(this,()=>{this._viewer.clock.onTick.removeEventListener(a),this._roamTick===a&&(this._roamTick=null);});},_createSampledPosition(r){this.startTime=e.JulianDate.now(),this.stopTime=e.JulianDate.addSeconds(this.startTime,Math.max(r.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<r.length;a++){let i=e.JulianDate.addSeconds(this.startTime,a*60,new e.JulianDate),o=r[a];n.addSample(i,o);}return n},_sampleOrientation(){let r;return new e.CallbackProperty(n=>{let a=this.droneEntity&&this.droneEntity.position;if(!a)return r;let i=jt(e,a,n);return i&&(r=i),r},false)},_installCss3Renderer:function(){if(this._viewer){let a=function(i,o){this._scratch=new e.Cartesian2,this._viewer=r,this._scene=r.scene,this._camera=r.camera,this._container=null,this._elements=i,this._isBackHide=o,this._postBuildFun=null,this._parentEleId=i.length>0&&i[0].parentEleId||"info-warp",ae(this),ie(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 r=this._viewer;a.prototype.init=function(){var i=document.createElement("div");i.className="ys-css3-container";let o=this._parentEleId,h=document.getElementById(o);h.appendChild(i),this._container=i,this._elements=this._elements.filter(m=>m.position),this._elements.forEach(function(m){i.insertAdjacentHTML("beforeend",m.element);});function s(m,y=document){return y.querySelectorAll(`.${m}`)}var l=this;l._scene.canvas.clientHeight;let c=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(){h.contains(i)&&(h.removeChild(i),l._postBuildFun&&l._scene.postRender.removeEventListener(l._postBuildFun));});});for(var y=0;y<i.children.length;y++){let v="",A=l._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(l._scene,v,c);let C=A.offset?A.offset[0]:0,P=A.offset?A.offset[1]:0;if(e.defined(c)){let x=i.children[y];if(x.style.position="absolute",x.style.zIndex=99,x.style.left=c.x+C+"px",x.style.top=c.y-x.offsetHeight+P+"px",l._isBackHide){var f=l._camera.position,g=l._scene.globe.ellipsoid.cartesianToCartographic(f).height;g+=1*l._scene.globe.ellipsoid.maximumRadius,e.Cartesian3.distance(f,v)>g?i.children[y].style.display="none":i.children[y].style.display="block";}}}},this._scene.postRender.addEventListener(this._postBuildFun);},a.prototype.remove=function(i){this._elements=this._elements.filter(function(o){o.id;}),this._container.removeChild(document.getElementById(i)),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},a.prototype.removeChild=function(){let i=document.getElementById(this._parentEleId);i.contains(this._container)&&i.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},a.prototype.close=function(){let i=document.getElementById(this._parentEleId);i.contains(this._container)&&i.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun);},a.prototype.append=function(i){this._elements.push(i),this._container.insertAdjacentHTML("beforeend",i.element);},a.prototype.removeEntityLayer=function(i){this._viewer.entities.removeById(i+"_1"),this._viewer.entities.removeById(i+"_2"),this._viewer.entities.removeById(i+"_3"),this.remove(i);},a.prototype.addEntityLayer=function(i){var o=i.position[0],h=i.position[1],l=this,u=.001,c=u,m=u,y=u;setTimeout(function(P){},300);var f=e.Math.toRadians(30),g=e.Math.toRadians(30),v=i.boxHeight||300,A=i.boxHeightMax||400,w=i.boxHeightDif||10,C=true;i.boxShow?this._viewer.entities.add({id:i.id+"_1",name:"\u7ACB\u65B9\u4F53\u76D2\u5B50",position:new e.CallbackProperty(function(){return v=v+w,v>=A&&(v=A),e.Cartesian3.fromDegrees(o,h,v/2)},false),box:{dimensions:new e.CallbackProperty(function(){return v=v+w,v>=A&&(v=A,C&&(C=false,l.append(i,true))),new e.Cartesian3(i.boxSide||100,i.boxSide||100,v)},false),material:i.boxMaterial||e.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){l.append(i,true);},100),i.circleShow&&(i.circleSize=i.circleSize||120,this._viewer.entities.add({id:i.id+"_2",name:"\u692D\u5706",position:e.Cartesian3.fromDegrees(o,h),ellipse:{semiMinorAxis:new e.CallbackProperty(function(){return u},false),semiMajorAxis:new e.CallbackProperty(function(){return c},false),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new e.CallbackProperty(function(){return f+=.05,f},false),stRotation:new e.CallbackProperty(function(){return f+=.05,f},false),zIndex:2}}),this._viewer.entities.add({id:i.id+"_3",name:"\u692D\u5706",position:e.Cartesian3.fromDegrees(o,h),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=a;}},_installClusterLayer:function(){if(this._viewer){let h=function(u,c){return typeof u!="object"&&(u={}),Array.isArray(c)?c.slice():(Object.keys(c).forEach(m=>{let y=c[m];typeof y=="object"?u[m]=h(u[m],y):u[m]=y;}),u)},s=function(u){if(u&&u.cluserColors&&!u.clusterColors){let{cluserColors:c,...m}=u;return {...m,clusterColors:c}}return u},l=function(u={}){this.style=h(o,s(u||{})),this.layer=null,this.unClusterLayer=null,this.lastCluster=[],this.cluserCanvasImages={},this._clusterEventHandler=null,ae(this),ie(this,()=>{this.layer&&this._clusterEventHandler&&this.layer.clustering.clusterEvent.removeEventListener(this._clusterEventHandler),i&&(this.layer&&i.dataSources.remove(this.layer,true),this.unClusterLayer&&i.dataSources.remove(this.unClusterLayer,true));}),this._init();};let i=this._viewer,o={pixelRange:40,minimumClusterSize:5,image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAE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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHL+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)"}]};l.prototype._init=function(){this.layer=new e.CustomDataSource("clusterLayer"),this.unClusterLayer=new e.CustomDataSource("unClusterLayer"),i.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();},l.prototype.addDataToLayer=function(u){u.forEach(c=>{let m=new e.Entity({id:c.id?c.id:Math.random().toString(36).substring(2),props:c,position:e.Cartesian3.fromDegrees(c.position[0],c.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);});},l.prototype.manualRaiseClusterEvent=function(u=2e3){setTimeout(()=>{this.layer.clustering._cluster(1);},u);},l.prototype.setCanvasClusterEvent=function(){this._clusterEventHandler&&this.layer.clustering.clusterEvent.removeEventListener(this._clusterEventHandler);let u=(c,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(c.length);break;case 1:y=this.getCluserCanvasImage2(c.length);break}m.billboard.image=y;};this._clusterEventHandler=u,this.layer.clustering.clusterEvent.addEventListener(u);},l.prototype.unClusterFn=function(u){u.primitive.show=false,u.id.forEach(c=>{this.unClusterLayer.entities.add(c);});},l.prototype.getCluserCanvasImage=function(u){if(this.cluserCanvasImages[u])return this.cluserCanvasImages[u];let c=document.createElement("canvas"),m=12*(u+"").length+50;c.width=c.height=m;let y=c.getContext("2d");y.beginPath(),y.globalAlpha=.5,y.fillStyle=this.getCluseColor(u),y.arc(m/2,m/2,m/2-5,0,2*Math.PI),y.fill(),y.beginPath(),y.globalAlpha=.8,y.fillStyle=this.getCluseColor(u),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 f=m/2-12*u.toString().length/2;return y.fillText(u,f,m/2+7),this.cluserCanvasImages[u]=c,c},l.prototype.getCluserCanvasImage2=function(u){if(this.cluserCanvasImages[u])return this.cluserCanvasImages[u];let c=document.createElement("canvas"),m=12*(u+"").length+50;c.width=c.height=m;let y=c.getContext("2d");y.translate(m/2,m/2),y.fillStyle=this.getCluseColor(u);let f=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+f,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*u.toString().length/2;return y.fillText(u,w,m/2+7),this.cluserCanvasImages[u]=c,c},l.prototype.getCluseColor=function(u){let c=this.style.clusterColors||this.style.cluserColors||[];for(let m=0;m<c.length;m++){let y=c[m];if(u>=y.value)return y.color}},l.prototype.updateStyle=function(u){this.style=h(this.style,s(u)),this.layer.clustering.pixelRange=this.style.pixelRange,this.layer.clustering.minimumClusterSize=this.style.minimumClusterSize;},l.prototype.setType=function(u){this.style.type=u;},l.prototype.setSelectById=function(u,c){if(this.layer){let m=this.layer.entities.getById(u);m&&(m.billboard.image=c?this.style.selectImage:this.style.image);}},l.prototype.getEntityById=function(u){return this.layer.entities.getById(u)},l.prototype.clear=function(){this.cluserCanvasImages={},this.layer&&this.layer.entities.removeAll();},e.Scene.ClusterLayer=l;}},_installBar3DLayer:function(){if(this._viewer){let i=function(c,m){return typeof c!="object"&&(c={}),Array.isArray(m)?m.slice():(Object.keys(m).forEach(y=>{let f=m[y];typeof f=="object"?c[y]=i(c[y],f):c[y]=f;}),c)},u=function(c){this.barLayer=null,this.config=i(l,c||{}),this._init();};let a=this._viewer,o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFCElEQVR4AexWWUjuVRCfz12v+5L7mqKmoqaCae744oJL+qKiSQgRET710Ms1CALlopIP6oNJoiCICylCoJQhKmIppKLmVi647+un2PzO9f/xrZp1I4r78c2ZOefMnPmdOXPm/PXoX/69BvDfikBFRYVlXV3dIPM7UHV19XF9ff1QS0vLj5WVlTdVVVXyhoaG35+SVn8qAo2NjWWtra0dJiYm27u7u0kREREEsrS0tDg6OopbW1t718XFRT8gIMBgc3PTrba2dpeBHjQ1Nf3S1tbW8hCgRwHU1NTMbmxsNC4sLLx3eXlpHBcXJ5wDAPfJ1taWcnJyKDk5mXx8fMjU1JSOj4/t2Kn1zc1N0MrKShEDOuvu7n6LxzT+DwJg9OOHh4cBcObp6Un29vYUGBhI+C0tLdHOzg4BEEcCQzQ8PCx08vPzKTc3lzIyMqigoICMjIzMtre3vxNKao1OAO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D0TrdEKfTDXNa7XuxVjtCuGc2xyF6L3gJFhRt4Gpq9yNF8jOjwJe27596sJLz43b7OXD2m91+xjY5eRqcmnA4ToLjdqezeMrpPIaCc9jhch0iIGM66AR/FG2AvK2QkktzFGcgNZwVhC0u2sDivw7i6FIhPwEAAP//c8uOZAAAAAZJREFUAwAS2vhBEdJeLwAAAABJRU5ErkJggg==",l={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)}};u.prototype._init=function(){this.barLayer=new e.CustomDataSource("threeDimensionalBarLayer"),a.dataSources.add(this.barLayer);},u.prototype._findWeight=function(c){let m=Math.max(...c),y=Math.min(...c);return {max:m,min:y}},u.prototype._limitNumberWithinRange=function(c,m,y){let f=m||1,g=y||20,v=parseInt(c);return Math.min(Math.max(v,f),g)},u.prototype.addDataToLayer=function(c){let{barData:m,numField:y="count",multiple:f}=c,{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,P)=>{let x=C[y],b=null;this.config.icon&&(C.iconUrl?b=C.iconUrl:b=x>=g?A[0]||s:x>=x*(w/x/100)?A[1]||h:A[2]||o);let M=x>w?x*(w/x/100):(w-x)/100*5,k=1;e.defined(f)?k=f:k=this._limitNumberWithinRange(M,v,w),this._add3DBarWithIcon({id:C.name+P,value:x,color:C.color,imgSrc:b,position:C.center,weight:k});});},u.prototype.clear=function(){this.barLayer&&this.barLayer.entities.removeAll();},u.prototype._add3DBarWithIcon=function({id:c,value:m,color:y,imgSrc:f,position:g,weight:v=1}){let A=this,w=A.barLayer.entities.getById(c+"-icon");w&&A.barLayer.entities.remove(w);let C=A.config.boxWidth,P=A.config.boxDepth,x=m*v,b=0,M=0,k=null;y instanceof e.Color?k=y:k=e.Color.fromCssColorString(y).withAlpha(.85),A.barLayer.entities.add({id:c+"-bar",name:"3DBar",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],M/2)},false),box:{dimensions:new e.CallbackProperty(function(){return new e.Cartesian3(C,P,M)},false),material:k,outline:false},show:true});let _=null;y instanceof e.Color?_=y:_=e.Color.fromCssColorString(y).withAlpha(.7),A.config.labelShow&&A.barLayer.entities.add({id:c+"-label",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],M+3e3)},false),label:{text:m+"",backgroundColor:_,...A.config.label},show:true}),A.config.icon&&A.barLayer.entities.add({id:c+"-icon",position:new e.CallbackProperty(function(){return e.Cartesian3.fromDegrees(g[0],g[1],M+22e3)},false),billboard:{image:f,...A.config.billboard},show:true});function S(){M=b+=A.config.duration,(A.config.loop||b<x)&&requestAnimationFrame(S);}S();},e.Scene.ThreeDimensionalBar=u;}},transformJD(r,n){var a=300+r+2*n+.1*r*r+.1*r*n+.1*Math.sqrt(Math.abs(r));return a+=(20*Math.sin(6*r*he)+20*Math.sin(2*r*he))*2/3,a+=(20*Math.sin(r*he)+40*Math.sin(r/3*he))*2/3,a+=(150*Math.sin(r/12*he)+300*Math.sin(r/30*he))*2/3,a},transformWD(r,n){var a=-100+2*r+3*n+.2*n*n+.1*r*n+.2*Math.sqrt(Math.abs(r));return a+=(20*Math.sin(6*r*he)+20*Math.sin(2*r*he))*2/3,a+=(20*Math.sin(n*he)+40*Math.sin(n/3*he))*2/3,a+=(160*Math.sin(n/12*he)+320*Math.sin(n*he/30))*2/3,a},gcj2wgs(r){var n=Number(r[0]),a=Number(r[1]),i=this.transformWD(n-105,a-35),o=this.transformJD(n-105,a-35),h=a/180*he,s=Math.sin(h);s=1-ut*s*s;var l=Math.sqrt(s);i=i*180/(ct*(1-ut)/(s*l)*he),o=o*180/(ct/l*Math.cos(h)*he);var u=a+i,c=n+o,m=n*2-c,y=a*2-u;return m=Number(m.toFixed(6)),y=Number(y.toFixed(6)),[m,y]},wgs2gcj(r){var n=Number(r[0]),a=Number(r[1]),i=this.transformWD(n-105,a-35),o=this.transformJD(n-105,a-35),h=a/180*he,s=Math.sin(h);s=1-ut*s*s;var l=Math.sqrt(s);i=i*180/(ct*(1-ut)/(s*l)*he),o=o*180/(ct/l*Math.cos(h)*he);var u=a+i,c=n+o;return c=Number(c.toFixed(6)),u=Number(u.toFixed(6)),[c,u]},transformData(r,n,a){for(var i=this,o=a.paths,h=[],s=function(c){for(var m=o[c],y=[],f=[],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(P){P=P.split(","),P=i.gcj2wgs(P),y.push([P[0],P[1]]);}),f.push(w);}y.unshift(r),y.push(n),h.push({lnglats:y,instructions:f,distance:g});},l=0;l<o.length;l++)s(l);return h},_queryDrivingRoute(r,n,a,i){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 o=n.key||this._queryRouteKey;delete n.key;var h=n.origin,s=this.wgs2gcj(h),l=s[0]+","+s[1];delete n.origin;var u=n.destination,c=this.wgs2gcj(u),m=c[0]+","+c[1];delete n.destination;var y="";if(n.avoidpolygons)for(var f=0;f<n.avoidpolygons.length;f++){for(var g=n.avoidpolygons[f],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,f==n.avoidpolygons.length-1?y+=A:y+=A+"|";}delete n.avoidpolygons;var P={key:o,origin:l,destination:m,strategy:0,avoidpolygons:y,show_fields:"polyline"};P=Object.assign(P,n||{});var x=this;let b="";Object.keys(P).map(M=>{b?b+=`&${M}=${P[M]}`:b+=`?${M}=${P[M]}`;}),fetch(r+b).then(function(M){return M.json()}).then(function(M){if(M.status!="1"||M.infocode!="10000"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01"),i&&i(M);return}var k=x.transformData(h,u,M.route);a&&a(k);});},queryPathPlan(r,n,a,i){let o;r===p.routeQueryType.DRIVE?(o=n.url||"https://restapi.amap.com/v5/direction/driving",delete n.url,this._queryDrivingRoute(o,n,a,i)):r===p.routeQueryType.WALK?(o=n.url||"https://restapi.amap.com/v3/direction/walking",delete n.url,this._queryWalkCycleRoute(o,n,a,i)):r===p.routeQueryType.CYCLE?(o=n.url||"https://restapi.amap.com/v5/direction/bicycling",delete n.url,this._queryWalkCycleRoute(o,n,a,i)):alert("\u67E5\u8BE2\u53C2\u6570type \u9519\u8BEF\uFF08walk:\u6B65\u884C\uFF0Ccycle:\u9A91\u884C\uFF09\uFF01");},_queryWalkCycleRoute(r,n,a,i){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 o=n.key||this._queryRouteKey;delete n.key;var h=n.origin;this.wgs2gcj(h);var s=h[0]+","+h[1];delete n.origin;var l=n.destination;this.wgs2gcj(l);var u=l[0]+","+l[1];delete n.destination;var c={key:o,origin:s,destination:u,show_fields:"polyline"};c=Object.assign(c,n||{});var m=this;let y="";var f;Object.keys(c).map(g=>{y?y+=`&${g}=${c[g]}`:y+=`?${g}=${c[g]}`;}),fetch(r+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),i&&i(g);return}f=m.transformData(h,l,g.data),a&&a(f);}else if(g.hasOwnProperty("status")){if(g.status!="1"||g.infocode!="10000"){console.log("\u67E5\u8BE2\u5931\u8D25\uFF01",g.info),i&&i(g);return}f=m.transformData(h,l,g.route),a&&a(f);}else {console.log("\u67E5\u8BE2\u5931\u8D25,\u672A\u77E5\u9519\u8BEF\uFF01"),i&&i(g);return}});}},p}var De=te(Hn);function Wn(){let e=null,p=null;async function r(){return p||(p=await Lt()),p}let n=function(s,l,u){if(s){this._viewer=s,e=l,this._analysisLayer=new e.CustomDataSource("analysisLayer"),Le(ve,Q),Le(ue,Q),this.$math3d=new ve(s,l),this.$graphics=new ue(s,l),s&&s.dataSources.add(this._analysisLayer);let c=this._analysisLayer,m=this.$graphics,y=this.$math3d;ae(this),ie(this,()=>{de(m),de(y),this._viewer&&c&&(this._viewer.dataSources.remove(c,true),this._analysisLayer===c&&(this._analysisLayer=void 0));});}};n.prototype={createVisibilityAnalysis:function(s){s=s||{};var l=this;l.drawLineGraphics({type:"straightLine",clampToGround:false,callback:function(u,c){var m=new a({positions:u,that:l});l._graphicsLayer&&l._graphicsLayer.entities.remove(c),typeof s.callback=="function"&&s.callback(m);}});},createLookAroundAnalysis:function(s){if(s=s||{},this._viewer&&s){var l=this;l.drawCircleGraphics({callback:function(u,c){l._drawLayer.entities.remove(c);let m=new i({that:l,radius:u.radius,center:u.center});typeof s.callback=="function"&&s.callback(m);}});}},createVisualFieldAnalysis:function(s){if(s=s||{},this._viewer&&s){var l=this,u=null;l.bindHandleEvent({leftClick:(function(m,y){var f=l._viewer.scene.pickPosition(m.position);f&&(e.defined(u)?(y.destroy(),y=null):(u=new e.Scene.ShadowPrimitive({scene:l._viewer.scene,viewerPosition:f}),l._analysisLayer._primitives.add(u)));}),mouseMove:(function(m){var y=l._viewer.scene.pickPosition(m.endPosition);y&&u&&u.setPoseByTargetPoint(y);})});}},createClipPlanAnalysis:function(s){if(s=s||{},this._viewer&&s){var l=this,u=s.height||30,c=s.splitNum||50,m=s.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",y=s.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg";l.drawPolygonGraphics({callback:function(f,g){l._drawLayer.entities.remove(g);let v=e.Cartesian3.fromDegreesArrayHeights(St(f)),A=new e.Scene.TerrainClipPlan(l._viewer,{height:u,splitNum:c,wallImg:m,bottomImg:y});A.updateData(v),typeof s.callback=="function"&&s.callback(A);}});}},createSubmergedAnalysis:function(s){if(s=s||{},this._viewer&&s){var l=this,u=s.maxH||15,c=s.speed||1,m=s.interval||10,y=s.matrialUrl||this.getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png";l.drawPolygonGraphics({height:1,callback:function(f,g){if(!l._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+c,A>=u&&(A=u,clearTimeout(w)),v.polygon.extrudedHeight=A;},m);},2e3);}}});}},createSlopeAnalysis:function(s){s=s||{};var l=this;this._viewer&&s&&l.drawLineGraphics({type:"straightLine",clampToGround:false,callback:async function(u,c){await r();var m=new o({positions:u,that:l});l._graphicsLayer&&l._graphicsLayer.entities.remove(c),typeof s.callback=="function"&&s.callback(m);}});},createCutVolumeAnalysis:function(s){if(s=s||{},this._viewer&&s){var l=this;l.drawWallGraphics({callback:function(u){var c=new h({positions:e.Cartesian3.fromDegreesArrayHeights(St(u)),that:l});typeof s.callback=="function"&&s.callback(c);}});}}};function a(s){if(s&&s.positions){let C=function(){for(let _=0;_<v.length;++_){var x=v[_].object;if(x){if(x instanceof e.Cesium3DTileFeature)y.push(x),x.oldColor=x.color.clone(),x.color=e.Color.fromAlpha(e.Color.YELLOW,x.color.alpha);else if(x.id instanceof e.Entity){var b=x.id,M=b.polygon||b.polyline;y.push(b);var k=M.material.color.getValue();M.oldColor=k.clone(),M.material=e.Color.fromAlpha(e.Color.YELLOW,k.alpha);}}c.push(u._analysisLayer.entities.add({position:v[_].position,ellipsoid:{radii:new e.Cartesian3(.8,.8,.8),material:e.Color.RED}}));}},P=function(){for(let D=v.length-1;D>=0;D--){let O=v[D];e.defined(O.position)||v.splice(D,1);}if(!e.defined(v[0].position))throw new e.DeveloperError("position is undefined");var x=v[0].position,b=e.Cartesian3.distance(x,g),M=b<5,k=[f,v[0].position],_=u._analysisLayer.entities.add({polyline:{positions:k,width:10,arcType:e.ArcType.NONE,material:new e.PolylineArrowMaterialProperty(e.Color.GREEN)}});if(m.push(_),!M){var S=[v[0].position,g],L=u._analysisLayer.entities.add({polyline:{positions:S,width:10,arcType:e.ArcType.NONE,material:new e.PolylineArrowMaterialProperty(e.Color.RED)}});m.push(L);}C();var G=e.Cartographic.fromCartesian(f),R=e.Cartographic.fromCartesian(g),z={longitude:G.longitude/Math.PI*180,latitude:G.latitude/Math.PI*180,height:G.height},U={longitude:R.longitude/Math.PI*180,latitude:R.latitude/Math.PI*180,height:R.height},K=Math.sqrt(Math.pow(f.x-g.x,2)+Math.pow(f.y-g.y,2)+Math.pow(f.z-g.z,2)),W=Math.abs(U.height-z.height),ne=Math.sqrt(Math.pow(K,2)+Math.pow(W,2)),q=M?"\u662F":"\u5426",oe="\u8D77\u70B9\u5750\u6807: "+(" ("+z.longitude.toFixed(6))+"\xB0,"+z.latitude.toFixed(6)+"\xB0,"+z.height.toFixed(2)+`)
|
|
1025
|
-
\u7EC8\u70B9\u5750\u6807: `+(" ("+
|
|
1026
|
-
\u5782\u76F4\u8DDD\u79BB: `+
|
|
1027
|
-
\u6C34\u5E73\u8DDD\u79BB: `+
|
|
1028
|
-
\u7A7A\u95F4\u8DDD\u79BB: `+
|
|
1029
|
-
\u662F\u5426\u53EF\u89C6: `+q;c&&c[0]&&(c[0].label={text:oe,showBackground:true,font:"14px monospace",fillColor:e.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:e.VerticalOrigin.BOTTOM,horizontalOrigin:e.HorizontalOrigin.LEFT});};var l=s.positions,u=s.that,c=[],m=[],y=[],f=l[0],g=l[1];c=u.$graphics.createPointsGraphics({point:true,positions:[f,g]});var v=u.$math3d.getIntersectObj(f,g,c,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;P();}a.prototype.remove=function(){};}function i(s){if(!s&&!s.center&&!s.radius&&s.that)return alert("\u6CA1\u6709\u83B7\u53D6\u5230\u5206\u6790\u53C2\u6570"),false;var l=s.that,u=this;if(!l._viewer.scene.globe.depthTestAgainstTerrain)return alert("\u8BF7\u5F00\u542F\u6DF1\u5EA6\u68C0\u6D4B"),false;var c=s.viewHeight||10,m=e.Cartographic.fromCartesian(s.center);try{var y=s.radius,f={semiMinorAxis:y,semiMajorAxis:y,rotation:0,center:s.center,granularity:Math.PI/30};let g=l.computeEllipseEdgePositions(f);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,P=l.computeInterpolateLineCartographic(m,w,C);l.computeCartographicPointsTerrainData(P||[],function(x){if(x.length>0){let b=!0,M=[],k=[];for(let _=1;_<x.length;_++){let S=!0;if(_>1){let G=new e.Cartographic(x[0].longitude,x[0].latitude,x[0].height+c);if(b)l.computeInterpolateIndexLineHeightCartographic(G,x[_],_,_-1).height>=x[_-1].height?(b=!0,S=!0):(b=!1,S=!1);else {let R=l.computeInterpolateIndexLineHeightCartographic(G,x[_],_,_-1);for(let z=0;z<R.length;z++)if(R[z].height>=x[z].height)b=!0,S=!0;else {b=!1,S=!1;break}}}let L=e.Cartesian3.fromRadians(x[_].longitude,x[_].latitude,x[_].height+1);M.push(L),S?(k.push(0),k.push(0),k.push(1),k.push(1)):(k.push(1),k.push(0),k.push(0),k.push(1));}u._pointsKSYResult=new e.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:M,Colors:k});}else alert("\u9AD8\u7A0B\u5F02\u5E38\uFF01");});}}catch(g){console.log(g);}i.prototype.remove=function(){};}function o(s){if(s&&s.positions){let f=function(g,v){for(var A=e.Cartographic.fromCartesian(g),w=[A],C=10,P=new e.Cartesian3,x=[0],b=[0],M=0,k=1;k<=C;k++){e.Cartesian3.lerp(g,v,k/C,P);var _=e.Cartographic.fromCartesian(P),S=u._viewer.scene.globe.getHeight(_);_.height=S,w.push(_);var L=w[k-1],G=e.Cartesian3.distance(e.Cartographic.toCartesian(L),e.Cartographic.toCartesian(_));b.push(b[k-1]+G),M=Math.asin((_.height-L.height)/G),x.push(Math.tan(M)*100);}var R=document.createElement("div");R.className="echart-viewer",u._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 z=p.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:b,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"\u5761\u5EA6\uFF08%\uFF09",axisLabel:{formatter:function(K){return K.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"\u5761\u5EA6",type:"line",areaStyle:{},smooth:true,data:x,markPoint:{data:[{type:"max",name:"\u6700\u5927\u503C"},{type:"min",name:"\u6700\u5C0F\u503C"}]},markLine:{data:[{type:"average",name:"\u5E73\u5747\u503C"}]}}]};return z.setOption(U),z};var l=s.positions,u=s.that,c=l[0],m=l[1];f(c,m);}o.prototype.remove=function(){};}function h(s){if(s&&s.positions&&s.that){var l=s.that,u=s.positions,c=true,m=this;g(u);}function y(v){for(var A=[],w=[],C=0;C<v.length;C++){var P=e.Cartographic.fromCartesian(v[C]);A.push(P.longitude),w.push(P.latitude);}var x=0,b=0,M=0,k=0,_=0,S=0,L=0,G=0;for(C=0;C<v.length;C++)x=A[C],b=w[C],C==v.length-1?(M=A[0],k=w[0]):(M=A[C+1],k=w[C+1]),S=x*k-M*b,_+=S,L+=(x+M)*S,G+=(b+k)*S;return _*=.5,L/=6*_,G/=6*_,new e.Cartographic(L,G)}function f(v,A,w){var C=e.Cartesian3.distance(v,A),P=e.Cartesian3.distance(A,w),x=e.Cartesian3.distance(w,v),b=(C+P+x)/2;return Math.sqrt(b*(b-C)*(b-P)*(b-x))}function g(v){var A=l._viewer.terrainProvider.availability;if(!A)return alert("\u672A\u83B7\u53D6\u5230\u5730\u5F62"),false;var C=15e3,P=Math.PI/Math.pow(2,11);P=P/64;var x=e.PolygonGeometry.fromPositions({positions:v,vertexFormat:e.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:P}),b=e.PolygonGeometry.createGeometry(x),M=0,k=0,_,S,L,G,R,z,U,K,W,ne,q,oe,D=new e.Cartesian3,O,J,$;for(let be=0;be<b.indices.length;be+=3)if(_=b.indices[be],S=b.indices[be+1],L=b.indices[be+2],$=b.attributes.position.values,D.x=$[_*3],D.y=$[_*3+1],D.z=$[_*3+2],O=e.Cartographic.fromCartesian(D),G=l._viewer.scene.globe.getHeight(O),U=e.Cartesian3.fromRadians(O.longitude,O.latitude,G),ne=e.Cartesian3.fromRadians(O.longitude,O.latitude,0),k<G&&(k=G),D.x=$[S*3],D.y=$[S*3+1],D.z=$[S*3+2],O=e.Cartographic.fromCartesian(D),R=l._viewer.scene.globe.getHeight(O),K=e.Cartesian3.fromRadians(O.longitude,O.latitude,R),q=e.Cartesian3.fromRadians(O.longitude,O.latitude,0),k<R&&(k=R),D.x=$[L*3],D.y=$[L*3+1],D.z=$[L*3+2],O=e.Cartographic.fromCartesian(D),z=l._viewer.scene.globe.getHeight(O),W=e.Cartesian3.fromRadians(O.longitude,O.latitude,z),oe=e.Cartesian3.fromRadians(O.longitude,O.latitude,0),k<z&&(k=z),J=f(ne,q,oe),M=M+J*(G-C+R-C+z-C)/3,c){var fe=[];fe.push(U),fe.push(K),fe.push(W);var Pe={polygon:{hierarchy:{positions:fe},extrudedHeight:0,perPositionHeight:true,material:e.Color.fromRandom().withAlpha(.5),outline:true,closeTop:true,closeBottom:true,outlineColor:e.Color.WHITE,outlineWidth:2}};l._analysisLayer.entities.add(Pe);}var Ve=y(v);return m._volumeLabel=l._analysisLayer.entities.add({position:e.Cartesian3.fromRadians(Ve.longitude,Ve.latitude,k+1e3),label:{text:"Cut Volume "+M.toString()+"m3"}}),k}h.prototype.remove=function(){};}return n}var et=te(Wn);var Ae={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},Un={},T={PlotUtils:Un,Constants:Ae};T.PlotUtils.distance=function(e,d){return Math.sqrt(Math.pow(e[0]-d[0],2)+Math.pow(e[1]-d[1],2))};T.PlotUtils.wholeDistance=function(e){let d=0;for(let p=0;p<e.length-1;p++)d+=T.PlotUtils.distance(e[p],e[p+1]);return d};T.PlotUtils.getBaseLength=function(e){return Math.pow(T.PlotUtils.wholeDistance(e),.99)};T.PlotUtils.mid=function(e,d){return [(e[0]+d[0])/2,(e[1]+d[1])/2]};T.PlotUtils.getCircleCenterOfThreePoints=function(e,d,p){let r=[(e[0]+d[0])/2,(e[1]+d[1])/2],n=[r[0]-e[1]+d[1],r[1]+e[0]-d[0]],a=[(e[0]+p[0])/2,(e[1]+p[1])/2],i=[a[0]-e[1]+p[1],a[1]+e[0]-p[0]];return T.PlotUtils.getIntersectPoint(r,n,a,i)};T.PlotUtils.getIntersectPoint=function(e,d,p,r){let n,a,i,o;return e[1]==d[1]?(o=(r[0]-p[0])/(r[1]-p[1]),n=o*(e[1]-p[1])+p[0],a=e[1],[n,a]):p[1]==r[1]?(i=(d[0]-e[0])/(d[1]-e[1]),n=i*(p[1]-e[1])+e[0],a=p[1],[n,a]):(i=(d[0]-e[0])/(d[1]-e[1]),o=(r[0]-p[0])/(r[1]-p[1]),a=(i*e[1]-e[0]-o*p[1]+p[0])/(i-o),n=i*a-i*e[1]+e[0],[n,a])};T.PlotUtils.getAzimuth=function(e,d){let p=0,r=Math.asin(Math.abs(d[1]-e[1])/T.PlotUtils.distance(e,d));return d[1]>=e[1]&&d[0]>=e[0]?p=r+Math.PI:d[1]>=e[1]&&d[0]<e[0]?p=Ae.TWO_PI-r:d[1]<e[1]&&d[0]<e[0]?p=r:d[1]<e[1]&&d[0]>=e[0]&&(p=Math.PI-r),p};T.PlotUtils.getAngleOfThreePoints=function(e,d,p){let r=T.PlotUtils.getAzimuth(d,e)-T.PlotUtils.getAzimuth(d,p);return 0>r?r+Ae.TWO_PI:r};T.PlotUtils.isClockWise=function(e,d,p){return (p[1]-e[1])*(d[0]-e[0])>(d[1]-e[1])*(p[0]-e[0])};T.PlotUtils.getPointOnLine=function(e,d,p){let r=d[0]+e*(p[0]-d[0]),n=d[1]+e*(p[1]-d[1]);return [r,n]};T.PlotUtils.getCubicValue=function(e,d,p,r,n){e=Math.max(Math.min(e,1),0);let a=1-e,i=e*e,o=i*e,h=a*a,s=h*a,l=s*d[0]+3*h*e*p[0]+3*a*i*r[0]+o*n[0],u=s*d[1]+3*h*e*p[1]+3*a*i*r[1]+o*n[1];return [l,u]};T.PlotUtils.getThirdPoint=function(e,d,p,r,n){let a=T.PlotUtils.getAzimuth(e,d),i=n?a+p:a-p,o=r*Math.cos(i),h=r*Math.sin(i);return [d[0]+o,d[1]+h]};T.PlotUtils.getArcPoints=function(e,d,p,r){let n,a,i=[],o=r-p;o=0>o?o+Ae.TWO_PI:o;for(let h=0;h<=Ae.FITTING_COUNT;h++){let s=p+o*h/Ae.FITTING_COUNT;n=e[0]+d*Math.cos(s),a=e[1]+d*Math.sin(s),i.push([n,a]);}return i};T.PlotUtils.getBisectorNormals=function(e,d,p,r){let n,a,i=T.PlotUtils.getNormal(d,p,r),o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=i[0]/o,s=i[1]/o,l=T.PlotUtils.distance(d,p),u=T.PlotUtils.distance(p,r),c,m,y;return o>Ae.ZERO_TOLERANCE?T.PlotUtils.isClockWise(d,p,r)?(c=e*l,m=p[0]-c*s,y=p[1]+c*h,n=[m,y],c=e*u,m=p[0]+c*s,y=p[1]-c*h,a=[m,y]):(c=e*l,m=p[0]+c*s,y=p[1]-c*h,n=[m,y],c=e*u,m=p[0]-c*s,y=p[1]+c*h,a=[m,y]):(m=p[0]+e*(d[0]-p[0]),y=p[1]+e*(d[1]-p[1]),n=[m,y],m=p[0]+e*(r[0]-p[0]),y=p[1]+e*(r[1]-p[1]),a=[m,y]),[n,a]};T.PlotUtils.getNormal=function(e,d,p){let r=e[0]-d[0],n=e[1]-d[1],a=Math.sqrt(r*r+n*n);r/=a,n/=a;let i=p[0]-d[0],o=p[1]-d[1],h=Math.sqrt(i*i+o*o);i/=h,o/=h;let s=r+i,l=n+o;return [s,l]};T.PlotUtils.getCurvePoints=function(e,d){let p,r,n,a,o=[T.PlotUtils.getLeftMostControlPoint(d)],h=0;for(h=0;h<d.length-2;h++)p=d[h],r=d[h+1],n=d[h+2],a=T.PlotUtils.getBisectorNormals(e,p,r,n),o=o.concat(a);let s=T.PlotUtils.getRightMostControlPoint(d);o.push(s);let l=[];for(h=0;h<d.length-1;h++){p=d[h],r=d[h+1],l.push(p);for(let u=0;u<Ae.FITTING_COUNT;u++){let c=T.PlotUtils.getCubicValue(u/Ae.FITTING_COUNT,p,o[2*h],o[2*h+1],r);l.push(c);}l.push(r);}return l};T.PlotUtils.getLeftMostControlPoint=function(e){let d=e[0],p=e[1],r=e[2],a=T.PlotUtils.getBisectorNormals(0,d,p,r)[0],i=T.PlotUtils.getNormal(d,p,r),o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h,s;if(o>Ae.ZERO_TOLERANCE){let l=T.PlotUtils.mid(d,p),u=d[0]-l[0],c=d[1]-l[1],y=2/T.PlotUtils.distance(d,p),f=-y*c,g=y*u,v=f*f-g*g,A=2*f*g,w=g*g-f*f,C=a[0]-l[0],P=a[1]-l[1];h=l[0]+v*C+A*P,s=l[1]+A*C+w*P;}else h=d[0]+t*(p[0]-d[0]),s=d[1]+t*(p[1]-d[1]);return [h,s]};T.PlotUtils.getRightMostControlPoint=function(e){let d=e.length,p=e[d-3],r=e[d-2],n=e[d-1],i=T.PlotUtils.getBisectorNormals(0,p,r,n)[1],o=T.PlotUtils.getNormal(p,r,n),h=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s,l;if(h>Ae.ZERO_TOLERANCE){let u=T.PlotUtils.mid(r,n),c=n[0]-u[0],m=n[1]-u[1],f=2/T.PlotUtils.distance(r,n),g=-f*m,v=f*c,A=g*g-v*v,w=2*g*v,C=v*v-g*g,P=i[0]-u[0],x=i[1]-u[1];s=u[0]+A*P+w*x,l=u[1]+w*P+C*x;}else s=n[0]+t*(r[0]-n[0]),l=n[1]+t*(r[1]-n[1]);return [s,l]};T.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;let d=[],p=e.length-1;for(let r=0;1>=r;r+=.01){let n=0,a=0;for(let i=0;p>=i;i++){let o=T.PlotUtils.getBinomialFactor(p,i),h=Math.pow(r,i),s=Math.pow(1-r,p-i);n+=o*h*s*e[i][0],a+=o*h*s*e[i][1];}d.push([n,a]);}return d.push(e[p]),d};T.PlotUtils.getBinomialFactor=function(e,d){return T.PlotUtils.getFactorial(e)/(T.PlotUtils.getFactorial(d)*T.PlotUtils.getFactorial(e-d))};T.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 d=1;for(let p=1;e>=p;p++)d*=p;return d};T.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;let d=2,p=[],r=e.length-d-1;p.push(e[0]);for(let n=0;r>=n;n++)for(let a=0;1>=a;a+=.05){let i=0,o=0;for(let h=0;d>=h;h++){let s=T.PlotUtils.getQuadricBSplineFactor(h,a);i+=s*e[n+h][0],o+=s*e[n+h][1];}p.push([i,o]);}return p.push(e[e.length-1]),p};T.PlotUtils.getQuadricBSplineFactor=function(e,d){return e==0?Math.pow(d-1,2)/2:e==1?(-2*Math.pow(d,2)+2*d+1)/2:e==2?Math.pow(d,2)/2:0};var Z={version:"1.0.0",createTime:"2018.6.19",author:"xupinhui",algorithm:{}},Ue={headHeightFactor:.25,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15},ht={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},tt={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};Z.algorithm.doubleArrow=function(e,d){let p=e,r={controlPoint:null,polygonalPoint:null},n=e.length;if(!(2>n)){if(n==2)return e;let a=p[0],i=p[1],o=p[2],h;n==3?h=Z.algorithm.getTempPoint4(a,i,o):h=p[3];let s;n==3||n==4?s=T.PlotUtils.mid(a,i):s=p[4];let l,u;T.PlotUtils.isClockWise(a,i,o)?(l=Z.algorithm.getArrowPoints(a,s,h,false),u=Z.algorithm.getArrowPoints(s,i,o,true)):(l=Z.algorithm.getArrowPoints(i,s,o,false),u=Z.algorithm.getArrowPoints(s,a,h,true));let c=l.length,m=(c-5)/2,y=l.slice(0,m),f=l.slice(m,m+5),g=l.slice(m+5,c),v=u.slice(0,m),A=u.slice(m,m+5),w=u.slice(m+5,c);v=T.PlotUtils.getBezierPoints(v);let C=T.PlotUtils.getBezierPoints(w.concat(y.slice(1)));g=T.PlotUtils.getBezierPoints(g);let P=v.concat(A,C,f,g),x=Z.algorithm.array2Dto1D(P);r.controlPoint=[a,i,o,h,s],r.polygonalPoint=d.Cartesian3.fromDegreesArray(x);}return r};Z.algorithm.threeArrow=function(e){let d=e,p={controlPoint:null,polygonalPoint:null},r=e.length;if(r>=2){if(r==2)return e;let n=d[0],a=d[1],i=d[2],o,h;r==3?(o=Z.algorithm.getTempPoint4(n,a,i),h=T.PlotUtils.mid(i,o)):(o=d[3],h=d[4]);let s;r<6?s=T.PlotUtils.mid(n,a):s=d[5];let l,u;T.PlotUtils.isClockWise(n,a,i)?(l=Z.algorithm.getArrowPoints(n,s,o,false),u=Z.algorithm.getArrowPoints(s,a,i,true)):(l=Z.algorithm.getArrowPoints(a,s,i,false),u=Z.algorithm.getArrowPoints(s,n,o,true));let c=l.length,m=(c-5)/2,y=l.slice(0,m),f=l.slice(m,m+5),g=l.slice(m+5,c),v=u.slice(0,m),A=u.slice(m,m+5),w=u.slice(m+5,c);v=T.PlotUtils.getBezierPoints(v);let C=T.PlotUtils.getBezierPoints(w.concat(y.slice(1)));g=T.PlotUtils.getBezierPoints(g);let P=v.concat(A,C,f,g),x=Z.algorithm.array2Dto1D(P);p.controlPoint=[n,a,i,o,h,s],p.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(x);}return p};Z.algorithm.array2Dto1D=function(e){let d=[];return e.forEach(function(p){d.push(p[0]),d.push(p[1]);}),d};Z.algorithm.getArrowPoints=function(e,d,p,r){let n=Ue.headHeightFactor,a=Ue.headWidthFactor,i=Ue.neckHeightFactor,o=Ue.neckWidthFactor,h=T.PlotUtils.mid(e,d),s=T.PlotUtils.distance(h,p),l=T.PlotUtils.getThirdPoint(p,h,0,.3*s,true),u=T.PlotUtils.getThirdPoint(p,h,0,.5*s,true);l=T.PlotUtils.getThirdPoint(h,l,T.Constants.HALF_PI,s/5,r),u=T.PlotUtils.getThirdPoint(h,u,T.Constants.HALF_PI,s/4,r);let c=[h,l,u,p],m=Z.algorithm.getArrowHeadPoints(c,n,a,i,o),y=m[0],f=m[4],g=T.PlotUtils.distance(e,d)/T.PlotUtils.getBaseLength(c)/2,v=Z.algorithm.getArrowBodyPoints(c,y,f,g),A=v.length,w=v.slice(0,A/2),C=v.slice(A/2,A);return w.push(y),C.push(f),w=w.reverse(),w.push(d),C=C.reverse(),C.push(e),w.reverse().concat(m,C)};Z.algorithm.getArrowHeadPoints=function(e,d,p,r,n){let a=Ue.headHeightFactor,i=Ue.headWidthFactor,h=T.PlotUtils.getBaseLength(e)*a,s=e[e.length-1],l=h*i,u=h*n,c=h*r,m=T.PlotUtils.getThirdPoint(e[e.length-2],s,0,h,true),y=T.PlotUtils.getThirdPoint(e[e.length-2],s,0,c,true),f=T.PlotUtils.getThirdPoint(s,m,T.Constants.HALF_PI,l,false),g=T.PlotUtils.getThirdPoint(s,m,T.Constants.HALF_PI,l,true),v=T.PlotUtils.getThirdPoint(s,y,T.Constants.HALF_PI,u,false),A=T.PlotUtils.getThirdPoint(s,y,T.Constants.HALF_PI,u,true);return [v,f,s,g,A]};Z.algorithm.getArrowBodyPoints=function(e,d,p,r){let n=T.PlotUtils.wholeDistance(e),i=T.PlotUtils.getBaseLength(e)*r,o=T.PlotUtils.distance(d,p),h=(i-o)/2,s=0,l=[],u=[];for(let c=1;c<e.length-1;c++){let m=T.PlotUtils.getAngleOfThreePoints(e[c-1],e[c],e[c+1])/2;s+=T.PlotUtils.distance(e[c-1],e[c]);let y=(i/2-s/n*h)/Math.sin(m),f=T.PlotUtils.getThirdPoint(e[c-1],e[c],Math.PI-m,y,true),g=T.PlotUtils.getThirdPoint(e[c-1],e[c],m,y,false);l.push(f),u.push(g);}return l.concat(u)};Z.algorithm.getTempPoint4=function(e,d,p){let r,n,a,i,o=T.PlotUtils.mid(e,d),h=T.PlotUtils.distance(o,p),s=T.PlotUtils.getAngleOfThreePoints(e,o,p);return s<T.Constants.HALF_PI?(n=h*Math.sin(s),a=h*Math.cos(s),i=T.PlotUtils.getThirdPoint(e,o,T.Constants.HALF_PI,n,false),r=T.PlotUtils.getThirdPoint(o,i,T.Constants.HALF_PI,a,true)):s>=T.Constants.HALF_PI&&s<Math.PI?(n=h*Math.sin(Math.PI-s),a=h*Math.cos(Math.PI-s),i=T.PlotUtils.getThirdPoint(e,o,T.Constants.HALF_PI,n,false),r=T.PlotUtils.getThirdPoint(o,i,T.Constants.HALF_PI,a,false)):s>=Math.PI&&s<1.5*Math.PI?(n=h*Math.sin(s-Math.PI),a=h*Math.cos(s-Math.PI),i=T.PlotUtils.getThirdPoint(e,o,T.Constants.HALF_PI,n,true),r=T.PlotUtils.getThirdPoint(o,i,T.Constants.HALF_PI,a,true)):(n=h*Math.sin(2*Math.PI-s),a=h*Math.cos(2*Math.PI-s),i=T.PlotUtils.getThirdPoint(e,o,T.Constants.HALF_PI,n,true),r=T.PlotUtils.getThirdPoint(o,i,T.Constants.HALF_PI,a,false)),r};Z.algorithm.tailedAttackArrow=function(e,d){e=Z.algorithm.dereplication(e);let p=ht.tailWidthFactor,r=ht.swallowTailFactor,n=ht.swallowTailPnt||null,a={controlPoint:null,polygonalPoint:null};if(a.controlPoint=e,!(2>e.length)){if(e.length==2)return a.polygonalPoint=e,a;let o=e,h=o[0],s=o[1];T.PlotUtils.isClockWise(o[0],o[1],o[2])&&(h=o[1],s=o[0]);let u=[T.PlotUtils.mid(h,s)].concat(o.slice(2)),c=Z.algorithm.getAttackArrowHeadPoints(u,h,s,ht),m=c[0],y=c[4],f=T.PlotUtils.distance(h,s),g=T.PlotUtils.getBaseLength(u),v=g*p*r;n=T.PlotUtils.getThirdPoint(u[1],u[0],0,v,true);let A=f/g,w=Z.algorithm.getAttackArrowBodyPoints(u,m,y,A),C=w.length,P=[h].concat(w.slice(0,C/2));P.push(m);let x=[s].concat(w.slice(C/2,C));x.push(y),P=T.PlotUtils.getQBSplinePoints(P),x=T.PlotUtils.getQBSplinePoints(x);let b=Z.algorithm.array2Dto1D(P.concat(c,x.reverse(),[n,P[0]]));a.polygonalPoint=d.Cartesian3.fromDegreesArray(b);}return a};Z.algorithm.getAttackArrowHeadPoints=function(e,d,p,r){let n=r.headHeightFactor,a=r.headTailFactor,i=r.headWidthFactor,o=r.neckWidthFactor,h=r.neckHeightFactor,s=T.PlotUtils.getBaseLength(e),l=s*n,u=e[e.length-1];s=T.PlotUtils.distance(u,e[e.length-2]);let c=T.PlotUtils.distance(d,p);l>c*a&&(l=c*a);let m=l*i,y=l*o;l>s&&(l=s);let f=l*h,g=T.PlotUtils.getThirdPoint(e[e.length-2],u,0,l,true),v=T.PlotUtils.getThirdPoint(e[e.length-2],u,0,f,true),A=T.PlotUtils.getThirdPoint(u,g,T.Constants.HALF_PI,m,false),w=T.PlotUtils.getThirdPoint(u,g,T.Constants.HALF_PI,m,true),C=T.PlotUtils.getThirdPoint(u,v,T.Constants.HALF_PI,y,false),P=T.PlotUtils.getThirdPoint(u,v,T.Constants.HALF_PI,y,true);return [C,A,u,w,P]};Z.algorithm.getAttackArrowBodyPoints=function(e,d,p,r){let n=T.PlotUtils.wholeDistance(e),i=T.PlotUtils.getBaseLength(e)*r,o=T.PlotUtils.distance(d,p),h=(i-o)/2,s=0,l=[],u=[];for(let c=1;c<e.length-1;c++){let m=T.PlotUtils.getAngleOfThreePoints(e[c-1],e[c],e[c+1])/2;s+=T.PlotUtils.distance(e[c-1],e[c]);let y=(i/2-s/n*h)/Math.sin(m),f=T.PlotUtils.getThirdPoint(e[c-1],e[c],Math.PI-m,y,true),g=T.PlotUtils.getThirdPoint(e[c-1],e[c],m,y,false);l.push(f),u.push(g);}return l.concat(u)};Z.algorithm.dereplication=function(e){let d=e[e.length-1],p=false,r=[];return r=e.filter(function(n){return n[0]!=d[0]&&n[1]!=d[1]?true:(p=true,false)}),p&&r.push(d),r};Z.algorithm.fineArrow=function(e,d,p){if(e.length<2||d.length<2)return;let r=tt.tailWidthFactor,n=tt.neckWidthFactor,a=tt.headWidthFactor,i=tt.headAngle,o=tt.neckAngle,h=[];h[0]=e,h[1]=d;let s=h[0],l=h[1],u=T.PlotUtils.getBaseLength(h),c=u*r,m=u*n,y=u*a,f=T.PlotUtils.getThirdPoint(l,s,T.Constants.HALF_PI,c,true),g=T.PlotUtils.getThirdPoint(l,s,T.Constants.HALF_PI,c,false),v=T.PlotUtils.getThirdPoint(s,l,i,y,false),A=T.PlotUtils.getThirdPoint(s,l,i,y,true),w=T.PlotUtils.getThirdPoint(s,l,o,m,false),C=T.PlotUtils.getThirdPoint(s,l,o,m,true),P=[];return P.push(f[0],f[1],w[0],w[1],v[0],v[1],l[0],l[1],A[0],A[1],C[0],C[1],g[0],g[1],s[0],s[1]),P.some(b=>isNaN(b))?"":p.Cartesian3.fromDegreesArray(P)};var we=function(e,d){this.viewer=e,this._Cesium=d,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=Z,this.tooltip=new st(e,d),this.tooltip.initTool();};we.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;};we.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 Ne=function(e,d){we.call(this,e,d),this._Cesium=d,this.type="AttackArrow",this.fillMaterial=this._Cesium.Color.RED.withAlpha(.5);};Ne.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 d=0;d<this.pointArr.length;d++)this.pointArr[d]&&this.viewer.entities.remove(this.pointArr[d]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var d=this._Cesium;let p=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,p=e.callback):p=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var r=this;this.state=1,this.handler||(this.handler=new d.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var a=nt(n.position,r.viewer);if(a){r.positions.length==0&&(r.floatPoint=r.creatPoint(a),r.floatPoint.wz=-1),r.positions.push(a);var i=r.creatPoint(a);r.positions.length>2?i.wz=r.positions.length-1:i.wz=r.positions.length,r.pointArr.push(i);}},d.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(!r.floatPoint||r.positions.length<2)){var a=nt(n.endPosition,r.viewer);a&&(r.floatPoint.position.setValue(a),r.tooltip.showAtCartesian(a,"\u53F3\u952E\u7ED3\u675F!"),r.positions.length>=2&&(d.defined(r.arrowEntity)?(r.positions.pop(),r.positions.push(a)):(r.positions.push(a),r.arrowEntity=r.showArrowOnMap(r.positions),r.arrowEntity.objId=r.objId,p&&p(r.objId))));}},d.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){var a=nt(n.position,r.viewer);if(a){for(var i=0;i<r.pointArr.length;i++)r.pointArr[i].show=false;r.floatPoint.show=false,r.viewer.entities.remove(r.floatPoint),r.floatPoint=null;var o=r.creatPoint(a);o.show=false,o.wz=r.positions.length,r.pointArr.push(o),r.handler.destroy(),r.handler=null,r.tooltip.setVisible(false),r.arrowEntity=null;}},d.ScreenSpaceEventType.RIGHT_CLICK);},createByData:function(e){var d=this._Cesium;this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var p=[],r=0;r<e.length;r++){var n=d.Cartesian3.fromDegrees(e[r][0],e[r][1]);p.push(n);}this.positions=p;for(var r=0;r<this.positions.length;r++){var a=this.creatPoint(this.positions[r]);a.show=false,a.wz=r+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 d=this,p=0;p<d.pointArr.length;p++)d.pointArr[p].show=true;this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(r){var n=d.viewer.scene.pick(r.position);if(e.defined(n)&&n.id)d.clickStep++,n.id.objId||(d.selectPoint=n.id);else {for(var a=0;a<d.pointArr.length;a++)d.pointArr[a].show=false;d.floatPoint&&(d.floatPoint.show=false),d.state=-1,d.modifyHandler.destroy(),d.modifyHandler=null,d.tooltip.setVisible(false);}if(d.clickStep==2){d.clickStep=0;var i=nt(r.position,d.viewer);if(!i)return;d.selectPoint&&(d.selectPoint.position.setValue(i),d.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(r){var n=nt(r.endPosition,d.viewer);if(n)if(d.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!"),d.selectPoint)d.selectPoint.position.setValue(n),d.positions[d.selectPoint.wz-1]=n;else return},e.ScreenSpaceEventType.MOUSE_MOVE);},getLnglats:function(){for(var e=[],d=0;d<this.positions.length;d++){var p=this.cartesianToLatlng(this.positions[d]);e.push(p);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var d=this._Cesium,p=this.viewer.entities.add({position:e,point:{pixelSize:10,color:d.Color.YELLOW}});return p.attr="editPoint",p},showArrowOnMap:function(e){var d=this._Cesium,p=this,r=function(){if(e.length<3)return null;for(var n=[],a=0;a<e.length;a++){var i=p.cartesianToLatlng(e[a]);n.push(i);}var o=p.xp.algorithm.tailedAttackArrow(n,d),h=JSON.stringify(o.polygonalPoint).indexOf("null"),s=[];return h==-1&&(s=o.polygonalPoint),new d.PolygonHierarchy(s)};return this.viewer.entities.add({id:p.objId,polygon:new d.PolygonGraphics({hierarchy:new d.CallbackProperty(r,false),show:true,fill:true,material:p.fillMaterial})})},cartesianToLatlng:function(e){var d=this._Cesium,p=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),r=d.Math.toDegrees(p.latitude),n=d.Math.toDegrees(p.longitude);return [n,r]}};Ne.prototype=Object.create(Object.assign({},Ne.prototype,we.prototype));Ne.prototype.constructor=Ne;function nt(e,d){var p,r=d.camera.getPickRay(e);return r?(p=d.scene.globe.pick(r,d.scene),p):null}var Ge=Ne;var Xe=function(e,d){we.call(this,e,d),this._Cesium=d,this.type="StraightArrow",this.fillMaterial=this._Cesium.Color.fromCssColorString("#0000FF").withAlpha(.8);};Xe.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 d=this._Cesium;let p=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,p=e.callback):p=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var r=this;this.state=1,this.handler||(this.handler=new d.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var a=dt(n.position,r.viewer);a&&(r.positions.length==0&&(r.firstPoint=r.creatPoint(a),r.firstPoint.type="firstPoint",r.floatPoint=r.creatPoint(a),r.floatPoint.type="floatPoint",r.positions.push(a),r.firstPoint.position.setValue(a),r.firstPoint.show=true),r.positions&&r.positions.length==3&&(r.firstPoint.show=false,r.floatPoint.show=false,r.handler.destroy(),r.handler=null,r.tooltip.setVisible(false),r.arrowEntity=null),r.positions.push(a.clone()));},d.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(r.positions.length<1)){var a=dt(n.endPosition,r.viewer);a&&(r.tooltip.showAtCartesian(a,"\u5DE6\u952E\u5355\u51FB\u7ED3\u675F!"),r.floatPoint.position.setValue(a),r.positions.length>=2&&(d.defined(r.arrowEntity)?(r.positions.pop(),r.positions.push(a)):(r.positions.push(a),r.arrowEntity=r.showArrowOnMap(r.positions),p&&p(r.objId))));}},d.ScreenSpaceEventType.MOUSE_MOVE);},startModify:function(){var e=this._Cesium;this.state=2,this.firstPoint.show=true,this.floatPoint.show=true;var d=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(p){var r=d.viewer.scene.pick(p.position);if(e.defined(r)&&r.id?(d.clickStep++,r.id.objId||(d.selectPoint=r.id)):(d.modifyHandler.destroy(),d.modifyHandler=null,d.firstPoint.show=false,d.floatPoint.show=false,d.state=-1,d.tooltip.setVisible(false)),d.clickStep==2){d.clickStep=0;var n=dt(p.position,d.viewer);if(!n)return;d.selectPoint&&d.selectPoint.position&&(d.selectPoint.position.setValue(n),d.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(p){var r=dt(p.endPosition,d.viewer);if(r)if(d.tooltip.showAtCartesian(r,"\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!"),d.selectPoint&&d.selectPoint.position)d.selectPoint.position.setValue(r),d.selectPoint.type=="firstPoint"&&(d.positions[1]=r),d.selectPoint.type=="floatPoint"&&(d.positions[2]=r);else return},e.ScreenSpaceEventType.MOUSE_MOVE);},createByData:function(e){var d=this._Cesium;this.state=-1,this.positions=[];for(var p=[],r=0;r<e.length;r++){var n=d.Cartesian3.fromDegrees(e[r][0],e[r][1]);p.push(n);}this.positions=p,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=[],d=0;d<this.positions.length;d++){var p=this.cartesianToLatlng(this.positions[d]);e.push(p);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var d=this._Cesium,p=this.viewer.entities.add({position:e,point:{pixelSize:10,color:d.Color.RED}});return p.attr="editPoint",p},showArrowOnMap:function(e){var d=this._Cesium,p=this,r=function(){if(e.length<2)return null;var n=e[1],a=e[2],i=p.cartesianToLatlng(n),o=p.cartesianToLatlng(a),h=[],s=p.xp.algorithm.fineArrow([i[0],i[1]],[o[0],o[1]],d),l=JSON.stringify(s).indexOf("null");if(l!=-1)return [];for(var u=s,c=0;c<u.length;c++){var m=new d.Cartesian3(u[c].x,u[c].y,u[c].z);h.push(m);}return new d.PolygonHierarchy(h)};return this.viewer.entities.add({id:p.objId,polygon:new d.PolygonGraphics({hierarchy:new d.CallbackProperty(r,false),show:true,fill:true,material:p.fillMaterial})})},cartesianToLatlng:function(e){var d=this._Cesium,p=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),r=d.Math.toDegrees(p.latitude),n=d.Math.toDegrees(p.longitude);return [n,r]}};Xe.prototype=Object.create(Object.assign({},Xe.prototype,we.prototype));Xe.prototype.constructor=Xe;function dt(e,d){var p,r=d.camera.getPickRay(e);return r?(p=d.scene.globe.pick(r,d.scene),p):null}var Re=Xe;var je=function(e,d){we.call(this,e,d),this._Cesium=d,this.type="PincerArrow",this.fillMaterial=this._Cesium.Color.YELLOW.withAlpha(.8);};je.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 d=0;d<this.pointArr.length;d++)this.pointArr[d]&&this.viewer.entities.remove(this.pointArr[d]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0;},startDraw:function(e){var d=this._Cesium;let p=null;typeof e=="object"?(this.fillMaterial=e.fillMaterial,p=e.callback):p=e,this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var r=this;this.state=1,this.handler||(this.handler=new d.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){var a=it(n.position,r.viewer);if(a)if(r.positions.length==0&&(r.floatPoint=r.creatPoint(a)),r.positions.length>4){var i=r.creatPoint(a);i.wz=r.positions.length,r.pointArr.push(i);for(var o=0;o<r.pointArr.length;o++)r.pointArr[o].show=false;r.floatPoint&&(r.floatPoint.show=false,r.viewer.entities.remove(r.floatPoint),r.floatPoint=null);}else {r.positions.push(a);var i=r.creatPoint(a);r.positions.length>2?i.wz=r.positions.length-1:i.wz=r.positions.length,r.pointArr.push(i);}},d.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!(!r.floatPoint||r.positions.length<2)){var a=it(n.endPosition,r.viewer);a&&(r.floatPoint.position.setValue(a),r.tooltip.showAtCartesian(a,"\u53F3\u952E\u5355\u51FB\u7ED3\u675F!"),r.positions.length>=2&&(d.defined(r.arrowEntity)?(r.positions.pop(),r.positions.push(a)):(r.positions.push(a),r.arrowEntity=r.showArrowOnMap(r.positions),r.arrowEntity.objId=r.objId,p&&p(r.objId))));}},d.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){if(r.positions.length>=4){var a=it(n.position,r.viewer);if(!a)return;for(var i=0;i<r.pointArr.length;i++)r.pointArr[i].show=false;r.floatPoint&&(r.floatPoint.show=false),r.viewer.entities.remove(r.floatPoint),r.floatPoint=null;var o=r.creatPoint(a);o.show=false,o.wz=r.positions.length,r.pointArr.push(o),r.handler.destroy(),r.handler=null,r.tooltip.setVisible(false),r.arrowEntity=null;}},d.ScreenSpaceEventType.RIGHT_CLICK);},createByData:function(e){var d=this._Cesium;this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var p=[],r=0;r<e.length;r++){var n=d.Cartesian3.fromDegrees(e[r][0],e[r][1]);p.push(n);}this.positions=p;for(var r=0;r<this.positions.length;r++){var a=this.creatPoint(this.positions[r]);a.show=false,a.wz=r+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 d=this;for(let p=0;p<d.pointArr.length;p++)d.pointArr[p].show=true;this.modifyHandler||(this.modifyHandler=new e.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(p){var r=d.viewer.scene.pick(p.position);if(e.defined(r)&&r.id)d.clickStep++,r.id.objId||(d.selectPoint=r.id);else {for(let a=0;a<d.pointArr.length;a++)d.pointArr[a].show=false;d.state=-1,d.modifyHandler.destroy(),d.modifyHandler=null,d.tooltip.setVisible(false);}if(d.clickStep==2){d.clickStep=0;var n=it(p.position,d.viewer);if(!n)return;d.selectPoint&&(d.selectPoint.position.setValue(n),d.selectPoint=null);}},e.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(p){var r=it(p.endPosition,d.viewer);if(r)if(d.tooltip.showAtCartesian(r,"\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!"),d.selectPoint)d.selectPoint.position.setValue(r),d.positions[d.selectPoint.wz-1]=r;else return},e.ScreenSpaceEventType.MOUSE_MOVE);},getLnglats:function(){for(var e=[],d=0;d<this.positions.length;d++){var p=this.cartesianToLatlng(this.positions[d]);e.push(p);}return e},getPositions:function(){return this.positions},creatPoint:function(e){var d=this._Cesium;return this.viewer.entities.add({position:e,point:{pixelSize:10,color:d.Color.RED},show:true})},showArrowOnMap:function(e){var d=this._Cesium,p=this,r=function(){if(e.length<3)return null;for(var n=[],a=0;a<e.length;a++){var i=p.cartesianToLatlng(e[a]);n.push(i);}var o=p.xp.algorithm.doubleArrow(n,d),h=[],s=JSON.stringify(o.polygonalPoint).indexOf("null");return s==-1&&(h=o.polygonalPoint),new d.PolygonHierarchy(h)};return this.viewer.entities.add({id:p.objId,polygon:new d.PolygonGraphics({hierarchy:new d.CallbackProperty(r,false),show:true,fill:true,material:p.fillMaterial})})},cartesianToLatlng:function(e){var d=this._Cesium,p=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),r=d.Math.toDegrees(p.latitude),n=d.Math.toDegrees(p.longitude);return [n,r]}};je.prototype=Object.create(Object.assign({},je.prototype,we.prototype));je.prototype.constructor=je;function it(e,d){var p,r=d.camera.getPickRay(e);return r?(p=d.scene.globe.pick(r,d.scene),p):null}var Be=je;function Yt({THREE:e,Cesium:d,viewer:p}){function r(a,i){i||(i=new e.BufferGeometry);let o=a.attributes;for(let l in o)if(o.hasOwnProperty(l)&&o[l]){var h=o[l],s=h.values;s instanceof Float64Array&&(s=new Float32Array(s));let u=new e.BufferAttribute(s,h.componentsPerAttribute,h.normalize);i.setAttribute(l,u);}if(o.st&&(i.attributes.uv=i.attributes.st,i.deleteAttribute("st")),a.indices){let l=new e.BufferAttribute(a.indices,1,false);i.setIndex(l);}if(a.boundingSphere){let l=a.boundingSphere;i.boundingSphere||(i.boundingSphere=new e.Sphere),i.boundingSphere.center.copy(l.center),i.boundingSphere.radius=l.radius;}return i}class n extends e.Scene{constructor(i={}){if(super(),this.type="ThreeCesiumScene",!i.cesiumDom)throw new Error("THREE.ThreeCesiumScene not found cesiumDom.");if(!i.camera||!(i.camera instanceof e.PerspectiveCamera))throw new Error("THREE.ThreeCesiumScene (not found cesiumDom) OR ( not THREE.PerspectiveCamera ).");if(!i.renderer)throw new Error("THREE.ThreeCesiumScene not found THREE.WebGLRender.");this.options=i,this.cesiumViewer=p;let h=(typeof i.cesiumDom=="string"?document.getElementById(i.cesiumDom):i.cesiumDom).children[0].children;for(let w=0;w<h.length;w++)w!==0&&(h[w].style.zIndex="100");this.ellipsoid=this.cesiumViewer.scene.globe.ellipsoid,i.threeHabit&&(this.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes=[d.CameraEventType.LEFT_DRAG],this.cesiumViewer.scene.screenSpaceCameraController.zoomEventTypes=[d.CameraEventType.MIDDLE_DRAG,d.CameraEventType.WHEEL,d.CameraEventType.PINCH],this.cesiumViewer.scene.screenSpaceCameraController.rotateEventTypes=[d.CameraEventType.RIGHT_DRAG]),this.camera=i.camera,this.cameraOffset=new e.Vector3,this.renderer=i.renderer,this.lngLat=i.lngLat&&i.lngLat.length>1?i.lngLat:[114.23,31.55],this.cameraCenter=new e.Vector3(0,0,0);let s=new d.EllipsoidGeometry({vertexFormat:d.VertexFormat.POSITION_ONLY,radii:new d.Cartesian3(this.ellipsoid.maximumRadius-1,this.ellipsoid.maximumRadius-1,this.ellipsoid.minimumRadius-1),slicePartitions:1024,stackPartitions:1024}),l=r(d.EllipsoidGeometry.createGeometry(s)),u=new e.MeshBasicMaterial({color:"#ff00ff",blending:e.MultiplyBlending}),c=new e.Mesh(l,u);i.axesHelper&&c.add(new e.AxesHelper(8e6)),super.add(c),this.sphere=c;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),f=new e.MeshBasicMaterial({color:"#fff00f",blending:e.MultiplyBlending}),g=new e.Mesh(y,f);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;}}),i.enableLighting!==void 0&&i.enableLighting!==null&&(this.enableLighting=i.enableLighting),i.cesiumLayers&&i.cesiumLayers.length>0)for(let w=0;w<i.cesiumLayers.length;w++)this.addImageryProvider(i.cesiumLayers[w].type,i.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 i=this.cesiumViewer.scene.sun._boundingVolume.center,o=this.cartesian3ToVector(i);return this.sunUp.lookAt(o.x-this.cameraOffset.x,o.y-this.cameraOffset.y,-(o.z-this.cameraOffset.z)),this}updateCameraMatrix(){this.camera.fov=d.Math.toDegrees(this.cesiumViewer.camera.frustum.fovy),this.camera.updateProjectionMatrix(),this.camera.matrixAutoUpdate=false;let i=this.cesiumViewer.camera.viewMatrix,o=this.cesiumViewer.camera.inverseViewMatrix;this.camera.lookAt(this.cameraCenter),this.camera.matrixWorld.set(o[0],o[4],o[8],o[12]-this.cameraOffset.x,o[1],o[5],o[9],o[13]-this.cameraOffset.y,o[2],o[6],o[10],o[14]-this.cameraOffset.z,o[3],o[7],o[11],o[15]),this.camera.matrixWorldInverse.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]);let h=this.cesiumViewer.scene.canvas.clientWidth,s=this.cesiumViewer.scene.canvas.clientHeight;return this.camera.aspect=h/s,this.camera.updateProjectionMatrix(),this.renderer.setSize(h,s),this}isColumbusViewMode(){return this.cesiumViewer.scene.mode===d.SceneMode.COLUMBUS_VIEW}isThreeRenderable(){let i=this.cesiumViewer.scene;return i.mode===d.SceneMode.SCENE2D?false:Math.abs(i.morphTime)<d.Math.EPSILON6||Math.abs(i.morphTime-1)<d.Math.EPSILON6}getSceneOriginPosition(){return this.isColumbusViewMode()?this.cartesianToCVWorld(d.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)):d.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)}cartesianToCVWorld(i){let o=this.cesiumViewer.scene.mapProjection.project(d.Cartographic.fromCartesian(i));return new e.Vector3(o.z,o.x,o.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 i=this.cartesian3ToVector(d.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)),o=this.cartesian3ToVector(d.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],2)),h=new e.Vector3().subVectors(i,o).normalize();return this.syncGroup.up.set(0,0,-1),this.syncGroup.lookAt(h),this.syncGroup.up.copy(h),this.syncGroup.updateMatrix(),this.cameraOffset.copy(i),this.syncGroup.up.set(0,0,-1),this.up.set(0,0,-1),this}update(){this.updateSunMatrix(),this.updateGroupMatrixWorld(),this.updateCameraMatrix(),this.isThreeRenderable()?this.renderThree():this.renderer.clear(),this.renderCesium();}add(i){if(arguments.length>1){for(let o=0;o<arguments.length;o++)this.childrenGroup.add(arguments[o]);return this}return i===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",i),this):(i&&i.isObject3D?(i.parent!==null&&i.parent.remove(i),i.parent=this.childrenGroup,this.childrenGroup.children.push(i),i.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",i),this)}remove(i){if(arguments.length>1){for(let h=0;h<arguments.length;h++)this.childrenGroup.remove(arguments[h]);return this}let o=this.childrenGroup.children.indexOf(i);return o!==-1&&(i.parent=null,this.childrenGroup.children.splice(o,1),i.dispatchEvent({type:"removed"})),this}clear(){for(let i=0;i<this.childrenGroup.children.length;i++){let o=this.childrenGroup.children[i];o.parent=null,o.dispatchEvent({type:"removed"});}return this.childrenGroup.children.length=0,this}traverse(i){i(this.childrenGroup);let o=this.childrenGroup.children;for(let h=0,s=o.length;h<s;h++)o[h].traverse(i);}traverseVisible(i){if(this.visible===false||this.childrenGroup.visible===false)return;i(this.childrenGroup);let o=this.childrenGroup.children;for(let h=0,s=o.length;h<s;h++)o[h].traverseVisible(i);}toJSON(i){let o=i===void 0||typeof i=="string",h={};o&&(i={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{},options:{}},h.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(i).uuid)),this.environment&&this.environment.isTexture&&(s.environment=this.environment.toJSON(i).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(i).object);}if(o){let u=l(i.geometries),c=l(i.materials),m=l(i.textures),y=l(i.images),f=l(i.shapes),g=l(i.skeletons),v=l(i.animations),A=l(i.nodes);u.length>0&&(h.geometries=u),c.length>0&&(h.materials=c),m.length>0&&(h.textures=m),y.length>0&&(h.images=y),f.length>0&&(h.shapes=f),g.length>0&&(h.skeletons=g),v.length>0&&(h.animations=v),A.length>0&&(h.nodes=A);}return s.isGIS=true,h.object=s,h;function l(u){let c=[];for(let m in u){let y=u[m];delete y.metadata,c.push(y);}return c}}dispose(){this.update=()=>{},this.renderCesium=()=>{},this.renderThree=()=>{},this.updateSunMatrix=()=>{},this.updateCameraMatrix=()=>{},this.updateGroupMatrixWorld=()=>{},this.cesiumViewer.destroy();}cartesian3ToVector(i){return new e.Vector3(i.x,i.y,i.z)}positionToCartesian(i){if(Array.isArray(i))return d.Cartesian3.fromDegrees(i[0],i[1],i.length>2?i[2]:0);if(i&&typeof i=="object"){if(typeof i.longitude=="number"&&typeof i.latitude=="number")return d.Cartesian3.fromRadians(i.longitude,i.latitude,i.height||0);if(typeof i.x=="number"&&typeof i.y=="number"&&typeof i.z=="number")return new d.Cartesian3(i.x,i.y,i.z)}throw new Error("THREE.ThreeCesiumScene: invalid position, expect [lng, lat, height] | Cesium.Cartesian3 | Cesium.Cartographic.")}positionToWorldVector(i){let o=this.positionToCartesian(i),h=this.getSceneOriginPosition();if(this.isColumbusViewMode()){let s=this.cartesianToCVWorld(o);return new e.Vector3(s.x-h.x,s.y-h.y,s.z-h.z)}return new e.Vector3(o.x-h.x,o.y-h.y,o.z-h.z)}setObjectPosition(i,o){if(!i||!i.isObject3D)return console.error("THREE.ThreeCesiumScene.setObjectPosition: object must be an instance of THREE.Object3D.",i),this;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let h=this.positionToWorldVector(o);return i.position.copy(this.childrenGroup.worldToLocal(h)),this}getObjectPosition(i){if(!i||!i.isObject3D)return console.error("THREE.ThreeCesiumScene.getObjectPosition: object must be an instance of THREE.Object3D.",i),null;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let o=this.getSceneOriginPosition(),h=this.childrenGroup.localToWorld(i.position.clone()),s=new d.Cartesian3(h.x+o.x,h.y+o.y,h.z+o.z),l;return this.isColumbusViewMode()?l=this.cesiumViewer.scene.mapProjection.unproject(new d.Cartesian3(s.y,s.z,s.x)):l=d.Cartographic.fromCartesian(s),[d.Math.toDegrees(l.longitude),d.Math.toDegrees(l.latitude),l.height]}}return n.prototype.isScene=true,n.prototype.isGIS=true,n}function Nn(){let e=null,d=null,p=function(r,n,a,i){if(r&&i){let{threeGlobal:o,containerId:h,threeContainerId:s}=i;e=n,d=o,this._viewer=r,this._containerId=h,this._threeContainerId=s,this._Scene=Yt({THREE:d,Cesium:e,viewer:r}),this._initContainer(),ae(this),ie(this,()=>{this.destroyThreeJS();});}};return p.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 r=document.getElementsByTagName("body")[0];r&&(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",r.appendChild(this.threeContainer));}},initThree:function(r){var n=r.fov||45,a=window.innerWidth,i=window.innerHeight,o=r.aspect||a/i,h=r.near||1,s=r.far||10*1e3*1e3;return this._three={renderer:null,camera:null,scene:null},this._three.camera=new d.PerspectiveCamera(n,o,h,s),this._three.renderer=new d.WebGLRenderer({alpha:true,antialias:true,logarithmicDepthBuffer:true,stencil:true,depth:true}),this._three.renderer.outputEncoding=d.sRGBEncoding,this._three.renderer.shadowMap.enabled=true,this._three.renderer.shadowMap.type=d.PCFSoftShadowMap,this._three.scene=new this._Scene({cesiumDom:this._containerId,threeHabit:this._objHasOwnProperty(r,"threeHabit",true),enableLighting:this._objHasOwnProperty(r,"enableLighting",true),axesHelper:this._objHasOwnProperty(r,"axesHelper",false),camera:this._three.camera,renderer:this._three.renderer,lngLat:r.center||[104.081701757991,30.627042558105988]}),this.threeContainer&&this.threeContainer.appendChild(this._three.renderer.domElement),this._three},loop(r){let n=a=>{this._rafId=requestAnimationFrame(n),r&&r(a);};this._rafId=requestAnimationFrame(n);},setPosition(r,n){return !this._three||!this._three.scene?(console.error("ThreeJs.setPosition: please call initThree first."),this):(this._three.scene.setObjectPosition(r,n),this)},getPosition(r){return !this._three||!this._three.scene?(console.error("ThreeJs.getPosition: please call initThree first."),null):this._three.scene.getObjectPosition(r)},_objHasOwnProperty(r,n,a){return r.hasOwnProperty(n)?r[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();}},p}var at=te(Nn);var Oe=class{constructor(d){this.viewer=null;this.Cesium=d,this.init_data();}init_data(){this.viewer=null;}init({containerId:d,viewerConfig:p,extraConfig:r,MapImageryList:n,imageryProvider:a,viewer:i}){let o=d,h={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),l=r==null?void 0:r.AccessToken;l&&(this.Cesium.Ion.defaultAccessToken=l),h=Object.assign(h,p);let u=i||new this.Cesium.Viewer(o,{...h,...s});if(r&&!r.logo){let c=u.cesiumWidget.creditContainer;c.style.display="none";}if(r&&r.depthTest&&(u.scene.globe.depthTestAgainstTerrain=true),n&&n.length>0)for(let c=0;c<n.length;c++)this.addImageryProvider(u,n[c].type,n[c].option||n[c].classConfig);if(!i){let c=typeof document=="undefined"?null:o&&o.nodeType===1?o:document.getElementById(o);this.bindContainerResize(u,c);}return this.viewer=u,u}bindContainerResize(d,p){if(typeof ResizeObserver=="undefined"||!p)return;let r=()=>{try{(typeof d.isDestroyed!="function"||!d.isDestroyed())&&d.resize();}catch(i){Ce(i,{scope:"Controller.bindContainerResize"});}},n=new ResizeObserver(r);n.observe(p),typeof requestAnimationFrame=="function"&&requestAnimationFrame(r);let a=d.destroy.bind(d);d.destroy=function(){try{n.disconnect();}catch(i){Ce(i,{scope:"Controller.bindContainerResize.disconnect"});}return a()};}addImageryProvider(d,p,r){d.imageryLayers.addImageryProvider(this.createCesiumProvider({type:p,option:r}));}findCesiumProvider(d){let p={};if(!d)return p;for(let r in d){let n=d[r];if(n&&n.type){p[r]=this.createCesiumProvider(n);continue}p[r]=d[r];}return p}createCesiumProvider(d){switch(d.type){case "WebMapTileServiceImageryProvider":return new this.Cesium[d.type](d.option);case "UrlTemplateImageryProvider":return new this.Cesium[d.type](d.option);case "TileMapServiceImageryProvider":return new this.Cesium[d.type](d.option)}}};function qt(){return typeof window!="undefined"&&typeof document!="undefined"}function Qt(e){if(!qt())throw new me("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 Xn(e){return e.defaultStatic?e.defaultStatic:typeof e.assetsBaseUrl=="string"?ce(e.assetsBaseUrl):ce()}function It(e){var a,i,o;let d=(a=e.cesiumGlobal)!=null?a:e.Cesium,p=(i=e.threeGlobal)!=null?i:e.three;if(!d)throw new me("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 me("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||Qt("createKit / initCesium"),e.onError&&vt(e.onError);let r=Xn(e),n=e.viewer;try{if(!n)n=new Oe(d).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 h=new Oe(d);e.MapImageryList.forEach(s=>{h.addImageryProvider(n,s.type,s.option||s.classConfig);});}}catch(h){throw qe(h)?h:new me("INTERNAL","\u521B\u5EFA Cesium viewer \u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5 containerId \u4E0E viewerConfig\u3002",{cause:h,details:{containerId:e.containerId}})}return {Cesium:d,viewer:n,defaultStatic:r,assetsBaseUrl:(o=r.baseService)!=null?o:"",three:p,ownsViewer:!e.viewer,containerId:e.containerId,threeContainerId:e.threeContainerId}}function Mt(e){!e||!e.ownsViewer||He(e.viewer);}function jn(e,d,p){function r(n,a){let i=null,o=Me(a),h=[];if(Array.isArray(n))n.forEach(l=>{let u=Me(l),c=new u(e,d,p);s(u,o),h.push(c);}),i=new o(e,d,p),h.forEach(l=>Object.assign(i,l)),h.forEach(l=>We(l,i));else {let l=Me(n),u=new l(e,d,p);s(l,o),i=new o(e,d,p),Object.assign(i,u),We(u,i);}function s(l,u){let c=Object.getOwnPropertyNames(l.prototype);for(let m=0,y=c.length;m<y;m++)c[m]!=="constructor"&&(u.prototype[c[m]]=l.prototype[c[m]]);}return i}return r}function Tt(e){let d=It(e),{viewer:p,Cesium:r,defaultStatic:n,three:a}=d,i=jn(p,r,n),o=i([Q,Se],Qe),h=i(Q,ue),s=i(Q,ve),l=new Ee(p,r),u=i(Q,Ke),c=i([Q,ve,Ee],Te),m=i([Q,Se],Je),y=i(Q,Ze),f=i(Q,$e),g=i([Q,ue],De),v=new Q(p,r),A=i([Q,Te,De],et),w=new Ge(p,r),C=new Re(p,r),P=new Be(p,r),x=a?{threeGlobal:a,containerId:d.containerId,threeContainerId:d.threeContainerId}:"",b=new at(p,r,n,x),M=[b,A,c,g,m,y,f,u,h,o,s,l,v,w,C,P],k=false;return {viewer:p,context:d,material:o,graphics:h,math3d:s,math2d:l,primitive:u,draw:c,passEffect:m,customCesiumPlugin:y,control:f,plugin:g,base:v,analysis:A,attackArrowObj:w,straightArrowObj:C,pincerArrowObj:P,threeJs:b,dispose:()=>{k||(k=true,M.forEach(S=>{try{S&&typeof S.destroy=="function"?S.destroy():de(S);}catch(L){Ce(L,{scope:"createKit.dispose"});}}),d.ownsViewer?He(p):Mt(d));},isDisposed:()=>k}}function Yn(e){return Tt(e)}var qn=Yn;function Qn(e,d,p,r){function n(a,i){let o={},h=Me(i),s=[];if(Array.isArray(a))a.forEach(u=>{let c=Me(u),m=new c(e,d,p,r);l(c,h),s.push(m);}),o=new h(e,d,p,r),s.forEach(u=>Object.assign(o,u)),s.forEach(u=>We(u,o));else {let u=Me(a),c=new u(e,d,p,r);l(u,h),o=new h(e,d,p,r),Object.assign(o,c),We(c,o);}function l(u,c){let m=Object.getOwnPropertyNames(u.prototype);for(let y=0,f=m.length;y<f;y++)m[y]!=="constructor"&&(c.prototype[m[y]]=u.prototype[m[y]]);}return o}return n}function Kn({cesiumGlobal:e,threeGlobal:d,containerId:p,threeContainerId:r,viewerConfig:n={},extraConfig:a={},MapImageryList:i=[],defaultStatic:o,baseExtendsCom:h=[],extendsCom:s,extendsComName:l,viewer:u}){if(!e)throw new me("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!p&&!u)throw new me("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 Oe(e).init({containerId:p,viewerConfig:n,extraConfig:a,MapImageryList:i,viewer:u}),y=!u,v=Qn(m,e,o,d?{threeGlobal:d,containerId:p,threeContainerId:r}:"")(h,s),A=false;return {viewer:m,[l]:v,dispose:()=>{if(!A){A=true;try{typeof v.destroy=="function"?v.destroy():de(v);}catch(w){Ce(w,{scope:"singleImport.dispose"});}y&&He(m);}}}}function re(e,d,p){function r(n){return Kn({...n,baseExtendsCom:e,extendsCom:d,extendsComName:p})}return r}var Kt=re([Q],ue,"graphics");var Jt=re([Q,Se],Qe,"material");var Zt=re([Q],Ke,"primitive");var Jn=re([Q,ve,Ee],Te,"draw");function Zn(e){let d=new Jn(e),p=new Ge(d.viewer,e.cesiumGlobal),r=new Re(d.viewer,e.cesiumGlobal),n=new Be(d.viewer,e.cesiumGlobal);return {...d,attackArrowObj:p,straightArrowObj:r,pincerArrowObj:n}}var $t=Zn;var en=re([Q,Te,De],et,"analysis");var tn=re(Q,Ze,"customCesiumPlugin");var nn=re([Q,Se],Je,"passEffect");var an=re([Q,ue],De,"plugin");var rn=re([],at,"threeJs");var on=re([Q],$e,"control");exports.Analysis=en;exports.AttackArrow=Ge;exports.CesiumDevKitError=me;exports.Control=on;exports.CustomCesiumPlugin=tn;exports.DEFAULT_STATIC_BASE=Pn;exports.Draw=$t;exports.Graphics=Kt;exports.Material=Jt;exports.Math2d=Ee;exports.Math3d=ve;exports.PassEffect=nn;exports.PincerArrow=Be;exports.Plugin=an;exports.Primitive=Zt;exports.StraightArrow=Re;exports.ThreeJs=rn;exports.assertBrowser=Qt;exports.createContext=It;exports.createDefaultStatic=ce;exports.createKit=Tt;exports.defaultStatic=bn;exports.disposeContext=Mt;exports.getErrorHandler=wn;exports.initCesium=qn;exports.isBrowser=qt;exports.isCesiumDevKitError=qe;exports.reportError=Ce;exports.setErrorHandler=vt;//# sourceMappingURL=index.cjs.map
|
|
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/3fO9Uq7s6thvPe7371z5w5ARERERERERGOBASp5avu/xAEzBlSkHoOUdevXdEHCWHxXAjQmMACUGPXsN5tRbrSgrGyR/rVZPxPXj7ERfJQOBkYHytCBfnMfzGSHce0ftYNKCgNAkVPb18dgVq7WFf5m/VuL/l86kso+DEY7ynRg6O37MQNC8WMAKEIDlR63QenWPn8S+hvUrjOEjQwGxYkBoIio59a3oKLyNphqNUaW1kfISOj/tOvMoNVYtjYBKgoMAEXAqvjlFfdBSYo/DOXjgKpaoHoaUKNLRep3eV6KU++p1GMPcOGUXeS5c8eA5AUMUxt6kwwERYABoICpZ9c36/72ev1jy5DeUDEemDTHruzyOG4iQnHuKNBzwC6n9wP954f2PkMCgWIgKGAMAAXI7uPjPl3uGXRjadXrrtIdgrlAbSNyonuPXY7tHHxbQ48TmGarcd2ftoEKDgNAgVHPfbUFqnyD/j8Tz7qhVPbYPLvyV4xDXkg3oUdnBAd/Zf+cjQSCvgu3GMu+kAAVDAaAAqG2r4uhv1b6+dlb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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHL+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/69BvDfikBFRYVlXV3dIPM7UHV19XF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3Cm3gjKA/w/yDWXrN3Z0WBzT0zsQ9QR4FfAOzAoEkDeOubNVLv/1IEMg7zoK2AAClyWT1foZJ3gKzMCrgA1g/yFvHHPncl1dLIKuAZ4CNsCLYhzcNZm6p1wuUsCa6NCwGFAmJUUjMamGyWh5CouBlq4uUqbfIPMQ4CksBirq68nKL/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)}};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
|
|
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=`
|
|
1030
|
+
varying float vCut;
|
|
1031
|
+
varying vec3 vLocalPos;
|
|
1032
|
+
float teHash(vec3 p) {
|
|
1033
|
+
p = fract(p * 0.3183099 + vec3(0.11, 0.23, 0.37));
|
|
1034
|
+
p *= 17.0;
|
|
1035
|
+
return fract(p.x * p.y * p.z * (p.x + p.y + p.z));
|
|
1036
|
+
}
|
|
1037
|
+
float teNoise(vec3 x) {
|
|
1038
|
+
vec3 i = floor(x);
|
|
1039
|
+
vec3 f = fract(x);
|
|
1040
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
1041
|
+
return mix(
|
|
1042
|
+
mix(mix(teHash(i), teHash(i + vec3(1.0, 0.0, 0.0)), f.x),
|
|
1043
|
+
mix(teHash(i + vec3(0.0, 1.0, 0.0)), teHash(i + vec3(1.0, 1.0, 0.0)), f.x), f.y),
|
|
1044
|
+
mix(mix(teHash(i + vec3(0.0, 0.0, 1.0)), teHash(i + vec3(1.0, 0.0, 1.0)), f.x),
|
|
1045
|
+
mix(teHash(i + vec3(0.0, 1.0, 1.0)), teHash(i + vec3(1.0, 1.0, 1.0)), f.x), f.y),
|
|
1046
|
+
f.z);
|
|
1047
|
+
}
|
|
1048
|
+
float teFbm(vec3 p) {
|
|
1049
|
+
float sum = 0.0;
|
|
1050
|
+
float amp = 0.5;
|
|
1051
|
+
for (int i = 0; i < 3; i++) {
|
|
1052
|
+
sum += amp * teNoise(p);
|
|
1053
|
+
p *= 2.07;
|
|
1054
|
+
amp *= 0.5;
|
|
1055
|
+
}
|
|
1056
|
+
return sum;
|
|
1057
|
+
}
|
|
1058
|
+
`,Fr=`
|
|
1059
|
+
{
|
|
1060
|
+
float teAmt = clamp(abs(vCut), 0.0, 1.0);
|
|
1061
|
+
if (teAmt > 0.004) {
|
|
1062
|
+
vec3 p = vLocalPos;
|
|
1063
|
+
// \u6BCF\u50CF\u7D20\u8986\u76D6\u591A\u5C11\u7C73\uFF1A\u8FDC\u770B\u65F6\u8981\u628A\u9AD8\u9891\u7EC6\u8282\u6DE1\u51FA\uFF0C\u5426\u5219\u7EC6\u5BC6\u566A\u58F0\u4F1A\u7CCA\u6210\u4E00\u5C42\u300C\u6BDB\u6BE1\u300D
|
|
1064
|
+
float px = max(fwidth(p.x), max(fwidth(p.y), fwidth(p.z)));
|
|
1065
|
+
float fineFade = 1.0 - smoothstep(0.35, 1.1, px);
|
|
1066
|
+
|
|
1067
|
+
// \u4E09\u4E2A\u5C3A\u5EA6\uFF1A\u6574\u7247\u8272\u533A\uFF08\u7EA6 200m\uFF09\u2192 \u6591\u5757\uFF08\u7EA6 30m\uFF09\u2192 \u788E\u77F3\uFF08\u7EA6 7m\uFF09
|
|
1068
|
+
float macro = teFbm(p * 0.005);
|
|
1069
|
+
float coarse = teFbm(p * 0.032);
|
|
1070
|
+
float medium = teFbm(p * 0.14);
|
|
1071
|
+
float fine = teNoise(p * 1.1);
|
|
1072
|
+
|
|
1073
|
+
// \u5C42\u7406\uFF1A\u7528\u4F4E\u9891\u566A\u58F0\u628A\u6761\u5E26\u7684\u76F8\u4F4D\u626D\u4E00\u626D\uFF0C\u4E0D\u7136\u7B49\u9AD8\u7684\u5730\u65B9\u4F1A\u8FDE\u6210\u4E00\u5708\u540C\u5FC3\u73AF
|
|
1074
|
+
float warp = teFbm(p * 0.016 + vec3(0.0, 0.0, 3.7));
|
|
1075
|
+
float band = fract((p.y + warp * 30.0) * 0.075);
|
|
1076
|
+
float strata = smoothstep(0.08, 0.42, band) * (1.0 - smoothstep(0.56, 0.92, band));
|
|
1077
|
+
|
|
1078
|
+
vec3 rock = mix(vec3(0.062, 0.046, 0.034), vec3(0.145, 0.112, 0.082), coarse);
|
|
1079
|
+
// \u5927\u5C3A\u5EA6\u8272\u533A\uFF1A\u504F\u9EC4\u8910 / \u504F\u9752\u7070\uFF0C\u907F\u514D\u6574\u9762\u5899\u4E00\u4E2A\u8272
|
|
1080
|
+
rock = mix(rock, vec3(0.175, 0.132, 0.086), macro * 0.72);
|
|
1081
|
+
rock = mix(rock, vec3(0.088, 0.086, 0.082), (1.0 - macro) * 0.42);
|
|
1082
|
+
rock = mix(rock, vec3(0.225, 0.186, 0.146), strata * 0.3);
|
|
1083
|
+
rock *= 0.90 + 0.20 * medium;
|
|
1084
|
+
rock *= 1.0 + (fine - 0.5) * 0.5 * fineFade;
|
|
1085
|
+
// \u501F\u4E00\u70B9\u5F53\u5730\u5730\u8868\u8272\u76F8\uFF1A\u6316\u5728\u57CE\u5E02\u91CC\u504F\u6696\u3001\u6316\u5728\u8349\u5761\u4E0A\u504F\u7EFF\uFF0C
|
|
1086
|
+
// \u514D\u5F97\u6574\u5757\u5751\u58C1\u50CF\u4E00\u5757\u7070\u8272\u8865\u4E01\u8D34\u4E0A\u53BB
|
|
1087
|
+
#ifdef USE_MAP
|
|
1088
|
+
vec3 localTone = texture2D(map, vMapUv, 2.0).rgb;
|
|
1089
|
+
float toneLum = max(dot(localTone, vec3(0.299, 0.587, 0.114)), 0.04);
|
|
1090
|
+
rock *= mix(vec3(1.0), localTone / toneLum, 0.34);
|
|
1091
|
+
#endif
|
|
1092
|
+
|
|
1093
|
+
// \u788E\u5C51\u7684\u51F9\u51F8\uFF1A\u7528\u566A\u58F0\u6CBF\u5149\u7167\u65B9\u5411\u7684\u5DEE\u5206\u5F53\u5FAE\u6CD5\u7EBF\uFF0C\u8FD1\u770B\u624D\u6709\u300C\u571F\u77F3\u300D\u7684\u9897\u7C92\u611F
|
|
1094
|
+
if (fineFade > 0.01) {
|
|
1095
|
+
float bump0 = teNoise(p * 1.6);
|
|
1096
|
+
float bumpX = teNoise(p * 1.6 + vec3(0.6, 0.0, 0.0));
|
|
1097
|
+
float bumpZ = teNoise(p * 1.6 + vec3(0.0, 0.0, 0.6));
|
|
1098
|
+
float bump = ((bumpX - bump0) * 0.32 + (bumpZ - bump0) * 0.27) * 3.2;
|
|
1099
|
+
rock *= clamp(1.0 + bump * fineFade, 0.55, 1.6);
|
|
1100
|
+
}
|
|
1101
|
+
diffuseColor.rgb = mix(diffuseColor.rgb, rock, teAmt);
|
|
1102
|
+
}
|
|
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>
|
|
1105
|
+
attribute float aCut;
|
|
1106
|
+
varying float vCut;
|
|
1107
|
+
varying vec3 vLocalPos;`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
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");exports.Analysis=Ln;exports.AttackArrow=Xe;exports.CesiumDevKitError=oe;exports.Control=Gn;exports.CustomCesiumPlugin=kn;exports.DEFAULT_STATIC_BASE=Qn;exports.Draw=En;exports.Graphics=Mn;exports.Material=In;exports.Math2d=He;exports.Math3d=Te;exports.PassEffect=Dn;exports.PincerArrow=Ye;exports.Plugin=Rn;exports.Primitive=Tn;exports.StraightArrow=je;exports.TerrainEdit=At;exports.ThreeJs=Bn;exports.assertBrowser=Sn;exports.createContext=jt;exports.createDefaultStatic=fe;exports.createKit=qt;exports.defaultStatic=Jn;exports.disposeContext=Yt;exports.getErrorHandler=Yn;exports.initCesium=Nr;exports.isBrowser=xn;exports.isCesiumDevKitError=lt;exports.reportError=pe;exports.setErrorHandler=Lt;//# sourceMappingURL=index.cjs.map
|
|
1030
1112
|
//# sourceMappingURL=index.cjs.map
|