cesium_dev_kit 1.1.23 → 1.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,7 +120,7 @@ void main(void)
120
120
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
121
121
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
122
122
  }
123
- `;return this._viewer.scene.postProcessStages.add(new t.PostProcessStage({fragmentShader:e,uniforms:{fogByDistance:new t.Cartesian4(10,0,200,.3),fogColor:t.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(e){e&&(Array.isArray(e)?e.forEach(n=>{this._viewer.scene.postProcessStages.contains(n)&&this._viewer.scene.postProcessStages.remove(n);}):this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e));}setView(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,window.opt.distance);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)}});}}flyTo(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,0);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)},easingFunction:e.easingFunction||t.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback});}}transformCartesianToWGS84(e){var n,i,a;if(this._viewer&&e){if(e.x===void 0&&(e.lng!==void 0||e.lon!==void 0))return {lng:Number((n=e.lng)!=null?n:e.lon),lat:Number(e.lat),alt:Number((a=(i=e.alt)!=null?i:e.height)!=null?a:0)};let m=t.Cartographic.fromCartesian(e);return {lng:t.Math.toDegrees(m.longitude),lat:t.Math.toDegrees(m.latitude),alt:m.height}}}transformWGS84ArrayToCartesianArray(e,n){if(this._viewer&&e){var i=this;return e?e.map(function(a){return i.transformWGS84ToCartesian(a,n)}):[]}}transformWGS84ToCartesian(e,n){if(this._viewer)return e?t.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=n||e.alt,t.Ellipsoid.WGS84):t.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(e){if(this._viewer){var n=this;return e?e.map(function(i){return n.transformCartesianToWGS84(i)}).filter(function(i){return !!i}):[]}}transformWGS84ToCartographic(e){return e?t.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):t.Cartographic.ZERO}lnglatArrayToCartesians(e){if(!e||e.length<1)return [];let n=[];for(let i=0;i<e.length;i++){let a=t.Cartesian3.fromDegrees(Number(e[i][0]),Number(e[i][1]),Number(e[i][2]||0));n.push(a);}return n}setCameraEotateHeading(e){if(e){let n=this._viewer,i=t.Cartesian3.fromDegrees(e.lng,e.lat,e.height),a=t.Math.toRadians(-30),m=360/30,c=5e3,y=t.JulianDate.fromDate(new Date);n.clock.startTime=y.clone(),n.clock.currentTime=y.clone(),n.clock.clockRange=t.ClockRange.CLAMPED,n.clock.clockStep=t.ClockStep.SYSTEM_CLOCK;let h=n.camera.heading,u=function(){let _=t.JulianDate.secondsDifference(n.clock.currentTime,n.clock.startTime),x=t.Math.toRadians(_*m)+h;n.scene.camera.setView({destination:i,orientation:{heading:x,pitch:a}}),n.scene.camera.moveBackward(c),t.JulianDate.compare(n.clock.currentTime,n.clock.stopTime)>=0&&n.clock.onTick.removeEventListener(u);};n.clock.onTick.addEventListener(u),ye(this,()=>{n.clock.onTick.removeEventListener(u);});}}getCatesian3FromPX(e){if(this._viewer&&e){var n=this._viewer.scene.pick(e),i=null,a=false,m=false;if(n instanceof t.Cesium3DTileFeature&&(a=true),a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!n){var c=this._viewer.scene.camera.getPickRay(e);if(!c)return null;i=this._viewer.scene.globe.pick(c,this._viewer.scene),m=true;}if(n&&!a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!a&&!m&&!n&&(i=this._viewer.scene.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid)),i){let y=this.transformCartesianToWGS84(i);return y.alt<0&&(i=this.transformWGS84ToCartesian(y,.1)),i}return false}}getCameraPosition(){if(this._viewer){var e=this._viewer.scene.camera.pickEllipsoid(new t.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(e){var n=t.Ellipsoid.WGS84.cartesianToCartographic(e),i=n.longitude*180/Math.PI,a=n.latitude*180/Math.PI,m=this._viewer.camera._direction,c=t.Math.toDegrees(m.x),y=t.Math.toDegrees(m.y),h=t.Math.toDegrees(m.z),u=this._viewer.camera.positionCartographic.height,g=t.Math.toDegrees(this._viewer.camera.heading),_=t.Math.toDegrees(this._viewer.camera.pitch),x=t.Math.toDegrees(this._viewer.camera.roll),D=this._viewer.camera.computeViewRectangle(),O=D.west/Math.PI*180,z=D.north/Math.PI*180,b=D.east/Math.PI*180,F=D.south/Math.PI*180,E=(O+b)/2,V=(z+F)/2;return {lon:i,lat:a,height:u,heading:g,pitch:_,roll:x,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:E,y:V},direction:new t.Cartesian3(c,y,h)}}}}pickUpPosition(e){return this.getCatesian3FromPX(e.position)}getHandlerClickPosition(e){if(this._viewer){let n=this._viewer.scene,i=this._viewer,a=n.camera.pickEllipsoid(e.position,n.globe.elliposid),m={cameraPosistion:i.camera.position,heading:i.camera.heading,pitch:i.camera.pitch,roll:i.camera.roll},c=t.Cartographic.fromCartesian(a);c.height<0&&(c.height=0);let y={alt:c.height,lat:t.Math.toDegrees(c.latitude),lon:t.Math.toDegrees(c.longitude)},h=n.pickPosition(e.position),u=t.Cartographic.fromCartesian(h),g={height:u.height,latitude:t.Math.toDegrees(u.latitude),longitude:t.Math.toDegrees(u.longitude)};return {wgs84Coor:y,graphicCoor:g,cameraPosition:m}}}updateCameraState(e){this._viewer.scene._screenSpaceCameraController.enableRotate=e,this._viewer.scene._screenSpaceCameraController.enableTranslate=e,this._viewer.scene._screenSpaceCameraController.enableZoom=e,this._viewer.scene._screenSpaceCameraController.enableTilt=e,this._viewer.scene._screenSpaceCameraController.enableLook=e;}bindHandleEvent({leftClick:e,mouseMove:n,doubleClick:i,leftDown:a,mouseWheel:m,leftUp:c}){if(this._viewer){var y=new t.ScreenSpaceEventHandler(this._viewer.canvas);ye(this,()=>{y&&!y.isDestroyed()&&y.destroy();}),e&&y.setInputAction(function(h){e(h,y);},t.ScreenSpaceEventType.LEFT_CLICK),n&&y.setInputAction(function(h){n(h,y);},t.ScreenSpaceEventType.MOUSE_MOVE),i&&y.setInputAction(function(h){i(h,y);},t.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),a&&y.setInputAction(function(h){a(h,y);},t.ScreenSpaceEventType.LEFT_DOWN),m&&y.setInputAction(function(h){m(h,y);},t.ScreenSpaceEventType.WHEEL),c&&y.setInputAction(function(h){c(h,y);},t.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(e){return this.bindHandleEvent(e)}getHandlePosition(e){if(this._viewer){var n=new t.ScreenSpaceEventHandler(this._viewer.scene.canvas),i=this;ye(this,()=>{n&&!n.isDestroyed()&&n.destroy();}),n.setInputAction(function(a){var m=i._viewer.scene.camera.pickEllipsoid(a.endPosition,i._viewer.scene.globe.ellipsoid);typeof e=="function"&&e(i.transformCartesianToWGS84(m),n);},t.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(e){return this.getHandlePosition(e)}saveSceneImages(){if(this._viewer){let c=function(y){for(var h=y.split(","),u=h[0].match(/:(.*?);/)[1],g=atob(h[1]),_=g.length,x=new Uint8Array(_);_--;)x[_]=g.charCodeAt(_);return new Blob([x],{type:u})};var e=this._viewer.scene.canvas,n=e.toDataURL("image/png").replace("image/png","image/octet-stream"),i=document.createElement("a"),a=c(n),m=URL.createObjectURL(a);i.download="scene.png",i.href=m,i.click();}}_installAmapImageryProvider(){let e="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",n="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function i(a){return a.url=a.style==="img"?e:n,a.subdomains||(a.subdomains=["01","02","03","04"]),new t.UrlTemplateImageryProvider(a)}t.Scene.AmapImageryProvider=i;}_installTdtImageryProvider(){let e="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 n(i){return new t.WebMapTileServiceImageryProvider({url:e.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})}t.Scene.TdtImageryProvider=n;}_installTencentImageryProvider(){let e="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",n="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function i(a){return a.layer==="img"?(a.url||(a.url=e),a.subdomains||(a.subdomains=["0","1","2"]),a.customTags={sx(m,c,y,h){return c>>4},sy(m,c,y,h){return (1<<h)-y>>4}}):a.url||(a.url=n),new t.UrlTemplateImageryProvider(a)}t.Scene.TencentImageryProvider=i;}_installGoogleImageryProvider(){let e="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",n="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 a(m){return m.url=m.style==="img"?n:m.style==="ter"?i:e,m.subdomains||(m.subdomains=["1","2","3","4","5"]),new t.UrlTemplateImageryProvider(m)}t.Scene.GoogleImageryProvider=a;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var e="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function n(a){e=a.url||e,this._url=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new t.WebMercatorTilingScheme({rectangleSouthwestInMeters:new t.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new t.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=a.style||"normal",this._ready=true;}Object.defineProperties(n.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new t.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new t.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new t.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new t.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(a,m,c,y,h){var u=a._url+"&x={x}&y={y}&z={z}&customid={style}",g=a._tilingScheme.getNumberOfXTilesAtLevel(y),_=a._tilingScheme.getNumberOfYTilesAtLevel(y);return u=u.replace("{x}",String(m-g/2)).replace("{y}",String(_/2-c-1)).replace("{z}",String(y)).replace("{style}",h),u}n.prototype.getTileCredits=function(a,m,c){},n.prototype.requestImage=function(a,m,c){if(!this.ready)throw new t.DeveloperError("requestImage must not be called before the imagery provider is ready.");var y=i(this,a,m,c,this._style);return t.ImageryProvider.loadImage(this,y)},t.Scene.BaiduImageryProvider=n;}_installGroundSkyBox(){var e=t.BoxGeometry,n=t.Cartesian3,i=t.defaultValue||de,a=t.defined,m=t.destroyObject,c=t.DeveloperError,y=t.GeometryPipeline,h=t.Matrix3,u=t.Matrix4,g=t.Transforms,_=t.VertexFormat,x=t.BufferUsage,D=t.CubeMap,O=t.DrawCommand,z=t.loadCubeMap,b=t.RenderState,F=t.VertexArray,E=t.BlendingState,V=t.SceneMode,f=t.ShaderProgram,I=t.ShaderSource,G=`uniform samplerCube u_cubeMap;
123
+ `;return this._viewer.scene.postProcessStages.add(new t.PostProcessStage({fragmentShader:e,uniforms:{fogByDistance:new t.Cartesian4(10,0,200,.3),fogColor:t.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(e){e&&(Array.isArray(e)?e.forEach(n=>{this._viewer.scene.postProcessStages.contains(n)&&this._viewer.scene.postProcessStages.remove(n);}):this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e));}setView(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,window.opt.distance);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)}});}}flyTo(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,0);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)},easingFunction:e.easingFunction||t.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback});}}transformCartesianToWGS84(e){var n,i,a;if(this._viewer&&e){if(e.x===void 0&&(e.lng!==void 0||e.lon!==void 0))return {lng:Number((n=e.lng)!=null?n:e.lon),lat:Number(e.lat),alt:Number((a=(i=e.alt)!=null?i:e.height)!=null?a:0)};let m=t.Cartographic.fromCartesian(e);return {lng:t.Math.toDegrees(m.longitude),lat:t.Math.toDegrees(m.latitude),alt:m.height}}}transformWGS84ArrayToCartesianArray(e,n){if(this._viewer&&e){var i=this;return e?e.map(function(a){return i.transformWGS84ToCartesian(a,n)}):[]}}transformWGS84ToCartesian(e,n){if(this._viewer)return e?t.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=n||e.alt,t.Ellipsoid.WGS84):t.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(e){if(this._viewer){var n=this;return e?e.map(function(i){return n.transformCartesianToWGS84(i)}).filter(function(i){return !!i}):[]}}transformWGS84ToCartographic(e){return e?t.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):t.Cartographic.ZERO}lnglatArrayToCartesians(e){if(!e||e.length<1)return [];let n=[];for(let i=0;i<e.length;i++){let a=t.Cartesian3.fromDegrees(Number(e[i][0]),Number(e[i][1]),Number(e[i][2]||0));n.push(a);}return n}setCameraEotateHeading(e){if(e){let n=this._viewer,i=t.Cartesian3.fromDegrees(e.lng,e.lat,e.height),a=t.Math.toRadians(-30),m=360/30,c=5e3,y=t.JulianDate.fromDate(new Date);n.clock.startTime=y.clone(),n.clock.currentTime=y.clone(),n.clock.clockRange=t.ClockRange.CLAMPED,n.clock.clockStep=t.ClockStep.SYSTEM_CLOCK;let h=n.camera.heading,u=function(){let _=t.JulianDate.secondsDifference(n.clock.currentTime,n.clock.startTime),x=t.Math.toRadians(_*m)+h;n.scene.camera.setView({destination:i,orientation:{heading:x,pitch:a}}),n.scene.camera.moveBackward(c),t.JulianDate.compare(n.clock.currentTime,n.clock.stopTime)>=0&&n.clock.onTick.removeEventListener(u);};n.clock.onTick.addEventListener(u),ye(this,()=>{n.clock.onTick.removeEventListener(u);});}}getCatesian3FromPX(e){if(this._viewer&&e){var n=this._viewer.scene.pick(e),i=null,a=false,m=false;if(n instanceof t.Cesium3DTileFeature&&(a=true),a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!n){var c=this._viewer.scene.camera.getPickRay(e);if(!c)return null;i=this._viewer.scene.globe.pick(c,this._viewer.scene),m=true;}if(n&&!a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!a&&!m&&!n&&(i=this._viewer.scene.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid)),i){let y=this.transformCartesianToWGS84(i);return y.alt<0&&(i=this.transformWGS84ToCartesian(y,.1)),i}return false}}getCameraPosition(){if(this._viewer){var e=this._viewer.scene.camera.pickEllipsoid(new t.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(e){var n=t.Ellipsoid.WGS84.cartesianToCartographic(e),i=n.longitude*180/Math.PI,a=n.latitude*180/Math.PI,m=this._viewer.camera._direction,c=t.Math.toDegrees(m.x),y=t.Math.toDegrees(m.y),h=t.Math.toDegrees(m.z),u=this._viewer.camera.positionCartographic.height,g=t.Math.toDegrees(this._viewer.camera.heading),_=t.Math.toDegrees(this._viewer.camera.pitch),x=t.Math.toDegrees(this._viewer.camera.roll),D=this._viewer.camera.computeViewRectangle(),O=D.west/Math.PI*180,z=D.north/Math.PI*180,b=D.east/Math.PI*180,F=D.south/Math.PI*180,P=(O+b)/2,V=(z+F)/2;return {lon:i,lat:a,height:u,heading:g,pitch:_,roll:x,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:P,y:V},direction:new t.Cartesian3(c,y,h)}}}}pickUpPosition(e){return this.getCatesian3FromPX(e.position)}getHandlerClickPosition(e){if(this._viewer){let n=this._viewer.scene,i=this._viewer,a=n.camera.pickEllipsoid(e.position,n.globe.elliposid),m={cameraPosistion:i.camera.position,heading:i.camera.heading,pitch:i.camera.pitch,roll:i.camera.roll},c=t.Cartographic.fromCartesian(a);c.height<0&&(c.height=0);let y={alt:c.height,lat:t.Math.toDegrees(c.latitude),lon:t.Math.toDegrees(c.longitude)},h=n.pickPosition(e.position),u=t.Cartographic.fromCartesian(h),g={height:u.height,latitude:t.Math.toDegrees(u.latitude),longitude:t.Math.toDegrees(u.longitude)};return {wgs84Coor:y,graphicCoor:g,cameraPosition:m}}}updateCameraState(e){this._viewer.scene._screenSpaceCameraController.enableRotate=e,this._viewer.scene._screenSpaceCameraController.enableTranslate=e,this._viewer.scene._screenSpaceCameraController.enableZoom=e,this._viewer.scene._screenSpaceCameraController.enableTilt=e,this._viewer.scene._screenSpaceCameraController.enableLook=e;}bindHandleEvent({leftClick:e,mouseMove:n,doubleClick:i,leftDown:a,mouseWheel:m,leftUp:c}){if(this._viewer){var y=new t.ScreenSpaceEventHandler(this._viewer.canvas);ye(this,()=>{y&&!y.isDestroyed()&&y.destroy();}),e&&y.setInputAction(function(h){e(h,y);},t.ScreenSpaceEventType.LEFT_CLICK),n&&y.setInputAction(function(h){n(h,y);},t.ScreenSpaceEventType.MOUSE_MOVE),i&&y.setInputAction(function(h){i(h,y);},t.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),a&&y.setInputAction(function(h){a(h,y);},t.ScreenSpaceEventType.LEFT_DOWN),m&&y.setInputAction(function(h){m(h,y);},t.ScreenSpaceEventType.WHEEL),c&&y.setInputAction(function(h){c(h,y);},t.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(e){return this.bindHandleEvent(e)}getHandlePosition(e){if(this._viewer){var n=new t.ScreenSpaceEventHandler(this._viewer.scene.canvas),i=this;ye(this,()=>{n&&!n.isDestroyed()&&n.destroy();}),n.setInputAction(function(a){var m=i._viewer.scene.camera.pickEllipsoid(a.endPosition,i._viewer.scene.globe.ellipsoid);typeof e=="function"&&e(i.transformCartesianToWGS84(m),n);},t.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(e){return this.getHandlePosition(e)}saveSceneImages(){if(this._viewer){let c=function(y){for(var h=y.split(","),u=h[0].match(/:(.*?);/)[1],g=atob(h[1]),_=g.length,x=new Uint8Array(_);_--;)x[_]=g.charCodeAt(_);return new Blob([x],{type:u})};var e=this._viewer.scene.canvas,n=e.toDataURL("image/png").replace("image/png","image/octet-stream"),i=document.createElement("a"),a=c(n),m=URL.createObjectURL(a);i.download="scene.png",i.href=m,i.click();}}_installAmapImageryProvider(){let e="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",n="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function i(a){return a.url=a.style==="img"?e:n,a.subdomains||(a.subdomains=["01","02","03","04"]),new t.UrlTemplateImageryProvider(a)}t.Scene.AmapImageryProvider=i;}_installTdtImageryProvider(){let e="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 n(i){return new t.WebMapTileServiceImageryProvider({url:e.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})}t.Scene.TdtImageryProvider=n;}_installTencentImageryProvider(){let e="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",n="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function i(a){return a.layer==="img"?(a.url||(a.url=e),a.subdomains||(a.subdomains=["0","1","2"]),a.customTags={sx(m,c,y,h){return c>>4},sy(m,c,y,h){return (1<<h)-y>>4}}):a.url||(a.url=n),new t.UrlTemplateImageryProvider(a)}t.Scene.TencentImageryProvider=i;}_installGoogleImageryProvider(){let e="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",n="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 a(m){return m.url=m.style==="img"?n:m.style==="ter"?i:e,m.subdomains||(m.subdomains=["1","2","3","4","5"]),new t.UrlTemplateImageryProvider(m)}t.Scene.GoogleImageryProvider=a;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var e="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function n(a){e=a.url||e,this._url=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new t.WebMercatorTilingScheme({rectangleSouthwestInMeters:new t.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new t.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=a.style||"normal",this._ready=true;}Object.defineProperties(n.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new t.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new t.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new t.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new t.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(a,m,c,y,h){var u=a._url+"&x={x}&y={y}&z={z}&customid={style}",g=a._tilingScheme.getNumberOfXTilesAtLevel(y),_=a._tilingScheme.getNumberOfYTilesAtLevel(y);return u=u.replace("{x}",String(m-g/2)).replace("{y}",String(_/2-c-1)).replace("{z}",String(y)).replace("{style}",h),u}n.prototype.getTileCredits=function(a,m,c){},n.prototype.requestImage=function(a,m,c){if(!this.ready)throw new t.DeveloperError("requestImage must not be called before the imagery provider is ready.");var y=i(this,a,m,c,this._style);return t.ImageryProvider.loadImage(this,y)},t.Scene.BaiduImageryProvider=n;}_installGroundSkyBox(){var e=t.BoxGeometry,n=t.Cartesian3,i=t.defaultValue||de,a=t.defined,m=t.destroyObject,c=t.DeveloperError,y=t.GeometryPipeline,h=t.Matrix3,u=t.Matrix4,g=t.Transforms,_=t.VertexFormat,x=t.BufferUsage,D=t.CubeMap,O=t.DrawCommand,z=t.loadCubeMap,b=t.RenderState,F=t.VertexArray,P=t.BlendingState,V=t.SceneMode,f=t.ShaderProgram,I=t.ShaderSource,G=`uniform samplerCube u_cubeMap;
124
124
  in vec3 v_texCoord;
125
125
  void main()
126
126
  {
@@ -136,7 +136,7 @@ void main(void)
136
136
  gl_Position = czm_projection * vec4(p, 1.0);
137
137
  v_texCoord = position.xyz;
138
138
  }
