cesium_dev_kit 1.1.21 → 1.1.23
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 +60 -0
- package/README.md +293 -291
- package/README.zh-CN.md +274 -0
- package/SECURITY.md +21 -0
- package/dist/Analysis-BLpVrGfg.d.mts +143 -0
- package/dist/Analysis-DmO1gtgS.d.ts +143 -0
- package/dist/Base-DH8H9suE.d.mts +635 -0
- package/dist/Base-DH8H9suE.d.ts +635 -0
- package/dist/Base-_BOXyMdS.d.ts +43 -0
- package/dist/Base-skqjcPfo.d.mts +43 -0
- package/dist/Control-B7AMFmHe.d.ts +98 -0
- package/dist/Control-BrpRU7RP.d.mts +98 -0
- package/dist/CustomCesiumPlugin-BqgAvlhi.d.ts +29 -0
- package/dist/CustomCesiumPlugin-CKYQ-7i9.d.mts +29 -0
- package/dist/Draw-1NhPP8z3.d.mts +490 -0
- package/dist/Draw-DRh7yNzc.d.ts +490 -0
- package/dist/Graphics-CuFNsQ3b.d.ts +1565 -0
- package/dist/Graphics-QE3Gb43w.d.mts +1565 -0
- package/dist/Material-CeZ4l-tY.d.mts +165 -0
- package/dist/Material-Cqbyf2Pn.d.ts +165 -0
- package/dist/Math3d-0nO-vFbT.d.mts +179 -0
- package/dist/Math3d-t635PYzU.d.ts +179 -0
- package/dist/PassEffect-DEFyytQZ.d.ts +41 -0
- package/dist/PassEffect-DEgElnVk.d.mts +41 -0
- package/dist/Plugin-BPCX0zTu.d.mts +197 -0
- package/dist/Plugin-DnYT0bue.d.ts +197 -0
- package/dist/Primitive-BNXp-9_6.d.mts +199 -0
- package/dist/Primitive-UEAuUimH.d.ts +199 -0
- package/dist/ThreeJs-BAlEWxa1.d.mts +44 -0
- package/dist/ThreeJs-DpAcw_qf.d.ts +44 -0
- package/dist/analysis.cjs +145 -0
- package/dist/analysis.cjs.map +1 -0
- package/dist/analysis.d.mts +6 -0
- package/dist/analysis.d.ts +6 -0
- package/dist/analysis.mjs +145 -0
- package/dist/analysis.mjs.map +1 -0
- package/dist/control.cjs +140 -0
- package/dist/control.cjs.map +1 -0
- package/dist/control.d.mts +4 -0
- package/dist/control.d.ts +4 -0
- package/dist/control.mjs +140 -0
- package/dist/control.mjs.map +1 -0
- package/dist/custom-cesium-plugin.cjs +507 -0
- package/dist/custom-cesium-plugin.cjs.map +1 -0
- package/dist/custom-cesium-plugin.d.mts +4 -0
- package/dist/custom-cesium-plugin.d.ts +4 -0
- package/dist/custom-cesium-plugin.mjs +507 -0
- package/dist/custom-cesium-plugin.mjs.map +1 -0
- package/dist/default-static.cjs +3 -0
- package/dist/default-static.cjs.map +1 -0
- package/dist/default-static.d.mts +37 -0
- package/dist/default-static.d.ts +37 -0
- package/dist/default-static.mjs +3 -0
- package/dist/default-static.mjs.map +1 -0
- package/dist/draw.cjs +140 -0
- package/dist/draw.cjs.map +1 -0
- package/dist/draw.d.mts +6 -0
- package/dist/draw.d.ts +6 -0
- package/dist/draw.mjs +140 -0
- package/dist/draw.mjs.map +1 -0
- package/dist/graphics.cjs +140 -0
- package/dist/graphics.cjs.map +1 -0
- package/dist/graphics.d.mts +19 -0
- package/dist/graphics.d.ts +19 -0
- package/dist/graphics.mjs +140 -0
- package/dist/graphics.mjs.map +1 -0
- package/dist/index.cjs +1030 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +338 -0
- package/dist/index.d.ts +338 -0
- package/dist/index.mjs +1030 -0
- package/dist/index.mjs.map +1 -0
- package/dist/material.cjs +391 -0
- package/dist/material.cjs.map +1 -0
- package/dist/material.d.mts +4 -0
- package/dist/material.d.ts +4 -0
- package/dist/material.mjs +391 -0
- package/dist/material.mjs.map +1 -0
- package/dist/pass-effect.cjs +416 -0
- package/dist/pass-effect.cjs.map +1 -0
- package/dist/pass-effect.d.mts +4 -0
- package/dist/pass-effect.d.ts +4 -0
- package/dist/pass-effect.mjs +416 -0
- package/dist/pass-effect.mjs.map +1 -0
- package/dist/plugin.cjs +141 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.mts +4 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.mjs +141 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/primitive.cjs +370 -0
- package/dist/primitive.cjs.map +1 -0
- package/dist/primitive.d.mts +4 -0
- package/dist/primitive.d.ts +4 -0
- package/dist/primitive.mjs +370 -0
- package/dist/primitive.mjs.map +1 -0
- package/dist/three.cjs +140 -0
- package/dist/three.cjs.map +1 -0
- package/dist/three.d.mts +4 -0
- package/dist/three.d.ts +4 -0
- package/dist/three.mjs +140 -0
- package/dist/three.mjs.map +1 -0
- package/package.json +289 -46
- package/dist/index.js +0 -1
- package/dist/index.min.js +0 -1
- package/dist/index.umd.js +0 -1
- package/index.js +0 -37
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1030 @@
|
|
|
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;
|
|
2
|
+
in vec2 v_textureCoordinates;
|
|
3
|
+
uniform float scale;
|
|
4
|
+
uniform vec3 offset;
|
|
5
|
+
void main() {
|
|
6
|
+
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
7
|
+
out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);
|
|
8
|
+
}
|
|
9
|
+
`;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"darkEffect",fragmentShader:a,uniforms:{scale:1,offset(){return n.offset||new e.Cartesian3(.1,.2,.3)}}}))}setBlurBloom(n){if(this._viewer&&n){var a=`uniform float height;
|
|
10
|
+
uniform float width;
|
|
11
|
+
uniform sampler2D colorTexture1;
|
|
12
|
+
|
|
13
|
+
in vec2 v_textureCoordinates;
|
|
14
|
+
|
|
15
|
+
const int SAMPLES = 9;
|
|
16
|
+
void main()
|
|
17
|
+
{
|
|
18
|
+
vec2 st = v_textureCoordinates;
|
|
19
|
+
float wr = float(1.0 / width);
|
|
20
|
+
float hr = float(1.0 / height);
|
|
21
|
+
vec4 result = vec4(0.0);
|
|
22
|
+
int count = 0;
|
|
23
|
+
for(int i = -SAMPLES; i <= SAMPLES; ++i){
|
|
24
|
+
for(int j = -SAMPLES; j <= SAMPLES; ++j){
|
|
25
|
+
vec2 offset = vec2(float(i) * wr, float(j) * hr);
|
|
26
|
+
result += texture(colorTexture1, st + offset);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
result = result / float(count);
|
|
30
|
+
out_FragColor = result;
|
|
31
|
+
}
|
|
32
|
+
`;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"blur_x_direction",fragmentShader:a,uniforms:{width:n.width,height:n.height,colorTexture1:"Bright"}}))}}setRainEffect(){if(this._viewer){var n=`uniform sampler2D colorTexture;
|
|
33
|
+
in vec2 v_textureCoordinates;
|
|
34
|
+
|
|
35
|
+
float hash(float x){
|
|
36
|
+
return fract(sin(x*23.3)*13.13);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
void main(){
|
|
40
|
+
float time = czm_frameNumber / 60.0;
|
|
41
|
+
vec2 resolution = czm_viewport.zw;
|
|
42
|
+
vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);
|
|
43
|
+
vec3 c=vec3(.6,.7,.8);
|
|
44
|
+
float a=-.4;
|
|
45
|
+
float si=sin(a),co=cos(a);
|
|
46
|
+
uv*=mat2(co,-si,si,co);
|
|
47
|
+
uv*=length(uv+vec2(0,4.9))*.3+1.;
|
|
48
|
+
float v=1.-sin(hash(floor(uv.x*100.))*2.);
|
|
49
|
+
float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;
|
|
50
|
+
c*=v*b;
|
|
51
|
+
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);
|
|
52
|
+
}
|
|
53
|
+
`;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"rainEffect",fragmentShader:n}))}}setSnowEffect(){if(this._viewer){var n=`uniform sampler2D colorTexture;
|
|
54
|
+
in vec2 v_textureCoordinates;
|
|
55
|
+
float snow(vec2 uv,float scale){
|
|
56
|
+
float time = czm_frameNumber / 60.0;
|
|
57
|
+
float w=smoothstep(1.,0.,-uv.y*(scale/10.));
|
|
58
|
+
if(w<.1)return 0.;
|
|
59
|
+
uv+=time/scale;
|
|
60
|
+
uv.y+=time*2./scale;
|
|
61
|
+
uv.x+=sin(uv.y+time*.5)/scale;
|
|
62
|
+
uv*=scale;
|
|
63
|
+
vec2 s=floor(uv),f=fract(uv),p;
|
|
64
|
+
float k=3.,d;
|
|
65
|
+
p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;
|
|
66
|
+
d=length(p);
|
|
67
|
+
k=min(d,k);
|
|
68
|
+
k=smoothstep(0.,k,sin(f.x+f.y)*0.01);
|
|
69
|
+
return k*w;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
void main(){
|
|
73
|
+
vec2 resolution = czm_viewport.zw;
|
|
74
|
+
vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);
|
|
75
|
+
vec3 finalColor=vec3(0);
|
|
76
|
+
float c = 0.0;
|
|
77
|
+
c+=snow(uv,30.)*.0;
|
|
78
|
+
c+=snow(uv,20.)*.0;
|
|
79
|
+
c+=snow(uv,15.)*.0;
|
|
80
|
+
c+=snow(uv,10.);
|
|
81
|
+
c+=snow(uv,8.);
|
|
82
|
+
c+=snow(uv,6.);
|
|
83
|
+
c+=snow(uv,5.);
|
|
84
|
+
finalColor=(vec3(c));
|
|
85
|
+
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
`;return this._viewer.scene.postProcessStages.add(new e.PostProcessStage({name:"snowEffect",fragmentShader:n}))}}setFogEffect(){if(this._viewer){var n=`float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
89
|
+
{
|
|
90
|
+
float depth = czm_unpackDepth(texture(depthTexture, texCoords));
|
|
91
|
+
if (depth == 0.0) {
|
|
92
|
+
return czm_infinity;
|
|
93
|
+
}
|
|
94
|
+
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);
|
|
95
|
+
return -eyeCoordinate.z / eyeCoordinate.w;
|
|
96
|
+
}
|
|
97
|
+
float interpolateByDistance(vec4 nearFarScalar, float distance)
|
|
98
|
+
{
|
|
99
|
+
float startDistance = nearFarScalar.x;
|
|
100
|
+
float startValue = nearFarScalar.y;
|
|
101
|
+
float endDistance = nearFarScalar.z;
|
|
102
|
+
float endValue = nearFarScalar.w;
|
|
103
|
+
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
|
|
104
|
+
return mix(startValue, endValue, t);
|
|
105
|
+
}
|
|
106
|
+
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
|
|
107
|
+
{
|
|
108
|
+
return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
|
|
109
|
+
}
|
|
110
|
+
uniform sampler2D colorTexture;
|
|
111
|
+
uniform sampler2D depthTexture;
|
|
112
|
+
uniform vec4 fogByDistance;
|
|
113
|
+
uniform vec4 fogColor;
|
|
114
|
+
in vec2 v_textureCoordinates;
|
|
115
|
+
void main(void)
|
|
116
|
+
{
|
|
117
|
+
float distance = getDistance(depthTexture, v_textureCoordinates);
|
|
118
|
+
vec4 sceneColor = texture(colorTexture, v_textureCoordinates);
|
|
119
|
+
float blendAmount = interpolateByDistance(fogByDistance, distance);
|
|
120
|
+
vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
|
|
121
|
+
out_FragColor = alphaBlend(finalFogColor, sceneColor);
|
|
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;
|
|
124
|
+
in vec3 v_texCoord;
|
|
125
|
+
void main()
|
|
126
|
+
{
|
|
127
|
+
vec4 color = texture(u_cubeMap, normalize(v_texCoord));
|
|
128
|
+
out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
|
|
129
|
+
}
|
|
130
|
+
`,_=`in vec3 position;
|
|
131
|
+
out vec3 v_texCoord;
|
|
132
|
+
uniform mat3 u_rotateMatrix;
|
|
133
|
+
void main()
|
|
134
|
+
{
|
|
135
|
+
vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
|
|
136
|
+
gl_Position = czm_projection * vec4(p, 1.0);
|
|
137
|
+
v_texCoord = position.xyz;
|
|
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=`
|
|
140
|
+
uniform vec4 color;
|
|
141
|
+
uniform float time;
|
|
142
|
+
uniform sampler2D image;
|
|
143
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
144
|
+
{
|
|
145
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
146
|
+
vec2 st = materialInput.st;
|
|
147
|
+
vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t));
|
|
148
|
+
material.alpha = colorImage.a * color.a;
|
|
149
|
+
material.diffuse = (colorImage.rgb+color.rgb)/2.0;
|
|
150
|
+
return material;
|
|
151
|
+
}`,e.Scene.PolylineTrailLinkMaterial=c,l.PolylineTrailLinkType="PolylineTrailLinkMaterial",l.PolylineTrailLinkImage=this.image||u||"static/data/images/Textures/river.png",l._materialCache.addMaterial(l.PolylineTrailLinkType,{fabric:{type:l.PolylineTrailLinkType,uniforms:{color:new n(1,1,1,1),image:l.PolylineTrailLinkImage,time:-20},source:l.PolylineTrailLinkSource},translucent:function(){return true}});}}return p}var Qe=te(In);var Se=function(){};Se.prototype={_getFlowLineShader:function(){return `uniform vec4 color;
|
|
152
|
+
uniform float duration;
|
|
153
|
+
|
|
154
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){
|
|
155
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
156
|
+
vec2 st = materialInput.st;
|
|
157
|
+
float t =fract(czm_frameNumber / duration);
|
|
158
|
+
t *= 1.03;
|
|
159
|
+
float alpha = smoothstep(t- 0.03, t, st.s) * step(-t, -st.s);
|
|
160
|
+
alpha += 0.1;
|
|
161
|
+
vec4 fragColor;
|
|
162
|
+
fragColor.rgb = (color.rgb) / 0.5;
|
|
163
|
+
fragColor = czm_gammaCorrect(fragColor);
|
|
164
|
+
material.diffuse = fragColor.rgb;
|
|
165
|
+
material.alpha = alpha;
|
|
166
|
+
material.emission = fragColor.rgb;
|
|
167
|
+
return material;
|
|
168
|
+
}
|
|
169
|
+
`},_getDynamicLineShader:function(e){if(e&&e.get)return `czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
170
|
+
{
|
|
171
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
172
|
+
vec2 st = materialInput.st;
|
|
173
|
+
|
|
174
|
+
if(texture(image, vec2(0.0, 0.0)).a == 1.0){
|
|
175
|
+
discard;
|
|
176
|
+
}else{
|
|
177
|
+
material.alpha = texture(image, vec2(1.0 - fract(time - st.s), st.t)).a * color.a;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);
|
|
181
|
+
|
|
182
|
+
return material;
|
|
183
|
+
}
|
|
184
|
+
`},_getDynamicLightLineShader:function(e){if(e&&e.get)return `czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
185
|
+
{
|
|
186
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
187
|
+
vec2 st = materialInput.st;
|
|
188
|
+
|
|
189
|
+
vec4 colorImage = texture(image, vec2(fract(1.0 *st.s - time), fract(st.t)));
|
|
190
|
+
|
|
191
|
+
vec4 fragColor;
|
|
192
|
+
fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;
|
|
193
|
+
fragColor = czm_gammaCorrect(fragColor);
|
|
194
|
+
material.diffuse = colorImage.rgb;
|
|
195
|
+
material.alpha = colorImage.a;
|
|
196
|
+
material.emission = fragColor.rgb;
|
|
197
|
+
|
|
198
|
+
return material;
|
|
199
|
+
}
|
|
200
|
+
`},_getDirectionWallShader:function(e){if(e&&e.get){var d=`czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
201
|
+
{
|
|
202
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
203
|
+
vec2 st = materialInput.st;
|
|
204
|
+
|
|
205
|
+
`;return e.freely=="vertical"?d+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.t "+e.direction+` time), fract(st.s)));
|
|
206
|
+
`:d+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.s "+e.direction+` time), fract(st.t)));
|
|
207
|
+
`,d+=`vec4 fragColor;
|
|
208
|
+
fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;
|
|
209
|
+
fragColor = czm_gammaCorrect(fragColor);
|
|
210
|
+
`,d+=` material.diffuse = colorImage.rgb;
|
|
211
|
+
material.alpha = colorImage.a;
|
|
212
|
+
material.emission = fragColor.rgb;
|
|
213
|
+
|
|
214
|
+
return material;
|
|
215
|
+
}
|
|
216
|
+
`,d}},_getCircleFadeShader:function(e){if(e&&e.get)return `czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
217
|
+
|
|
218
|
+
{
|
|
219
|
+
|
|
220
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
221
|
+
|
|
222
|
+
material.diffuse = 1.5 * color.rgb;
|
|
223
|
+
|
|
224
|
+
vec2 st = materialInput.st;
|
|
225
|
+
|
|
226
|
+
float dis = distance(st, vec2(0.5, 0.5));
|
|
227
|
+
|
|
228
|
+
float per = fract(time);
|
|
229
|
+
|
|
230
|
+
if(dis > per * 0.5){
|
|
231
|
+
|
|
232
|
+
//material.alpha = 0.0;
|
|
233
|
+
|
|
234
|
+
discard;
|
|
235
|
+
|
|
236
|
+
}else {
|
|
237
|
+
|
|
238
|
+
material.alpha = color.a * dis / per / 2.0;
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return material;
|
|
243
|
+
|
|
244
|
+
}`},_getDynamicCircleShader:function(e){if(e&&e.get)return `uniform vec4 color;
|
|
245
|
+
uniform float duration;
|
|
246
|
+
uniform float count;
|
|
247
|
+
uniform float gradient;
|
|
248
|
+
|
|
249
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
250
|
+
{
|
|
251
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
252
|
+
material.diffuse = 1.5 * color.rgb;
|
|
253
|
+
vec2 st = materialInput.st;
|
|
254
|
+
vec3 str = materialInput.str;
|
|
255
|
+
float dis = distance(st, vec2(0.5, 0.5));
|
|
256
|
+
float per = fract(czm_frameNumber / duration);
|
|
257
|
+
if(abs(str.z) > 0.001){
|
|
258
|
+
discard;
|
|
259
|
+
}
|
|
260
|
+
if(dis > 0.5){
|
|
261
|
+
discard;
|
|
262
|
+
} else {
|
|
263
|
+
float perDis = 0.5 / count;
|
|
264
|
+
float disNum;
|
|
265
|
+
float bl = .0;
|
|
266
|
+
for (int i = 0; i <= 10; i++) {
|
|
267
|
+
if (float(i) <= count) {
|
|
268
|
+
disNum = perDis * float(i) - dis + per / count;
|
|
269
|
+
if (disNum > 0.0) {
|
|
270
|
+
if (disNum < perDis) {
|
|
271
|
+
bl = 1.0 - disNum / perDis;
|
|
272
|
+
} else if (disNum - perDis < perDis) {
|
|
273
|
+
bl = 1.0 - abs(1.0 - disNum / perDis);
|
|
274
|
+
}
|
|
275
|
+
material.alpha = pow(bl, gradient);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return material;
|
|
281
|
+
}
|
|
282
|
+
`},_getRadarScanShader:function(e){if(e&&e.get)return `uniform sampler2D colorTexture;
|
|
283
|
+
uniform sampler2D depthTexture;
|
|
284
|
+
in vec2 v_textureCoordinates;
|
|
285
|
+
uniform vec4 u_scanCenterEC;
|
|
286
|
+
uniform vec3 u_scanPlaneNormalEC;
|
|
287
|
+
uniform vec3 u_scanLineNormalEC;
|
|
288
|
+
uniform float u_radius;
|
|
289
|
+
uniform vec4 u_scanColor;
|
|
290
|
+
|
|
291
|
+
vec4 toEye(in vec2 uv, in float depth){
|
|
292
|
+
vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));
|
|
293
|
+
vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);
|
|
294
|
+
posInCamera =posInCamera / posInCamera.w;
|
|
295
|
+
return posInCamera;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){
|
|
299
|
+
vec3 v01 = testPt - ptOnLine;
|
|
300
|
+
normalize(v01);
|
|
301
|
+
vec3 temp = cross(v01, lineNormal);
|
|
302
|
+
float d = dot(temp, u_scanPlaneNormalEC);
|
|
303
|
+
return d > 0.5;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){
|
|
307
|
+
vec3 v01 = point -planeOrigin;
|
|
308
|
+
float d = dot(planeNormal, v01) ;
|
|
309
|
+
return (point - planeNormal * d);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){
|
|
313
|
+
vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);
|
|
314
|
+
return length(tempPt - ptOnLine);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
float getDepth(in vec4 depth){
|
|
318
|
+
float z_window = czm_unpackDepth(depth);
|
|
319
|
+
z_window = czm_reverseLogDepth(z_window);
|
|
320
|
+
float n_range = czm_depthRange.near;
|
|
321
|
+
float f_range = czm_depthRange.far;
|
|
322
|
+
return (2.0 * z_window - n_range - f_range) / (f_range - n_range);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
void main(){
|
|
326
|
+
out_FragColor = texture(colorTexture, v_textureCoordinates);
|
|
327
|
+
float depth = getDepth( texture(depthTexture, v_textureCoordinates));
|
|
328
|
+
vec4 viewPos = toEye(v_textureCoordinates, depth);
|
|
329
|
+
vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);
|
|
330
|
+
float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);
|
|
331
|
+
float twou_radius = u_radius * 2.0;
|
|
332
|
+
if(dis < u_radius){
|
|
333
|
+
float f0 = 1.0 -abs(u_radius - dis) / u_radius;
|
|
334
|
+
f0 = pow(f0, 64.0);
|
|
335
|
+
vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;
|
|
336
|
+
float f = 0.0;
|
|
337
|
+
if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)){
|
|
338
|
+
float dis1= length(prjOnPlane.xyz - lineEndPt);
|
|
339
|
+
f = abs(twou_radius -dis1) / twou_radius;
|
|
340
|
+
f = pow(f, float(`+e.width+`));
|
|
341
|
+
}
|
|
342
|
+
if(float(`+e.border+`) > 0.0){
|
|
343
|
+
out_FragColor = mix(out_FragColor, u_scanColor, f + f0);
|
|
344
|
+
} else {
|
|
345
|
+
out_FragColor = mix(out_FragColor, u_scanColor, f);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
`},_getCircleScanShader:function(e){if(e&&e.get)return `uniform sampler2D colorTexture;
|
|
350
|
+
uniform sampler2D depthTexture;
|
|
351
|
+
in vec2 v_textureCoordinates;
|
|
352
|
+
uniform vec4 u_scanCenterEC;
|
|
353
|
+
uniform vec3 u_scanPlaneNormalEC;
|
|
354
|
+
uniform float u_radius;
|
|
355
|
+
uniform vec4 u_scanColor;
|
|
356
|
+
|
|
357
|
+
vec4 toEye(in vec2 uv, in float depth){
|
|
358
|
+
vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));
|
|
359
|
+
vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
|
|
360
|
+
posInCamera =posInCamera / posInCamera.w;
|
|
361
|
+
return posInCamera;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){
|
|
365
|
+
vec3 v01 = point - planeOrigin;
|
|
366
|
+
float d = dot(planeNormal, v01) ;
|
|
367
|
+
return (point - planeNormal * d);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
float getDepth(in vec4 depth){
|
|
371
|
+
float z_window = czm_unpackDepth(depth);
|
|
372
|
+
z_window = czm_reverseLogDepth(z_window);
|
|
373
|
+
float n_range = czm_depthRange.near;
|
|
374
|
+
float f_range = czm_depthRange.far;
|
|
375
|
+
return (2.0 * z_window - n_range - f_range) / (f_range - n_range);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
void main(){
|
|
379
|
+
out_FragColor = texture(colorTexture, v_textureCoordinates);
|
|
380
|
+
float depth = getDepth(texture(depthTexture, v_textureCoordinates));
|
|
381
|
+
vec4 viewPos = toEye(v_textureCoordinates, depth);
|
|
382
|
+
vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);
|
|
383
|
+
float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);
|
|
384
|
+
if(dis < u_radius){
|
|
385
|
+
float f = 1.0 - abs(u_radius - dis) / u_radius;
|
|
386
|
+
f = pow(f, float(`+e.border+`));
|
|
387
|
+
out_FragColor = mix(out_FragColor, u_scanColor, f);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
`}};function Mn(){let e={};class d{constructor(r,n){r&&(this._viewer=r,e=n);}splitCartesians3(r){for(var n=[],a=0;a<r.length;a+=3){var i=new e.Cartesian3(r[a],r[a+1],r[a+2]);n.push(i);}return n.push(n[0]),n}getLinkedPointList(r,n,a,i){if(this._viewer){var o=[],h=e.Cartographic.fromCartesian(r),s=e.Cartographic.fromCartesian(n),l=h.longitude*180/Math.PI,u=h.latitude*180/Math.PI,c=s.longitude*180/Math.PI,m=s.latitude*180/Math.PI,y=Math.sqrt((l-c)*(l-c)+(u-m)*(u-m)),f=y*a,g=e.Cartesian3.clone(r),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 o;var C=e.Cartesian3.angleBetween(g,v);o.push(r);for(var P=1;P<i-1;P++){var x=P*1/(i-1),b=1-x,M=Math.sin(b*C)/Math.sin(C),k=Math.sin(x*C)/Math.sin(C),_=e.Cartesian3.multiplyByScalar(g,M,new e.Cartesian3),S=e.Cartesian3.multiplyByScalar(v,k,new e.Cartesian3),L=e.Cartesian3.add(_,S,new e.Cartesian3),G=x*Math.PI,R=A*b+w*x+Math.sin(G)*f;L=e.Cartesian3.multiplyByScalar(L,R,L),o.push(L);}return o.push(n),o}}getPositionsAngle(r){if(r){var n=r.position1,a=r.position2,i=e.Transforms.eastNorthUpToFixedFrame(n),o=e.Matrix4.inverse(i,new e.Matrix4),h=e.Matrix4.multiplyByPoint(o,n,new e.Cartesian3),s=e.Matrix4.multiplyByPoint(o,a,new e.Cartesian3),l;r.type==="pitch"?l=Math.atan2(s.z-h.z,s.x-h.x):r.type==="heading"&&(l=Math.atan2(s.y-h.y,s.x-h.x));var u=l*(180/Math.PI);return u<0&&(u=u+360),u}}getPositionsArea(r){let n=0;if(r){let a=0,i=e.Ellipsoid.WGS84;r.push(r[0]);for(let o=1;o<r.length;o++){let h=i.cartographicToCartesian(this.transformWGS84ToCartographic(r[o-1])),s=i.cartographicToCartesian(this.transformWGS84ToCartographic(r[o]));a+=h.x*s.y-s.x*h.y;}n=Math.abs(a).toFixed(2);}return n}getPolygonArea(r){if(this._viewer){let n=Math.PI/180,a=180/Math.PI,i=function(s,l){var u=(s.lat||0)*n,c=(s.lng||s.lon||0)*n,m=(l.lat||0)*n,y=(l.lng||l.lon||0)*n;let f=-Math.atan2(Math.sin(c-y)*Math.cos(m),Math.cos(u)*Math.sin(m)-Math.sin(u)*Math.cos(m)*Math.cos(c-y));return f<0&&(f+=Math.PI*2),f=f*a,f},o=function(s,l,u){let c=i(l,s),m=i(l,u),y=c-m;return y<0&&(y+=360),y},h=0;for(let s=0;s<r.length-2;s++){let l=(s+1)%r.length,u=(s+2)%r.length,c=o(r[s],r[l],r[u]),m=this.getPointDistance(this.transformWGS84ToCartesian(r[s]),this.transformWGS84ToCartesian(r[l])),y=this.getPointDistance(this.transformWGS84ToCartesian(r[l]),this.transformWGS84ToCartesian(r[u]));h+=m*y*Math.abs(Math.sin(c));}return h.toFixed(2)}}getPointDistance(r,n){if(this._viewer){var a=e.Cartographic.fromCartesian(r),i=e.Cartographic.fromCartesian(n),o=new e.EllipsoidGeodesic;o.setEndPoints(a,i);var h=o.surfaceDistance;return h=Math.sqrt(Math.pow(h,2)+Math.pow(i.height-a.height,2)),h}}getPositionDistance(r){let n=0;for(let a=0;a<r.length-1;a++){let i=this.transformWGS84ToCartographic(r[a]),o=this.transformWGS84ToCartographic(r[a+1]),h=new e.EllipsoidGeodesic;h.setEndPoints(i,o);let s=h.surfaceDistance;s=Math.sqrt(Math.pow(s,2)+Math.pow(o.height-i.height,2)),n=n+s;}return n.toFixed(3)}getIntersectObj(r,n,a=[],i=false){if(this._viewer){var o=e.Cartesian3.normalize(e.Cartesian3.subtract(n,r,new e.Cartesian3),new e.Cartesian3),h=new e.Ray(r,o),s=[],l=this._viewer.scene;if(i)s=l.drillPickFromRay(h,10,a);else {var u=l.pickFromRay(h,a);e.defined(u)&&(s=[u]);}return s}}getPointOnEllipsoid(r,n,a,i,o,h,s,l,u,c){if(this._viewer){var m=new e.Cartesian3,y=new e.Cartesian3,f=new e.Quaternion,g=new e.Matrix3,v=r+n;e.Cartesian3.multiplyByScalar(i,Math.cos(v),m),e.Cartesian3.multiplyByScalar(a,Math.sin(v),y),e.Cartesian3.add(m,y,m);var A=Math.cos(r);A=A*A;var w=Math.sin(r);w=w*w;var C=h/Math.sqrt(s*A+o*w),P=C/l;return e.Quaternion.fromAxisAngle(m,P,f),e.Matrix3.fromQuaternion(f,g),e.Matrix3.multiplyByVector(g,u,c),e.Cartesian3.normalize(c,c),e.Cartesian3.multiplyByScalar(c,l,c),c}}raisePositionsToHeight(r,n,a){if(this._viewer){for(var i=new e.Cartesian3,o=new e.Cartesian3,h=new e.Cartesian3,s=new e.Cartesian3,l=n.ellipsoid,u=n.height,c=n.extrudedHeight,m=a?r.length/3*2:r.length/3,y=new Float64Array(m*3),f=r.length,g=a?f:0,v=0;v<f;v+=3){var A=v+1,w=v+2,C=e.Cartesian3.fromArray(r,v,i);l.scaleToGeodeticSurface(C,C);var P=e.Cartesian3.clone(C,o),x=l.geodeticSurfaceNormal(C,s),b=e.Cartesian3.multiplyByScalar(x,u,h);e.Cartesian3.add(C,b,C),a&&(e.Cartesian3.multiplyByScalar(x,c,b),e.Cartesian3.add(P,b,P),y[v+g]=P.x,y[A+g]=P.y,y[w+g]=P.z),y[v]=C.x,y[A]=C.y,y[w]=C.z;}return y}}computeEllipseEdgePositions(r){if(this._viewer){var n=new e.Cartesian3,a=new e.Cartesian3,i=new e.Cartesian3,o=new e.Cartesian3,h=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,c=r.granularity&&typeof r.granularity=="number"?r.granularity:Math.PI/180;c>Math.PI/12&&(c=Math.PI/12),c<Math.PI/180&&(c=Math.PI/180);var m=h*h,y=s*s,f=s*h,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,i),C=Math.ceil(e.Math.PI*2/c),P=c,x=0,b=o,M,k=0,_=[];for(M=0;M<C;M++)x=M*P,b=this.getPointOnEllipsoid(x,l,w,A,m,f,y,g,v,b),_[k++]=b.x,_[k++]=b.y,_[k++]=b.z;var S={numPts:C,outerPositions:_};return S}}computeSectorEdgePositions(r){if(this._viewer){var n=new e.Cartesian3,a=new e.Cartesian3,i=new e.Cartesian3,o=new e.Cartesian3,h=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.angle?r.angle:Math.PI*2,c=r.center,m=r.granularity&&typeof r.granularity=="number"?r.granularity:Math.PI/180;m>Math.PI/12&&(m=Math.PI/12),m<Math.PI/180&&(m=Math.PI/180);var y=h*h,f=s*s,g=s*h,v=e.Cartesian3.magnitude(c),A=e.Cartesian3.normalize(c,n),w=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,c,a);w=e.Cartesian3.normalize(w,w);var C=e.Cartesian3.cross(A,w,i),P=Math.ceil(u/m),x=m,b=0,M=o,k,_=0,S=[];for(k=0;k<P;k++)b=k*x,M=this.getPointOnEllipsoid(b,l,C,w,y,g,f,v,A,M),S[_++]=M.x,S[_++]=M.y,S[_++]=M.z;var L={numPts:P,outerPositions:S};return L}}computeLonlatPointsTerrainData(r,n){if(this._viewer){for(var a=[],i=0;i<r.length;i++)a.push(e.Cartographic.fromDegrees(r[i].lon,r[i].lat));var o=this._viewer.scene.clampToHeightMostDetailed(a);o.then(function(h){n(h);});}}computeCartographicPointsTerrainData(r,n){if(this._viewer){if(r.length<=0)return;for(var a=[],i=0;i<r.length;i++)a.push(e.Cartesian3.fromRadians(r[i].longitude,r[i].latitude,r[i].height));var o=this._viewer.scene.clampToHeightMostDetailed(a),h=this;o.then(function(s){for(var l=[],u=h._viewer.scene.globe.ellipsoid,c=0;c<s.length;c++)l.push(u.cartesianToCartographic(s[c]));n&&n(l);}).catch(function(s){console.log(s);});}}_checkLonDegree(r){return !(r>180||r<-180)}_checkLatDegree(r){return !(r>90||r<-90)}computeInterpolateLineLonlat(r,n){if(!r||!n||r.lon||!r.lat||!n.lon||!n.lat||!this._checkLonDegree(r.lon)||!this._checkLonDegree(n.lon)||!this._checkLatDegree(r.lat)||!this._checkLatDegree(n.lat))return null;var a=[];a.push([r.lon,r.lat]);var i=Math.sqrt(Math.pow(n.lon-r.lon,2)+Math.pow(n.lat-r.lat,2));if(i<=1e-5)return a.push([n.lon,n.lat]),a;for(var o=i/1e-5,h=(n.lon-r.lon)/o,s=(n.lat-r.lat)/o,l=0;l<o;l++){var u=r.lon+(l+1)*h,c=r.lat+(l+1)*s;a.push([u,c]);}return a}computeInterpolateLineCartographic(r,n,a){if(!r||!n||!r.longitude||!r.latitude||!n.longitude||!n.latitude)return null;var i=[];i.push(new e.Cartographic(r.longitude,r.latitude));var o=Math.sqrt(Math.pow(n.longitude-r.longitude,2)+Math.pow(n.latitude-r.latitude,2)),h=a&&typeof a=="number"?a:1e-5*Math.PI/180;if(o<=h)return i.push(new e.Cartographic(n.longitude,n.latitude)),i;for(var s=o/h,l=(n.longitude-r.longitude)/s,u=(n.latitude-r.latitude)/s,c=0;c<s;c++){var m=r.longitude+(c+1)*l,y=r.latitude+(c+1)*u;i.push(new e.Cartographic(m,y));}return i.push(new e.Cartographic(n.longitude,n.latitude,n.height)),i}computeInterpolateLineHeightCartographic(r,n){if(!r||!n||!r.longitude||!r.latitude||!n.longitude||!n.latitude)return null;var a=[];a.push(new e.Cartographic(r.longitude,r.latitude,r.height));var i=Math.sqrt(Math.pow(n.longitude-r.longitude,2)+Math.pow(n.latitude-r.latitude,2));if(i<=1e-5*Math.PI/180)return a.push(new e.Cartographic(n.longitude,n.latitude,n.height)),a;for(var o=i/1e-5*Math.PI/180,h=(n.longitude-r.longitude)/o,s=(n.latitude-r.latitude)/o,l=((n.height||0)-(r.height||0))/o,u=0;u<o;u++){var c=r.longitude+(u+1)*h,m=r.latitude+(u+1)*s,y=(r.height||0)+(u+1)*l;a.push(new e.Cartographic(c,m,y));}return a.push(new e.Cartographic(n.longitude,n.latitude,n.height)),a}computeInterpolate2IndexLineHeightCartographic(r,n,a,i){if(!r||!n||!r.longitude||!r.latitude||!n.longitude||!n.latitude)return null;var o=[];o.push(new e.Cartographic(r.longitude,r.latitude,r.height));for(var h=(n.longitude-r.longitude)/a,s=(n.latitude-r.latitude)/a,l=((n.height||0)-(r.height||0))/a,u=0;u<i;u++){var c=r.longitude+(u+1)*h,m=r.latitude+(u+1)*s,y=(r.height||0)+(u+1)*l;o.push(new e.Cartographic(c,m,y));}return o}computeInterpolateIndexLineHeightCartographic(r,n,a,i){if(!r||!n||!r.longitude||!r.latitude||!n.longitude||!n.latitude)return null;var o=(n.longitude-r.longitude)/a,h=(n.latitude-r.latitude)/a,s=((n.height||0)-(r.height||0))/a,l=r.longitude+i*o,u=r.latitude+i*h,c=(r.height||0)+i*s,m=new e.Cartographic(l,u,c);return m}}return d}var ve=te(Mn);var Tn=`in vec3 position3DHigh;
|
|
391
|
+
in vec3 position3DLow;
|
|
392
|
+
in float batchId;
|
|
393
|
+
in vec3 position;
|
|
394
|
+
in vec2 st;
|
|
395
|
+
out vec2 v_st;
|
|
396
|
+
uniform vec3 v1;
|
|
397
|
+
uniform vec3 v2;
|
|
398
|
+
|
|
399
|
+
// \u7F57\u5FB7\u91CC\u683C\u65CB\u8F6C\u516C\u5F0F
|
|
400
|
+
mat4 RodriguesRotation(vec3 v1, vec3 v2, float theta) {
|
|
401
|
+
|
|
402
|
+
vec3 _p = v2 - v1;
|
|
403
|
+
vec3 p = normalize(_p);
|
|
404
|
+
|
|
405
|
+
float x = p.x;
|
|
406
|
+
float y = p.y;
|
|
407
|
+
float z = p.z;
|
|
408
|
+
|
|
409
|
+
float xy = x * y;
|
|
410
|
+
float xx = x * x;
|
|
411
|
+
float xz = x * z;
|
|
412
|
+
float yy = y * y;
|
|
413
|
+
float yz = y * z;
|
|
414
|
+
float zz = z * z;
|
|
415
|
+
|
|
416
|
+
float sintheta = sin(radians(theta));
|
|
417
|
+
float costheta = cos(radians(theta));
|
|
418
|
+
|
|
419
|
+
float _m00 = costheta + xx * (1.0 - costheta);
|
|
420
|
+
float _m01 = z * sintheta + xy * (1.0 - costheta);
|
|
421
|
+
float _m02 = -y * sintheta + xz * (1.0 - costheta);
|
|
422
|
+
float _m03 = 0.0;
|
|
423
|
+
float _m10 = -z * sintheta + xy * (1.0 - costheta);
|
|
424
|
+
float _m11 = costheta + yy * (1.0 - costheta);
|
|
425
|
+
float _m12 = x * sintheta + yz * (1.0 - costheta);
|
|
426
|
+
float _m13 = 0.0;
|
|
427
|
+
float _m20 = y * sintheta + xz * (1.0 - costheta);
|
|
428
|
+
float _m21 = -x * sintheta + yz * (1.0 - costheta);
|
|
429
|
+
float _m22 = costheta + zz * (1.0 - costheta);
|
|
430
|
+
float _m23 = 0.0;
|
|
431
|
+
|
|
432
|
+
return mat4(_m00, _m01, _m02, _m03, _m10, _m11, _m12, _m13, _m20, _m21, _m22,
|
|
433
|
+
_m23, 0, 0, 0, 1.0);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
void main() {
|
|
437
|
+
float ty = abs(cos(czm_frameNumber / 60.0)) * 0.3;
|
|
438
|
+
mat4 translateY = mat4(1, 0, 0, 0, 0, 1, 0, ty, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
439
|
+
mat4 roatateAxis = RodriguesRotation(v1, v2, czm_frameNumber);
|
|
440
|
+
//vec4 roatePosition = roatateAxis * vec4(position, 1.0);
|
|
441
|
+
vec4 roatePosition = vec4(position, 1.0);
|
|
442
|
+
v_st = st;
|
|
443
|
+
gl_Position = czm_projection * czm_modelView * roatePosition * translateY;
|
|
444
|
+
}`,Bt=Tn;var En=`in vec2 v_st;
|
|
445
|
+
uniform sampler2D wenli;
|
|
446
|
+
uniform vec2 iResolution;
|
|
447
|
+
void main() {
|
|
448
|
+
vec2 uv = gl_FragCoord.xy / iResolution.xy;
|
|
449
|
+
float r = 0.01;
|
|
450
|
+
// \u4F7F\u7528length \u5B9E\u73B0\u5706\u5F27\u5149\u5E26
|
|
451
|
+
uv.x *= iResolution.x / iResolution.y;
|
|
452
|
+
float d = length(uv);
|
|
453
|
+
r = abs(sin(r * czm_frameNumber) * iResolution.x / iResolution.y);
|
|
454
|
+
vec4 wenli = texture(wenli, v_st);
|
|
455
|
+
vec4 centerColor = vec4(0.0, 255.0, 0.0, 1.0);
|
|
456
|
+
float ratio =
|
|
457
|
+
smoothstep(r, r + 0.02, d) - smoothstep(r + 0.0029, r + 0.06, d);
|
|
458
|
+
vec4 mixColor = vec4(mix(vec4(ratio), centerColor, ratio));
|
|
459
|
+
out_FragColor = vec4(mix(wenli, mixColor, ratio));
|
|
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
|
|
462
|
+
in vec3 position;
|
|
463
|
+
in vec3 normal;
|
|
464
|
+
in vec2 st;
|
|
465
|
+
in float batchId;
|
|
466
|
+
out vec3 v_positionEC;
|
|
467
|
+
out vec3 v_normalEC;
|
|
468
|
+
out vec2 v_st;
|
|
469
|
+
out vec4 v_pickColor;
|
|
470
|
+
void main()
|
|
471
|
+
{
|
|
472
|
+
v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;
|
|
473
|
+
v_normalEC = czm_normal * normal;
|
|
474
|
+
v_st = st;
|
|
475
|
+
// v_pickColor = czm_batchTable_pickColor(batchId);
|
|
476
|
+
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
477
|
+
}
|
|
478
|
+
`;return D},W=function(){var D=`#version 300 es
|
|
479
|
+
precision mediump float;
|
|
480
|
+
in vec3 v_positionEC;
|
|
481
|
+
in vec3 v_normalEC;
|
|
482
|
+
in vec2 v_st;
|
|
483
|
+
uniform vec4 color;
|
|
484
|
+
in vec4 v_pickColor;
|
|
485
|
+
uniform sampler2D myImage;
|
|
486
|
+
void main()
|
|
487
|
+
{
|
|
488
|
+
vec3 positionToEyeEC = -v_positionEC;
|
|
489
|
+
vec3 normalEC = normalize(v_normalEC);
|
|
490
|
+
#ifdef FACE_FORWARD
|
|
491
|
+
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
|
492
|
+
#endif
|
|
493
|
+
czm_materialInput materialInput;
|
|
494
|
+
materialInput.normalEC = normalEC;
|
|
495
|
+
materialInput.positionToEyeEC = positionToEyeEC;
|
|
496
|
+
materialInput.st = v_st;
|
|
497
|
+
vec2 st = materialInput.st;
|
|
498
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
499
|
+
float dt_a11 = fract(czm_frameNumber / 100.0) * 3.14159265 * 2.0;
|
|
500
|
+
float dt_a12 = sin(dt_a11);
|
|
501
|
+
float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;
|
|
502
|
+
vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));
|
|
503
|
+
material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;
|
|
504
|
+
material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);
|
|
505
|
+
#ifdef FLAT
|
|
506
|
+
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
507
|
+
#else
|
|
508
|
+
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
509
|
+
#endif
|
|
510
|
+
}
|
|
511
|
+
`;return D},ne=function(D){M.createIfNeeded(D._imageUrl).fetchImage().then(function(O){var J,$=D._viewer.scene.context;l(O.internalFormat)?J=new b({context:$,pixelFormat:O.internalFormat,width:O.naturalWidth,height:O.naturalHeight,source:{arrayBufferView:O.bufferView}}):J=new b({context:$,source:O}),D._texture=J;});},q=function(D){let O=k.eastNorthUpToFixedFrame(D._localPosition),J=P.fromScale(D._scale),$=P.multiply(O,J,new P);return D._scaleMatrix=J,D._enuMatrix=O,$},oe=function(D){let O=r.fromElements(0,0,D._distance,new e.Cartesian3),J=e.Matrix4.multiplyByPoint(D._enuMatrix,O,new r),$=P.multiplyByPoint(D._viewer.scene.camera._viewMatrix,J,new r),fe=P.multiplyByPoint(D._viewer.scene.camera.frustum.projectionMatrix,$,new r);return r.normalize(fe,new r).z};e.Scene.TetrahedronPrimitive=G;}catch(G){console.log(G);}},_installXyzAxisPrimitive:function(){function r(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();}r.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),i=n.boundingSphere,o=i.radius,h=new e.ArrowPolylinePrimitive({id:"axisZ",color:e.Color.RED,position:a,width:3,headWidth:5,length:o*2+50,headLength:10}),s=new e.ArrowPolylinePrimitive({id:"axisX",color:e.Color.GREEN,position:a,width:3,headWidth:5,length:o*2+50,headLength:10}),l=new e.ArrowPolylinePrimitive({id:"axisY",color:e.Color.BLUE,position:a,width:3,headWidth:5,length:o*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 c=e.Matrix3.fromRotationX(e.Math.toRadians(90));this._rotationY=e.Matrix4.fromRotationTranslation(c),e.Matrix4.multiply(l.geometryInstances[0].modelMatrix,this._rotationY,l.geometryInstances[0].modelMatrix),e.Matrix4.multiply(l.geometryInstances[1].modelMatrix,this._rotationY,l.geometryInstances[1].modelMatrix),this._layer._primitives.add(h),this._layer._primitives.add(s),this._layer._primitives.add(l),this._radius=i.radius,this._createAxisSphere();});},_createAxisSphere:function(){let n=[];for(let h=0;h<=360;h+=3){let s=Math.sin(e.Math.toRadians(h)),l=Math.cos(e.Math.toRadians(h)),u=this._radius*l,c=this._radius*s;n.push(new e.Cartesian3(u,c,0));}let a=this._createAxisSpheres("axisSphereZ",n,this._matrix,e.Color.RED);this._layer._primitives.add(a);let i=this._createAxisSpheres("axisSphereY",n,this._matrix,e.Color.GREEN);this._layer._primitives.add(i),e.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix);let o=this._createAxisSpheres("axisSphereX",n,this._matrix,e.Color.BLUE);this._layer._primitives.add(o),e.Matrix4.multiply(o.geometryInstances.modelMatrix,this._rotationX,o.geometryInstances.modelMatrix);},_createAxisSpheres:function(n,a,i,o){let h=new e.PolylineGeometry({positions:a,width:10}),s=new e.GeometryInstance({geometry:h,id:n,attributes:{color:e.ColorGeometryInstanceAttribute.fromColor(o)}});return new e.Primitive({geometryInstances:s,appearance:new e.PolylineColorAppearance({translucent:false}),modelMatrix:i})},_updateAxis(n){if(this._layer){let i=this._layer._primitives._primitives;for(let o=1,h=i.length;o<h;o++){let s=i[o],l=e.Matrix4.fromTranslation(new e.Cartesian3(n.x,n.y,n.z));e.Matrix4.multiply(s.modelMatrix,l,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 i=this._layer._primitives._primitives;for(let o=1,h=i.length;o<h;o++){let s=i[o],l=e.Matrix4.fromRotationTranslation(n);e.Matrix4.multiply(s.modelMatrix,l,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=r;},_installArrowPolylinePrimitive:function(){function r(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 i=a.id,o=e.CylinderGeometry.createGeometry(new e.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),h=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(h,[0,0,s]),new e.Primitive({modelMatrix:e.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new e.GeometryInstance({id:i+"-line",geometry:o}),new e.GeometryInstance({id:i+"-arrow",geometry:h})],appearance:new e.MaterialAppearance({material:e.Material.fromType("Color",{color:this._color})})})}let n=function(a,i){let o=new e.Cartesian3;i.length?(o.x=i[0],o.y=i[1],o.z=i[2]):e.Cartesian3.clone(i,o);for(let h=0;h<a.attributes.position.values.length;h+=3)a.attributes.position.values[h]+=o.x,a.attributes.position.values[h+1]+=o.y,a.attributes.position.values[h+2]+=o.z;};e.Scene.ArrowPolylinePrimitive=r;},_installShadowPrimitive:function(){let r=e.defaultValue||xe,n=`in vec3 position;
|
|
512
|
+
uniform mat4 u_modelViewMatrix;
|
|
513
|
+
void main()
|
|
514
|
+
{
|
|
515
|
+
gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);
|
|
516
|
+
}
|
|
517
|
+
`,a=`uniform vec4 u_bgColor;
|
|
518
|
+
void main()
|
|
519
|
+
{
|
|
520
|
+
out_FragColor = u_bgColor;
|
|
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=`
|
|
523
|
+
precision highp float;
|
|
524
|
+
struct Light {
|
|
525
|
+
vec3 position;
|
|
526
|
+
vec3 ambient;
|
|
527
|
+
vec3 diffuse;
|
|
528
|
+
vec3 specular;
|
|
529
|
+
};
|
|
530
|
+
in vec3 position;
|
|
531
|
+
in vec2 textureCoord;
|
|
532
|
+
|
|
533
|
+
uniform vec3 viewPos;
|
|
534
|
+
uniform Light light;
|
|
535
|
+
|
|
536
|
+
uniform sampler2D normalSampler;
|
|
537
|
+
uniform samplerCube skybox;
|
|
538
|
+
uniform float detalX;
|
|
539
|
+
|
|
540
|
+
void main() {
|
|
541
|
+
|
|
542
|
+
float z = gl_FragCoord.z / gl_FragCoord.w;
|
|
543
|
+
const float LOG2 = 1.442695;
|
|
544
|
+
float density = 0.005;
|
|
545
|
+
float normalFactor = exp( -density * density * z * z * LOG2 );
|
|
546
|
+
normalFactor = clamp(normalFactor, 0.0, 1.0);
|
|
547
|
+
|
|
548
|
+
vec4 normalTex1 = texture(normalSampler, vec2(textureCoord.s + detalX/1024.0, textureCoord.t - detalX/1024.0));
|
|
549
|
+
vec3 normalTex2 = texture(normalSampler, vec2(textureCoord.t, textureCoord.s)).rgb;
|
|
550
|
+
vec3 normal1 = normalize(vec3(normalTex1.r * 2.0 - 1.0, normalTex1.b,normalTex1.g*2.0-1.0));
|
|
551
|
+
vec3 normal2 = normalize(vec3(normalTex2.r * 2.0 - 1.0, normalTex2.b,normalTex2.g*2.0-1.0));
|
|
552
|
+
|
|
553
|
+
vec3 normal = mix(normal1,normal2,0.2);
|
|
554
|
+
|
|
555
|
+
normal = mix(vec3(0.0,1.0,0.0),normal,0.2);
|
|
556
|
+
|
|
557
|
+
normal = mix(vec3(0.0,1.0,0.0),normal,normalFactor);
|
|
558
|
+
|
|
559
|
+
vec3 viewDir = normalize(viewPos - position);
|
|
560
|
+
|
|
561
|
+
vec3 I = normalize(position - viewPos);
|
|
562
|
+
vec3 R = reflect(I, normal);
|
|
563
|
+
vec3 reflection = texture(skybox, R).rgb;
|
|
564
|
+
|
|
565
|
+
float ratio = 1.00 / 1.33;
|
|
566
|
+
vec3 Rr = refract(I, normal , ratio);
|
|
567
|
+
vec3 refraction = texture(skybox, Rr).rgb;
|
|
568
|
+
|
|
569
|
+
float reflectivity = 0.02;
|
|
570
|
+
float theta = max( dot( viewDir, normal ), 0.0 );
|
|
571
|
+
float reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 2.0 );
|
|
572
|
+
|
|
573
|
+
vec3 reflectanceColor = mix( refraction, reflection, reflectance );
|
|
574
|
+
|
|
575
|
+
out_FragColor = vec4(reflectanceColor,1.0);
|
|
576
|
+
|
|
577
|
+
}
|
|
578
|
+
`;return a},n.prototype.getVS=function(){var a=" in vec3 normal;in vec2 st;in float batchId; out vec3 v_normalEC;uniform mat4 u_modelViewMatrix;uniform mat4 u_invWorldViewMatrix;uniform int u_clampToGroud;uniform vec3 u_camPos;uniform vec3 u_scale;out vec3 vToEye;out vec2 vUv;out vec4 vCoord;void main(void){v_normalEC = czm_normal * normal;if (u_clampToGroud == 1){} else {vCoord = gl_Position;}vUv = st;}";return a},n.prototype.getFS2=function(){return `in vec3 v_positionMC;
|
|
579
|
+
in vec3 v_positionEC;
|
|
580
|
+
in vec2 v_st;
|
|
581
|
+
|
|
582
|
+
void main()
|
|
583
|
+
{
|
|
584
|
+
czm_materialInput materialInput;
|
|
585
|
+
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
|
|
586
|
+
#ifdef FACE_FORWARD
|
|
587
|
+
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
|
588
|
+
#endif
|
|
589
|
+
materialInput.s = v_st.s;
|
|
590
|
+
materialInput.st = v_st;
|
|
591
|
+
materialInput.str = vec3(v_st, 0.0);
|
|
592
|
+
materialInput.normalEC = normalEC;
|
|
593
|
+
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
|
|
594
|
+
vec3 positionToEyeEC = -v_positionEC;
|
|
595
|
+
materialInput.positionToEyeEC = positionToEyeEC;
|
|
596
|
+
czm_material material = czm_getMaterial(materialInput);
|
|
597
|
+
#ifdef FLAT
|
|
598
|
+
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
599
|
+
#else
|
|
600
|
+
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
601
|
+
out_FragColor.a = 0.5;
|
|
602
|
+
#endif
|
|
603
|
+
}
|
|
604
|
+
`},p.prototype.updateDegreesPosition=function(a,i){if(this.primitive!=null){if(this._viewer.scene.primitives.remove(this.primitive),a&&a.length<3)return;var o=this._createGeometry(a,i||0);this.primitive=this._viewer.scene.primitives.add(new e.Primitive({allowPicking:false,geometryInstances:new e.GeometryInstance({geometry:o}),appearance:this._appearance,asynchronous:false}));}else return},e.Scene.WaterPrimitive=n;},_installTexturePrimitive:function(){function r(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||"";}r.prototype.build=function(){for(var n=[],a=[0,0,1,0,1,1,0,1],i=[0,1,2,0,2,3],o=0;o<this._cartesians.length;o++)n.push(this._cartesians[o].x),n.push(this._cartesians[o].y),n.push(this._cartesians[o].z);this._positionArr=new Float32Array(n),this._sts=new Uint8Array(a),this._indiceArr=new Uint16Array(i),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}));},r.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)})},r.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})},r.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; } "},r.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; } "},r.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=r;},_installProbingPrimitive:function(){var r={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(i){this._viewer=n,this._length=i.length||r.length,this._center=i.center||r.center,this._color=i.color||r.color,this._repeat=i.repeat||r.repeat,this._offset=i.offset||r.offset,this._thickness=i.thickness||r.thickness,this._bottom=i.bottom||r.bottom,this._top=i.top||r.top,this._radar=void 0,this.build();}a.prototype.build=function(){var i=new e.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:e.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),o=new e.GeometryInstance({geometry:i,modelMatrix:this.getModelMatrix()}),h=new e.MaterialAppearance({material:this.getMaterial(),faceForward:false,closed:true}),s=this;this._radar=this._viewer.scene.primitives.add(new e.Primitive({geometryInstances:[o],appearance:h}));let l=function(){var u=s._radar.appearance.material.uniforms.offset;u-=.001,u>1&&(u=0),s._radar.appearance.material.uniforms.offset=u;};this._preUpdate=l,this._viewer.scene.preUpdate.addEventListener(l);},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 i=`uniform vec4 color;
|
|
605
|
+
uniform float repeat;
|
|
606
|
+
uniform float offset;
|
|
607
|
+
uniform float thickness;
|
|
608
|
+
|
|
609
|
+
czm_material czm_getMaterial(czm_materialInput materialInput){
|
|
610
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
611
|
+
float sp = 1.0/repeat;
|
|
612
|
+
vec2 st = materialInput.st;
|
|
613
|
+
float dis = distance(st, vec2(0.5));
|
|
614
|
+
float m = mod(dis + offset, sp);
|
|
615
|
+
float a = step(sp*(1.0-thickness), m);
|
|
616
|
+
|
|
617
|
+
material.diffuse = color.rgb;
|
|
618
|
+
material.alpha = a * color.a;
|
|
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:`
|
|
621
|
+
uniform vec4 color;
|
|
622
|
+
uniform float repeat;
|
|
623
|
+
uniform float offset;
|
|
624
|
+
uniform float thickness;
|
|
625
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
626
|
+
{
|
|
627
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
628
|
+
float sp = 1.0/repeat;
|
|
629
|
+
vec2 st = materialInput.st;
|
|
630
|
+
float dis = distance(st, vec2(0.5));
|
|
631
|
+
float m = mod(dis + offset, sp);
|
|
632
|
+
float a = step(sp*(1.0-thickness), m);
|
|
633
|
+
material.diffuse = color.rgb;
|
|
634
|
+
material.alpha = a * color.a;
|
|
635
|
+
vec3 normalMC = material.normal;
|
|
636
|
+
if(normalMC.y < 0.0 && normalMC.z < 0.0)
|
|
637
|
+
{
|
|
638
|
+
discard;
|
|
639
|
+
}
|
|
640
|
+
return material;
|
|
641
|
+
}`},translucent:true}),faceForward:false,closed:true,vertexShaderSource:`
|
|
642
|
+
in vec3 position3DHigh;
|
|
643
|
+
in vec3 position3DLow;
|
|
644
|
+
in vec3 normal;
|
|
645
|
+
in vec2 st;
|
|
646
|
+
in float batchId;
|
|
647
|
+
out vec3 v_positionEC;
|
|
648
|
+
out vec3 v_normalEC;
|
|
649
|
+
out vec2 v_st;
|
|
650
|
+
void main()
|
|
651
|
+
{
|
|
652
|
+
vec4 p = czm_computePosition();
|
|
653
|
+
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
654
|
+
v_normalEC = normal; // normal in world coordinates
|
|
655
|
+
v_st = st;
|
|
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),ie(this,()=>{this._viewer.scene.preUpdate.removeEventListener(w);}),g}},lighitCentrumScanEffect:function(p){let r=this.createLightScan_getCirclePoints(p.circle[0],p.circle[1],p.circle[2],p.circle[3]),n=this.createLightScan_entityCList(this._viewer,r,p);for(let a=0;a<n.length;a++)a!==n.length-1?this.createLightScan_changeOnePosition(p,n[a],[r[a].x,r[a].y,r[a+1].x,r[a+1].y]):this.createLightScan_changeOnePosition(p,n[a],[r[a].x,r[a].y,r[0].x,r[0].y]);return n},createLightScan_getCirclePoints:function(p,r,n,a){let i=[],o=Math.PI/180*Math.round(360/a),h=0;for(;h<a;h++){let s=r+p*Math.sin(o*h),l=n+p*Math.cos(o*h);i.unshift({x:s,y:l});}return i},createLightScan_changeOnePosition:function(p,r,n){let a=p.positionList,i,o,h,s,l,u,c=0,m=0;function y(f){i=a[f+1][0]-a[f][0],o=a[f+1][1]-a[f][1],h=i/p.number,s=o/p.number,m=0;}y(c),r.polygon.hierarchy=new e.CallbackProperty(function(){return Math.abs(l)>=Math.abs(i)&&Math.abs(u)>=Math.abs(o)&&(c=c+1,c===a.length-1&&(c=0),n[0]=n[0]+l,n[1]=n[1]+u,n[2]=n[2]+l,n[3]=n[3]+u,y(c)),l=m*h,u=m*s,m++,new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([p.observer[0],p.observer[1],p.observer[2],n[0]+l,n[1]+u,0,n[2]+l,n[3]+u,0]))},false);},createLightScan_entityCList:function(p,r,n){let a=n.observer[0],i=n.observer[1],o=n.observer[2],h=[];for(let s=0;s<r.length;s++){let l;s===r.length-1?l=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([a,i,o,r[s].x,r[s].y,0,r[0].x,r[0].y,0])):l=new e.PolygonHierarchy(e.Cartesian3.fromDegreesArrayHeights([a,i,o,r[s].x,r[s].y,0,r[s+1].x,r[s+1].y,0]));let u=p.entities.add({name:"\u4E09\u89D2\u5F62",polygon:{hierarchy:l,outline:false,perPositionHeight:true,material:n.material}});h.push(u);}return h},createFireParticleSystem(p){if(p&&p.position){let r=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))},p),{fireImage:n,startScale:a,endScale:i,minimumParticleLife:o,maximumParticleLife:h,minimumSpeed:s,maximumSpeed:l,particleSize:u,emissionRate:c,position:m,startColor:y,endColor:f,emitter:g}=r;return new e.ParticleSystem({image:n,startScale:a,endScale:i,minimumParticleLife:o,maximumParticleLife:h,minimumSpeed:s,maximumSpeed:l,emissionRate:c,startColor:y,endColor:f,emitter:g,imageSize:new e.Cartesian2(u,u),lifetime:16,loop:true,sizeInMeters:true,modelMatrix:e.Transforms.eastNorthUpToFixedFrame(m)})}}},d}var Je=te(On);var Ft=`#ifdef GL_OES_standard_derivatives
|
|
658
|
+
#extension GL_OES_standard_derivatives : enable
|
|
659
|
+
#endif
|
|
660
|
+
|
|
661
|
+
uniform bool u_showIntersection;
|
|
662
|
+
uniform bool u_showThroughEllipsoid;
|
|
663
|
+
|
|
664
|
+
uniform float u_radius;
|
|
665
|
+
uniform float u_xHalfAngle;
|
|
666
|
+
uniform float u_yHalfAngle;
|
|
667
|
+
uniform float u_normalDirection;
|
|
668
|
+
uniform vec4 u_color;
|
|
669
|
+
|
|
670
|
+
in vec3 v_position;
|
|
671
|
+
in vec3 v_positionWC;
|
|
672
|
+
in vec3 v_positionEC;
|
|
673
|
+
in vec3 v_normalEC;
|
|
674
|
+
|
|
675
|
+
vec4 getColor(float sensorRadius, vec3 pointEC) {
|
|
676
|
+
czm_materialInput materialInput;
|
|
677
|
+
|
|
678
|
+
vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;
|
|
679
|
+
materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);
|
|
680
|
+
materialInput.str = pointMC / sensorRadius;
|
|
681
|
+
|
|
682
|
+
vec3 positionToEyeEC = -v_positionEC;
|
|
683
|
+
materialInput.positionToEyeEC = positionToEyeEC;
|
|
684
|
+
|
|
685
|
+
vec3 normalEC = normalize(v_normalEC);
|
|
686
|
+
materialInput.normalEC = u_normalDirection * normalEC;
|
|
687
|
+
|
|
688
|
+
czm_material material = czm_getMaterial(materialInput);
|
|
689
|
+
|
|
690
|
+
material.diffuse = u_color.rgb;
|
|
691
|
+
material.alpha = u_color.a;
|
|
692
|
+
|
|
693
|
+
return mix(
|
|
694
|
+
czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),
|
|
695
|
+
vec4(material.diffuse, material.alpha), 0.4);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
bool isOnBoundary(float value, float epsilon) {
|
|
699
|
+
float width = getIntersectionWidth();
|
|
700
|
+
float tolerance = width * epsilon;
|
|
701
|
+
|
|
702
|
+
#ifdef GL_OES_standard_derivatives
|
|
703
|
+
float delta = max(abs(dFdx(value)), abs(dFdy(value)));
|
|
704
|
+
float pixels = width * delta;
|
|
705
|
+
float temp = abs(value);
|
|
706
|
+
// There are a couple things going on here.
|
|
707
|
+
// First we test the value at the current fragment to see if it is within the
|
|
708
|
+
// tolerance. We also want to check if the value of an adjacent pixel is
|
|
709
|
+
// within the tolerance, but we don't want to admit points that are obviously
|
|
710
|
+
// not on the surface. For example, if we are looking for "value" to be close
|
|
711
|
+
// to 0, but value is 1 and the adjacent value is 2, then the delta would be 1
|
|
712
|
+
// and "temp - delta" would be "1 - 1" which is zero even though neither of
|
|
713
|
+
// the points is close to zero.
|
|
714
|
+
return temp < tolerance && temp < pixels ||
|
|
715
|
+
(delta < 10.0 * tolerance && temp - delta < tolerance &&
|
|
716
|
+
temp < pixels);
|
|
717
|
+
#else
|
|
718
|
+
return abs(value) < tolerance;
|
|
719
|
+
#endif
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
vec4 shade(bool isOnBoundary) {
|
|
723
|
+
if (u_showIntersection && isOnBoundary) {
|
|
724
|
+
return getIntersectionColor();
|
|
725
|
+
}
|
|
726
|
+
return getColor(u_radius, v_positionEC);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
float ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {
|
|
730
|
+
vec3 scaled = inverseRadii * point;
|
|
731
|
+
return dot(scaled, scaled) - 1.0;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
void main() {
|
|
735
|
+
vec3 sensorVertexWC =
|
|
736
|
+
czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates
|
|
737
|
+
vec3 sensorVertexEC =
|
|
738
|
+
czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates
|
|
739
|
+
|
|
740
|
+
// vec3 pixDir = normalize(v_position);
|
|
741
|
+
float positionX = v_position.x;
|
|
742
|
+
float positionY = v_position.y;
|
|
743
|
+
float positionZ = v_position.z;
|
|
744
|
+
|
|
745
|
+
vec3 zDir = vec3(0.0, 0.0, 1.0);
|
|
746
|
+
vec3 lineX = vec3(positionX, 0, positionZ);
|
|
747
|
+
vec3 lineY = vec3(0, positionY, positionZ);
|
|
748
|
+
float resX = dot(normalize(lineX), zDir);
|
|
749
|
+
if (resX < cos(u_xHalfAngle) - 0.0001) {
|
|
750
|
+
discard;
|
|
751
|
+
}
|
|
752
|
+
float resY = dot(normalize(lineY), zDir);
|
|
753
|
+
if (resY < cos(u_yHalfAngle) - 0.0001) {
|
|
754
|
+
discard;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();
|
|
758
|
+
float ellipsoidValue =
|
|
759
|
+
ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);
|
|
760
|
+
|
|
761
|
+
// Occluded by the ellipsoid?
|
|
762
|
+
if (!u_showThroughEllipsoid) {
|
|
763
|
+
// Discard if in the ellipsoid
|
|
764
|
+
// PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done
|
|
765
|
+
// on the CPU first.
|
|
766
|
+
if (ellipsoidValue < 0.0) {
|
|
767
|
+
discard;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// Discard if in the sensor's shadow
|
|
771
|
+
if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,
|
|
772
|
+
v_positionWC)) {
|
|
773
|
+
discard;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// Notes: Each surface functions should have an associated tolerance based on
|
|
778
|
+
// the floating point error.
|
|
779
|
+
bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);
|
|
780
|
+
out_FragColor = shade(isOnEllipsoid);
|
|
781
|
+
}`,bt=`in vec4 position;
|
|
782
|
+
in vec3 normal;
|
|
783
|
+
|
|
784
|
+
out vec3 v_position;
|
|
785
|
+
out vec3 v_positionWC;
|
|
786
|
+
out vec3 v_positionEC;
|
|
787
|
+
out vec3 v_normalEC;
|
|
788
|
+
|
|
789
|
+
void main() {
|
|
790
|
+
gl_Position = czm_modelViewProjection * position;
|
|
791
|
+
v_position = vec3(position);
|
|
792
|
+
v_positionWC = (czm_model * position).xyz;
|
|
793
|
+
v_positionEC = (czm_modelView * position).xyz;
|
|
794
|
+
v_normalEC = czm_normal * normal;
|
|
795
|
+
}`,lt=`uniform vec4 u_intersectionColor;
|
|
796
|
+
uniform float u_intersectionWidth;
|
|
797
|
+
uniform vec4 u_lineColor;
|
|
798
|
+
|
|
799
|
+
bool inSensorShadow(vec3 coneVertexWC, vec3 inverseRadii, vec3 pointWC) {
|
|
800
|
+
// Diagonal matrix from the unscaled ellipsoid space to the scaled space.
|
|
801
|
+
vec3 D = inverseRadii;
|
|
802
|
+
|
|
803
|
+
// Sensor vertex in the scaled ellipsoid space
|
|
804
|
+
vec3 q = D * coneVertexWC;
|
|
805
|
+
float qMagnitudeSquared = dot(q, q);
|
|
806
|
+
float test = qMagnitudeSquared - 1.0;
|
|
807
|
+
|
|
808
|
+
// Sensor vertex to fragment vector in the ellipsoid's scaled space
|
|
809
|
+
vec3 temp = D * pointWC - q;
|
|
810
|
+
float d = dot(temp, q);
|
|
811
|
+
|
|
812
|
+
// Behind silhouette plane and inside silhouette cone
|
|
813
|
+
return (d < -test) && (d / length(temp) < -sqrt(test));
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
817
|
+
|
|
818
|
+
vec4 getLineColor() { return u_lineColor; }
|
|
819
|
+
|
|
820
|
+
vec4 getIntersectionColor() { return u_intersectionColor; }
|
|
821
|
+
|
|
822
|
+
float getIntersectionWidth() { return u_intersectionWidth; }
|
|
823
|
+
|
|
824
|
+
vec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) {
|
|
825
|
+
// (s, t) both in the range [0, 1]
|
|
826
|
+
float t = pointMC.z / sensorRadius;
|
|
827
|
+
float s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);
|
|
828
|
+
s = s - floor(s);
|
|
829
|
+
|
|
830
|
+
return vec2(s, t);
|
|
831
|
+
}`,_t=`#ifdef GL_OES_standard_derivatives
|
|
832
|
+
#extension GL_OES_standard_derivatives : enable
|
|
833
|
+
#endif
|
|
834
|
+
|
|
835
|
+
uniform bool u_showIntersection;
|
|
836
|
+
uniform bool u_showThroughEllipsoid;
|
|
837
|
+
|
|
838
|
+
uniform float u_radius;
|
|
839
|
+
uniform float u_xHalfAngle;
|
|
840
|
+
uniform float u_yHalfAngle;
|
|
841
|
+
uniform float u_normalDirection;
|
|
842
|
+
uniform float u_type;
|
|
843
|
+
|
|
844
|
+
in vec3 v_position;
|
|
845
|
+
in vec3 v_positionWC;
|
|
846
|
+
in vec3 v_positionEC;
|
|
847
|
+
in vec3 v_normalEC;
|
|
848
|
+
|
|
849
|
+
vec4 getColor(float sensorRadius, vec3 pointEC) {
|
|
850
|
+
czm_materialInput materialInput;
|
|
851
|
+
|
|
852
|
+
vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;
|
|
853
|
+
materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);
|
|
854
|
+
materialInput.str = pointMC / sensorRadius;
|
|
855
|
+
|
|
856
|
+
vec3 positionToEyeEC = -v_positionEC;
|
|
857
|
+
materialInput.positionToEyeEC = positionToEyeEC;
|
|
858
|
+
|
|
859
|
+
vec3 normalEC = normalize(v_normalEC);
|
|
860
|
+
materialInput.normalEC = u_normalDirection * normalEC;
|
|
861
|
+
|
|
862
|
+
czm_material material = czm_getMaterial(materialInput);
|
|
863
|
+
|
|
864
|
+
return mix(
|
|
865
|
+
czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),
|
|
866
|
+
vec4(material.diffuse, material.alpha), 0.4);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
bool isOnBoundary(float value, float epsilon) {
|
|
870
|
+
float width = getIntersectionWidth();
|
|
871
|
+
float tolerance = width * epsilon;
|
|
872
|
+
|
|
873
|
+
#ifdef GL_OES_standard_derivatives
|
|
874
|
+
float delta = max(abs(dFdx(value)), abs(dFdy(value)));
|
|
875
|
+
float pixels = width * delta;
|
|
876
|
+
float temp = abs(value);
|
|
877
|
+
// There are a couple things going on here.
|
|
878
|
+
// First we test the value at the current fragment to see if it is within the
|
|
879
|
+
// tolerance. We also want to check if the value of an adjacent pixel is
|
|
880
|
+
// within the tolerance, but we don't want to admit points that are obviously
|
|
881
|
+
// not on the surface. For example, if we are looking for "value" to be close
|
|
882
|
+
// to 0, but value is 1 and the adjacent value is 2, then the delta would be 1
|
|
883
|
+
// and "temp - delta" would be "1 - 1" which is zero even though neither of
|
|
884
|
+
// the points is close to zero.
|
|
885
|
+
return temp < tolerance && temp < pixels ||
|
|
886
|
+
(delta < 10.0 * tolerance && temp - delta < tolerance &&
|
|
887
|
+
temp < pixels);
|
|
888
|
+
#else
|
|
889
|
+
return abs(value) < tolerance;
|
|
890
|
+
#endif
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
vec4 shade(bool isOnBoundary) {
|
|
894
|
+
if (u_showIntersection && isOnBoundary) {
|
|
895
|
+
return getIntersectionColor();
|
|
896
|
+
}
|
|
897
|
+
if (u_type == 1.0) {
|
|
898
|
+
return getLineColor();
|
|
899
|
+
}
|
|
900
|
+
return getColor(u_radius, v_positionEC);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
float ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {
|
|
904
|
+
vec3 scaled = inverseRadii * point;
|
|
905
|
+
return dot(scaled, scaled) - 1.0;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
void main() {
|
|
909
|
+
vec3 sensorVertexWC =
|
|
910
|
+
czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates
|
|
911
|
+
vec3 sensorVertexEC =
|
|
912
|
+
czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates
|
|
913
|
+
|
|
914
|
+
// vec3 pixDir = normalize(v_position);
|
|
915
|
+
float positionX = v_position.x;
|
|
916
|
+
float positionY = v_position.y;
|
|
917
|
+
float positionZ = v_position.z;
|
|
918
|
+
|
|
919
|
+
vec3 zDir = vec3(0.0, 0.0, 1.0);
|
|
920
|
+
vec3 lineX = vec3(positionX, 0, positionZ);
|
|
921
|
+
vec3 lineY = vec3(0, positionY, positionZ);
|
|
922
|
+
float resX = dot(normalize(lineX), zDir);
|
|
923
|
+
if (resX < cos(u_xHalfAngle) - 0.00001) {
|
|
924
|
+
discard;
|
|
925
|
+
}
|
|
926
|
+
float resY = dot(normalize(lineY), zDir);
|
|
927
|
+
if (resY < cos(u_yHalfAngle) - 0.00001) {
|
|
928
|
+
discard;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();
|
|
932
|
+
float ellipsoidValue =
|
|
933
|
+
ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);
|
|
934
|
+
|
|
935
|
+
// Occluded by the ellipsoid?
|
|
936
|
+
if (!u_showThroughEllipsoid) {
|
|
937
|
+
// Discard if in the ellipsoid
|
|
938
|
+
// PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done
|
|
939
|
+
// on the CPU first.
|
|
940
|
+
if (ellipsoidValue < 0.0) {
|
|
941
|
+
discard;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
// Discard if in the sensor's shadow
|
|
945
|
+
if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,
|
|
946
|
+
v_positionWC)) {
|
|
947
|
+
discard;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// Notes: Each surface functions should have an associated tolerance based on
|
|
952
|
+
// the floating point error.
|
|
953
|
+
bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);
|
|
954
|
+
// isOnEllipsoid = false;
|
|
955
|
+
// if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81)){
|
|
956
|
+
/*if(false){
|
|
957
|
+
out_FragColor = vec4(1.0,0.0,0.0,1.0);
|
|
958
|
+
}else{
|
|
959
|
+
out_FragColor = shade(isOnEllipsoid);
|
|
960
|
+
}
|
|
961
|
+
*/
|
|
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
|
|
964
|
+
in vec3 v_position;
|
|
965
|
+
in vec3 v_normal;
|
|
966
|
+
uniform float picked;
|
|
967
|
+
uniform vec4 pickedColor;
|
|
968
|
+
uniform vec4 defaultColor;
|
|
969
|
+
uniform float specular;
|
|
970
|
+
uniform float shininess;
|
|
971
|
+
uniform vec3 emission;
|
|
972
|
+
in vec2 v_st;
|
|
973
|
+
uniform bool isLine;
|
|
974
|
+
uniform float glowPower;
|
|
975
|
+
void main() {
|
|
976
|
+
vec3 positionToEyeEC = -v_position;
|
|
977
|
+
vec3 normalEC = normalize(v_normal);
|
|
978
|
+
vec4 color = defaultColor;
|
|
979
|
+
if (picked != 0.0) {
|
|
980
|
+
color = pickedColor;
|
|
981
|
+
}
|
|
982
|
+
czm_material material;
|
|
983
|
+
material.specular = specular;
|
|
984
|
+
material.shininess = shininess;
|
|
985
|
+
material.normal = normalEC;
|
|
986
|
+
material.emission = emission;//vec3(0.2,0.2,0.2);
|
|
987
|
+
material.diffuse = color.rgb ;
|
|
988
|
+
if(isLine){
|
|
989
|
+
material.alpha = 1.0;
|
|
990
|
+
}
|
|
991
|
+
else{
|
|
992
|
+
material.alpha = color.a;
|
|
993
|
+
}
|
|
994
|
+
if(v_st.x==0.0){
|
|
995
|
+
out_FragColor =color ;
|
|
996
|
+
}else {
|
|
997
|
+
out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ;
|
|
998
|
+
}
|
|
999
|
+
}`},d.prototype.getVertexShaderSource=function(r){return `#version 300 es
|
|
1000
|
+
#ifdef GL_ES
|
|
1001
|
+
precision highp float;
|
|
1002
|
+
#endif
|
|
1003
|
+
|
|
1004
|
+
in vec3 position;
|
|
1005
|
+
in vec2 st;
|
|
1006
|
+
in vec3 normal;
|
|
1007
|
+
uniform mat4 modelViewMatrix;
|
|
1008
|
+
uniform mat3 normalMatrix;
|
|
1009
|
+
uniform mat4 projectionMatrix;
|
|
1010
|
+
out vec3 v_position;
|
|
1011
|
+
out vec3 v_normal;
|
|
1012
|
+
out vec2 v_st;
|
|
1013
|
+
|
|
1014
|
+
out vec3 v_light0Direction;
|
|
1015
|
+
|
|
1016
|
+
void main(void)
|
|
1017
|
+
{
|
|
1018
|
+
vec4 pos = modelViewMatrix * vec4( position,1.0);
|
|
1019
|
+
v_normal = normalMatrix * normal;
|
|
1020
|
+
v_st = st;
|
|
1021
|
+
v_position = pos.xyz;
|
|
1022
|
+
v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);
|
|
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,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABmDSURBVHgB7d0LdBTXeQfw/+gFkhEsCBACCa8BY2OcIAx2gh+x3MRpmpzEkDatSRwDTdLG6cOmdU6b06ZG7WnTJO3BSZr2tDkJwkmbJk1rktoxcZwix8bxCyPbGBts8GKBeIOMeEraub3fzC6a165eM/vS/3fO9Uq7s6thvPe7371z5w5ARERERERERGOBASp5avu/xAEzBlSkHoOUdevXdEHCWHxXAjQmMACUGPXsN5tRbrSgrGyR/rVZPxPXj7ERfJQOBkYHytCBfnMfzGSHce0ftYNKCgNAkVPb18dgVq7WFf5m/VuL/l86kso+DEY7ynRg6O37MQNC8WMAKEIDlR63QenWPn8S+hvUrjOEjQwGxYkBoIio59a3oKLyNphqNUaW1kfISOj/tOvMoNVYtjYBKgoMAEXAqvjlFfdBSYo/DOX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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+C0tLdHOzg4BEEcCQzQ8PCx08vPzKTc3lzIyMqigoICMjIzMtre3vxNKao1OAO3t7c/n5+cjo6KiKDw8nDjM5OzsrDDnOXJ3dyfJ+cTEBO3v71NMTIxiDMrsnMLCwoij6NrZ2ZmPMWXSCYDP+n0+V+EcO729vSVEQTI+PT0lV1dXqSsAQt/KykoxJgmwMzMzI7b5SBqTuE4ArOzs4eFB19fXdHJyIvT39vawEyFfXFzQs2fPhIxma2uLbGxsIGolJycnrOOvPqkVAF8xS3ZgzIlHzc3NNDg4KOxGRkaot7eXenp6iOdFwokJHQ2OBYRpgON8egOyMmkA6Orqem5tbb0rk8mIuTjTzMxMKi0tJSRXQkKCcI5FFhcXwXQSbsn09LSYBwC5XK7Pm3tbDNw3KgD6+vqcVldXPzM2NjYsLi6mlJQUCg4OFslnaGgoQuzv70/x8fGkp6dHrHu/zEvGDl4K9y2iJOUE1xAxam5u7iCE+0YFACfbxxwmIzhgEPcqmgzJhqQ6Pz+nmZkZoYDryYkrZKm5uroSdULqg7OdKb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DiJeXJHoAlctAFSWGYRTnMbc7lgnUqpjETrp9VRUR8xmQ9KwRFwAGiACmwGMrAC8EQbuGLNyHlBky2Nz0DU/Ty1WkSuevT9lJ2Z+UGjUu3fpVQWoUCVbJDJLmFnbqyKimpcGRFhxsXbLxQIRhBIFolmTqK5Zv47ZkVkBg05WqjRWFqqqsiKyNCP5ooKjam6et/z2to9pECNNjXtHjcadzpaW1Nn2tuT3CZTbHNl5WiESFTiG+xnwPfg3+4bLZavbo+nw/e8YTVwp62N3Cm3gjKA/w/yDWXrN3Z0WBzT0zsQ9QR4FfAOzAoEkDeOubNVLv/1IEMg7zoK2AAClyWT1foZJ3gKzMCrgA1g/yFvHHPncl1dLIKuAZ4CNsCLYhzcNZm6p1wuUsCa6NCwGFAmJUUjMamGyWh5CouBlq4uUqbfIPMQ4CksBirq68nKL/Iy/x6E3EC5wdD5w+0eRr4FX15DbuDV4KAbyckrGxp/hdyAyWqV+KednwmpgaKyssdjNht5lN+cT8nv+RmY8bgH+D+ZG2ElUple3wN6Y/X6Pmle3mvQL8nNHQCD0TrdEKfTDXNa7XuxVjtCuGc2xyF6L3gJFhRt4Gpq9yNF8jOjwJe27596sJLz43b7OXD2m91+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: `+(" ("+U.longitude.toFixed(6))+"\xB0,"+U.latitude.toFixed(6)+"\xB0,"+U.height.toFixed(2)+`)
|
|
1026
|
+
\u5782\u76F4\u8DDD\u79BB: `+W.toFixed(2)+`m
|
|
1027
|
+
\u6C34\u5E73\u8DDD\u79BB: `+K.toFixed(2)+`m
|
|
1028
|
+
\u7A7A\u95F4\u8DDD\u79BB: `+ne.toFixed(2)+`m
|
|
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
|
|
1030
|
+
//# sourceMappingURL=index.cjs.map
|