139
- `,S=typeof u.getRotation=="function"?u.getRotation.bind(u):u.getMatrix3.bind(u);function B(P){this.sources=P.sources,this._sources=void 0,this.show=i(P.show,true),this._command=new O({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var U=new h;B.prototype.update=function(P,H){var Y=this;if(this.show&&!(P.mode!==V.SCENE3D&&P.mode!==V.MORPHING)&&P.passes.render){var q=P.context;if(this._sources!==this.sources){this._sources=this.sources;var N=this.sources;if(!a(N.positiveX)||!a(N.negativeX)||!a(N.positiveY)||!a(N.negativeY)||!a(N.positiveZ)||!a(N.negativeZ))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof N.positiveX!=typeof N.negativeX||typeof N.positiveX!=typeof N.positiveY||typeof N.positiveX!=typeof N.negativeY||typeof N.positiveX!=typeof N.positiveZ||typeof N.positiveX!=typeof N.negativeZ)throw new c("this.sources properties must all be the same type.");typeof N.positiveX=="string"?z(q,this._sources).then(function(te){Y._cubeMap=Y._cubeMap&&Y._cubeMap.destroy(),Y._cubeMap=te;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new D({context:q,source:N}));}var Q=this._command;if(Q.modelMatrix=g.eastNorthUpToFixedFrame(P.camera._positionWC),!a(Q.vertexArray)){Q.uniformMap={u_cubeMap(){return Y._cubeMap},u_rotateMatrix(){return S(Q.modelMatrix,U)}};var W=e.createGeometry(e.fromDimensions({dimensions:new n(2,2,2),vertexFormat:_.POSITION_ONLY})),ee=this._attributeLocations=y.createAttributeLocations(W);Q.vertexArray=F.fromGeometry({context:q,geometry:W,attributeLocations:ee,bufferUsage:x._DRAW}),Q.renderState=b.fromCache({blending:E.ALPHA_BLEND});}if(!a(Q.shaderProgram)||this._useHdr!==H){var A=new I({defines:[H?"HDR":""],sources:[G]});Q.shaderProgram=f.fromCache({context:q,vertexShaderSource:L,fragmentShaderSource:A,attributeLocations:this._attributeLocations}),this._useHdr=H;}if(a(this._cubeMap))return Q}},B.prototype.isDestroyed=function(){return false},B.prototype.destroy=function(){var P=this._command;return P.vertexArray=P.vertexArray&&P.vertexArray.destroy(),P.shaderProgram=P.shaderProgram&&P.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),m(this)},t.Scene.GroundSkyBox=B;}removeHandlerByName(e=[]){e.forEach(n=>{this._viewer.screenSpaceEventHandler.removeInputAction(t.ScreenSpaceEventType[n]);});}}return d}var xe=we(lt);function ct(t,o,d,s){function e(n,i){let a={},m=me(i),c=[];if(Array.isArray(n))n.forEach(h=>{let u=me(h),g=new u(t,o,d,s);y(u,m),c.push(g);}),a=new m(t,o,d,s),c.forEach(h=>Object.assign(a,h)),c.forEach(h=>Se(h,a));else {let h=me(n),u=new h(t,o,d,s);y(h,m),a=new m(t,o,d,s),Object.assign(a,u),Se(u,a);}function y(h,u){let g=Object.getOwnPropertyNames(h.prototype);for(let _=0,x=g.length;_<x;_++)g[_]!=="constructor"&&(u.prototype[g[_]]=h.prototype[g[_]]);}return a}return e}function ut({cesiumGlobal:t,threeGlobal:o,containerId:d,threeContainerId:s,viewerConfig:e={},extraConfig:n={},MapImageryList:i=[],defaultStatic:a,baseExtendsCom:m=[],extendsCom:c,extendsComName:y,viewer:h}){if(!t)throw new le("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!d&&!h)throw new le("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 g=new he(t).init({containerId:d,viewerConfig:e,extraConfig:n,MapImageryList:i,viewer:h}),_=!h,O=ct(g,t,a,o?{threeGlobal:o,containerId:d,threeContainerId:s}:"")(m,c),z=false;return {viewer:g,[y]:O,dispose:()=>{if(!z){z=true;try{typeof O.destroy=="function"?O.destroy():Ce(O);}catch(b){ce(b,{scope:"singleImport.dispose"});}_&&Be(g);}}}}function Le(t,o,d){function s(e){return ut({...e,baseExtendsCom:t,extendsCom:o,extendsComName:d})}return s}var Ve=`#ifdef GL_OES_standard_derivatives
139
+ `,S=typeof u.getRotation=="function"?u.getRotation.bind(u):u.getMatrix3.bind(u);function B(E){this.sources=E.sources,this._sources=void 0,this.show=i(E.show,true),this._command=new O({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var U=new h;B.prototype.update=function(E,H){var Y=this;if(this.show&&!(E.mode!==V.SCENE3D&&E.mode!==V.MORPHING)&&E.passes.render){var q=E.context;if(this._sources!==this.sources){this._sources=this.sources;var N=this.sources;if(!a(N.positiveX)||!a(N.negativeX)||!a(N.positiveY)||!a(N.negativeY)||!a(N.positiveZ)||!a(N.negativeZ))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof N.positiveX!=typeof N.negativeX||typeof N.positiveX!=typeof N.positiveY||typeof N.positiveX!=typeof N.negativeY||typeof N.positiveX!=typeof N.positiveZ||typeof N.positiveX!=typeof N.negativeZ)throw new c("this.sources properties must all be the same type.");typeof N.positiveX=="string"?z(q,this._sources).then(function(te){Y._cubeMap=Y._cubeMap&&Y._cubeMap.destroy(),Y._cubeMap=te;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new D({context:q,source:N}));}var Q=this._command;if(Q.modelMatrix=g.eastNorthUpToFixedFrame(E.camera._positionWC),!a(Q.vertexArray)){Q.uniformMap={u_cubeMap(){return Y._cubeMap},u_rotateMatrix(){return S(Q.modelMatrix,U)}};var W=e.createGeometry(e.fromDimensions({dimensions:new n(2,2,2),vertexFormat:_.POSITION_ONLY})),ee=this._attributeLocations=y.createAttributeLocations(W);Q.vertexArray=F.fromGeometry({context:q,geometry:W,attributeLocations:ee,bufferUsage:x._DRAW}),Q.renderState=b.fromCache({blending:P.ALPHA_BLEND});}if(!a(Q.shaderProgram)||this._useHdr!==H){var A=new I({defines:[H?"HDR":""],sources:[G]});Q.shaderProgram=f.fromCache({context:q,vertexShaderSource:L,fragmentShaderSource:A,attributeLocations:this._attributeLocations}),this._useHdr=H;}if(a(this._cubeMap))return Q}},B.prototype.isDestroyed=function(){return false},B.prototype.destroy=function(){var E=this._command;return E.vertexArray=E.vertexArray&&E.vertexArray.destroy(),E.shaderProgram=E.shaderProgram&&E.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),m(this)},t.Scene.GroundSkyBox=B;}removeHandlerByName(e=[]){e.forEach(n=>{this._viewer.screenSpaceEventHandler.removeInputAction(t.ScreenSpaceEventType[n]);});}}return d}var xe=we(lt);function ct(t,o,d,s){function e(n,i){let a={},m=me(i),c=[];if(Array.isArray(n))n.forEach(h=>{let u=me(h),g=new u(t,o,d,s);y(u,m),c.push(g);}),a=new m(t,o,d,s),c.forEach(h=>Object.assign(a,h)),c.forEach(h=>Se(h,a));else {let h=me(n),u=new h(t,o,d,s);y(h,m),a=new m(t,o,d,s),Object.assign(a,u),Se(u,a);}function y(h,u){let g=Object.getOwnPropertyNames(h.prototype);for(let _=0,x=g.length;_<x;_++)g[_]!=="constructor"&&(u.prototype[g[_]]=h.prototype[g[_]]);}return a}return e}function ut({cesiumGlobal:t,threeGlobal:o,containerId:d,threeContainerId:s,viewerConfig:e={},extraConfig:n={},MapImageryList:i=[],defaultStatic:a,baseExtendsCom:m=[],extendsCom:c,extendsComName:y,viewer:h}){if(!t)throw new le("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!d&&!h)throw new le("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 g=new he(t).init({containerId:d,viewerConfig:e,extraConfig:n,MapImageryList:i,viewer:h}),_=!h,O=ct(g,t,a,o?{threeGlobal:o,containerId:d,threeContainerId:s}:"")(m,c),z=false;return {viewer:g,[y]:O,dispose:()=>{if(!z){z=true;try{typeof O.destroy=="function"?O.destroy():Ce(O);}catch(b){ce(b,{scope:"singleImport.dispose"});}_&&Be(g);}}}}function Le(t,o,d){function s(e){return ut({...e,baseExtendsCom:t,extendsCom:o,extendsComName:d})}return s}var Ve=`#ifdef GL_OES_standard_derivatives
140
140
  #extension GL_OES_standard_derivatives : enable
141
141
  #endif
142
142
 
@@ -260,7 +260,7 @@ void main() {
260
260
  // the floating point error.
261
261
  bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);
262
262
  out_FragColor = shade(isOnEllipsoid);
263
- }`,Pe=`in vec4 position;
263
+ }`,Ee=`in vec4 position;
264
264
  in vec3 normal;
265
265
 
266
266
  out vec3 v_position;
@@ -310,7 +310,7 @@ vec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) {
310
310
  s = s - floor(s);
311
311
 
312
312
  return vec2(s, t);
313
- }`,Ee=`#ifdef GL_OES_standard_derivatives
313
+ }`,Pe=`#ifdef GL_OES_standard_derivatives
314
314
  #extension GL_OES_standard_derivatives : enable
315
315
  #endif
316
316
 
@@ -442,7 +442,7 @@ void main() {
442
442
  }
443
443
  */
444
444
  out_FragColor = shade(isOnEllipsoid);
445
- }`;var M={};function Oe(t){M=t;var o=M.BoundingSphere,d=M.Cartesian3,s=M.Color,e=M.combine,n=M.ComponentDatatype,i=M.defaultValue||M.Scene.defaultValue,a=M.defined;M.destroyObject;var y=M.DeveloperError,S=M.Matrix4,h=M.PrimitiveType,u=M.Buffer,g=M.BufferUsage,_=M.DrawCommand,x=M.Pass,D=M.RenderState,O=M.ShaderProgram,z=M.ShaderSource,b=M.VertexArray,F=M.BlendingState,E=M.CullFace,V=M.Material,f=M.SceneMode,I=M.VertexFormat,G=M.Math,L=M.Matrix3,S=M.Matrix4,B=M.JulianDate;M.BoxGeometry;M.EllipsoidGeometry;var H=Math.sin,Y=Math.cos,q=Math.tan,N=Math.atan,W={position:0,normal:1};function ee(r){var p=this;r=i(r,i.EMPTY_OBJECT),this.show=i(r.show,true),this.slice=i(r.slice,32),this.modelMatrix=S.clone(r.modelMatrix,new S),this._modelMatrix=new S,this._computedModelMatrix=new S,this._computedScanPlaneModelMatrix=new S,this.radius=i(r.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=i(r.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=i(r.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=i(r.lineColor,s.WHITE),this.showSectorLines=i(r.showSectorLines,true),this.showSectorSegmentLines=i(r.showSectorSegmentLines,true),this.showLateralSurfaces=i(r.showLateralSurfaces,true),this.material=a(r.material)?r.material:V.fromType(V.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=a(r.lateralSurfaceMaterial)?r.lateralSurfaceMaterial:V.fromType(V.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=i(r.showDomeSurfaces,true),this.domeSurfaceMaterial=a(r.domeSurfaceMaterial)?r.domeSurfaceMaterial:V.fromType(V.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=i(r.showDomeLines,true),this.showIntersection=i(r.showIntersection,true),this.intersectionColor=i(r.intersectionColor,s.WHITE),this.intersectionWidth=i(r.intersectionWidth,5),this.showThroughEllipsoid=i(r.showThroughEllipsoid,false),this._showThroughEllipsoid=void 0,this.showScanPlane=i(r.showScanPlane,true),this.scanPlaneColor=i(r.scanPlaneColor,s.WHITE),this.scanPlaneMode=i(r.scanPlaneMode,"horizontal"),this.scanPlaneRate=i(r.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=B.now(),this._boundingSphere=new o,this._boundingSphereWC=new o,this._sectorFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return p.xHalfAngle},u_yHalfAngle:function(){return p.yHalfAngle},u_radius:function(){return p.radius},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return p._scanePlaneXHalfAngle},u_yHalfAngle:function(){return p._scanePlaneYHalfAngle},u_radius:function(){return p.radius},u_color:function(){return p.scanPlaneColor},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}};}ee.prototype.update=function(r){var p=r.mode;if(!(!this.show||p!==f.SCENE3D)){var C=false,v=false,w=false,T=this.xHalfAngle,j=this.yHalfAngle;if(T<0||j<0)throw new y("halfAngle must be greater than or equal to zero.");if(!(T==0||j==0)){(this._xHalfAngle!==T||this._yHalfAngle!==j)&&(this._xHalfAngle=T,this._yHalfAngle=j,C=true);var k=this.radius;if(k<0)throw new y("this.radius must be greater than or equal to zero.");var R=false;this._radius!==k&&(R=true,this._radius=k,this._boundingSphere=new o(d.ZERO,this.radius));var X=!S.equals(this.modelMatrix,this._modelMatrix);(X||R)&&(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),o.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var K=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=K,v=true);var Z=this.material;this._material!==Z&&(this._material=Z,v=true,w=true);var $=Z.isTranslucent();if(this._translucent!==$&&(this._translucent=$,v=true),this.showScanPlane){var se=r.time,Ae=B.secondsDifference(se,this._time);Ae<0&&(this._time=B.clone(se,this._time));var ke=Math.max(Ae%this.scanPlaneRate/this.scanPlaneRate,0),oe;if(this.scanPlaneMode=="horizontal"){oe=2*j*ke-j;var Ke=Y(oe),Je=q(T),Qe=N(Ke*Je);this._scanePlaneXHalfAngle=Qe,this._scanePlaneYHalfAngle=oe,M.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,A);}else {oe=2*T*ke-T;var $e=q(j),et=Y(oe),tt=N(et*$e);this._scanePlaneXHalfAngle=oe,this._scanePlaneYHalfAngle=tt,M.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,A);}M.Matrix4.multiplyByMatrix3(this.modelMatrix,A,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix);}C&&je(this,r),v&&Ze(this,K,$),w&&Xe(this,r,Z),(v||w)&&qe(this,$);var nt=r.commandList,at=r.passes,De=this._colorCommands;if(at.render)for(var ve=0,rt=De.length;ve<rt;ve++){var it=De[ve];nt.push(it);}}}},ee.prototype.isDestroyed=function(){return false};var A=new L,te=new d;function re(r,p,C){for(var v=r.slice,w=Y(C),T=q(C),j=Y(p),k=q(p),R=N(j*T),X=N(w*k),K=[],Z=0;Z<v;Z++){var $=2*R*Z/(v-1)-R;K.push(new d(0,H($),Y($)));}for(var se=[],Z=0;Z<v;Z++){var $=2*X*Z/(v-1)-X;se.push(new d(H($),0,Y($)));}return {zoy:K,zox:se}}function ue(r,p){var C=r.xHalfAngle,v=r.yHalfAngle,w=p.zoy,T=p.zox,j=[],k=L.fromRotationY(C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}));var k=L.fromRotationX(-v,A);j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationY(-C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationX(v,A);return j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)})),j}function fe(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(18*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=d.normalize(d.cross(k[0],k[k.length-1],te),te),X=0,C=k.length-1;X<C;X++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X].x,v[w++]=k[X].y,v[w++]=k[X].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X+1].x,v[w++]=k[X+1].y,v[w++]=k[X+1].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z;var K=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),Z=6*Float32Array.BYTES_PER_ELEMENT,$=[{index:W.position,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:Z},{index:W.normal,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:Z}];return new b({context:r,attributes:$})}function ge(r,p){for(var C=p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++){var k=p[T];v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=k[0].x,v[w++]=k[0].y,v[w++]=k[0].z;}var R=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),X=3*Float32Array.BYTES_PER_ELEMENT,K=[{index:W.position,vertexBuffer:R,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:X}];return new b({context:r,attributes:K})}function He(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=0,C=k.length-1;R<C;R++)v[w++]=k[R].x,v[w++]=k[R].y,v[w++]=k[R].z,v[w++]=k[R+1].x,v[w++]=k[R+1].y,v[w++]=k[R+1].z;var X=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),K=3*Float32Array.BYTES_PER_ELEMENT,Z=[{index:W.position,vertexBuffer:X,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:K}];return new b({context:r,attributes:Z})}function Ne(r){var p=M.EllipsoidGeometry.createGeometry(new M.EllipsoidGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function We(r){var p=M.EllipsoidOutlineGeometry.createGeometry(new M.EllipsoidOutlineGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function Me(r,p){for(var C=p.length-1,v=new Float32Array(9*C),w=0,T=0;T<C;T++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=p[T].x,v[w++]=p[T].y,v[w++]=p[T].z,v[w++]=p[T+1].x,v[w++]=p[T+1].y,v[w++]=p[T+1].z;var j=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),k=3*Float32Array.BYTES_PER_ELEMENT,R=[{index:W.position,vertexBuffer:j,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:k}];return new b({context:r,attributes:R})}function je(r,p){var C=p.context,v=re(r,r.xHalfAngle,r.yHalfAngle),w=ue(r,v);if(r.showLateralSurfaces&&(r._sectorVA=fe(C,w)),r.showSectorLines&&(r._sectorLineVA=ge(C,w)),r.showSectorSegmentLines&&(r._sectorSegmentLineVA=He(C,w)),r.showDomeSurfaces&&(r._domeVA=Ne(C)),r.showDomeLines&&(r._domeLineVA=We(C)),r.showScanPlane)if(r.scanPlaneMode=="horizontal"){var T=re(r,G.PI_OVER_TWO,0);r._scanPlaneVA=Me(C,T.zox);}else {var T=re(r,0,G.PI_OVER_TWO);r._scanPlaneVA=Me(C,T.zoy);}}function Ye(r,p,C){var v=p.context,w=Pe,T=new z({sources:[pe,C.shaderSource,Ee]});r._sp=O.replaceCache({context:v,shaderProgram:r._sp,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});var j=new z({sources:[pe,C.shaderSource,Ee],pickColorQualifier:"uniform"});r._pickSP=O.replaceCache({context:v,shaderProgram:r._pickSP,vertexShaderSource:w,fragmentShaderSource:j,attributeLocations:W});}function Ue(r,p,C){var v=p.context,w=Pe,T=new z({sources:[pe,C.shaderSource,Ve]});r._scanePlaneSP=O.replaceCache({context:v,shaderProgram:r._scanePlaneSP,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});}function Xe(r,p,C){Ye(r,p,C),r.showScanPlane&&Ue(r,p,C);}function Ze(r,p,C){C?(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:E.BACK}}),r._backFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:E.FRONT}}),r._pickRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND})):(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:true}),r._pickRS=D.fromCache({depthTest:{enabled:true},depthMask:true}));}function ie(r,p,C,v,w,T,j,k,R,X,K,Z){X&&C&&(C.vertexArray=j,C.renderState=w,C.shaderProgram=T,C.uniformMap=e(k,r._material._uniforms),C.uniformMap.u_normalDirection=function(){return -1},C.pass=K,C.modelMatrix=R,r._colorCommands.push(C)),p.vertexArray=j,p.renderState=v,p.shaderProgram=T,p.uniformMap=e(k,r._material._uniforms),Z&&(p.uniformMap.u_type=function(){return 1}),p.pass=K,p.modelMatrix=R,r._colorCommands.push(p);}function qe(r,p){r._colorCommands.length=0;var C=p?x.TRANSLUCENT:x.OPAQUE;r.showLateralSurfaces&&ie(r,r._sectorFrontCommand,r._sectorBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorVA,r._uniforms,r._computedModelMatrix,p,C),r.showSectorLines&&ie(r,r._sectorLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showSectorSegmentLines&&ie(r,r._sectorSegmentLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorSegmentLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showDomeSurfaces&&ie(r,r._domeFrontCommand,r._domeBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._domeVA,r._uniforms,r._computedModelMatrix,p,C),r.showDomeLines&&ie(r,r._domeLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._domeLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showScanPlane&&ie(r,r._scanPlaneFrontCommand,r._scanPlaneBackCommand,r._frontFaceRS,r._backFaceRS,r._scanePlaneSP,r._scanPlaneVA,r._scanUniforms,r._computedScanPlaneModelMatrix,p,C);}return ee}var ae={};function ze(t){ae=t;var o=ae.defaultValue||ae.Scene.defaultValue,d=ae.defined,s=Object.defineProperties,e=ae.DeveloperError,n=ae.Event,i=ae.createMaterialPropertyDescriptor,a=ae.createPropertyDescriptor;function m(c){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 n,this.merge(o(c,o.EMPTY_OBJECT));}return s(m.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radius:a("radius"),xHalfAngle:a("xHalfAngle"),yHalfAngle:a("yHalfAngle"),lineColor:a("lineColor"),showSectorLines:a("showSectorLines"),showSectorSegmentLines:a("showSectorSegmentLines"),showLateralSurfaces:a("showLateralSurfaces"),material:i("material"),showDomeSurfaces:a("showDomeSurfaces"),showDomeLines:a("showDomeLines "),showIntersection:a("showIntersection"),intersectionColor:a("intersectionColor"),intersectionWidth:a("intersectionWidth"),showThroughEllipsoid:a("showThroughEllipsoid"),gaze:a("gaze"),showScanPlane:a("showScanPlane"),scanPlaneColor:a("scanPlaneColor"),scanPlaneMode:a("scanPlaneMode"),scanPlaneRate:a("scanPlaneRate")}),m.prototype.clone=function(c){return d(c)||(c=new m),c.show=this.show,c.radius=this.radius,c.xHalfAngle=this.xHalfAngle,c.yHalfAngle=this.yHalfAngle,c.lineColor=this.lineColor,c.showSectorLines=this.showSectorLines,c.showSectorSegmentLines=this.showSectorSegmentLines,c.showLateralSurfaces=this.showLateralSurfaces,c.material=this.material,c.showDomeSurfaces=this.showDomeSurfaces,c.showDomeLines=this.showDomeLines,c.showIntersection=this.showIntersection,c.intersectionColor=this.intersectionColor,c.intersectionWidth=this.intersectionWidth,c.showThroughEllipsoid=this.showThroughEllipsoid,c.gaze=this.gaze,c.showScanPlane=this.showScanPlane,c.scanPlaneColor=this.scanPlaneColor,c.scanPlaneMode=this.scanPlaneMode,c.scanPlaneRate=this.scanPlaneRate,c},m.prototype.merge=function(c){if(!d(c))throw new e("source is required.");this.show=o(this.show,c.show),this.radius=o(this.radius,c.radius),this.xHalfAngle=o(this.xHalfAngle,c.xHalfAngle),this.yHalfAngle=o(this.yHalfAngle,c.yHalfAngle),this.lineColor=o(this.lineColor,c.lineColor),this.showSectorLines=o(this.showSectorLines,c.showSectorLines),this.showSectorSegmentLines=o(this.showSectorSegmentLines,c.showSectorSegmentLines),this.showLateralSurfaces=o(this.showLateralSurfaces,c.showLateralSurfaces),this.material=o(this.material,c.material),this.showDomeSurfaces=o(this.showDomeSurfaces,c.showDomeSurfaces),this.showDomeLines=o(this.showDomeLines,c.showDomeLines),this.showIntersection=o(this.showIntersection,c.showIntersection),this.intersectionColor=o(this.intersectionColor,c.intersectionColor),this.intersectionWidth=o(this.intersectionWidth,c.intersectionWidth),this.showThroughEllipsoid=o(this.showThroughEllipsoid,c.showThroughEllipsoid),this.gaze=o(this.gaze,c.gaze),this.showScanPlane=o(this.showScanPlane,c.showScanPlane),this.scanPlaneColor=o(this.scanPlaneColor,c.scanPlaneColor),this.scanPlaneMode=o(this.scanPlaneMode,c.scanPlaneMode),this.scanPlaneRate=o(this.scanPlaneRate,c.scanPlaneRate);},m}var J={};function Fe(t,o){if(t){let V=function(f,I,G){var L=I[f.id];if(n(L)){var S=L.primitive;G.remove(S),S&&!S.isDestroyed()&&S.destroy(),delete I[f.id];}};J=t;var d=J.AssociativeArray,s=J.Cartesian3,e=J.Color,n=J.defined,i=J.destroyObject,a=J.DeveloperError,m=J.Matrix3,c=J.Matrix4,y=J.Quaternion,h=J.MaterialProperty,u=J.Property,g=new m;new c;var x=new s,D=new s,O=new y,z=new s,b=new y,F=function(f,I){if(!n(f))throw new a("scene is required.");if(!n(I))throw new a("entityCollection is required.");I.collectionChanged.addEventListener(F.prototype._onCollectionChanged,this),this._scene=f,this._primitives=f.primitives,this._entityCollection=I,this._hash={},this._entitiesToVisualize=new d,this._onCollectionChanged(I,I.values,[],[]);};return F.prototype.update=function(f){if(!n(f))throw new a("time is required.");for(var I=this._entitiesToVisualize.values,G=this._hash,L=this._primitives,S=0,B=I.length;S<B;S++){var U=I[S],P=U._rectangularSensor,H,Y,q,N,Q,W=G[U.id],ee=U.isShowing&&U.isAvailable(f)&&u.getValueOrDefault(P._show,f,true);if(ee&&(H=u.getValueOrUndefined(U._position,f,x),Y=u.getValueOrUndefined(U._orientation,f,O),q=u.getValueOrUndefined(P._radius,f),N=u.getValueOrUndefined(P._xHalfAngle,f),Q=u.getValueOrUndefined(P._yHalfAngle,f),ee=n(H)&&n(N)&&n(Q)),!ee){n(W)&&(W.primitive.show=false);continue}var A=n(W)?W.primitive:void 0;n(A)||(A=new o,A.id=U,L.add(A),W={primitive:A,position:void 0,orientation:void 0},G[U.id]=W);var te=u.getValueOrUndefined(P._gaze,f);if(n(te)){var re=u.getValueOrUndefined(te._position,f,D);if(!n(H)||!n(re))continue;var ue=s.subtract(H,re,z),fe=s.angleBetween(J.Cartesian3.UNIT_Z,ue),ge=s.cross(J.Cartesian3.UNIT_Z,ue,z),Y=y.fromAxisAngle(ge,fe-Math.PI,b);q=s.distance(H,re),A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix);}else (!s.equals(H,W.position)||!y.equals(Y,W.orientation))&&(n(Y)?(A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix),W.position=s.clone(H,W.position),W.orientation=y.clone(Y,W.orientation)):(A.modelMatrix=J.Transforms.eastNorthUpToFixedFrame(H),W.position=s.clone(H,W.position)));A.show=true,A.gaze=te,A.radius=q,A.xHalfAngle=N,A.yHalfAngle=Q,A.lineColor=u.getValueOrDefault(P._lineColor,f,e.WHITE),A.showSectorLines=u.getValueOrDefault(P._showSectorLines,f,true),A.showSectorSegmentLines=u.getValueOrDefault(P._showSectorSegmentLines,f,true),A.showLateralSurfaces=u.getValueOrDefault(P._showLateralSurfaces,f,true),A.material=h.getValue(f,P._material,A.material),A.showDomeSurfaces=u.getValueOrDefault(P._showDomeSurfaces,f,true),A.showDomeLines=u.getValueOrDefault(P._showDomeLines,f,true),A.showIntersection=u.getValueOrDefault(P._showIntersection,f,true),A.intersectionColor=u.getValueOrDefault(P._intersectionColor,f,e.WHITE),A.intersectionWidth=u.getValueOrDefault(P._intersectionWidth,f,1),A.showThroughEllipsoid=u.getValueOrDefault(P._showThroughEllipsoid,f,true),A.scanPlaneMode=u.getValueOrDefault(P._scanPlaneMode,f),A.scanPlaneColor=u.getValueOrDefault(P._scanPlaneColor,f,e.WHITE),A.showScanPlane=u.getValueOrDefault(P._showScanPlane,f,true),A.scanPlaneRate=u.getValueOrDefault(P._scanPlaneRate,f,1);}return true},F.prototype.isDestroyed=function(){return false},F.prototype.destroy=function(){for(var f=this._entitiesToVisualize.values,I=this._hash,G=this._primitives,L=f.length-1;L>-1;L--)V(f[L],I,G);return i(this)},F.prototype._onCollectionChanged=function(f,I,G,L){var S,B,U=this._entitiesToVisualize,P=this._hash,H=this._primitives;for(S=I.length-1;S>-1;S--)B=I[S],n(B._rectangularSensor)&&n(B._position)&&U.set(B.id,B);for(S=L.length-1;S>-1;S--)B=L[S],n(B._rectangularSensor)&&n(B._position)?U.set(B.id,B):(V(B,P,H),U.remove(B.id));for(S=G.length-1;S>-1;S--)B=G[S],V(B,P,H),U.remove(B.id);},F}}var l=null,be=function(t,o){t&&(this.viewer=t,l=o,this._installPlugin());};be.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive();},_installCylinderGeometry:function(){function t(e){this.length=e.length,this.topRadius=e.topRadius,this.bottomRadius=e.bottomRadius,this.slices=e.slices?e.slices:64,this.zReverse=e.zReverse;}var o=new l.Cartesian2,d=new l.Cartesian3,s=new l.Ray;t._createGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),E=0;E<D.length;E++){_[E]=[];for(var V=x[E],f=0;f<m;f++){_[E].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[E]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(E/(D.length-1),0);}}for(var S=[],E=1;E<D.length;E++)for(var f=1;f<m;f++){var B=_[E-1][f-1],U=_[E][f-1],P=_[E][f],H=_[E-1][f];S.push(P),S.push(H),S.push(B),S.push(P),S.push(B),S.push(U),f==_[E].length-1&&(B=_[E-1][f],U=_[E][f],P=_[E][0],H=_[E-1][0],S.push(P),S.push(H),S.push(B),S.push(P),S.push(B),S.push(U));}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var Y={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},q=l.BoundingSphere.fromVertices(h),N=new l.Geometry({attributes:Y,indices:S,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:q});return h=[],S=[],g=[],N},t.createGeometry=function(e,n){if(!n)return t._createGeometry(e);l.Matrix4.multiplyByPoint(n,l.Cartesian3.ZERO,d),d.clone(s.origin);var i=e.length,a=e.topRadius,m=(e.bottomRadius,e.slices),c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[0,y?-i:i],D=0,D=0;h.push(0,0,0),u.push(1,1),D++;for(var O=new l.Cartesian3,z=a/15,b=0;b<16;b++){for(var F=z*b,E=[],V=0;V<m;V++){var f=c*V,I=F*Math.cos(f),G=F*Math.sin(f);O.x=I,O.y=G,O.z=x[1];var L=(0, l.Scene.extend2Earth)(O,n,s);L?(E.push(D),h.push(I,G,x[1]),u.push(b/15,1),D++):(L=d,E.push(-1));}_.push(E);}for(var S,B,U=[0,_.length-1],P=0;P<U.length;P++)for(var b=U[P],V=1;V<_[b].length;V++)S=_[b][V-1],B=_[b][V],S>=0&&B>=0&&g.push(0,S,B);h=new Float32Array(h),g=new Int32Array(g),u=new Float32Array(u);var H={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:u})},Y=l.BoundingSphere.fromVertices(h),q=new l.Geometry({attributes:H,indices:g,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:Y});return (0, l.Scene.computeVertexNormals)(q),h=[],g=[],q},t.createOutlineGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),E=0;E<D.length;E++){_[E]=[];for(var V=x[E],f=0;f<m;f++){_[E].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[E]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(E/(D.length-1),0);}}for(var S=[],E=1;E<D.length;E++)for(var f=1;f<m;f+=1){var B=_[E-1][f-1],U=_[E][f-1];_[E][f],_[E-1][f],f%8==1&&S.push(B,U);}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var P={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},H=l.BoundingSphere.fromVertices(h),Y=new l.Geometry({attributes:P,indices:S,primitiveType:l.PrimitiveType.LINES,boundingSphere:H});return h=[],S=[],g=[],Y},t.fromAngleAndLength=function(e,n,i){return e=l.Math.toRadians(e),new t({topRadius:Math.tan(e)*n/2,bottomRadius:0,length:n,zReverse:i})},l.Scene.CylinderGeometry=t;},_installRadarPrimitive:function(){var t;function o(s,e){let n=l.defaultValue||de;e=e||{},t=s.scene.globe.ellipsoid,this._geometry=null,this._angle=e.angle,this._radius=e.radius?e.radius:5,this._position=e.position,this._rotation=e.rotation?e.rotation:{heading:0,pitch:0,roll:0},this._trackedEntity=e.trackedEntity,this.defaultColor=e.color?e.color:l.Color.YELLOW,this.defaultLineColor=e.lineColor?e.lineColor:this.defaultColor,this._show=n(e.show,true),this._outline=n(e.outline,false),this._topShow=n(e.top,true),this._topOutline=n(e.topOutline,true),this._modelMatrix=l.Matrix4.clone(l.Matrix4.IDENTITY),this._quaternion=new l.Quaternion,this._translation=new l.Cartesian3,this._scale=new l.Cartesian3(1,1,1),this._matrix=new l.Matrix4,this._inverseMatrix=new l.Matrix4,this._positionCartographic=new l.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=s,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=n(e.groundArea,false),this.addGroundAreaEntity(this._groundArea);}Object.defineProperties(o.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(s){this._trackedEntity=s;}},color:{get:function(){return this.defaultColor},set:function(s){this.defaultColor=s;}},lineColor:{get:function(){return this.defaultLineColor},set:function(s){this.defaultLineColor=s;}},show:{get:function(){return this._show},set:function(s){this._show=s;}},outline:{get:function(){return this._outline},set:function(s){this._outline=s,this.updateGeometry();}},top:{get:function(){return this._topShow},set:function(s){this._topShow=s,this.updateGeometry();}},topOutline:{get:function(){return this._topOutline},set:function(s){this._topOutline=s,this.updateGeometry();}},groundArea:{get:function(){return this._groundArea},set:function(s){this._groundArea=s,this.addGroundAreaEntity(this._groundArea);}},angle:{get:function(){return this._angle},set:function(s){this._angle=s,this.updateGroundCircleRadius(),this.updateGeometry();}},radius:{get:function(){return this._radius},set:function(s){this._radius=s,this.updateGroundCircleRadius(),this.updateGeometry();}},heading:{get:function(){return this._rotation.heading},set:function(s){this._rotation.heading=s;}},pitch:{get:function(){return this._rotation.pitch},set:function(s){this._rotation.pitch=s;}},roll:{get:function(){return this._rotation.roll},set:function(s){this._rotation.roll=s;}},position:{get:function(){return this._position},set:function(s){this._position=s;}}}),o.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(l.Math.toRadians(this._angle));},o.prototype.isDestroyed=function(){return false},o.prototype.addGroundAreaEntity=function(s){if(s&&!this.groundAreaEntity){var e=this;this.updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:this._rotation.pitch===0&&this._rotation.roll===0,semiMinorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),semiMajorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0),positions:new l.CallbackProperty(function(n){return e._trackedEntityPosition?l.Cartesian3.distance(e._position,e._trackedEntityPosition)>e._radius?[]:[e._position,e._trackedEntityPosition]:[]},false),followSurface:false,material:new l.PolylineDashMaterialProperty({color:l.Color.CYAN}),width:1}});}};var d=new l.Cartesian3;o.prototype.computeMatrix=function(s,e){if(this._positionCartesian||(this._positionCartesian=new l.Cartesian3),this.position instanceof l.Cartesian3?this._positionCartesian=this.position:typeof this.position.getValue=="function"?this._positionCartesian=this.position.getValue(s):this.position._value&&this.position._value instanceof l.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position){this._positionCartesian;var i=l.Property.getValueOrUndefined(this._trackedEntity.position,s,d);i&&(this._trackedEntityPosition=i,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0);}return this._modelMatrix=l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),this._positionCartographic=l.Cartographic.fromCartesian(this._positionCartesian,t,this._positionCartographic),l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),l.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=l.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),l.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),l.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},o.prototype.getTopGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],E=a[u][x-1],V=a[u][x],f=a[u-1][x];i.push(F,E,V),i.push(F,V,f);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var I={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},G=l.BoundingSphere.fromVertices(e),L=new l.Geometry({attributes:I,indices:i,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:G});return (0, l.Scene.computeVertexNormals)(L),L},o.prototype.getTopOutlineGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],E=a[u][x-1],V=a[u][x];a[u-1][x],x%8==1&&i.push(F,E),u%8==1&&i.push(E,V);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var f={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},I=l.BoundingSphere.fromVertices(e),G=new l.Geometry({attributes:f,indices:i,primitiveType:l.PrimitiveType.LINES,boundingSphere:I});return (0, l.Scene.computeVertexNormals)(G),G},o.prototype.updateGeometry=function(){this._geometry=l.Scene.CylinderGeometry.createGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=l.Scene.CylinderGeometry.createOutlineGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var s=0;s<this._positions.length;s++)this._positions[s]=this._geometry.attributes.position.values[s];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy();}),this._drawCommands.splice(0,this._drawCommands.length));},o.prototype.update=function(s){this._show&&(this.computeMatrix(s.time),s.mode===l.SceneMode.SCENE3D?(this._geometry.boundingSphere=l.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,s)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,s)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,s)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,s)))),this._drawCommands.forEach(function(e){s.commandList.push(e);}),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)));},o.prototype.getFragmentShaderSource=function(s){return `#version 300 es
445
+ }`;var M={};function Oe(t){M=t;var o=M.BoundingSphere,d=M.Cartesian3,s=M.Color,e=M.combine,n=M.ComponentDatatype,i=M.defaultValue||M.Scene.defaultValue,a=M.defined;M.destroyObject;var y=M.DeveloperError,S=M.Matrix4,h=M.PrimitiveType,u=M.Buffer,g=M.BufferUsage,_=M.DrawCommand,x=M.Pass,D=M.RenderState,O=M.ShaderProgram,z=M.ShaderSource,b=M.VertexArray,F=M.BlendingState,P=M.CullFace,V=M.Material,f=M.SceneMode,I=M.VertexFormat,G=M.Math,L=M.Matrix3,S=M.Matrix4,B=M.JulianDate;M.BoxGeometry;M.EllipsoidGeometry;var H=Math.sin,Y=Math.cos,q=Math.tan,N=Math.atan,W={position:0,normal:1};function ee(r){var p=this;r=i(r,i.EMPTY_OBJECT),this.show=i(r.show,true),this.slice=i(r.slice,32),this.modelMatrix=S.clone(r.modelMatrix,new S),this._modelMatrix=new S,this._computedModelMatrix=new S,this._computedScanPlaneModelMatrix=new S,this.radius=i(r.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=i(r.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=i(r.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=i(r.lineColor,s.WHITE),this.showSectorLines=i(r.showSectorLines,true),this.showSectorSegmentLines=i(r.showSectorSegmentLines,true),this.showLateralSurfaces=i(r.showLateralSurfaces,true),this.material=a(r.material)?r.material:V.fromType(V.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=a(r.lateralSurfaceMaterial)?r.lateralSurfaceMaterial:V.fromType(V.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=i(r.showDomeSurfaces,true),this.domeSurfaceMaterial=a(r.domeSurfaceMaterial)?r.domeSurfaceMaterial:V.fromType(V.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=i(r.showDomeLines,true),this.showIntersection=i(r.showIntersection,true),this.intersectionColor=i(r.intersectionColor,s.WHITE),this.intersectionWidth=i(r.intersectionWidth,5),this.showThroughEllipsoid=i(r.showThroughEllipsoid,false),this._showThroughEllipsoid=void 0,this.showScanPlane=i(r.showScanPlane,true),this.scanPlaneColor=i(r.scanPlaneColor,s.WHITE),this.scanPlaneMode=i(r.scanPlaneMode,"horizontal"),this.scanPlaneRate=i(r.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=B.now(),this._boundingSphere=new o,this._boundingSphereWC=new o,this._sectorFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return p.xHalfAngle},u_yHalfAngle:function(){return p.yHalfAngle},u_radius:function(){return p.radius},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return p._scanePlaneXHalfAngle},u_yHalfAngle:function(){return p._scanePlaneYHalfAngle},u_radius:function(){return p.radius},u_color:function(){return p.scanPlaneColor},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}};}ee.prototype.update=function(r){var p=r.mode;if(!(!this.show||p!==f.SCENE3D)){var C=false,v=false,w=false,T=this.xHalfAngle,j=this.yHalfAngle;if(T<0||j<0)throw new y("halfAngle must be greater than or equal to zero.");if(!(T==0||j==0)){(this._xHalfAngle!==T||this._yHalfAngle!==j)&&(this._xHalfAngle=T,this._yHalfAngle=j,C=true);var k=this.radius;if(k<0)throw new y("this.radius must be greater than or equal to zero.");var R=false;this._radius!==k&&(R=true,this._radius=k,this._boundingSphere=new o(d.ZERO,this.radius));var X=!S.equals(this.modelMatrix,this._modelMatrix);(X||R)&&(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),o.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var K=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=K,v=true);var Z=this.material;this._material!==Z&&(this._material=Z,v=true,w=true);var $=Z.isTranslucent();if(this._translucent!==$&&(this._translucent=$,v=true),this.showScanPlane){var se=r.time,Ae=B.secondsDifference(se,this._time);Ae<0&&(this._time=B.clone(se,this._time));var ke=Math.max(Ae%this.scanPlaneRate/this.scanPlaneRate,0),oe;if(this.scanPlaneMode=="horizontal"){oe=2*j*ke-j;var Ke=Y(oe),Je=q(T),Qe=N(Ke*Je);this._scanePlaneXHalfAngle=Qe,this._scanePlaneYHalfAngle=oe,M.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,A);}else {oe=2*T*ke-T;var $e=q(j),et=Y(oe),tt=N(et*$e);this._scanePlaneXHalfAngle=oe,this._scanePlaneYHalfAngle=tt,M.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,A);}M.Matrix4.multiplyByMatrix3(this.modelMatrix,A,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix);}C&&je(this,r),v&&Ze(this,K,$),w&&Xe(this,r,Z),(v||w)&&qe(this,$);var nt=r.commandList,at=r.passes,De=this._colorCommands;if(at.render)for(var ve=0,rt=De.length;ve<rt;ve++){var it=De[ve];nt.push(it);}}}},ee.prototype.isDestroyed=function(){return false};var A=new L,te=new d;function re(r,p,C){for(var v=r.slice,w=Y(C),T=q(C),j=Y(p),k=q(p),R=N(j*T),X=N(w*k),K=[],Z=0;Z<v;Z++){var $=2*R*Z/(v-1)-R;K.push(new d(0,H($),Y($)));}for(var se=[],Z=0;Z<v;Z++){var $=2*X*Z/(v-1)-X;se.push(new d(H($),0,Y($)));}return {zoy:K,zox:se}}function ue(r,p){var C=r.xHalfAngle,v=r.yHalfAngle,w=p.zoy,T=p.zox,j=[],k=L.fromRotationY(C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}));var k=L.fromRotationX(-v,A);j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationY(-C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationX(v,A);return j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)})),j}function fe(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(18*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=d.normalize(d.cross(k[0],k[k.length-1],te),te),X=0,C=k.length-1;X<C;X++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X].x,v[w++]=k[X].y,v[w++]=k[X].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X+1].x,v[w++]=k[X+1].y,v[w++]=k[X+1].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z;var K=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),Z=6*Float32Array.BYTES_PER_ELEMENT,$=[{index:W.position,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:Z},{index:W.normal,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:Z}];return new b({context:r,attributes:$})}function ge(r,p){for(var C=p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++){var k=p[T];v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=k[0].x,v[w++]=k[0].y,v[w++]=k[0].z;}var R=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),X=3*Float32Array.BYTES_PER_ELEMENT,K=[{index:W.position,vertexBuffer:R,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:X}];return new b({context:r,attributes:K})}function He(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=0,C=k.length-1;R<C;R++)v[w++]=k[R].x,v[w++]=k[R].y,v[w++]=k[R].z,v[w++]=k[R+1].x,v[w++]=k[R+1].y,v[w++]=k[R+1].z;var X=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),K=3*Float32Array.BYTES_PER_ELEMENT,Z=[{index:W.position,vertexBuffer:X,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:K}];return new b({context:r,attributes:Z})}function Ne(r){var p=M.EllipsoidGeometry.createGeometry(new M.EllipsoidGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function We(r){var p=M.EllipsoidOutlineGeometry.createGeometry(new M.EllipsoidOutlineGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function Me(r,p){for(var C=p.length-1,v=new Float32Array(9*C),w=0,T=0;T<C;T++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=p[T].x,v[w++]=p[T].y,v[w++]=p[T].z,v[w++]=p[T+1].x,v[w++]=p[T+1].y,v[w++]=p[T+1].z;var j=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),k=3*Float32Array.BYTES_PER_ELEMENT,R=[{index:W.position,vertexBuffer:j,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:k}];return new b({context:r,attributes:R})}function je(r,p){var C=p.context,v=re(r,r.xHalfAngle,r.yHalfAngle),w=ue(r,v);if(r.showLateralSurfaces&&(r._sectorVA=fe(C,w)),r.showSectorLines&&(r._sectorLineVA=ge(C,w)),r.showSectorSegmentLines&&(r._sectorSegmentLineVA=He(C,w)),r.showDomeSurfaces&&(r._domeVA=Ne(C)),r.showDomeLines&&(r._domeLineVA=We(C)),r.showScanPlane)if(r.scanPlaneMode=="horizontal"){var T=re(r,G.PI_OVER_TWO,0);r._scanPlaneVA=Me(C,T.zox);}else {var T=re(r,0,G.PI_OVER_TWO);r._scanPlaneVA=Me(C,T.zoy);}}function Ye(r,p,C){var v=p.context,w=Ee,T=new z({sources:[pe,C.shaderSource,Pe]});r._sp=O.replaceCache({context:v,shaderProgram:r._sp,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});var j=new z({sources:[pe,C.shaderSource,Pe],pickColorQualifier:"uniform"});r._pickSP=O.replaceCache({context:v,shaderProgram:r._pickSP,vertexShaderSource:w,fragmentShaderSource:j,attributeLocations:W});}function Ue(r,p,C){var v=p.context,w=Ee,T=new z({sources:[pe,C.shaderSource,Ve]});r._scanePlaneSP=O.replaceCache({context:v,shaderProgram:r._scanePlaneSP,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});}function Xe(r,p,C){Ye(r,p,C),r.showScanPlane&&Ue(r,p,C);}function Ze(r,p,C){C?(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:P.BACK}}),r._backFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:P.FRONT}}),r._pickRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND})):(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:true}),r._pickRS=D.fromCache({depthTest:{enabled:true},depthMask:true}));}function ie(r,p,C,v,w,T,j,k,R,X,K,Z){X&&C&&(C.vertexArray=j,C.renderState=w,C.shaderProgram=T,C.uniformMap=e(k,r._material._uniforms),C.uniformMap.u_normalDirection=function(){return -1},C.pass=K,C.modelMatrix=R,r._colorCommands.push(C)),p.vertexArray=j,p.renderState=v,p.shaderProgram=T,p.uniformMap=e(k,r._material._uniforms),Z&&(p.uniformMap.u_type=function(){return 1}),p.pass=K,p.modelMatrix=R,r._colorCommands.push(p);}function qe(r,p){r._colorCommands.length=0;var C=p?x.TRANSLUCENT:x.OPAQUE;r.showLateralSurfaces&&ie(r,r._sectorFrontCommand,r._sectorBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorVA,r._uniforms,r._computedModelMatrix,p,C),r.showSectorLines&&ie(r,r._sectorLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showSectorSegmentLines&&ie(r,r._sectorSegmentLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorSegmentLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showDomeSurfaces&&ie(r,r._domeFrontCommand,r._domeBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._domeVA,r._uniforms,r._computedModelMatrix,p,C),r.showDomeLines&&ie(r,r._domeLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._domeLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showScanPlane&&ie(r,r._scanPlaneFrontCommand,r._scanPlaneBackCommand,r._frontFaceRS,r._backFaceRS,r._scanePlaneSP,r._scanPlaneVA,r._scanUniforms,r._computedScanPlaneModelMatrix,p,C);}return ee}var ae={};function ze(t){ae=t;var o=ae.defaultValue||ae.Scene.defaultValue,d=ae.defined,s=Object.defineProperties,e=ae.DeveloperError,n=ae.Event,i=ae.createMaterialPropertyDescriptor,a=ae.createPropertyDescriptor;function m(c){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 n,this.merge(o(c,o.EMPTY_OBJECT));}return s(m.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radius:a("radius"),xHalfAngle:a("xHalfAngle"),yHalfAngle:a("yHalfAngle"),lineColor:a("lineColor"),showSectorLines:a("showSectorLines"),showSectorSegmentLines:a("showSectorSegmentLines"),showLateralSurfaces:a("showLateralSurfaces"),material:i("material"),showDomeSurfaces:a("showDomeSurfaces"),showDomeLines:a("showDomeLines "),showIntersection:a("showIntersection"),intersectionColor:a("intersectionColor"),intersectionWidth:a("intersectionWidth"),showThroughEllipsoid:a("showThroughEllipsoid"),gaze:a("gaze"),showScanPlane:a("showScanPlane"),scanPlaneColor:a("scanPlaneColor"),scanPlaneMode:a("scanPlaneMode"),scanPlaneRate:a("scanPlaneRate")}),m.prototype.clone=function(c){return d(c)||(c=new m),c.show=this.show,c.radius=this.radius,c.xHalfAngle=this.xHalfAngle,c.yHalfAngle=this.yHalfAngle,c.lineColor=this.lineColor,c.showSectorLines=this.showSectorLines,c.showSectorSegmentLines=this.showSectorSegmentLines,c.showLateralSurfaces=this.showLateralSurfaces,c.material=this.material,c.showDomeSurfaces=this.showDomeSurfaces,c.showDomeLines=this.showDomeLines,c.showIntersection=this.showIntersection,c.intersectionColor=this.intersectionColor,c.intersectionWidth=this.intersectionWidth,c.showThroughEllipsoid=this.showThroughEllipsoid,c.gaze=this.gaze,c.showScanPlane=this.showScanPlane,c.scanPlaneColor=this.scanPlaneColor,c.scanPlaneMode=this.scanPlaneMode,c.scanPlaneRate=this.scanPlaneRate,c},m.prototype.merge=function(c){if(!d(c))throw new e("source is required.");this.show=o(this.show,c.show),this.radius=o(this.radius,c.radius),this.xHalfAngle=o(this.xHalfAngle,c.xHalfAngle),this.yHalfAngle=o(this.yHalfAngle,c.yHalfAngle),this.lineColor=o(this.lineColor,c.lineColor),this.showSectorLines=o(this.showSectorLines,c.showSectorLines),this.showSectorSegmentLines=o(this.showSectorSegmentLines,c.showSectorSegmentLines),this.showLateralSurfaces=o(this.showLateralSurfaces,c.showLateralSurfaces),this.material=o(this.material,c.material),this.showDomeSurfaces=o(this.showDomeSurfaces,c.showDomeSurfaces),this.showDomeLines=o(this.showDomeLines,c.showDomeLines),this.showIntersection=o(this.showIntersection,c.showIntersection),this.intersectionColor=o(this.intersectionColor,c.intersectionColor),this.intersectionWidth=o(this.intersectionWidth,c.intersectionWidth),this.showThroughEllipsoid=o(this.showThroughEllipsoid,c.showThroughEllipsoid),this.gaze=o(this.gaze,c.gaze),this.showScanPlane=o(this.showScanPlane,c.showScanPlane),this.scanPlaneColor=o(this.scanPlaneColor,c.scanPlaneColor),this.scanPlaneMode=o(this.scanPlaneMode,c.scanPlaneMode),this.scanPlaneRate=o(this.scanPlaneRate,c.scanPlaneRate);},m}var J={};function Fe(t,o){if(t){let V=function(f,I,G){var L=I[f.id];if(n(L)){var S=L.primitive;G.remove(S),S&&!S.isDestroyed()&&S.destroy(),delete I[f.id];}};J=t;var d=J.AssociativeArray,s=J.Cartesian3,e=J.Color,n=J.defined,i=J.destroyObject,a=J.DeveloperError,m=J.Matrix3,c=J.Matrix4,y=J.Quaternion,h=J.MaterialProperty,u=J.Property,g=new m;new c;var x=new s,D=new s,O=new y,z=new s,b=new y,F=function(f,I){if(!n(f))throw new a("scene is required.");if(!n(I))throw new a("entityCollection is required.");I.collectionChanged.addEventListener(F.prototype._onCollectionChanged,this),this._scene=f,this._primitives=f.primitives,this._entityCollection=I,this._hash={},this._entitiesToVisualize=new d,this._onCollectionChanged(I,I.values,[],[]);};return F.prototype.update=function(f){if(!n(f))throw new a("time is required.");for(var I=this._entitiesToVisualize.values,G=this._hash,L=this._primitives,S=0,B=I.length;S<B;S++){var U=I[S],E=U._rectangularSensor,H,Y,q,N,Q,W=G[U.id],ee=U.isShowing&&U.isAvailable(f)&&u.getValueOrDefault(E._show,f,true);if(ee&&(H=u.getValueOrUndefined(U._position,f,x),Y=u.getValueOrUndefined(U._orientation,f,O),q=u.getValueOrUndefined(E._radius,f),N=u.getValueOrUndefined(E._xHalfAngle,f),Q=u.getValueOrUndefined(E._yHalfAngle,f),ee=n(H)&&n(N)&&n(Q)),!ee){n(W)&&(W.primitive.show=false);continue}var A=n(W)?W.primitive:void 0;n(A)||(A=new o,A.id=U,L.add(A),W={primitive:A,position:void 0,orientation:void 0},G[U.id]=W);var te=u.getValueOrUndefined(E._gaze,f);if(n(te)){var re=u.getValueOrUndefined(te._position,f,D);if(!n(H)||!n(re))continue;var ue=s.subtract(H,re,z),fe=s.angleBetween(J.Cartesian3.UNIT_Z,ue),ge=s.cross(J.Cartesian3.UNIT_Z,ue,z),Y=y.fromAxisAngle(ge,fe-Math.PI,b);q=s.distance(H,re),A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix);}else (!s.equals(H,W.position)||!y.equals(Y,W.orientation))&&(n(Y)?(A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix),W.position=s.clone(H,W.position),W.orientation=y.clone(Y,W.orientation)):(A.modelMatrix=J.Transforms.eastNorthUpToFixedFrame(H),W.position=s.clone(H,W.position)));A.show=true,A.gaze=te,A.radius=q,A.xHalfAngle=N,A.yHalfAngle=Q,A.lineColor=u.getValueOrDefault(E._lineColor,f,e.WHITE),A.showSectorLines=u.getValueOrDefault(E._showSectorLines,f,true),A.showSectorSegmentLines=u.getValueOrDefault(E._showSectorSegmentLines,f,true),A.showLateralSurfaces=u.getValueOrDefault(E._showLateralSurfaces,f,true),A.material=h.getValue(f,E._material,A.material),A.showDomeSurfaces=u.getValueOrDefault(E._showDomeSurfaces,f,true),A.showDomeLines=u.getValueOrDefault(E._showDomeLines,f,true),A.showIntersection=u.getValueOrDefault(E._showIntersection,f,true),A.intersectionColor=u.getValueOrDefault(E._intersectionColor,f,e.WHITE),A.intersectionWidth=u.getValueOrDefault(E._intersectionWidth,f,1),A.showThroughEllipsoid=u.getValueOrDefault(E._showThroughEllipsoid,f,true),A.scanPlaneMode=u.getValueOrDefault(E._scanPlaneMode,f),A.scanPlaneColor=u.getValueOrDefault(E._scanPlaneColor,f,e.WHITE),A.showScanPlane=u.getValueOrDefault(E._showScanPlane,f,true),A.scanPlaneRate=u.getValueOrDefault(E._scanPlaneRate,f,1);}return true},F.prototype.isDestroyed=function(){return false},F.prototype.destroy=function(){for(var f=this._entitiesToVisualize.values,I=this._hash,G=this._primitives,L=f.length-1;L>-1;L--)V(f[L],I,G);return i(this)},F.prototype._onCollectionChanged=function(f,I,G,L){var S,B,U=this._entitiesToVisualize,E=this._hash,H=this._primitives;for(S=I.length-1;S>-1;S--)B=I[S],n(B._rectangularSensor)&&n(B._position)&&U.set(B.id,B);for(S=L.length-1;S>-1;S--)B=L[S],n(B._rectangularSensor)&&n(B._position)?U.set(B.id,B):(V(B,E,H),U.remove(B.id));for(S=G.length-1;S>-1;S--)B=G[S],V(B,E,H),U.remove(B.id);},F}}var l=null,be=function(t,o){t&&(this.viewer=t,l=o,this._installPlugin());};be.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive();},_installCylinderGeometry:function(){function t(e){this.length=e.length,this.topRadius=e.topRadius,this.bottomRadius=e.bottomRadius,this.slices=e.slices?e.slices:64,this.zReverse=e.zReverse;}var o=new l.Cartesian2,d=new l.Cartesian3,s=new l.Ray;t._createGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),P=0;P<D.length;P++){_[P]=[];for(var V=x[P],f=0;f<m;f++){_[P].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[P]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(P/(D.length-1),0);}}for(var S=[],P=1;P<D.length;P++)for(var f=1;f<m;f++){var B=_[P-1][f-1],U=_[P][f-1],E=_[P][f],H=_[P-1][f];S.push(E),S.push(H),S.push(B),S.push(E),S.push(B),S.push(U),f==_[P].length-1&&(B=_[P-1][f],U=_[P][f],E=_[P][0],H=_[P-1][0],S.push(E),S.push(H),S.push(B),S.push(E),S.push(B),S.push(U));}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var Y={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},q=l.BoundingSphere.fromVertices(h),N=new l.Geometry({attributes:Y,indices:S,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:q});return h=[],S=[],g=[],N},t.createGeometry=function(e,n){if(!n)return t._createGeometry(e);l.Matrix4.multiplyByPoint(n,l.Cartesian3.ZERO,d),d.clone(s.origin);var i=e.length,a=e.topRadius,m=(e.bottomRadius,e.slices),c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[0,y?-i:i],D=0,D=0;h.push(0,0,0),u.push(1,1),D++;for(var O=new l.Cartesian3,z=a/15,b=0;b<16;b++){for(var F=z*b,P=[],V=0;V<m;V++){var f=c*V,I=F*Math.cos(f),G=F*Math.sin(f);O.x=I,O.y=G,O.z=x[1];var L=(0, l.Scene.extend2Earth)(O,n,s);L?(P.push(D),h.push(I,G,x[1]),u.push(b/15,1),D++):(L=d,P.push(-1));}_.push(P);}for(var S,B,U=[0,_.length-1],E=0;E<U.length;E++)for(var b=U[E],V=1;V<_[b].length;V++)S=_[b][V-1],B=_[b][V],S>=0&&B>=0&&g.push(0,S,B);h=new Float32Array(h),g=new Int32Array(g),u=new Float32Array(u);var H={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:u})},Y=l.BoundingSphere.fromVertices(h),q=new l.Geometry({attributes:H,indices:g,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:Y});return (0, l.Scene.computeVertexNormals)(q),h=[],g=[],q},t.createOutlineGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),P=0;P<D.length;P++){_[P]=[];for(var V=x[P],f=0;f<m;f++){_[P].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[P]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(P/(D.length-1),0);}}for(var S=[],P=1;P<D.length;P++)for(var f=1;f<m;f+=1){var B=_[P-1][f-1],U=_[P][f-1];_[P][f],_[P-1][f],f%8==1&&S.push(B,U);}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var E={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},H=l.BoundingSphere.fromVertices(h),Y=new l.Geometry({attributes:E,indices:S,primitiveType:l.PrimitiveType.LINES,boundingSphere:H});return h=[],S=[],g=[],Y},t.fromAngleAndLength=function(e,n,i){return e=l.Math.toRadians(e),new t({topRadius:Math.tan(e)*n/2,bottomRadius:0,length:n,zReverse:i})},l.Scene.CylinderGeometry=t;},_installRadarPrimitive:function(){var t;function o(s,e){let n=l.defaultValue||de;e=e||{},t=s.scene.globe.ellipsoid,this._geometry=null,this._angle=e.angle,this._radius=e.radius?e.radius:5,this._position=e.position,this._rotation=e.rotation?e.rotation:{heading:0,pitch:0,roll:0},this._trackedEntity=e.trackedEntity,this.defaultColor=e.color?e.color:l.Color.YELLOW,this.defaultLineColor=e.lineColor?e.lineColor:this.defaultColor,this._show=n(e.show,true),this._outline=n(e.outline,false),this._topShow=n(e.top,true),this._topOutline=n(e.topOutline,true),this._modelMatrix=l.Matrix4.clone(l.Matrix4.IDENTITY),this._quaternion=new l.Quaternion,this._translation=new l.Cartesian3,this._scale=new l.Cartesian3(1,1,1),this._matrix=new l.Matrix4,this._inverseMatrix=new l.Matrix4,this._positionCartographic=new l.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=s,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=n(e.groundArea,false),this.addGroundAreaEntity(this._groundArea);}Object.defineProperties(o.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(s){this._trackedEntity=s;}},color:{get:function(){return this.defaultColor},set:function(s){this.defaultColor=s;}},lineColor:{get:function(){return this.defaultLineColor},set:function(s){this.defaultLineColor=s;}},show:{get:function(){return this._show},set:function(s){this._show=s;}},outline:{get:function(){return this._outline},set:function(s){this._outline=s,this.updateGeometry();}},top:{get:function(){return this._topShow},set:function(s){this._topShow=s,this.updateGeometry();}},topOutline:{get:function(){return this._topOutline},set:function(s){this._topOutline=s,this.updateGeometry();}},groundArea:{get:function(){return this._groundArea},set:function(s){this._groundArea=s,this.addGroundAreaEntity(this._groundArea);}},angle:{get:function(){return this._angle},set:function(s){this._angle=s,this.updateGroundCircleRadius(),this.updateGeometry();}},radius:{get:function(){return this._radius},set:function(s){this._radius=s,this.updateGroundCircleRadius(),this.updateGeometry();}},heading:{get:function(){return this._rotation.heading},set:function(s){this._rotation.heading=s;}},pitch:{get:function(){return this._rotation.pitch},set:function(s){this._rotation.pitch=s;}},roll:{get:function(){return this._rotation.roll},set:function(s){this._rotation.roll=s;}},position:{get:function(){return this._position},set:function(s){this._position=s;}}}),o.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(l.Math.toRadians(this._angle));},o.prototype.isDestroyed=function(){return false},o.prototype.addGroundAreaEntity=function(s){if(s&&!this.groundAreaEntity){var e=this;this.updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:this._rotation.pitch===0&&this._rotation.roll===0,semiMinorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),semiMajorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0),positions:new l.CallbackProperty(function(n){return e._trackedEntityPosition?l.Cartesian3.distance(e._position,e._trackedEntityPosition)>e._radius?[]:[e._position,e._trackedEntityPosition]:[]},false),followSurface:false,material:new l.PolylineDashMaterialProperty({color:l.Color.CYAN}),width:1}});}};var d=new l.Cartesian3;o.prototype.computeMatrix=function(s,e){if(this._positionCartesian||(this._positionCartesian=new l.Cartesian3),this.position instanceof l.Cartesian3?this._positionCartesian=this.position:typeof this.position.getValue=="function"?this._positionCartesian=this.position.getValue(s):this.position._value&&this.position._value instanceof l.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position){this._positionCartesian;var i=l.Property.getValueOrUndefined(this._trackedEntity.position,s,d);i&&(this._trackedEntityPosition=i,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0);}return this._modelMatrix=l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),this._positionCartographic=l.Cartographic.fromCartesian(this._positionCartesian,t,this._positionCartographic),l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),l.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=l.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),l.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),l.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},o.prototype.getTopGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],P=a[u][x-1],V=a[u][x],f=a[u-1][x];i.push(F,P,V),i.push(F,V,f);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var I={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},G=l.BoundingSphere.fromVertices(e),L=new l.Geometry({attributes:I,indices:i,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:G});return (0, l.Scene.computeVertexNormals)(L),L},o.prototype.getTopOutlineGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],P=a[u][x-1],V=a[u][x];a[u-1][x],x%8==1&&i.push(F,P),u%8==1&&i.push(P,V);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var f={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},I=l.BoundingSphere.fromVertices(e),G=new l.Geometry({attributes:f,indices:i,primitiveType:l.PrimitiveType.LINES,boundingSphere:I});return (0, l.Scene.computeVertexNormals)(G),G},o.prototype.updateGeometry=function(){this._geometry=l.Scene.CylinderGeometry.createGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=l.Scene.CylinderGeometry.createOutlineGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var s=0;s<this._positions.length;s++)this._positions[s]=this._geometry.attributes.position.values[s];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy();}),this._drawCommands.splice(0,this._drawCommands.length));},o.prototype.update=function(s){this._show&&(this.computeMatrix(s.time),s.mode===l.SceneMode.SCENE3D?(this._geometry.boundingSphere=l.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,s)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,s)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,s)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,s)))),this._drawCommands.forEach(function(e){s.commandList.push(e);}),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)));},o.prototype.getFragmentShaderSource=function(s){return `#version 300 es
446
446
  in vec3 v_position;
447
447
  in vec3 v_normal;
448
448
  uniform float picked;
@@ -120,7 +120,7 @@ void main(void)
120
120
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
121
121
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
122
122
  }
123
- `;return this._viewer.scene.postProcessStages.add(new t.PostProcessStage({fragmentShader:e,uniforms:{fogByDistance:new t.Cartesian4(10,0,200,.3),fogColor:t.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(e){e&&(Array.isArray(e)?e.forEach(n=>{this._viewer.scene.postProcessStages.contains(n)&&this._viewer.scene.postProcessStages.remove(n);}):this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e));}setView(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,window.opt.distance);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)}});}}flyTo(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,0);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)},easingFunction:e.easingFunction||t.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback});}}transformCartesianToWGS84(e){var n,i,a;if(this._viewer&&e){if(e.x===void 0&&(e.lng!==void 0||e.lon!==void 0))return {lng:Number((n=e.lng)!=null?n:e.lon),lat:Number(e.lat),alt:Number((a=(i=e.alt)!=null?i:e.height)!=null?a:0)};let m=t.Cartographic.fromCartesian(e);return {lng:t.Math.toDegrees(m.longitude),lat:t.Math.toDegrees(m.latitude),alt:m.height}}}transformWGS84ArrayToCartesianArray(e,n){if(this._viewer&&e){var i=this;return e?e.map(function(a){return i.transformWGS84ToCartesian(a,n)}):[]}}transformWGS84ToCartesian(e,n){if(this._viewer)return e?t.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=n||e.alt,t.Ellipsoid.WGS84):t.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(e){if(this._viewer){var n=this;return e?e.map(function(i){return n.transformCartesianToWGS84(i)}).filter(function(i){return !!i}):[]}}transformWGS84ToCartographic(e){return e?t.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):t.Cartographic.ZERO}lnglatArrayToCartesians(e){if(!e||e.length<1)return [];let n=[];for(let i=0;i<e.length;i++){let a=t.Cartesian3.fromDegrees(Number(e[i][0]),Number(e[i][1]),Number(e[i][2]||0));n.push(a);}return n}setCameraEotateHeading(e){if(e){let n=this._viewer,i=t.Cartesian3.fromDegrees(e.lng,e.lat,e.height),a=t.Math.toRadians(-30),m=360/30,c=5e3,y=t.JulianDate.fromDate(new Date);n.clock.startTime=y.clone(),n.clock.currentTime=y.clone(),n.clock.clockRange=t.ClockRange.CLAMPED,n.clock.clockStep=t.ClockStep.SYSTEM_CLOCK;let h=n.camera.heading,u=function(){let _=t.JulianDate.secondsDifference(n.clock.currentTime,n.clock.startTime),x=t.Math.toRadians(_*m)+h;n.scene.camera.setView({destination:i,orientation:{heading:x,pitch:a}}),n.scene.camera.moveBackward(c),t.JulianDate.compare(n.clock.currentTime,n.clock.stopTime)>=0&&n.clock.onTick.removeEventListener(u);};n.clock.onTick.addEventListener(u),ye(this,()=>{n.clock.onTick.removeEventListener(u);});}}getCatesian3FromPX(e){if(this._viewer&&e){var n=this._viewer.scene.pick(e),i=null,a=false,m=false;if(n instanceof t.Cesium3DTileFeature&&(a=true),a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!n){var c=this._viewer.scene.camera.getPickRay(e);if(!c)return null;i=this._viewer.scene.globe.pick(c,this._viewer.scene),m=true;}if(n&&!a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!a&&!m&&!n&&(i=this._viewer.scene.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid)),i){let y=this.transformCartesianToWGS84(i);return y.alt<0&&(i=this.transformWGS84ToCartesian(y,.1)),i}return false}}getCameraPosition(){if(this._viewer){var e=this._viewer.scene.camera.pickEllipsoid(new t.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(e){var n=t.Ellipsoid.WGS84.cartesianToCartographic(e),i=n.longitude*180/Math.PI,a=n.latitude*180/Math.PI,m=this._viewer.camera._direction,c=t.Math.toDegrees(m.x),y=t.Math.toDegrees(m.y),h=t.Math.toDegrees(m.z),u=this._viewer.camera.positionCartographic.height,g=t.Math.toDegrees(this._viewer.camera.heading),_=t.Math.toDegrees(this._viewer.camera.pitch),x=t.Math.toDegrees(this._viewer.camera.roll),D=this._viewer.camera.computeViewRectangle(),O=D.west/Math.PI*180,z=D.north/Math.PI*180,b=D.east/Math.PI*180,F=D.south/Math.PI*180,E=(O+b)/2,V=(z+F)/2;return {lon:i,lat:a,height:u,heading:g,pitch:_,roll:x,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:E,y:V},direction:new t.Cartesian3(c,y,h)}}}}pickUpPosition(e){return this.getCatesian3FromPX(e.position)}getHandlerClickPosition(e){if(this._viewer){let n=this._viewer.scene,i=this._viewer,a=n.camera.pickEllipsoid(e.position,n.globe.elliposid),m={cameraPosistion:i.camera.position,heading:i.camera.heading,pitch:i.camera.pitch,roll:i.camera.roll},c=t.Cartographic.fromCartesian(a);c.height<0&&(c.height=0);let y={alt:c.height,lat:t.Math.toDegrees(c.latitude),lon:t.Math.toDegrees(c.longitude)},h=n.pickPosition(e.position),u=t.Cartographic.fromCartesian(h),g={height:u.height,latitude:t.Math.toDegrees(u.latitude),longitude:t.Math.toDegrees(u.longitude)};return {wgs84Coor:y,graphicCoor:g,cameraPosition:m}}}updateCameraState(e){this._viewer.scene._screenSpaceCameraController.enableRotate=e,this._viewer.scene._screenSpaceCameraController.enableTranslate=e,this._viewer.scene._screenSpaceCameraController.enableZoom=e,this._viewer.scene._screenSpaceCameraController.enableTilt=e,this._viewer.scene._screenSpaceCameraController.enableLook=e;}bindHandleEvent({leftClick:e,mouseMove:n,doubleClick:i,leftDown:a,mouseWheel:m,leftUp:c}){if(this._viewer){var y=new t.ScreenSpaceEventHandler(this._viewer.canvas);ye(this,()=>{y&&!y.isDestroyed()&&y.destroy();}),e&&y.setInputAction(function(h){e(h,y);},t.ScreenSpaceEventType.LEFT_CLICK),n&&y.setInputAction(function(h){n(h,y);},t.ScreenSpaceEventType.MOUSE_MOVE),i&&y.setInputAction(function(h){i(h,y);},t.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),a&&y.setInputAction(function(h){a(h,y);},t.ScreenSpaceEventType.LEFT_DOWN),m&&y.setInputAction(function(h){m(h,y);},t.ScreenSpaceEventType.WHEEL),c&&y.setInputAction(function(h){c(h,y);},t.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(e){return this.bindHandleEvent(e)}getHandlePosition(e){if(this._viewer){var n=new t.ScreenSpaceEventHandler(this._viewer.scene.canvas),i=this;ye(this,()=>{n&&!n.isDestroyed()&&n.destroy();}),n.setInputAction(function(a){var m=i._viewer.scene.camera.pickEllipsoid(a.endPosition,i._viewer.scene.globe.ellipsoid);typeof e=="function"&&e(i.transformCartesianToWGS84(m),n);},t.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(e){return this.getHandlePosition(e)}saveSceneImages(){if(this._viewer){let c=function(y){for(var h=y.split(","),u=h[0].match(/:(.*?);/)[1],g=atob(h[1]),_=g.length,x=new Uint8Array(_);_--;)x[_]=g.charCodeAt(_);return new Blob([x],{type:u})};var e=this._viewer.scene.canvas,n=e.toDataURL("image/png").replace("image/png","image/octet-stream"),i=document.createElement("a"),a=c(n),m=URL.createObjectURL(a);i.download="scene.png",i.href=m,i.click();}}_installAmapImageryProvider(){let e="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",n="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function i(a){return a.url=a.style==="img"?e:n,a.subdomains||(a.subdomains=["01","02","03","04"]),new t.UrlTemplateImageryProvider(a)}t.Scene.AmapImageryProvider=i;}_installTdtImageryProvider(){let e="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 n(i){return new t.WebMapTileServiceImageryProvider({url:e.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})}t.Scene.TdtImageryProvider=n;}_installTencentImageryProvider(){let e="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",n="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function i(a){return a.layer==="img"?(a.url||(a.url=e),a.subdomains||(a.subdomains=["0","1","2"]),a.customTags={sx(m,c,y,h){return c>>4},sy(m,c,y,h){return (1<<h)-y>>4}}):a.url||(a.url=n),new t.UrlTemplateImageryProvider(a)}t.Scene.TencentImageryProvider=i;}_installGoogleImageryProvider(){let e="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",n="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 a(m){return m.url=m.style==="img"?n:m.style==="ter"?i:e,m.subdomains||(m.subdomains=["1","2","3","4","5"]),new t.UrlTemplateImageryProvider(m)}t.Scene.GoogleImageryProvider=a;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var e="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function n(a){e=a.url||e,this._url=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new t.WebMercatorTilingScheme({rectangleSouthwestInMeters:new t.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new t.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=a.style||"normal",this._ready=true;}Object.defineProperties(n.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new t.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new t.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new t.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new t.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(a,m,c,y,h){var u=a._url+"&x={x}&y={y}&z={z}&customid={style}",g=a._tilingScheme.getNumberOfXTilesAtLevel(y),_=a._tilingScheme.getNumberOfYTilesAtLevel(y);return u=u.replace("{x}",String(m-g/2)).replace("{y}",String(_/2-c-1)).replace("{z}",String(y)).replace("{style}",h),u}n.prototype.getTileCredits=function(a,m,c){},n.prototype.requestImage=function(a,m,c){if(!this.ready)throw new t.DeveloperError("requestImage must not be called before the imagery provider is ready.");var y=i(this,a,m,c,this._style);return t.ImageryProvider.loadImage(this,y)},t.Scene.BaiduImageryProvider=n;}_installGroundSkyBox(){var e=t.BoxGeometry,n=t.Cartesian3,i=t.defaultValue||de,a=t.defined,m=t.destroyObject,c=t.DeveloperError,y=t.GeometryPipeline,h=t.Matrix3,u=t.Matrix4,g=t.Transforms,_=t.VertexFormat,x=t.BufferUsage,D=t.CubeMap,O=t.DrawCommand,z=t.loadCubeMap,b=t.RenderState,F=t.VertexArray,E=t.BlendingState,V=t.SceneMode,f=t.ShaderProgram,I=t.ShaderSource,G=`uniform samplerCube u_cubeMap;
123
+ `;return this._viewer.scene.postProcessStages.add(new t.PostProcessStage({fragmentShader:e,uniforms:{fogByDistance:new t.Cartesian4(10,0,200,.3),fogColor:t.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(e){e&&(Array.isArray(e)?e.forEach(n=>{this._viewer.scene.postProcessStages.contains(n)&&this._viewer.scene.postProcessStages.remove(n);}):this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e));}setView(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,window.opt.distance);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)}});}}flyTo(e){if(this._viewer&&e&&e.position){if(e.distance){var n=new t.Cartesian3(0,e.distance,0);e.position=t.Cartesian3.add(e.position,n,new t.Cartesian3);}this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:t.Math.toRadians(90),pitch:t.Math.toRadians(90),roll:t.Math.toRadians(0)},easingFunction:e.easingFunction||t.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback});}}transformCartesianToWGS84(e){var n,i,a;if(this._viewer&&e){if(e.x===void 0&&(e.lng!==void 0||e.lon!==void 0))return {lng:Number((n=e.lng)!=null?n:e.lon),lat:Number(e.lat),alt:Number((a=(i=e.alt)!=null?i:e.height)!=null?a:0)};let m=t.Cartographic.fromCartesian(e);return {lng:t.Math.toDegrees(m.longitude),lat:t.Math.toDegrees(m.latitude),alt:m.height}}}transformWGS84ArrayToCartesianArray(e,n){if(this._viewer&&e){var i=this;return e?e.map(function(a){return i.transformWGS84ToCartesian(a,n)}):[]}}transformWGS84ToCartesian(e,n){if(this._viewer)return e?t.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=n||e.alt,t.Ellipsoid.WGS84):t.Cartesian3.ZERO}transformCartesianArrayToWGS84Array(e){if(this._viewer){var n=this;return e?e.map(function(i){return n.transformCartesianToWGS84(i)}).filter(function(i){return !!i}):[]}}transformWGS84ToCartographic(e){return e?t.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):t.Cartographic.ZERO}lnglatArrayToCartesians(e){if(!e||e.length<1)return [];let n=[];for(let i=0;i<e.length;i++){let a=t.Cartesian3.fromDegrees(Number(e[i][0]),Number(e[i][1]),Number(e[i][2]||0));n.push(a);}return n}setCameraEotateHeading(e){if(e){let n=this._viewer,i=t.Cartesian3.fromDegrees(e.lng,e.lat,e.height),a=t.Math.toRadians(-30),m=360/30,c=5e3,y=t.JulianDate.fromDate(new Date);n.clock.startTime=y.clone(),n.clock.currentTime=y.clone(),n.clock.clockRange=t.ClockRange.CLAMPED,n.clock.clockStep=t.ClockStep.SYSTEM_CLOCK;let h=n.camera.heading,u=function(){let _=t.JulianDate.secondsDifference(n.clock.currentTime,n.clock.startTime),x=t.Math.toRadians(_*m)+h;n.scene.camera.setView({destination:i,orientation:{heading:x,pitch:a}}),n.scene.camera.moveBackward(c),t.JulianDate.compare(n.clock.currentTime,n.clock.stopTime)>=0&&n.clock.onTick.removeEventListener(u);};n.clock.onTick.addEventListener(u),ye(this,()=>{n.clock.onTick.removeEventListener(u);});}}getCatesian3FromPX(e){if(this._viewer&&e){var n=this._viewer.scene.pick(e),i=null,a=false,m=false;if(n instanceof t.Cesium3DTileFeature&&(a=true),a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!n){var c=this._viewer.scene.camera.getPickRay(e);if(!c)return null;i=this._viewer.scene.globe.pick(c,this._viewer.scene),m=true;}if(n&&!a&&(i=this._viewer.scene.pickPosition(e),i)){let y=t.Cartographic.fromCartesian(i);y.height<0&&(y.height=0);let h=t.Math.toDegrees(y.longitude),u=t.Math.toDegrees(y.latitude),g=y.height;i=this.transformWGS84ToCartesian({lng:h,lat:u,alt:g});}if(!a&&!m&&!n&&(i=this._viewer.scene.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid)),i){let y=this.transformCartesianToWGS84(i);return y.alt<0&&(i=this.transformWGS84ToCartesian(y,.1)),i}return false}}getCameraPosition(){if(this._viewer){var e=this._viewer.scene.camera.pickEllipsoid(new t.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(e){var n=t.Ellipsoid.WGS84.cartesianToCartographic(e),i=n.longitude*180/Math.PI,a=n.latitude*180/Math.PI,m=this._viewer.camera._direction,c=t.Math.toDegrees(m.x),y=t.Math.toDegrees(m.y),h=t.Math.toDegrees(m.z),u=this._viewer.camera.positionCartographic.height,g=t.Math.toDegrees(this._viewer.camera.heading),_=t.Math.toDegrees(this._viewer.camera.pitch),x=t.Math.toDegrees(this._viewer.camera.roll),D=this._viewer.camera.computeViewRectangle(),O=D.west/Math.PI*180,z=D.north/Math.PI*180,b=D.east/Math.PI*180,F=D.south/Math.PI*180,P=(O+b)/2,V=(z+F)/2;return {lon:i,lat:a,height:u,heading:g,pitch:_,roll:x,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:P,y:V},direction:new t.Cartesian3(c,y,h)}}}}pickUpPosition(e){return this.getCatesian3FromPX(e.position)}getHandlerClickPosition(e){if(this._viewer){let n=this._viewer.scene,i=this._viewer,a=n.camera.pickEllipsoid(e.position,n.globe.elliposid),m={cameraPosistion:i.camera.position,heading:i.camera.heading,pitch:i.camera.pitch,roll:i.camera.roll},c=t.Cartographic.fromCartesian(a);c.height<0&&(c.height=0);let y={alt:c.height,lat:t.Math.toDegrees(c.latitude),lon:t.Math.toDegrees(c.longitude)},h=n.pickPosition(e.position),u=t.Cartographic.fromCartesian(h),g={height:u.height,latitude:t.Math.toDegrees(u.latitude),longitude:t.Math.toDegrees(u.longitude)};return {wgs84Coor:y,graphicCoor:g,cameraPosition:m}}}updateCameraState(e){this._viewer.scene._screenSpaceCameraController.enableRotate=e,this._viewer.scene._screenSpaceCameraController.enableTranslate=e,this._viewer.scene._screenSpaceCameraController.enableZoom=e,this._viewer.scene._screenSpaceCameraController.enableTilt=e,this._viewer.scene._screenSpaceCameraController.enableLook=e;}bindHandleEvent({leftClick:e,mouseMove:n,doubleClick:i,leftDown:a,mouseWheel:m,leftUp:c}){if(this._viewer){var y=new t.ScreenSpaceEventHandler(this._viewer.canvas);ye(this,()=>{y&&!y.isDestroyed()&&y.destroy();}),e&&y.setInputAction(function(h){e(h,y);},t.ScreenSpaceEventType.LEFT_CLICK),n&&y.setInputAction(function(h){n(h,y);},t.ScreenSpaceEventType.MOUSE_MOVE),i&&y.setInputAction(function(h){i(h,y);},t.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),a&&y.setInputAction(function(h){a(h,y);},t.ScreenSpaceEventType.LEFT_DOWN),m&&y.setInputAction(function(h){m(h,y);},t.ScreenSpaceEventType.WHEEL),c&&y.setInputAction(function(h){c(h,y);},t.ScreenSpaceEventType.LEFT_UP);}}bindHandelEvent(e){return this.bindHandleEvent(e)}getHandlePosition(e){if(this._viewer){var n=new t.ScreenSpaceEventHandler(this._viewer.scene.canvas),i=this;ye(this,()=>{n&&!n.isDestroyed()&&n.destroy();}),n.setInputAction(function(a){var m=i._viewer.scene.camera.pickEllipsoid(a.endPosition,i._viewer.scene.globe.ellipsoid);typeof e=="function"&&e(i.transformCartesianToWGS84(m),n);},t.ScreenSpaceEventType.MOUSE_MOVE);}}getHandelPosition(e){return this.getHandlePosition(e)}saveSceneImages(){if(this._viewer){let c=function(y){for(var h=y.split(","),u=h[0].match(/:(.*?);/)[1],g=atob(h[1]),_=g.length,x=new Uint8Array(_);_--;)x[_]=g.charCodeAt(_);return new Blob([x],{type:u})};var e=this._viewer.scene.canvas,n=e.toDataURL("image/png").replace("image/png","image/octet-stream"),i=document.createElement("a"),a=c(n),m=URL.createObjectURL(a);i.download="scene.png",i.href=m,i.click();}}_installAmapImageryProvider(){let e="https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",n="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";function i(a){return a.url=a.style==="img"?e:n,a.subdomains||(a.subdomains=["01","02","03","04"]),new t.UrlTemplateImageryProvider(a)}t.Scene.AmapImageryProvider=i;}_installTdtImageryProvider(){let e="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 n(i){return new t.WebMapTileServiceImageryProvider({url:e.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})}t.Scene.TdtImageryProvider=n;}_installTencentImageryProvider(){let e="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",n="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1";function i(a){return a.layer==="img"?(a.url||(a.url=e),a.subdomains||(a.subdomains=["0","1","2"]),a.customTags={sx(m,c,y,h){return c>>4},sy(m,c,y,h){return (1<<h)-y>>4}}):a.url||(a.url=n),new t.UrlTemplateImageryProvider(a)}t.Scene.TencentImageryProvider=i;}_installGoogleImageryProvider(){let e="https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",n="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 a(m){return m.url=m.style==="img"?n:m.style==="ter"?i:e,m.subdomains||(m.subdomains=["1","2","3","4","5"]),new t.UrlTemplateImageryProvider(m)}t.Scene.GoogleImageryProvider=a;}_installGooGleImageryProvider(){return this._installGoogleImageryProvider()}_installBaiduImageryProvider(){var e="https://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function n(a){e=a.url||e,this._url=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new t.WebMercatorTilingScheme({rectangleSouthwestInMeters:new t.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new t.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=a.style||"normal",this._ready=true;}Object.defineProperties(n.prototype,{url:{get(){return this._url}},token:{get(){return this._token}},tileWidth:{get(){if(!this.ready)throw new t.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get(){if(!this.ready)throw new t.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get(){if(!this.ready)throw new t.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get(){if(!this.ready)throw new t.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get(){if(!this.ready)throw new t.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(a,m,c,y,h){var u=a._url+"&x={x}&y={y}&z={z}&customid={style}",g=a._tilingScheme.getNumberOfXTilesAtLevel(y),_=a._tilingScheme.getNumberOfYTilesAtLevel(y);return u=u.replace("{x}",String(m-g/2)).replace("{y}",String(_/2-c-1)).replace("{z}",String(y)).replace("{style}",h),u}n.prototype.getTileCredits=function(a,m,c){},n.prototype.requestImage=function(a,m,c){if(!this.ready)throw new t.DeveloperError("requestImage must not be called before the imagery provider is ready.");var y=i(this,a,m,c,this._style);return t.ImageryProvider.loadImage(this,y)},t.Scene.BaiduImageryProvider=n;}_installGroundSkyBox(){var e=t.BoxGeometry,n=t.Cartesian3,i=t.defaultValue||de,a=t.defined,m=t.destroyObject,c=t.DeveloperError,y=t.GeometryPipeline,h=t.Matrix3,u=t.Matrix4,g=t.Transforms,_=t.VertexFormat,x=t.BufferUsage,D=t.CubeMap,O=t.DrawCommand,z=t.loadCubeMap,b=t.RenderState,F=t.VertexArray,P=t.BlendingState,V=t.SceneMode,f=t.ShaderProgram,I=t.ShaderSource,G=`uniform samplerCube u_cubeMap;
124
124
  in vec3 v_texCoord;
125
125
  void main()
126
126
  {
@@ -136,7 +136,7 @@ void main(void)
136
136
  gl_Position = czm_projection * vec4(p, 1.0);
137
137
  v_texCoord = position.xyz;
138
138
  }
139
- `,S=typeof u.getRotation=="function"?u.getRotation.bind(u):u.getMatrix3.bind(u);function B(P){this.sources=P.sources,this._sources=void 0,this.show=i(P.show,true),this._command=new O({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var U=new h;B.prototype.update=function(P,H){var Y=this;if(this.show&&!(P.mode!==V.SCENE3D&&P.mode!==V.MORPHING)&&P.passes.render){var q=P.context;if(this._sources!==this.sources){this._sources=this.sources;var N=this.sources;if(!a(N.positiveX)||!a(N.negativeX)||!a(N.positiveY)||!a(N.negativeY)||!a(N.positiveZ)||!a(N.negativeZ))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof N.positiveX!=typeof N.negativeX||typeof N.positiveX!=typeof N.positiveY||typeof N.positiveX!=typeof N.negativeY||typeof N.positiveX!=typeof N.positiveZ||typeof N.positiveX!=typeof N.negativeZ)throw new c("this.sources properties must all be the same type.");typeof N.positiveX=="string"?z(q,this._sources).then(function(te){Y._cubeMap=Y._cubeMap&&Y._cubeMap.destroy(),Y._cubeMap=te;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new D({context:q,source:N}));}var Q=this._command;if(Q.modelMatrix=g.eastNorthUpToFixedFrame(P.camera._positionWC),!a(Q.vertexArray)){Q.uniformMap={u_cubeMap(){return Y._cubeMap},u_rotateMatrix(){return S(Q.modelMatrix,U)}};var W=e.createGeometry(e.fromDimensions({dimensions:new n(2,2,2),vertexFormat:_.POSITION_ONLY})),ee=this._attributeLocations=y.createAttributeLocations(W);Q.vertexArray=F.fromGeometry({context:q,geometry:W,attributeLocations:ee,bufferUsage:x._DRAW}),Q.renderState=b.fromCache({blending:E.ALPHA_BLEND});}if(!a(Q.shaderProgram)||this._useHdr!==H){var A=new I({defines:[H?"HDR":""],sources:[G]});Q.shaderProgram=f.fromCache({context:q,vertexShaderSource:L,fragmentShaderSource:A,attributeLocations:this._attributeLocations}),this._useHdr=H;}if(a(this._cubeMap))return Q}},B.prototype.isDestroyed=function(){return false},B.prototype.destroy=function(){var P=this._command;return P.vertexArray=P.vertexArray&&P.vertexArray.destroy(),P.shaderProgram=P.shaderProgram&&P.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),m(this)},t.Scene.GroundSkyBox=B;}removeHandlerByName(e=[]){e.forEach(n=>{this._viewer.screenSpaceEventHandler.removeInputAction(t.ScreenSpaceEventType[n]);});}}return d}var xe=we(lt);function ct(t,o,d,s){function e(n,i){let a={},m=me(i),c=[];if(Array.isArray(n))n.forEach(h=>{let u=me(h),g=new u(t,o,d,s);y(u,m),c.push(g);}),a=new m(t,o,d,s),c.forEach(h=>Object.assign(a,h)),c.forEach(h=>Se(h,a));else {let h=me(n),u=new h(t,o,d,s);y(h,m),a=new m(t,o,d,s),Object.assign(a,u),Se(u,a);}function y(h,u){let g=Object.getOwnPropertyNames(h.prototype);for(let _=0,x=g.length;_<x;_++)g[_]!=="constructor"&&(u.prototype[g[_]]=h.prototype[g[_]]);}return a}return e}function ut({cesiumGlobal:t,threeGlobal:o,containerId:d,threeContainerId:s,viewerConfig:e={},extraConfig:n={},MapImageryList:i=[],defaultStatic:a,baseExtendsCom:m=[],extendsCom:c,extendsComName:y,viewer:h}){if(!t)throw new le("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!d&&!h)throw new le("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 g=new he(t).init({containerId:d,viewerConfig:e,extraConfig:n,MapImageryList:i,viewer:h}),_=!h,O=ct(g,t,a,o?{threeGlobal:o,containerId:d,threeContainerId:s}:"")(m,c),z=false;return {viewer:g,[y]:O,dispose:()=>{if(!z){z=true;try{typeof O.destroy=="function"?O.destroy():Ce(O);}catch(b){ce(b,{scope:"singleImport.dispose"});}_&&Be(g);}}}}function Le(t,o,d){function s(e){return ut({...e,baseExtendsCom:t,extendsCom:o,extendsComName:d})}return s}var Ve=`#ifdef GL_OES_standard_derivatives
139
+ `,S=typeof u.getRotation=="function"?u.getRotation.bind(u):u.getMatrix3.bind(u);function B(E){this.sources=E.sources,this._sources=void 0,this.show=i(E.show,true),this._command=new O({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var U=new h;B.prototype.update=function(E,H){var Y=this;if(this.show&&!(E.mode!==V.SCENE3D&&E.mode!==V.MORPHING)&&E.passes.render){var q=E.context;if(this._sources!==this.sources){this._sources=this.sources;var N=this.sources;if(!a(N.positiveX)||!a(N.negativeX)||!a(N.positiveY)||!a(N.negativeY)||!a(N.positiveZ)||!a(N.negativeZ))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof N.positiveX!=typeof N.negativeX||typeof N.positiveX!=typeof N.positiveY||typeof N.positiveX!=typeof N.negativeY||typeof N.positiveX!=typeof N.positiveZ||typeof N.positiveX!=typeof N.negativeZ)throw new c("this.sources properties must all be the same type.");typeof N.positiveX=="string"?z(q,this._sources).then(function(te){Y._cubeMap=Y._cubeMap&&Y._cubeMap.destroy(),Y._cubeMap=te;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new D({context:q,source:N}));}var Q=this._command;if(Q.modelMatrix=g.eastNorthUpToFixedFrame(E.camera._positionWC),!a(Q.vertexArray)){Q.uniformMap={u_cubeMap(){return Y._cubeMap},u_rotateMatrix(){return S(Q.modelMatrix,U)}};var W=e.createGeometry(e.fromDimensions({dimensions:new n(2,2,2),vertexFormat:_.POSITION_ONLY})),ee=this._attributeLocations=y.createAttributeLocations(W);Q.vertexArray=F.fromGeometry({context:q,geometry:W,attributeLocations:ee,bufferUsage:x._DRAW}),Q.renderState=b.fromCache({blending:P.ALPHA_BLEND});}if(!a(Q.shaderProgram)||this._useHdr!==H){var A=new I({defines:[H?"HDR":""],sources:[G]});Q.shaderProgram=f.fromCache({context:q,vertexShaderSource:L,fragmentShaderSource:A,attributeLocations:this._attributeLocations}),this._useHdr=H;}if(a(this._cubeMap))return Q}},B.prototype.isDestroyed=function(){return false},B.prototype.destroy=function(){var E=this._command;return E.vertexArray=E.vertexArray&&E.vertexArray.destroy(),E.shaderProgram=E.shaderProgram&&E.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),m(this)},t.Scene.GroundSkyBox=B;}removeHandlerByName(e=[]){e.forEach(n=>{this._viewer.screenSpaceEventHandler.removeInputAction(t.ScreenSpaceEventType[n]);});}}return d}var xe=we(lt);function ct(t,o,d,s){function e(n,i){let a={},m=me(i),c=[];if(Array.isArray(n))n.forEach(h=>{let u=me(h),g=new u(t,o,d,s);y(u,m),c.push(g);}),a=new m(t,o,d,s),c.forEach(h=>Object.assign(a,h)),c.forEach(h=>Se(h,a));else {let h=me(n),u=new h(t,o,d,s);y(h,m),a=new m(t,o,d,s),Object.assign(a,u),Se(u,a);}function y(h,u){let g=Object.getOwnPropertyNames(h.prototype);for(let _=0,x=g.length;_<x;_++)g[_]!=="constructor"&&(u.prototype[g[_]]=h.prototype[g[_]]);}return a}return e}function ut({cesiumGlobal:t,threeGlobal:o,containerId:d,threeContainerId:s,viewerConfig:e={},extraConfig:n={},MapImageryList:i=[],defaultStatic:a,baseExtendsCom:m=[],extendsCom:c,extendsComName:y,viewer:h}){if(!t)throw new le("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!d&&!h)throw new le("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 g=new he(t).init({containerId:d,viewerConfig:e,extraConfig:n,MapImageryList:i,viewer:h}),_=!h,O=ct(g,t,a,o?{threeGlobal:o,containerId:d,threeContainerId:s}:"")(m,c),z=false;return {viewer:g,[y]:O,dispose:()=>{if(!z){z=true;try{typeof O.destroy=="function"?O.destroy():Ce(O);}catch(b){ce(b,{scope:"singleImport.dispose"});}_&&Be(g);}}}}function Le(t,o,d){function s(e){return ut({...e,baseExtendsCom:t,extendsCom:o,extendsComName:d})}return s}var Ve=`#ifdef GL_OES_standard_derivatives
140
140
  #extension GL_OES_standard_derivatives : enable
141
141
  #endif
142
142
 
@@ -260,7 +260,7 @@ void main() {
260
260
  // the floating point error.
261
261
  bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);
262
262
  out_FragColor = shade(isOnEllipsoid);
263
- }`,Pe=`in vec4 position;
263
+ }`,Ee=`in vec4 position;
264
264
  in vec3 normal;
265
265
 
266
266
  out vec3 v_position;
@@ -310,7 +310,7 @@ vec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) {
310
310
  s = s - floor(s);
311
311
 
312
312
  return vec2(s, t);
313
- }`,Ee=`#ifdef GL_OES_standard_derivatives
313
+ }`,Pe=`#ifdef GL_OES_standard_derivatives
314
314
  #extension GL_OES_standard_derivatives : enable
315
315
  #endif
316
316
 
@@ -442,7 +442,7 @@ void main() {
442
442
  }
443
443
  */
444
444
  out_FragColor = shade(isOnEllipsoid);
445
- }`;var M={};function Oe(t){M=t;var o=M.BoundingSphere,d=M.Cartesian3,s=M.Color,e=M.combine,n=M.ComponentDatatype,i=M.defaultValue||M.Scene.defaultValue,a=M.defined;M.destroyObject;var y=M.DeveloperError,S=M.Matrix4,h=M.PrimitiveType,u=M.Buffer,g=M.BufferUsage,_=M.DrawCommand,x=M.Pass,D=M.RenderState,O=M.ShaderProgram,z=M.ShaderSource,b=M.VertexArray,F=M.BlendingState,E=M.CullFace,V=M.Material,f=M.SceneMode,I=M.VertexFormat,G=M.Math,L=M.Matrix3,S=M.Matrix4,B=M.JulianDate;M.BoxGeometry;M.EllipsoidGeometry;var H=Math.sin,Y=Math.cos,q=Math.tan,N=Math.atan,W={position:0,normal:1};function ee(r){var p=this;r=i(r,i.EMPTY_OBJECT),this.show=i(r.show,true),this.slice=i(r.slice,32),this.modelMatrix=S.clone(r.modelMatrix,new S),this._modelMatrix=new S,this._computedModelMatrix=new S,this._computedScanPlaneModelMatrix=new S,this.radius=i(r.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=i(r.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=i(r.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=i(r.lineColor,s.WHITE),this.showSectorLines=i(r.showSectorLines,true),this.showSectorSegmentLines=i(r.showSectorSegmentLines,true),this.showLateralSurfaces=i(r.showLateralSurfaces,true),this.material=a(r.material)?r.material:V.fromType(V.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=a(r.lateralSurfaceMaterial)?r.lateralSurfaceMaterial:V.fromType(V.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=i(r.showDomeSurfaces,true),this.domeSurfaceMaterial=a(r.domeSurfaceMaterial)?r.domeSurfaceMaterial:V.fromType(V.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=i(r.showDomeLines,true),this.showIntersection=i(r.showIntersection,true),this.intersectionColor=i(r.intersectionColor,s.WHITE),this.intersectionWidth=i(r.intersectionWidth,5),this.showThroughEllipsoid=i(r.showThroughEllipsoid,false),this._showThroughEllipsoid=void 0,this.showScanPlane=i(r.showScanPlane,true),this.scanPlaneColor=i(r.scanPlaneColor,s.WHITE),this.scanPlaneMode=i(r.scanPlaneMode,"horizontal"),this.scanPlaneRate=i(r.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=B.now(),this._boundingSphere=new o,this._boundingSphereWC=new o,this._sectorFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return p.xHalfAngle},u_yHalfAngle:function(){return p.yHalfAngle},u_radius:function(){return p.radius},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return p._scanePlaneXHalfAngle},u_yHalfAngle:function(){return p._scanePlaneYHalfAngle},u_radius:function(){return p.radius},u_color:function(){return p.scanPlaneColor},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}};}ee.prototype.update=function(r){var p=r.mode;if(!(!this.show||p!==f.SCENE3D)){var C=false,v=false,w=false,T=this.xHalfAngle,j=this.yHalfAngle;if(T<0||j<0)throw new y("halfAngle must be greater than or equal to zero.");if(!(T==0||j==0)){(this._xHalfAngle!==T||this._yHalfAngle!==j)&&(this._xHalfAngle=T,this._yHalfAngle=j,C=true);var k=this.radius;if(k<0)throw new y("this.radius must be greater than or equal to zero.");var R=false;this._radius!==k&&(R=true,this._radius=k,this._boundingSphere=new o(d.ZERO,this.radius));var X=!S.equals(this.modelMatrix,this._modelMatrix);(X||R)&&(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),o.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var K=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=K,v=true);var Z=this.material;this._material!==Z&&(this._material=Z,v=true,w=true);var $=Z.isTranslucent();if(this._translucent!==$&&(this._translucent=$,v=true),this.showScanPlane){var se=r.time,Ae=B.secondsDifference(se,this._time);Ae<0&&(this._time=B.clone(se,this._time));var ke=Math.max(Ae%this.scanPlaneRate/this.scanPlaneRate,0),oe;if(this.scanPlaneMode=="horizontal"){oe=2*j*ke-j;var Ke=Y(oe),Je=q(T),Qe=N(Ke*Je);this._scanePlaneXHalfAngle=Qe,this._scanePlaneYHalfAngle=oe,M.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,A);}else {oe=2*T*ke-T;var $e=q(j),et=Y(oe),tt=N(et*$e);this._scanePlaneXHalfAngle=oe,this._scanePlaneYHalfAngle=tt,M.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,A);}M.Matrix4.multiplyByMatrix3(this.modelMatrix,A,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix);}C&&je(this,r),v&&Ze(this,K,$),w&&Xe(this,r,Z),(v||w)&&qe(this,$);var nt=r.commandList,at=r.passes,De=this._colorCommands;if(at.render)for(var ve=0,rt=De.length;ve<rt;ve++){var it=De[ve];nt.push(it);}}}},ee.prototype.isDestroyed=function(){return false};var A=new L,te=new d;function re(r,p,C){for(var v=r.slice,w=Y(C),T=q(C),j=Y(p),k=q(p),R=N(j*T),X=N(w*k),K=[],Z=0;Z<v;Z++){var $=2*R*Z/(v-1)-R;K.push(new d(0,H($),Y($)));}for(var se=[],Z=0;Z<v;Z++){var $=2*X*Z/(v-1)-X;se.push(new d(H($),0,Y($)));}return {zoy:K,zox:se}}function ue(r,p){var C=r.xHalfAngle,v=r.yHalfAngle,w=p.zoy,T=p.zox,j=[],k=L.fromRotationY(C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}));var k=L.fromRotationX(-v,A);j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationY(-C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationX(v,A);return j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)})),j}function fe(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(18*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=d.normalize(d.cross(k[0],k[k.length-1],te),te),X=0,C=k.length-1;X<C;X++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X].x,v[w++]=k[X].y,v[w++]=k[X].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X+1].x,v[w++]=k[X+1].y,v[w++]=k[X+1].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z;var K=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),Z=6*Float32Array.BYTES_PER_ELEMENT,$=[{index:W.position,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:Z},{index:W.normal,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:Z}];return new b({context:r,attributes:$})}function ge(r,p){for(var C=p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++){var k=p[T];v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=k[0].x,v[w++]=k[0].y,v[w++]=k[0].z;}var R=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),X=3*Float32Array.BYTES_PER_ELEMENT,K=[{index:W.position,vertexBuffer:R,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:X}];return new b({context:r,attributes:K})}function He(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=0,C=k.length-1;R<C;R++)v[w++]=k[R].x,v[w++]=k[R].y,v[w++]=k[R].z,v[w++]=k[R+1].x,v[w++]=k[R+1].y,v[w++]=k[R+1].z;var X=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),K=3*Float32Array.BYTES_PER_ELEMENT,Z=[{index:W.position,vertexBuffer:X,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:K}];return new b({context:r,attributes:Z})}function Ne(r){var p=M.EllipsoidGeometry.createGeometry(new M.EllipsoidGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function We(r){var p=M.EllipsoidOutlineGeometry.createGeometry(new M.EllipsoidOutlineGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function Me(r,p){for(var C=p.length-1,v=new Float32Array(9*C),w=0,T=0;T<C;T++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=p[T].x,v[w++]=p[T].y,v[w++]=p[T].z,v[w++]=p[T+1].x,v[w++]=p[T+1].y,v[w++]=p[T+1].z;var j=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),k=3*Float32Array.BYTES_PER_ELEMENT,R=[{index:W.position,vertexBuffer:j,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:k}];return new b({context:r,attributes:R})}function je(r,p){var C=p.context,v=re(r,r.xHalfAngle,r.yHalfAngle),w=ue(r,v);if(r.showLateralSurfaces&&(r._sectorVA=fe(C,w)),r.showSectorLines&&(r._sectorLineVA=ge(C,w)),r.showSectorSegmentLines&&(r._sectorSegmentLineVA=He(C,w)),r.showDomeSurfaces&&(r._domeVA=Ne(C)),r.showDomeLines&&(r._domeLineVA=We(C)),r.showScanPlane)if(r.scanPlaneMode=="horizontal"){var T=re(r,G.PI_OVER_TWO,0);r._scanPlaneVA=Me(C,T.zox);}else {var T=re(r,0,G.PI_OVER_TWO);r._scanPlaneVA=Me(C,T.zoy);}}function Ye(r,p,C){var v=p.context,w=Pe,T=new z({sources:[pe,C.shaderSource,Ee]});r._sp=O.replaceCache({context:v,shaderProgram:r._sp,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});var j=new z({sources:[pe,C.shaderSource,Ee],pickColorQualifier:"uniform"});r._pickSP=O.replaceCache({context:v,shaderProgram:r._pickSP,vertexShaderSource:w,fragmentShaderSource:j,attributeLocations:W});}function Ue(r,p,C){var v=p.context,w=Pe,T=new z({sources:[pe,C.shaderSource,Ve]});r._scanePlaneSP=O.replaceCache({context:v,shaderProgram:r._scanePlaneSP,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});}function Xe(r,p,C){Ye(r,p,C),r.showScanPlane&&Ue(r,p,C);}function Ze(r,p,C){C?(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:E.BACK}}),r._backFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:E.FRONT}}),r._pickRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND})):(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:true}),r._pickRS=D.fromCache({depthTest:{enabled:true},depthMask:true}));}function ie(r,p,C,v,w,T,j,k,R,X,K,Z){X&&C&&(C.vertexArray=j,C.renderState=w,C.shaderProgram=T,C.uniformMap=e(k,r._material._uniforms),C.uniformMap.u_normalDirection=function(){return -1},C.pass=K,C.modelMatrix=R,r._colorCommands.push(C)),p.vertexArray=j,p.renderState=v,p.shaderProgram=T,p.uniformMap=e(k,r._material._uniforms),Z&&(p.uniformMap.u_type=function(){return 1}),p.pass=K,p.modelMatrix=R,r._colorCommands.push(p);}function qe(r,p){r._colorCommands.length=0;var C=p?x.TRANSLUCENT:x.OPAQUE;r.showLateralSurfaces&&ie(r,r._sectorFrontCommand,r._sectorBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorVA,r._uniforms,r._computedModelMatrix,p,C),r.showSectorLines&&ie(r,r._sectorLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showSectorSegmentLines&&ie(r,r._sectorSegmentLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorSegmentLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showDomeSurfaces&&ie(r,r._domeFrontCommand,r._domeBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._domeVA,r._uniforms,r._computedModelMatrix,p,C),r.showDomeLines&&ie(r,r._domeLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._domeLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showScanPlane&&ie(r,r._scanPlaneFrontCommand,r._scanPlaneBackCommand,r._frontFaceRS,r._backFaceRS,r._scanePlaneSP,r._scanPlaneVA,r._scanUniforms,r._computedScanPlaneModelMatrix,p,C);}return ee}var ae={};function ze(t){ae=t;var o=ae.defaultValue||ae.Scene.defaultValue,d=ae.defined,s=Object.defineProperties,e=ae.DeveloperError,n=ae.Event,i=ae.createMaterialPropertyDescriptor,a=ae.createPropertyDescriptor;function m(c){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 n,this.merge(o(c,o.EMPTY_OBJECT));}return s(m.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radius:a("radius"),xHalfAngle:a("xHalfAngle"),yHalfAngle:a("yHalfAngle"),lineColor:a("lineColor"),showSectorLines:a("showSectorLines"),showSectorSegmentLines:a("showSectorSegmentLines"),showLateralSurfaces:a("showLateralSurfaces"),material:i("material"),showDomeSurfaces:a("showDomeSurfaces"),showDomeLines:a("showDomeLines "),showIntersection:a("showIntersection"),intersectionColor:a("intersectionColor"),intersectionWidth:a("intersectionWidth"),showThroughEllipsoid:a("showThroughEllipsoid"),gaze:a("gaze"),showScanPlane:a("showScanPlane"),scanPlaneColor:a("scanPlaneColor"),scanPlaneMode:a("scanPlaneMode"),scanPlaneRate:a("scanPlaneRate")}),m.prototype.clone=function(c){return d(c)||(c=new m),c.show=this.show,c.radius=this.radius,c.xHalfAngle=this.xHalfAngle,c.yHalfAngle=this.yHalfAngle,c.lineColor=this.lineColor,c.showSectorLines=this.showSectorLines,c.showSectorSegmentLines=this.showSectorSegmentLines,c.showLateralSurfaces=this.showLateralSurfaces,c.material=this.material,c.showDomeSurfaces=this.showDomeSurfaces,c.showDomeLines=this.showDomeLines,c.showIntersection=this.showIntersection,c.intersectionColor=this.intersectionColor,c.intersectionWidth=this.intersectionWidth,c.showThroughEllipsoid=this.showThroughEllipsoid,c.gaze=this.gaze,c.showScanPlane=this.showScanPlane,c.scanPlaneColor=this.scanPlaneColor,c.scanPlaneMode=this.scanPlaneMode,c.scanPlaneRate=this.scanPlaneRate,c},m.prototype.merge=function(c){if(!d(c))throw new e("source is required.");this.show=o(this.show,c.show),this.radius=o(this.radius,c.radius),this.xHalfAngle=o(this.xHalfAngle,c.xHalfAngle),this.yHalfAngle=o(this.yHalfAngle,c.yHalfAngle),this.lineColor=o(this.lineColor,c.lineColor),this.showSectorLines=o(this.showSectorLines,c.showSectorLines),this.showSectorSegmentLines=o(this.showSectorSegmentLines,c.showSectorSegmentLines),this.showLateralSurfaces=o(this.showLateralSurfaces,c.showLateralSurfaces),this.material=o(this.material,c.material),this.showDomeSurfaces=o(this.showDomeSurfaces,c.showDomeSurfaces),this.showDomeLines=o(this.showDomeLines,c.showDomeLines),this.showIntersection=o(this.showIntersection,c.showIntersection),this.intersectionColor=o(this.intersectionColor,c.intersectionColor),this.intersectionWidth=o(this.intersectionWidth,c.intersectionWidth),this.showThroughEllipsoid=o(this.showThroughEllipsoid,c.showThroughEllipsoid),this.gaze=o(this.gaze,c.gaze),this.showScanPlane=o(this.showScanPlane,c.showScanPlane),this.scanPlaneColor=o(this.scanPlaneColor,c.scanPlaneColor),this.scanPlaneMode=o(this.scanPlaneMode,c.scanPlaneMode),this.scanPlaneRate=o(this.scanPlaneRate,c.scanPlaneRate);},m}var J={};function Fe(t,o){if(t){let V=function(f,I,G){var L=I[f.id];if(n(L)){var S=L.primitive;G.remove(S),S&&!S.isDestroyed()&&S.destroy(),delete I[f.id];}};J=t;var d=J.AssociativeArray,s=J.Cartesian3,e=J.Color,n=J.defined,i=J.destroyObject,a=J.DeveloperError,m=J.Matrix3,c=J.Matrix4,y=J.Quaternion,h=J.MaterialProperty,u=J.Property,g=new m;new c;var x=new s,D=new s,O=new y,z=new s,b=new y,F=function(f,I){if(!n(f))throw new a("scene is required.");if(!n(I))throw new a("entityCollection is required.");I.collectionChanged.addEventListener(F.prototype._onCollectionChanged,this),this._scene=f,this._primitives=f.primitives,this._entityCollection=I,this._hash={},this._entitiesToVisualize=new d,this._onCollectionChanged(I,I.values,[],[]);};return F.prototype.update=function(f){if(!n(f))throw new a("time is required.");for(var I=this._entitiesToVisualize.values,G=this._hash,L=this._primitives,S=0,B=I.length;S<B;S++){var U=I[S],P=U._rectangularSensor,H,Y,q,N,Q,W=G[U.id],ee=U.isShowing&&U.isAvailable(f)&&u.getValueOrDefault(P._show,f,true);if(ee&&(H=u.getValueOrUndefined(U._position,f,x),Y=u.getValueOrUndefined(U._orientation,f,O),q=u.getValueOrUndefined(P._radius,f),N=u.getValueOrUndefined(P._xHalfAngle,f),Q=u.getValueOrUndefined(P._yHalfAngle,f),ee=n(H)&&n(N)&&n(Q)),!ee){n(W)&&(W.primitive.show=false);continue}var A=n(W)?W.primitive:void 0;n(A)||(A=new o,A.id=U,L.add(A),W={primitive:A,position:void 0,orientation:void 0},G[U.id]=W);var te=u.getValueOrUndefined(P._gaze,f);if(n(te)){var re=u.getValueOrUndefined(te._position,f,D);if(!n(H)||!n(re))continue;var ue=s.subtract(H,re,z),fe=s.angleBetween(J.Cartesian3.UNIT_Z,ue),ge=s.cross(J.Cartesian3.UNIT_Z,ue,z),Y=y.fromAxisAngle(ge,fe-Math.PI,b);q=s.distance(H,re),A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix);}else (!s.equals(H,W.position)||!y.equals(Y,W.orientation))&&(n(Y)?(A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix),W.position=s.clone(H,W.position),W.orientation=y.clone(Y,W.orientation)):(A.modelMatrix=J.Transforms.eastNorthUpToFixedFrame(H),W.position=s.clone(H,W.position)));A.show=true,A.gaze=te,A.radius=q,A.xHalfAngle=N,A.yHalfAngle=Q,A.lineColor=u.getValueOrDefault(P._lineColor,f,e.WHITE),A.showSectorLines=u.getValueOrDefault(P._showSectorLines,f,true),A.showSectorSegmentLines=u.getValueOrDefault(P._showSectorSegmentLines,f,true),A.showLateralSurfaces=u.getValueOrDefault(P._showLateralSurfaces,f,true),A.material=h.getValue(f,P._material,A.material),A.showDomeSurfaces=u.getValueOrDefault(P._showDomeSurfaces,f,true),A.showDomeLines=u.getValueOrDefault(P._showDomeLines,f,true),A.showIntersection=u.getValueOrDefault(P._showIntersection,f,true),A.intersectionColor=u.getValueOrDefault(P._intersectionColor,f,e.WHITE),A.intersectionWidth=u.getValueOrDefault(P._intersectionWidth,f,1),A.showThroughEllipsoid=u.getValueOrDefault(P._showThroughEllipsoid,f,true),A.scanPlaneMode=u.getValueOrDefault(P._scanPlaneMode,f),A.scanPlaneColor=u.getValueOrDefault(P._scanPlaneColor,f,e.WHITE),A.showScanPlane=u.getValueOrDefault(P._showScanPlane,f,true),A.scanPlaneRate=u.getValueOrDefault(P._scanPlaneRate,f,1);}return true},F.prototype.isDestroyed=function(){return false},F.prototype.destroy=function(){for(var f=this._entitiesToVisualize.values,I=this._hash,G=this._primitives,L=f.length-1;L>-1;L--)V(f[L],I,G);return i(this)},F.prototype._onCollectionChanged=function(f,I,G,L){var S,B,U=this._entitiesToVisualize,P=this._hash,H=this._primitives;for(S=I.length-1;S>-1;S--)B=I[S],n(B._rectangularSensor)&&n(B._position)&&U.set(B.id,B);for(S=L.length-1;S>-1;S--)B=L[S],n(B._rectangularSensor)&&n(B._position)?U.set(B.id,B):(V(B,P,H),U.remove(B.id));for(S=G.length-1;S>-1;S--)B=G[S],V(B,P,H),U.remove(B.id);},F}}var l=null,be=function(t,o){t&&(this.viewer=t,l=o,this._installPlugin());};be.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive();},_installCylinderGeometry:function(){function t(e){this.length=e.length,this.topRadius=e.topRadius,this.bottomRadius=e.bottomRadius,this.slices=e.slices?e.slices:64,this.zReverse=e.zReverse;}var o=new l.Cartesian2,d=new l.Cartesian3,s=new l.Ray;t._createGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),E=0;E<D.length;E++){_[E]=[];for(var V=x[E],f=0;f<m;f++){_[E].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[E]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(E/(D.length-1),0);}}for(var S=[],E=1;E<D.length;E++)for(var f=1;f<m;f++){var B=_[E-1][f-1],U=_[E][f-1],P=_[E][f],H=_[E-1][f];S.push(P),S.push(H),S.push(B),S.push(P),S.push(B),S.push(U),f==_[E].length-1&&(B=_[E-1][f],U=_[E][f],P=_[E][0],H=_[E-1][0],S.push(P),S.push(H),S.push(B),S.push(P),S.push(B),S.push(U));}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var Y={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},q=l.BoundingSphere.fromVertices(h),N=new l.Geometry({attributes:Y,indices:S,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:q});return h=[],S=[],g=[],N},t.createGeometry=function(e,n){if(!n)return t._createGeometry(e);l.Matrix4.multiplyByPoint(n,l.Cartesian3.ZERO,d),d.clone(s.origin);var i=e.length,a=e.topRadius,m=(e.bottomRadius,e.slices),c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[0,y?-i:i],D=0,D=0;h.push(0,0,0),u.push(1,1),D++;for(var O=new l.Cartesian3,z=a/15,b=0;b<16;b++){for(var F=z*b,E=[],V=0;V<m;V++){var f=c*V,I=F*Math.cos(f),G=F*Math.sin(f);O.x=I,O.y=G,O.z=x[1];var L=(0, l.Scene.extend2Earth)(O,n,s);L?(E.push(D),h.push(I,G,x[1]),u.push(b/15,1),D++):(L=d,E.push(-1));}_.push(E);}for(var S,B,U=[0,_.length-1],P=0;P<U.length;P++)for(var b=U[P],V=1;V<_[b].length;V++)S=_[b][V-1],B=_[b][V],S>=0&&B>=0&&g.push(0,S,B);h=new Float32Array(h),g=new Int32Array(g),u=new Float32Array(u);var H={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:u})},Y=l.BoundingSphere.fromVertices(h),q=new l.Geometry({attributes:H,indices:g,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:Y});return (0, l.Scene.computeVertexNormals)(q),h=[],g=[],q},t.createOutlineGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),E=0;E<D.length;E++){_[E]=[];for(var V=x[E],f=0;f<m;f++){_[E].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[E]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(E/(D.length-1),0);}}for(var S=[],E=1;E<D.length;E++)for(var f=1;f<m;f+=1){var B=_[E-1][f-1],U=_[E][f-1];_[E][f],_[E-1][f],f%8==1&&S.push(B,U);}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var P={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},H=l.BoundingSphere.fromVertices(h),Y=new l.Geometry({attributes:P,indices:S,primitiveType:l.PrimitiveType.LINES,boundingSphere:H});return h=[],S=[],g=[],Y},t.fromAngleAndLength=function(e,n,i){return e=l.Math.toRadians(e),new t({topRadius:Math.tan(e)*n/2,bottomRadius:0,length:n,zReverse:i})},l.Scene.CylinderGeometry=t;},_installRadarPrimitive:function(){var t;function o(s,e){let n=l.defaultValue||de;e=e||{},t=s.scene.globe.ellipsoid,this._geometry=null,this._angle=e.angle,this._radius=e.radius?e.radius:5,this._position=e.position,this._rotation=e.rotation?e.rotation:{heading:0,pitch:0,roll:0},this._trackedEntity=e.trackedEntity,this.defaultColor=e.color?e.color:l.Color.YELLOW,this.defaultLineColor=e.lineColor?e.lineColor:this.defaultColor,this._show=n(e.show,true),this._outline=n(e.outline,false),this._topShow=n(e.top,true),this._topOutline=n(e.topOutline,true),this._modelMatrix=l.Matrix4.clone(l.Matrix4.IDENTITY),this._quaternion=new l.Quaternion,this._translation=new l.Cartesian3,this._scale=new l.Cartesian3(1,1,1),this._matrix=new l.Matrix4,this._inverseMatrix=new l.Matrix4,this._positionCartographic=new l.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=s,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=n(e.groundArea,false),this.addGroundAreaEntity(this._groundArea);}Object.defineProperties(o.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(s){this._trackedEntity=s;}},color:{get:function(){return this.defaultColor},set:function(s){this.defaultColor=s;}},lineColor:{get:function(){return this.defaultLineColor},set:function(s){this.defaultLineColor=s;}},show:{get:function(){return this._show},set:function(s){this._show=s;}},outline:{get:function(){return this._outline},set:function(s){this._outline=s,this.updateGeometry();}},top:{get:function(){return this._topShow},set:function(s){this._topShow=s,this.updateGeometry();}},topOutline:{get:function(){return this._topOutline},set:function(s){this._topOutline=s,this.updateGeometry();}},groundArea:{get:function(){return this._groundArea},set:function(s){this._groundArea=s,this.addGroundAreaEntity(this._groundArea);}},angle:{get:function(){return this._angle},set:function(s){this._angle=s,this.updateGroundCircleRadius(),this.updateGeometry();}},radius:{get:function(){return this._radius},set:function(s){this._radius=s,this.updateGroundCircleRadius(),this.updateGeometry();}},heading:{get:function(){return this._rotation.heading},set:function(s){this._rotation.heading=s;}},pitch:{get:function(){return this._rotation.pitch},set:function(s){this._rotation.pitch=s;}},roll:{get:function(){return this._rotation.roll},set:function(s){this._rotation.roll=s;}},position:{get:function(){return this._position},set:function(s){this._position=s;}}}),o.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(l.Math.toRadians(this._angle));},o.prototype.isDestroyed=function(){return false},o.prototype.addGroundAreaEntity=function(s){if(s&&!this.groundAreaEntity){var e=this;this.updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:this._rotation.pitch===0&&this._rotation.roll===0,semiMinorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),semiMajorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0),positions:new l.CallbackProperty(function(n){return e._trackedEntityPosition?l.Cartesian3.distance(e._position,e._trackedEntityPosition)>e._radius?[]:[e._position,e._trackedEntityPosition]:[]},false),followSurface:false,material:new l.PolylineDashMaterialProperty({color:l.Color.CYAN}),width:1}});}};var d=new l.Cartesian3;o.prototype.computeMatrix=function(s,e){if(this._positionCartesian||(this._positionCartesian=new l.Cartesian3),this.position instanceof l.Cartesian3?this._positionCartesian=this.position:typeof this.position.getValue=="function"?this._positionCartesian=this.position.getValue(s):this.position._value&&this.position._value instanceof l.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position){this._positionCartesian;var i=l.Property.getValueOrUndefined(this._trackedEntity.position,s,d);i&&(this._trackedEntityPosition=i,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0);}return this._modelMatrix=l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),this._positionCartographic=l.Cartographic.fromCartesian(this._positionCartesian,t,this._positionCartographic),l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),l.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=l.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),l.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),l.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},o.prototype.getTopGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],E=a[u][x-1],V=a[u][x],f=a[u-1][x];i.push(F,E,V),i.push(F,V,f);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var I={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},G=l.BoundingSphere.fromVertices(e),L=new l.Geometry({attributes:I,indices:i,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:G});return (0, l.Scene.computeVertexNormals)(L),L},o.prototype.getTopOutlineGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],E=a[u][x-1],V=a[u][x];a[u-1][x],x%8==1&&i.push(F,E),u%8==1&&i.push(E,V);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var f={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},I=l.BoundingSphere.fromVertices(e),G=new l.Geometry({attributes:f,indices:i,primitiveType:l.PrimitiveType.LINES,boundingSphere:I});return (0, l.Scene.computeVertexNormals)(G),G},o.prototype.updateGeometry=function(){this._geometry=l.Scene.CylinderGeometry.createGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=l.Scene.CylinderGeometry.createOutlineGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var s=0;s<this._positions.length;s++)this._positions[s]=this._geometry.attributes.position.values[s];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy();}),this._drawCommands.splice(0,this._drawCommands.length));},o.prototype.update=function(s){this._show&&(this.computeMatrix(s.time),s.mode===l.SceneMode.SCENE3D?(this._geometry.boundingSphere=l.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,s)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,s)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,s)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,s)))),this._drawCommands.forEach(function(e){s.commandList.push(e);}),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)));},o.prototype.getFragmentShaderSource=function(s){return `#version 300 es
445
+ }`;var M={};function Oe(t){M=t;var o=M.BoundingSphere,d=M.Cartesian3,s=M.Color,e=M.combine,n=M.ComponentDatatype,i=M.defaultValue||M.Scene.defaultValue,a=M.defined;M.destroyObject;var y=M.DeveloperError,S=M.Matrix4,h=M.PrimitiveType,u=M.Buffer,g=M.BufferUsage,_=M.DrawCommand,x=M.Pass,D=M.RenderState,O=M.ShaderProgram,z=M.ShaderSource,b=M.VertexArray,F=M.BlendingState,P=M.CullFace,V=M.Material,f=M.SceneMode,I=M.VertexFormat,G=M.Math,L=M.Matrix3,S=M.Matrix4,B=M.JulianDate;M.BoxGeometry;M.EllipsoidGeometry;var H=Math.sin,Y=Math.cos,q=Math.tan,N=Math.atan,W={position:0,normal:1};function ee(r){var p=this;r=i(r,i.EMPTY_OBJECT),this.show=i(r.show,true),this.slice=i(r.slice,32),this.modelMatrix=S.clone(r.modelMatrix,new S),this._modelMatrix=new S,this._computedModelMatrix=new S,this._computedScanPlaneModelMatrix=new S,this.radius=i(r.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=i(r.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=i(r.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=i(r.lineColor,s.WHITE),this.showSectorLines=i(r.showSectorLines,true),this.showSectorSegmentLines=i(r.showSectorSegmentLines,true),this.showLateralSurfaces=i(r.showLateralSurfaces,true),this.material=a(r.material)?r.material:V.fromType(V.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=a(r.lateralSurfaceMaterial)?r.lateralSurfaceMaterial:V.fromType(V.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=i(r.showDomeSurfaces,true),this.domeSurfaceMaterial=a(r.domeSurfaceMaterial)?r.domeSurfaceMaterial:V.fromType(V.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=i(r.showDomeLines,true),this.showIntersection=i(r.showIntersection,true),this.intersectionColor=i(r.intersectionColor,s.WHITE),this.intersectionWidth=i(r.intersectionWidth,5),this.showThroughEllipsoid=i(r.showThroughEllipsoid,false),this._showThroughEllipsoid=void 0,this.showScanPlane=i(r.showScanPlane,true),this.scanPlaneColor=i(r.scanPlaneColor,s.WHITE),this.scanPlaneMode=i(r.scanPlaneMode,"horizontal"),this.scanPlaneRate=i(r.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=B.now(),this._boundingSphere=new o,this._boundingSphereWC=new o,this._sectorFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new _({owner:this,primitiveType:h.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new _({owner:this,primitiveType:h.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return p.xHalfAngle},u_yHalfAngle:function(){return p.yHalfAngle},u_radius:function(){return p.radius},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return p._scanePlaneXHalfAngle},u_yHalfAngle:function(){return p._scanePlaneYHalfAngle},u_radius:function(){return p.radius},u_color:function(){return p.scanPlaneColor},u_showThroughEllipsoid:function(){return p.showThroughEllipsoid},u_showIntersection:function(){return p.showIntersection},u_intersectionColor:function(){return p.intersectionColor},u_intersectionWidth:function(){return p.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return p.lineColor}};}ee.prototype.update=function(r){var p=r.mode;if(!(!this.show||p!==f.SCENE3D)){var C=false,v=false,w=false,T=this.xHalfAngle,j=this.yHalfAngle;if(T<0||j<0)throw new y("halfAngle must be greater than or equal to zero.");if(!(T==0||j==0)){(this._xHalfAngle!==T||this._yHalfAngle!==j)&&(this._xHalfAngle=T,this._yHalfAngle=j,C=true);var k=this.radius;if(k<0)throw new y("this.radius must be greater than or equal to zero.");var R=false;this._radius!==k&&(R=true,this._radius=k,this._boundingSphere=new o(d.ZERO,this.radius));var X=!S.equals(this.modelMatrix,this._modelMatrix);(X||R)&&(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),o.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var K=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=K,v=true);var Z=this.material;this._material!==Z&&(this._material=Z,v=true,w=true);var $=Z.isTranslucent();if(this._translucent!==$&&(this._translucent=$,v=true),this.showScanPlane){var se=r.time,Ae=B.secondsDifference(se,this._time);Ae<0&&(this._time=B.clone(se,this._time));var ke=Math.max(Ae%this.scanPlaneRate/this.scanPlaneRate,0),oe;if(this.scanPlaneMode=="horizontal"){oe=2*j*ke-j;var Ke=Y(oe),Je=q(T),Qe=N(Ke*Je);this._scanePlaneXHalfAngle=Qe,this._scanePlaneYHalfAngle=oe,M.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,A);}else {oe=2*T*ke-T;var $e=q(j),et=Y(oe),tt=N(et*$e);this._scanePlaneXHalfAngle=oe,this._scanePlaneYHalfAngle=tt,M.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,A);}M.Matrix4.multiplyByMatrix3(this.modelMatrix,A,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix);}C&&je(this,r),v&&Ze(this,K,$),w&&Xe(this,r,Z),(v||w)&&qe(this,$);var nt=r.commandList,at=r.passes,De=this._colorCommands;if(at.render)for(var ve=0,rt=De.length;ve<rt;ve++){var it=De[ve];nt.push(it);}}}},ee.prototype.isDestroyed=function(){return false};var A=new L,te=new d;function re(r,p,C){for(var v=r.slice,w=Y(C),T=q(C),j=Y(p),k=q(p),R=N(j*T),X=N(w*k),K=[],Z=0;Z<v;Z++){var $=2*R*Z/(v-1)-R;K.push(new d(0,H($),Y($)));}for(var se=[],Z=0;Z<v;Z++){var $=2*X*Z/(v-1)-X;se.push(new d(H($),0,Y($)));}return {zoy:K,zox:se}}function ue(r,p){var C=r.xHalfAngle,v=r.yHalfAngle,w=p.zoy,T=p.zox,j=[],k=L.fromRotationY(C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}));var k=L.fromRotationX(-v,A);j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationY(-C,A);j.push(w.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)}).reverse());var k=L.fromRotationX(v,A);return j.push(T.map(function(R){return L.multiplyByVector(k,R,new M.Cartesian3)})),j}function fe(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(18*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=d.normalize(d.cross(k[0],k[k.length-1],te),te),X=0,C=k.length-1;X<C;X++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X].x,v[w++]=k[X].y,v[w++]=k[X].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z,v[w++]=k[X+1].x,v[w++]=k[X+1].y,v[w++]=k[X+1].z,v[w++]=-R.x,v[w++]=-R.y,v[w++]=-R.z;var K=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),Z=6*Float32Array.BYTES_PER_ELEMENT,$=[{index:W.position,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:Z},{index:W.normal,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:Z}];return new b({context:r,attributes:$})}function ge(r,p){for(var C=p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++){var k=p[T];v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=k[0].x,v[w++]=k[0].y,v[w++]=k[0].z;}var R=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),X=3*Float32Array.BYTES_PER_ELEMENT,K=[{index:W.position,vertexBuffer:R,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:X}];return new b({context:r,attributes:K})}function He(r,p){for(var C=Array.prototype.concat.apply([],p).length-p.length,v=new Float32Array(9*C),w=0,T=0,j=p.length;T<j;T++)for(var k=p[T],R=0,C=k.length-1;R<C;R++)v[w++]=k[R].x,v[w++]=k[R].y,v[w++]=k[R].z,v[w++]=k[R+1].x,v[w++]=k[R+1].y,v[w++]=k[R+1].z;var X=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),K=3*Float32Array.BYTES_PER_ELEMENT,Z=[{index:W.position,vertexBuffer:X,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:K}];return new b({context:r,attributes:Z})}function Ne(r){var p=M.EllipsoidGeometry.createGeometry(new M.EllipsoidGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function We(r){var p=M.EllipsoidOutlineGeometry.createGeometry(new M.EllipsoidOutlineGeometry({vertexFormat:I.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),C=b.fromGeometry({context:r,geometry:p,attributeLocations:W,bufferUsage:g.STATIC_DRAW,interleave:false});return C}function Me(r,p){for(var C=p.length-1,v=new Float32Array(9*C),w=0,T=0;T<C;T++)v[w++]=0,v[w++]=0,v[w++]=0,v[w++]=p[T].x,v[w++]=p[T].y,v[w++]=p[T].z,v[w++]=p[T+1].x,v[w++]=p[T+1].y,v[w++]=p[T+1].z;var j=u.createVertexBuffer({context:r,typedArray:v,usage:g.STATIC_DRAW}),k=3*Float32Array.BYTES_PER_ELEMENT,R=[{index:W.position,vertexBuffer:j,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:0,strideInBytes:k}];return new b({context:r,attributes:R})}function je(r,p){var C=p.context,v=re(r,r.xHalfAngle,r.yHalfAngle),w=ue(r,v);if(r.showLateralSurfaces&&(r._sectorVA=fe(C,w)),r.showSectorLines&&(r._sectorLineVA=ge(C,w)),r.showSectorSegmentLines&&(r._sectorSegmentLineVA=He(C,w)),r.showDomeSurfaces&&(r._domeVA=Ne(C)),r.showDomeLines&&(r._domeLineVA=We(C)),r.showScanPlane)if(r.scanPlaneMode=="horizontal"){var T=re(r,G.PI_OVER_TWO,0);r._scanPlaneVA=Me(C,T.zox);}else {var T=re(r,0,G.PI_OVER_TWO);r._scanPlaneVA=Me(C,T.zoy);}}function Ye(r,p,C){var v=p.context,w=Ee,T=new z({sources:[pe,C.shaderSource,Pe]});r._sp=O.replaceCache({context:v,shaderProgram:r._sp,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});var j=new z({sources:[pe,C.shaderSource,Pe],pickColorQualifier:"uniform"});r._pickSP=O.replaceCache({context:v,shaderProgram:r._pickSP,vertexShaderSource:w,fragmentShaderSource:j,attributeLocations:W});}function Ue(r,p,C){var v=p.context,w=Ee,T=new z({sources:[pe,C.shaderSource,Ve]});r._scanePlaneSP=O.replaceCache({context:v,shaderProgram:r._scanePlaneSP,vertexShaderSource:w,fragmentShaderSource:T,attributeLocations:W});}function Xe(r,p,C){Ye(r,p,C),r.showScanPlane&&Ue(r,p,C);}function Ze(r,p,C){C?(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:P.BACK}}),r._backFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND,cull:{enabled:true,face:P.FRONT}}),r._pickRS=D.fromCache({depthTest:{enabled:!p},depthMask:false,blending:F.ALPHA_BLEND})):(r._frontFaceRS=D.fromCache({depthTest:{enabled:!p},depthMask:true}),r._pickRS=D.fromCache({depthTest:{enabled:true},depthMask:true}));}function ie(r,p,C,v,w,T,j,k,R,X,K,Z){X&&C&&(C.vertexArray=j,C.renderState=w,C.shaderProgram=T,C.uniformMap=e(k,r._material._uniforms),C.uniformMap.u_normalDirection=function(){return -1},C.pass=K,C.modelMatrix=R,r._colorCommands.push(C)),p.vertexArray=j,p.renderState=v,p.shaderProgram=T,p.uniformMap=e(k,r._material._uniforms),Z&&(p.uniformMap.u_type=function(){return 1}),p.pass=K,p.modelMatrix=R,r._colorCommands.push(p);}function qe(r,p){r._colorCommands.length=0;var C=p?x.TRANSLUCENT:x.OPAQUE;r.showLateralSurfaces&&ie(r,r._sectorFrontCommand,r._sectorBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorVA,r._uniforms,r._computedModelMatrix,p,C),r.showSectorLines&&ie(r,r._sectorLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showSectorSegmentLines&&ie(r,r._sectorSegmentLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._sectorSegmentLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showDomeSurfaces&&ie(r,r._domeFrontCommand,r._domeBackCommand,r._frontFaceRS,r._backFaceRS,r._sp,r._domeVA,r._uniforms,r._computedModelMatrix,p,C),r.showDomeLines&&ie(r,r._domeLineCommand,void 0,r._frontFaceRS,r._backFaceRS,r._sp,r._domeLineVA,r._uniforms,r._computedModelMatrix,p,C,true),r.showScanPlane&&ie(r,r._scanPlaneFrontCommand,r._scanPlaneBackCommand,r._frontFaceRS,r._backFaceRS,r._scanePlaneSP,r._scanPlaneVA,r._scanUniforms,r._computedScanPlaneModelMatrix,p,C);}return ee}var ae={};function ze(t){ae=t;var o=ae.defaultValue||ae.Scene.defaultValue,d=ae.defined,s=Object.defineProperties,e=ae.DeveloperError,n=ae.Event,i=ae.createMaterialPropertyDescriptor,a=ae.createPropertyDescriptor;function m(c){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 n,this.merge(o(c,o.EMPTY_OBJECT));}return s(m.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radius:a("radius"),xHalfAngle:a("xHalfAngle"),yHalfAngle:a("yHalfAngle"),lineColor:a("lineColor"),showSectorLines:a("showSectorLines"),showSectorSegmentLines:a("showSectorSegmentLines"),showLateralSurfaces:a("showLateralSurfaces"),material:i("material"),showDomeSurfaces:a("showDomeSurfaces"),showDomeLines:a("showDomeLines "),showIntersection:a("showIntersection"),intersectionColor:a("intersectionColor"),intersectionWidth:a("intersectionWidth"),showThroughEllipsoid:a("showThroughEllipsoid"),gaze:a("gaze"),showScanPlane:a("showScanPlane"),scanPlaneColor:a("scanPlaneColor"),scanPlaneMode:a("scanPlaneMode"),scanPlaneRate:a("scanPlaneRate")}),m.prototype.clone=function(c){return d(c)||(c=new m),c.show=this.show,c.radius=this.radius,c.xHalfAngle=this.xHalfAngle,c.yHalfAngle=this.yHalfAngle,c.lineColor=this.lineColor,c.showSectorLines=this.showSectorLines,c.showSectorSegmentLines=this.showSectorSegmentLines,c.showLateralSurfaces=this.showLateralSurfaces,c.material=this.material,c.showDomeSurfaces=this.showDomeSurfaces,c.showDomeLines=this.showDomeLines,c.showIntersection=this.showIntersection,c.intersectionColor=this.intersectionColor,c.intersectionWidth=this.intersectionWidth,c.showThroughEllipsoid=this.showThroughEllipsoid,c.gaze=this.gaze,c.showScanPlane=this.showScanPlane,c.scanPlaneColor=this.scanPlaneColor,c.scanPlaneMode=this.scanPlaneMode,c.scanPlaneRate=this.scanPlaneRate,c},m.prototype.merge=function(c){if(!d(c))throw new e("source is required.");this.show=o(this.show,c.show),this.radius=o(this.radius,c.radius),this.xHalfAngle=o(this.xHalfAngle,c.xHalfAngle),this.yHalfAngle=o(this.yHalfAngle,c.yHalfAngle),this.lineColor=o(this.lineColor,c.lineColor),this.showSectorLines=o(this.showSectorLines,c.showSectorLines),this.showSectorSegmentLines=o(this.showSectorSegmentLines,c.showSectorSegmentLines),this.showLateralSurfaces=o(this.showLateralSurfaces,c.showLateralSurfaces),this.material=o(this.material,c.material),this.showDomeSurfaces=o(this.showDomeSurfaces,c.showDomeSurfaces),this.showDomeLines=o(this.showDomeLines,c.showDomeLines),this.showIntersection=o(this.showIntersection,c.showIntersection),this.intersectionColor=o(this.intersectionColor,c.intersectionColor),this.intersectionWidth=o(this.intersectionWidth,c.intersectionWidth),this.showThroughEllipsoid=o(this.showThroughEllipsoid,c.showThroughEllipsoid),this.gaze=o(this.gaze,c.gaze),this.showScanPlane=o(this.showScanPlane,c.showScanPlane),this.scanPlaneColor=o(this.scanPlaneColor,c.scanPlaneColor),this.scanPlaneMode=o(this.scanPlaneMode,c.scanPlaneMode),this.scanPlaneRate=o(this.scanPlaneRate,c.scanPlaneRate);},m}var J={};function Fe(t,o){if(t){let V=function(f,I,G){var L=I[f.id];if(n(L)){var S=L.primitive;G.remove(S),S&&!S.isDestroyed()&&S.destroy(),delete I[f.id];}};J=t;var d=J.AssociativeArray,s=J.Cartesian3,e=J.Color,n=J.defined,i=J.destroyObject,a=J.DeveloperError,m=J.Matrix3,c=J.Matrix4,y=J.Quaternion,h=J.MaterialProperty,u=J.Property,g=new m;new c;var x=new s,D=new s,O=new y,z=new s,b=new y,F=function(f,I){if(!n(f))throw new a("scene is required.");if(!n(I))throw new a("entityCollection is required.");I.collectionChanged.addEventListener(F.prototype._onCollectionChanged,this),this._scene=f,this._primitives=f.primitives,this._entityCollection=I,this._hash={},this._entitiesToVisualize=new d,this._onCollectionChanged(I,I.values,[],[]);};return F.prototype.update=function(f){if(!n(f))throw new a("time is required.");for(var I=this._entitiesToVisualize.values,G=this._hash,L=this._primitives,S=0,B=I.length;S<B;S++){var U=I[S],E=U._rectangularSensor,H,Y,q,N,Q,W=G[U.id],ee=U.isShowing&&U.isAvailable(f)&&u.getValueOrDefault(E._show,f,true);if(ee&&(H=u.getValueOrUndefined(U._position,f,x),Y=u.getValueOrUndefined(U._orientation,f,O),q=u.getValueOrUndefined(E._radius,f),N=u.getValueOrUndefined(E._xHalfAngle,f),Q=u.getValueOrUndefined(E._yHalfAngle,f),ee=n(H)&&n(N)&&n(Q)),!ee){n(W)&&(W.primitive.show=false);continue}var A=n(W)?W.primitive:void 0;n(A)||(A=new o,A.id=U,L.add(A),W={primitive:A,position:void 0,orientation:void 0},G[U.id]=W);var te=u.getValueOrUndefined(E._gaze,f);if(n(te)){var re=u.getValueOrUndefined(te._position,f,D);if(!n(H)||!n(re))continue;var ue=s.subtract(H,re,z),fe=s.angleBetween(J.Cartesian3.UNIT_Z,ue),ge=s.cross(J.Cartesian3.UNIT_Z,ue,z),Y=y.fromAxisAngle(ge,fe-Math.PI,b);q=s.distance(H,re),A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix);}else (!s.equals(H,W.position)||!y.equals(Y,W.orientation))&&(n(Y)?(A.modelMatrix=c.fromRotationTranslation(m.fromQuaternion(Y,g),H,A.modelMatrix),W.position=s.clone(H,W.position),W.orientation=y.clone(Y,W.orientation)):(A.modelMatrix=J.Transforms.eastNorthUpToFixedFrame(H),W.position=s.clone(H,W.position)));A.show=true,A.gaze=te,A.radius=q,A.xHalfAngle=N,A.yHalfAngle=Q,A.lineColor=u.getValueOrDefault(E._lineColor,f,e.WHITE),A.showSectorLines=u.getValueOrDefault(E._showSectorLines,f,true),A.showSectorSegmentLines=u.getValueOrDefault(E._showSectorSegmentLines,f,true),A.showLateralSurfaces=u.getValueOrDefault(E._showLateralSurfaces,f,true),A.material=h.getValue(f,E._material,A.material),A.showDomeSurfaces=u.getValueOrDefault(E._showDomeSurfaces,f,true),A.showDomeLines=u.getValueOrDefault(E._showDomeLines,f,true),A.showIntersection=u.getValueOrDefault(E._showIntersection,f,true),A.intersectionColor=u.getValueOrDefault(E._intersectionColor,f,e.WHITE),A.intersectionWidth=u.getValueOrDefault(E._intersectionWidth,f,1),A.showThroughEllipsoid=u.getValueOrDefault(E._showThroughEllipsoid,f,true),A.scanPlaneMode=u.getValueOrDefault(E._scanPlaneMode,f),A.scanPlaneColor=u.getValueOrDefault(E._scanPlaneColor,f,e.WHITE),A.showScanPlane=u.getValueOrDefault(E._showScanPlane,f,true),A.scanPlaneRate=u.getValueOrDefault(E._scanPlaneRate,f,1);}return true},F.prototype.isDestroyed=function(){return false},F.prototype.destroy=function(){for(var f=this._entitiesToVisualize.values,I=this._hash,G=this._primitives,L=f.length-1;L>-1;L--)V(f[L],I,G);return i(this)},F.prototype._onCollectionChanged=function(f,I,G,L){var S,B,U=this._entitiesToVisualize,E=this._hash,H=this._primitives;for(S=I.length-1;S>-1;S--)B=I[S],n(B._rectangularSensor)&&n(B._position)&&U.set(B.id,B);for(S=L.length-1;S>-1;S--)B=L[S],n(B._rectangularSensor)&&n(B._position)?U.set(B.id,B):(V(B,E,H),U.remove(B.id));for(S=G.length-1;S>-1;S--)B=G[S],V(B,E,H),U.remove(B.id);},F}}var l=null,be=function(t,o){t&&(this.viewer=t,l=o,this._installPlugin());};be.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive();},_installCylinderGeometry:function(){function t(e){this.length=e.length,this.topRadius=e.topRadius,this.bottomRadius=e.bottomRadius,this.slices=e.slices?e.slices:64,this.zReverse=e.zReverse;}var o=new l.Cartesian2,d=new l.Cartesian3,s=new l.Ray;t._createGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),P=0;P<D.length;P++){_[P]=[];for(var V=x[P],f=0;f<m;f++){_[P].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[P]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(P/(D.length-1),0);}}for(var S=[],P=1;P<D.length;P++)for(var f=1;f<m;f++){var B=_[P-1][f-1],U=_[P][f-1],E=_[P][f],H=_[P-1][f];S.push(E),S.push(H),S.push(B),S.push(E),S.push(B),S.push(U),f==_[P].length-1&&(B=_[P-1][f],U=_[P][f],E=_[P][0],H=_[P-1][0],S.push(E),S.push(H),S.push(B),S.push(E),S.push(B),S.push(U));}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var Y={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},q=l.BoundingSphere.fromVertices(h),N=new l.Geometry({attributes:Y,indices:S,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:q});return h=[],S=[],g=[],N},t.createGeometry=function(e,n){if(!n)return t._createGeometry(e);l.Matrix4.multiplyByPoint(n,l.Cartesian3.ZERO,d),d.clone(s.origin);var i=e.length,a=e.topRadius,m=(e.bottomRadius,e.slices),c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[0,y?-i:i],D=0,D=0;h.push(0,0,0),u.push(1,1),D++;for(var O=new l.Cartesian3,z=a/15,b=0;b<16;b++){for(var F=z*b,P=[],V=0;V<m;V++){var f=c*V,I=F*Math.cos(f),G=F*Math.sin(f);O.x=I,O.y=G,O.z=x[1];var L=(0, l.Scene.extend2Earth)(O,n,s);L?(P.push(D),h.push(I,G,x[1]),u.push(b/15,1),D++):(L=d,P.push(-1));}_.push(P);}for(var S,B,U=[0,_.length-1],E=0;E<U.length;E++)for(var b=U[E],V=1;V<_[b].length;V++)S=_[b][V-1],B=_[b][V],S>=0&&B>=0&&g.push(0,S,B);h=new Float32Array(h),g=new Int32Array(g),u=new Float32Array(u);var H={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:u})},Y=l.BoundingSphere.fromVertices(h),q=new l.Geometry({attributes:H,indices:g,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:Y});return (0, l.Scene.computeVertexNormals)(q),h=[],g=[],q},t.createOutlineGeometry=function(e){var n=e.length,i=e.topRadius,a=e.bottomRadius,m=e.slices,c=2*Math.PI/(m-1),y=e.zReverse,h=[],u=[],g=[],_=[],x=[a,i],D=[0,y?-n:n],O=0,z=Math.atan2(a-i,n),b=o;b.z=Math.sin(z);for(var F=Math.cos(z),P=0;P<D.length;P++){_[P]=[];for(var V=x[P],f=0;f<m;f++){_[P].push(O++);var I=c*f,G=V*Math.cos(I),L=V*Math.sin(I);h.push(G,L,D[P]),G=F*Math.cos(I),L=F*Math.sin(I),u.push(G,L,b.z),g.push(P/(D.length-1),0);}}for(var S=[],P=1;P<D.length;P++)for(var f=1;f<m;f+=1){var B=_[P-1][f-1],U=_[P][f-1];_[P][f],_[P-1][f],f%8==1&&S.push(B,U);}S=new Int16Array(S),h=new Float32Array(h),u=new Float32Array(u),g=new Float32Array(g);var E={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),normal:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:g})},H=l.BoundingSphere.fromVertices(h),Y=new l.Geometry({attributes:E,indices:S,primitiveType:l.PrimitiveType.LINES,boundingSphere:H});return h=[],S=[],g=[],Y},t.fromAngleAndLength=function(e,n,i){return e=l.Math.toRadians(e),new t({topRadius:Math.tan(e)*n/2,bottomRadius:0,length:n,zReverse:i})},l.Scene.CylinderGeometry=t;},_installRadarPrimitive:function(){var t;function o(s,e){let n=l.defaultValue||de;e=e||{},t=s.scene.globe.ellipsoid,this._geometry=null,this._angle=e.angle,this._radius=e.radius?e.radius:5,this._position=e.position,this._rotation=e.rotation?e.rotation:{heading:0,pitch:0,roll:0},this._trackedEntity=e.trackedEntity,this.defaultColor=e.color?e.color:l.Color.YELLOW,this.defaultLineColor=e.lineColor?e.lineColor:this.defaultColor,this._show=n(e.show,true),this._outline=n(e.outline,false),this._topShow=n(e.top,true),this._topOutline=n(e.topOutline,true),this._modelMatrix=l.Matrix4.clone(l.Matrix4.IDENTITY),this._quaternion=new l.Quaternion,this._translation=new l.Cartesian3,this._scale=new l.Cartesian3(1,1,1),this._matrix=new l.Matrix4,this._inverseMatrix=new l.Matrix4,this._positionCartographic=new l.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=s,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=n(e.groundArea,false),this.addGroundAreaEntity(this._groundArea);}Object.defineProperties(o.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(s){this._trackedEntity=s;}},color:{get:function(){return this.defaultColor},set:function(s){this.defaultColor=s;}},lineColor:{get:function(){return this.defaultLineColor},set:function(s){this.defaultLineColor=s;}},show:{get:function(){return this._show},set:function(s){this._show=s;}},outline:{get:function(){return this._outline},set:function(s){this._outline=s,this.updateGeometry();}},top:{get:function(){return this._topShow},set:function(s){this._topShow=s,this.updateGeometry();}},topOutline:{get:function(){return this._topOutline},set:function(s){this._topOutline=s,this.updateGeometry();}},groundArea:{get:function(){return this._groundArea},set:function(s){this._groundArea=s,this.addGroundAreaEntity(this._groundArea);}},angle:{get:function(){return this._angle},set:function(s){this._angle=s,this.updateGroundCircleRadius(),this.updateGeometry();}},radius:{get:function(){return this._radius},set:function(s){this._radius=s,this.updateGroundCircleRadius(),this.updateGeometry();}},heading:{get:function(){return this._rotation.heading},set:function(s){this._rotation.heading=s;}},pitch:{get:function(){return this._rotation.pitch},set:function(s){this._rotation.pitch=s;}},roll:{get:function(){return this._rotation.roll},set:function(s){this._rotation.roll=s;}},position:{get:function(){return this._position},set:function(s){this._position=s;}}}),o.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(l.Math.toRadians(this._angle));},o.prototype.isDestroyed=function(){return false},o.prototype.addGroundAreaEntity=function(s){if(s&&!this.groundAreaEntity){var e=this;this.updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:this._rotation.pitch===0&&this._rotation.roll===0,semiMinorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),semiMajorAxis:new l.CallbackProperty(function(n){return e._ground_radius},false),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(this._rotation.pitch!==0||this._rotation.roll!==0),positions:new l.CallbackProperty(function(n){return e._trackedEntityPosition?l.Cartesian3.distance(e._position,e._trackedEntityPosition)>e._radius?[]:[e._position,e._trackedEntityPosition]:[]},false),followSurface:false,material:new l.PolylineDashMaterialProperty({color:l.Color.CYAN}),width:1}});}};var d=new l.Cartesian3;o.prototype.computeMatrix=function(s,e){if(this._positionCartesian||(this._positionCartesian=new l.Cartesian3),this.position instanceof l.Cartesian3?this._positionCartesian=this.position:typeof this.position.getValue=="function"?this._positionCartesian=this.position.getValue(s):this.position._value&&this.position._value instanceof l.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position){this._positionCartesian;var i=l.Property.getValueOrUndefined(this._trackedEntity.position,s,d);i&&(this._trackedEntityPosition=i,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0);}return this._modelMatrix=l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),this._positionCartographic=l.Cartographic.fromCartesian(this._positionCartesian,t,this._positionCartographic),l.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,t,this._modelMatrix),l.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=l.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),l.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),l.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},o.prototype.getTopGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],P=a[u][x-1],V=a[u][x],f=a[u-1][x];i.push(F,P,V),i.push(F,V,f);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var I={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},G=l.BoundingSphere.fromVertices(e),L=new l.Geometry({attributes:I,indices:i,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:G});return (0, l.Scene.computeVertexNormals)(L),L},o.prototype.getTopOutlineGeometry=function(){for(var s=this.radius,e=[],n=[],i=[],a=[],m=90-parseInt(this.angle),c=m<1?m/8:1,y=2*Math.PI/127,h=0,u=this.angle;u<91;u+=c){var g=l.Math.toRadians(u<90?u:90);g=Math.cos(g)*s;for(var _=[],x=0;x<128;x++){var D=y*x,O=g*Math.cos(D),z=g*Math.sin(D),b=Math.sqrt(s*s-O*O-z*z);e.push(O,z,b),n.push(1,1),_.push(h++);}a.push(_);}for(var u=1;u<a.length;u++)for(var x=1;x<a[u].length;x++){var F=a[u-1][x-1],P=a[u][x-1],V=a[u][x];a[u-1][x],x%8==1&&i.push(F,P),u%8==1&&i.push(P,V);}e=new Float32Array(e),i=new Int32Array(i),n=new Float32Array(n);var f={position:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})},I=l.BoundingSphere.fromVertices(e),G=new l.Geometry({attributes:f,indices:i,primitiveType:l.PrimitiveType.LINES,boundingSphere:I});return (0, l.Scene.computeVertexNormals)(G),G},o.prototype.updateGeometry=function(){this._geometry=l.Scene.CylinderGeometry.createGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=l.Scene.CylinderGeometry.createOutlineGeometry(new l.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(l.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(l.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var s=0;s<this._positions.length;s++)this._positions[s]=this._geometry.attributes.position.values[s];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy();}),this._drawCommands.splice(0,this._drawCommands.length));},o.prototype.update=function(s){this._show&&(this.computeMatrix(s.time),s.mode===l.SceneMode.SCENE3D?(this._geometry.boundingSphere=l.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,s)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,s)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,s)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,s)))),this._drawCommands.forEach(function(e){s.commandList.push(e);}),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)));},o.prototype.getFragmentShaderSource=function(s){return `#version 300 es
446
446
  in vec3 v_position;
447
447
  in vec3 v_normal;
448
448
  uniform float picked;