cesium_dev_kit 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/index.js +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"libgif";import{GUI as i}from"dat.gui";import n from"echarts";let r=null;class o{constructor(e){r=e,this.init_data()}init_data(){this.viewer=null}init({containerId:e,viewerConfig:t,extraConfig:i,MapImageryList:n,imageryProvider:o,viewer:a}){var s={contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:r.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0},o=this.findCesiumProvider(o),l=(r.Ion.defaultAccessToken=i.AccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",s=Object.assign(s,t),a||new r.Viewer(e,{...s,...o}));if(i.logo||(l.cesiumWidget.creditContainer.style.display="none"),i.depthTest&&(l.scene.globe.depthTestAgainstTerrain=!0),n&&0<n.length)for(let e=0;e<n.length;e++)this.addImageryProvider(l,n[e].type,n[e].option||n[e].classConfig);return this.viewer=l}addImageryProvider(e,t,i){e.imageryLayers.addImageryProvider(this.createCesiumProvider({type:t,option:i}))}findCesiumProvider(e){var t={};for(const i in e)e[i]&&e[i].type?t[i]=this.createCesiumProvider(e[i]):t[i]=e[i];return t}createCesiumProvider(e){switch(e.type){case"WebMapTileServiceImageryProvider":case"UrlTemplateImageryProvider":case"TileMapServiceImageryProvider":return new r[e.type](e.option)}}}let a=null;function s(e,t,i){e&&(a=t,this._graphicsLayer=new a.CustomDataSource("graphicsLayer"),e)&&e.dataSources.add(this._graphicsLayer)}s.prototype={getPointGraphics:function(e){if(e=e||{})return new a.PointGraphics({color:e.color||a.Color.GREEN,pixelSize:e.pixelSize||5,outlineColor:e.outlineColor||a.Color.WHITE,outlineWidth:e.outlineWidth||1})},getLineGraphics:function(e){if((e=e||{})&&e.positions)return new a.PolylineGraphics({show:!0,positions:e.positions,material:e.material||a.Color.YELLOW,width:e.width||1,arcType:a.ArcType.GEODESIC,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)})},getPolygonGraphics:function(e){if((e=e||{})&&e.positions)return new a.PolygonGraphics({hierarchy:{positions:e.positions},material:e.material||a.Color.RED.withAlpha(.2),clampToGround:e.clampToGround||!1})},getLabelGraphics:function(e){if((e=e||{})&&e.l_text)return new a.LabelGraphics({text:e.l_text,font:e.l_font||"14px sans-serif",fillColor:e.l_fillColor||a.Color.GOLD,style:e.l_style||a.LabelStyle.FILL_AND_OUTLINE,outlineColor:e.l_outlineColor||a.Color.GOLD,outlineWidth:e.l_outlineWidth||2,showBackground:e.l_showBackground||!1,backgroundColor:e.l_backgroundColor||new a.Color(.165,.165,.165,.8),verticalOrigin:e.l_verticalOrigin||a.VerticalOrigin.BOTTOM,pixelOffset:e.l_pixelOffset||new a.Cartesian2(0,-30)})},getBillboardGraphics:function(e){if((e=e||{})&&e.b_img)return new a.BillboardGraphics({image:e.b_img,width:e.b_width||35,height:e.b_height||35,clampToGround:e.b_clampToGround||!0,scale:e.b_scale||1,pixelOffset:e.b_pixelOffset||new a.Cartesian2(0,-20),scaleByDistance:e.b_scaleByDistance||void 0})},getPathGraphics:function(e){if(e=e||{})return new a.PathGraphics({resolution:e.resolution||1,material:new a.PolylineGlowMaterialProperty({glowPower:e.glowPower||.1,color:e.color||a.Color.YELLOW}),width:e.width||30})},getModelGraphics:function(e){if(e=e||{})return new a.ModelGraphics({uri:e.m_url||e.url,scale:e.m_scale||e.scale||10,clampAnimations:!0})},getEllipseGraphics:function(e){if(e=e||{})return new a.EllipseGraphics({semiMajorAxis:e.e_semiMajorAxis||1e6,semiMinorAxis:e.e_semiMinorAxis||1e6,metarial:e.e_metarial||a.Color.RED.withAlpha(.5),outline:this._objHasOwnProperty(e,"e_outline",!0)})},getEllipsoidGraphics:function(e){var t;if(e=e||{})return t=e.radii||1e6,new a.EllipsoidGraphics({radii:new a.Cartesian3(t,t,t),innerRadii:this._objHasOwnProperty(e,"innerRadii",new a.Cartesian3(t/1.5,t/1.5,t/1.5)),maximumCone:e.maximumCone||a.Math.PI_OVER_TWO,stackPartitions:e.stackPartitions||56,slicePartitions:e.slicePartitions||56,outlineWidth:e.outlineWidth||2,outlineColor:e.outlineColor||a.Color.YELLOW,outline:this._objHasOwnProperty(e,"outline",!0),fill:this._objHasOwnProperty(e,"fill",!0),material:e.material||a.Color.RED.withAlpha(.1)})},getBoxGraphics:function(e){if(e=e||{})return new a.BoxGraphics({show:this._objHasOwnProperty(e,"show",!0),fill:this._objHasOwnProperty(e,"fill",!0),dimensions:e.dimensions||new a.Cartesian3(0,0,0),material:e.material,outline:this._objHasOwnProperty(e,"outline",!0),outlineColor:e.outlineColor||a.Color.BLACK,distanceDisplayCondition:e.distanceDisplayCondition||void 0})},getPlaneGraphics:function(e){if(e=e||{})return new a.PlaneGraphics({plane:e.plane||new a.Plane(a.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new a.Cartesian2(170,130),material:e.material||a.Color.BLUE})},getCylinderGraphics:function(e){if(e=e||{})return new a.CylinderGraphics({HeightReference:a.HeightReference.RELATIVE_TO_GROUND,length:e.length||250,topRadius:e.topRadius||0,bottomRadius:e.bottomRadius||0,material:e.material||new a.Color(0,1,1,.4),slices:e.slices||128})},createPointsGraphics:function(e){if(e&&e.positions){var t,i=[];for(t in e.positions){var n=e.positions[t],o=this.createGraphics();o.name=e.name||"",o.oid=e.oid||"point",o.position=n,e.point&&(o.point=this.getPointGraphics()),e.billboard&&(o.billboard=this.getBillboardGraphics(e.billboard)),e.label&&(o.label=this.getLabelGraphics(e.label)),i.push(this._graphicsLayer.entities.add(o))}return i}},createLineGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).name=e.name||"",t.oid=e.oid||"line",t.position=e.positions,t.polyline=this.getLineGraphics(e),this._graphicsLayer.entities.add(t)},createPolygonGraphics:function(e){var t;if(e=e||{})return(t=this.createGraphics()).polygon=this.getPolygonGraphics(e),t.clampToS3M=this._objHasOwnProperty(e,"clampToS3M",!1),this._graphicsLayer.entities.add(t)},createBoxGraphics:function(e){var t;if(e=e||{})return(t=this.createGraphics()).position=e.position,t.name=e.name||"box_graphic",t.box=this.getBoxGraphics(e.box),this._graphicsLayer.entities.add(t)},createModelGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).model=this.getModelGraphics(e),t.position=e.position,this._graphicsLayer.entities.add(t)},craeteCorridorGraphics:function(r){if(r&&r.positions){let{positions:e,height:t,width:i,material:n,...o}=r;r=this.createGraphics();return r.corridor={positions:e,height:void 0===t?6:t,width:void 0===i?15:i,...o,material:n||new a.Scene.WarnLinkMaterialProperty({freely:"cross",color:a.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(r)}},craeteDynamicPolyLineGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).polyline={show:!0,positions:[],material:e.material||a.Color.CHARTREUSE,width:e.width||5,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)},t.polyline.positions=new a.CallbackProperty(function(){return e.positions},!1),this._graphicsLayer.entities.add(t)},craeteDynamicCylinderGraphics:function(e){var i,n,t={};if(e&&e.cylinder)return i=e.entity,e=e.cylinder,t.cylinder=(n=this).getCylinderGraphics(e),t.position=new a.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime),e=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=a.Math.toDegrees(e.latitude),e=a.Math.toDegrees(e.longitude);return a.Cartesian3.fromDegrees(e,t,0)},!1),t.cylinder.length=new a.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime);return 2*n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e).height},!1),t},createFadeCylinderGraphics:function(e){var t;if((e=e||{})&&e.position)return(t=this.createGraphics()).position=e.position,e.material=new a.Scene.CircleFadeMaterialProperty({color:e.color||a.Color.fromCssColorString("#02ff00"),duration:e.duration||2e3}),t.cylinder=this.getCylinderGraphics(e),this._drawLayer.entities.add(t)},craeteRotateCylinderGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).cylinder={HeightReference:a.HeightReference.RELATIVE_TO_GROUND,length:e.length||500,topRadius:e.topRadius||500,bottomRadius:e.bottomRadius||500,material:e.material||new a.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:!0,repeat:{x:1,y:-1}}),slices:e.slices||128},t.position=e.position,this.setGraphicsRotate({entity:t,position:this.transformCartesianToWGS84(e.position),rotateAmount:4}),this._graphicsLayer.entities.add(t)},craeteDynamicBlinkCircleGraphics:function(e){var t,i,n;if(e&&e.position)return t=this.createGraphics(),i=e.alp||1,n=this._objHasOwnProperty(e,"flog",!0),t.position=e.position,t.ellipse={semiMinorAxis:e.semiMinorAxis||2e3,semiMajorAxis:e.semiMajorAxis||2e3,height:e.height||10,material:new a.ColorMaterialProperty(new a.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),a.Color.RED.withAlpha(i)},!1))},this._graphicsLayer.entities.add(t)},craeteDynamicCricleGraphics:function(i){if(i&&i.center){var n=this.createGraphics(),o=this,r=i.center,s=i.radius||800,l=i.rotateAmount||.05,c=0,h=i.height||1,u=i.scale||null,d=i.scale2||null,i=i.material||new a.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new a.CallbackProperty(function(){return o.transformWGS84ToCartesian(r)},!1),n.orientation=new a.CallbackProperty(function(){return a.Transforms.headingPitchRollQuaternion(o.transformWGS84ToCartesian(r),new a.HeadingPitchRoll(a.Math.toRadians(0),a.Math.toRadians(0),a.Math.toRadians(0)))},!1);let e=s,t=!1;return n.ellipse={material:i,height:h,semiMajorAxis:new a.CallbackProperty(function(){return s},!1),semiMinorAxis:new a.CallbackProperty(function(){return s},!1),stRotation:new a.CallbackProperty(function(){return 0<l&&360<=(c+=l)&&(c=0),u&&((t=u<=s||s<=e?!t:t)?s+=2:s-=2),d&&(s<=d?s+=2:s=e),c},!1)},this._graphicsLayer.entities.add(n)}},craeteDynamicShadeWallGraphics:function(e){var t,i,n,o,r;if(e&&e.positions)return t=e.alp||1,i=e.num||20,n=e.color||a.Color.RED,o=e.speed||.003,(r=this.createGraphics()).wall={positions:e.positions,material:new a.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new a.CallbackProperty(function(){return i%2==0?t-=o:t+=o,(t<=.1||1<=t)&&i++,n.withAlpha(t)},!1)})},this._graphicsLayer.entities.add(r)},createCustomDefBillboardGraphics:function(t){if(t&&t.position){var i=this,n=document.createElement("img");n.src=t.image||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";n.onload=function(){t.image=n;var e=i._graphicsLayer.entities.add({position:t.position,billboard:{image:function(e){var t,i;if(e.image)return(t=document.createElement("canvas")).width=e.width||150,t.height=e.height||80,(i=t.getContext("2d")).drawImage(e.image,0,0),e=e.text,i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(e,55,36),t}(t),scaleByDistance:new a.NearFarScalar(150,.7,15e6,.5),verticalOrigin:a.VerticalOrigin.BOTTOM,pixelOffset:t.b_pixelOffset||new a.Cartesian2(80,-35),width:140,height:100,scale:t.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof t.callback&&t.callback(e)}}},craeteRotatePlaneGraphics:function(e){var t,i,n,o;if(e&&e.center&&e.positions)return t=this.createGraphics(),i=0,n=e.positions,o=n[0],t.position=new a.CallbackProperty(function(){return 0==i?(o=n[0],i+=1):i<n.length-1?(o=n[i],i+=1):i==n.length-1&&(o=n[i],i=0),o},!1),t.plane={plane:new a.Plane(a.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new a.Cartesian2(200,150),material:new a.ImageMaterialProperty({image:e.image})},this._graphicsLayer.entities.add(t)},createVideoPlaneGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).position=e.position,t.plane={plane:new a.Plane(e.normal||a.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new a.Cartesian2(200,150),material:new a.ImageMaterialProperty({image:e.videoElement})},this._graphicsLayer.entities.add(t)},createGifBillboardGraphics:function(t){var i,n,o,r,s,l,c;if(e&&t&&t.position)return n=t.url,o=0,r=n,s=i=[],(l=document.createElement("img")).src=r,l.setAttribute("rel:animated_src",r),l.setAttribute("rel:auto_play","0"),document.body.appendChild(l),c=new e({gif:l}),new Promise(e=>{c.load(()=>{for(let e=1;e<=c.get_length();e++)c.move_to(e),s.push(c.get_canvas().toDataURL());e(s)})}),this._graphicsLayer.entities.add({position:t.position,billboard:{verticalOrigin:a.VerticalOrigin.BASELINE,image:new a.CallbackProperty(function(){return i.length?(o<6*(i.length-1)?o++:o=0,i[Math.floor(o/6)]):n},!1),scale:.2}})},setGraphicsRotate:function(e){var t,i,n,o;e&&e.entity&&e.rotateAmount&&(t=e.entity,i=e.rotateAmount,n=e.position,o=this,n.heading=0,n.pitch=0,n.roll=0,t.position=new a.CallbackProperty(function(){return o.transformWGS84ToCartesian(n)},!1),t.orientation=new a.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),a.Transforms.headingPitchRollQuaternion(o.transformWGS84ToCartesian(n),new a.HeadingPitchRoll(a.Math.toRadians(n.heading),a.Math.toRadians(n.pitch),a.Math.toRadians(n.roll)))},!1))},setGraphicsFloat:function(e){if(e&&e.entity&&e.maxHeiht)try{var t=e.entity,n=e.minHeiht||5,o=e.maxHeiht||100,r=e.cartesians,s=e.speed||.06,l=this,c=n,h=!1;r.length?t.positions=new a.CallbackProperty(function(){var e,t=l.transformCartesianArrayToWGS84Array(r);for(e in t){var i=t[e];(h=o<=n||n<=c?!h:h)?n+=s:n-=s,i.alt=n}return l.transformWGS84ArrayToCartesianArray(t)},!1):t.position=new a.CallbackProperty(function(){var e=l.transformCartesianToWGS84(r);return(h=o<=n||n<=c?!h:h)?n+=s:n-=s,e.alt=n,l.transformWGS84ToCartesian(e)},!1)}catch(e){console.log(e)}},createCanvasGraphics:function(o){o&&o.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:o.positions,material:new a.ImageMaterialProperty({image:new a.CallbackProperty(function(){var e=0,t=document.createElement("canvas"),i=t.getContext("2d"),n=new Image;if(n.src=o.img||"../../images/ysCesium/logo.png",i.clearRect(0,0,o.cwidth,o.cheight),!(e<=o.cwidth))return e=0,e+=3,t;i.drawImage(n,e,0)},!1),transparent:!0})}}),"function"==typeof o.callback)&&o.callback()},createFanShape:function({viewer:e,longitude:t,latitude:i,alt:n,custMaterial:o,speed:r=0,direction:s="+"}){var l,c,h;if(e)return l=this.createGraphics(),c=0,h=this._calcPoints(t,i,n,c),l.wall={positions:new a.CallbackProperty(()=>a.Cartesian3.fromDegreesArrayHeights(h),!1),material:o||a.Color.AQUAMARINE.withAlpha(.5)},e.clock.onTick.addEventListener(()=>{0<r&&(c+=r,h=this._calcPoints(t,i,n,s+c))}),this._graphicsLayer.entities.add(l)},_computeCirclularFlight(t,i,n,o,r,s){var l=[],c=(l.push(t),l.push(i),l.push(0),a.Cartesian3.distance(a.Cartesian3.fromDegrees(t,i),a.Cartesian3.fromDegrees(n,o)));for(let e=r;e<=r+s;e++){var h=c*Math.sin(e*Math.PI/180),u=Math.cos(e*Math.PI/180),d=(o-i)*u+i;l.push((n-t)*u+t),l.push(d),l.push(h)}return l},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,_calcPoints(e,t,i,n){var o=a.Transforms.eastNorthUpToFixedFrame(a.Cartesian3.fromDegrees(e,t)),r=i*Math.cos(n*Math.PI/180),i=i*Math.sin(n*Math.PI/180),n=a.Cartesian3.fromElements(r,i,0),r=a.Matrix4.multiplyByPoint(o,n,new a.Cartesian3),i=a.Cartographic.fromCartesian(r),o=a.Math.toDegrees(i.longitude),n=a.Math.toDegrees(i.latitude);return this._computeCirclularFlight(e,t,o,n,0,90)}};let l=null;function c(e,t,i){e&&(l=t,this._installMaterial())}function h(){}c.prototype={_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial(),this._installPolylineTrailLinkMaterial()},addMaterialLineGraphics:function(e){var t;if(this._viewer&&e&&e.image)return(t=this.createGraphics()).polyline={positions:e.positions,material:new l.PolylineCustomMaterialProperty({color:e.color||l.Color.RED,duration:e.duration||500}),width:e.width},this._viewer.entities.add(t)},getCustomMaterialLine:function(e){if(this._viewer&&e&&e.image)return this._initPolylineCustomMaterialProperty(e)},_initPolylineCustomMaterialProperty(i){if(i){var e=l.Color,t=l.defaultValue,n=l.defined,o=Object.defineProperties,r=l.Event,a=l.createPropertyDescriptor,s=l.Property,c=l.Material,h=e.WHITE,u=i.MaterialType||"wallType"+parseInt(1e3*Math.random());const d=function(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||l.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0};return o(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),d.prototype.getType=function(){return u},d.prototype.getValue=function(e,t){return(t=n(t)?t:{}).color=s.getValueOrClonedDefault(this._color,e,h,t.color),t.image=i.image,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},d.prototype.equals=function(e){return this===e||e instanceof d&&s.equals(this._color,e._color)},c._materialCache.addMaterial(u,{fabric:{type:u,uniforms:{color:i.color||new l.Color(1,0,0,.5),image:i.image,time:i.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new d(i)}},addMaterialWallGraphics:function(e){var t;if(this._viewer&&e&&e.image)return(t=this.createGraphics()).wall={positions:e.positions,material:this.getCustomMaterialWall(e),width:e.width},this._viewer.entities.add(t)},getCustomMaterialWall:function(e){if(this._viewer&&e&&e.image)return this._initWallCustomMaterialProperty(e)},_initWallCustomMaterialProperty(i){var n=l.Color,t=l.defaultValue,o=l.defined,e=Object.defineProperties,r=l.Event,a=l.createPropertyDescriptor,s=l.Property,c=l.Material,h=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||n.BLUE,this.duration=e.duration||3e3,this._time=(new Date).getTime()}return e(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),u.prototype.getType=function(){return h},u.prototype.getValue=function(e,t){return(t=o(t)?t:{}).color=s.getValueOrClonedDefault(this._color,e,n.WHITE,t.color),t.image=i.image,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},u.prototype.equals=function(e){return this===e||e instanceof u&&s.equals(this._color,e._color)},c._materialCache.addMaterial(h,{fabric:{type:h,uniforms:{color:new n(1,0,0,.5),image:i.image,time:0},source:this._getDirectionWallShader({get:!0,count:i.count,freely:i.freely,direction:i.direction})},translucent:function(){return!0}}),new u(i)},_installWaveCircleMaterial:function(){var t=l.Color,i=l.defaultValue,e=Object.defineProperties,n=l.Event,o=l.Property,r=l.Material;function a(e){e=e||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=i(e.color,t.fromBytes(0,255,255,255)),this.duration=i(e.duration,45),this.count=Math.max(i(e.count,2),1),this.gradient=i(e.gradient,.1),this.gradient<0?this.gradient=0:1<this.gradient&&(this.gradient=1)}e(a.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getType=function(){return r.CircleWaveType},a.prototype.getValue=function(e,t){return(t=t||{}).color=o.getValueOrUndefined(this._color,e),t.duration=this._duration,t.count=this.count,t.gradient=this.gradient,t},a.prototype.equals=function(e){return this===e||e instanceof a&&l.Property.equals(this._color,e._color)},e(a.prototype,{color:l.createPropertyDescriptor("color"),duration:l.createPropertyDescriptor("duration")}),l.Scene.CircleWaveMaterialProperty=a,r.CircleWaveType="CircleWave",r._materialCache.addMaterial(r.CircleWaveType,{fabric:{type:r.CircleWaveType,uniforms:{color:new t(1,0,0,.7),duration:45,count:1,gradient:.1},source:this._getDynamicCircleShader({get:!0})},translucent:function(){return!0}})},_installCircleFadeMaterial:function(){var e=l.Color,t=l.defaultValue,i=Object.defineProperties,n=l.Event,o=l.Property,r=l.Material,a=new e(0,0,0,0);function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=t(e.color,a),this._duration=e.duration||1e3,this._time=void 0}i(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return r.CircleFadeMaterialType},s.prototype.getValue=function(e,t){return(t=t||{}).color=o.getValueOrClonedDefault(this._color,e,a,t.color),void 0===this._time&&(this._time=(new Date).getTime()),t.time=((new Date).getTime()-this._time)/this._duration,t},s.prototype.equals=function(e){return this===e||e instanceof s&&l.Property.equals(this._color,e._color)},i(s.prototype,{color:l.createPropertyDescriptor("color")}),l.Scene.CircleFadeMaterialProperty=s,r.CircleFadeMaterialType="CircleFadeMaterial",r._materialCache.addMaterial(r.CircleFadeMaterialType,{fabric:{type:r.CircleFadeMaterialType,uniforms:{color:new e(1,0,0,1),time:1},source:this._getCircleFadeShader({get:!0})},translucent:function(){return!0}})},_installCityLineMaterial:function(){var e=l.Color,t=l.defaultValue,i=l.defined,n=Object.defineProperties,o=l.Event,r=l.createPropertyDescriptor,a=l.Property,s=l.Material,c=e.WHITE;function h(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||l.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0,this._img=e.imgUrl||s.PolylineCityLinkImage}n(h.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:r("color")}),h.prototype.getType=function(){return s.PolylineCityLinkType},h.prototype.getValue=function(e,t){return(t=i(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,c,t.color),t.image=this._img,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},h.prototype.equals=function(e){return this===e||e instanceof h&&a.equals(this._color,e._color)},l.Scene.PolylineCityLinkMaterialProperty=h,s.PolylineCityLinkType="PolylineCityLink",s.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",s._materialCache.addMaterial(s.PolylineCityLinkType,{fabric:{type:s.PolylineCityLinkType,uniforms:{color:new e(1,0,0,1),image:s.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:!0})},translucent:function(){return!0}})},_installWarnMaterial:function(){var i=l.Color,t=l.defaultValue,n=l.defined,e=Object.defineProperties,o=l.Event,r=l.createPropertyDescriptor,a=l.Property,s=l.Material;function c(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||i.BLUE,this.duration=e.duration||3e3,this._time=(new Date).getTime()}e(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.getType=function(){return s.WarnLinkType},c.prototype.getValue=function(e,t){return(t=n(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,i.WHITE,t.color),t.image=s.WarnLinkImage,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},c.prototype.equals=function(e){return this===e||e instanceof c&&a.equals(this._color,e._color)},e(c.prototype,{color:r("color")}),l.Scene.WarnLinkMaterialProperty=c,s.WarnLinkType="WarnWallLinkType",s.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",s._materialCache.addMaterial(s.WarnLinkType,{fabric:{type:s.WarnLinkType,uniforms:{color:new i(1,0,0,.5),image:s.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:!0,count:10,freely:"cross",direction:"-"})},translucent:function(){return!0}})},_installFlowMaterial:function(){var t=l.Color,i=l.defaultValue,e=Object.defineProperties,n=l.Event,o=l.createPropertyDescriptor,r=l.Property,a=l.Material;function s(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||t.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=i(e.duration,45)}e(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return a.PolylineFlowType},s.prototype.getValue=function(e,t){return(t=t||{}).color=r.getValueOrClonedDefault(this._color,e,l.Color.WHITE,t.color),t.duration=this._duration,t},s.prototype.equals=function(e){return this===e||e instanceof s&&r.equals(this._color,e._color)},e(s.prototype,{color:o("color"),duration:o("duration")}),l.Scene.PolylineFlowMaterialProperty=s,a.PolylineFlowType="PolylineFlow",a._materialCache.addMaterial(a.PolylineFlowType,{fabric:{type:a.PolylineFlowType,uniforms:{color:new t(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:!0})},translucent:function(){return!0}})},_installPolylineTrailLinkMaterial:function(){var e=l.Color,t=l.defaultValue,i=Object.defineProperties,n=l.createPropertyDescriptor,o=l.Event,r=l.Property,a=l.Material,s=this.getDfSt(["primitive","WaterPrimitive"]);function c(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this.color=e.color||l.Color.WHITE,this.image=e.image||s,this._colorSubscription=void 0,this.duration=e.duration||3e3,this._time=(new Date).getTime(),this.speed=e.speed,this.isTranslucent=function(){return!0}}i(c.prototype,{isConstant:{get:function(){return!1},configurable:!0},definitionChanged:{get:function(){return this._definitionChanged},configurable:!0},color:n("color"),duration:n("duration")}),c.prototype.getType=function(){return a.PolylineTrailLinkType},c.prototype.getValue=function(e,t){return(t=l.defined(t)?t:{}).color=r.getValueOrClonedDefault(this._color,e,this.color,t.color),t.image=a.PolylineTrailLinkImage,t.time=((new Date).getTime()-this._time)%this.duration/this.duration*this.speed,t},c.prototype.equals=function(e){return this===e||e instanceof c&&r.equals(this._color,e._color)},a.PolylineTrailLinkSource="\n uniform vec4 color;\n uniform float time;\n uniform sampler2D image;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n return material;\n }",l.Scene.PolylineTrailLinkMaterial=c,a.PolylineTrailLinkType="PolylineTrailLinkMaterial",a.PolylineTrailLinkImage=this.image||s||"static/data/images/Textures/river.png",a._materialCache.addMaterial(a.PolylineTrailLinkType,{fabric:{type:a.PolylineTrailLinkType,uniforms:{color:new e(1,1,1,1),image:a.PolylineTrailLinkImage,time:-20},source:a.PolylineTrailLinkSource},translucent:function(){return!0}})}},h.prototype={_getFlowLineShader:function(){return"uniform vec4 color;\n uniform float duration;\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float t =fract(czm_frameNumber / duration);\n t *= 1.03;\n float alpha = smoothstep(t- 0.03, t, st.s) * step(-t, -st.s);\n alpha += 0.1;\n vec4 fragColor;\n fragColor.rgb = (color.rgb) / 0.5;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = fragColor.rgb;\n material.alpha = alpha;\n material.emission = fragColor.rgb;\n return material;\n }\n "},_getDynamicLineShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n if(texture(image, vec2(0.0, 0.0)).a == 1.0){\n discard;\n }else{\n material.alpha = texture(image, vec2(1.0 - fract(time - st.s), st.t)).a * color.a;\n }\n \n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n \n return material;\n }\n "},_getDynamicLightLineShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n vec4 colorImage = texture(image, vec2(fract(1.0 *st.s - time), fract(st.t)));\n \n vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getDirectionWallShader:function(e){var t;if(e&&e.get)return t="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ","vertical"==e.freely?t+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.t "+e.direction+" time), fract(st.s)));\n ":t+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.s "+e.direction+" time), fract(st.t)));\n ",t+"vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getCircleFadeShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n \n {\n \n czm_material material = czm_getDefaultMaterial(materialInput);\n \n material.diffuse = 1.5 * color.rgb;\n \n vec2 st = materialInput.st;\n \n float dis = distance(st, vec2(0.5, 0.5));\n \n float per = fract(time);\n \n if(dis > per * 0.5){\n \n //material.alpha = 0.0;\n \n discard;\n \n }else {\n \n material.alpha = color.a * dis / per / 2.0;\n \n }\n \n return material;\n \n }"},_getDynamicCircleShader:function(e){if(e&&e.get)return"uniform vec4 color;\n uniform float duration;\n uniform float count;\n uniform float gradient;\n \n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(czm_frameNumber / duration);\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n } else {\n float perDis = 0.5 / count;\n float disNum;\n float bl = .0;\n for (int i = 0; i <= 10; i++) {\n if (float(i) <= count) {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0) {\n if (disNum < perDis) {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl, gradient);\n }\n }\n }\n }\n return material;\n }\n "},_getRadarScanShader:function(e){if(e&&e.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 v01 = testPt - ptOnLine;\n normalize(v01);\n vec3 temp = cross(v01, lineNormal);\n float d = dot(temp, u_scanPlaneNormalEC);\n return d > 0.5;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point -planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\n return length(tempPt - ptOnLine);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n out_FragColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n float twou_radius = u_radius * 2.0;\n if(dis < u_radius){\n float f0 = 1.0 -abs(u_radius - dis) / u_radius;\n f0 = pow(f0, 64.0);\n vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\n float f = 0.0;\n if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)){\n float dis1= length(prjOnPlane.xyz - lineEndPt);\n f = abs(twou_radius -dis1) / twou_radius;\n f = pow(f, float("+e.width+"));\n }\n if(float("+e.border+") > 0.0){\n out_FragColor = mix(out_FragColor, u_scanColor, f + f0);\n } else {\n out_FragColor = mix(out_FragColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(e){if(e&&e.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point - planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n out_FragColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius){\n float f = 1.0 - abs(u_radius - dis) / u_radius;\n f = pow(f, float("+e.border+"));\n out_FragColor = mix(out_FragColor, u_scanColor, f);\n }\n }\n "}};let u={},d=void 0;function p(e,t,i){e&&(this._viewer=e,u=t,d=i,this._drawLayer=new u.CustomDataSource("drawLayer"),e&&e.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}p.prototype={createGraphics:function(){return new u.Entity},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,getDfSt(e){if(d)return e=e.reduce((e,t)=>(e||d)[t],void 0),d.baseService+e},setOneSkyBox:function(){return new u.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})},setTwoSkyBox:function(){return new u.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})},setThreeSkyBox:function(){return new u.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})},setOneGroundSkyBox:function(){return new u.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})},setTwoGroundSkyBox:function(){return new u.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})},setThreeGroundSkyBox:function(){return new u.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})},setDarkEffect:function(e){return e=e||{},this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n}\n",uniforms:{scale:1,offset:function(){return e.offset||new u.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(e){if(this._viewer&&e)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"blur_x_direction",fragmentShader:"uniform float height;\nuniform float width;\nuniform sampler2D colorTexture1;\n\nin vec2 v_textureCoordinates;\n\nconst int SAMPLES = 9;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nfloat wr = float(1.0 / width);\nfloat hr = float(1.0 / height);\nvec4 result = vec4(0.0);\nint count = 0;\nfor(int i = -SAMPLES; i <= SAMPLES; ++i){\nfor(int j = -SAMPLES; j <= SAMPLES; ++j){\nvec2 offset = vec2(float(i) * wr, float(j) * hr);\nresult += texture(colorTexture1, st + offset);\n}\n}\nresult = result / float(count);\nout_FragColor = result;\n}\n",uniforms:{width:e.width,height:e.height,colorTexture1:"Bright"}}))},setRainEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"rainEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n \n float hash(float x){\n return fract(sin(x*23.3)*13.13);\n }\n \n void main(){\n float time = czm_frameNumber / 60.0;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a=-.4;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*.3+1.;\n float v=1.-sin(hash(floor(uv.x*100.))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n }\n "}))},setSnowEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"snowEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n float snow(vec2 uv,float scale){\n float time = czm_frameNumber / 60.0;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));\n if(w<.1)return 0.;\n uv+=time/scale;\n uv.y+=time*2./scale;\n uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;\n vec2 s=floor(uv),f=fract(uv),p;\n float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;\n d=length(p);\n k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01);\n return k*w;\n }\n \n void main(){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n \n }\n "}))},setFogEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nin vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n out_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new u.Cartesian4(10,0,200,.3),fogColor:u.Color.AZURE}}))},setDefSceneConfig:function(){this._viewer&&(this._viewer.scene.sun.show=!1,this._viewer.scene.moon.show=!1,this._viewer.scene.fxaa=!0,this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.undergroundMode=!1,this._viewer.scene.terrainProvider.isCreateSkirt=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.globe.showGroundAtmosphere=!1,this._viewer.scene.globe.enableLighting=!0,this._viewer.scene.fog.enabled=!1,this._viewer.cesiumWidget.creditContainer.style.display="none")},setBloomLightScene:function(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=!0,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=!1,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=!1)},removePostProcessStage:function(e){e&&(Array.isArray(e)?e.forEach(e=>{this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e)}):this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e))},setView:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new u.Cartesian3(0,e.distance,window.opt.distance),e.position=u.Cartesian3.add(e.position,t,new u.Cartesian3)),this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:u.Math.toRadians(90),pitch:u.Math.toRadians(90),roll:u.Math.toRadians(0)}}))},flyTo:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new u.Cartesian3(0,e.distance,0),e.position=u.Cartesian3.add(e.position,t,new u.Cartesian3)),this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:u.Math.toRadians(90),pitch:u.Math.toRadians(90),roll:u.Math.toRadians(0)},easingFunction:e.easingFunction||u.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback}))},transformCartesianToWGS84:function(e){if(this._viewer&&e)return e=u.Ellipsoid.WGS84.cartesianToCartographic(e),{lng:u.Math.toDegrees(e.longitude),lat:u.Math.toDegrees(e.latitude),alt:e.height}},transformWGS84ArrayToCartesianArray:function(e,t){var i;if(this._viewer&&e)return i=this,e?e.map(function(e){return i.transformWGS84ToCartesian(e,t)}):[]},transformWGS84ToCartesian:function(e,t){if(this._viewer)return e?u.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=t||e.alt,u.Ellipsoid.WGS84):u.Cartesian3.ZERO},transformCartesianArrayToWGS84Array:function(e){var t;if(this._viewer)return t=this,e?e.map(function(e){return t.transformCartesianToWGS84(e)}):[]},transformWGS84ToCartographic:function(e){return e?u.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):u.Cartographic.ZERO},lnglatArrayToCartesians:function(t){if(!t||t.length<1)return[];var i=[];for(let e=0;e<t.length;e++){var n=u.Cartesian3.fromDegrees(Number(t[e][0]),Number(t[e][1]),Number(t[e][2]||0));i.push(n)}return i},setCameraEotateHeading(l){if(l){let t=this._viewer,i=u.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=u.Math.toRadians(-30),o=12,r=5e3,e=u.JulianDate.fromDate(new Date),a=(t.clock.startTime=e.clone(),t.clock.currentTime=e.clone(),t.clock.clockRange=u.ClockRange.CLAMPED,t.clock.clockStep=u.ClockStep.SYSTEM_CLOCK,t.camera.heading),s=function(){var e=u.JulianDate.secondsDifference(t.clock.currentTime,t.clock.startTime),e=u.Math.toRadians(e*o)+a;t.scene.camera.setView({destination:i,orientation:{heading:e,pitch:n}}),t.scene.camera.moveBackward(r),0<=u.JulianDate.compare(t.clock.currentTime,t.clock.stopTime)&&t.clock.onTick.removeEventListener(s)};t.clock.onTick.addEventListener(s)}},getCatesian3FromPX:function(e){if(this._viewer&&e){var t,i,n=this._viewer.scene.pick(e),o=null,r=!1,a=!1;if((r=n instanceof u.Cesium3DTileFeature?!0:r)&&(o=this._viewer.scene.pickPosition(e))&&((t=u.Cartographic.fromCartesian(o)).height<0&&(t.height=0),s=u.Math.toDegrees(t.longitude),i=u.Math.toDegrees(t.latitude),t=t.height,o=this.transformWGS84ToCartesian({lng:s,lat:i,alt:t})),!n){var s=this._viewer.scene.camera.getPickRay(e);if(!s)return null;o=this._viewer.scene.globe.pick(s,this._viewer.scene),a=!0}return(o=r||a?o:this._viewer.scene.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid))?(i=this.transformCartesianToWGS84(o)).alt<0?this.transformWGS84ToCartesian(i,.1):o:!1}},getCameraPosition:function(){if(this._viewer){var e,t,i,n,o,r,a,s,l,c,h,d=this._viewer.scene.camera.pickEllipsoid(new u.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(d)return e=180*(d=u.Ellipsoid.WGS84.cartesianToCartographic(d)).longitude/Math.PI,d=180*d.latitude/Math.PI,n=this._viewer.camera._direction,t=u.Math.toDegrees(n.x),i=u.Math.toDegrees(n.y),n=u.Math.toDegrees(n.z),o=this._viewer.camera.positionCartographic.height,r=u.Math.toDegrees(this._viewer.camera.heading),a=u.Math.toDegrees(this._viewer.camera.pitch),s=u.Math.toDegrees(this._viewer.camera.roll),c=(l=this._viewer.camera.computeViewRectangle()).west/Math.PI*180,h=l.north/Math.PI*180,c=(c+l.east/Math.PI*180)/2,h=(h+l.south/Math.PI*180)/2,{lon:e,lat:d,height:o,heading:r,pitch:a,roll:s,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:c,y:h},direction:new u.Cartesian3(t,i,n)}}},getHandlerClickPosition(e){var t,i,n;if(this._viewer)return n=this._viewer.scene,t=this._viewer,i=n.camera.pickEllipsoid(e.position,n.globe.elliposid),t={heading:u.Math.toDegrees(t.camera.heading),pitch:u.Math.toDegrees(t.camera.pitch),roll:u.Math.toDegrees(t.camera.roll),position:t.camera.position},(i=u.Cartographic.fromCartesian(i)).height<0&&(i.height=0),i={alt:i.height,lat:u.Math.toDegrees(i.latitude),lon:u.Math.toDegrees(i.longitude)},n=n.pickPosition(e.position),{wgs84Coor:i,graphicCoor:{height:(e=u.Cartographic.fromCartesian(n)).height,latitude:u.Math.toDegrees(e.latitude),longitude:u.Math.toDegrees(e.longitude)},cameraPosition:t}},updateCameraState:function(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},bindHandelEvent:function({leftClick:t,mouseMove:i,doubleClick:n,leftDown:o,mouseWheel:r,leftUp:a}){var s;this._viewer&&(s=new u.ScreenSpaceEventHandler(this._viewer.canvas),t&&s.setInputAction(function(e){t(e,s)},u.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(e){i(e,s)},u.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(e){n(e,s)},u.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),o&&s.setInputAction(function(e){o(e,s)},u.ScreenSpaceEventType.LEFT_DOWN),r&&s.setInputAction(function(e){r(e,s)},u.ScreenSpaceEventType.WHEEL),a)&&s.setInputAction(function(e){a(e,s)},u.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(t){var i,n;this._viewer&&(i=new u.ScreenSpaceEventHandler(this._viewer.scene.canvas),n=this,i.setInputAction(function(e){e=n._viewer.scene.camera.pickEllipsoid(e.endPosition,n._viewer.scene.globe.ellipsoid);"function"==typeof t&&t(n.transformCartesianToWGS84(e),i)},u.ScreenSpaceEventType.MOUSE_MOVE))},saveSceneImages:function(){var e,t;this._viewer&&(t=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),e=document.createElement("a"),t=function(e){for(var e=e.split(","),t=e[0].match(/:(.*?);/)[1],i=atob(e[1]),n=i.length,o=new Uint8Array(n);n--;)o[n]=i.charCodeAt(n);return new Blob([o],{type:t})}(t),t=URL.createObjectURL(t),e.download="scene.png",e.href=t,e.click())},_installAmapImageryProvider:function(){u.Scene.AmapImageryProvider=function(e){return e.url="img"===e.style?"https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}":"http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}",e.subdomains||(e.subdomains=["01","02","03","04"]),new u.UrlTemplateImageryProvider(e)}},_installTdtImageryProvider:function(){u.Scene.TdtImageryProvider=function(e){return new u.WebMapTileServiceImageryProvider({url:"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}".replace(/\{layer\}/g,e.style||"vec").replace(/\{key\}/g,e.key||""),layer:e.style+"_w",style:"default",format:"tiles",tileMatrixSetID:"GoogleMapsCompatible",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],minimumLevel:0,maximumLevel:18})}},_installTencentImageryProvider:function(){u.Scene.TencentImageryProvider=function(e){return"img"===e.layer?(e.url||(e.url="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229"),e.subdomains||(e.subdomains=["0","1","2"]),e.customTags={sx:function(e,t,i,n){return t>>4},sy:function(e,t,i,n){return(1<<n)-i>>4}}):e.url||(e.url="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1"),new u.UrlTemplateImageryProvider(e)}},_installGooGleImageryProvider:function(){u.Scene.GoogleImageryProvider=function(e){return e.url="img"===e.style?"http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali":"ter"===e.style?"http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile":"http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",e.subdomains||(e.subdomains=["1","2","3","4","5"]),new u.UrlTemplateImageryProvider(e)}},_installBaiduImageryProvider:function(){var t="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function e(e){t=e.url||t,this._url=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new u.WebMercatorTilingScheme({rectangleSouthwestInMeters:new u.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new u.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=e.style||"normal",this._ready=!0}Object.defineProperties(e.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(this.ready)return this._tileWidth;throw new u.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new u.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new u.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new u.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new u.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new u.DeveloperError("rectangle must not be called before the imagery provider is ready.")}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}},readyPromise:{get:function(){return this._readyPromise.promise}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),e.prototype.getTileCredits=function(e,t,i){},e.prototype.requestImage=function(e,t,i){var n,o,r,a;if(this.ready)return e=e,t=t,i=i,o=(n=this)._style,r=n._url+"&x={x}&y={y}&z={z}&customid={style}",a=n._tilingScheme.getNumberOfXTilesAtLevel(i),n=n._tilingScheme.getNumberOfYTilesAtLevel(i),r=r.replace("{x}",e-a/2).replace("{y}",n/2-t-1).replace("{z}",i).replace("{style}",o),u.ImageryProvider.loadImage(this,r);throw new u.DeveloperError("requestImage must not be called before the imagery provider is ready.")},u.Scene.BaiduImageryProvider=e},_installGroundSkyBox:function(){var a=u.BoxGeometry,s=u.Cartesian3,t=u.defaultValue,l=u.defined,i=u.destroyObject,c=u.DeveloperError,h=u.GeometryPipeline,e=u.Matrix3,d=u.Matrix4,p=u.Transforms,m=u.VertexFormat,g=u.BufferUsage,f=u.CubeMap,n=u.DrawCommand,y=u.loadCubeMap,v=u.RenderState,_=u.VertexArray,w=u.BlendingState,C=u.SceneMode,P=u.ShaderProgram,x=u.ShaderSource;function o(e){this.sources=e.sources,this._sources=void 0,this.show=t(e.show,!0),this._command=new n({modelMatrix:d.clone(d.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(d.getRotation)||(d.getRotation=d.getMatrix3);var b=new e;o.prototype.update=function(e,t){var i=this;if(this.show&&(e.mode===C.SCENE3D||e.mode===C.MORPHING)&&e.passes.render){var n=e.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;if(!(l(o.positiveX)&&l(o.negativeX)&&l(o.positiveY)&&l(o.negativeY)&&l(o.positiveZ)&&l(o.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof o.positiveX?y(n,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new f({context:n,source:o}))}var r=this._command;if(r.modelMatrix=p.eastNorthUpToFixedFrame(e.camera._positionWC),l(r.vertexArray)||(r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return d.getRotation(r.modelMatrix,b)}},o=a.createGeometry(a.fromDimensions({dimensions:new s(2,2,2),vertexFormat:m.POSITION_ONLY})),e=this._attributeLocations=h.createAttributeLocations(o),r.vertexArray=_.fromGeometry({context:n,geometry:o,attributeLocations:e,bufferUsage:g._DRAW}),r.renderState=v.fromCache({blending:w.ALPHA_BLEND})),l(r.shaderProgram)&&this._useHdr===t||(o=new x({defines:[t?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),r.shaderProgram=P.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._useHdr=t),l(this._cubeMap))return r}},o.prototype.isDestroyed=function(){return!1},o.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(),i(this)},u.Scene.GroundSkyBox=o},removeHandlerByName(e=[]){e.forEach(e=>{this._viewer.screenSpaceEventHandler.removeInputAction(u.ScreenSpaceEventType[e])})}};let m={};function f(e,t){e&&(this._viewer=e,m=t)}f.prototype={splitCartesians3:function(e){for(var t=[],i=0;i<e.length;i+=3){var n=new m.Cartesian3(e[i],e[i+1],e[i+2]);t.push(n)}return t.push(t[0]),t},getLinkedPointList:function(e,t,i,n){if(this._viewer){var o=[],r=m.Cartographic.fromCartesian(e),a=m.Cartographic.fromCartesian(t),s=180*r.longitude/Math.PI,r=180*r.latitude/Math.PI,l=180*a.longitude/Math.PI,a=180*a.latitude/Math.PI,c=Math.sqrt((s-l)*(s-l)+(r-a)*(r-a))*i,h=m.Cartesian3.clone(e),u=m.Cartesian3.clone(t),d=m.Cartesian3.distance(h,m.Cartesian3.ZERO),p=m.Cartesian3.distance(u,m.Cartesian3.ZERO);if(m.Cartesian3.normalize(h,h),m.Cartesian3.normalize(u,u),0!=m.Cartesian3.distance(h,u)){var g=m.Cartesian3.angleBetween(h,u);o.push(e);for(var f=1;f<n-1;f++){var y=+f/(n-1),v=1-y,_=Math.sin(v*g)/Math.sin(g),w=Math.sin(y*g)/Math.sin(g),_=m.Cartesian3.multiplyByScalar(h,_,new m.Cartesian3),w=m.Cartesian3.multiplyByScalar(u,w,new m.Cartesian3),_=m.Cartesian3.add(_,w,new m.Cartesian3),w=y*Math.PI,v=d*v+p*y+Math.sin(w)*c,_=m.Cartesian3.multiplyByScalar(_,v,_);o.push(_)}o.push(t)}return o}},getPositionsAngle:function(e){var t,i,n,o;if(e)return i=e.position1,o=e.position2,n=m.Transforms.eastNorthUpToFixedFrame(i),n=m.Matrix4.inverse(n,new m.Matrix4),i=m.Matrix4.multiplyByPoint(n,i,new m.Cartesian3),n=m.Matrix4.multiplyByPoint(n,o,new m.Cartesian3),"pitch"===e.type?t=Math.atan2(n.z-i.z,n.x-i.x):"heading "===e.type&&(t=Math.atan2(n.y-i.y,n.x-i.x)),(o=t*(180/Math.PI))<0&&(o+=360),o},getPositionsArea:function(n){let e=0;if(n){let t=0,i=m.Ellipsoid.WGS84;n.push(n[0]);for(let e=1;e<n.length;e++){var o=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[e-1])),r=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[e]));t+=o.x*r.y-r.x*o.y}e=Math.abs(t).toFixed(2)}return e},getPolygonArea:function(i){if(this._viewer){let r=Math.PI/180,a=180/Math.PI;const l=function(e,t){var i=e.lat*r,e=e.lon*r,n=t.lat*r,t=t.lon*r;let o=-Math.atan2(Math.sin(e-t)*Math.cos(n),Math.cos(i)*Math.sin(n)-Math.sin(i)*Math.cos(n)*Math.cos(e-t));return o<0&&(o+=2*Math.PI),o*=a};let t=0;for(let e=0;e<i.length-2;e++){var n=(e+1)%i.length,o=(e+2)%i.length,s=function(e,t,i){let n=l(t,e)-l(t,i);return n<0&&(n+=360),n}(i[e],i[n],i[o]);t+=this.getPointDistance(this.transformWGS84ToCartesian(i[e]),this.transformWGS84ToCartesian(i[n]))*this.getPointDistance(this.transformWGS84ToCartesian(i[n]),this.transformWGS84ToCartesian(i[o]))*Math.abs(Math.sin(s))}return t.toFixed(2)}},getPointDistance:function(e,t){var i;if(this._viewer)return e=m.Cartographic.fromCartesian(e),t=m.Cartographic.fromCartesian(t),(i=new m.EllipsoidGeodesic).setEndPoints(e,t),i=i.surfaceDistance,Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2))},getPositionDistance:function(t){let i=0;for(let e=0;e<t.length-1;e++){var n=this.transformWGS84ToCartographic(t[e]),o=this.transformWGS84ToCartographic(t[e+1]),r=new m.EllipsoidGeodesic,r=(r.setEndPoints(n,o),r.surfaceDistance),r=Math.sqrt(Math.pow(r,2)+Math.pow(o.height-n.height,2));i+=r}return i.toFixed(3)},getIntersectObj:function(e,t,i=[],n=!1){if(this._viewer)return t=m.Cartesian3.normalize(m.Cartesian3.subtract(t,e,new m.Cartesian3),new m.Cartesian3),e=new m.Ray(e,t),t=[],n?t=this._viewer.scene.drillPickFromRay(e,10,i):(n=this._viewer.scene.pickFromRay(e,i),m.defined(n)&&(t=[n])),t},getPointOnEllipsoid:function(e,t,i,n,o,r,a,s,l,c){var h,u,d,p;if(this._viewer)return h=new m.Cartesian3,u=new m.Cartesian3,d=new m.Quaternion,p=new m.Matrix3,t=e+t,m.Cartesian3.multiplyByScalar(n,Math.cos(t),h),m.Cartesian3.multiplyByScalar(i,Math.sin(t),u),m.Cartesian3.add(h,u,h),n=Math.cos(e),n*=n,i=Math.sin(e),i*=i,t=r/Math.sqrt(a*n+o*i)/s,m.Quaternion.fromAxisAngle(h,t,d),m.Matrix3.fromQuaternion(d,p),m.Matrix3.multiplyByVector(p,l,c),m.Cartesian3.normalize(c,c),m.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(e,t,i){if(this._viewer){for(var n=new m.Cartesian3,o=new m.Cartesian3,r=new m.Cartesian3,a=new m.Cartesian3,s=t.ellipsoid,l=t.height,c=t.extrudedHeight,t=i?e.length/3*2:e.length/3,h=new Float64Array(3*t),u=e.length,d=i?u:0,p=0;p<u;p+=3){var g=p+1,f=p+2,y=m.Cartesian3.fromArray(e,p,n),v=(s.scaleToGeodeticSurface(y,y),m.Cartesian3.clone(y,o)),_=s.geodeticSurfaceNormal(y,a),w=m.Cartesian3.multiplyByScalar(_,l,r);m.Cartesian3.add(y,w,y),i&&(m.Cartesian3.multiplyByScalar(_,c,w),m.Cartesian3.add(v,w,v),h[p+d]=v.x,h[g+d]=v.y,h[f+d]=v.z),h[p]=y.x,h[g]=y.y,h[f]=y.z}return h}},computeEllipseEdgePositions:function(e){if(this._viewer){for(var t=new m.Cartesian3,i=new m.Cartesian3,n=new m.Cartesian3,o=new m.Cartesian3,r=e.semiMinorAxis,a=e.semiMajorAxis,s=e.rotation,l=e.center,e=e.granularity&&"number"==typeof e.granularity?e.granularity:Math.PI/180,c=((e=e>Math.PI/12?Math.PI/12:e)<Math.PI/180&&(e=Math.PI/180),r*r),h=a*a,u=a*r,d=m.Cartesian3.magnitude(l),p=m.Cartesian3.normalize(l,t),g=m.Cartesian3.cross(m.Cartesian3.UNIT_Z,l,i),g=m.Cartesian3.normalize(g,g),f=m.Cartesian3.cross(p,g,n),y=Math.ceil(2*m.Math.PI/e),v=e,_=o,w=0,C=[],P=0;P<y;P++)_=this.getPointOnEllipsoid(P*v,s,f,g,c,u,h,d,p,_),C[w++]=_.x,C[w++]=_.y,C[w++]=_.z;a={};return a.numPts=y,a.outerPositions=C,a}},computeSectorEdgePositions:function(e){if(this._viewer){for(var t=new m.Cartesian3,i=new m.Cartesian3,n=new m.Cartesian3,o=new m.Cartesian3,r=e.semiMinorAxis,a=e.semiMajorAxis,s=e.rotation,l=e.angle||2*Math.PI,c=e.center,e=e.granularity&&"number"==typeof e.granularity?e.granularity:Math.PI/180,h=((e=e>Math.PI/12?Math.PI/12:e)<Math.PI/180&&(e=Math.PI/180),r*r),u=a*a,d=a*r,p=m.Cartesian3.magnitude(c),g=m.Cartesian3.normalize(c,t),f=m.Cartesian3.cross(m.Cartesian3.UNIT_Z,c,i),f=m.Cartesian3.normalize(f,f),y=m.Cartesian3.cross(g,f,n),v=Math.ceil(l/e),_=e,w=o,C=0,P=[],x=0;x<v;x++)w=this.getPointOnEllipsoid(x*_,s,y,f,h,d,u,p,g,w),P[C++]=w.x,P[C++]=w.y,P[C++]=w.z;a={};return a.numPts=v,a.outerPositions=P,a}},computeLonlatPointsTerrainData:function(e,t){if(this._viewer){for(var i=[],n=0;n<e.length;n++)i.push(m.Cartographic.fromDegrees(e[n].lon,e[n].lat));this._viewer.scene.clampToHeightMostDetailed(i).then(function(e){t(e)})}},computeCartographicPointsTerrainData:function(e,o){if(this._viewer&&!(e.length<=0)){for(var t=[],i=0;i<e.length;i++)t.push(m.Cartesian3.fromRadians(e[i].longitude,e[i].latitude,e[i].height));var n=this._viewer.scene.clampToHeightMostDetailed(t),r=this;n.then(function(e){for(var t=[],i=r._viewer.scene.globe.ellipsoid,n=0;n<e.length;n++)t.push(i.cartesianToCartographic(e[n]));o(t)}).catch(function(e){console.log(e)})}},_checkLonDegree:function(e){return!(180<e||e<-180)},_checkLatDegree:function(e){return!(90<e||e<-90)},computeInterpolateLineLonlat:function(e,t){if(!e||!t)return null;if(e.lon||!e.lat||!t.lon||!t.lat)return null;if(!(this._checkLonDegree(e.lon)&&this._checkLonDegree(t.lon)&&this._checkLatDegree(e.lat)&&this._checkLatDegree(t.lat)))return null;var i=[],n=(i.push([e.lon,e.lat]),Math.sqrt(Math.pow(t.lon-e.lon,2)+Math.pow(t.lat-e.lat,2)));if(n<=1e-5)i.push([t.lon,t.lat]);else for(var o=n/1e-5,r=(t.lon-e.lon)/o,a=(t.lat-e.lat)/o,s=0;s<o;s++){var l=e.lon+(s+1)*r,c=e.lat+(s+1)*a;i.push([l,c])}return i},computeInterpolateLineCartographic:function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var n=[],o=(n.push(new m.Cartographic(e.longitude,e.latitude)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2))),i=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(o<=i)n.push(new m.Cartographic(t.longitude,t.latitude));else{for(var r=o/i,a=(t.longitude-e.longitude)/r,s=(t.latitude-e.latitude)/r,l=0;l<r;l++){var c=e.longitude+(l+1)*a,h=e.latitude+(l+1)*s;n.push(new m.Cartographic(c,h))}n.push(new m.Cartographic(t.longitude,t.latitude,t.height))}return n},computeInterpolateLineHeightCartographic:function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[],n=(i.push(new m.Cartographic(e.longitude,e.latitude,e.height)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)));if(!(n<=1e-5*Math.PI/180))for(var o=n/1e-5*Math.PI/180,r=(t.longitude-e.longitude)/o,a=(t.latitude-e.latitude)/o,s=(t.height-e.height)/o,l=0;l<o;l++){var c=e.longitude+(l+1)*r,h=e.latitude+(l+1)*a,u=e.height+(l+1)*s;i.push(new m.Cartographic(c,h,u))}return i.push(new m.Cartographic(t.longitude,t.latitude,t.height)),i},computeInterpolate2IndexLineHeightCartographic:function(e,t,i,n){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new m.Cartographic(e.longitude,e.latitude,e.height));for(var r=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<n;l++){var c=e.longitude+(l+1)*r,h=e.latitude+(l+1)*a,u=e.height+(l+1)*s;o.push(new m.Cartographic(c,h,u))}return o},computeInterpolateIndexLineHeightCartographic:function(e,t,i,n){var o,r;return e&&t&&e.longitude&&e.latitude&&t.longitude&&t.latitude?(o=(t.longitude-e.longitude)/i,r=(t.latitude-e.latitude)/i,t=(t.height-e.height)/i,i=e.longitude+n*o,o=e.latitude+n*r,r=e.height+n*t,new m.Cartographic(i,o,r)):null}};let g=null;function v(e,t,i){e&&(this._viewer=e,g=t,this._installPrimitives())}v.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive()},_installTetrahedronPrimitive:function(){try{function e(e){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=e.position,this._createCommand=T,this._angle=0,this._distance=b(e.distance,1),this._setInterval=void 0,this._viewer=S,this._speed=b(e.speed,1),this._color=b(e.color,new t(1,1,0,.8)),this._scale=b(e.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=M,this._modelMatrix=R(this),this._height=k(this),D(this)}var i=g.Cartesian3,n=g.ComponentDatatype,a=g.PrimitiveType,o=g.BoundingSphere,r=g.GeometryAttribute,s=g.GeometryPipeline,l=g.Geometry,c=g.defined,h=g.RenderState,u=g.ShaderSource,d=g.ShaderProgram,p=g.DrawCommand,m=g.Pass,f=g.Appearance,y=g.BufferUsage,t=g.Color,v=g.VertexArray,_=(g.buildModuleUrl,g.Matrix4),w=g.Matrix3,C=g.Texture,P=g.Resource,x=g.Transforms,b=g.defaultValue,S=this._viewer,M=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";e.prototype.update=function(e){this.show&&(c(this._command)||(this._command=this._createCommand(e.context,this)),c(this._command))&&e.commandList.push(this._command)},e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},e.prototype.startAnimate=function(){let t=this;this._setInterval=setInterval(function(){t._angle=t._angle+.01,0<Math.sin(t._angle)?t._height=.01:t._height=-.01;var e=new g.Cartesian3(0,0,t._height),e=(_.multiplyByTranslation(t._modelMatrix,e,t._modelMatrix),_.fromRotationTranslation(w.fromRotationZ(g.Math.toRadians(t._speed))));_.multiply(t._modelMatrix,e,t._modelMatrix)},5)},e.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const T=function(e,t){var i=I(),n=L(),o=f.getDefaultRenderState(!1,!0,void 0),o=h.fromCache(o),i=new u({sources:[i]}),n=new u({sources:[n]}),r={color:function(){return t._color},myImage:function(){return c(t._texture)?t._texture:t._viewer.scene.context.defaultTexture}},i=d.fromCache({context:e,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:{position:0,textureCoordinates:1}});return new p({vertexArray:A(e),primitiveType:a.TRIANGLES,renderState:o,shaderProgram:i,uniformMap:r,owner:this,pass:m.TRANSLUCENT,modelMatrix:t._modelMatrix})},A=function(e){var t=E(),t=new l({attributes:{position:new r({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.positions}),textureCoordinates:new r({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:t.sts})},indices:t.indices,primitiveType:a.TRIANGLES,boundingSphere:o.fromVertices(t.positions)}),t=s.computeNormal(t);return v.fromGeometry({context:e,geometry:t,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:y.STATIC_DRAW})},E=function(){var e=new Float64Array(15),t=(e[0]=0,e[1]=1,e[2]=0,e[3]=-1,e[4]=0,e[5]=0,e[6]=0,e[7]=-1,e[8]=0,e[9]=1,e[10]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=-1,new Uint16Array(18));return t[0]=4,t[1]=2,t[2]=3,t[3]=4,t[4]=3,t[5]=0,t[6]=4,t[7]=0,t[8]=1,t[9]=4,t[10]=1,t[11]=2,t[12]=1,t[13]=2,t[14]=3,t[15]=1,t[16]=3,t[17]=0,{indices:t,positions:e,sts:new Float32Array([0,0,1,0,1,1,0,1,.5,.5])}},I=function(){return"#version 300 es\n in vec3 position;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n out vec4 v_pickColor;\n void main()\n {\n v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;\n v_normalEC = czm_normal * normal;\n v_st = st;\n // v_pickColor = czm_batchTable_pickColor(batchId);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},L=function(){return"#version 300 es\n precision mediump float;\n in vec3 v_positionEC;\n in vec3 v_normalEC;\n in vec2 v_st;\n uniform vec4 color;\n in vec4 v_pickColor;\n uniform sampler2D myImage;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n vec2 st = materialInput.st;\n czm_material material = czm_getDefaultMaterial(materialInput);\n float dt_a11 = fract(czm_frameNumber / 100.0) * 3.14159265 * 2.0;\n float dt_a12 = sin(dt_a11);\n float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;\n vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));\n material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;\n material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},D=function(i){P.createIfNeeded(i._imageUrl).fetchImage().then(function(e){var t=i._viewer.scene.context,t=c(e.internalFormat)?new C({context:t,pixelFormat:e.internalFormat,width:e.naturalWidth,height:e.naturalHeight,source:{arrayBufferView:e.bufferView}}):new C({context:t,source:e});i._texture=t})},R=function(e){var t=x.eastNorthUpToFixedFrame(e._localPosition),i=_.fromScale(e._scale),n=_.multiply(t,i,new _);return e._scaleMatrix=i,e._enuMatrix=t,n},k=function(e){var t=i.fromElements(0,0,e._distance,new g.Cartesian3),t=g.Matrix4.multiplyByPoint(e._enuMatrix,t,new i),t=_.multiplyByPoint(e._viewer.scene.camera._viewMatrix,t,new i),e=_.multiplyByPoint(e._viewer.scene.camera.frustum.projectionMatrix,t,new i);return i.normalize(e,new i).z};g.Scene.TetrahedronPrimitive=e}catch(i){console.log(i)}},_installXyzAxisPrimitive:function(){function e(e){this._viewer=e.viewer,this._model=e.model,this._matrix=e.matrix,this._radius=void 0,this._layer=new g.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new g.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=!1,this._xyzPid=void 0,this._builds()}e.prototype={_builds(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(e=>{var t=g.Matrix4.getTranslation(e.modelMatrix,new g.Cartesian3),e=e.boundingSphere,i=e.radius,n=new g.ArrowPolylinePrimitive({id:"axisZ",color:g.Color.RED,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),o=new g.ArrowPolylinePrimitive({id:"axisX",color:g.Color.GREEN,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),t=new g.ArrowPolylinePrimitive({id:"axisY",color:g.Color.BLUE,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),i=g.Matrix3.fromRotationY(g.Math.toRadians(90)),i=(this._rotationX=g.Matrix4.fromRotationTranslation(i),g.Matrix4.multiply(o.geometryInstances[0].modelMatrix,this._rotationX,o.geometryInstances[0].modelMatrix),g.Matrix4.multiply(o.geometryInstances[1].modelMatrix,this._rotationX,o.geometryInstances[1].modelMatrix),g.Matrix3.fromRotationX(g.Math.toRadians(90)));this._rotationY=g.Matrix4.fromRotationTranslation(i),g.Matrix4.multiply(t.geometryInstances[0].modelMatrix,this._rotationY,t.geometryInstances[0].modelMatrix),g.Matrix4.multiply(t.geometryInstances[1].modelMatrix,this._rotationY,t.geometryInstances[1].modelMatrix),this._layer._primitives.add(n),this._layer._primitives.add(o),this._layer._primitives.add(t),this._radius=e.radius,this._createAxisSphere()})},_createAxisSphere:function(){var t=[];for(let e=0;e<=360;e+=3){const i=Math.sin(g.Math.toRadians(e)),n=Math.cos(g.Math.toRadians(e)),o=this._radius*n,r=this._radius*i;t.push(new g.Cartesian3(o,r,0))}var e=this._createAxisSpheres("axisSphereZ",t,this._matrix,g.Color.RED);this._layer._primitives.add(e);const i=this._createAxisSpheres("axisSphereY",t,this._matrix,g.Color.GREEN),n=(this._layer._primitives.add(i),g.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",t,this._matrix,g.Color.BLUE));this._layer._primitives.add(n),g.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(e,t,i,n){t=new g.PolylineGeometry({positions:t,width:10}),t=new g.GeometryInstance({geometry:t,id:e,attributes:{color:g.ColorGeometryInstanceAttribute.fromColor(n)}});return new g.Primitive({geometryInstances:t,appearance:new g.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(i){if(this._layer){var n=this._layer._primitives._primitives;for(let e=1,t=n.length;e<t;e++){var o=n[e],r=g.Matrix4.fromTranslation(new g.Cartesian3(i.x,i.y,i.z));g.Matrix4.multiply(o.modelMatrix,r,o.modelMatrix)}}var e=g.Matrix4.fromTranslation(new g.Cartesian3(i.x,i.y,i.z));g.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_updateAxisSphere(i){if(this._layer){var n=this._layer._primitives._primitives;for(let e=1,t=n.length;e<t;e++){var o=n[e],r=g.Matrix4.fromRotationTranslation(i);g.Matrix4.multiply(o.modelMatrix,r,o.modelMatrix)}}var e=g.Matrix4.fromRotationTranslation(i);g.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_bindHandler(){this._handler.setInputAction(e=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case"axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case"axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case"axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case"axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case"axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case"axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case"axisSphereX":this._updateAxisSphere(g.Matrix3.fromRotationX(g.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(g.Matrix3.fromRotationY(g.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(g.Matrix3.fromRotationZ(g.Math.toRadians(1)))}},g.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(e=>{e=viewer.scene.pick(e.position);e&&e.id&&(this._xyzPid=e.id,this._xyzState=!0)},g.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},g.ScreenSpaceEventType.LEFT_UP)}},g.Scene.XyzAxisPrimitive=e},_installArrowPolylinePrimitive:function(){g.Scene.ArrowPolylinePrimitive=function(e={}){this._color=e.color||g.Color.RED,this._width=e.width||3,this._headWidth=e.headWidth||2*this._width,this._length=e.length||300,this._headLength=e.headLength||10,this._inverse=e.inverse||!1,this.position=e.position;var e=e.id,t=g.CylinderGeometry.createGeometry(new g.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=g.CylinderGeometry.createGeometry(new g.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let n=(this._length+this._headLength)/2;this._inverse&&(n=-n);var o=i,r=[0,0,n],a=new g.Cartesian3;r.length?(a.x=r[0],a.y=r[1],a.z=r[2]):g.Cartesian3.clone(r,a);for(let e=0;e<o.attributes.position.values.length;e+=3)o.attributes.position.values[e]+=a.x,o.attributes.position.values[e+1]+=a.y,o.attributes.position.values[e+2]+=a.z;return new g.Primitive({modelMatrix:g.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new g.GeometryInstance({id:e+"-line",geometry:t}),new g.GeometryInstance({id:e+"-arrow",geometry:i})],appearance:new g.MaterialAppearance({material:g.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){function e(e){var t=(e=g.defaultValue(e,g.defaultValue.EMPTY_OBJECT)).scene;if(!g.defined(t))throw new g.DeveloperError("scene is required.");var i=(this._scene=t)._context;if(!g.defined(i))throw new g.DeveloperError("context is required.");if(!g.defined(e.viewerPosition))throw new g.DeveloperError("this view position is required.");this._viewerPosition=e.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new g.Camera(t),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=g.defaultValue(e.horizontalFov,60),this._verticalFov=g.defaultValue(e.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();t=new g.Cartesian3(0,0,100),e=g.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);g.Matrix4.multiplyByPoint(e,t,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new g.Matrix4,this._shadowMap=new g.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=g.Color.RED,this._visiblyColor=g.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:g.Color.RED,visibly:g.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var e=this._indices,t=0;e[t++]=0,e[t++]=1,e[t++]=0,e[t++]=21,e[t++]=0,e[t++]=85,e[t++]=0,e[t++]=105;for(var i=0,n=0;n<5;++n){i++;for(var o=0;o<20;++o)e[t++]=i++,e[t++]=i}i++;for(var r=0;r<20;++r)for(var a=0;a<5;++a)e[t++]=i,e[t++]=5+i++;this._initialized=!0},this._debugLightFrustum=void 0,this._debugShow=!0}Object.defineProperties(e.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(e){this.shadowMap.debugShow=e,this._debugShow=e}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(e){this._invisiblyColor=e,this.shadowMap._customColor.invisibly=e}},visiblyColor:{get:function(){return this._visiblyColor},set:function(e){this._visiblyColor=e,this.shadowMap._customColor.visibly=e}},viewerPosition:{get:function(){return this._viewerPosition},set:function(e){this._viewerPosition=e,this._cameraUpdated=!1}},direction:{get:function(){return this._direction},set:function(e){this._direction=e,this._cameraUpdated=!1}},pitch:{get:function(){return this._pitch},set:function(e){this._pitch=e,this._cameraUpdated=!1}},horizontalFov:{get:function(){return this._horizontalFov},set:function(e){this._horizontalFov=e,this._cameraUpdated=!1,this._hintLineUpdated=!1}},verticalFov:{get:function(){return this._verticalFov},set:function(e){this._verticalFov=e,this._cameraUpdated=!1,this._hintLineUpdated=!1}},distance:{get:function(){return this._distance},set:function(e){this._distance=e,this._cameraUpdated=!1}}}),e.prototype.setDebugFrustumEffect=function(t,i){var e,n;this.debugShow&&(e=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives,e.forEach(function(e){e.show=t}),n.forEach(function(e){e.show=i}))},e.prototype.update=function(e){var t;this.show&&(this._cameraUpdated||(this._updateCamera(),this.debugShow&&!g.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new g.DebugCameraPrimitive({camera:this._depthCamera,color:g.Color.YELLOW,updateOnChange:!0}),this.setDebugFrustumEffect(!1,!0))),t=e.frustumSplits[1],e.frustumSplits[1]=this._distance,this._debugLightFrustum.update(e),e.frustumSplits[1]=t,e.shadowMaps.push(this.shadowMap))},e.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=g.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:g.Math.toRadians(this._direction),pitch:g.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},e.prototype.setPoseByTargetPoint=function(e){this.distance=g.Cartesian3.distance(this._viewerPosition,e);var t=new g.Cartesian3,i=g.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);g.Matrix4.inverse(i,i),g.Matrix4.multiplyByPoint(i,e,t),g.Cartesian3.normalize(t,t),this.direction=g.Math.toDegrees(Math.atan2(t.x,t.y)),this.pitch=g.Math.toDegrees(Math.asin(t.z))},e.prototype._updateHintLine=function(e){var t,i=this._positions,n=g.Math.toRadians(this._horizontalFov),o=g.Math.toRadians(this._verticalFov),r=Math.tan(.5*n),o=Math.tan(.5*o),a=-(r=this._distance*r),o=-(t=this._distance*o),a=new g.Cartesian3(a,o,-this._distance),o=new g.Cartesian3(r,t,0),r=(g.Matrix4.multiplyByPoint(this._modelMatrix,a,a),g.Matrix4.multiplyByPoint(this._modelMatrix,o,o),g.BoundingSphere.fromCornerPoints(a,o));if(e.cullingVolume.computeVisibility(r)!==Intersect.OUTSIDE){this._valid=!0;var s=0;i[s++]=0,i[s++]=0,i[s++]=0;for(var l,c=Math.PI-.5*n,h=n/4,u=0;u<5;++u)for(var d=c+u*h,p=t/(this._distance/Math.cos(d)),m=-(_=Math.atan(p)),f=_/10,y=0;y<21;++y)l=m+y*f,i[s++]=this._distance*Math.cos(l)*Math.sin(d),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(d);for(var h=n/20,v=0;v<21;++v){d=c+v*h;for(var _,p=t/(this._distance/Math.cos(d)),m=-(_=Math.atan(p)),f=_/2,w=0;w<5;++w)l=m+w*f,i[s++]=this._distance*Math.cos(l)*Math.sin(d),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(d)}var C,P=e.context,a=g.Buffer.createIndexBuffer({context:P,typedArray:new Uint32Array(this._indices),usage:g.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),o=g.Buffer.createVertexBuffer({context:P,typedArray:g.ComponentDatatype.createTypedArray(g.ComponentDatatype.FLOAT,this._positions),usage:g.BufferUsage.STATIC_DRAW}),n=[],e=(n.push({index:0,vertexBuffer:o,componentDatatype:g.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new g.VertexArray({context:P,attributes:n,indexBuffer:a}));g.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=e,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=r):(o=g.ShaderProgram.fromCache({context:P,vertexShaderSource:"in vec3 position;\n uniform mat4 u_modelViewMatrix;\n void main()\n {\n gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);\n }\n ",fragmentShaderSource:"uniform vec4 u_bgColor;\n void main()\n {\n out_FragColor = u_bgColor;\n }\n "}),n=g.RenderState.fromCache({depthTest:{enabled:!0}}),a={u_bgColor:function(){return C._lineColor},u_modelViewMatrix:function(){return P.uniformState.modelView}},(C=this)._drawLineCommand=new g.DrawCommand({boundingVolume:r,modelMatrix:C._modelMatrix,primitiveType:g.PrimitiveType.LINES,vertexArray:e,shaderProgram:o,castShadows:!1,receiveShadows:!1,uniformMap:a,renderState:n,pass:g.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},g.Scene.ShadowPrimitive=e},_installPointsPrimitive:function(){function e(e){e&&e.viewer&&e.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=e.viewer,this.build(e))}e.prototype={build:function(e){if(e.Cartesians&&2<=e.Cartesians.length){var t=[],i=[],n=[];if(e.Colors&&e.Colors.length===4*e.Cartesians.length){for(var o=0;o<e.Cartesians.length;o++)t.push(e.Cartesians[o].x),t.push(e.Cartesians[o].y),t.push(e.Cartesians[o].z);i=e.Colors}else for(var r=0;r<e.Cartesians.length;r++)t.push(e.Cartesians[r].x),t.push(e.Cartesians[r].y),t.push(e.Cartesians[r].z),i.push(0),i.push(0),i.push(1),i.push(1);for(var a=0;a<e.Cartesians.length;a++)n.push(a);this.positionArr=new Float64Array(t),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(n)}else{var s=g.Cartesian3.fromDegrees(0,0,-10),l=g.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([s.x,s.y,s.z,l.x,l.y,l.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},getVSPolylie:function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return"in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(e,t){return new g.Appearance({renderState:{blending:g.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:e,vertexShaderSource:t})},createGeometry:function(e,t,i){return new g.Geometry({attributes:{position:new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),color:new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:t})},indices:i,primitiveType:g.PrimitiveType.POINTS,boundingSphere:g.BoundingSphere.fromVertices(e)})},remove:function(){null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null)},updateCartesianPosition:function(e){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var t=e[0],i=e[1];this.positionArr=new Float64Array([t.x,t.y,t.z,i.x,i.y,i.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var n=[],o=[],r=[],a=0;a<e.length;a++)n.push(e[a].x),n.push(e[a].y),n.push(e[a].z),o.push(0),o.push(0),o.push(1),o.push(1);for(var s=0;s<e.length;s++)r.push(s);this.positionArr=new Float64Array(n),this.colorArr=new Float32Array(o),this.indiceArr=new Uint16Array(r),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}},updateCartesianPositionColor:function(e,t){if(t.length===4*e.length&&null!=this.primitive&&(viewer.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var i=e[0],n=e[1];this.positionArr=new Float64Array([i.x,i.y,i.z,n.x,n.y,n.z]),this.colorArr=new Float32Array(t),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var o=[],r=[],a=0;a<e.length;a++)o.push(e[a].x),o.push(e[a].y),o.push(e[a].z);for(a=0;a<e.length;a++)r.push(a);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(t),this.indiceArr=new Uint16Array(r),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},g.Scene.PointsPrimitive=e},_installWaterPrimitive:function(){let t=this;function e(e){this._positions=e.positions,this._url=e.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=e.frequency||1e3,this._animationSpeed=e.animationSpeed||.01,this._amplitude=e.amplitude||10,this._extrudedHeight=e.extrudedHeight||0,this._viewer=t._viewer,this._fs=this.getFS()}e.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({allowPicking:!1,geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createAppearence=function(){return new g.EllipsoidSurfaceAppearance({material:new g.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},e.prototype._createGeometry=function(){return new g.PolygonGeometry({polygonHierarchy:new g.PolygonHierarchy(g.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:!0})},e.prototype.getFS=function(){return"\n precision highp float;\n struct Light {\n vec3 position;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n };\n in vec3 position;\n in vec2 textureCoord;\n\n uniform vec3 viewPos;\n uniform Light light;\n\n uniform sampler2D normalSampler;\n uniform samplerCube skybox;\n uniform float detalX;\n\n void main() {\n\n float z = gl_FragCoord.z / gl_FragCoord.w;\n const float LOG2 = 1.442695;\n float density = 0.005;\n float normalFactor = exp( -density * density * z * z * LOG2 );\n normalFactor = clamp(normalFactor, 0.0, 1.0);\n\n vec4 normalTex1 = texture(normalSampler, vec2(textureCoord.s + detalX/1024.0, textureCoord.t - detalX/1024.0));\n vec3 normalTex2 = texture(normalSampler, vec2(textureCoord.t, textureCoord.s)).rgb;\n vec3 normal1 = normalize(vec3(normalTex1.r * 2.0 - 1.0, normalTex1.b,normalTex1.g*2.0-1.0));\n vec3 normal2 = normalize(vec3(normalTex2.r * 2.0 - 1.0, normalTex2.b,normalTex2.g*2.0-1.0));\n\n vec3 normal = mix(normal1,normal2,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,normalFactor);\n\n vec3 viewDir = normalize(viewPos - position);\n\n vec3 I = normalize(position - viewPos);\n vec3 R = reflect(I, normal);\n vec3 reflection = texture(skybox, R).rgb;\n\n float ratio = 1.00 / 1.33;\n vec3 Rr = refract(I, normal , ratio);\n vec3 refraction = texture(skybox, Rr).rgb;\n\n float reflectivity = 0.02;\n float theta = max( dot( viewDir, normal ), 0.0 );\n float reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 2.0 );\n\n vec3 reflectanceColor = mix( refraction, reflection, reflectance );\n\n out_FragColor = vec4(reflectanceColor,1.0);\n\n }\n "},e.prototype.getVS=function(){return" in vec3 normal;in vec2 st;in float batchId; out vec3 v_normalEC;uniform mat4 u_modelViewMatrix;uniform mat4 u_invWorldViewMatrix;uniform int u_clampToGroud;uniform vec3 u_camPos;uniform vec3 u_scale;out vec3 vToEye;out vec2 vUv;out vec4 vCoord;void main(void){v_normalEC = czm_normal * normal;if (u_clampToGroud == 1){} else {vCoord = gl_Position;}vUv = st;}"},e.prototype.getFS2=function(){return"in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n \n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n out_FragColor.a = 0.5;\n #endif\n }\n "},v.prototype.updateDegreesPosition=function(e,t){null==this.primitive||(this._viewer.scene.primitives.remove(this.primitive),e&&e.length<3)||(e=this._createGeometry(e,t||0),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({allowPicking:!1,geometryInstances:new g.GeometryInstance({geometry:e}),appearance:this._appearance,asynchronous:!1})))},g.Scene.WaterPrimitive=e},_installTexturePrimitive:function(){function e(e){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=e.url,this._cartesians=e.cartesians,this._id=e.id||""}e.prototype.build=function(){for(var e=[],t=0;t<this._cartesians.length;t++)e.push(this._cartesians[t].x),e.push(this._cartesians[t].y),e.push(this._cartesians[t].z);this._positionArr=new Float32Array(e),this._sts=new Uint8Array([0,0,1,0,1,1,0,1]),this._indiceArr=new Uint16Array([0,1,2,0,2,3]),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createGeometry=function(){var e=new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new g.Geometry({attributes:{position:new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:e},indices:this._indices,primitiveType:g.PrimitiveType.TRIANGLES,boundingSphere:g.BoundingSphere.fromVertices(positions)})},e.prototype._createAppearence=function(){return new g.Appearance({material:new g.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:g.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},e.prototype.getVS=function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},e.prototype.getFS=function(){return"in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},e.prototype.getMS=function(){return"czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},g.Scene.TexturePrimitive=e},_installProbingPrimitive:function(){var t={color:new g.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:g.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},i=this._viewer;function e(e){this._viewer=i,this._length=e.length||t.length,this._center=e.center||t.center,this._color=e.color||t.color,this._repeat=e.repeat||t.repeat,this._offset=e.offset||t.offset,this._thickness=e.thickness||t.thickness,this._bottom=e.bottom||t.bottom,this._top=e.top||t.top,this._radar=void 0,this.build()}e.prototype.build=function(){var e=new g.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:g.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),e=new g.GeometryInstance({geometry:e,modelMatrix:this.getModelMatrix()}),t=new g.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:[e],appearance:t})),this._viewer.scene.preUpdate.addEventListener(function(){var e=i._radar.appearance.material.uniforms.offset;1<(e-=.001)&&(e=0),i._radar.appearance.material.uniforms.offset=e})},e.prototype.getModelMatrix=function(){return g.Matrix4.multiplyByTranslation(g.Transforms.eastNorthUpToFixedFrame(this._center),new g.Cartesian3(0,0,.5*this._length),new g.Matrix4)},e.prototype.updateModelMatrix=function(){},e.prototype.getMaterial=function(){return new g.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:"uniform vec4 color; \n uniform float repeat; \n uniform float offset; \n uniform float thickness;\n\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m); \n\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n return material;\n }"},translucent:!1})},e.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},g.Scene.ProbingPrimitive=e},_initCustomPrimitive:function(e){let u=g;function t({img:e,center:t,height1:i=0,height2:n=3e5,scale:o=.003}){this.drawCommand=null,this._texture=null,this._image=null,this.img=e,this.center=t,this.height1=i,this.height2=n,this.scale=o}return t.prototype.update=function(e){null===this.drawCommand&&this.createDrawCommand(e.context),null===this._texture&&this.createTexture(e.context),e.commandList.push(this.drawCommand)},t.prototype.isDestroyed=function(){return!1},t.prototype.createTexture=function(e){null===this._image&&(this._image=new Image,this._image.src=this.img||"static/data/images/Textures/beautiful.jpg",this._image.onload=()=>{this._texture=new u.Texture({context:e,source:this._image})})},t.prototype.createDrawCommand=function(e){var t=this.createPyramidGeometry(),i=u.VertexArray.fromGeometry({context:e,geometry:t,attributeLocations:u.GeometryPipeline.createAttributeLocations(t)}),t=u.ShaderProgram.fromCache({context:e,vertexShaderSource:"in vec3 position3DHigh;\nin vec3 position3DLow;\nin float batchId;\nin vec3 position;\nin vec2 st;\nout vec2 v_st;\nuniform vec3 v1;\nuniform vec3 v2;\n\n// 罗德里格旋转公式\nmat4 RodriguesRotation(vec3 v1, vec3 v2, float theta) {\n\n vec3 _p = v2 - v1;\n vec3 p = normalize(_p);\n\n float x = p.x;\n float y = p.y;\n float z = p.z;\n\n float xy = x * y;\n float xx = x * x;\n float xz = x * z;\n float yy = y * y;\n float yz = y * z;\n float zz = z * z;\n\n float sintheta = sin(radians(theta));\n float costheta = cos(radians(theta));\n\n float _m00 = costheta + xx * (1.0 - costheta);\n float _m01 = z * sintheta + xy * (1.0 - costheta);\n float _m02 = -y * sintheta + xz * (1.0 - costheta);\n float _m03 = 0.0;\n float _m10 = -z * sintheta + xy * (1.0 - costheta);\n float _m11 = costheta + yy * (1.0 - costheta);\n float _m12 = x * sintheta + yz * (1.0 - costheta);\n float _m13 = 0.0;\n float _m20 = y * sintheta + xz * (1.0 - costheta);\n float _m21 = -x * sintheta + yz * (1.0 - costheta);\n float _m22 = costheta + zz * (1.0 - costheta);\n float _m23 = 0.0;\n\n return mat4(_m00, _m01, _m02, _m03, _m10, _m11, _m12, _m13, _m20, _m21, _m22,\n _m23, 0, 0, 0, 1.0);\n}\n\nvoid main() {\n float ty = abs(cos(czm_frameNumber / 60.0)) * 0.3;\n mat4 translateY = mat4(1, 0, 0, 0, 0, 1, 0, ty, 0, 0, 1, 0, 0, 0, 0, 1);\n mat4 roatateAxis = RodriguesRotation(v1, v2, czm_frameNumber);\n //vec4 roatePosition = roatateAxis * vec4(position, 1.0);\n vec4 roatePosition = vec4(position, 1.0);\n v_st = st;\n gl_Position = czm_projection * czm_modelView * roatePosition * translateY;\n}",fragmentShaderSource:"in vec2 v_st;\nuniform sampler2D wenli;\nuniform vec2 iResolution;\nvoid main() {\n vec2 uv = gl_FragCoord.xy / iResolution.xy;\n float r = 0.01;\n // 使用length 实现圆弧光带\n uv.x *= iResolution.x / iResolution.y;\n float d = length(uv);\n r = abs(sin(r * czm_frameNumber) * iResolution.x / iResolution.y);\n vec4 wenli = texture(wenli, v_st);\n vec4 centerColor = vec4(0.0, 255.0, 0.0, 1.0);\n float ratio =\n smoothstep(r, r + 0.02, d) - smoothstep(r + 0.0029, r + 0.06, d);\n vec4 mixColor = vec4(mix(vec4(ratio), centerColor, ratio));\n out_FragColor = vec4(mix(wenli, mixColor, ratio));\n}\n",attributeLocations:u.GeometryPipeline.createAttributeLocations(t)});let n=new u.Cartesian2(e.canvas.width,e.canvas.height),o={v1:()=>this.v1,v2:()=>this.v2,wenli:()=>null!==this._texture?this._texture:e.defaultTexture,iResolution:()=>n},r=u.RenderState.fromCache();this.drawCommand=new u.DrawCommand({vertexArray:i,shaderProgram:t,uniformMap:o,renderState:r,pass:u.Pass.OPAQUE})},t.prototype.createPyramidGeometry=function(){let e=this.height1,i=this.height2,t=this.scale,n=this.center||[104.057605,30.607196],o=h(n,[-t,t]),r=h(n,[t,t]),a=h(n,[-t,-t]),s=h(n,[t,t]),l=[];function c(e,t=i){e=u.Cartesian3.fromDegrees(...e,t);return[e.x,e.y,e.z]}function h(e,t){return[t[0]+e[0],t[1]+e[1]]}return l.push(...c(n,e),...c(o),...c(r),...c(a),...c(s)),this.v1=new u.Cartesian3(...c(n,e)),this.v2=new u.Cartesian3(...c(n,i)),new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:u.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(l)}),st:new u.GeometryAttribute({componentDatatype:u.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array([.5,.5,0,1,1,1,0,0,1,0])})},indices:[0,1,3,0,1,2,0,2,4,0,3,4,1,2,3,2,3,4],boundingSphere:u.BoundingSphere.fromVertices(l)})},new t(e)},customPrimivive(e){return this._initCustomPrimitive(e)}};let y=null;class _{constructor(e,t){y=t,this._viewer=e,this._labelEntity=null,this.$graphics=new s(e,t),this.isInit=!1}initTool(){this.isInit||(this._labelEntity=this._viewer.entities.add({position:y.Cartesian3.fromDegrees(0,0),label:this.$graphics.getLabelGraphics({l_text:"操作提示",l_fillColor:y.Color.CYAN,l_outlineColor:y.Color.BLACK})}),this._labelEntity.show=!1,this.isInit=!0)}setVisible(e){this.isInit&&(this._labelEntity.show=!!e)}showAt(e,t){this.isInit&&e&&t&&(this._labelEntity.show=!0,(e=this._viewer.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid))?(this._labelEntity.position=e,this._labelEntity.show=!0,this._labelEntity.label.text=t):this._labelEntity.show=!1)}showAtCartesian(e,t){this.isInit&&e&&t&&(this._labelEntity.show=!0,this._labelEntity.position=e,this._labelEntity.show=!0,this._labelEntity.label.text=t)}}let w=null,C=null;function P(e,t,i){e&&(w=t,this._drawLayer=new w.CustomDataSource("drawLayer"),s.prototype={...s.prototype,...p.prototype},this.$graphics=new s(e,t),e&&e.dataSources.add(this._drawLayer),this.tooltip=new _(e,t),this.tooltip.initTool())}P.prototype={drawPointGraphics:function(t){var i,n,e,o,r,a;(t=t||{}).style=t.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:!0,scale:1,pixelOffset:new w.Cartesian2(0,-20)},this._viewer&&t&&(e=new w.Entity,o=[],r=this,a=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas),(C=a).setInputAction(function(e){e=r.getCatesian3FromPX(e.position);r.tooltip.showAtCartesian(e,"右键单击结束!"),e&&e.x&&(i=e,o.push(e))},w.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){e=r.getCatesian3FromPX(e.endPosition);e&&e.x&&(i=e,(o=[]).push(e)),a.destroy(),a=null,r.tooltip.setVisible(!1),"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(o),n)},w.ScreenSpaceEventType.RIGHT_CLICK),e.billboard=t.style,e.position=new w.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(e))},drawLineGraphics:function(t){if(t=t||{},this._viewer&&t){var i,n=[],e=new w.Entity,o=this,r=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);(C=r).setInputAction(function(e){e=o.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length&&n.push(e.clone()),t.measure&&a(e),2==n.length&&"straightLine"===t.type&&(r.destroy(),r=null,"function"==typeof t.callback)&&t.callback(o.transformCartesianArrayToWGS84Array(n),i),n.push(e))},w.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){e=o.getCatesian3FromPX(e.endPosition);o.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.length&&e&&e.x&&(n.pop(),n.push(e))},w.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(e){o.tooltip.setVisible(!1),r.destroy(),r=null;e=o.getCatesian3FromPX(e.position);t.measure&&a(e),"function"==typeof t.callback&&t.callback(o.transformCartesianArrayToWGS84Array(n),i)},w.ScreenSpaceEventType.RIGHT_CLICK),e.polyline={width:t.width||5,material:t.material||w.Color.BLUE.withAlpha(.8),clampToGround:t.clampToGround||!1,clampToS3M:t.clampToS3M||!1},e.polyline.positions=new w.CallbackProperty(function(){return n},!1),i=this._drawLayer.entities.add(e);const a=function(e){var t=new w.Entity;t.position=e,t.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},t.label={text:(o.getPositionDistance(o.transformCartesianArrayToWGS84Array(n))/1e3).toFixed(4)+"公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-80)},o._drawLayer.entities.add(t)}}},drawPolygonGraphics:function(i){i=i||{};const t={width:3,material:w.Color.BLUE.withAlpha(.8),clampToGround:!0};if(i.style?i.style=Object.assign({},t,i.style):i.style=t,this._viewer&&i){var n=[],o=new w.PolygonHierarchy,r=new w.Entity,a=this,s=null,l=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);C=l;const t=function(){r.polyline=i.style,r.polyline.positions=new w.CallbackProperty(function(){return n},!1),r.polygon={hierarchy:new w.CallbackProperty(function(){return o},!1),material:w.Color.WHITE.withAlpha(.1),clampToGround:a._objHasOwnProperty(i,"clampToGround",!1)},r.clampToS3M=!0,s=a._drawLayer.entities.add(r)};l.setInputAction(function(e){e=a.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length&&(o.positions.push(e.clone()),n.push(e.clone())),n.push(e.clone()),o.positions.push(e.clone()),s||t())},w.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(e){e=a.getCatesian3FromPX(e.endPosition);a.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.length&&e&&e.x&&(n.pop(),n.push(e),o.positions.pop(),o.positions.push(e))},w.ScreenSpaceEventType.MOUSE_MOVE),l.setInputAction(function(){var e,t;l.destroy(),a.tooltip.setVisible(!1),n.push(n[0]),i.height&&(r.polygon.extrudedHeight=i.height,r.polygon.material=w.Color.BLUE.withAlpha(.5)),i.measure&&(e=n[0],(t=new w.Entity).position=e,t.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},t.label={text:(a.getPositionsArea(a.transformCartesianArrayToWGS84Array(n))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-50)},a._drawLayer.entities.add(t)),"function"==typeof i.callback&&i.callback(a.transformCartesianArrayToWGS84Array(n),s)},w.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(t){var i,n,e,o,r,a;(t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t&&(n=[],e=new w.Entity,o=new w.Rectangle,r=this,a=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas),(C=a).setInputAction(function(e){e=r.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length?n.push(e.clone()):(a.destroy(),n.push(e.clone()),o=w.Rectangle.fromCartesianArray([...n,e],w.Ellipsoid.WGS84),"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(n),i)))},w.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){e=r.getCatesian3FromPX(e.endPosition);e&&(o=w.Rectangle.fromCartesianArray([...n,e],w.Ellipsoid.WGS84))},w.ScreenSpaceEventType.MOUSE_MOVE),e.rectangle=t.style,t.height&&(e.rectangle.extrudedHeight=t.height),e.rectangle.coordinates=new w.CallbackProperty(function(){return o},!1),i=this._drawLayer.entities.add(e))},drawCircleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var i,n=void 0,o=new w.Entity,r=this,a=1,s=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);C=s;const l=function(e,t){var e=w.Cartographic.fromCartesian(e),t=w.Cartographic.fromCartesian(t),i=new w.EllipsoidGeodesic,i=(i.setEndPoints(e,t),i.surfaceDistance);a=Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2))};s.setInputAction(function(e){e=r.getCatesian3FromPX(e.position);r.tooltip.showAtCartesian(e,"左键单击结束!"),e&&e.x&&(n?(l(n,e),r.tooltip.setVisible(!1),s.destroy(),"function"==typeof t.callback&&t.callback({center:n,radius:a},i)):(n=e,o.ellipse=t.style,o.ellipse.semiMajorAxis=new w.CallbackProperty(function(){return a},!1),o.ellipse.semiMinorAxis=new w.CallbackProperty(function(){return a},!1),o.position=new w.CallbackProperty(function(){return n},!1),o.point={pixelSize:5,outlineColor:w.Color.RED,outlineWidth:3},t.height&&(o.ellipse.extrudedHeight=t.height),i=r._drawLayer.entities.add(o)))},w.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(e){e=r._viewer.scene.camera.pickEllipsoid(e.endPosition,r._viewer.scene.globe.ellipsoid);n&&e&&e.x&&l(n,e)},w.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5)},this._viewer&&t){var i=new w.Entity,n=new w.Entity,o=new w.Entity,r=[],a=[],s=[],l=this,c=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);C=c;c.setInputAction(function(e){e=l.getCatesian3FromPX(e.position);if(!e)return!1;0==r.length?(r.push(e.clone()),r.push(e.clone()),a.push(e.clone()),a.push(e.clone())):(c.destroy(),"function"==typeof t.callback&&t.callback({e:i,e2:n,e3:o}))},w.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){var t,i,e=l.getCatesian3FromPX(e.endPosition);e&&0<r.length&&(r.pop(),r.push(e.clone()),t=r,i=w.Cartographic.fromCartesian(t[0]),t=w.Cartographic.fromCartesian(t[1]),i=w.Cartesian3.fromDegrees(w.Math.toDegrees(i.longitude),w.Math.toDegrees(i.latitude),t.height),a.pop(),a.push(i.clone()),s.pop(),s.pop(),s.push(e.clone()),s.push(i.clone()))},w.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new w.CallbackProperty(function(){return r},!1),...t.style},i.position=new w.CallbackProperty(function(){return r[0]},!1),i.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:new w.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(r))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(50,-100)},n.polyline={positions:new w.CallbackProperty(function(){return a},!1),...t.style},n.position=new w.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},n.label={text:new w.CallbackProperty(function(){return"高度:"+(t=a[1],!(e=a[0])&&!t||w.Cartesian3.equals(e,t)?0:(e=w.Cartographic.fromCartesian(e),(w.Cartographic.fromCartesian(t).height-e.height).toFixed(2)))+"米";var e,t},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,100)},o.polyline={positions:new w.CallbackProperty(function(){return s},!1),...t.style},o.position=new w.CallbackProperty(function(){return r[1]},!1),o.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},o.label={text:new w.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-150,-20)},this._drawLayer.entities.add(o),this._drawLayer.entities.add(n),this._drawLayer.entities.add(i)}},drawWallGraphics:function(a){a=a||{};var s,e={material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE};a.style?a.style=Object.assign({},e,a.style):a.style=e,this._viewer&&a&&(s=this).drawPolygonGraphics({clampToGround:s._objHasOwnProperty(a.style,"clampToGround",!0),style:{material:a.style.material},callback:function(e,t){var i=s.transformWGS84ArrayToCartesianArray(e),n=[],o=[];if(a.style.maximumHeights){let e=0;for(;e<i.length;)n.push(a.style.maximumHeights[e%2]),e++;a.style.maximumHeights=n}if(a.style.minimumHeights){let e=0;for(;e<i.length;)o.push(a.style.minimumHeights[e%2]),e++;a.style.minimumHeights=o}var r=s._drawLayer.entities.add({wall:{positions:i,...a.style}});"function"==typeof a.callback&&a.callback(e,r)}})},drawEllipsoidGraphics:function(n){var o;(n=n||{}).style=n.style||{},this._viewer&&n&&(o=this).drawCircleGraphics({callback:function(e,t){var i=o.createGraphics(),t=(i.ellipsoid=o.$graphics.getEllipsoidGraphics({radii:e.radius}),i.position=e.center,o._drawLayer.entities.remove(t),o._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback({center:e.center,radius:e.radius},t)}})},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,drawCylinderGraphics:function(n){var o;(n=n||{}).style=n.style||{},this._viewer&&n&&(o=this).drawCircleGraphics({callback:function(e,t){var i=o._drawLayer.entities.add({position:e.center,cylinder:{length:2*e.radius||n.length,topRadius:n.topRadius||e.radius,bottomRadius:n.bottomRadius||e.radius,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE}});o._drawLayer.entities.remove(t),"function"==typeof n.callback&&n.callback({center:e.center,radius:e.radius},i)}})},drawCorridorGraphics:function(n){var o;(n=n||{}).style=n.style||{},this._viewer&&n&&(o=this).drawLineGraphics({callback:function(e,t){var i=o.createGraphics(),t=(i.corridor={positions:o.transformWGS84ArrayToCartesianArray(e),height:n.height||1,width:n.width||100,cornerType:w.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},o._drawLayer.entities.remove(t),o._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback(e,t)}})},drawPolylineVolumeGraphics:function(o){(o=o||{}).style=o.style||{};const r=o.circleRadius||20,a=o.arms||7,s=o.rOuter||150,l=o.rInner||75;var c;this._viewer&&o&&(c=this).drawLineGraphics({callback:function(e,t){var i=c.createGraphics(),n="fivePoint"===o.shape?c.computeStar2d(a,s,l):c.computeCircleShap(r),n=(i.polylineVolume={positions:c.transformWGS84ArrayToCartesianArray(e),shape:n,cornerType:w.CornerType.MITERED,material:o.color||w.Color.RED},c._drawLayer.entities.remove(t),c._drawLayer.entities.add(i));"function"==typeof o.callback&&o.callback(e,n)}})},removeAll(){this._drawLayer.entities.removeAll()},removeEventHandler(){C&&!C.isDestroyed()&&(C.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),C.removeInputAction(w.ScreenSpaceEventType.RIGHT_CLICK),C.removeInputAction(w.ScreenSpaceEventType.LEFT_CLICK))}};let x={};function S(e,t){e&&(this._viewer=e,x=t)}S.prototype={mathDistance2d:function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},getCirclePoints2d:function(e,t,i,n){for(var o=[],r=Math.PI/180*Math.round(360/n),a=0;a<n;a++){var s=t+e*Math.sin(r*a),l=i+e*Math.cos(r*a);o.unshift({x:s,y:l})}return o},wholeDistance2d:function(i){let n=0;return i&&Array.isArray(i)&&0<i.length&&i.forEach((e,t)=>{t<i.length-1&&(n+=this.mathDistance2d(e,i[t+1]))}),n},getBaseLength2d:function(e){return Math.pow(this.wholeDistance2d(e),.99)},computeStar2d(e,t,i){for(var n=Math.PI/e,o=2*e,r=new Array(o),a=0;a<o;a++){var s=a%2==0?t:i;r[a]=new x.Cartesian2(Math.cos(a*n)*s,Math.sin(a*n)*s)}return r},computeCircleShap(t){var i=[];for(let e=0;e<360;e++){var n=x.Math.toRadians(e);i.push(new x.Cartesian2(t*Math.cos(n),t*Math.sin(n)))}return i},mid2d:function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},getCircleCenterOfThreePoints2d:function(e,t,i){var n=[(e[0]+t[0])/2,(e[1]+t[1])/2],t=[n[0]-e[1]+t[1],n[1]+e[0]-t[0]],o=[(e[0]+i[0])/2,(e[1]+i[1])/2],e=[o[0]-e[1]+i[1],o[1]+e[0]-i[0]];return this.getIntersectPoint2d(n,t,o,e)},getIntersectPoint2d:function(e,t,i,n){return e[1]===t[1]?[(n[0]-i[0])/(n[1]-i[1])*(e[1]-i[1])+i[0],e[1]]:i[1]===n[1]?[(t[0]-e[0])/(t[1]-e[1])*(i[1]-e[1])+e[0],i[1]]:(t=(t[0]-e[0])/(t[1]-e[1]),n=(n[0]-i[0])/(n[1]-i[1]),[t*(i=(t*e[1]-e[0]-n*i[1]+i[0])/(t-n))-t*e[1]+e[0],i])},getAzimuth2d:function(e,t){let i,n=Math.asin(Math.abs(t[1]-e[1])/this.mathDistance2d(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=n+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=2*Math.PI-n:t[1]<e[1]&&t[0]<e[0]?i=n:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-n),i},getAngleOfThreePoints2d:function(e,t,i){e=this.getAzimuth2d(t,e)-this.getAzimuth2d(t,i);return e<0?e+2*Math.PI:e},isClockWise2d:function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},getPointOnLine2d:function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},getCubicValue2d:function(e,t,i,n,o){var[r,a]=[1-(e=Math.max(Math.min(e,1),0)),e*e],s=a*e,l=r*r,c=l*r;return[c*t[0]+3*l*e*i[0]+3*r*a*n[0]+s*o[0],c*t[1]+3*l*e*i[1]+3*r*a*n[1]+s*o[1]]},getThirdPoint2d:function(e,t,i,n,o){e=this.getAzimuth2d(e,t),o=o?e+i:e-i,e=n*Math.cos(o),i=n*Math.sin(o);return[t[0]+e,t[1]+i]},inherits2d:function(e,o){function t(){}t.prototype=o.prototype,e.superClass_=o.prototype,e.prototype=new t,(e.prototype.constructor=e).base=function(e,t,i){var n=Array.prototype.slice.call(arguments,2);return o.prototype[t].apply(e,n)}},getArcPoints2d:function(t,i,n,e){var[o,r,a,s]=[null,null,[],e-n],s=s<0?s+2*Math.PI:s;for(let e=0;e<=100;e++){var l=n+s*e/100,o=t[0]+i*Math.cos(l),r=t[1]+i*Math.sin(l);a.push([o,r])}return a},getBisectorNormals2d:function(e,t,i,n){let o=this.getNormal2d(t,i,n),[r,a,s,l,c]=[null,null,null,null,null],h=Math.sqrt(o[0]*o[0]+o[1]*o[1]),u=o[0]/h,d=o[1]/h,p=this.mathDistance2d(t,i),m=this.mathDistance2d(i,n);return a=(c=1e-4<h?this.isClockWise(t,i,n)?(s=e*p,l=i[0]-s*d,c=i[1]+s*u,r=[l,c],s=e*m,l=i[0]+s*d,i[1]-s*u):(s=e*p,l=i[0]+s*d,c=i[1]-s*u,r=[l,c],s=e*m,l=i[0]-s*d,i[1]+s*u):(l=i[0]+e*(t[0]-i[0]),c=i[1]+e*(t[1]-i[1]),r=[l,c],l=i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])),[l,c]),[r,a]},getNormal2d:function(e,t,i){var n=e[0]-t[0],e=e[1]-t[1],o=Math.sqrt(n*n+e*e),o=(n/=o,e/=o,i[0]-t[0]),i=i[1]-t[1],t=Math.sqrt(o*o+i*i);return[n+(o/=t),e+(i/=t)]},getLeftMostControlPoint2d:function(e,t){let[i,n,o,r,a]=[e[0],e[1],e[2],null,null],s=this.getBisectorNormals2d(0,i,n,o)[0],l=this.getNormal2d(i,n,o);var c,h,u,d,p;return a=1e-4<Math.sqrt(l[0]*l[0]+l[1]*l[1])?(e=this.mid2d(i,n),u=i[0]-e[0],c=i[1]-e[1],u=2*(c=-(h=2/this.mathDistance2d(i,n))*c)*(h=h*u),d=s[0]-e[0],p=s[1]-e[1],r=e[0]+(c*c-h*h)*d+u*p,e[1]+u*d+(h*h-c*c)*p):(r=i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])),[r,a]},getRightMostControlPoint2d:function(e,t){let i=e.length,n=e[i-3],o=e[i-2],r=e[i-1],a=this.getBisectorNormals2d(0,n,o,r)[1],s=this.getNormal2d(n,o,r),l=Math.sqrt(s[0]*s[0]+s[1]*s[1]),[c,h]=[null,null];var u,d,p,m,g;return h=1e-4<l?(e=this.mid2d(o,r),p=r[0]-e[0],u=r[1]-e[1],p=2*(u=-(d=2/this.mathDistance2d(o,r))*u)*(d=d*p),m=a[0]-e[0],g=a[1]-e[1],c=e[0]+(u*u-d*d)*m+p*g,e[1]+p*m+(d*d-u*u)*g):(c=r[0]+t*(o[0]-r[0]),r[1]+t*(o[1]-r[1])),[c,h]},getCurvePoints2d:function(t,i){let e=this.getLeftMostControlPoint2d(i,t),[n,o,r,a,s]=[null,null,null,[e],[]];for(let e=0;e<i.length-2;e++){[n,o,r]=[i[e],i[e+1],i[e+2]];var l=this.getBisectorNormals2d(t,n,o,r);a=a.concat(l)}var c=this.getRightMostControlPoint2d(i,t);c&&a.push(c);for(let t=0;t<i.length-1;t++){n=i[t],o=i[t+1],s.push(n);for(let e=0;e<100;e++){var h=this.getCubicValue2d(e/100,n,a[2*t],a[2*t+1],o);s.push(h)}s.push(o)}return s},getBezierPoints2d:function(o){if(o.length<=2)return o;var e=[],r=o.length-1;for(let n=0;n<=1;n+=.01){let[t,i]=[0,0];for(let e=0;e<=r;e++){var a=this.getBinomialFactor2d(r,e),s=Math.pow(n,e),l=Math.pow(1-n,r-e);t+=a*s*l*o[e][0],i+=a*s*l*o[e][1]}e.push([t,i])}return e.push(o[r]),e},getFactorial2d:function(t){let i=1;switch(t){case t<=1:i=1;break;case 2===t:i=2;break;case 3===t:i=6;break;case 24===t:i=24;break;case 5===t:i=120;break;default:for(let e=1;e<=t;e++)i*=e}return i},getBinomialFactor2d:function(e,t){return this.getFactorial2d(e)/(this.getFactorial2d(t)*this.getFactorial2d(e-t))},getQBSplinePoints2d:function(r){if(r.length<=2)return r;var[a,e]=[2,[]],t=r.length-a-1;e.push(r[0]);for(let o=0;o<=t;o++)for(let n=0;n<=1;n+=.05){let[t,i]=[0,0];for(let e=0;e<=a;e++){var s=this.getQuadricBSplineFactor2d(e,n);t+=s*r[o+e][0],i+=s*r[o+e][1]}e.push([t,i])}return e.push(r[r.length-1]),e},getQuadricBSplineFactor2d:function(e,t){let i=0;return 0===e?i=Math.pow(t-1,2)/2:1===e?i=(-2*Math.pow(t,2)+2*t+1)/2:2===e&&(i=Math.pow(t,2)/2),i}};let b=null;function M(e,t){e&&(this._viewer=e,s.prototype={...s.prototype,...p.prototype},this.$graphics=new s(e,t),b=t)}M.prototype={setCircleScanEffect:function(e){var t,i,n,o,r,a,s,l,c,h,u;if(e&&e.position)return t=e.id||"CircleScan"+parseInt(1e3*Math.random()),l=e.position,i=e.radius,n=e.color||b.Color.RED,o=e.duration||1500,r=this,a=e.circleMode||"CircleScan",e=e.border||4,u=l,s=new b.Cartesian4(u.x,u.y,u.z,1),u=this.transformCartesianToWGS84(l),l=this.transformWGS84ToCartesian({lng:u.lng,lat:u.lat,alt:u.alt+500}),c=new b.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),u=new b.PostProcessStage({name:t,fragmentShader:this._getCircleScanShader({get:!0,border:e}),uniforms:{u_scanCenterEC:function(){return b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new b.Cartesian4)},u_scanPlaneNormalEC:function(){var e=b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new b.Cartesian4),t=b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,c,new b.Cartesian4),i=new b.Cartesian3;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,b.Cartesian3.normalize(i,i),i},u_radius:function(){return"CircleScan"==a?i*(((new Date).getTime()-h)%o)/o:i},u_scanColor:n}}),this._viewer.scene.postProcessStages.add(u),u},setRadarScanEffect:function(e){var t,i,n,o,r,a,s,l,c,h,u,d,p,m,g,f,y,v,_;if(e&&e.position)return t=e.id||"radarScan"+parseInt(1e3*Math.random()),c=e.position,i=e.radius,n=e.color||b.Color.RED,o=e.duration||1500,r=this,a=e.border||1,e=e.width||3,_=c,s=new b.Cartesian4(_.x,_.y,_.z,1),_=this.transformCartesianToWGS84(c),c=this.transformWGS84ToCartesian({lng:_.lng,lat:_.lat,alt:_.alt+500}),l=new b.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:_.lng+.001,lat:_.lat,alt:_.alt}),h=new b.Cartesian4(c.x,c.y,c.z,1),u=(new Date).getTime(),d=new b.Quaternion,p=new b.Matrix3,m=new b.Cartesian4,g=new b.Cartesian4,f=new b.Cartesian4,y=new b.Cartesian3,v=new b.Cartesian3,_=new b.PostProcessStage({name:t,fragmentShader:this._getRadarScanShader({border:a,width:e,get:!0}),uniforms:{u_scanCenterEC:function(){return b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,m)},u_scanPlaneNormalEC:function(){var e=b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,m),t=b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,g);return y.x=t.x-e.x,y.y=t.y-e.y,y.z=t.z-e.z,b.Cartesian3.normalize(y,y),y},u_scanLineNormalEC:function(){var e=b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,m),t=b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,g),i=b.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,h,f),t=(y.x=t.x-e.x,y.y=t.y-e.y,y.z=t.z-e.z,b.Cartesian3.normalize(y,y),v.x=i.x-e.x,v.y=i.y-e.y,v.z=i.z-e.z,((new Date).getTime()-u)%o/o);return b.Quaternion.fromAxisAngle(y,t*b.Math.PI*2,d),b.Matrix3.fromQuaternion(d,p),b.Matrix3.multiplyByVector(p,v,v),b.Cartesian3.normalize(v,v),v},u_radius:i,u_scanColor:n}}),this._viewer.scene.postProcessStages.add(_),_},satelliteScan:function(e){var t,i,n,o,r,a,s,l,c,h,u,d;if(e&&e.position)return t=b.Cartesian3,i=b.GeometryInstance,n=b.Primitive,o=b.MaterialAppearance,r=b.Material,a=b.Color,s=b.Matrix4,h=b.Transforms,o=b.MaterialAppearance,l=b.CylinderGeometry,u=e.position||[116.39,39.9],c=e.length||4e4,u=t.fromDegrees(u[0],u[1]),h=s.multiplyByTranslation(h.eastNorthUpToFixedFrame(u),new t(0,0,.5*c),new s),u=new i({geometry:new l({length:c,topRadius:0,bottomRadius:.5*c,vertexFormat:o.MaterialSupport.TEXTURED.vertexFormat}),modelMatrix:h}),d=this._viewer.scene.primitives.add(new n({geometryInstances:u,appearance:new o({material:new r({fabric:{uniforms:{color:e.color||new a(.2,1,0,1),repeat:e.repeat||30,offset:0,thickness:e.thickness||.2},source:"\n uniform vec4 color;\n uniform float repeat;\n uniform float offset;\n uniform float thickness;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m);\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n vec3 normalMC = material.normal;\n if(normalMC.y < 0.0 && normalMC.z < 0.0)\n { \n discard;\n }\n return material;\n }"},translucent:!0}),faceForward:!1,closed:!0,vertexShaderSource:"\n in vec3 position3DHigh;\n in vec3 position3DLow;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n void main()\n {\n vec4 p = czm_computePosition();\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = normal; // normal in world coordinates\n v_st = st;\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n }"})})),this._viewer.scene.preUpdate.addEventListener(function(){var e=d.appearance.material.uniforms.offset;1<(e-=.001)&&(e=0),d.appearance.material.uniforms.offset=e}),d},lighitCentrumScanEffect:function(t){var i=this.createLightScan_getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),n=this.createLightScan_entityCList(this._viewer,i,t);for(let e=0;e<n.length;e++)e!==n.length-1?this.createLightScan_changeOnePosition(t,n[e],[i[e].x,i[e].y,i[e+1].x,i[e+1].y]):this.createLightScan_changeOnePosition(t,n[e],[i[e].x,i[e].y,i[0].x,i[0].y]);return n},createLightScan_getCirclePoints:function(e,t,i,n){let o=[],r=Math.PI/180*Math.round(360/n),a=0;for(;a<n;a++){var s=t+e*Math.sin(r*a),l=i+e*Math.cos(r*a);o.unshift({x:s,y:l})}return o},createLightScan_changeOnePosition:function(t,e,i){const n=t.positionList;let o,r,a,s,l,c,h=0,u=0;function d(e){o=n[e+1][0]-n[e][0],r=n[e+1][1]-n[e][1],a=o/t.number,s=r/t.number,u=0}d(h),e.polygon.hierarchy=new b.CallbackProperty(function(){return Math.abs(l)>=Math.abs(o)&&Math.abs(c)>=Math.abs(r)&&((h+=1)===n.length-1&&(h=0),i[0]=i[0]+l,i[1]=i[1]+c,i[2]=i[2]+l,i[3]=i[3]+c,d(h)),l=u*a,c=u*s,u++,new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+l,i[1]+c,0,i[2]+l,i[3]+c,0]))},!1)},createLightScan_entityCList:function(t,i,n){var o=n.observer[0],r=n.observer[1],a=n.observer[2],s=[];for(let e=0;e<i.length;e++){var l=e===i.length-1?new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights([o,r,a,i[e].x,i[e].y,0,i[0].x,i[0].y,0])):new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights([o,r,a,i[e].x,i[e].y,0,i[e+1].x,i[e+1].y,0])),l=t.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:n.material}});s.push(l)}return s},createFireParticleSystem(e){var t,i,n,o,r,a,s,l,c,h,u,d;if(e&&e.position)return{fireImage:e,startScale:t,endScale:i,minimumParticleLife:n,maximumParticleLife:o,minimumSpeed:r,maximumSpeed:a,particleSize:s,emissionRate:l,position:c,startColor:h,endColor:u,emitter:d}=Object.assign({},{fireImage:"static/data/images/file/fire.png",startScale:3,endScale:1.5,minimumParticleLife:1.5,maximumParticleLife:1.8,minimumSpeed:7,maximumSpeed:9,particleSize:2,emissionRate:200,startColor:new b.Color(1,1,1,1),endColor:new b.Color(.5,0,0,0),emitter:new b.ConeEmitter(b.Math.toRadians(45))},e),new b.ParticleSystem({image:e,startScale:t,endScale:i,minimumParticleLife:n,maximumParticleLife:o,minimumSpeed:r,maximumSpeed:a,emissionRate:l,startColor:h,endColor:u,emitter:d,imageSize:new b.Cartesian2(s,s),lifetime:16,loop:!0,sizeInMeters:!0,modelMatrix:b.Transforms.eastNorthUpToFixedFrame(c)})}};const T="uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nuniform vec4 u_lineColor;\n\nbool inSensorShadow(vec3 coneVertexWC, vec3 inverseRadii, vec3 pointWC) {\n // Diagonal matrix from the unscaled ellipsoid space to the scaled space.\n vec3 D = inverseRadii;\n\n // Sensor vertex in the scaled ellipsoid space\n vec3 q = D * coneVertexWC;\n float qMagnitudeSquared = dot(q, q);\n float test = qMagnitudeSquared - 1.0;\n\n // Sensor vertex to fragment vector in the ellipsoid's scaled space\n vec3 temp = D * pointWC - q;\n float d = dot(temp, q);\n\n // Behind silhouette plane and inside silhouette cone\n return (d < -test) && (d / length(temp) < -sqrt(test));\n}\n\n///////////////////////////////////////////////////////////////////////////////\n\nvec4 getLineColor() { return u_lineColor; }\n\nvec4 getIntersectionColor() { return u_intersectionColor; }\n\nfloat getIntersectionWidth() { return u_intersectionWidth; }\n\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) {\n // (s, t) both in the range [0, 1]\n float t = pointMC.z / sensorRadius;\n float s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\n s = s - floor(s);\n\n return vec2(s, t);\n}",E='#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n uniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\n\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\n\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\n\nvec4 getColor(float sensorRadius, vec3 pointEC) {\n czm_materialInput materialInput;\n\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n\n czm_material material = czm_getMaterial(materialInput);\n\n return mix(\n czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),\n vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon) {\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the\n // tolerance. We also want to check if the value of an adjacent pixel is\n // within the tolerance, but we don\'t want to admit points that are obviously\n // not on the surface. For example, if we are looking for "value" to be close\n // to 0, but value is 1 and the adjacent value is 2, then the delta would be 1\n // and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels ||\n (delta < 10.0 * tolerance && temp - delta < tolerance &&\n temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\n\nvec4 shade(bool isOnBoundary) {\n if (u_showIntersection && isOnBoundary) {\n return getIntersectionColor();\n }\n if (u_type == 1.0) {\n return getLineColor();\n }\n return getColor(u_radius, v_positionEC);\n}\n\nfloat ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {\n vec3 scaled = inverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main() {\n vec3 sensorVertexWC =\n czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC =\n czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n\n // vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0, positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if (resX < cos(u_xHalfAngle) - 0.00001) {\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if (resY < cos(u_yHalfAngle) - 0.00001) {\n discard;\n }\n\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue =\n ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);\n\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid) {\n // Discard if in the ellipsoid\n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done\n // on the CPU first.\n if (ellipsoidValue < 0.0) {\n discard;\n }\n\n // Discard if in the sensor\'s shadow\n if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,\n v_positionWC)) {\n discard;\n }\n }\n\n // Notes: Each surface functions should have an associated tolerance based on\n // the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n // isOnEllipsoid = false;\n // if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81)){\n /*if(false){\n out_FragColor = vec4(1.0,0.0,0.0,1.0);\n }else{\n out_FragColor = shade(isOnEllipsoid);\n }\n*/\nout_FragColor = shade(isOnEllipsoid);\n}';let A={};function I(t){var P=(A=t).BoundingSphere,x=A.Cartesian3,i=A.Color,d=A.combine,b=A.ComponentDatatype,n=A.defaultValue,o=A.defined,S=(A.destroyObject,A.DeveloperError),M=A.Matrix4,r=A.PrimitiveType,I=A.Buffer,L=A.BufferUsage,a=A.DrawCommand,D=A.Pass,R=A.RenderState,k=A.ShaderProgram,z=A.ShaderSource,O=A.VertexArray,G=A.BlendingState,F=A.CullFace,s=A.Material,Q=A.SceneMode,B=A.VertexFormat,U=A.Math,H=A.Matrix3,V=(M=A.Matrix4,A.JulianDate),u=(A.BoxGeometry,A.EllipsoidGeometry,Math.sin),W=Math.cos,N=Math.tan,j=Math.atan,q={position:0,normal:1};function e(e){var t=this;e=n(e,n.EMPTY_OBJECT),this.show=n(e.show,!0),this.slice=n(e.slice,32),this.modelMatrix=M.clone(e.modelMatrix,new M),this._modelMatrix=new M,this._computedModelMatrix=new M,this._computedScanPlaneModelMatrix=new M,this.radius=n(e.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=n(e.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=n(e.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=n(e.lineColor,i.WHITE),this.showSectorLines=n(e.showSectorLines,!0),this.showSectorSegmentLines=n(e.showSectorSegmentLines,!0),this.showLateralSurfaces=n(e.showLateralSurfaces,!0),this.material=o(e.material)?e.material:s.fromType(s.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=o(e.lateralSurfaceMaterial)?e.lateralSurfaceMaterial:s.fromType(s.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=n(e.showDomeSurfaces,!0),this.domeSurfaceMaterial=o(e.domeSurfaceMaterial)?e.domeSurfaceMaterial:s.fromType(s.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=n(e.showDomeLines,!0),this.showIntersection=n(e.showIntersection,!0),this.intersectionColor=n(e.intersectionColor,i.WHITE),this.intersectionWidth=n(e.intersectionWidth,5),this.showThroughEllipsoid=n(e.showThroughEllipsoid,!1),this._showThroughEllipsoid=void 0,this.showScanPlane=n(e.showScanPlane,!0),this.scanPlaneColor=n(e.scanPlaneColor,i.WHITE),this.scanPlaneMode=n(e.scanPlaneMode,"horizontal"),this.scanPlaneRate=n(e.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=V.now(),this._boundingSphere=new P,this._boundingSphereWC=new P,this._sectorFrontCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new a({owner:this,primitiveType:r.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new a({owner:this,primitiveType:r.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new a({owner:this,primitiveType:r.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new a({owner:this,primitiveType:r.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 t.xHalfAngle},u_yHalfAngle:function(){return t.yHalfAngle},u_radius:function(){return t.radius},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return t._scanePlaneXHalfAngle},u_yHalfAngle:function(){return t._scanePlaneYHalfAngle},u_radius:function(){return t.radius},u_color:function(){return t.scanPlaneColor},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}}}e.prototype.update=function(e){var t,i,n,o,r=e.mode;if(this.show&&r===Q.SCENE3D){var r=!1,a=!1,s=!1,l=this.xHalfAngle,c=this.yHalfAngle;if(l<0||c<0)throw new S("halfAngle must be greater than or equal to zero.");if(0!=l&&0!=c){this._xHalfAngle===l&&this._yHalfAngle===c||(this._xHalfAngle=l,this._yHalfAngle=c,r=!0);var h=this.radius;if(h<0)throw new S("this.radius must be greater than or equal to zero.");var u,d,p,m,g=!1,h=(this._radius!==h&&(g=!0,this._radius=h,this._boundingSphere=new P(x.ZERO,this.radius)),M.equals(this.modelMatrix,this._modelMatrix)&&!g||(M.clone(this.modelMatrix,this._modelMatrix),M.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),P.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC)),this.showThroughEllipsoid),g=(this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=h,a=!0),this.material),f=(this._material!==g&&(this._material=g,s=a=!0),g.isTranslucent()),y=(this._translucent!==f&&(this._translucent=f,a=!0),this.showScanPlane&&(m=e.time,(p=V.secondsDifference(m,this._time))<0&&(this._time=V.clone(m,this._time)),m=Math.max(p%this.scanPlaneRate/this.scanPlaneRate,0),"horizontal"==this.scanPlaneMode?(p=W(u=2*c*m-c),d=N(l),p=j(p*d),this._scanePlaneXHalfAngle=p,this._scanePlaneYHalfAngle=u,A.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,Y)):(u=2*l*m-l,d=N(c),p=W(u),m=j(p*d),this._scanePlaneXHalfAngle=u,this._scanePlaneYHalfAngle=m,A.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,Y)),A.Matrix4.multiplyByMatrix3(this.modelMatrix,Y,this._computedScanPlaneModelMatrix),M.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix)),r&&(l=this,c=e.context,d=Z(p=l,l.xHalfAngle,l.yHalfAngle),u=p.xHalfAngle,p=p.yHalfAngle,m=d.zoy,d=d.zox,r=[],n=H.fromRotationY(u,Y),r.push(m.map(function(e){return H.multiplyByVector(n,e,new A.Cartesian3)})),n=H.fromRotationX(-p,Y),r.push(d.map(function(e){return H.multiplyByVector(n,e,new A.Cartesian3)}).reverse()),n=H.fromRotationY(-u,Y),r.push(m.map(function(e){return H.multiplyByVector(n,e,new A.Cartesian3)}).reverse()),n=H.fromRotationX(p,Y),r.push(d.map(function(e){return H.multiplyByVector(n,e,new A.Cartesian3)})),u=r,l.showLateralSurfaces&&(l._sectorVA=function(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,n=new Float32Array(18*i),o=0,r=0,a=t.length;r<a;r++)for(var s=t[r],l=x.normalize(x.cross(s[0],s[s.length-1],X),X),c=0,i=s.length-1;c<i;c++)n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=-l.x,n[o++]=-l.y,n[o++]=-l.z,n[o++]=s[c].x,n[o++]=s[c].y,n[o++]=s[c].z,n[o++]=-l.x,n[o++]=-l.y,n[o++]=-l.z,n[o++]=s[c+1].x,n[o++]=s[c+1].y,n[o++]=s[c+1].z,n[o++]=-l.x,n[o++]=-l.y,n[o++]=-l.z;var h=I.createVertexBuffer({context:e,typedArray:n,usage:L.STATIC_DRAW}),u=6*Float32Array.BYTES_PER_ELEMENT,h=[{index:q.position,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:u},{index:q.normal,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:u}];return new O({context:e,attributes:h})}(c,u)),l.showSectorLines&&(l._sectorLineVA=function(e,t){for(var i=new Float32Array(9*t.length),n=0,o=0,r=t.length;o<r;o++){var a=t[o];i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=a[0].x,i[n++]=a[0].y,i[n++]=a[0].z}var s=I.createVertexBuffer({context:e,typedArray:i,usage:L.STATIC_DRAW}),l=3*Float32Array.BYTES_PER_ELEMENT,s=[{index:q.position,vertexBuffer:s,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:l}];return new O({context:e,attributes:s})}(c,u)),l.showSectorSegmentLines&&(l._sectorSegmentLineVA=function(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,n=new Float32Array(9*i),o=0,r=0,a=t.length;r<a;r++)for(var s=t[r],l=0,i=s.length-1;l<i;l++)n[o++]=s[l].x,n[o++]=s[l].y,n[o++]=s[l].z,n[o++]=s[l+1].x,n[o++]=s[l+1].y,n[o++]=s[l+1].z;var c=I.createVertexBuffer({context:e,typedArray:n,usage:L.STATIC_DRAW}),h=3*Float32Array.BYTES_PER_ELEMENT,c=[{index:q.position,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:h}];return new O({context:e,attributes:c})}(c,u)),l.showDomeSurfaces&&(l._domeVA=(m=c,p=A.EllipsoidGeometry.createGeometry(new A.EllipsoidGeometry({vertexFormat:B.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),O.fromGeometry({context:m,geometry:p,attributeLocations:q,bufferUsage:L.STATIC_DRAW,interleave:!1}))),l.showDomeLines&&(l._domeLineVA=(d=c,r=A.EllipsoidOutlineGeometry.createGeometry(new A.EllipsoidOutlineGeometry({vertexFormat:B.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),O.fromGeometry({context:d,geometry:r,attributeLocations:q,bufferUsage:L.STATIC_DRAW,interleave:!1}))),l.showScanPlane)&&("horizontal"==l.scanPlaneMode?(o=Z(l,U.PI_OVER_TWO,0),l._scanPlaneVA=$(c,o.zox)):(o=Z(l,0,U.PI_OVER_TWO),l._scanPlaneVA=$(c,o.zoy))),a&&(r=this,l=h,f?(r._frontFaceRS=R.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:G.ALPHA_BLEND,cull:{enabled:!0,face:F.BACK}}),r._backFaceRS=R.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:G.ALPHA_BLEND,cull:{enabled:!0,face:F.FRONT}}),r._pickRS=R.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:G.ALPHA_BLEND})):(r._frontFaceRS=R.fromCache({depthTest:{enabled:!l},depthMask:!0}),r._pickRS=R.fromCache({depthTest:{enabled:!0},depthMask:!0}))),s&&(o=c=this,l=h=g,g=(r=e).context,t="in vec4 position;\nin vec3 normal;\n\nout vec3 v_position;\nout vec3 v_positionWC;\nout vec3 v_positionEC;\nout vec3 v_normalEC;\n\nvoid main() {\n gl_Position = czm_modelViewProjection * position;\n v_position = vec3(position);\n v_positionWC = (czm_model * position).xyz;\n v_positionEC = (czm_modelView * position).xyz;\n v_normalEC = czm_normal * normal;\n}",i=new z({sources:[T,l.shaderSource,E]}),o._sp=k.replaceCache({context:g,shaderProgram:o._sp,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:q}),i=new z({sources:[T,l.shaderSource,E],pickColorQualifier:"uniform"}),o._pickSP=k.replaceCache({context:g,shaderProgram:o._pickSP,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:q}),c.showScanPlane)&&(l=c,g=h,o=r.context,g=new z({sources:[T,g.shaderSource,'#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n uniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\n\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\n\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\n\nvec4 getColor(float sensorRadius, vec3 pointEC) {\n czm_materialInput materialInput;\n\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n\n czm_material material = czm_getMaterial(materialInput);\n\n material.diffuse = u_color.rgb;\n material.alpha = u_color.a;\n\n return mix(\n czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),\n vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon) {\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the\n // tolerance. We also want to check if the value of an adjacent pixel is\n // within the tolerance, but we don\'t want to admit points that are obviously\n // not on the surface. For example, if we are looking for "value" to be close\n // to 0, but value is 1 and the adjacent value is 2, then the delta would be 1\n // and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels ||\n (delta < 10.0 * tolerance && temp - delta < tolerance &&\n temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\n\nvec4 shade(bool isOnBoundary) {\n if (u_showIntersection && isOnBoundary) {\n return getIntersectionColor();\n }\n return getColor(u_radius, v_positionEC);\n}\n\nfloat ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {\n vec3 scaled = inverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main() {\n vec3 sensorVertexWC =\n czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC =\n czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n\n // vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0, positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if (resX < cos(u_xHalfAngle) - 0.0001) {\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if (resY < cos(u_yHalfAngle) - 0.0001) {\n discard;\n }\n\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue =\n ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);\n\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid) {\n // Discard if in the ellipsoid\n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done\n // on the CPU first.\n if (ellipsoidValue < 0.0) {\n discard;\n }\n\n // Discard if in the sensor\'s shadow\n if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,\n v_positionWC)) {\n discard;\n }\n }\n\n // Notes: Each surface functions should have an associated tolerance based on\n // the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n out_FragColor = shade(isOnEllipsoid);\n}']}),l._scanePlaneSP=k.replaceCache({context:o,shaderProgram:l._scanePlaneSP,vertexShaderSource:"in vec4 position;\nin vec3 normal;\n\nout vec3 v_position;\nout vec3 v_positionWC;\nout vec3 v_positionEC;\nout vec3 v_normalEC;\n\nvoid main() {\n gl_Position = czm_modelViewProjection * position;\n v_position = vec3(position);\n v_positionWC = (czm_model * position).xyz;\n v_positionEC = (czm_modelView * position).xyz;\n v_normalEC = czm_normal * normal;\n}",fragmentShaderSource:g,attributeLocations:q})),(a||s)&&(t=f,(i=this)._colorCommands.length=0,c=t?D.TRANSLUCENT:D.OPAQUE,i.showLateralSurfaces&&J(i,i._sectorFrontCommand,i._sectorBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorVA,i._uniforms,i._computedModelMatrix,t,c),i.showSectorLines&&J(i,i._sectorLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showSectorSegmentLines&&J(i,i._sectorSegmentLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorSegmentLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showDomeSurfaces&&J(i,i._domeFrontCommand,i._domeBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._domeVA,i._uniforms,i._computedModelMatrix,t,c),i.showDomeLines&&J(i,i._domeLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._domeLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showScanPlane)&&J(i,i._scanPlaneFrontCommand,i._scanPlaneBackCommand,i._frontFaceRS,i._backFaceRS,i._scanePlaneSP,i._scanPlaneVA,i._scanUniforms,i._computedScanPlaneModelMatrix,t,c),e.commandList),h=e.passes,v=this._colorCommands;if(h.render)for(var _=0,w=v.length;_<w;_++){var C=v[_];y.push(C)}}}},e.prototype.isDestroyed=function(){return!1};var Y=new H,X=new x;function Z(e,t,i){for(var n=e.slice,e=W(i),i=N(i),o=W(t),t=N(t),r=j(o*i),a=j(e*t),s=[],l=0;l<n;l++){var c=2*r*l/(n-1)-r;s.push(new x(0,u(c),W(c)))}for(var h=[],l=0;l<n;l++)h.push(new x(u(c=2*a*l/(n-1)-a),0,W(c)));return{zoy:s,zox:h}}function $(e,t){for(var i=t.length-1,n=new Float32Array(9*i),o=0,r=0;r<i;r++)n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t[r].x,n[o++]=t[r].y,n[o++]=t[r].z,n[o++]=t[r+1].x,n[o++]=t[r+1].y,n[o++]=t[r+1].z;var a=I.createVertexBuffer({context:e,typedArray:n,usage:L.STATIC_DRAW}),s=3*Float32Array.BYTES_PER_ELEMENT,a=[{index:q.position,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:s}];return new O({context:e,attributes:a})}function J(e,t,i,n,o,r,a,s,l,c,h,u){c&&i&&(i.vertexArray=a,i.renderState=o,i.shaderProgram=r,i.uniformMap=d(s,e._material._uniforms),i.uniformMap.u_normalDirection=function(){return-1},i.pass=h,i.modelMatrix=l,e._colorCommands.push(i)),t.vertexArray=a,t.renderState=n,t.shaderProgram=r,t.uniformMap=d(s,e._material._uniforms),u&&(t.uniformMap.u_type=function(){return 1}),t.pass=h,t.modelMatrix=l,e._colorCommands.push(t)}return e}let L={};function D(e){var t=(L=e).defaultValue,i=L.defined,e=Object.defineProperties,n=L.DeveloperError,o=L.Event,r=L.createMaterialPropertyDescriptor,a=L.createPropertyDescriptor;function s(e){this._show=void 0,this._radius=void 0,this._xHalfAngle=void 0,this._yHalfAngle=void 0,this._lineColor=void 0,this._showSectorLines=void 0,this._showSectorSegmentLines=void 0,this._showLateralSurfaces=void 0,this._material=void 0,this._showDomeSurfaces=void 0,this._showDomeLines=void 0,this._showIntersection=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._showThroughEllipsoid=void 0,this._gaze=void 0,this._showScanPlane=void 0,this._scanPlaneColor=void 0,this._scanPlaneMode=void 0,this._scanPlaneRate=void 0,this._definitionChanged=new o,this.merge(t(e,t.EMPTY_OBJECT))}return e(s.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:r("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")}),s.prototype.clone=function(e){return(e=i(e)?e:new s).show=this.show,e.radius=this.radius,e.xHalfAngle=this.xHalfAngle,e.yHalfAngle=this.yHalfAngle,e.lineColor=this.lineColor,e.showSectorLines=this.showSectorLines,e.showSectorSegmentLines=this.showSectorSegmentLines,e.showLateralSurfaces=this.showLateralSurfaces,e.material=this.material,e.showDomeSurfaces=this.showDomeSurfaces,e.showDomeLines=this.showDomeLines,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.showThroughEllipsoid=this.showThroughEllipsoid,e.gaze=this.gaze,e.showScanPlane=this.showScanPlane,e.scanPlaneColor=this.scanPlaneColor,e.scanPlaneMode=this.scanPlaneMode,e.scanPlaneRate=this.scanPlaneRate,e},s.prototype.merge=function(e){if(!i(e))throw new n("source is required.");this.show=t(this.show,e.show),this.radius=t(this.radius,e.radius),this.xHalfAngle=t(this.xHalfAngle,e.xHalfAngle),this.yHalfAngle=t(this.yHalfAngle,e.yHalfAngle),this.lineColor=t(this.lineColor,e.lineColor),this.showSectorLines=t(this.showSectorLines,e.showSectorLines),this.showSectorSegmentLines=t(this.showSectorSegmentLines,e.showSectorSegmentLines),this.showLateralSurfaces=t(this.showLateralSurfaces,e.showLateralSurfaces),this.material=t(this.material,e.material),this.showDomeSurfaces=t(this.showDomeSurfaces,e.showDomeSurfaces),this.showDomeLines=t(this.showDomeLines,e.showDomeLines),this.showIntersection=t(this.showIntersection,e.showIntersection),this.intersectionColor=t(this.intersectionColor,e.intersectionColor),this.intersectionWidth=t(this.intersectionWidth,e.intersectionWidth),this.showThroughEllipsoid=t(this.showThroughEllipsoid,e.showThroughEllipsoid),this.gaze=t(this.gaze,e.gaze),this.showScanPlane=t(this.showScanPlane,e.showScanPlane),this.scanPlaneColor=t(this.scanPlaneColor,e.scanPlaneColor),this.scanPlaneMode=t(this.scanPlaneMode,e.scanPlaneMode),this.scanPlaneRate=t(this.scanPlaneRate,e.scanPlaneRate)},s}let k={};function z(e,v){function c(e,t,i){var n=t[e.id];C(n)&&(n=n.primitive,i.remove(n),n&&!n.isDestroyed()&&n.destroy(),delete t[e.id])}var i,_,w,C,o,P,x,b,S,M,T,A,E,I,L,D,R,n;if(e)return i=(k=e).AssociativeArray,_=k.Cartesian3,w=k.Color,C=k.defined,o=k.destroyObject,P=k.DeveloperError,x=k.Matrix3,b=k.Matrix4,S=k.Quaternion,M=k.MaterialProperty,T=k.Property,A=new x,new b,E=new _,I=new _,L=new S,D=new _,R=new S,(n=function(e,t){if(!C(e))throw new P("scene is required.");if(!C(t))throw new P("entityCollection is required.");t.collectionChanged.addEventListener(n.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._hash={},this._entitiesToVisualize=new i,this._onCollectionChanged(t,t.values,[],[])}).prototype.update=function(e){if(!C(e))throw new P("time is required.");for(var t=this._entitiesToVisualize.values,i=this._hash,n=this._primitives,o=0,r=t.length;o<r;o++){var a,s,l,c=t[o],h=c._rectangularSensor,u=i[c.id],d=c.isShowing&&c.isAvailable(e)&&T.getValueOrDefault(h._show,e,!0);if(d&&(a=T.getValueOrUndefined(c._position,e,E),f=T.getValueOrUndefined(c._orientation,e,L),y=T.getValueOrUndefined(h._radius,e),s=T.getValueOrUndefined(h._xHalfAngle,e),l=T.getValueOrUndefined(h._yHalfAngle,e),d=C(a)&&C(s)&&C(l)),d){d=C(u)?u.primitive:void 0,c=(C(d)||((d=new v).id=c,n.add(d),i[c.id]=u={primitive:d,position:void 0,orientation:void 0}),T.getValueOrUndefined(h._gaze,e));if(C(c)){var p=T.getValueOrUndefined(c._position,e,I);if(!C(a)||!C(p))continue;var m=_.subtract(a,p,D),g=_.angleBetween(k.Cartesian3.UNIT_Z,m),m=_.cross(k.Cartesian3.UNIT_Z,m,D),f=S.fromAxisAngle(m,g-Math.PI,R),y=_.distance(a,p);d.modelMatrix=b.fromRotationTranslation(x.fromQuaternion(f,A),a,d.modelMatrix)}else _.equals(a,u.position)&&S.equals(f,u.orientation)||(C(f)?(d.modelMatrix=b.fromRotationTranslation(x.fromQuaternion(f,A),a,d.modelMatrix),u.position=_.clone(a,u.position),u.orientation=S.clone(f,u.orientation)):(d.modelMatrix=k.Transforms.eastNorthUpToFixedFrame(a),u.position=_.clone(a,u.position)));d.show=!0,d.gaze=c,d.radius=y,d.xHalfAngle=s,d.yHalfAngle=l,d.lineColor=T.getValueOrDefault(h._lineColor,e,w.WHITE),d.showSectorLines=T.getValueOrDefault(h._showSectorLines,e,!0),d.showSectorSegmentLines=T.getValueOrDefault(h._showSectorSegmentLines,e,!0),d.showLateralSurfaces=T.getValueOrDefault(h._showLateralSurfaces,e,!0),d.material=M.getValue(e,h._material,d.material),d.showDomeSurfaces=T.getValueOrDefault(h._showDomeSurfaces,e,!0),d.showDomeLines=T.getValueOrDefault(h._showDomeLines,e,!0),d.showIntersection=T.getValueOrDefault(h._showIntersection,e,!0),d.intersectionColor=T.getValueOrDefault(h._intersectionColor,e,w.WHITE),d.intersectionWidth=T.getValueOrDefault(h._intersectionWidth,e,1),d.showThroughEllipsoid=T.getValueOrDefault(h._showThroughEllipsoid,e,!0),d.scanPlaneMode=T.getValueOrDefault(h._scanPlaneMode,e),d.scanPlaneColor=T.getValueOrDefault(h._scanPlaneColor,e,w.WHITE),d.showScanPlane=T.getValueOrDefault(h._showScanPlane,e,!0),d.scanPlaneRate=T.getValueOrDefault(h._scanPlaneRate,e,1)}else C(u)&&(u.primitive.show=!1)}return!0},n.prototype.isDestroyed=function(){return!1},n.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,t=this._hash,i=this._primitives,n=e.length-1;-1<n;n--)c(e[n],t,i);return o(this)},n.prototype._onCollectionChanged=function(e,t,i,n){for(var o,r=this._entitiesToVisualize,a=this._hash,s=this._primitives,l=t.length-1;-1<l;l--)o=t[l],C(o._rectangularSensor)&&C(o._position)&&r.set(o.id,o);for(l=n.length-1;-1<l;l--)o=n[l],C(o._rectangularSensor)&&C(o._position)?r.set(o.id,o):(c(o,a,s),r.remove(o.id));for(l=i.length-1;-1<l;l--)c(o=i[l],a,s),r.remove(o.id)},n}let R=null;function G(e,t){e&&(this.viewer=e,R=t,this._installPlugin())}G.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive()},_installCylinderGeometry:function(){function b(e){this.length=e.length,this.topRadius=e.topRadius,this.bottomRadius=e.bottomRadius,this.slices=e.slices||64,this.zReverse=e.zReverse}var M=new R.Cartesian2,S=new R.Cartesian3,T=new R.Ray;b._createGeometry=function(e){var t=e.length,i=e.topRadius,n=e.bottomRadius,o=e.slices,r=2*Math.PI/(o-1),a=[],s=[],l=[],c=[],h=[n,i],u=[0,e.zReverse?-t:t],d=0,e=Math.atan2(n-i,t),p=M;p.z=Math.sin(e);for(var m=Math.cos(e),g=0;g<u.length;g++){c[g]=[];for(var f=h[g],y=0;y<o;y++){c[g].push(d++);var v=r*y,_=f*Math.cos(v),w=f*Math.sin(v);a.push(_,w,u[g]),_=m*Math.cos(v),w=m*Math.sin(v),s.push(_,w,p.z),l.push(g/(u.length-1),0)}}for(var C=[],g=1;g<u.length;g++)for(y=1;y<o;y++){var P=c[g-1][y-1],x=c[g][y-1],b=c[g][y],S=c[g-1][y];C.push(b),C.push(S),C.push(P),C.push(b),C.push(P),C.push(x),y==c[g].length-1&&(P=c[g-1][y],x=c[g][y],b=c[g][0],S=c[g-1][0],C.push(b),C.push(S),C.push(P),C.push(b),C.push(P),C.push(x))}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=R.BoundingSphere.fromVertices(a),t=new R.Geometry({attributes:n,indices:C,primitiveType:R.PrimitiveType.TRIANGLES,boundingSphere:i});return a=[],C=[],l=[],t},b.createGeometry=function(e,t){if(!t)return b._createGeometry(e);R.Matrix4.multiplyByPoint(t,R.Cartesian3.ZERO,S),S.clone(T.origin);var i=e.length,n=e.topRadius,o=(e.bottomRadius,e.slices),r=2*Math.PI/(o-1),a=[],s=[],l=[],c=[],h=[0,e.zReverse?-i:i],u=0,u=0;a.push(0,0,0),s.push(1,1),u++;for(var d=new R.Cartesian3,p=n/15,m=0;m<16;m++){for(var g=p*m,f=[],y=0;y<o;y++){var v=r*y,_=g*Math.cos(v),v=g*Math.sin(v);d.x=_,d.y=v,d.z=h[1],(0,R.Scene.extend2Earth)(d,t,T)?(f.push(u),a.push(_,v,h[1]),s.push(m/15,1),u++):f.push(-1)}c.push(f)}for(var w,C,P=[0,c.length-1],x=0;x<P.length;x++)for(m=P[x],y=1;y<c[m].length;y++)w=c[m][y-1],C=c[m][y],0<=w&&0<=C&&l.push(0,w,C);a=new Float32Array(a),l=new Int32Array(l),s=new Float32Array(s),e={position:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),st:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=R.BoundingSphere.fromVertices(a),n=new R.Geometry({attributes:e,indices:l,primitiveType:R.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,R.Scene.computeVertexNormals)(n),a=[],l=[],n},b.createOutlineGeometry=function(e){var t=e.length,i=e.topRadius,n=e.bottomRadius,o=e.slices,r=2*Math.PI/(o-1),a=[],s=[],l=[],c=[],h=[n,i],u=[0,e.zReverse?-t:t],d=0,e=Math.atan2(n-i,t),p=M;p.z=Math.sin(e);for(var m=Math.cos(e),g=0;g<u.length;g++){c[g]=[];for(var f=h[g],y=0;y<o;y++){c[g].push(d++);var v=r*y,_=f*Math.cos(v),w=f*Math.sin(v);a.push(_,w,u[g]),_=m*Math.cos(v),w=m*Math.sin(v),s.push(_,w,p.z),l.push(g/(u.length-1),0)}}for(var C=[],g=1;g<u.length;g++)for(y=1;y<o;y+=1){var P=c[g-1][y-1],x=c[g][y-1];c[g][y],c[g-1][y],y%8==1&&C.push(P,x)}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=R.BoundingSphere.fromVertices(a),t=new R.Geometry({attributes:n,indices:C,primitiveType:R.PrimitiveType.LINES,boundingSphere:i});return a=[],C=[],l=[],t},b.fromAngleAndLength=function(e,t,i){return e=R.Math.toRadians(e),new b({topRadius:Math.tan(e)*t/2,bottomRadius:0,length:t,zReverse:i})},R.Scene.CylinderGeometry=b},_installRadarPrimitive:function(){var i;function e(e,t){t=t||{},i=e.scene.globe.ellipsoid,this._geometry=null,this._angle=t.angle,this._radius=t.radius||5,this._position=t.position,this._rotation=t.rotation||{heading:0,pitch:0,roll:0},this._trackedEntity=t.trackedEntity,this.defaultColor=t.color||R.Color.YELLOW,this.defaultLineColor=t.lineColor||this.defaultColor,this._show=R.defaultValue(t.show,!0),this._outline=R.defaultValue(t.outline,!1),this._topShow=R.defaultValue(t.top,!0),this._topOutline=R.defaultValue(t.topOutline,!0),this._modelMatrix=R.Matrix4.clone(R.Matrix4.IDENTITY),this._quaternion=new R.Quaternion,this._translation=new R.Cartesian3,this._scale=new R.Cartesian3(1,1,1),this._matrix=new R.Matrix4,this._inverseMatrix=new R.Matrix4,this._positionCartographic=new R.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=e,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=R.defaultValue(t.groundArea,!1),this.addGroundAreaEntity(this._groundArea)}Object.defineProperties(e.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(e){this._trackedEntity=e}},color:{get:function(){return this.defaultColor},set:function(e){this.defaultColor=e}},lineColor:{get:function(){return this.defaultLineColor},set:function(e){this.defaultLineColor=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},outline:{get:function(){return this._outline},set:function(e){this._outline=e,this.updateGeometry()}},top:{get:function(){return this._topShow},set:function(e){this._topShow=e,this.updateGeometry()}},topOutline:{get:function(){return this._topOutline},set:function(e){this._topOutline=e,this.updateGeometry()}},groundArea:{get:function(){return this._groundArea},set:function(e){this._groundArea=e,this.addGroundAreaEntity(this._groundArea)}},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this.updateGroundCircleRadius(),this.updateGeometry()}},radius:{get:function(){return this._radius},set:function(e){this._radius=e,this.updateGroundCircleRadius(),this.updateGeometry()}},heading:{get:function(){return this._rotation.heading},set:function(e){this._rotation.heading=e}},pitch:{get:function(){return this._rotation.pitch},set:function(e){this._rotation.pitch=e}},roll:{get:function(){return this._rotation.roll},set:function(e){this._rotation.roll=e}},position:{get:function(){return this._position},set:function(e){this._position=e}}}),e.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(R.Math.toRadians(this._angle))},e.prototype.isDestroyed=function(){return!1},e.prototype.addGroundAreaEntity=function(e){var t;e&&!this.groundAreaEntity&&((t=this).updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:0===this._rotation.pitch&&0===this._rotation.roll,semiMinorAxis:new R.CallbackProperty(function(e){return t._ground_radius},!1),semiMajorAxis:new R.CallbackProperty(function(e){return t._ground_radius},!1),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll),positions:new R.CallbackProperty(function(e){return!t._trackedEntityPosition||R.Cartesian3.distance(t._position,t._trackedEntityPosition)>t._radius?[]:[t._position,t._trackedEntityPosition]},!1),followSurface:!1,material:new R.PolylineDashMaterialProperty({color:R.Color.CYAN}),width:1}}))};var n=new R.Cartesian3;e.prototype.computeMatrix=function(e,t){return this._positionCartesian||(this._positionCartesian=new R.Cartesian3),this.position instanceof R.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(e):this.position._value&&this.position._value instanceof R.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,e=R.Property.getValueOrUndefined(this._trackedEntity.position,e,n))&&(this._trackedEntityPosition=e,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=R.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),this._positionCartographic=R.Cartographic.fromCartesian(this._positionCartesian,i,this._positionCartographic),R.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),R.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=R.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),R.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),R.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},e.prototype.getTopGeometry=function(){for(var e=this.radius,t=[],i=[],n=[],o=[],r=90-parseInt(this.angle),a=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=a){for(var h=R.Math.toRadians(c<90?c:90),h=Math.cos(h)*e,u=[],d=0;d<128;d++){var p=s*d,m=h*Math.cos(p),p=h*Math.sin(p),g=Math.sqrt(e*e-m*m-p*p);t.push(m,p,g),i.push(1,1),u.push(l++)}o.push(u)}for(c=1;c<o.length;c++)for(d=1;d<o[c].length;d++){var f=o[c-1][d-1],y=o[c][d-1],v=o[c][d],_=o[c-1][d];n.push(f,y,v),n.push(f,v,_)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),r={position:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},w=R.BoundingSphere.fromVertices(t),r=new R.Geometry({attributes:r,indices:n,primitiveType:R.PrimitiveType.TRIANGLES,boundingSphere:w});return(0,R.Scene.computeVertexNormals)(r),r},e.prototype.getTopOutlineGeometry=function(){for(var e=this.radius,t=[],i=[],n=[],o=[],r=90-parseInt(this.angle),a=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=a){for(var h=R.Math.toRadians(c<90?c:90),h=Math.cos(h)*e,u=[],d=0;d<128;d++){var p=s*d,m=h*Math.cos(p),p=h*Math.sin(p),g=Math.sqrt(e*e-m*m-p*p);t.push(m,p,g),i.push(1,1),u.push(l++)}o.push(u)}for(c=1;c<o.length;c++)for(d=1;d<o[c].length;d++){var f=o[c-1][d-1],y=o[c][d-1],v=o[c][d];o[c-1][d],d%8==1&&n.push(f,y),c%8==1&&n.push(y,v)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),r={position:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},_=R.BoundingSphere.fromVertices(t),r=new R.Geometry({attributes:r,indices:n,primitiveType:R.PrimitiveType.LINES,boundingSphere:_});return(0,R.Scene.computeVertexNormals)(r),r},e.prototype.updateGeometry=function(){this._geometry=R.Scene.CylinderGeometry.createGeometry(new R.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(R.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(R.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=R.Scene.CylinderGeometry.createOutlineGeometry(new R.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(R.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(R.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var e=0;e<this._positions.length;e++)this._positions[e]=this._geometry.attributes.position.values[e];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))},e.prototype.update=function(t){this._show&&(this.computeMatrix(t.time),t.mode===R.SceneMode.SCENE3D?(this._geometry.boundingSphere=R.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,t)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,t)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,t)),this._topOutline)&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,t))),this._drawCommands.forEach(function(e){t.commandList.push(e)}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=!1)):(this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.ellipse.show=0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll)))},e.prototype.getFragmentShaderSource=function(e){return"#version 300 es\n in vec3 v_position;\n in vec3 v_normal; \n uniform float picked; \n uniform vec4 pickedColor; \n uniform vec4 defaultColor; \n uniform float specular; \n uniform float shininess; \n uniform vec3 emission; \n in vec2 v_st; \n uniform bool isLine; \n uniform float glowPower; \n void main() { \n vec3 positionToEyeEC = -v_position; \n vec3 normalEC = normalize(v_normal); \n vec4 color = defaultColor; \n if (picked != 0.0) { \n color = pickedColor; \n } \n czm_material material; \n material.specular = specular; \n material.shininess = shininess; \n material.normal = normalEC; \n material.emission = emission;//vec3(0.2,0.2,0.2);\n material.diffuse = color.rgb ;\n if(isLine){\n material.alpha = 1.0; \n }\n else{ \n material.alpha = color.a; \n }\n if(v_st.x==0.0){ \n out_FragColor =color ;\n }else { \n out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ; \n } \n }"},e.prototype.getVertexShaderSource=function(e){return"#version 300 es\n #ifdef GL_ES\n precision highp float;\n #endif\n\n in vec3 position;\n in vec2 st;\n in vec3 normal;\n uniform mat4 modelViewMatrix;\n uniform mat3 normalMatrix;\n uniform mat4 projectionMatrix;\n out vec3 v_position;\n out vec3 v_normal;\n out vec2 v_st;\n\n out vec3 v_light0Direction;\n\n void main(void) \n {\n vec4 pos = modelViewMatrix * vec4( position,1.0);\n v_normal = normalMatrix * normal;\n v_st = st;\n v_position = pos.xyz;\n v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n gl_Position = projectionMatrix * pos;\n }"},e.prototype.createDrawCommand=function(e,t,i){var n=t.context,o=new R.Cartesian3,o=(R.Matrix4.multiplyByPoint(this._matrix,e.boundingSphere.center,o),new R.BoundingSphere(o,e.boundingSphere.radius)),i=new R.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:e.primitiveType,pass:R.Pass.TRANSLUCENT,boundingVolume:o}),r=this,o=R.GeometryPipeline.createAttributeLocations(e);return i.vertexArray=R.VertexArray.fromGeometry({context:n,geometry:e,attributeLocations:o,bufferUsage:R.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=o,i.shaderProgram=R.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(e),fragmentShaderSource:this.getFragmentShaderSource(e),attributeLocations:o}),i.renderState=R.RenderState.fromCache({blending:R.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:R.DepthFunction.LESS},cull:{enabled:!1,face:R.CullFace.BACK}}),i.uniformMap={},i.uniformMap.projectionMatrix=function(){return t.context.uniformState.projection},i.uniformMap.modelViewMatrix=function(){return t.context.uniformState.modelView},i.uniformMap.shininess=function(){return r.shininess||(r.shininess=0),r.shininess},i.uniformMap.emission=function(){return r.emission||(r.emission=new R.Cartesian3(.2,.2,.2)),r.emission},i.uniformMap.specular=function(){return r.specular||(r.specular=0),r.specular},i.uniformMap.isLine=function(){return e.primitiveType==R.PrimitiveType.LINES||e.primitiveType==R.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return e.primitiveType==R.PrimitiveType.LINES||e.primitiveType==R.PrimitiveType.LINE_STRIP?(r.defaultLineColor||(r.defaultLineColor=new R.Color(1,1,0,1)),r.defaultLineColor):(r.defaultColor||(r.defaultColor=new R.Color(1,0,0,1)),r.defaultColor)},i.uniformMap.picked=function(){return r.picked||(r.picked=0),r.picked},i.uniformMap.pickedColor=function(){return r.pickedColor||(r.pickedColor=new R.Color(1,1,0,1)),r.pickedColor},i.uniformMap.normalMatrix=function(){return t.context.uniformState.normal},i.uniformMap.glowPower=function(){return.25},i},e.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity)},e.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity)},e.prototype.destroy=function(e){e&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy()}),this._drawCommands=[])},R.Scene.ConeSensorPrimitive=e},_installCounputeVertex:function(){var o=new R.Cartesian3,r=(new R.Ray,new R.Cartographic);R.Scene.computeVertexNormals=function(e){var t=e.indices,i=e.attributes,n=t.length;if(i.position){var o=i.position.values;if(void 0===i.normal)i.normal=new R.GeometryAttribute({componentDatatype:R.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(o.length)});else for(var r=i.normal.values,a=0;a<n;a++)r[a]=0;for(var s,l,c,h=i.normal.values,u=new R.Cartesian3,d=new R.Cartesian3,p=new R.Cartesian3,m=new R.Cartesian3,g=new R.Cartesian3,a=0;a<n;a+=3)s=3*t[a+0],l=3*t[a+1],c=3*t[a+2],R.Cartesian3.fromArray(o,s,u),R.Cartesian3.fromArray(o,l,d),R.Cartesian3.fromArray(o,c,p),R.Cartesian3.subtract(p,d,m),R.Cartesian3.subtract(u,d,g),R.Cartesian3.cross(m,g,m),h[s]+=m.x,h[1+s]+=m.y,h[2+s]+=m.z,h[l]+=m.x,h[1+l]+=m.y,h[2+l]+=m.z,h[c]+=m.x,h[1+c]+=m.y,h[2+c]+=m.z;for(var f,y,v,_,w=e.attributes.normal.values,C=0;C<w.length;C+=3)f=w[C],y=w[C+1],v=w[C+2],_=1/Math.sqrt(f*f+y*y+v*v),w[C]=f*_,w[C+1]=y*_,w[C+2]=v*_;i.normal.needsUpdate=!0}return e},R.Scene.extend2Earth=function(e,t,i,n){n=n||R.Ellipsoid.WGS84,R.Matrix4.multiplyByPoint(t,e,o),R.Cartesian3.subtract(o,i.origin,i.direction),R.Cartesian3.normalize(i.direction,i.direction);t=R.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=t?R.Ray.getPoint(i,t.start):n)try{R.Cartographic.fromCartesian(n,null,r)}catch(e){return null}return n}}};let O={};function F(e,t){if(t){new G(e,O=t);const i=new I(t),n=new D(t),r=new z(t,i);O.Scene.RectangularSensorPrimitive=i,O.Scene.RectangularSensorGraphics=n,O.Scene.RectangularSensorVisualizer=r;var e=O.DataSourceDisplay,o=e.defaultVisualizersCallback;e.defaultVisualizersCallback=function(e,t,i){var n=i.entities;return o(e,t,i).concat([new r(e,n)])}}}let B=null;function H(e,t){e&&(this._viewer=e,B=t,this._customPluginLayer=new B.CustomDataSource("_customPluginLayer"),new F(e,t),e)&&e.dataSources.add(this._customPluginLayer)}H.prototype={createRectangularSensorGraphics:function(e){var t,i;if(this._customPluginLayer&&e)return t=new B.HeadingPitchRoll(B.Math.toRadians(e.heading||90),B.Math.toRadians(e.pitch||0),B.Math.toRadians(e.roll||0)),i=e.position,this._customPluginLayer.entities.add({position:i,orientation:B.Transforms.headingPitchRollQuaternion(i,t),rectangularSensor:new B.Scene.RectangularSensorGraphics({radius:e.radius||1e5,xHalfAngle:B.Math.toRadians(e.xHalfAngle||45),yHalfAngle:B.Math.toRadians(e.yHalfAngle||45),material:e.material||new B.Color(1,0,1,.4),lineColor:e.lineColor||new B.Color(1,0,1,1),showScanPlane:this._objHasOwnProperty(e,"showScanPlane",!0),showSectorLines:this._objHasOwnProperty(e,"showSectorLines",!0),showLateralSurfaces:this._objHasOwnProperty(e,"showLateralSurfaces",!0),modelMatrix:e.modelMatrix||new B.Matrix4,scanPlaneColor:e.scanPlaneColor||new B.Color(1,0,1,1),scanPlaneMode:e.scanPlaneMode||"vertical",scanPlaneRate:e.scanPlaneRate||3,showThroughEllipsoid:this._objHasOwnProperty(e,"showThroughEllipsoid",!1),show:this._objHasOwnProperty(e,"show",!0)})})},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e.field:i,createSatelliteCoverageSimulationGraphics:function(e){if(e)return new B.Scene.SatelliteCoverageSimulation(this._viewer,{position:e.position,angle1:e.angle1||30,angle2:e.angle2||45,areaType:e.areaType||2,rotation:{heading:B.Math.toRadians(e.heading||0),pitch:B.Math.toRadians(e.pitch||0),roll:B.Math.toRadians(e.roll||0)},color:e.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(e){if(e)return new B.Scene.ConeSensorPrimitive(this._viewer,{position:e.position,angle:e.angle||80,radius:e.radius||7e5,rotation:{heading:B.Math.toRadians(e.heading||0),pitch:B.Math.toRadians(e.pitch||40),roll:B.Math.toRadians(e.roll||0)},color:e.color||{red:1,green:0,blue:0,alpha:.4},lineColor:e.lineColor||{red:1,green:1,blue:1,alpha:.9}})}};let V,W,U=null,N={},j="move",Y=null;function X(e,t){e&&(this._viewer=e,Y=e,U=t,this._installFileDragDropHandler())}X.prototype={_installFileDragDropHandler(){function i(e,t){var i=document.createElement("div");i.id="fileDragDrop",i.classList.add("filedragdrop"),i.innerHTML="请将Json文件拖拽到此区域",this._dragBox=i,this._viewer=t,(this._parentDiv=e).appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}i.prototype.startuploadfile=function(){var i=this,e=i._dragBox,t=null;document.ondragover=function(){clearTimeout(t),t=setTimeout(function(){e.innerHTML="请将文件拖拽到此区域"},200)},e.ondragenter=function(){e.innerHTML="请释放鼠标"},e.ondragover=function(){return!1},e.ondragleave=function(){e.innerHTML="请将文件拖拽到此区域"},e.ondrop=function(e){e.preventDefault();var e=e.dataTransfer.files[0],t=new FileReader;return t.readAsText(e,"UTF-8"),t.onload=function(){var e=JSON.parse(this.result);i.fileDragDropCallBack&&i.fileDragDropCallBack(i.callBackParms,e,i._viewer)},t.onloadstart=function(){},t.onloadend=function(){},t.onabort=function(){alert("读取数据中断")},!(t.onerror=function(){alert("读取数据失败")})}},U.Scene.FileDragDropMixin=function(e){var t=new i(document.querySelector(".cesium-viewer"),e);Object.defineProperties(e,{fileDragDropMixin:{get:function(){return t}}})}},showLoadDataToScenePanel(e){if(e=e||{}){let e=new i,o=this._viewer,t=e.addFolder("加载数据文件"),n=e=>{let t=document.createElement("input");t.type="file",t.className="datgui_upload",t.onchange=function(){"function"==typeof e&&t.files.length&&e(URL.createObjectURL(t.files[0]))},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(t),t.click()},r={point:()=>{n(e=>{U.GeoJsonDataSource.load(e).then(function(e){o.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.point={color:U.Color.BLUE}}o.flyTo(e)})})},polyline:()=>{n(e=>{U.GeoJsonDataSource.load(e).then(function(e){o.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.polyline.width=5,n.polyline.material=new U.PolylineGlowMaterialProperty({glowPower:.1,color:U.Color.ORANGERED.withAlpha(.9)})}o.flyTo(e)})})},polygon:()=>{n(e=>{U.GeoJsonDataSource.load(e).then(function(e){o.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.polygon.width=10,n.polygon.material=U.Color.BLUE.withAlpha(.9)}o.flyTo(e)})})},model:()=>{n(e=>{o.flyTo(d3kit.createModelGraphics({position:U.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:e}))})},czml:()=>{n(e=>{o.flyTo(o.dataSources.add(U.CzmlDataSource.load(e)))})},"3dtilset":()=>{n(e=>{o.flyTo(o.scene.primitives.add(new U.Cesium3DTileset({url:e})))})}};t.add(r,"point"),t.add(r,"polyline"),t.add(r,"polygon"),t.add(r,"model"),t.add(r,"czml"),t.add(r,"3dtilset"),t.open()}},showPostProcessStagesPanel(e){e=e||{};let t=null,n=new function(){this.blackAndWhiteShow=!1,this.blackAndWhiteGradations=5,this.brightnessShow=!1,this.brightnessValue=.5,this.nightVisionShow=!1,this.silhouette=!1},o=(e&&e.elementId?(t=new i({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new i,this._viewer.scene.postProcessStages),r=o.add(U.PostProcessStageLibrary.createSilhouetteStage()),a=o.add(U.PostProcessStageLibrary.createBlackAndWhiteStage()),s=o.add(U.PostProcessStageLibrary.createBrightnessStage()),l=o.add(U.PostProcessStageLibrary.createNightVisionStage());r.uniforms.color=e.silhouetteColor||U.Color.YELLOW,r.enabled=!1,a.enabled=!1,a.uniforms.gradations=5,s.enabled=!1,s.uniforms.brightness=.5,l.enabled=!1,t.add(n,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(e){a.enabled=e}),t.add(n,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(e){a.uniforms.gradations=e}),t.add(n,"brightnessShow").name("brightnessShow").onChange(function(e){s.enabled=e}),t.add(n,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(e){s.uniforms.brightness=e}),t.add(n,"nightVisionShow").name("nightVisionShow").onChange(function(e){l.enabled=e}),t.add(n,"silhouette").name("silhouette").onChange(function(e){r.enabled=e})},showSceneBloomPanel(e){let t=null,n=new function(){this.contrast=128,this.brightness=-.3,this.delta=1,this.gamma=3.5,this.enabled=!1,this.highDynamicRange=!1,this.shadows=!1,this.glowOnly=!1,this.sigma=1,this.stepSize=5},o=(e&&e.elementId?(t=new i({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new i,this._viewer),r=(t.__closeButton.innerHTML="收缩面板",o.scene.postProcessStages.bloom);t.add(n,"enabled").name("bloom").onChange(function(e){r.enabled=e}),t.add(n,"glowOnly").name("发光").onChange(function(e){r.uniforms.glowOnly=e}),t.add(n,"enabled").name("启用模糊").onChange(function(e){r.enabled=e}),t.add(n,"contrast",-255,255,.01).name("对比度").onChange(function(e){r.uniforms.contrast=e}),t.add(n,"brightness",-1,1,.01).name("光泽亮度").onChange(function(e){r.uniforms.brightness=e}),t.add(n,"delta",1,5,.01).name("因子").onChange(function(e){r.uniforms.delta=e}),t.add(n,"sigma",1,10,.01).name("sigma").onChange(function(e){r.uniforms.sigma=e}),t.add(n,"stepSize",.1,10).name("stepSize").onChange(function(e){r.uniforms.stepSize=e}),t.add(n,"shadows").name("启用阴影").onChange(function(e){o.shadows=e}),t.add(n,"highDynamicRange").name("高动态范围").onChange(function(e){o.scene.highDynamicRange=e}),t.add(n,"gamma",1,10,.01).name("伽马亮度").onChange(function(e){o.scene.gamma=e})},showPrimitiveMatrixPanel(t){let n=t.primitives._delegate||t.primitives,o=t.primitives,e=(this._viewer,null);t&&t.elementId?(e=new i({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new i;var r=e.addFolder("离地高度"),r=(r.add({height:100},"height",0,1e3,1).onChange(function(e){var t=o.boundingSphere,t=U.Cartographic.fromCartesian(t.center),i=U.Cartesian3.fromRadians(t.longitude,t.latitude,0),t=U.Cartesian3.fromRadians(t.longitude,t.latitude,e),e=U.Cartesian3.subtract(t,i,new U.Cartesian3);o.modelMatrix=U.Matrix4.fromTranslation(e)}),r.open(),e.addFolder("缩放大小")),a={"m+Scale":()=>{n.readyPromise.then(e=>{var t=e.root.transform;U.Matrix4.multiplyByUniformScale(t,1.2,t),e.root.transform=t})},"m-Scale":()=>{n.readyPromise.then(e=>{var t=e.root.transform;U.Matrix4.multiplyByUniformScale(t,.8,t),e.root.transform=t})}},a=(r.add(a,"m+Scale"),r.add(a,"m-Scale"),r.open(),{"x+Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(20,0,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"x-Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(-20,0,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"y+Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,20,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"y-Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,-20,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"z+Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,0,20));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"z-Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,0,-20));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)}}),r=e.addFolder("矩阵平移");r.add(a,"x+Axis"),r.add(a,"x-Axis"),r.add(a,"y+Axis"),r.add(a,"y-Axis"),r.add(a,"z+Axis"),r.add(a,"z-Axis"),r.open();let s={x:0,y:0,z:0},l={"x+Axis":()=>{s.x+=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationX(U.Math.toRadians(s.x)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"x-Axis":()=>{s.x-=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationX(U.Math.toRadians(s.x)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"y+Axis":()=>{s.y+=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationY(U.Math.toRadians(s.y)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"y-Axis":()=>{s.y-=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationY(U.Math.toRadians(s.y)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"z+Axis":()=>{s.z+=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationZ(U.Math.toRadians(s.z)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"z-Axis":()=>{s.z-=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationZ(U.Math.toRadians(s.z)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})}},c=e.addFolder("旋转矩阵");c.add(l,"x+Axis"),c.add(l,"x-Axis"),c.add(l,"y+Axis"),c.add(l,"y-Axis"),c.add(l,"z+Axis"),c.add(l,"z-Axis"),c.open(),t.cb&&((a=e.addFolder("获取调整后的模型矩阵")).add({getModelMaterix:()=>{n.readyPromise.then(e=>{e=e.root.transform;t.cb({modelTransformMatrix:U.Matrix4.toArray(e),modelMatrix:U.Matrix4.toArray(o.modelMatrix)})})}},"getModelMaterix").name("获取模型矩阵"),a.open()),e.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(t,n){if(t){let e=null;n&&n.elementId?(e=new i({autoPlace:!1}),document.getElementById(n.elementId).appendChild(e.domElement)):e=new i;var n=new function(){this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.gamma=t.gamma,this.hue=t.hue,this.dayAlpha=t.dayAlpha,this.nightAlpha=t.nightAlpha,this.saturation=t.saturation},o=e.addFolder("图层调整");o.add(n,"alpha",0,1,.05).name("透明度").onChange(function(e){t.alpha=e}),o.add(n,"brightness",0,5,.05).name("亮度").onChange(function(e){t.brightness=e}),o.add(n,"contrast",0,5,.05).name("对比").onChange(function(e){t.contrast=e}),o.add(n,"gamma",0,5,.05).name("伽马").onChange(function(e){t.gamma=e}),o.add(n,"hue",0,5,.05).name("色调").onChange(function(e){t.hue=e}),o.add(n,"dayAlpha",0,1,.05).name("白天透明").onChange(function(e){t.dayAlpha=e}),o.add(n,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(e){t.nightAlpha=e}),o.add(n,"saturation",0,5,.05).name("饱和").onChange(function(e){t.saturation=e}),o.open()}},showLayerSwitchPanel:function(t,n,o){if(t&&t.length){let e=null;n&&n.elementId?(e=new i({autoPlace:!1}),document.getElementById(n.elementId).appendChild(e.domElement)):e=new i;var r=new function(){t.forEach(e=>{this[e.id]=e.show})},a=e.addFolder("图层切换"),s=(t.forEach(t=>{a.add(r,t.id).name(t.name).onChange(function(e){t.show=e,o&&o({key:t.id,val:e})})}),new function(){t.forEach(e=>{this[e.id]=e.alpha})}),l=e.addFolder("透明度");t.forEach(t=>{l.add(s,t.id,0,1,.05).name(t.name).onChange(function(e){t.alpha=e})}),a.open(),l.open()}},showSceneEffectEditPanel:function(e){var t,n,o;e=e||{},i&&this._viewer.scene.colorCorrection&&(o=new i,(t=this._viewer).scene.lightSource.ambientLightColor=e.ambientLightColor||new U.Color(.3,.3,.3,1),t.scene.colorCorrection.show=e.colorCorrection||!1,t.scene.colorCorrection.saturation=e.saturation||3.1,t.scene.colorCorrection.brightness=e.brightness||1.8,t.scene.colorCorrection.contrast=e.contrast||1.2,t.scene.colorCorrection.hue=e.hue||0,t.scene.bloomEffect.show=e.bloomEffect||!1,t.scene.hdrEnabled=e.hdrEnabled||!0,t.scene.bloomEffect.threshold=e.threshold||1,t.scene.bloomEffect.bloomIntensity=e.bloomIntensity||2,n=new function(){this.bloomEffectShow=e.bloomEffect||!1,this.bloomThreshold=e.threshold||1,this.bloomIntensity=e.bloomIntensity||2,this.ambientLightColor=e.ambientLightColor||.3,this.hdrEnabled=e.hdrEnabled||!0,this.colorCorrectionShow=!1,this.colorCorrectionSaturation=e.saturation||3.1,this.colorCorrectionBrightness=e.brightness||1.8,this.colorCorrectionContrast=e.contrast||1.2,this.colorCorrectionHue=e.hue||0},(o=o.addFolder("场景效果")).add(n,"bloomEffectShow").name("泛光开关").onChange(function(e){t.scene.bloomEffect.show=e,t.scene.bloomEffect.threshold=n.bloomThreshold,t.scene.bloomEffect.bloomIntensity=n.bloomIntensity}),o.add(n,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(e){t.scene.bloomEffect.threshold=e}),o.add(n,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(e){t.scene.bloomEffect.bloomIntensity=e}),o.add(n,"hdrEnabled").name("HDR开关").onChange(function(e){t.scene.hdrEnabled=e}),o.add(n,"colorCorrectionShow").name("颜色校正").onChange(function(e){t.scene.colorCorrection.show=e}),o.add(n,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(e){t.scene.colorCorrection.saturation=e}),o.add(n,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(e){t.scene.colorCorrection.brightness=e}),o.add(n,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(e){t.scene.colorCorrection.contrast=e}),o.add(n,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(e){t.scene.hdrEnabled=e}),o.add(n,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(e){t.scene.lightSource.ambientLightColor=new U.Color(e,e,e,1)}),o.open())},showEntityOrientationEditPanel:function(n={}){if(n.entity){let t=n.entity;var e=new i,o=(n&&n.elementId?(e=new i({autoPlace:!1}),document.getElementById(n.elementId).appendChild(e.domElement)):e=new i,new function(){this.heading=360,this.pitch=1,this.roll=1}),e=e.addFolder("实体姿态调整"),r=this;e.add(o,"heading",0,360,1).name("角度").onChange(function(e){o.heading=e;e=U.Transforms.headingPitchRollQuaternion(t.position.getValue(r._viewer.clock.currentTime),new U.HeadingPitchRoll(U.Math.toRadians(o.heading),U.Math.toRadians(o.pitch),U.Math.toRadians(o.roll)));t.orientation=e,n.cb&&n.cb({orientation:e})}),e.add(o,"pitch",0,360,1).name("航向").onChange(function(e){o.pitch=e;e=U.Transforms.headingPitchRollQuaternion(t.position.getValue(r._viewer.clock.currentTime),new U.HeadingPitchRoll(U.Math.toRadians(o.heading),U.Math.toRadians(o.pitch),U.Math.toRadians(o.roll)));t.orientation=e,n.cb&&n.cb({orientation:e})}),e.add(o,"roll",0,360,1).name("翻转").onChange(function(e){o.roll=e;e=U.Transforms.headingPitchRollQuaternion(t.position.getValue(r._viewer.clock.currentTime),new U.HeadingPitchRoll(U.Math.toRadians(o.heading),U.Math.toRadians(o.pitch),U.Math.toRadians(o.roll)));t.orientation=e,n.cb&&n.cb({orientation:e})}),e.open()}},definedMouseEvent({targetEntity:e,ctrlFlag:t}){W=e,N=t,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(t){if(N.leftDown&&V){let e=Y.camera.getPickRay(t.endPosition),o=Y.scene.globe.pick(e,Y.scene);if(document.body.style.cursor="pointer",V&&V.id&&"move"===j){let e=U.JulianDate.fromDate(new Date),t=W.position.getValue(e),i=U.Cartographic.fromCartesian(t),n=Number(i.height.toFixed(3));W.position=new U.CallbackProperty(()=>{var e=Y.scene.globe.ellipsoid.cartesianToCartographic(o),t=U.Math.toDegrees(e.longitude),e=U.Math.toDegrees(e.latitude);return U.Cartesian3.fromDegrees(t,e,n)},!1)}else{var i,n,r;V&&V.id&&"rotate"===j&&(n=U.JulianDate.fromDate(new Date),n=W.position.getValue(n),r=Y.scene.camera.pickEllipsoid(t.startPosition),t=Y.scene.camera.pickEllipsoid(t.endPosition),i=U.Cartesian3.subtract(n,t,new U.Cartesian3),i=U.Cartesian3.normalize(i,new U.Cartesian3),r=U.Cartesian3.subtract(r,n,new U.Cartesian3),t=U.Cartesian3.subtract(t,n,new U.Cartesian3),n=U.Cartesian3.angleBetween(r,t),r=U.Quaternion.fromAxisAngle(i,100*n),W.orientation=r)}}},defLeftDown(e){V=Y.scene.pick(e.position),U.defined(V)&&j?(N.selected=!0,N.leftDown=!0):N.selected=!1},defMouseWheel(n){if(V&&V.id&&"scale"===j){let e=U.JulianDate.fromDate(new Date),t=W.box.dimensions.getValue(e),i=0<n?2:.5;W.box.dimensions=new U.CallbackProperty(()=>U.Cartesian3.multiplyByScalar(t,i,new U.Cartesian3),!1)}},defLeftUp(e){N.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(e){j=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(e){j=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(e){j=e,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let q=null;var Z=3.141592653589793,J=6378245,Q=.006693421622965943;function K(e,t,i){e&&(this._viewer=e,q=t,this._queryRouteKey="8dc49b1fa65a79d306ef12dae4229842",this._pluginLayer=new q.CustomDataSource("pluginLayer"),e&&e.dataSources.add(this._pluginLayer),this._installPlugin())}K.routeQueryType={DRIVE:"drive",WALK:"walk",CYCLE:"cycle"},K.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan()},_installTerrainClipPlan:function(){function e(e,t){this.viewer=e,this.options=t||{},this._positions=t.positions,this._height=this.options.height||0,this.bottomImg=t.bottomImg,this.wallImg=t.wallImg,this.splitNum=q.defaultValue(t.splitNum,50),this._positions&&0<this._positions.length&&this.updateData(this._positions)}Object.defineProperties(e.prototype,{show:{get:function(){return this._show},set:function(e){this._show=e,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=e),this._switchExcavate(e)}},height:{get:function(){return this._height},set:function(e){this._height=e,this._updateExcavateDepth(e)}}}),e.prototype.updateData=function(e){var t=[],i=e.length-1,n=new q.Cartesian3,o=0<q.Cartesian3.subtract(e[0],e[1],n).x;this.excavateMinHeight=9999;for(var r=0;r<i;r++){var a=(r+1)%i,s=q.Cartesian3.midpoint(e[r],e[a],new q.Cartesian3),l=q.Cartographic.fromCartesian(e[r]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=q.Cartesian3.normalize(s,new q.Cartesian3),a=o?q.Cartesian3.subtract(e[r],s,new q.Cartesian3):q.Cartesian3.subtract(e[a],s,new q.Cartesian3),a=(a=q.Cartesian3.normalize(a,a),q.Cartesian3.cross(a,l,new q.Cartesian3)),a=q.Cartesian3.normalize(a,a),l=new q.Plane(a,0),l=q.Plane.getPointDistance(l,s);t.push(new q.ClippingPlane(a,l))}this.viewer.scene.globe.clippingPlanes=new q.ClippingPlaneCollection({planes:t,edgeWidth:1,edgeColor:q.Color.WHITE,enabled:!0}),this._prepareWell(e),this._createWell(this.wellData)},e.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()},e.prototype._prepareWell=function(e){var t=this.splitNum,i=e.length;if(0!=i){for(var n=this.excavateMinHeight-this.height,o=[],r=[],a=[],s=0;s<i;s++){var l=s==i-1?0:s+1,c=q.Cartographic.fromCartesian(e[s]),l=q.Cartographic.fromCartesian(e[l]),h=[c.longitude,c.latitude],u=[l.longitude,l.latitude];0==s&&(a.push(new q.Cartographic(h[0],h[1])),r.push(q.Cartesian3.fromRadians(h[0],h[1],n)),o.push(q.Cartesian3.fromRadians(h[0],h[1],0)));for(var d=1;d<=t;d++){var p=q.Math.lerp(h[0],u[0],d/t),m=q.Math.lerp(h[1],u[1],d/t);s==i-1&&d==t||(a.push(new q.Cartographic(p,m)),r.push(q.Cartesian3.fromRadians(p,m,n)),o.push(q.Cartesian3.fromRadians(p,m,0)))}}this.wellData={lerp_pos:a,bottom_pos:r,no_height_top:o}}},e.prototype._createWell=function(r){var a;this.viewer.terrainProvider._layers?((a=this)._createBottomSurface(r.bottom_pos),q.sampleTerrainMostDetailed(this.viewer.terrainProvider,r.lerp_pos).then(function(e){for(var t=e.length,i=[],n=0;n<t;n++){var o=q.Cartesian3.fromRadians(e[n].longitude,e[n].latitude,e[n].height);i.push(o)}a._createWellWall(r.bottom_pos,i)})):(this._createBottomSurface(r.bottom_pos),this._createWellWall(r.bottom_pos,r.no_height_top))},e.prototype._getMinHeight=function(t){let i=5e6,n=null;for(let e=0;e<t.length;e++){var o=t[e].z;o<i&&(i=o,n=this._ellipsoidToLonLat(t[e]))}return n.altitude},e.prototype._ellipsoidToLonLat=function(e){var t=this.viewer.scene.globe.ellipsoid,e=new q.Cartesian3(e.x,e.y,e.z),t=t.cartesianToCartographic(e),e=q.Math.toDegrees(t.latitude);return{longitude:q.Math.toDegrees(t.longitude),latitude:e,altitude:t.height}},e.prototype._createBottomSurface=function(t){if(t.length){var i=this._getMinHeight(t),n=[];for(let e=0;e<t.length;e++){var o=this._ellipsoidToLonLat(t[e]);n.push(o.longitude),n.push(o.latitude),n.push(i)}var e=new q.PolygonGeometry({polygonHierarchy:new q.PolygonHierarchy(q.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),e=q.PolygonGeometry.createGeometry(e),r=new q.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),r=new q.MaterialAppearance({translucent:!1,flat:!0,material:r});this.bottomSurface=new q.Primitive({geometryInstances:new q.GeometryInstance({geometry:e}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},e.prototype._createWellWall=function(e,t){var i=this._getMinHeight(e),n=[],o=[];for(let e=0;e<t.length;e++)n.push(this._ellipsoidToLonLat(t[e]).altitude),o.push(i);var e=new q.WallGeometry({positions:t,maximumHeights:n,minimumHeights:o}),e=q.WallGeometry.createGeometry(e),r=new q.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),r=new q.MaterialAppearance({translucent:!1,flat:!0,material:r});this.wellWall=new q.Primitive({geometryInstances:new q.GeometryInstance({geometry:e,attributes:{color:q.ColorGeometryInstanceAttribute.fromColor(q.Color.GREY)},id:"PitWall"}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},e.prototype._switchExcavate=function(e){e?(this.viewer.scene.globe.material=q.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)},e.prototype._updateExcavateDepth=function(e){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var t=this.wellData.lerp_pos,i=[],n=t.length,o=0;o<n;o++)i.push(q.Cartesian3.fromRadians(t[o].longitude,t[o].latitude,this.excavateMinHeight-e));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)},q.Scene.TerrainClipPlan=e},buildLightScanGraphics:function(e){if(this._viewer&&e){function t(t,e,i){var n,o,r,a,s,l,c=t.positionList,h=0,u=0;function d(e){n=c[e+1][0]-c[e][0],o=c[e+1][1]-c[e][1],r=n/t.number,a=o/t.number,u=0}d(h),e.polygon.hierarchy=new q.CallbackProperty(function(){return Math.abs(s)>=Math.abs(n)&&Math.abs(l)>=Math.abs(o)&&((h+=1)===c.length-1&&(h=0),i[0]=i[0]+s,i[1]=i[1]+l,i[2]=i[2]+s,i[3]=i[3]+l,d(h)),s=u*r,l=u*a,u++,new q.PolygonHierarchy(q.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))},!1)}for(var l=this,i=function(e,t,i,n){let o=[],r=Math.PI/180*Math.round(360/n),a=0;for(;a<n;a++){var s=t+e*Math.sin(r*a),l=i+e*Math.cos(r*a);o.unshift({x:s,y:l})}return o}(e.circle[0],e.circle[1],e.circle[2],e.circle[3]),n=function(e,t){for(var i=t.observer[0],n=t.observer[1],o=t.observer[2],r=[],a=0;a<e.length;a++){var s=a===e.length-1?new q.PolygonHierarchy(q.Cartesian3.fromDegreesArrayHeights([i,n,o,e[a].x,e[a].y,0,e[0].x,e[0].y,0])):new q.PolygonHierarchy(q.Cartesian3.fromDegreesArrayHeights([i,n,o,e[a].x,e[a].y,0,e[a+1].x,e[a+1].y,0])),s=l._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:s,outline:!1,perPositionHeight:!0,material:t.material}});r.push(s)}return r}(i,e),o=0;o<n.length;o++)o!==n.length-1?t(e,n[o],[i[o].x,i[o].y,i[o+1].x,i[o+1].y]):t(e,n[o],[i[o].x,i[o].y,i[0].x,i[0].y]);return n}},buildPathRoaming:function(e){if(this._viewer&&e&&e.paths){for(var t=e.paths,i=this.createGraphics(),n=[],o=0;o<t.length;o++){var r=q.Cartesian3.fromDegrees(Number(t[o].lng),Number(t[o].lat),Number(t[o].alt));n.push(r)}if(i.position=this._createSampledPosition(n),i.name=e.name||"路径漫游",i.availability=new q.TimeIntervalCollection([new q.TimeInterval({start:this.startTime,stop:this.stopTime})]),i.orientation=this._sampleOrientation(),e.polyline){const{width:t,material:o,clampToGround:r,...a}=e.polyline;i.polyline={positions:new q.CallbackProperty(function(){return n},!1),width:t||10,material:o||new q.PolylineGlowMaterialProperty({glowPower:1,color:q.Color.RED}),clampToGround:r||!0,resOpt:a}}return e.model&&(i.model=this.getModelGraphics(e.model)),e.label&&(i.label=this.getLabelGraphics(e)),e.billboard&&(i.billboard=this.getBillboardGraphics(e)),this.droneEntity=i,this._beginRoamTrace(e),this._viewer.entities.add(i)}},_beginRoamTrace(i){this._viewer.clock.onTick.addEventListener(()=>{var e,t;this._viewer.clock.shouldAnimate&&(t=this._viewer.clock.currentTime,e=this.droneEntity.position.getValue(t),t=this.droneEntity.orientation.getValue(t),e)&&t&&(t=q.Matrix4.fromRotationTranslation(q.Matrix3.fromQuaternion(t),e),this._viewer.camera.lookAtTransform(t,i.cameraOffset()))})},_createSampledPosition(t){this.startTime=q.JulianDate.now(),this.stopTime=q.JulianDate.addSeconds(this.startTime,60*t.length,new q.JulianDate),this._viewer.clock.startTime=this.startTime.clone(),this._viewer.clock.stopTime=this.stopTime.clone(),this._viewer.clock.currentTime=this.startTime.clone(),this._viewer.clock.clockRange=q.ClockRange.CLAMPED;var i=new q.SampledPositionProperty;for(let e=0;e<t.length;e++){var n=q.JulianDate.addSeconds(this.startTime,60*e,new q.JulianDate),o=t[e];i.addSample(n,o)}return i},_sampleOrientation(){let o,r,a;return new q.CallbackProperty(e=>{var t=this.droneEntity.position.getValue(e);if(r=this.droneEntity.position.getValue(q.JulianDate.addSeconds(e,1/60,new q.JulianDate)),t&&r){o=t;const e=q.Cartesian3.subtract(r,o,new q.Cartesian3),i=q.Cartesian3.normalize(e,new q.Cartesian3),n=q.Transforms.rotationMatrixFromPositionVelocity(o,i,q.Ellipsoid.WGS84);a=q.Quaternion.fromRotationMatrix(n)}return a},!1)},_installCss3Renderer:function(){function e(e,t){this._scratch=new q.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=e,this._isBackHide=t,this._parentEleId=0<e.length&&e[0].parentEleId||"info-warp",this.init()}var i;this._viewer&&(i=this._viewer,e.prototype.init=function(){var r=document.createElement("div");r.className="ys-css3-container";const e=this._parentEleId,a=document.getElementById(e);a.appendChild(r),this._container=r,this._elements=this._elements.filter(e=>e.position),this._elements.forEach(function(e){r.insertAdjacentHTML("beforeend",e.element)});var s=this;this._scene.preRender.addEventListener(function(){document.querySelectorAll(".close__box__btn").forEach(function(e){e.addEventListener("click",function(){a.contains(r)&&a.removeChild(r)})});for(var e=0;e<r.children.length;e++){var t,i=q.Cartesian3.fromDegrees(s._elements[e].position[0],s._elements[e].position[1],s._elements[e].position[2]||0),n=s._scene.cartesianToCanvasCoordinates(i,s._scratch);const a=s._elements[e].offset?s._elements[e].offset[0]:0,o=s._elements[e].offset?s._elements[e].offset[1]:0;q.defined(n)&&(r.children[e].style.left=parseFloat(n.x)+parseFloat(a)+"px",r.children[e].style.top=parseFloat(n.y)+parseFloat(o)+"px",s._isBackHide)&&(n=s._camera.position,t=s._scene.globe.ellipsoid.cartesianToCartographic(n).height,t+=+s._scene.globe.ellipsoid.maximumRadius,q.Cartesian3.distance(n,i)>t?r.children[e].style.display="none":r.children[e].style.display="block")}})},e.prototype.remove=function(e){this._elements=this._elements.filter(function(e){e.id}),this._container.removeChild(document.getElementById(e))},e.prototype.removeChild=function(){var e=document.getElementById(this._parentEleId);e.contains(this._container)&&e.removeChild(this._container)},e.prototype.append=function(e){this._elements.push(e),this._container.insertAdjacentHTML("beforeend",e.element)},e.prototype.removeEntityLayer=function(e){this._viewer.entities.removeById(e+"_1"),this._viewer.entities.removeById(e+"_2"),this._viewer.entities.removeById(e+"_3"),this.remove(e)},e.prototype.addEntityLayer=function(e){var t=e.position[0],i=e.position[1],n=this,o=(setTimeout(function(e){},300),q.Math.toRadians(30)),r=q.Math.toRadians(30),a=e.boxHeight||300,s=e.boxHeightMax||400,l=e.boxHeightDif||10,c=!0;e.boxShow?this._viewer.entities.add({id:e.id+"_1",name:"立方体盒子",position:new q.CallbackProperty(function(){return(a+=l)>=s&&(a=s),q.Cartesian3.fromDegrees(t,i,a/2)},!1),box:{dimensions:new q.CallbackProperty(function(){return(a+=l)>=s&&(a=s,c)&&(c=!1,n.append(e,!0)),new q.Cartesian3(e.boxSide||100,e.boxSide||100,a)},!1),material:e.boxMaterial||q.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){n.append(e,!0)},100),e.circleShow&&(e.circleSize=e.circleSize||120,this._viewer.entities.add({id:e.id+"_2",name:"椭圆",position:q.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new q.CallbackProperty(function(){return.001},!1),semiMajorAxis:new q.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new q.CallbackProperty(function(){return o+=.05},!1),stRotation:new q.CallbackProperty(function(){return o+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:e.id+"_3",name:"椭圆",position:q.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new q.CallbackProperty(function(){return.001},!1),semiMajorAxis:new q.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new q.CallbackProperty(function(){return r-=.03},!1),stRotation:new q.CallbackProperty(function(){return r-=.03},!1),zIndex:3}}))},q.Scene.Css3Renderer=e)},transformJD(e,t){t=300+e+2*t+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return(t+=2*(20*Math.sin(6*e*Z)+20*Math.sin(2*e*Z))/3)+2*(20*Math.sin(e*Z)+40*Math.sin(e/3*Z))/3+2*(150*Math.sin(e/12*Z)+300*Math.sin(e/30*Z))/3},transformWD(e,t){var i=2*e-100+3*t+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return(i+=2*(20*Math.sin(6*e*Z)+20*Math.sin(2*e*Z))/3)+2*(20*Math.sin(t*Z)+40*Math.sin(t/3*Z))/3+2*(160*Math.sin(t/12*Z)+320*Math.sin(t*Z/30))/3},gcj2wgs(e){var t=Number(e[0]),e=Number(e[1]),i=this.transformWD(t-105,e-35),n=this.transformJD(t-105,e-35),o=e/180*Z,r=Math.sin(o),r=1-Q*r*r,a=Math.sqrt(r),i=180*i/(J*(1-Q)/(r*a)*Z),r=2*t-(t+180*n/(J/a*Math.cos(o)*Z)),t=2*e-(e+i);return[r=Number(r.toFixed(6)),t=Number(t.toFixed(6))]},wgs2gcj(e){var t=Number(e[0]),e=Number(e[1]),i=this.transformWD(t-105,e-35),n=this.transformJD(t-105,e-35),o=e/180*Z,r=Math.sin(o),r=1-Q*r*r,a=Math.sqrt(r),e=e+180*i/(J*(1-Q)/(r*a)*Z),i=t+180*n/(J/a*Math.cos(o)*Z);return[i=Number(i.toFixed(6)),e=Number(e.toFixed(6))]},transformData(s,l,e){for(var c=this,h=e.paths,u=[],t=0;t<h.length;t++)!function(e){for(var t=h[e],i=[],n=[],e=t.distance,o=0;o<t.steps.length;o++){var r=t.steps[o],a=t.steps[o].instruction;r.polyline.split(";").forEach(function(e){e=e.split(","),e=c.gcj2wgs(e),i.push([e[0],e[1]])}),n.push(a)}i.unshift(s),i.push(l),u.push({lnglats:i,instructions:n,distance:e})}(t);return u},_queryDrivingRoute(e,i,n,o){if((i=i||{}).origin)if(i.destination){var r=i.key||this._queryRouteKey,a=(delete i.key,i.origin),s=(s=this.wgs2gcj(a))[0]+","+s[1],l=(delete i.origin,i.destination),c=(c=this.wgs2gcj(l))[0]+","+c[1],h=(delete i.destination,"");if(i.avoidpolygons)for(var u=0;u<i.avoidpolygons.length;u++){for(var d=i.avoidpolygons[u],p="",m="",g=0;g<d.length;g++){var f=d[g];m+=(f=this.wgs2gcj(f))[0]+","+f[1]+",",0==g&&(p=f[0]+","+f[1])}m+=p,u==i.avoidpolygons.length-1?h+=m:h+=m+"|"}delete i.avoidpolygons;var y={key:r,origin:s,destination:c,strategy:0,avoidpolygons:h,show_fields:"polyline"},y=Object.assign(y,i||{}),v=this;let t="";Object.keys(y).map(e=>{t+=t?`&${e}=`+y[e]:`?${e}=`+y[e]}),fetch(e+t).then(function(e){return e.json()}).then(function(e){"1"!=e.status||"10000"!=e.infocode?(console.log("查询失败!"),o&&o(e)):(e=v.transformData(a,l,e.route),n&&n(e))})}else alert("缺少终点坐标!");else alert("缺少起点坐标!")},queryPathPlan(e,t,i,n){let o;e===K.routeQueryType.DRIVE?(o=t.url||"https://restapi.amap.com/v5/direction/driving",delete t.url,this._queryDrivingRoute(o,t,i,n)):e===K.routeQueryType.WALK?(o=t.url||"https://restapi.amap.com/v3/direction/walking",delete t.url,this._queryWalkCycleRoute(o,t,i,n)):e===K.routeQueryType.CYCLE?(o=t.url||"https://restapi.amap.com/v5/direction/bicycling",delete t.url,this._queryWalkCycleRoute(o,t,i,n)):alert("查询参数type 错误(walk:步行,cycle:骑行)!")},_queryWalkCycleRoute(e,i,n,o){if((i=i||{}).origin)if(i.destination){var r,a=i.key||this._queryRouteKey,s=(delete i.key,i.origin),l=(this.wgs2gcj(s),s[0]+","+s[1]),c=(delete i.origin,i.destination),h=(this.wgs2gcj(c),c[0]+","+c[1]),u=(delete i.destination,{key:a,origin:l,destination:h,show_fields:"polyline"}),u=Object.assign(u,i||{}),d=this;let t="";Object.keys(u).map(e=>{t+=t?`&${e}=`+u[e]:`?${e}=`+u[e]}),fetch(e+t).then(function(e){return e.json()}).then(function(e){e.hasOwnProperty("errcode")?0!=e.errcode||"OK"!=e.errmsg?(console.log("查询失败!",e.errdetail),o&&o(e)):(r=d.transformData(s,c,e.data),n&&n(r)):e.hasOwnProperty("status")?"1"!=e.status||"10000"!=e.infocode?(console.log("查询失败!",e.info),o&&o(e)):(r=d.transformData(s,c,e.route),n&&n(r)):(console.log("查询失败,未知错误!"),o&&o(e))})}else alert("缺少终点坐标!");else alert("缺少起点坐标!")}};let $=null;function ee(e,t,i){e&&($=t,this._analysisLayer=new $.CustomDataSource("analysisLayer"),f.prototype={...f.prototype,...p.prototype},s.prototype={...s.prototype,...p.prototype},this.$math3d=new f(e,t),this.$graphics=new s(e,t),e)&&e.dataSources.add(this._analysisLayer)}function te(e){if(e&&e.positions){var t=e.positions,i=e.that,n=[],e=[],o=[],r=i.transformWGS84ToCartesian(t[0]),t=i.transformWGS84ToCartesian(t[1]),n=i.$graphics.createPointsGraphics({point:!0,positions:[r,t]}),a=i.$math3d.getIntersectObj(r,t,n,!0);if(0===a.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;for(let e=a.length-1;0<=e;e--){const l=a[e];$.defined(l.position)||a.splice(e,1)}if(!$.defined(a[0].position))throw new $.DeveloperError("position is undefined");var s=a[0].position,l=$.Cartesian3.distance(s,t)<5,s=[r,a[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:$.ArcType.NONE,material:new $.PolylineArrowMaterialProperty($.Color.GREEN)}});e.push(s),l||(s=[a[0].position,t],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:$.ArcType.NONE,material:new $.PolylineArrowMaterialProperty($.Color.RED)}}),e.push(s));for(let e=0;e<a.length;++e){var c,h=a[e].object;h&&(h instanceof $.Cesium3DTileFeature?(o.push(h),h.oldColor=h.color.clone(),h.color=$.Color.fromAlpha($.Color.YELLOW,h.color.alpha)):h.id instanceof $.Entity&&(c=(h=h.id).polygon||h.polyline,o.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=$.Color.fromAlpha($.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:a[e].position,ellipsoid:{radii:new $.Cartesian3(.8,.8,.8),material:$.Color.RED}}))}var s=$.Cartographic.fromCartesian(r),e=$.Cartographic.fromCartesian(t),s={longitude:s.longitude/Math.PI*180,latitude:s.latitude/Math.PI*180,height:s.height},e={longitude:e.longitude/Math.PI*180,latitude:e.latitude/Math.PI*180,height:e.height},r=Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2)+Math.pow(r.z-t.z,2)),t=Math.abs(e.height-s.height),u=Math.sqrt(Math.pow(r,2)+Math.pow(t,2)),l=l?"是":"否",s="起点坐标: ("+s.longitude.toFixed(6)+"°,"+s.latitude.toFixed(6)+"°,"+s.height.toFixed(2)+")\n终点坐标: ("+e.longitude.toFixed(6)+"°,"+e.latitude.toFixed(6)+"°,"+e.height.toFixed(2)+")\n垂直距离: "+t.toFixed(2)+"m\n水平距离: "+r.toFixed(2)+"m\n空间距离: "+u.toFixed(2)+"m\n是否可视: "+l;n&&n[0]&&(n[0].label={text:s,showBackground:!0,font:"14px monospace",fillColor:$.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:$.VerticalOrigin.BOTTOM,horizontalOrigin:$.HorizontalOrigin.LEFT})}te.prototype.remove=function(){}}function ie(e){if(!e&&!e.center&&!e.radius&&e.that)return alert("没有获取到分析参数"),!1;var l=e.that,t=this;if(!l._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var c=e.viewHeight||10,i=$.Cartographic.fromCartesian(e.center);try{var n=e.radius,o={},r=(o.semiMinorAxis=n,o.semiMajorAxis=n,o.rotation=0,o.center=e.center,o.granularity=Math.PI/30,l.computeEllipseEdgePositions(o));for(let e=0;e<r.outerPositions.length;e+=3){var a=new $.Cartesian3(r.outerPositions[e],r.outerPositions[e+1],r.outerPositions[e+2]),s=$.Cartographic.fromCartesian(a),h=5e-4*Math.PI/180,u=l.computeInterpolateLineCartographic(i,s,h);l.computeCartographicPointsTerrainData(u,function(r){if(0<r.length){let i=!0,n=[],o=[];for(let e=1;e<r.length;e++){let t=!0;if(1<e){var a=new $.Cartographic(r[0].longitude,r[0].latitude,r[0].height+c);if(i)t=l.computeInterpolateIndexLineHeightCartographic(a,r[e],e,e-1).height>=r[e-1].height?i=!0:i=!1;else{var s=l.computeInterpolateIndexLineHeightCartographic(a,r[e],e,e-1);for(let e=0;e<s.length;e++){if(!(s[e].height>=r[e].height)){i=!1,t=!1;break}i=!0,t=!0}}}a=$.Cartesian3.fromRadians(r[e].longitude,r[e].latitude,r[e].height+1);n.push(a),t?(o.push(0),o.push(0),o.push(1)):(o.push(1),o.push(0),o.push(0)),o.push(1)}t._pointsKSYResult=new $.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:o})}else alert("高程异常!")})}}catch(e){console.log(e)}ie.prototype.remove=function(){}}function ne(e){if(e&&e.positions){for(var t=e.positions,i=e.that,o=i.transformWGS84ToCartesian(t[0]),r=i.transformWGS84ToCartesian(t[1]),a=[$.Cartographic.fromCartesian(o)],s=new $.Cartesian3,l=[0],c=[0],h=1;h<=10;h++){$.Cartesian3.lerp(o,r,h/10,s);var u=$.Cartographic.fromCartesian(s),d=i._viewer.scene.globe.getHeight(u),d=(u.height=d,a.push(u),a[h-1]),p=$.Cartesian3.distance($.Cartographic.toCartesian(d),$.Cartographic.toCartesian(u));c.push(c[h-1]+p),u=Math.asin((u.height-d.height)/p),l.push(100*Math.tan(u))}e=document.createElement("div"),t=(e.className="echart-viewer",i._viewer.container.appendChild(e,"dark",{renderer:"canvas",width:640,height:480}),e.style.position="absolute",e.style.left="20px",e.style.bottom="20px",e.style.height="300px",e.style.width="640px",e.style.overflow="hidden",e.style.zIndex="9999",{title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!(e.style.opacity=.9),feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0,xAxis:[{type:"category",name:"长度(米)",boundaryGap:!1,data:c,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"坡度(%)",axisLabel:{formatter:function(e){return e.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"坡度",type:"line",areaStyle:{},smooth:!0,data:l,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]});n.init(e).setOption(t)}}function re(e){if(e&&e.positions&&e.that){var t=e.that,e=e.positions,i=this;if(t._viewer.terrainProvider.availability){var n=Math.PI/Math.pow(2,11);n/=64;var o,r,a,s,l,c,h,u,n=new $.PolygonGeometry.fromPositions({positions:e,vertexFormat:$.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:n}),d=new $.PolygonGeometry.createGeometry(n),p=0,m=0,g=new $.Cartesian3;for(let e=0;e<d.indices.length;e+=3){h=d.indices[e],r=d.indices[e+1],l=d.indices[e+2],c=d.attributes.position.values,g.x=c[3*h],g.y=c[3*h+1],g.z=c[3*h+2],h=$.Cartographic.fromCartesian(g),o=t._viewer.scene.globe.getHeight(h),a=$.Cartesian3.fromRadians(h.longitude,h.latitude,o),u=$.Cartesian3.fromRadians(h.longitude,h.latitude,0),m<o&&(m=o),g.x=c[3*r],g.y=c[3*r+1],g.z=c[3*r+2],h=$.Cartographic.fromCartesian(g),r=t._viewer.scene.globe.getHeight(h),s=$.Cartesian3.fromRadians(h.longitude,h.latitude,r),y=$.Cartesian3.fromRadians(h.longitude,h.latitude,0),m<r&&(m=r),g.x=c[3*l],g.y=c[3*l+1],g.z=c[3*l+2],h=$.Cartographic.fromCartesian(g),c=t._viewer.scene.globe.getHeight(h),l=$.Cartesian3.fromRadians(h.longitude,h.latitude,c),m<c&&(m=c),u=u,y=y,h=$.Cartesian3.fromRadians(h.longitude,h.latitude,0),u=((f=$.Cartesian3.distance(u,y))+(y=$.Cartesian3.distance(y,h))+(h=$.Cartesian3.distance(h,u)))/2,p+=Math.sqrt(u*(u-f)*(u-y)*(u-h))*(o-15e3+r-15e3+c-15e3)/3;var f=[],y=(f.push(a),f.push(s),f.push(l),{polygon:{hierarchy:{positions:f},extrudedHeight:0,perPositionHeight:!0,material:$.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:$.Color.WHITE,outlineWidth:2}});t._analysisLayer.entities.add(y)}n=function(e){for(var t=[],i=[],n=0;n<e.length;n++){var o=$.Cartographic.fromCartesian(e[n]);t.push(o.longitude),i.push(o.latitude)}for(var r,a,s,l=0,c=0,h=0,u=0,d=0,n=0;n<e.length;n++)h+=s=(r=t[n])*(c=n==e.length-1?(l=t[0],i[0]):(l=t[n+1],i[n+1]))-l*(a=i[n]),u+=(r+l)*s,d+=(a+c)*s;return u/=6*(h*=.5),d/=6*h,new $.Cartographic(u,d)}(e),i._volumeLabel=t._analysisLayer.entities.add({position:$.Cartesian3.fromRadians(n.longitude,n.latitude,m+1e3),label:{text:"Cut Volume "+p.toString()+"m3"}})}else alert("未获取到地形")}}ee.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new te({positions:e,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(t),"function"==typeof i.callback&&i.callback(e)}})},createLookAroundAnalysis:function(i){var n;i=i||{},this._viewer&&i&&(n=this).drawCircleGraphics({callback:function(e,t){n._drawLayer.entities.remove(t);t=new ie({that:n,radius:e.radius,center:e.center});"function"==typeof i.callback&&i.callback(t)}})},createVisualFieldAnalysis:function(e){var i,n;e=e||{},this._viewer&&e&&(n=null,(i=this).bindHandelEvent({leftClick:function(e,t){e=i._viewer.scene.pickPosition(e.position);if(!e)return!1;$.defined(n)?t.destroy():(n=new $.Scene.ShadowPrimitive({scene:i._viewer.scene,viewerPosition:e}),i._analysisLayer._primitives.add(n))},mouseMove:function(e){e=i._viewer.scene.pickPosition(e.endPosition);if(!e)return!1;n&&n.setPoseByTargetPoint(e)}}))},createClipPlanAnalysis:function(i){var n,o,r,a,s;i=i||{},this._viewer&&i&&(n=this,o=i.height||30,r=i.splitNum||50,a=i.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",s=i.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg",n.drawPolygonGraphics({callback:function(e,t){n._drawLayer.entities.remove(t);t=new $.Scene.TerrainClipPlan(n._viewer,{height:o,splitNum:r,wallImg:a,bottomImg:s}),e=n.transformWGS84ArrayToCartesianArray(e);t.updateData(e),"function"==typeof i.callback&&i.callback(t)}}))},createSubmergedAnalysis:function(e){var t,n,o,r,a;e=e||{},this._viewer&&e&&(t=this,n=e.maxH||15,o=e.speed||1,r=e.interval||10,a=e.matrialUrl||this.getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png",t.drawPolygonGraphics({height:1,callback:function(e,i){if(!t._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;i&&setTimeout(()=>{i.polygon.heightReference="CLAMP_TO_GROUND",i.polygon.material=a;var e=0,t=(i.polygon.extrudedHeight=e,setInterval(function(){(e+=o)>=n&&(e=n,clearTimeout(t)),i.polygon.extrudedHeight=e},r))},2e3)}}))},createSlopeAnalysis:function(i){if(i=i||{},!n)return alert("需要引入echarts库"),!1;var o=this;this._viewer&&i&&o.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new ne({positions:e,that:o});o._graphicsLayer&&o._graphicsLayer.entities.remove(t),"function"==typeof i.callback&&i.callback(e)}})},createCutVolumeAnalysis:function(t){var i;t=t||{},this._viewer&&t&&(i=this).drawWallGraphics({callback:function(e){e=new re({positions:i.transformWGS84ArrayToCartesianArray(e,100),that:i});"function"==typeof t.callback&&t.callback(e)}})}};var oe={version:"1.0.0",PlotUtils:{}},ae=(oe.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},oe.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=oe.PlotUtils.distance(e[i],e[i+1]);return t},oe.PlotUtils.getBaseLength=function(e){return Math.pow(oe.PlotUtils.wholeDistance(e),.99)},oe.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},oe.PlotUtils.getCircleCenterOfThreePoints=function(e,t,i){var n=[(e[0]+t[0])/2,(e[1]+t[1])/2],t=[n[0]-e[1]+t[1],n[1]+e[0]-t[0]],o=[(e[0]+i[0])/2,(e[1]+i[1])/2],e=[o[0]-e[1]+i[1],o[1]+e[0]-i[0]];return oe.PlotUtils.getIntersectPoint(n,t,o,e)},oe.PlotUtils.getIntersectPoint=function(e,t,i,n){var o,r,a;return e[1]==t[1]?[(o=(n[0]-i[0])/(n[1]-i[1]))*(e[1]-i[1])+i[0],r=e[1]]:i[1]==n[1]?[(a=(t[0]-e[0])/(t[1]-e[1]))*(i[1]-e[1])+e[0],r=i[1]]:(a=(t[0]-e[0])/(t[1]-e[1]),o=(n[0]-i[0])/(n[1]-i[1]),[a*(r=(a*e[1]-e[0]-o*i[1]+i[0])/(a-o))-a*e[1]+e[0],r])},oe.PlotUtils.getAzimuth=function(e,t){var i,n=Math.asin(Math.abs(t[1]-e[1])/oe.PlotUtils.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=n+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=oe.Constants.TWO_PI-n:t[1]<e[1]&&t[0]<e[0]?i=n:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-n),i},oe.PlotUtils.getAngleOfThreePoints=function(e,t,i){e=oe.PlotUtils.getAzimuth(t,e)-oe.PlotUtils.getAzimuth(t,i);return e<0?e+oe.Constants.TWO_PI:e},oe.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},oe.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},oe.PlotUtils.getCubicValue=function(e,t,i,n,o){var r=1-(e=Math.max(Math.min(e,1),0)),a=e*e,s=a*e,l=r*r,c=l*r;return[c*t[0]+3*l*e*i[0]+3*r*a*n[0]+s*o[0],c*t[1]+3*l*e*i[1]+3*r*a*n[1]+s*o[1]]},oe.PlotUtils.getThirdPoint=function(e,t,i,n,o){e=oe.PlotUtils.getAzimuth(e,t),o=o?e+i:e-i,e=n*Math.cos(o),i=n*Math.sin(o);return[t[0]+e,t[1]+i]},oe.PlotUtils.getArcPoints=function(e,t,i,n){for(var o=[],r=(r=n-i)<0?r+oe.Constants.TWO_PI:r,a=0;a<=oe.Constants.FITTING_COUNT;a++){var s=i+r*a/oe.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);o.push([l,s])}return o},oe.PlotUtils.getBisectorNormals=function(e,t,i,n){var o,r,a=oe.PlotUtils.getNormal(t,i,n),s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=a[0]/s,a=a[1]/s,c=oe.PlotUtils.distance(t,i),h=oe.PlotUtils.distance(i,n),s=s>oe.Constants.ZERO_TOLERANCE?oe.PlotUtils.isClockWise(t,i,n)?(o=[i[0]-(r=e*c)*a,i[1]+r*l],[i[0]+(r=e*h)*a,i[1]-r*l]):(o=[i[0]+(r=e*c)*a,i[1]-r*l],[i[0]-(r=e*h)*a,i[1]+r*l]):(o=[i[0]+e*(t[0]-i[0]),i[1]+e*(t[1]-i[1])],[i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])]);return[o,s]},oe.PlotUtils.getNormal=function(e,t,i){var n=e[0]-t[0],e=e[1]-t[1],o=Math.sqrt(n*n+e*e),o=(n/=o,e/=o,i[0]-t[0]),i=i[1]-t[1],t=Math.sqrt(o*o+i*i);return[n+(o/=t),e+(i/=t)]},oe.PlotUtils.getCurvePoints=function(e,t){for(var i=[oe.PlotUtils.getLeftMostControlPoint(t)],n=0;n<t.length-2;n++)var o=t[n],r=t[n+1],a=t[n+2],a=oe.PlotUtils.getBisectorNormals(e,o,r,a),i=i.concat(a);for(var s=oe.PlotUtils.getRightMostControlPoint(t),l=(i.push(s),[]),n=0;n<t.length-1;n++){for(o=t[n],r=t[n+1],l.push(o),e=0;e<oe.Constants.FITTING_COUNT;e++){var c=oe.PlotUtils.getCubicValue(e/oe.Constants.FITTING_COUNT,o,i[2*n],i[2*n+1],r);l.push(c)}l.push(r)}return l},oe.PlotUtils.getLeftMostControlPoint=function(e){var i,n,o,r,a,s=e[0],l=e[1],e=e[2],c=oe.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=oe.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>oe.Constants.ZERO_TOLERANCE?(e=oe.PlotUtils.mid(s,l),o=s[0]-e[0],i=s[1]-e[1],n=2/oe.PlotUtils.distance(s,l),r=c[0]-e[0],c=c[1]-e[1],a=e[0]+((i=-n*i)*i-(n=n*o)*n)*r+(o=2*i*n)*c,e[1]+o*r+(n*n-i*i)*c):(a=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[a,e]},oe.PlotUtils.getRightMostControlPoint=function(e){var i,n,o,r,a,s=e.length,l=e[s-3],c=e[s-2],e=e[s-1],s=oe.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=oe.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>oe.Constants.ZERO_TOLERANCE?(l=oe.PlotUtils.mid(c,e),o=e[0]-l[0],i=e[1]-l[1],n=2/oe.PlotUtils.distance(c,e),r=s[0]-l[0],s=s[1]-l[1],a=l[0]+((i=-n*i)*i-(n=n*o)*n)*r+(o=2*i*n)*s,l[1]+o*r+(n*n-i*i)*s):(a=e[0]+t*(c[0]-e[0]),e[1]+t*(c[1]-e[1]));return[a,l]},oe.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;for(var t=[],i=e.length-1,n=0;n<=1;n+=.01){for(var o=0,r=0,a=0;a<=i;a++){var s=oe.PlotUtils.getBinomialFactor(i,a),l=Math.pow(n,a),c=Math.pow(1-n,i-a);o+=s*l*c*e[a][0],r+=s*l*c*e[a][1]}t.push([o,r])}return t.push(e[i]),t},oe.PlotUtils.getBinomialFactor=function(e,t){return oe.PlotUtils.getFactorial(e)/(oe.PlotUtils.getFactorial(t)*oe.PlotUtils.getFactorial(e-t))},oe.PlotUtils.getFactorial=function(e){if(e<=1)return 1;if(2==e)return 2;if(3==e)return 6;if(4==e)return 24;if(5==e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},oe.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;var t=[],i=e.length-2-1;t.push(e[0]);for(var n=0;n<=i;n++)for(var o=0;o<=1;o+=.05){for(var r=0,a=0,s=0;s<=2;s++){var l=oe.PlotUtils.getQuadricBSplineFactor(s,o);r+=l*e[n+s][0],a+=l*e[n+s][1]}t.push([r,a])}return t.push(e[e.length-1]),t},oe.PlotUtils.getQuadricBSplineFactor=function(e,t){return 0==e?Math.pow(t-1,2)/2:1==e?(-2*Math.pow(t,2)+2*t+1)/2:2==e?Math.pow(t,2)/2:0},oe.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},{version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"}),se="doublearrow",le={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},ce={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};ae.algorithm={},ae.algorithm.doubleArrow=function(e,t){this.connPoint=null;var i={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((a=(this.points=e).length)<2)){if(2==a)return e;var n=this.points[0],o=this.points[1],r=this.points[2],a=e.length,a=(this.tempPoint4=3==a?ae.algorithm.getTempPoint4(n,o,r):this.points[3],this.connPoint=3==a||4==a?oe.PlotUtils.mid(n,o):this.points[4],e=oe.PlotUtils.isClockWise(n,o,r)?(h=ae.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),ae.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(h=ae.algorithm.getArrowPoints(o,this.connPoint,r,!1),ae.algorithm.getArrowPoints(this.connPoint,n,this.tempPoint4,!0)),h.length),s=(a-5)/2,l=h.slice(0,s),c=h.slice(s,5+s),h=h.slice(5+s,a),u=e.slice(0,s),d=e.slice(s,5+s),e=e.slice(5+s,a),u=oe.PlotUtils.getBezierPoints(u),s=oe.PlotUtils.getBezierPoints(e.concat(l.slice(1))),h=oe.PlotUtils.getBezierPoints(h),a=u.concat(d,s,c,h),e=ae.algorithm.array2Dto1D(a);i.controlPoint=[n,o,r,this.tempPoint4,this.connPoint],i.polygonalPoint=t.Cartesian3.fromDegreesArray(e)}return i},ae.algorithm.threeArrow=function(e){this.connPoint=null,this.tempPoint4=null;var t={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(r=(this.points=e).length)){if(2==r)return e;var i=this.points[0],n=this.points[1],o=this.points[2],r=(3==(r=e.length)?(this.tempPoint4=ae.algorithm.getTempPoint4(i,n,o),this.tempPoint5=oe.PlotUtils.mid(o,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=r<6?oe.PlotUtils.mid(i,n):this.points[5],e=oe.PlotUtils.isClockWise(i,n,o)?(c=ae.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),ae.algorithm.getArrowPoints(this.connPoint,n,o,!0)):(c=ae.algorithm.getArrowPoints(n,this.connPoint,o,!1),ae.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),a=(r-5)/2,s=c.slice(0,a),l=c.slice(a,5+a),c=c.slice(5+a,r),h=e.slice(0,a),u=e.slice(a,5+a),e=e.slice(5+a,r),h=oe.PlotUtils.getBezierPoints(h),a=oe.PlotUtils.getBezierPoints(e.concat(s.slice(1))),c=oe.PlotUtils.getBezierPoints(c),r=h.concat(u,a,l,c),e=ae.algorithm.array2Dto1D(r);t.controlPoint=[i,n,o,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},ae.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},ae.algorithm.getArrowPoints=function(e,t,i,n){this.type=se,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var o=oe.PlotUtils.mid(e,t),r=oe.PlotUtils.distance(o,i),a=oe.PlotUtils.getThirdPoint(i,o,0,.3*r,!0),s=oe.PlotUtils.getThirdPoint(i,o,0,.5*r,!0),a=[o,oe.PlotUtils.getThirdPoint(o,a,oe.Constants.HALF_PI,r/5,n),oe.PlotUtils.getThirdPoint(o,s,oe.Constants.HALF_PI,r/4,n),i],o=ae.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=o[0],r=o[4],n=oe.PlotUtils.distance(e,t)/oe.PlotUtils.getBaseLength(a)/2,i=ae.algorithm.getArrowBodyPoints(a,s,r,n),a=i.length,n=i.slice(0,a/2),i=i.slice(a/2,a);return n.push(s),i.push(r),(n=n.reverse()).push(t),(i=i.reverse()).push(e),n.reverse().concat(o,i)},ae.algorithm.getArrowHeadPoints=function(e,t,i){this.type=se,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var n=oe.PlotUtils.getBaseLength(e)*this.headHeightFactor,o=e[e.length-1],t=(oe.PlotUtils.distance(t,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,r=n*this.neckHeightFactor,n=oe.PlotUtils.getThirdPoint(e[e.length-2],o,0,n,!0),e=oe.PlotUtils.getThirdPoint(e[e.length-2],o,0,r,!0),r=oe.PlotUtils.getThirdPoint(o,n,oe.Constants.HALF_PI,t,!1),n=oe.PlotUtils.getThirdPoint(o,n,oe.Constants.HALF_PI,t,!0);return[oe.PlotUtils.getThirdPoint(o,e,oe.Constants.HALF_PI,i,!1),r,o,n,oe.PlotUtils.getThirdPoint(o,e,oe.Constants.HALF_PI,i,!0)]},ae.algorithm.getArrowBodyPoints=function(e,t,i,n){for(var o=oe.PlotUtils.wholeDistance(e),r=oe.PlotUtils.getBaseLength(e)*n,a=(r-oe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=oe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(r/2-(s+=oe.PlotUtils.distance(e[h-1],e[h]))/o*a)/Math.sin(u),p=oe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=oe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ae.algorithm.getTempPoint4=function(e,t,i){var n,o,r,t=oe.PlotUtils.mid(e,t),a=oe.PlotUtils.distance(t,i),i=oe.PlotUtils.getAngleOfThreePoints(e,t,i),a=i<oe.Constants.HALF_PI?(n=a*Math.sin(i),o=a*Math.cos(i),r=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!1),oe.PlotUtils.getThirdPoint(t,r,oe.Constants.HALF_PI,o,!0)):i>=oe.Constants.HALF_PI&&i<Math.PI?(n=a*Math.sin(Math.PI-i),o=a*Math.cos(Math.PI-i),r=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!1),oe.PlotUtils.getThirdPoint(t,r,oe.Constants.HALF_PI,o,!1)):i>=Math.PI&&i<1.5*Math.PI?(n=a*Math.sin(i-Math.PI),o=a*Math.cos(i-Math.PI),r=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!0),oe.PlotUtils.getThirdPoint(t,r,oe.Constants.HALF_PI,o,!0)):(n=a*Math.sin(2*Math.PI-i),o=a*Math.cos(2*Math.PI-i),r=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!0),oe.PlotUtils.getThirdPoint(t,r,oe.Constants.HALF_PI,o,!1));return a},ae.algorithm.tailedAttackArrow=function(e,t){e=ae.algorithm.dereplication(e),this.tailWidthFactor=le.tailWidthFactor,this.swallowTailFactor=le.swallowTailFactor,this.swallowTailPnt=le.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(!((i.controlPoint=e).length<2)){if(2==e.length)return i.polygonalPoint=e,i;var n=e[0],o=e[1],e=(oe.PlotUtils.isClockWise(e[0],e[1],e[2])&&(n=e[1],o=e[0]),[oe.PlotUtils.mid(n,o)].concat(e.slice(2))),r=ae.algorithm.getAttackArrowHeadPoints(e,n,o,le),a=r[0],s=r[4],l=oe.PlotUtils.distance(n,o),c=oe.PlotUtils.getBaseLength(e),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=oe.PlotUtils.getThirdPoint(e[1],e[0],0,h,!0);h=ae.algorithm.getAttackArrowBodyPoints(e,a,s,l/c),e=h.length,l=[n].concat(h.slice(0,e/2));l.push(a);c=[o].concat(h.slice(e/2,e));c.push(s),l=oe.PlotUtils.getQBSplinePoints(l),c=oe.PlotUtils.getQBSplinePoints(c),n=ae.algorithm.array2Dto1D(l.concat(r,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=t.Cartesian3.fromDegreesArray(n)}return i},ae.algorithm.getAttackArrowHeadPoints=function(e,t,i,n){this.headHeightFactor=n.headHeightFactor,this.headTailFactor=n.headTailFactor,this.headWidthFactor=n.headWidthFactor,this.neckWidthFactor=n.neckWidthFactor,this.neckHeightFactor=n.neckHeightFactor;var n=oe.PlotUtils.getBaseLength(e)*this.headHeightFactor,o=e[e.length-1],r=oe.PlotUtils.distance(o,e[e.length-2]),t=oe.PlotUtils.distance(t,i),i=(n=n>t*this.headTailFactor?t*this.headTailFactor:n)*this.headWidthFactor,t=n*this.neckWidthFactor,r=(n=r<n?r:n)*this.neckHeightFactor,n=oe.PlotUtils.getThirdPoint(e[e.length-2],o,0,n,!0),e=oe.PlotUtils.getThirdPoint(e[e.length-2],o,0,r,!0),r=oe.PlotUtils.getThirdPoint(o,n,oe.Constants.HALF_PI,i,!1),n=oe.PlotUtils.getThirdPoint(o,n,oe.Constants.HALF_PI,i,!0);return[oe.PlotUtils.getThirdPoint(o,e,oe.Constants.HALF_PI,t,!1),r,o,n,oe.PlotUtils.getThirdPoint(o,e,oe.Constants.HALF_PI,t,!0)]},ae.algorithm.getAttackArrowBodyPoints=function(e,t,i,n){for(var o=oe.PlotUtils.wholeDistance(e),r=oe.PlotUtils.getBaseLength(e)*n,a=(r-oe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=oe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(r/2-(s+=oe.PlotUtils.distance(e[h-1],e[h]))/o*a)/Math.sin(u),p=oe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=oe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ae.algorithm.dereplication=function(e){var t=e[e.length-1],i=!1,n=[],n=e.filter(function(e){if(e[0]!=t[0]&&e[1]!=t[1])return e;i=!0});return i&&n.push(t),n},ae.algorithm.fineArrow=function(e,t,i){var n,o,r,a,s,l,c;if(!(e.length<2||t.length<2))return n=ce.tailWidthFactor,c=ce.neckWidthFactor,s=ce.headWidthFactor,a=ce.headAngle,l=ce.neckAngle,(o=[])[0]=e,o[1]=t,e=o[0],t=o[1],c=(o=oe.PlotUtils.getBaseLength(o))*c,s=o*s,n=oe.PlotUtils.getThirdPoint(t,e,oe.Constants.HALF_PI,o=o*n,!0),o=oe.PlotUtils.getThirdPoint(t,e,oe.Constants.HALF_PI,o,!1),r=oe.PlotUtils.getThirdPoint(e,t,a,s,!1),a=oe.PlotUtils.getThirdPoint(e,t,a,s,!0),s=oe.PlotUtils.getThirdPoint(e,t,l,c,!1),l=oe.PlotUtils.getThirdPoint(e,t,l,c,!0),(c=[]).push(n[0],n[1],s[0],s[1],r[0],r[1],t[0],t[1],a[0],a[1],l[0],l[1],o[0],o[1],e[0],e[1]),c.some(e=>isNaN(e))?"":i.Cartesian3.fromDegreesArray(c)};let he=null;function ue(e,t){this.viewer=e,he=t,this.handler=new he.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=he.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=ae,this.tooltip=new _(e,t),this.tooltip.initTool()}ue.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},ue.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new he.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let de=null;var pe=function(e,t){ue.call(this,e,t),de=t,this.type="AttackArrow",this.fillMaterial=de.Color.RED.withAlpha(.5)};function me(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}pe.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new de.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){let t=null;t="object"==typeof e?(this.fillMaterial=e.fillMaterial,e.callback):e,this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new de.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){var e=me(e.position,i.viewer);e&&(0==i.positions.length&&(i.floatPoint=i.creatPoint(e),i.floatPoint.wz=-1),i.positions.push(e),e=i.creatPoint(e),2<i.positions.length?e.wz=i.positions.length-1:e.wz=i.positions.length,i.pointArr.push(e))},de.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!i.floatPoint||i.positions.length<2||(e=me(e.endPosition,i.viewer))&&(i.floatPoint.position.setValue(e),i.tooltip.showAtCartesian(e,"右键结束!"),2<=i.positions.length)&&(de.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),i.arrowEntity.objId=i.objId,t&&t(i.objId)))},de.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){e=me(e.position,i.viewer);if(e){for(var t=0;t<i.pointArr.length;t++)i.pointArr[t].show=!1;i.floatPoint.show=!1,i.viewer.entities.remove(i.floatPoint),i.floatPoint=null;e=i.creatPoint(e);e.show=!1,e.wz=i.positions.length,i.pointArr.push(e),i.handler.destroy(),i.handler=null,i.tooltip.setVisible(!1),i.arrowEntity=null}},de.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var n=de.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}for(this.positions=t,i=0;i<this.positions.length;i++){var o=this.creatPoint(this.positions[i]);o.show=!1,o.wz=i+1,this.pointArr.push(o)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new de.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=n.viewer.scene.pick(e.position);if(de.defined(t)&&t.id)n.clickStep++,t.id.objId||(n.selectPoint=t.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null,n.tooltip.setVisible(!1)}2==n.clickStep&&(n.clickStep=0,t=me(e.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.selectPoint=null)},de.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=me(e.endPosition,n.viewer);e&&(n.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),n.selectPoint)&&(n.selectPoint.position.setValue(e),n.positions[n.selectPoint.wz-1]=e)},de.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){e=this.viewer.entities.add({position:e,point:{pixelSize:10,color:de.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(r){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new de.PolygonGraphics({hierarchy:new de.CallbackProperty(function(){if(r.length<3)return null;for(var e=[],t=0;t<r.length;t++){var i=a.cartesianToLatlng(r[t]);e.push(i)}var n=a.xp.algorithm.tailedAttackArrow(e,de),o=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(o=n.polygonalPoint),new de.PolygonHierarchy(o)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=de.Math.toDegrees(e.latitude);return[de.Math.toDegrees(e.longitude),t]}},(pe.prototype=Object.create(Object.assign({},pe.prototype,ue.prototype))).constructor=pe;let fe=null;var ge=function(e,t){ue.call(this,e,t),fe=t,this.type="StraightArrow",this.fillMaterial=fe.Color.fromCssColorString("#0000FF").withAlpha(.8)};function ve(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}ge.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new fe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){let t=null;t="object"==typeof e?(this.fillMaterial=e.fillMaterial,e.callback):e,this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new fe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=ve(e.position,i.viewer);e&&(0==i.positions.length&&(i.firstPoint=i.creatPoint(e),i.firstPoint.type="firstPoint",i.floatPoint=i.creatPoint(e),i.floatPoint.type="floatPoint",i.positions.push(e),i.firstPoint.position.setValue(e),i.firstPoint.show=!0),i.positions&&3==i.positions.length&&(i.firstPoint.show=!1,i.floatPoint.show=!1,i.handler.destroy(),i.handler=null,i.tooltip.setVisible(!1),i.arrowEntity=null),i.positions.push(e.clone()))},fe.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){i.positions.length<1||(e=ve(e.endPosition,i.viewer))&&(i.tooltip.showAtCartesian(e,"左键单击结束!"),i.floatPoint.position.setValue(e),2<=i.positions.length)&&(fe.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),t&&t(i.objId)))},fe.ScreenSpaceEventType.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var i=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new fe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);fe.defined(t)&&t.id?(i.clickStep++,t.id.objId||(i.selectPoint=t.id)):(i.modifyHandler.destroy(),i.modifyHandler=null,i.firstPoint.show=!1,i.floatPoint.show=!1,i.state=-1,i.tooltip.setVisible(!1)),2==i.clickStep&&(i.clickStep=0,t=ve(e.position,i.viewer))&&i.selectPoint&&i.selectPoint.position&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},fe.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=ve(e.endPosition,i.viewer);e&&(i.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),i.selectPoint)&&i.selectPoint.position&&(i.selectPoint.position.setValue(e),"firstPoint"==i.selectPoint.type&&(i.positions[1]=e),"floatPoint"==i.selectPoint.type)&&(i.positions[2]=e)},fe.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(e){this.state=-1,this.positions=[];for(var t=[],i=0;i<e.length;i++){var n=fe.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}this.positions=t,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){e=this.viewer.entities.add({position:e,point:{pixelSize:10,color:fe.Color.RED}});return e.attr="editPoint",e},showArrowOnMap:function(a){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new fe.PolygonGraphics({hierarchy:new fe.CallbackProperty(function(){if(a.length<2)return null;var e=a[1],t=a[2],e=s.cartesianToLatlng(e),t=s.cartesianToLatlng(t),i=[],n=s.xp.algorithm.fineArrow([e[0],e[1]],[t[0],t[1]],fe);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var o=0;o<n.length;o++){var r=new fe.Cartesian3(n[o].x,n[o].y,n[o].z);i.push(r)}return new fe.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=fe.Math.toDegrees(e.latitude);return[fe.Math.toDegrees(e.longitude),t]}},(ge.prototype=Object.create(Object.assign({},ge.prototype,ue.prototype))).constructor=ge;let ye=null;var _e=function(e,t){ue.call(this,e,t),ye=t,this.type="PincerArrow",this.fillMaterial=ye.Color.YELLOW.withAlpha(.8)};function we(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}_e.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new ye.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){let t=null;t="object"==typeof e?(this.fillMaterial=e.fillMaterial,e.callback):e,this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=this;this.state=1,this.handler||(this.handler=new ye.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=we(e.position,n.viewer);if(e)if(0==n.positions.length&&(n.floatPoint=n.creatPoint(e)),4<n.positions.length){(i=n.creatPoint(e)).wz=n.positions.length,n.pointArr.push(i);for(var t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!1;n.floatPoint&&(n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null)}else{n.positions.push(e);var i=n.creatPoint(e);2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},ye.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!n.floatPoint||n.positions.length<2||(e=we(e.endPosition,n.viewer))&&(n.floatPoint.position.setValue(e),n.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.positions.length)&&(ye.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(e)):(n.positions.push(e),n.arrowEntity=n.showArrowOnMap(n.positions),n.arrowEntity.objId=n.objId,t&&t(n.objId)))},ye.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){if(4<=n.positions.length){e=we(e.position,n.viewer);if(e){for(var t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;e=n.creatPoint(e);e.show=!1,e.wz=n.positions.length,n.pointArr.push(e),n.handler.destroy(),n.handler=null,n.tooltip.setVisible(!1),n.arrowEntity=null}}},ye.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var n=ye.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}for(this.positions=t,i=0;i<this.positions.length;i++){var o=this.creatPoint(this.positions[i]);o.show=!1,o.wz=i+1,this.pointArr.push(o)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;var i=this;for(let e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new ye.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);if(ye.defined(t)&&t.id)i.clickStep++,t.id.objId||(i.selectPoint=t.id);else{for(let e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!1;i.state=-1,i.modifyHandler.destroy(),i.modifyHandler=null,i.tooltip.setVisible(!1)}2==i.clickStep&&(i.clickStep=0,t=we(e.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},ye.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=we(e.endPosition,i.viewer);e&&(i.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),i.selectPoint)&&(i.selectPoint.position.setValue(e),i.positions[i.selectPoint.wz-1]=e)},ye.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){return this.viewer.entities.add({position:e,point:{pixelSize:10,color:ye.Color.RED},show:!0})},showArrowOnMap:function(r){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new ye.PolygonGraphics({hierarchy:new ye.CallbackProperty(function(){if(r.length<3)return null;for(var e=[],t=0;t<r.length;t++){var i=a.cartesianToLatlng(r[t]);e.push(i)}var n=a.xp.algorithm.doubleArrow(e,ye),o=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(o=n.polygonalPoint),new ye.PolygonHierarchy(o)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=ye.Math.toDegrees(e.latitude);return[ye.Math.toDegrees(e.longitude),t]}},(_e.prototype=Object.create(Object.assign({},_e.prototype,ue.prototype))).constructor=_e;let Ce=null,Pe=null;function xe(e,t,i,n){if(e&&n){const{threeGlobal:i,containerId:o,threeContainerId:r}=n;Ce=t,Pe=i,this._viewer=e,this._containerId=o,this._threeContainerId=r,this._Scene=function({THREE:a,Cesium:s,viewer:l}){class e extends a.Scene{constructor(t={}){if(super(),this.type="ThreeCesiumScene",!t.cesiumDom)throw new Error("THREE.ThreeCesiumScene not found cesiumDom.");if(!(t.camera&&t.camera instanceof a.PerspectiveCamera))throw new Error("THREE.ThreeCesiumScene (not found cesiumDom) OR ( not THREE.PerspectiveCamera ).");if(!t.renderer)throw new Error("THREE.ThreeCesiumScene not found THREE.WebGLRender.");this.options=t,this.cesiumViewer=l;var i=("string"==typeof t.cesiumDom?document.getElementById(t.cesiumDom):t.cesiumDom).children[0].children;for(let e=0;e<i.length;e++)0!==e&&(i[e].style.zIndex="100");this.ellipsoid=this.cesiumViewer.scene.globe.ellipsoid,t.threeHabit&&(this.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes=[s.CameraEventType.LEFT_DRAG],this.cesiumViewer.scene.screenSpaceCameraController.zoomEventTypes=[s.CameraEventType.MIDDLE_DRAG,s.CameraEventType.WHEEL,s.CameraEventType.PINCH],this.cesiumViewer.scene.screenSpaceCameraController.rotateEventTypes=[s.CameraEventType.RIGHT_DRAG]),this.camera=t.camera,this.cameraOffset=new a.Vector3,this.renderer=t.renderer,this.lngLat=t.lngLat&&1<t.lngLat.length?t.lngLat:[114.23,31.55],this.cameraCenter=new a.Vector3(0,0,0);var e=new s.EllipsoidGeometry({vertexFormat:s.VertexFormat.POSITION_ONLY,radii:new s.Cartesian3(this.ellipsoid.maximumRadius-1,this.ellipsoid.maximumRadius-1,this.ellipsoid.minimumRadius-1),slicePartitions:1024,stackPartitions:1024}),e=function(e,t){t=t||new a.BufferGeometry;const i=e.attributes;for(const e in i){var n,o;i.hasOwnProperty(e)&&i[e]&&((o=(n=i[e]).values)instanceof Float64Array&&(o=new Float32Array(o)),o=new a.BufferAttribute(o,n.componentsPerAttribute,n.normalize),t.setAttribute(e,o))}if(i.st&&(t.attributes.uv=t.attributes.st,t.deleteAttribute("st")),e.indices){const i=new a.BufferAttribute(e.indices,1,!1);t.setIndex(i)}if(e.boundingSphere){const i=e.boundingSphere;t.boundingSphere||(t.boundingSphere=new a.Sphere),t.boundingSphere.center.copy(i.center),t.boundingSphere.radius=i.radius}return t}(s.EllipsoidGeometry.createGeometry(e)),n=new a.MeshBasicMaterial({color:"#ff00ff",blending:a.MultiplyBlending}),e=new a.Mesh(e,n),n=(t.axesHelper&&e.add(new a.AxesHelper(8e6)),super.add(e),this.sphere=e,new a.Group),e=(super.add(n),this.syncGroup=n,new a.SphereGeometry(this.ellipsoid.minimumRadius,512,256,0,2*Math.PI,3.1,Math.PI-3.1)),o=new a.MeshBasicMaterial({color:"#fff00f",blending:a.MultiplyBlending}),e=new a.Mesh(e,o),o=(e.rotateX(90*Math.PI/180),e.position.z=this.ellipsoid.minimumRadius,new a.Group),r=(o.rotateX(-90*Math.PI/180),o.position.z=-1,this.syncGroup=n,this.childrenGroup=o,this.sunUp=new a.Group,this.sunLightColor=new a.Color,this.sunLightIntensity=1,this.cesiumViewer.scene.light);if(this.sunLightColor.r=r.color.red,this.sunLightColor.g=r.color.green,this.sunLightColor.b=r.color.blue,this.sunLightIntensity=r.intensity,this.sun=new a.DirectionalLight(this.sunLightColor,this.sunLightIntensity),this.sun.castShadow=!0,this.sun.shadow.camera.far=Math.pow(10,14),this.sun.position.set(0,0,2*this.ellipsoid.maximumRadius+1e3),this.sun.target=this.childrenGroup,this.sunUp.add(this.sun),n.add(e),n.add(o),n.add(this.sunUp),this._enableLighting=!1,Object.defineProperty(this,"enableLighting",{get(){return this._enableLighting},set(e){this.cesiumViewer.scene.globe.enableLighting=e,this._enableLighting=e,this.sun.visible=!!e}}),void 0!==t.enableLighting&&null!==t.enableLighting&&(this.enableLighting=t.enableLighting),t.cesiumLayers&&0<t.cesiumLayers.length)for(let e=0;e<t.cesiumLayers.length;e++)this.addImageryProvider(t.cesiumLayers[e].type,t.cesiumLayers[e].option)}renderCesium(){return this.cesiumViewer.render(),this}renderThree(){return this.renderer.render(this,this.camera),this}updateSunMatrix(){var e=this.cesiumViewer.scene.sun._boundingVolume.center,e=this.cartesian3ToVector(e);return this.sunUp.lookAt(e.x-this.cameraOffset.x,e.y-this.cameraOffset.y,-(e.z-this.cameraOffset.z)),this}updateCameraMatrix(){this.camera.fov=s.Math.toDegrees(this.cesiumViewer.camera.frustum.fovy),this.camera.updateProjectionMatrix(),this.camera.matrixAutoUpdate=!1;var e=this.cesiumViewer.camera.viewMatrix,t=this.cesiumViewer.camera.inverseViewMatrix,t=(this.camera.lookAt(this.cameraCenter),this.camera.matrixWorld.set(t[0],t[4],t[8],t[12]-this.cameraOffset.x,t[1],t[5],t[9],t[13]-this.cameraOffset.y,t[2],t[6],t[10],t[14]-this.cameraOffset.z,t[3],t[7],t[11],t[15]),this.camera.matrixWorldInverse.set(e[0],e[4],e[8],e[12]-this.cameraOffset.x,e[1],e[5],e[9],e[13]-this.cameraOffset.y,e[2],e[6],e[10],e[14]-this.cameraOffset.z,e[3],e[7],e[11],e[15]),this.cesiumViewer.scene.canvas.clientWidth),e=this.cesiumViewer.scene.canvas.clientHeight;return this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e),this}updateGroupMatrixWorld(){var e=this.cartesian3ToVector(s.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)),t=this.cartesian3ToVector(s.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],2)),t=(new a.Vector3).subVectors(e,t).normalize();return this.syncGroup.lookAt(t),this.syncGroup.up.copy(t),this.syncGroup.updateMatrix(),this.cameraOffset.copy(e),this.syncGroup.up.set(0,0,-1),this.up.set(0,0,-1),this}update(){this.updateSunMatrix(),this.updateGroupMatrixWorld(),this.updateCameraMatrix(),this.renderThree(),this.renderCesium()}add(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.childrenGroup.add(arguments[e]);else e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this.childrenGroup,this.childrenGroup.children.push(e),e.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e);return this}remove(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.childrenGroup.remove(arguments[e]);else{var t=this.childrenGroup.children.indexOf(e);-1!==t&&(e.parent=null,this.childrenGroup.children.splice(t,1),e.dispatchEvent({type:"removed"}))}return this}clear(){for(let e=0;e<this.childrenGroup.children.length;e++){var t=this.childrenGroup.children[e];t.parent=null,t.dispatchEvent({type:"removed"})}return this.childrenGroup.children.length=0,this}traverse(i){i(this.childrenGroup);var n=this.childrenGroup.children;for(let e=0,t=n.length;e<t;e++)n[e].traverse(i)}traverseVisible(i){if(!1!==this.visible&&!1!==this.childrenGroup.visible){i(this.childrenGroup);var n=this.childrenGroup.children;for(let e=0,t=n.length;e<t;e++)n[e].traverseVisible(i)}}toJSON(t){const e=void 0===t||"string"==typeof t,i={},n=(e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{},options:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}),{});if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(t).uuid),null!==this.fog&&(n.fog=this.fog.toJSON()),this.options){n.options={};for(const t in this.options)["camera","renderer"].includes(t)||(n.options[t]=this.options[t])}if(0<this.childrenGroup.children.length){n.children=[];for(let e=0;e<this.childrenGroup.children.length;e++)n.children.push(this.childrenGroup.children[e].toJSON(t).object)}if(e){const e=o(t.geometries),n=o(t.materials),r=o(t.textures),a=o(t.images),s=o(t.shapes),l=o(t.skeletons),c=o(t.animations),h=o(t.nodes);0<e.length&&(i.geometries=e),0<n.length&&(i.materials=n),0<r.length&&(i.textures=r),0<a.length&&(i.images=a),0<s.length&&(i.shapes=s),0<l.length&&(i.skeletons=l),0<c.length&&(i.animations=c),0<h.length&&(i.nodes=h)}return n.isGIS=!0,i.object=n,i;function o(e){var t=[];for(const n in e){var i=e[n];delete i.metadata,t.push(i)}return t}}dispose(){this.update=()=>{},this.renderCesium=()=>{},this.renderThree=()=>{},this.updateSunMatrix=()=>{},this.updateCameraMatrix=()=>{},this.updateGroupMatrixWorld=()=>{},this.cesiumViewer.destroy()}cartesian3ToVector(e){return new a.Vector3(e.x,e.y,e.z)}}return e.prototype.isScene=!0,e.prototype.isGIS=!0,e}({THREE:Pe,Cesium:Ce,viewer:e}),this._initContainer()}}function Se({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:a={},imageryProvider:l={},MapImageryList:u=[],defaultStatic:d,viewer:m}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";var g,y,_;if(i||m)return r=new o(e).init({containerId:i,viewerConfig:r,extraConfig:a,MapImageryList:u,imageryProvider:l,viewer:m}),y=e,_=d,{viewer:g=r,material:(a=function(e,o){var t=null;function i(e){for(var t=Object.keys(e.prototype),i=0,n=t.length;i<n;i++)o.prototype[t[i]]=e.prototype[t[i]]}return Array.isArray(e)?(e.forEach(e=>{i(e)}),t=new o(g,y,_),e.forEach(e=>{e.call(t,g,y,_)})):(i(e),t=new o(g,y,_),e.call(t,g,y,_)),t})([p,h],c),graphics:a(p,s),math3d:a(p,f),math2d:new S(r,e),primitive:a(p,v),draw:a([p,f,S],P),passEffect:a([p,h],M),customCesiumPlugin:a(p,H),control:a(p,X),plugin:a([p,s],K),base:new p(r,e),analysis:a([p,P,K],ee),attackArrowObj:new pe(r,e),straightArrowObj:new ge(r,e),pincerArrowObj:new _e(r,e),threeJs:new xe(r,e,d,t?{threeGlobal:t,containerId:i,threeContainerId:n}:"")};throw"Missing containerId parameter, please check the calling function initCesium."}xe.prototype={_initContainer:function(){if(this.cesiumContainer=void 0,this.threeContainer=void 0,this.cesiumContainer=document.getElementById(this._containerId),this.threeContainer=document.getElementById(this._threeContainerId),!this.cesiumContainer)return alert("未获取到 cesiumContainer 容器!"),!1;var e;"absolute"!==this.cesiumContainer.style.position&&(this.cesiumContainer.style.position="absolute",this.cesiumContainer.style.top=0,this.cesiumContainer.style.left=0,this.cesiumContainer.style.height="100%",this.cesiumContainer.style.width="100%",this.cesiumContainer.style.margin=0,this.cesiumContainer.style.overflow="hidden",this.cesiumContainer.style.padding=0,this.cesiumContainer.style.fontFamily="sans-serif"),this.threeContainer||(e=document.getElementsByTagName("body")[0])&&(this.threeContainer=document.createElement("div"),this.threeContainer.id=this._threeContainerId,this.threeContainer.style.position="absolute",this.threeContainer.style.top=0,this.threeContainer.style.left=0,this.threeContainer.style.height="100%",this.threeContainer.style.width="100%",this.threeContainer.style.margin=0,this.threeContainer.style.overflow="hidden",this.threeContainer.style.padding=0,this.threeContainer.style.fontFamily="sans-serif",this.threeContainer.style.pointerEvents="none",e.appendChild(this.threeContainer))},initThree:function(e){var t=e.fov||45,i=window.innerWidth,n=window.innerHeight,i=e.aspect||i/n,n=e.near||1,o=e.far||1e7;return this._three={renderer:null,camera:null,scene:null},this._three.camera=new Pe.PerspectiveCamera(t,i,n,o),this._three.renderer=new Pe.WebGLRenderer({alpha:!0,antialias:!0,logarithmicDepthBuffer:!0,stencil:!0,depth:!0}),this._three.renderer.outputEncoding=Pe.sRGBEncoding,this._three.renderer.shadowMap.enabled=!0,this._three.renderer.shadowMap.type=Pe.PCFSoftShadowMap,this._three.scene=new this._Scene({cesiumDom:this._containerId,threeHabit:this._objHasOwnProperty(e,"threeHabit",!0),enableLighting:this._objHasOwnProperty(e,"enableLighting",!0),axesHelper:this._objHasOwnProperty(e,"axesHelper",!1),camera:this._three.camera,renderer:this._three.renderer,lngLat:e.center||[104.081701757991,30.627042558105988]}),this.threeContainer&&this.threeContainer.appendChild(this._three.renderer.domElement),this._three},loop(t){function i(){var e=requestAnimationFrame(i);t&&t(e)}i()},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,destroyThreeJS(){this._three.scene.dispose()}};class be{constructor(e){return this.init(e)}init({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:a={},MapImageryList:s=[],defaultStatic:l,baseExtendsCom:c=[],extendsCom:h,extendsComName:u,viewer:d}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";if(i||d)return{viewer:r=new o(e).init({containerId:i,viewerConfig:r,extraConfig:a,MapImageryList:s,viewer:d}),[u]:this.prototypeExtends(r,e,l,t?{threeGlobal:t,containerId:i,threeContainerId:n}:"")(c,h)};throw"Missing containerId parameter, please check the calling function initCesium."}prototypeExtends(n,r,a,s){return function(e,o){var t=null;function i(e){for(var t=Object.keys(e.prototype),i=0,n=t.length;i<n;i++)o.prototype[t[i]]=e.prototype[t[i]]}return Array.isArray(e)?(e.forEach(e=>{i(e)}),t=new o(n,r,a,s),e.forEach(e=>{e.call(t,n,r,a,s)})):(i(e),t=new o(n,r,a,s),e.call(t,n,r,a,s)),t}}}class Me extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:s,extendsComName:"graphics"})}}class Te extends be{constructor(e){return super({...e,baseExtendsCom:[p,h],extendsCom:c,extendsComName:"material"})}}class Ee extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:v,extendsComName:"primitive"})}}class Ae extends be{constructor(e){return super({...e,baseExtendsCom:[p,f,S],extendsCom:P,extendsComName:"draw"})}}class Ie{constructor(e){var t=new Ae(e);return this._initCurrMeasure(e,t)}_initCurrMeasure(e,t){var i=new pe(t.viewer,e.cesiumGlobal),n=new ge(t.viewer,e.cesiumGlobal),e=new _e(t.viewer,e.cesiumGlobal);return{...t,attackArrowObj:i,straightArrowObj:n,pincerArrowObj:e}}}class Le extends be{constructor(e){return super({...e,baseExtendsCom:[p,P,K],extendsCom:ee,extendsComName:"analysis"})}}class De extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:H,extendsComName:"customCesiumPlugin"})}}class ke{constructor(e){return new De(e)}}class ze extends be{constructor(e){return super({...e,baseExtendsCom:[p,h],extendsCom:M,extendsComName:"passEffect"})}}class Re extends be{constructor(e){return super({...e,baseExtendsCom:[p,s],extendsCom:K,extendsComName:"plugin"})}}class Ge extends be{constructor(e){return super({...e,baseExtendsCom:[],extendsCom:xe,extendsComName:"threeJs"})}}class Oe extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:X,extendsComName:"control"})}}export{Le as Analysis,pe as AttackArrow,Oe as Control,ke as CustomCesiumPlugin,Ie as Draw,Me as Graphics,Te as Material,S as Math2d,f as Math3d,ze as PassEffect,_e as PincerArrow,Re as Plugin,Ee as Primitive,ge as StraightArrow,Ge as ThreeJs,Se as initCesium};
|
|
1
|
+
import e from"libgif";import{GUI as i}from"dat.gui";import n from"echarts";let r=null;class o{constructor(e){r=e,this.init_data()}init_data(){this.viewer=null}init({containerId:e,viewerConfig:t,extraConfig:i,MapImageryList:n,imageryProvider:o,viewer:a}){var s={contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:r.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0},o=this.findCesiumProvider(o),l=(r.Ion.defaultAccessToken=i.AccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",s=Object.assign(s,t),a||new r.Viewer(e,{...s,...o}));if(i.logo||(l.cesiumWidget.creditContainer.style.display="none"),i.depthTest&&(l.scene.globe.depthTestAgainstTerrain=!0),n&&0<n.length)for(let e=0;e<n.length;e++)this.addImageryProvider(l,n[e].type,n[e].option||n[e].classConfig);return this.viewer=l}addImageryProvider(e,t,i){e.imageryLayers.addImageryProvider(this.createCesiumProvider({type:t,option:i}))}findCesiumProvider(e){var t={};for(const i in e)e[i]&&e[i].type?t[i]=this.createCesiumProvider(e[i]):t[i]=e[i];return t}createCesiumProvider(e){switch(e.type){case"WebMapTileServiceImageryProvider":case"UrlTemplateImageryProvider":case"TileMapServiceImageryProvider":return new r[e.type](e.option)}}}let a=null;function s(e,t,i){e&&(a=t,this._graphicsLayer=new a.CustomDataSource("graphicsLayer"),e)&&e.dataSources.add(this._graphicsLayer)}s.prototype={getPointGraphics:function(e){if(e=e||{})return new a.PointGraphics({color:e.color||a.Color.GREEN,pixelSize:e.pixelSize||5,outlineColor:e.outlineColor||a.Color.WHITE,outlineWidth:e.outlineWidth||1})},getLineGraphics:function(e){if((e=e||{})&&e.positions)return new a.PolylineGraphics({show:!0,positions:e.positions,material:e.material||a.Color.YELLOW,width:e.width||1,arcType:a.ArcType.GEODESIC,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)})},getPolygonGraphics:function(e){if((e=e||{})&&e.positions)return new a.PolygonGraphics({hierarchy:{positions:e.positions},material:e.material||a.Color.RED.withAlpha(.2),clampToGround:e.clampToGround||!1})},getLabelGraphics:function(e){if((e=e||{})&&e.l_text)return new a.LabelGraphics({text:e.l_text,font:e.l_font||"14px sans-serif",fillColor:e.l_fillColor||a.Color.GOLD,style:e.l_style||a.LabelStyle.FILL_AND_OUTLINE,outlineColor:e.l_outlineColor||a.Color.GOLD,outlineWidth:e.l_outlineWidth||2,showBackground:e.l_showBackground||!1,backgroundColor:e.l_backgroundColor||new a.Color(.165,.165,.165,.8),verticalOrigin:e.l_verticalOrigin||a.VerticalOrigin.BOTTOM,pixelOffset:e.l_pixelOffset||new a.Cartesian2(0,-30)})},getBillboardGraphics:function(e){if((e=e||{})&&e.b_img)return new a.BillboardGraphics({image:e.b_img,width:e.b_width||35,height:e.b_height||35,clampToGround:e.b_clampToGround||!0,scale:e.b_scale||1,pixelOffset:e.b_pixelOffset||new a.Cartesian2(0,-20),scaleByDistance:e.b_scaleByDistance||void 0})},getPathGraphics:function(e){if(e=e||{})return new a.PathGraphics({resolution:e.resolution||1,material:new a.PolylineGlowMaterialProperty({glowPower:e.glowPower||.1,color:e.color||a.Color.YELLOW}),width:e.width||30})},getModelGraphics:function(e){if(e=e||{})return new a.ModelGraphics({uri:e.m_url||e.url,scale:e.m_scale||e.scale||10,clampAnimations:!0})},getEllipseGraphics:function(e){if(e=e||{})return new a.EllipseGraphics({semiMajorAxis:e.e_semiMajorAxis||1e6,semiMinorAxis:e.e_semiMinorAxis||1e6,metarial:e.e_metarial||a.Color.RED.withAlpha(.5),outline:this._objHasOwnProperty(e,"e_outline",!0)})},getEllipsoidGraphics:function(e){var t;if(e=e||{})return t=e.radii||1e6,new a.EllipsoidGraphics({radii:new a.Cartesian3(t,t,t),innerRadii:this._objHasOwnProperty(e,"innerRadii",new a.Cartesian3(t/1.5,t/1.5,t/1.5)),maximumCone:e.maximumCone||a.Math.PI_OVER_TWO,stackPartitions:e.stackPartitions||56,slicePartitions:e.slicePartitions||56,outlineWidth:e.outlineWidth||2,outlineColor:e.outlineColor||a.Color.YELLOW,outline:this._objHasOwnProperty(e,"outline",!0),fill:this._objHasOwnProperty(e,"fill",!0),material:e.material||a.Color.RED.withAlpha(.1)})},getBoxGraphics:function(e){if(e=e||{})return new a.BoxGraphics({show:this._objHasOwnProperty(e,"show",!0),fill:this._objHasOwnProperty(e,"fill",!0),dimensions:e.dimensions||new a.Cartesian3(0,0,0),material:e.material,outline:this._objHasOwnProperty(e,"outline",!0),outlineColor:e.outlineColor||a.Color.BLACK,distanceDisplayCondition:e.distanceDisplayCondition||void 0})},getPlaneGraphics:function(e){if(e=e||{})return new a.PlaneGraphics({plane:e.plane||new a.Plane(a.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new a.Cartesian2(170,130),material:e.material||a.Color.BLUE})},getCylinderGraphics:function(e){if(e=e||{})return new a.CylinderGraphics({HeightReference:a.HeightReference.RELATIVE_TO_GROUND,length:e.length||250,topRadius:e.topRadius||0,bottomRadius:e.bottomRadius||0,material:e.material||new a.Color(0,1,1,.4),slices:e.slices||128})},createPointsGraphics:function(e){if(e&&e.positions){var t,i=[];for(t in e.positions){var n=e.positions[t],r=this.createGraphics();r.name=e.name||"",r.oid=e.oid||"point",r.position=n,e.point&&(r.point=this.getPointGraphics()),e.billboard&&(r.billboard=this.getBillboardGraphics(e.billboard)),e.label&&(r.label=this.getLabelGraphics(e.label)),i.push(this._graphicsLayer.entities.add(r))}return i}},createLineGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).name=e.name||"",t.oid=e.oid||"line",t.position=e.positions,t.polyline=this.getLineGraphics(e),this._graphicsLayer.entities.add(t)},createPolygonGraphics:function(e){var t;if(e=e||{})return(t=this.createGraphics()).polygon=this.getPolygonGraphics(e),t.clampToS3M=this._objHasOwnProperty(e,"clampToS3M",!1),this._graphicsLayer.entities.add(t)},createBoxGraphics:function(e){var t;if(e=e||{})return(t=this.createGraphics()).position=e.position,t.name=e.name||"box_graphic",t.box=this.getBoxGraphics(e.box),this._graphicsLayer.entities.add(t)},createModelGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).model=this.getModelGraphics(e),t.position=e.position,this._graphicsLayer.entities.add(t)},craeteCorridorGraphics:function(o){if(o&&o.positions){let{positions:e,height:t,width:i,material:n,...r}=o;o=this.createGraphics();return o.corridor={positions:e,height:void 0===t?6:t,width:void 0===i?15:i,...r,material:n||new a.Scene.WarnLinkMaterialProperty({freely:"cross",color:a.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(o)}},craeteDynamicPolyLineGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).polyline={show:!0,positions:[],material:e.material||a.Color.CHARTREUSE,width:e.width||5,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)},t.polyline.positions=new a.CallbackProperty(function(){return e.positions},!1),this._graphicsLayer.entities.add(t)},craeteDynamicCylinderGraphics:function(e){var i,n,t={};if(e&&e.cylinder)return i=e.entity,e=e.cylinder,t.cylinder=(n=this).getCylinderGraphics(e),t.position=new a.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime),e=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=a.Math.toDegrees(e.latitude),e=a.Math.toDegrees(e.longitude);return a.Cartesian3.fromDegrees(e,t,0)},!1),t.cylinder.length=new a.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime);return 2*n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e).height},!1),t},createFadeCylinderGraphics:function(e){var t;if((e=e||{})&&e.position)return(t=this.createGraphics()).position=e.position,e.material=new a.Scene.CircleFadeMaterialProperty({color:e.color||a.Color.fromCssColorString("#02ff00"),duration:e.duration||2e3}),t.cylinder=this.getCylinderGraphics(e),this._drawLayer.entities.add(t)},craeteRotateCylinderGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).cylinder={HeightReference:a.HeightReference.RELATIVE_TO_GROUND,length:e.length||500,topRadius:e.topRadius||500,bottomRadius:e.bottomRadius||500,material:e.material||new a.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:!0,repeat:{x:1,y:-1}}),slices:e.slices||128},t.position=e.position,this.setGraphicsRotate({entity:t,position:this.transformCartesianToWGS84(e.position),rotateAmount:4}),this._graphicsLayer.entities.add(t)},craeteDynamicBlinkCircleGraphics:function(e){var t,i,n;if(e&&e.position)return t=this.createGraphics(),i=e.alp||1,n=this._objHasOwnProperty(e,"flog",!0),t.position=e.position,t.ellipse={semiMinorAxis:e.semiMinorAxis||2e3,semiMajorAxis:e.semiMajorAxis||2e3,height:e.height||10,material:new a.ColorMaterialProperty(new a.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),a.Color.RED.withAlpha(i)},!1))},this._graphicsLayer.entities.add(t)},craeteDynamicCricleGraphics:function(i){if(i&&i.center){var n=this.createGraphics(),r=this,o=i.center,s=i.radius||800,l=i.rotateAmount||.05,c=0,h=i.height||1,u=i.scale||null,d=i.scale2||null,i=i.material||new a.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new a.CallbackProperty(function(){return r.transformWGS84ToCartesian(o)},!1),n.orientation=new a.CallbackProperty(function(){return a.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(o),new a.HeadingPitchRoll(a.Math.toRadians(0),a.Math.toRadians(0),a.Math.toRadians(0)))},!1);let e=s,t=!1;return n.ellipse={material:i,height:h,semiMajorAxis:new a.CallbackProperty(function(){return s},!1),semiMinorAxis:new a.CallbackProperty(function(){return s},!1),stRotation:new a.CallbackProperty(function(){return 0<l&&360<=(c+=l)&&(c=0),u&&((t=u<=s||s<=e?!t:t)?s+=2:s-=2),d&&(s<=d?s+=2:s=e),c},!1)},this._graphicsLayer.entities.add(n)}},craeteDynamicShadeWallGraphics:function(e){var t,i,n,r,o;if(e&&e.positions)return t=e.alp||1,i=e.num||20,n=e.color||a.Color.RED,r=e.speed||.003,(o=this.createGraphics()).wall={positions:e.positions,material:new a.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new a.CallbackProperty(function(){return i%2==0?t-=r:t+=r,(t<=.1||1<=t)&&i++,n.withAlpha(t)},!1)})},this._graphicsLayer.entities.add(o)},createCustomDefBillboardGraphics:function(t){if(t&&t.position){var i=this,n=document.createElement("img");n.src=t.image||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";n.onload=function(){t.image=n;var e=i._graphicsLayer.entities.add({position:t.position,billboard:{image:function(e){var t,i;if(e.image)return(t=document.createElement("canvas")).width=e.width||150,t.height=e.height||80,(i=t.getContext("2d")).drawImage(e.image,0,0),e=e.text,i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(e,55,36),t}(t),scaleByDistance:new a.NearFarScalar(150,.7,15e6,.5),verticalOrigin:a.VerticalOrigin.BOTTOM,pixelOffset:t.b_pixelOffset||new a.Cartesian2(80,-35),width:140,height:100,scale:t.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof t.callback&&t.callback(e)}}},craeteRotatePlaneGraphics:function(e){var t,i,n,r;if(e&&e.center&&e.positions)return t=this.createGraphics(),i=0,n=e.positions,r=n[0],t.position=new a.CallbackProperty(function(){return 0==i?(r=n[0],i+=1):i<n.length-1?(r=n[i],i+=1):i==n.length-1&&(r=n[i],i=0),r},!1),t.plane={plane:new a.Plane(a.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new a.Cartesian2(200,150),material:new a.ImageMaterialProperty({image:e.image})},this._graphicsLayer.entities.add(t)},createVideoPlaneGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).position=e.position,t.plane={plane:new a.Plane(e.normal||a.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new a.Cartesian2(200,150),material:new a.ImageMaterialProperty({image:e.videoElement})},this._graphicsLayer.entities.add(t)},createGifBillboardGraphics:function(t){var i,n,r,o,s,l,c;if(e&&t&&t.position)return n=t.url,r=0,o=n,s=i=[],(l=document.createElement("img")).src=o,l.setAttribute("rel:animated_src",o),l.setAttribute("rel:auto_play","0"),document.body.appendChild(l),c=new e({gif:l}),new Promise(e=>{c.load(()=>{for(let e=1;e<=c.get_length();e++)c.move_to(e),s.push(c.get_canvas().toDataURL());e(s)})}),this._graphicsLayer.entities.add({position:t.position,billboard:{verticalOrigin:a.VerticalOrigin.BASELINE,image:new a.CallbackProperty(function(){return i.length?(r<6*(i.length-1)?r++:r=0,i[Math.floor(r/6)]):n},!1),scale:.2}})},setGraphicsRotate:function(e){var t,i,n,r;e&&e.entity&&e.rotateAmount&&(t=e.entity,i=e.rotateAmount,n=e.position,r=this,n.heading=0,n.pitch=0,n.roll=0,t.position=new a.CallbackProperty(function(){return r.transformWGS84ToCartesian(n)},!1),t.orientation=new a.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),a.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(n),new a.HeadingPitchRoll(a.Math.toRadians(n.heading),a.Math.toRadians(n.pitch),a.Math.toRadians(n.roll)))},!1))},setGraphicsFloat:function(e){if(e&&e.entity&&e.maxHeiht)try{var t=e.entity,n=e.minHeiht||5,r=e.maxHeiht||100,o=e.cartesians,s=e.speed||.06,l=this,c=n,h=!1;o.length?t.positions=new a.CallbackProperty(function(){var e,t=l.transformCartesianArrayToWGS84Array(o);for(e in t){var i=t[e];(h=r<=n||n<=c?!h:h)?n+=s:n-=s,i.alt=n}return l.transformWGS84ArrayToCartesianArray(t)},!1):t.position=new a.CallbackProperty(function(){var e=l.transformCartesianToWGS84(o);return(h=r<=n||n<=c?!h:h)?n+=s:n-=s,e.alt=n,l.transformWGS84ToCartesian(e)},!1)}catch(e){console.log(e)}},createCanvasGraphics:function(r){r&&r.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:r.positions,material:new a.ImageMaterialProperty({image:new a.CallbackProperty(function(){var e=0,t=document.createElement("canvas"),i=t.getContext("2d"),n=new Image;if(n.src=r.img||"../../images/ysCesium/logo.png",i.clearRect(0,0,r.cwidth,r.cheight),!(e<=r.cwidth))return e=0,e+=3,t;i.drawImage(n,e,0)},!1),transparent:!0})}}),"function"==typeof r.callback)&&r.callback()},createFanShape:function({viewer:e,longitude:t,latitude:i,alt:n,custMaterial:r,speed:o=0,direction:s="+"}){var l,c,h;if(e)return l=this.createGraphics(),c=0,h=this._calcPoints(t,i,n,c),l.wall={positions:new a.CallbackProperty(()=>a.Cartesian3.fromDegreesArrayHeights(h),!1),material:r||a.Color.AQUAMARINE.withAlpha(.5)},e.clock.onTick.addEventListener(()=>{0<o&&(c+=o,h=this._calcPoints(t,i,n,s+c))}),this._graphicsLayer.entities.add(l)},_computeCirclularFlight(t,i,n,r,o,s){var l=[],c=(l.push(t),l.push(i),l.push(0),a.Cartesian3.distance(a.Cartesian3.fromDegrees(t,i),a.Cartesian3.fromDegrees(n,r)));for(let e=o;e<=o+s;e++){var h=c*Math.sin(e*Math.PI/180),u=Math.cos(e*Math.PI/180),d=(r-i)*u+i;l.push((n-t)*u+t),l.push(d),l.push(h)}return l},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,_calcPoints(e,t,i,n){var r=a.Transforms.eastNorthUpToFixedFrame(a.Cartesian3.fromDegrees(e,t)),o=i*Math.cos(n*Math.PI/180),i=i*Math.sin(n*Math.PI/180),n=a.Cartesian3.fromElements(o,i,0),o=a.Matrix4.multiplyByPoint(r,n,new a.Cartesian3),i=a.Cartographic.fromCartesian(o),r=a.Math.toDegrees(i.longitude),n=a.Math.toDegrees(i.latitude);return this._computeCirclularFlight(e,t,r,n,0,90)}};let l=null;function c(e,t,i){e&&(l=t,this._installMaterial())}function h(){}c.prototype={_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial(),this._installPolylineTrailLinkMaterial()},addMaterialLineGraphics:function(e){var t;if(this._viewer&&e&&e.image)return(t=this.createGraphics()).polyline={positions:e.positions,material:new l.PolylineCustomMaterialProperty({color:e.color||l.Color.RED,duration:e.duration||500}),width:e.width},this._viewer.entities.add(t)},getCustomMaterialLine:function(e){if(this._viewer&&e&&e.image)return this._initPolylineCustomMaterialProperty(e)},_initPolylineCustomMaterialProperty(i){if(i){var e=l.Color,t=l.defaultValue,n=l.defined,r=Object.defineProperties,o=l.Event,a=l.createPropertyDescriptor,s=l.Property,c=l.Material,h=e.WHITE,u=i.MaterialType||"wallType"+parseInt(1e3*Math.random());const d=function(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||l.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0};return r(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),d.prototype.getType=function(){return u},d.prototype.getValue=function(e,t){return(t=n(t)?t:{}).color=s.getValueOrClonedDefault(this._color,e,h,t.color),t.image=i.image,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},d.prototype.equals=function(e){return this===e||e instanceof d&&s.equals(this._color,e._color)},c._materialCache.addMaterial(u,{fabric:{type:u,uniforms:{color:i.color||new l.Color(1,0,0,.5),image:i.image,time:i.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new d(i)}},addMaterialWallGraphics:function(e){var t;if(this._viewer&&e&&e.image)return(t=this.createGraphics()).wall={positions:e.positions,material:this.getCustomMaterialWall(e),width:e.width},this._viewer.entities.add(t)},getCustomMaterialWall:function(e){if(this._viewer&&e&&e.image)return this._initWallCustomMaterialProperty(e)},_initWallCustomMaterialProperty(i){var n=l.Color,t=l.defaultValue,r=l.defined,e=Object.defineProperties,o=l.Event,a=l.createPropertyDescriptor,s=l.Property,c=l.Material,h=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||n.BLUE,this.duration=e.duration||3e3,this._time=(new Date).getTime()}return e(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),u.prototype.getType=function(){return h},u.prototype.getValue=function(e,t){return(t=r(t)?t:{}).color=s.getValueOrClonedDefault(this._color,e,n.WHITE,t.color),t.image=i.image,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},u.prototype.equals=function(e){return this===e||e instanceof u&&s.equals(this._color,e._color)},c._materialCache.addMaterial(h,{fabric:{type:h,uniforms:{color:new n(1,0,0,.5),image:i.image,time:0},source:this._getDirectionWallShader({get:!0,count:i.count,freely:i.freely,direction:i.direction})},translucent:function(){return!0}}),new u(i)},_installWaveCircleMaterial:function(){var t=l.Color,i=l.defaultValue,e=Object.defineProperties,n=l.Event,r=l.Property,o=l.Material;function a(e){e=e||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=i(e.color,t.fromBytes(0,255,255,255)),this.duration=i(e.duration,45),this.count=Math.max(i(e.count,2),1),this.gradient=i(e.gradient,.1),this.gradient<0?this.gradient=0:1<this.gradient&&(this.gradient=1)}e(a.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getType=function(){return o.CircleWaveType},a.prototype.getValue=function(e,t){return(t=t||{}).color=r.getValueOrUndefined(this._color,e),t.duration=this._duration,t.count=this.count,t.gradient=this.gradient,t},a.prototype.equals=function(e){return this===e||e instanceof a&&l.Property.equals(this._color,e._color)},e(a.prototype,{color:l.createPropertyDescriptor("color"),duration:l.createPropertyDescriptor("duration")}),l.Scene.CircleWaveMaterialProperty=a,o.CircleWaveType="CircleWave",o._materialCache.addMaterial(o.CircleWaveType,{fabric:{type:o.CircleWaveType,uniforms:{color:new t(1,0,0,.7),duration:45,count:1,gradient:.1},source:this._getDynamicCircleShader({get:!0})},translucent:function(){return!0}})},_installCircleFadeMaterial:function(){var e=l.Color,t=l.defaultValue,i=Object.defineProperties,n=l.Event,r=l.Property,o=l.Material,a=new e(0,0,0,0);function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=t(e.color,a),this._duration=e.duration||1e3,this._time=void 0}i(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return o.CircleFadeMaterialType},s.prototype.getValue=function(e,t){return(t=t||{}).color=r.getValueOrClonedDefault(this._color,e,a,t.color),void 0===this._time&&(this._time=(new Date).getTime()),t.time=((new Date).getTime()-this._time)/this._duration,t},s.prototype.equals=function(e){return this===e||e instanceof s&&l.Property.equals(this._color,e._color)},i(s.prototype,{color:l.createPropertyDescriptor("color")}),l.Scene.CircleFadeMaterialProperty=s,o.CircleFadeMaterialType="CircleFadeMaterial",o._materialCache.addMaterial(o.CircleFadeMaterialType,{fabric:{type:o.CircleFadeMaterialType,uniforms:{color:new e(1,0,0,1),time:1},source:this._getCircleFadeShader({get:!0})},translucent:function(){return!0}})},_installCityLineMaterial:function(){var e=l.Color,t=l.defaultValue,i=l.defined,n=Object.defineProperties,r=l.Event,o=l.createPropertyDescriptor,a=l.Property,s=l.Material,c=e.WHITE;function h(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||l.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0,this._img=e.imgUrl||s.PolylineCityLinkImage}n(h.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),h.prototype.getType=function(){return s.PolylineCityLinkType},h.prototype.getValue=function(e,t){return(t=i(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,c,t.color),t.image=this._img,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},h.prototype.equals=function(e){return this===e||e instanceof h&&a.equals(this._color,e._color)},l.Scene.PolylineCityLinkMaterialProperty=h,s.PolylineCityLinkType="PolylineCityLink",s.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",s._materialCache.addMaterial(s.PolylineCityLinkType,{fabric:{type:s.PolylineCityLinkType,uniforms:{color:new e(1,0,0,1),image:s.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:!0})},translucent:function(){return!0}})},_installWarnMaterial:function(){var i=l.Color,t=l.defaultValue,n=l.defined,e=Object.defineProperties,r=l.Event,o=l.createPropertyDescriptor,a=l.Property,s=l.Material;function c(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||i.BLUE,this.duration=e.duration||3e3,this._time=(new Date).getTime()}e(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.getType=function(){return s.WarnLinkType},c.prototype.getValue=function(e,t){return(t=n(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,i.WHITE,t.color),t.image=s.WarnLinkImage,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},c.prototype.equals=function(e){return this===e||e instanceof c&&a.equals(this._color,e._color)},e(c.prototype,{color:o("color")}),l.Scene.WarnLinkMaterialProperty=c,s.WarnLinkType="WarnWallLinkType",s.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",s._materialCache.addMaterial(s.WarnLinkType,{fabric:{type:s.WarnLinkType,uniforms:{color:new i(1,0,0,.5),image:s.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:!0,count:10,freely:"cross",direction:"-"})},translucent:function(){return!0}})},_installFlowMaterial:function(){var t=l.Color,i=l.defaultValue,e=Object.defineProperties,n=l.Event,r=l.createPropertyDescriptor,o=l.Property,a=l.Material;function s(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||t.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=i(e.duration,45)}e(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return a.PolylineFlowType},s.prototype.getValue=function(e,t){return(t=t||{}).color=o.getValueOrClonedDefault(this._color,e,l.Color.WHITE,t.color),t.duration=this._duration,t},s.prototype.equals=function(e){return this===e||e instanceof s&&o.equals(this._color,e._color)},e(s.prototype,{color:r("color"),duration:r("duration")}),l.Scene.PolylineFlowMaterialProperty=s,a.PolylineFlowType="PolylineFlow",a._materialCache.addMaterial(a.PolylineFlowType,{fabric:{type:a.PolylineFlowType,uniforms:{color:new t(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:!0})},translucent:function(){return!0}})},_installPolylineTrailLinkMaterial:function(){var e=l.Color,t=l.defaultValue,i=Object.defineProperties,n=l.createPropertyDescriptor,r=l.Event,o=l.Property,a=l.Material,s=this.getDfSt(["primitive","WaterPrimitive"]);function c(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this.color=e.color||l.Color.WHITE,this.image=e.image||s,this._colorSubscription=void 0,this.duration=e.duration||3e3,this._time=(new Date).getTime(),this.speed=e.speed,this.isTranslucent=function(){return!0}}i(c.prototype,{isConstant:{get:function(){return!1},configurable:!0},definitionChanged:{get:function(){return this._definitionChanged},configurable:!0},color:n("color"),duration:n("duration")}),c.prototype.getType=function(){return a.PolylineTrailLinkType},c.prototype.getValue=function(e,t){return(t=l.defined(t)?t:{}).color=o.getValueOrClonedDefault(this._color,e,this.color,t.color),t.image=a.PolylineTrailLinkImage,t.time=((new Date).getTime()-this._time)%this.duration/this.duration*this.speed,t},c.prototype.equals=function(e){return this===e||e instanceof c&&o.equals(this._color,e._color)},a.PolylineTrailLinkSource="\n uniform vec4 color;\n uniform float time;\n uniform sampler2D image;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n return material;\n }",l.Scene.PolylineTrailLinkMaterial=c,a.PolylineTrailLinkType="PolylineTrailLinkMaterial",a.PolylineTrailLinkImage=this.image||s||"static/data/images/Textures/river.png",a._materialCache.addMaterial(a.PolylineTrailLinkType,{fabric:{type:a.PolylineTrailLinkType,uniforms:{color:new e(1,1,1,1),image:a.PolylineTrailLinkImage,time:-20},source:a.PolylineTrailLinkSource},translucent:function(){return!0}})}},h.prototype={_getFlowLineShader:function(){return"uniform vec4 color;\n uniform float duration;\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float t =fract(czm_frameNumber / duration);\n t *= 1.03;\n float alpha = smoothstep(t- 0.03, t, st.s) * step(-t, -st.s);\n alpha += 0.1;\n vec4 fragColor;\n fragColor.rgb = (color.rgb) / 0.5;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = fragColor.rgb;\n material.alpha = alpha;\n material.emission = fragColor.rgb;\n return material;\n }\n "},_getDynamicLineShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n if(texture(image, vec2(0.0, 0.0)).a == 1.0){\n discard;\n }else{\n material.alpha = texture(image, vec2(1.0 - fract(time - st.s), st.t)).a * color.a;\n }\n \n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n \n return material;\n }\n "},_getDynamicLightLineShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n vec4 colorImage = texture(image, vec2(fract(1.0 *st.s - time), fract(st.t)));\n \n vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getDirectionWallShader:function(e){var t;if(e&&e.get)return t="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ","vertical"==e.freely?t+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.t "+e.direction+" time), fract(st.s)));\n ":t+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.s "+e.direction+" time), fract(st.t)));\n ",t+"vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getCircleFadeShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n \n {\n \n czm_material material = czm_getDefaultMaterial(materialInput);\n \n material.diffuse = 1.5 * color.rgb;\n \n vec2 st = materialInput.st;\n \n float dis = distance(st, vec2(0.5, 0.5));\n \n float per = fract(time);\n \n if(dis > per * 0.5){\n \n //material.alpha = 0.0;\n \n discard;\n \n }else {\n \n material.alpha = color.a * dis / per / 2.0;\n \n }\n \n return material;\n \n }"},_getDynamicCircleShader:function(e){if(e&&e.get)return"uniform vec4 color;\n uniform float duration;\n uniform float count;\n uniform float gradient;\n \n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(czm_frameNumber / duration);\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n } else {\n float perDis = 0.5 / count;\n float disNum;\n float bl = .0;\n for (int i = 0; i <= 10; i++) {\n if (float(i) <= count) {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0) {\n if (disNum < perDis) {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl, gradient);\n }\n }\n }\n }\n return material;\n }\n "},_getRadarScanShader:function(e){if(e&&e.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 v01 = testPt - ptOnLine;\n normalize(v01);\n vec3 temp = cross(v01, lineNormal);\n float d = dot(temp, u_scanPlaneNormalEC);\n return d > 0.5;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point -planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\n return length(tempPt - ptOnLine);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n out_FragColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n float twou_radius = u_radius * 2.0;\n if(dis < u_radius){\n float f0 = 1.0 -abs(u_radius - dis) / u_radius;\n f0 = pow(f0, 64.0);\n vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\n float f = 0.0;\n if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)){\n float dis1= length(prjOnPlane.xyz - lineEndPt);\n f = abs(twou_radius -dis1) / twou_radius;\n f = pow(f, float("+e.width+"));\n }\n if(float("+e.border+") > 0.0){\n out_FragColor = mix(out_FragColor, u_scanColor, f + f0);\n } else {\n out_FragColor = mix(out_FragColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(e){if(e&&e.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point - planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n out_FragColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius){\n float f = 1.0 - abs(u_radius - dis) / u_radius;\n f = pow(f, float("+e.border+"));\n out_FragColor = mix(out_FragColor, u_scanColor, f);\n }\n }\n "}};let u={},d=void 0;function p(e,t,i){e&&(this._viewer=e,u=t,d=i,this._drawLayer=new u.CustomDataSource("drawLayer"),e&&e.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}p.prototype={createGraphics:function(){return new u.Entity},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,getDfSt(e){if(d)return e=e.reduce((e,t)=>(e||d)[t],void 0),d.baseService+e},setOneSkyBox:function(){return new u.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})},setTwoSkyBox:function(){return new u.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})},setThreeSkyBox:function(){return new u.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})},setOneGroundSkyBox:function(){return new u.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})},setTwoGroundSkyBox:function(){return new u.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})},setThreeGroundSkyBox:function(){return new u.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})},setDarkEffect:function(e){return e=e||{},this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n}\n",uniforms:{scale:1,offset:function(){return e.offset||new u.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(e){if(this._viewer&&e)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"blur_x_direction",fragmentShader:"uniform float height;\nuniform float width;\nuniform sampler2D colorTexture1;\n\nin vec2 v_textureCoordinates;\n\nconst int SAMPLES = 9;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nfloat wr = float(1.0 / width);\nfloat hr = float(1.0 / height);\nvec4 result = vec4(0.0);\nint count = 0;\nfor(int i = -SAMPLES; i <= SAMPLES; ++i){\nfor(int j = -SAMPLES; j <= SAMPLES; ++j){\nvec2 offset = vec2(float(i) * wr, float(j) * hr);\nresult += texture(colorTexture1, st + offset);\n}\n}\nresult = result / float(count);\nout_FragColor = result;\n}\n",uniforms:{width:e.width,height:e.height,colorTexture1:"Bright"}}))},setRainEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"rainEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n \n float hash(float x){\n return fract(sin(x*23.3)*13.13);\n }\n \n void main(){\n float time = czm_frameNumber / 60.0;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a=-.4;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*.3+1.;\n float v=1.-sin(hash(floor(uv.x*100.))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n }\n "}))},setSnowEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({name:"snowEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n float snow(vec2 uv,float scale){\n float time = czm_frameNumber / 60.0;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));\n if(w<.1)return 0.;\n uv+=time/scale;\n uv.y+=time*2./scale;\n uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;\n vec2 s=floor(uv),f=fract(uv),p;\n float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;\n d=length(p);\n k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01);\n return k*w;\n }\n \n void main(){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n \n }\n "}))},setFogEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new u.PostProcessStage({fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nin vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n out_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new u.Cartesian4(10,0,200,.3),fogColor:u.Color.AZURE}}))},setDefSceneConfig:function(){this._viewer&&(this._viewer.scene.sun.show=!1,this._viewer.scene.moon.show=!1,this._viewer.scene.fxaa=!0,this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.undergroundMode=!1,this._viewer.scene.terrainProvider.isCreateSkirt=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.globe.showGroundAtmosphere=!1,this._viewer.scene.globe.enableLighting=!0,this._viewer.scene.fog.enabled=!1,this._viewer.cesiumWidget.creditContainer.style.display="none")},setBloomLightScene:function(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=!0,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=!1,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=!1)},removePostProcessStage:function(e){e&&(Array.isArray(e)?e.forEach(e=>{this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e)}):this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e))},setView:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new u.Cartesian3(0,e.distance,window.opt.distance),e.position=u.Cartesian3.add(e.position,t,new u.Cartesian3)),this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:u.Math.toRadians(90),pitch:u.Math.toRadians(90),roll:u.Math.toRadians(0)}}))},flyTo:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new u.Cartesian3(0,e.distance,0),e.position=u.Cartesian3.add(e.position,t,new u.Cartesian3)),this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:u.Math.toRadians(90),pitch:u.Math.toRadians(90),roll:u.Math.toRadians(0)},easingFunction:e.easingFunction||u.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback}))},transformCartesianToWGS84:function(e){if(this._viewer&&e)return e=u.Ellipsoid.WGS84.cartesianToCartographic(e),{lng:u.Math.toDegrees(e.longitude),lat:u.Math.toDegrees(e.latitude),alt:e.height}},transformWGS84ArrayToCartesianArray:function(e,t){var i;if(this._viewer&&e)return i=this,e?e.map(function(e){return i.transformWGS84ToCartesian(e,t)}):[]},transformWGS84ToCartesian:function(e,t){if(this._viewer)return e?u.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=t||e.alt,u.Ellipsoid.WGS84):u.Cartesian3.ZERO},transformCartesianArrayToWGS84Array:function(e){var t;if(this._viewer)return t=this,e?e.map(function(e){return t.transformCartesianToWGS84(e)}):[]},transformWGS84ToCartographic:function(e){return e?u.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):u.Cartographic.ZERO},lnglatArrayToCartesians:function(t){if(!t||t.length<1)return[];var i=[];for(let e=0;e<t.length;e++){var n=u.Cartesian3.fromDegrees(Number(t[e][0]),Number(t[e][1]),Number(t[e][2]||0));i.push(n)}return i},setCameraEotateHeading(l){if(l){let t=this._viewer,i=u.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=u.Math.toRadians(-30),r=12,o=5e3,e=u.JulianDate.fromDate(new Date),a=(t.clock.startTime=e.clone(),t.clock.currentTime=e.clone(),t.clock.clockRange=u.ClockRange.CLAMPED,t.clock.clockStep=u.ClockStep.SYSTEM_CLOCK,t.camera.heading),s=function(){var e=u.JulianDate.secondsDifference(t.clock.currentTime,t.clock.startTime),e=u.Math.toRadians(e*r)+a;t.scene.camera.setView({destination:i,orientation:{heading:e,pitch:n}}),t.scene.camera.moveBackward(o),0<=u.JulianDate.compare(t.clock.currentTime,t.clock.stopTime)&&t.clock.onTick.removeEventListener(s)};t.clock.onTick.addEventListener(s)}},getCatesian3FromPX:function(e){if(this._viewer&&e){var t,i,n=this._viewer.scene.pick(e),r=null,o=!1,a=!1;if((o=n instanceof u.Cesium3DTileFeature?!0:o)&&(r=this._viewer.scene.pickPosition(e))&&((t=u.Cartographic.fromCartesian(r)).height<0&&(t.height=0),s=u.Math.toDegrees(t.longitude),i=u.Math.toDegrees(t.latitude),t=t.height,r=this.transformWGS84ToCartesian({lng:s,lat:i,alt:t})),!n){var s=this._viewer.scene.camera.getPickRay(e);if(!s)return null;r=this._viewer.scene.globe.pick(s,this._viewer.scene),a=!0}return(r=o||a?r:this._viewer.scene.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid))?(i=this.transformCartesianToWGS84(r)).alt<0?this.transformWGS84ToCartesian(i,.1):r:!1}},getCameraPosition:function(){if(this._viewer){var e,t,i,n,r,o,a,s,l,c,h,d=this._viewer.scene.camera.pickEllipsoid(new u.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(d)return e=180*(d=u.Ellipsoid.WGS84.cartesianToCartographic(d)).longitude/Math.PI,d=180*d.latitude/Math.PI,n=this._viewer.camera._direction,t=u.Math.toDegrees(n.x),i=u.Math.toDegrees(n.y),n=u.Math.toDegrees(n.z),r=this._viewer.camera.positionCartographic.height,o=u.Math.toDegrees(this._viewer.camera.heading),a=u.Math.toDegrees(this._viewer.camera.pitch),s=u.Math.toDegrees(this._viewer.camera.roll),c=(l=this._viewer.camera.computeViewRectangle()).west/Math.PI*180,h=l.north/Math.PI*180,c=(c+l.east/Math.PI*180)/2,h=(h+l.south/Math.PI*180)/2,{lon:e,lat:d,height:r,heading:o,pitch:a,roll:s,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:c,y:h},direction:new u.Cartesian3(t,i,n)}}},getHandlerClickPosition(e){var t,i,n;if(this._viewer)return n=this._viewer.scene,t=this._viewer,i=n.camera.pickEllipsoid(e.position,n.globe.elliposid),t={heading:u.Math.toDegrees(t.camera.heading),pitch:u.Math.toDegrees(t.camera.pitch),roll:u.Math.toDegrees(t.camera.roll),position:t.camera.position},(i=u.Cartographic.fromCartesian(i)).height<0&&(i.height=0),i={alt:i.height,lat:u.Math.toDegrees(i.latitude),lon:u.Math.toDegrees(i.longitude)},n=n.pickPosition(e.position),{wgs84Coor:i,graphicCoor:{height:(e=u.Cartographic.fromCartesian(n)).height,latitude:u.Math.toDegrees(e.latitude),longitude:u.Math.toDegrees(e.longitude)},cameraPosition:t}},updateCameraState:function(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},bindHandelEvent:function({leftClick:t,mouseMove:i,doubleClick:n,leftDown:r,mouseWheel:o,leftUp:a}){var s;this._viewer&&(s=new u.ScreenSpaceEventHandler(this._viewer.canvas),t&&s.setInputAction(function(e){t(e,s)},u.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(e){i(e,s)},u.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(e){n(e,s)},u.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),r&&s.setInputAction(function(e){r(e,s)},u.ScreenSpaceEventType.LEFT_DOWN),o&&s.setInputAction(function(e){o(e,s)},u.ScreenSpaceEventType.WHEEL),a)&&s.setInputAction(function(e){a(e,s)},u.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(t){var i,n;this._viewer&&(i=new u.ScreenSpaceEventHandler(this._viewer.scene.canvas),n=this,i.setInputAction(function(e){e=n._viewer.scene.camera.pickEllipsoid(e.endPosition,n._viewer.scene.globe.ellipsoid);"function"==typeof t&&t(n.transformCartesianToWGS84(e),i)},u.ScreenSpaceEventType.MOUSE_MOVE))},saveSceneImages:function(){var e,t;this._viewer&&(t=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),e=document.createElement("a"),t=function(e){for(var e=e.split(","),t=e[0].match(/:(.*?);/)[1],i=atob(e[1]),n=i.length,r=new Uint8Array(n);n--;)r[n]=i.charCodeAt(n);return new Blob([r],{type:t})}(t),t=URL.createObjectURL(t),e.download="scene.png",e.href=t,e.click())},_installAmapImageryProvider:function(){u.Scene.AmapImageryProvider=function(e){return e.url="img"===e.style?"https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}":"http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}",e.subdomains||(e.subdomains=["01","02","03","04"]),new u.UrlTemplateImageryProvider(e)}},_installTdtImageryProvider:function(){u.Scene.TdtImageryProvider=function(e){return new u.WebMapTileServiceImageryProvider({url:"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}".replace(/\{layer\}/g,e.style||"vec").replace(/\{key\}/g,e.key||""),layer:e.style+"_w",style:"default",format:"tiles",tileMatrixSetID:"GoogleMapsCompatible",subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],minimumLevel:0,maximumLevel:18})}},_installTencentImageryProvider:function(){u.Scene.TencentImageryProvider=function(e){return"img"===e.layer?(e.url||(e.url="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229"),e.subdomains||(e.subdomains=["0","1","2"]),e.customTags={sx:function(e,t,i,n){return t>>4},sy:function(e,t,i,n){return(1<<n)-i>>4}}):e.url||(e.url="https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&type=vector&styleid=1"),new u.UrlTemplateImageryProvider(e)}},_installGooGleImageryProvider:function(){u.Scene.GoogleImageryProvider=function(e){return e.url="img"===e.style?"http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali":"ter"===e.style?"http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile":"http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",e.subdomains||(e.subdomains=["1","2","3","4","5"]),new u.UrlTemplateImageryProvider(e)}},_installBaiduImageryProvider:function(){var t="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function e(e){t=e.url||t,this._url=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new u.WebMercatorTilingScheme({rectangleSouthwestInMeters:new u.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new u.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=e.style||"normal",this._ready=!0}Object.defineProperties(e.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(this.ready)return this._tileWidth;throw new u.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new u.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new u.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new u.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new u.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new u.DeveloperError("rectangle must not be called before the imagery provider is ready.")}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}},readyPromise:{get:function(){return this._readyPromise.promise}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),e.prototype.getTileCredits=function(e,t,i){},e.prototype.requestImage=function(e,t,i){var n,r,o,a;if(this.ready)return e=e,t=t,i=i,r=(n=this)._style,o=n._url+"&x={x}&y={y}&z={z}&customid={style}",a=n._tilingScheme.getNumberOfXTilesAtLevel(i),n=n._tilingScheme.getNumberOfYTilesAtLevel(i),o=o.replace("{x}",e-a/2).replace("{y}",n/2-t-1).replace("{z}",i).replace("{style}",r),u.ImageryProvider.loadImage(this,o);throw new u.DeveloperError("requestImage must not be called before the imagery provider is ready.")},u.Scene.BaiduImageryProvider=e},_installGroundSkyBox:function(){var a=u.BoxGeometry,s=u.Cartesian3,t=u.defaultValue,l=u.defined,i=u.destroyObject,c=u.DeveloperError,h=u.GeometryPipeline,e=u.Matrix3,d=u.Matrix4,p=u.Transforms,m=u.VertexFormat,g=u.BufferUsage,f=u.CubeMap,n=u.DrawCommand,A=u.loadCubeMap,y=u.RenderState,v=u.VertexArray,w=u.BlendingState,C=u.SceneMode,_=u.ShaderProgram,P=u.ShaderSource;function r(e){this.sources=e.sources,this._sources=void 0,this.show=t(e.show,!0),this._command=new n({modelMatrix:d.clone(d.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(d.getRotation)||(d.getRotation=d.getMatrix3);var b=new e;r.prototype.update=function(e,t){var i=this;if(this.show&&(e.mode===C.SCENE3D||e.mode===C.MORPHING)&&e.passes.render){var n=e.context;if(this._sources!==this.sources){this._sources=this.sources;var r=this.sources;if(!(l(r.positiveX)&&l(r.negativeX)&&l(r.positiveY)&&l(r.negativeY)&&l(r.positiveZ)&&l(r.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof r.positiveX!=typeof r.negativeX||typeof r.positiveX!=typeof r.positiveY||typeof r.positiveX!=typeof r.negativeY||typeof r.positiveX!=typeof r.positiveZ||typeof r.positiveX!=typeof r.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof r.positiveX?A(n,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new f({context:n,source:r}))}var o=this._command;if(o.modelMatrix=p.eastNorthUpToFixedFrame(e.camera._positionWC),l(o.vertexArray)||(o.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return d.getRotation(o.modelMatrix,b)}},r=a.createGeometry(a.fromDimensions({dimensions:new s(2,2,2),vertexFormat:m.POSITION_ONLY})),e=this._attributeLocations=h.createAttributeLocations(r),o.vertexArray=v.fromGeometry({context:n,geometry:r,attributeLocations:e,bufferUsage:g._DRAW}),o.renderState=y.fromCache({blending:w.ALPHA_BLEND})),l(o.shaderProgram)&&this._useHdr===t||(r=new P({defines:[t?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),o.shaderProgram=_.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._useHdr=t),l(this._cubeMap))return o}},r.prototype.isDestroyed=function(){return!1},r.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(),i(this)},u.Scene.GroundSkyBox=r},removeHandlerByName(e=[]){e.forEach(e=>{this._viewer.screenSpaceEventHandler.removeInputAction(u.ScreenSpaceEventType[e])})}};let m={};function f(e,t){e&&(this._viewer=e,m=t)}f.prototype={splitCartesians3:function(e){for(var t=[],i=0;i<e.length;i+=3){var n=new m.Cartesian3(e[i],e[i+1],e[i+2]);t.push(n)}return t.push(t[0]),t},getLinkedPointList:function(e,t,i,n){if(this._viewer){var r=[],o=m.Cartographic.fromCartesian(e),a=m.Cartographic.fromCartesian(t),s=180*o.longitude/Math.PI,o=180*o.latitude/Math.PI,l=180*a.longitude/Math.PI,a=180*a.latitude/Math.PI,c=Math.sqrt((s-l)*(s-l)+(o-a)*(o-a))*i,h=m.Cartesian3.clone(e),u=m.Cartesian3.clone(t),d=m.Cartesian3.distance(h,m.Cartesian3.ZERO),p=m.Cartesian3.distance(u,m.Cartesian3.ZERO);if(m.Cartesian3.normalize(h,h),m.Cartesian3.normalize(u,u),0!=m.Cartesian3.distance(h,u)){var g=m.Cartesian3.angleBetween(h,u);r.push(e);for(var f=1;f<n-1;f++){var A=+f/(n-1),y=1-A,v=Math.sin(y*g)/Math.sin(g),w=Math.sin(A*g)/Math.sin(g),v=m.Cartesian3.multiplyByScalar(h,v,new m.Cartesian3),w=m.Cartesian3.multiplyByScalar(u,w,new m.Cartesian3),v=m.Cartesian3.add(v,w,new m.Cartesian3),w=A*Math.PI,y=d*y+p*A+Math.sin(w)*c,v=m.Cartesian3.multiplyByScalar(v,y,v);r.push(v)}r.push(t)}return r}},getPositionsAngle:function(e){var t,i,n,r;if(e)return i=e.position1,r=e.position2,n=m.Transforms.eastNorthUpToFixedFrame(i),n=m.Matrix4.inverse(n,new m.Matrix4),i=m.Matrix4.multiplyByPoint(n,i,new m.Cartesian3),n=m.Matrix4.multiplyByPoint(n,r,new m.Cartesian3),"pitch"===e.type?t=Math.atan2(n.z-i.z,n.x-i.x):"heading "===e.type&&(t=Math.atan2(n.y-i.y,n.x-i.x)),(r=t*(180/Math.PI))<0&&(r+=360),r},getPositionsArea:function(n){let e=0;if(n){let t=0,i=m.Ellipsoid.WGS84;n.push(n[0]);for(let e=1;e<n.length;e++){var r=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[e-1])),o=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[e]));t+=r.x*o.y-o.x*r.y}e=Math.abs(t).toFixed(2)}return e},getPolygonArea:function(i){if(this._viewer){let o=Math.PI/180,a=180/Math.PI;const l=function(e,t){var i=e.lat*o,e=e.lon*o,n=t.lat*o,t=t.lon*o;let r=-Math.atan2(Math.sin(e-t)*Math.cos(n),Math.cos(i)*Math.sin(n)-Math.sin(i)*Math.cos(n)*Math.cos(e-t));return r<0&&(r+=2*Math.PI),r*=a};let t=0;for(let e=0;e<i.length-2;e++){var n=(e+1)%i.length,r=(e+2)%i.length,s=function(e,t,i){let n=l(t,e)-l(t,i);return n<0&&(n+=360),n}(i[e],i[n],i[r]);t+=this.getPointDistance(this.transformWGS84ToCartesian(i[e]),this.transformWGS84ToCartesian(i[n]))*this.getPointDistance(this.transformWGS84ToCartesian(i[n]),this.transformWGS84ToCartesian(i[r]))*Math.abs(Math.sin(s))}return t.toFixed(2)}},getPointDistance:function(e,t){var i;if(this._viewer)return e=m.Cartographic.fromCartesian(e),t=m.Cartographic.fromCartesian(t),(i=new m.EllipsoidGeodesic).setEndPoints(e,t),i=i.surfaceDistance,Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2))},getPositionDistance:function(t){let i=0;for(let e=0;e<t.length-1;e++){var n=this.transformWGS84ToCartographic(t[e]),r=this.transformWGS84ToCartographic(t[e+1]),o=new m.EllipsoidGeodesic,o=(o.setEndPoints(n,r),o.surfaceDistance),o=Math.sqrt(Math.pow(o,2)+Math.pow(r.height-n.height,2));i+=o}return i.toFixed(3)},getIntersectObj:function(e,t,i=[],n=!1){if(this._viewer)return t=m.Cartesian3.normalize(m.Cartesian3.subtract(t,e,new m.Cartesian3),new m.Cartesian3),e=new m.Ray(e,t),t=[],n?t=this._viewer.scene.drillPickFromRay(e,10,i):(n=this._viewer.scene.pickFromRay(e,i),m.defined(n)&&(t=[n])),t},getPointOnEllipsoid:function(e,t,i,n,r,o,a,s,l,c){var h,u,d,p;if(this._viewer)return h=new m.Cartesian3,u=new m.Cartesian3,d=new m.Quaternion,p=new m.Matrix3,t=e+t,m.Cartesian3.multiplyByScalar(n,Math.cos(t),h),m.Cartesian3.multiplyByScalar(i,Math.sin(t),u),m.Cartesian3.add(h,u,h),n=Math.cos(e),n*=n,i=Math.sin(e),i*=i,t=o/Math.sqrt(a*n+r*i)/s,m.Quaternion.fromAxisAngle(h,t,d),m.Matrix3.fromQuaternion(d,p),m.Matrix3.multiplyByVector(p,l,c),m.Cartesian3.normalize(c,c),m.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(e,t,i){if(this._viewer){for(var n=new m.Cartesian3,r=new m.Cartesian3,o=new m.Cartesian3,a=new m.Cartesian3,s=t.ellipsoid,l=t.height,c=t.extrudedHeight,t=i?e.length/3*2:e.length/3,h=new Float64Array(3*t),u=e.length,d=i?u:0,p=0;p<u;p+=3){var g=p+1,f=p+2,A=m.Cartesian3.fromArray(e,p,n),y=(s.scaleToGeodeticSurface(A,A),m.Cartesian3.clone(A,r)),v=s.geodeticSurfaceNormal(A,a),w=m.Cartesian3.multiplyByScalar(v,l,o);m.Cartesian3.add(A,w,A),i&&(m.Cartesian3.multiplyByScalar(v,c,w),m.Cartesian3.add(y,w,y),h[p+d]=y.x,h[g+d]=y.y,h[f+d]=y.z),h[p]=A.x,h[g]=A.y,h[f]=A.z}return h}},computeEllipseEdgePositions:function(e){if(this._viewer){for(var t=new m.Cartesian3,i=new m.Cartesian3,n=new m.Cartesian3,r=new m.Cartesian3,o=e.semiMinorAxis,a=e.semiMajorAxis,s=e.rotation,l=e.center,e=e.granularity&&"number"==typeof e.granularity?e.granularity:Math.PI/180,c=((e=e>Math.PI/12?Math.PI/12:e)<Math.PI/180&&(e=Math.PI/180),o*o),h=a*a,u=a*o,d=m.Cartesian3.magnitude(l),p=m.Cartesian3.normalize(l,t),g=m.Cartesian3.cross(m.Cartesian3.UNIT_Z,l,i),g=m.Cartesian3.normalize(g,g),f=m.Cartesian3.cross(p,g,n),A=Math.ceil(2*m.Math.PI/e),y=e,v=r,w=0,C=[],_=0;_<A;_++)v=this.getPointOnEllipsoid(_*y,s,f,g,c,u,h,d,p,v),C[w++]=v.x,C[w++]=v.y,C[w++]=v.z;a={};return a.numPts=A,a.outerPositions=C,a}},computeSectorEdgePositions:function(e){if(this._viewer){for(var t=new m.Cartesian3,i=new m.Cartesian3,n=new m.Cartesian3,r=new m.Cartesian3,o=e.semiMinorAxis,a=e.semiMajorAxis,s=e.rotation,l=e.angle||2*Math.PI,c=e.center,e=e.granularity&&"number"==typeof e.granularity?e.granularity:Math.PI/180,h=((e=e>Math.PI/12?Math.PI/12:e)<Math.PI/180&&(e=Math.PI/180),o*o),u=a*a,d=a*o,p=m.Cartesian3.magnitude(c),g=m.Cartesian3.normalize(c,t),f=m.Cartesian3.cross(m.Cartesian3.UNIT_Z,c,i),f=m.Cartesian3.normalize(f,f),A=m.Cartesian3.cross(g,f,n),y=Math.ceil(l/e),v=e,w=r,C=0,_=[],P=0;P<y;P++)w=this.getPointOnEllipsoid(P*v,s,A,f,h,d,u,p,g,w),_[C++]=w.x,_[C++]=w.y,_[C++]=w.z;a={};return a.numPts=y,a.outerPositions=_,a}},computeLonlatPointsTerrainData:function(e,t){if(this._viewer){for(var i=[],n=0;n<e.length;n++)i.push(m.Cartographic.fromDegrees(e[n].lon,e[n].lat));this._viewer.scene.clampToHeightMostDetailed(i).then(function(e){t(e)})}},computeCartographicPointsTerrainData:function(e,r){if(this._viewer&&!(e.length<=0)){for(var t=[],i=0;i<e.length;i++)t.push(m.Cartesian3.fromRadians(e[i].longitude,e[i].latitude,e[i].height));var n=this._viewer.scene.clampToHeightMostDetailed(t),o=this;n.then(function(e){for(var t=[],i=o._viewer.scene.globe.ellipsoid,n=0;n<e.length;n++)t.push(i.cartesianToCartographic(e[n]));r(t)}).catch(function(e){console.log(e)})}},_checkLonDegree:function(e){return!(180<e||e<-180)},_checkLatDegree:function(e){return!(90<e||e<-90)},computeInterpolateLineLonlat:function(e,t){if(!e||!t)return null;if(e.lon||!e.lat||!t.lon||!t.lat)return null;if(!(this._checkLonDegree(e.lon)&&this._checkLonDegree(t.lon)&&this._checkLatDegree(e.lat)&&this._checkLatDegree(t.lat)))return null;var i=[],n=(i.push([e.lon,e.lat]),Math.sqrt(Math.pow(t.lon-e.lon,2)+Math.pow(t.lat-e.lat,2)));if(n<=1e-5)i.push([t.lon,t.lat]);else for(var r=n/1e-5,o=(t.lon-e.lon)/r,a=(t.lat-e.lat)/r,s=0;s<r;s++){var l=e.lon+(s+1)*o,c=e.lat+(s+1)*a;i.push([l,c])}return i},computeInterpolateLineCartographic:function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var n=[],r=(n.push(new m.Cartographic(e.longitude,e.latitude)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2))),i=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(r<=i)n.push(new m.Cartographic(t.longitude,t.latitude));else{for(var o=r/i,a=(t.longitude-e.longitude)/o,s=(t.latitude-e.latitude)/o,l=0;l<o;l++){var c=e.longitude+(l+1)*a,h=e.latitude+(l+1)*s;n.push(new m.Cartographic(c,h))}n.push(new m.Cartographic(t.longitude,t.latitude,t.height))}return n},computeInterpolateLineHeightCartographic:function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[],n=(i.push(new m.Cartographic(e.longitude,e.latitude,e.height)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)));if(!(n<=1e-5*Math.PI/180))for(var r=n/1e-5*Math.PI/180,o=(t.longitude-e.longitude)/r,a=(t.latitude-e.latitude)/r,s=(t.height-e.height)/r,l=0;l<r;l++){var c=e.longitude+(l+1)*o,h=e.latitude+(l+1)*a,u=e.height+(l+1)*s;i.push(new m.Cartographic(c,h,u))}return i.push(new m.Cartographic(t.longitude,t.latitude,t.height)),i},computeInterpolate2IndexLineHeightCartographic:function(e,t,i,n){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new m.Cartographic(e.longitude,e.latitude,e.height));for(var o=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<n;l++){var c=e.longitude+(l+1)*o,h=e.latitude+(l+1)*a,u=e.height+(l+1)*s;r.push(new m.Cartographic(c,h,u))}return r},computeInterpolateIndexLineHeightCartographic:function(e,t,i,n){var r,o;return e&&t&&e.longitude&&e.latitude&&t.longitude&&t.latitude?(r=(t.longitude-e.longitude)/i,o=(t.latitude-e.latitude)/i,t=(t.height-e.height)/i,i=e.longitude+n*r,r=e.latitude+n*o,o=e.height+n*t,new m.Cartographic(i,r,o)):null}};let g=null;function A(e,t,i){e&&(this._viewer=e,g=t,this._installPrimitives())}A.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive()},_installTetrahedronPrimitive:function(){try{function e(e){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=e.position,this._createCommand=M,this._angle=0,this._distance=b(e.distance,1),this._setInterval=void 0,this._viewer=x,this._speed=b(e.speed,1),this._color=b(e.color,new t(1,1,0,.8)),this._scale=b(e.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=S,this._modelMatrix=G(this),this._height=k(this),D(this)}var i=g.Cartesian3,n=g.ComponentDatatype,a=g.PrimitiveType,r=g.BoundingSphere,o=g.GeometryAttribute,s=g.GeometryPipeline,l=g.Geometry,c=g.defined,h=g.RenderState,u=g.ShaderSource,d=g.ShaderProgram,p=g.DrawCommand,m=g.Pass,f=g.Appearance,A=g.BufferUsage,t=g.Color,y=g.VertexArray,v=(g.buildModuleUrl,g.Matrix4),w=g.Matrix3,C=g.Texture,_=g.Resource,P=g.Transforms,b=g.defaultValue,x=this._viewer,S=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";e.prototype.update=function(e){this.show&&(c(this._command)||(this._command=this._createCommand(e.context,this)),c(this._command))&&e.commandList.push(this._command)},e.prototype.isDestroyed=function(){return!1},e.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},e.prototype.startAnimate=function(){let t=this;this._setInterval=setInterval(function(){t._angle=t._angle+.01,0<Math.sin(t._angle)?t._height=.01:t._height=-.01;var e=new g.Cartesian3(0,0,t._height),e=(v.multiplyByTranslation(t._modelMatrix,e,t._modelMatrix),v.fromRotationTranslation(w.fromRotationZ(g.Math.toRadians(t._speed))));v.multiply(t._modelMatrix,e,t._modelMatrix)},5)},e.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const M=function(e,t){var i=T(),n=L(),r=f.getDefaultRenderState(!1,!0,void 0),r=h.fromCache(r),i=new u({sources:[i]}),n=new u({sources:[n]}),o={color:function(){return t._color},myImage:function(){return c(t._texture)?t._texture:t._viewer.scene.context.defaultTexture}},i=d.fromCache({context:e,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:{position:0,textureCoordinates:1}});return new p({vertexArray:I(e),primitiveType:a.TRIANGLES,renderState:r,shaderProgram:i,uniformMap:o,owner:this,pass:m.TRANSLUCENT,modelMatrix:t._modelMatrix})},I=function(e){var t=E(),t=new l({attributes:{position:new o({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.positions}),textureCoordinates:new o({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:t.sts})},indices:t.indices,primitiveType:a.TRIANGLES,boundingSphere:r.fromVertices(t.positions)}),t=s.computeNormal(t);return y.fromGeometry({context:e,geometry:t,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:A.STATIC_DRAW})},E=function(){var e=new Float64Array(15),t=(e[0]=0,e[1]=1,e[2]=0,e[3]=-1,e[4]=0,e[5]=0,e[6]=0,e[7]=-1,e[8]=0,e[9]=1,e[10]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=-1,new Uint16Array(18));return t[0]=4,t[1]=2,t[2]=3,t[3]=4,t[4]=3,t[5]=0,t[6]=4,t[7]=0,t[8]=1,t[9]=4,t[10]=1,t[11]=2,t[12]=1,t[13]=2,t[14]=3,t[15]=1,t[16]=3,t[17]=0,{indices:t,positions:e,sts:new Float32Array([0,0,1,0,1,1,0,1,.5,.5])}},T=function(){return"#version 300 es\n in vec3 position;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n out vec4 v_pickColor;\n void main()\n {\n v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;\n v_normalEC = czm_normal * normal;\n v_st = st;\n // v_pickColor = czm_batchTable_pickColor(batchId);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},L=function(){return"#version 300 es\n precision mediump float;\n in vec3 v_positionEC;\n in vec3 v_normalEC;\n in vec2 v_st;\n uniform vec4 color;\n in vec4 v_pickColor;\n uniform sampler2D myImage;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n vec2 st = materialInput.st;\n czm_material material = czm_getDefaultMaterial(materialInput);\n float dt_a11 = fract(czm_frameNumber / 100.0) * 3.14159265 * 2.0;\n float dt_a12 = sin(dt_a11);\n float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;\n vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));\n material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;\n material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},D=function(i){_.createIfNeeded(i._imageUrl).fetchImage().then(function(e){var t=i._viewer.scene.context,t=c(e.internalFormat)?new C({context:t,pixelFormat:e.internalFormat,width:e.naturalWidth,height:e.naturalHeight,source:{arrayBufferView:e.bufferView}}):new C({context:t,source:e});i._texture=t})},G=function(e){var t=P.eastNorthUpToFixedFrame(e._localPosition),i=v.fromScale(e._scale),n=v.multiply(t,i,new v);return e._scaleMatrix=i,e._enuMatrix=t,n},k=function(e){var t=i.fromElements(0,0,e._distance,new g.Cartesian3),t=g.Matrix4.multiplyByPoint(e._enuMatrix,t,new i),t=v.multiplyByPoint(e._viewer.scene.camera._viewMatrix,t,new i),e=v.multiplyByPoint(e._viewer.scene.camera.frustum.projectionMatrix,t,new i);return i.normalize(e,new i).z};g.Scene.TetrahedronPrimitive=e}catch(i){console.log(i)}},_installXyzAxisPrimitive:function(){function e(e){this._viewer=e.viewer,this._model=e.model,this._matrix=e.matrix,this._radius=void 0,this._layer=new g.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new g.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=!1,this._xyzPid=void 0,this._builds()}e.prototype={_builds(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(e=>{var t=g.Matrix4.getTranslation(e.modelMatrix,new g.Cartesian3),e=e.boundingSphere,i=e.radius,n=new g.ArrowPolylinePrimitive({id:"axisZ",color:g.Color.RED,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),r=new g.ArrowPolylinePrimitive({id:"axisX",color:g.Color.GREEN,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),t=new g.ArrowPolylinePrimitive({id:"axisY",color:g.Color.BLUE,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),i=g.Matrix3.fromRotationY(g.Math.toRadians(90)),i=(this._rotationX=g.Matrix4.fromRotationTranslation(i),g.Matrix4.multiply(r.geometryInstances[0].modelMatrix,this._rotationX,r.geometryInstances[0].modelMatrix),g.Matrix4.multiply(r.geometryInstances[1].modelMatrix,this._rotationX,r.geometryInstances[1].modelMatrix),g.Matrix3.fromRotationX(g.Math.toRadians(90)));this._rotationY=g.Matrix4.fromRotationTranslation(i),g.Matrix4.multiply(t.geometryInstances[0].modelMatrix,this._rotationY,t.geometryInstances[0].modelMatrix),g.Matrix4.multiply(t.geometryInstances[1].modelMatrix,this._rotationY,t.geometryInstances[1].modelMatrix),this._layer._primitives.add(n),this._layer._primitives.add(r),this._layer._primitives.add(t),this._radius=e.radius,this._createAxisSphere()})},_createAxisSphere:function(){var t=[];for(let e=0;e<=360;e+=3){const i=Math.sin(g.Math.toRadians(e)),n=Math.cos(g.Math.toRadians(e)),r=this._radius*n,o=this._radius*i;t.push(new g.Cartesian3(r,o,0))}var e=this._createAxisSpheres("axisSphereZ",t,this._matrix,g.Color.RED);this._layer._primitives.add(e);const i=this._createAxisSpheres("axisSphereY",t,this._matrix,g.Color.GREEN),n=(this._layer._primitives.add(i),g.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",t,this._matrix,g.Color.BLUE));this._layer._primitives.add(n),g.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(e,t,i,n){t=new g.PolylineGeometry({positions:t,width:10}),t=new g.GeometryInstance({geometry:t,id:e,attributes:{color:g.ColorGeometryInstanceAttribute.fromColor(n)}});return new g.Primitive({geometryInstances:t,appearance:new g.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(i){if(this._layer){var n=this._layer._primitives._primitives;for(let e=1,t=n.length;e<t;e++){var r=n[e],o=g.Matrix4.fromTranslation(new g.Cartesian3(i.x,i.y,i.z));g.Matrix4.multiply(r.modelMatrix,o,r.modelMatrix)}}var e=g.Matrix4.fromTranslation(new g.Cartesian3(i.x,i.y,i.z));g.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_updateAxisSphere(i){if(this._layer){var n=this._layer._primitives._primitives;for(let e=1,t=n.length;e<t;e++){var r=n[e],o=g.Matrix4.fromRotationTranslation(i);g.Matrix4.multiply(r.modelMatrix,o,r.modelMatrix)}}var e=g.Matrix4.fromRotationTranslation(i);g.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_bindHandler(){this._handler.setInputAction(e=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case"axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case"axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case"axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case"axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case"axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case"axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case"axisSphereX":this._updateAxisSphere(g.Matrix3.fromRotationX(g.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(g.Matrix3.fromRotationY(g.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(g.Matrix3.fromRotationZ(g.Math.toRadians(1)))}},g.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(e=>{e=viewer.scene.pick(e.position);e&&e.id&&(this._xyzPid=e.id,this._xyzState=!0)},g.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},g.ScreenSpaceEventType.LEFT_UP)}},g.Scene.XyzAxisPrimitive=e},_installArrowPolylinePrimitive:function(){g.Scene.ArrowPolylinePrimitive=function(e={}){this._color=e.color||g.Color.RED,this._width=e.width||3,this._headWidth=e.headWidth||2*this._width,this._length=e.length||300,this._headLength=e.headLength||10,this._inverse=e.inverse||!1,this.position=e.position;var e=e.id,t=g.CylinderGeometry.createGeometry(new g.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=g.CylinderGeometry.createGeometry(new g.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let n=(this._length+this._headLength)/2;this._inverse&&(n=-n);var r=i,o=[0,0,n],a=new g.Cartesian3;o.length?(a.x=o[0],a.y=o[1],a.z=o[2]):g.Cartesian3.clone(o,a);for(let e=0;e<r.attributes.position.values.length;e+=3)r.attributes.position.values[e]+=a.x,r.attributes.position.values[e+1]+=a.y,r.attributes.position.values[e+2]+=a.z;return new g.Primitive({modelMatrix:g.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new g.GeometryInstance({id:e+"-line",geometry:t}),new g.GeometryInstance({id:e+"-arrow",geometry:i})],appearance:new g.MaterialAppearance({material:g.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){function e(e){var t=(e=g.defaultValue(e,g.defaultValue.EMPTY_OBJECT)).scene;if(!g.defined(t))throw new g.DeveloperError("scene is required.");var i=(this._scene=t)._context;if(!g.defined(i))throw new g.DeveloperError("context is required.");if(!g.defined(e.viewerPosition))throw new g.DeveloperError("this view position is required.");this._viewerPosition=e.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new g.Camera(t),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=g.defaultValue(e.horizontalFov,60),this._verticalFov=g.defaultValue(e.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();t=new g.Cartesian3(0,0,100),e=g.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);g.Matrix4.multiplyByPoint(e,t,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new g.Matrix4,this._shadowMap=new g.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=g.Color.RED,this._visiblyColor=g.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:g.Color.RED,visibly:g.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var e=this._indices,t=0;e[t++]=0,e[t++]=1,e[t++]=0,e[t++]=21,e[t++]=0,e[t++]=85,e[t++]=0,e[t++]=105;for(var i=0,n=0;n<5;++n){i++;for(var r=0;r<20;++r)e[t++]=i++,e[t++]=i}i++;for(var o=0;o<20;++o)for(var a=0;a<5;++a)e[t++]=i,e[t++]=5+i++;this._initialized=!0},this._debugLightFrustum=void 0,this._debugShow=!0}Object.defineProperties(e.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(e){this.shadowMap.debugShow=e,this._debugShow=e}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(e){this._invisiblyColor=e,this.shadowMap._customColor.invisibly=e}},visiblyColor:{get:function(){return this._visiblyColor},set:function(e){this._visiblyColor=e,this.shadowMap._customColor.visibly=e}},viewerPosition:{get:function(){return this._viewerPosition},set:function(e){this._viewerPosition=e,this._cameraUpdated=!1}},direction:{get:function(){return this._direction},set:function(e){this._direction=e,this._cameraUpdated=!1}},pitch:{get:function(){return this._pitch},set:function(e){this._pitch=e,this._cameraUpdated=!1}},horizontalFov:{get:function(){return this._horizontalFov},set:function(e){this._horizontalFov=e,this._cameraUpdated=!1,this._hintLineUpdated=!1}},verticalFov:{get:function(){return this._verticalFov},set:function(e){this._verticalFov=e,this._cameraUpdated=!1,this._hintLineUpdated=!1}},distance:{get:function(){return this._distance},set:function(e){this._distance=e,this._cameraUpdated=!1}}}),e.prototype.setDebugFrustumEffect=function(t,i){var e,n;this.debugShow&&(e=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives,e.forEach(function(e){e.show=t}),n.forEach(function(e){e.show=i}))},e.prototype.update=function(e){var t;this.show&&(this._cameraUpdated||(this._updateCamera(),this.debugShow&&!g.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new g.DebugCameraPrimitive({camera:this._depthCamera,color:g.Color.YELLOW,updateOnChange:!0}),this.setDebugFrustumEffect(!1,!0))),t=e.frustumSplits[1],e.frustumSplits[1]=this._distance,this._debugLightFrustum.update(e),e.frustumSplits[1]=t,e.shadowMaps.push(this.shadowMap))},e.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=g.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:g.Math.toRadians(this._direction),pitch:g.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},e.prototype.setPoseByTargetPoint=function(e){this.distance=g.Cartesian3.distance(this._viewerPosition,e);var t=new g.Cartesian3,i=g.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);g.Matrix4.inverse(i,i),g.Matrix4.multiplyByPoint(i,e,t),g.Cartesian3.normalize(t,t),this.direction=g.Math.toDegrees(Math.atan2(t.x,t.y)),this.pitch=g.Math.toDegrees(Math.asin(t.z))},e.prototype._updateHintLine=function(e){var t,i=this._positions,n=g.Math.toRadians(this._horizontalFov),r=g.Math.toRadians(this._verticalFov),o=Math.tan(.5*n),r=Math.tan(.5*r),a=-(o=this._distance*o),r=-(t=this._distance*r),a=new g.Cartesian3(a,r,-this._distance),r=new g.Cartesian3(o,t,0),o=(g.Matrix4.multiplyByPoint(this._modelMatrix,a,a),g.Matrix4.multiplyByPoint(this._modelMatrix,r,r),g.BoundingSphere.fromCornerPoints(a,r));if(e.cullingVolume.computeVisibility(o)!==Intersect.OUTSIDE){this._valid=!0;var s=0;i[s++]=0,i[s++]=0,i[s++]=0;for(var l,c=Math.PI-.5*n,h=n/4,u=0;u<5;++u)for(var d=c+u*h,p=t/(this._distance/Math.cos(d)),m=-(v=Math.atan(p)),f=v/10,A=0;A<21;++A)l=m+A*f,i[s++]=this._distance*Math.cos(l)*Math.sin(d),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(d);for(var h=n/20,y=0;y<21;++y){d=c+y*h;for(var v,p=t/(this._distance/Math.cos(d)),m=-(v=Math.atan(p)),f=v/2,w=0;w<5;++w)l=m+w*f,i[s++]=this._distance*Math.cos(l)*Math.sin(d),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(d)}var C,_=e.context,a=g.Buffer.createIndexBuffer({context:_,typedArray:new Uint32Array(this._indices),usage:g.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),r=g.Buffer.createVertexBuffer({context:_,typedArray:g.ComponentDatatype.createTypedArray(g.ComponentDatatype.FLOAT,this._positions),usage:g.BufferUsage.STATIC_DRAW}),n=[],e=(n.push({index:0,vertexBuffer:r,componentDatatype:g.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new g.VertexArray({context:_,attributes:n,indexBuffer:a}));g.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=e,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=o):(r=g.ShaderProgram.fromCache({context:_,vertexShaderSource:"in vec3 position;\n uniform mat4 u_modelViewMatrix;\n void main()\n {\n gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);\n }\n ",fragmentShaderSource:"uniform vec4 u_bgColor;\n void main()\n {\n out_FragColor = u_bgColor;\n }\n "}),n=g.RenderState.fromCache({depthTest:{enabled:!0}}),a={u_bgColor:function(){return C._lineColor},u_modelViewMatrix:function(){return _.uniformState.modelView}},(C=this)._drawLineCommand=new g.DrawCommand({boundingVolume:o,modelMatrix:C._modelMatrix,primitiveType:g.PrimitiveType.LINES,vertexArray:e,shaderProgram:r,castShadows:!1,receiveShadows:!1,uniformMap:a,renderState:n,pass:g.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},g.Scene.ShadowPrimitive=e},_installPointsPrimitive:function(){function e(e){e&&e.viewer&&e.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=e.viewer,this.build(e))}e.prototype={build:function(e){if(e.Cartesians&&2<=e.Cartesians.length){var t=[],i=[],n=[];if(e.Colors&&e.Colors.length===4*e.Cartesians.length){for(var r=0;r<e.Cartesians.length;r++)t.push(e.Cartesians[r].x),t.push(e.Cartesians[r].y),t.push(e.Cartesians[r].z);i=e.Colors}else for(var o=0;o<e.Cartesians.length;o++)t.push(e.Cartesians[o].x),t.push(e.Cartesians[o].y),t.push(e.Cartesians[o].z),i.push(0),i.push(0),i.push(1),i.push(1);for(var a=0;a<e.Cartesians.length;a++)n.push(a);this.positionArr=new Float64Array(t),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(n)}else{var s=g.Cartesian3.fromDegrees(0,0,-10),l=g.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([s.x,s.y,s.z,l.x,l.y,l.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},getVSPolylie:function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return"in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(e,t){return new g.Appearance({renderState:{blending:g.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:e,vertexShaderSource:t})},createGeometry:function(e,t,i){return new g.Geometry({attributes:{position:new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),color:new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:t})},indices:i,primitiveType:g.PrimitiveType.POINTS,boundingSphere:g.BoundingSphere.fromVertices(e)})},remove:function(){null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null)},updateCartesianPosition:function(e){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var t=e[0],i=e[1];this.positionArr=new Float64Array([t.x,t.y,t.z,i.x,i.y,i.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var n=[],r=[],o=[],a=0;a<e.length;a++)n.push(e[a].x),n.push(e[a].y),n.push(e[a].z),r.push(0),r.push(0),r.push(1),r.push(1);for(var s=0;s<e.length;s++)o.push(s);this.positionArr=new Float64Array(n),this.colorArr=new Float32Array(r),this.indiceArr=new Uint16Array(o),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}},updateCartesianPositionColor:function(e,t){if(t.length===4*e.length&&null!=this.primitive&&(viewer.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var i=e[0],n=e[1];this.positionArr=new Float64Array([i.x,i.y,i.z,n.x,n.y,n.z]),this.colorArr=new Float32Array(t),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var r=[],o=[],a=0;a<e.length;a++)r.push(e[a].x),r.push(e[a].y),r.push(e[a].z);for(a=0;a<e.length;a++)o.push(a);this.positionArr=new Float64Array(r),this.colorArr=new Float32Array(t),this.indiceArr=new Uint16Array(o),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},g.Scene.PointsPrimitive=e},_installWaterPrimitive:function(){let t=this;function e(e){this._positions=e.positions,this._url=e.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=e.frequency||1e3,this._animationSpeed=e.animationSpeed||.01,this._amplitude=e.amplitude||10,this._extrudedHeight=e.extrudedHeight||0,this._viewer=t._viewer,this._fs=this.getFS()}e.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({allowPicking:!1,geometryInstances:new g.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createAppearence=function(){return new g.EllipsoidSurfaceAppearance({material:new g.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},e.prototype._createGeometry=function(){return new g.PolygonGeometry({polygonHierarchy:new g.PolygonHierarchy(g.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:!0})},e.prototype.getFS=function(){return"\n precision highp float;\n struct Light {\n vec3 position;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n };\n in vec3 position;\n in vec2 textureCoord;\n\n uniform vec3 viewPos;\n uniform Light light;\n\n uniform sampler2D normalSampler;\n uniform samplerCube skybox;\n uniform float detalX;\n\n void main() {\n\n float z = gl_FragCoord.z / gl_FragCoord.w;\n const float LOG2 = 1.442695;\n float density = 0.005;\n float normalFactor = exp( -density * density * z * z * LOG2 );\n normalFactor = clamp(normalFactor, 0.0, 1.0);\n\n vec4 normalTex1 = texture(normalSampler, vec2(textureCoord.s + detalX/1024.0, textureCoord.t - detalX/1024.0));\n vec3 normalTex2 = texture(normalSampler, vec2(textureCoord.t, textureCoord.s)).rgb;\n vec3 normal1 = normalize(vec3(normalTex1.r * 2.0 - 1.0, normalTex1.b,normalTex1.g*2.0-1.0));\n vec3 normal2 = normalize(vec3(normalTex2.r * 2.0 - 1.0, normalTex2.b,normalTex2.g*2.0-1.0));\n\n vec3 normal = mix(normal1,normal2,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,normalFactor);\n\n vec3 viewDir = normalize(viewPos - position);\n\n vec3 I = normalize(position - viewPos);\n vec3 R = reflect(I, normal);\n vec3 reflection = texture(skybox, R).rgb;\n\n float ratio = 1.00 / 1.33;\n vec3 Rr = refract(I, normal , ratio);\n vec3 refraction = texture(skybox, Rr).rgb;\n\n float reflectivity = 0.02;\n float theta = max( dot( viewDir, normal ), 0.0 );\n float reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 2.0 );\n\n vec3 reflectanceColor = mix( refraction, reflection, reflectance );\n\n out_FragColor = vec4(reflectanceColor,1.0);\n\n }\n "},e.prototype.getVS=function(){return" in vec3 normal;in vec2 st;in float batchId; out vec3 v_normalEC;uniform mat4 u_modelViewMatrix;uniform mat4 u_invWorldViewMatrix;uniform int u_clampToGroud;uniform vec3 u_camPos;uniform vec3 u_scale;out vec3 vToEye;out vec2 vUv;out vec4 vCoord;void main(void){v_normalEC = czm_normal * normal;if (u_clampToGroud == 1){} else {vCoord = gl_Position;}vUv = st;}"},e.prototype.getFS2=function(){return"in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n \n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n out_FragColor.a = 0.5;\n #endif\n }\n "},A.prototype.updateDegreesPosition=function(e,t){null==this.primitive||(this._viewer.scene.primitives.remove(this.primitive),e&&e.length<3)||(e=this._createGeometry(e,t||0),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({allowPicking:!1,geometryInstances:new g.GeometryInstance({geometry:e}),appearance:this._appearance,asynchronous:!1})))},g.Scene.WaterPrimitive=e},_installTexturePrimitive:function(){function e(e){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=e.url,this._cartesians=e.cartesians,this._id=e.id||""}e.prototype.build=function(){for(var e=[],t=0;t<this._cartesians.length;t++)e.push(this._cartesians[t].x),e.push(this._cartesians[t].y),e.push(this._cartesians[t].z);this._positionArr=new Float32Array(e),this._sts=new Uint8Array([0,0,1,0,1,1,0,1]),this._indiceArr=new Uint16Array([0,1,2,0,2,3]),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:new g.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createGeometry=function(){var e=new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new g.Geometry({attributes:{position:new g.GeometryAttribute({componentDatatype:g.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:e},indices:this._indices,primitiveType:g.PrimitiveType.TRIANGLES,boundingSphere:g.BoundingSphere.fromVertices(positions)})},e.prototype._createAppearence=function(){return new g.Appearance({material:new g.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:g.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},e.prototype.getVS=function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},e.prototype.getFS=function(){return"in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},e.prototype.getMS=function(){return"czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},g.Scene.TexturePrimitive=e},_installProbingPrimitive:function(){var t={color:new g.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:g.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},i=this._viewer;function e(e){this._viewer=i,this._length=e.length||t.length,this._center=e.center||t.center,this._color=e.color||t.color,this._repeat=e.repeat||t.repeat,this._offset=e.offset||t.offset,this._thickness=e.thickness||t.thickness,this._bottom=e.bottom||t.bottom,this._top=e.top||t.top,this._radar=void 0,this.build()}e.prototype.build=function(){var e=new g.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:g.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),e=new g.GeometryInstance({geometry:e,modelMatrix:this.getModelMatrix()}),t=new g.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new g.Primitive({geometryInstances:[e],appearance:t})),this._viewer.scene.preUpdate.addEventListener(function(){var e=i._radar.appearance.material.uniforms.offset;1<(e-=.001)&&(e=0),i._radar.appearance.material.uniforms.offset=e})},e.prototype.getModelMatrix=function(){return g.Matrix4.multiplyByTranslation(g.Transforms.eastNorthUpToFixedFrame(this._center),new g.Cartesian3(0,0,.5*this._length),new g.Matrix4)},e.prototype.updateModelMatrix=function(){},e.prototype.getMaterial=function(){return new g.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:"uniform vec4 color; \n uniform float repeat; \n uniform float offset; \n uniform float thickness;\n\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m); \n\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n return material;\n }"},translucent:!1})},e.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},g.Scene.ProbingPrimitive=e},_initCustomPrimitive:function(e){let u=g;function t({img:e,center:t,height1:i=0,height2:n=3e5,scale:r=.003}){this.drawCommand=null,this._texture=null,this._image=null,this.img=e,this.center=t,this.height1=i,this.height2=n,this.scale=r}return t.prototype.update=function(e){null===this.drawCommand&&this.createDrawCommand(e.context),null===this._texture&&this.createTexture(e.context),e.commandList.push(this.drawCommand)},t.prototype.isDestroyed=function(){return!1},t.prototype.createTexture=function(e){null===this._image&&(this._image=new Image,this._image.src=this.img||"static/data/images/Textures/beautiful.jpg",this._image.onload=()=>{this._texture=new u.Texture({context:e,source:this._image})})},t.prototype.createDrawCommand=function(e){var t=this.createPyramidGeometry(),i=u.VertexArray.fromGeometry({context:e,geometry:t,attributeLocations:u.GeometryPipeline.createAttributeLocations(t)}),t=u.ShaderProgram.fromCache({context:e,vertexShaderSource:"in vec3 position3DHigh;\nin vec3 position3DLow;\nin float batchId;\nin vec3 position;\nin vec2 st;\nout vec2 v_st;\nuniform vec3 v1;\nuniform vec3 v2;\n\n// 罗德里格旋转公式\nmat4 RodriguesRotation(vec3 v1, vec3 v2, float theta) {\n\n vec3 _p = v2 - v1;\n vec3 p = normalize(_p);\n\n float x = p.x;\n float y = p.y;\n float z = p.z;\n\n float xy = x * y;\n float xx = x * x;\n float xz = x * z;\n float yy = y * y;\n float yz = y * z;\n float zz = z * z;\n\n float sintheta = sin(radians(theta));\n float costheta = cos(radians(theta));\n\n float _m00 = costheta + xx * (1.0 - costheta);\n float _m01 = z * sintheta + xy * (1.0 - costheta);\n float _m02 = -y * sintheta + xz * (1.0 - costheta);\n float _m03 = 0.0;\n float _m10 = -z * sintheta + xy * (1.0 - costheta);\n float _m11 = costheta + yy * (1.0 - costheta);\n float _m12 = x * sintheta + yz * (1.0 - costheta);\n float _m13 = 0.0;\n float _m20 = y * sintheta + xz * (1.0 - costheta);\n float _m21 = -x * sintheta + yz * (1.0 - costheta);\n float _m22 = costheta + zz * (1.0 - costheta);\n float _m23 = 0.0;\n\n return mat4(_m00, _m01, _m02, _m03, _m10, _m11, _m12, _m13, _m20, _m21, _m22,\n _m23, 0, 0, 0, 1.0);\n}\n\nvoid main() {\n float ty = abs(cos(czm_frameNumber / 60.0)) * 0.3;\n mat4 translateY = mat4(1, 0, 0, 0, 0, 1, 0, ty, 0, 0, 1, 0, 0, 0, 0, 1);\n mat4 roatateAxis = RodriguesRotation(v1, v2, czm_frameNumber);\n //vec4 roatePosition = roatateAxis * vec4(position, 1.0);\n vec4 roatePosition = vec4(position, 1.0);\n v_st = st;\n gl_Position = czm_projection * czm_modelView * roatePosition * translateY;\n}",fragmentShaderSource:"in vec2 v_st;\nuniform sampler2D wenli;\nuniform vec2 iResolution;\nvoid main() {\n vec2 uv = gl_FragCoord.xy / iResolution.xy;\n float r = 0.01;\n // 使用length 实现圆弧光带\n uv.x *= iResolution.x / iResolution.y;\n float d = length(uv);\n r = abs(sin(r * czm_frameNumber) * iResolution.x / iResolution.y);\n vec4 wenli = texture(wenli, v_st);\n vec4 centerColor = vec4(0.0, 255.0, 0.0, 1.0);\n float ratio =\n smoothstep(r, r + 0.02, d) - smoothstep(r + 0.0029, r + 0.06, d);\n vec4 mixColor = vec4(mix(vec4(ratio), centerColor, ratio));\n out_FragColor = vec4(mix(wenli, mixColor, ratio));\n}\n",attributeLocations:u.GeometryPipeline.createAttributeLocations(t)});let n=new u.Cartesian2(e.canvas.width,e.canvas.height),r={v1:()=>this.v1,v2:()=>this.v2,wenli:()=>null!==this._texture?this._texture:e.defaultTexture,iResolution:()=>n},o=u.RenderState.fromCache();this.drawCommand=new u.DrawCommand({vertexArray:i,shaderProgram:t,uniformMap:r,renderState:o,pass:u.Pass.OPAQUE})},t.prototype.createPyramidGeometry=function(){let e=this.height1,i=this.height2,t=this.scale,n=this.center||[104.057605,30.607196],r=h(n,[-t,t]),o=h(n,[t,t]),a=h(n,[-t,-t]),s=h(n,[t,t]),l=[];function c(e,t=i){e=u.Cartesian3.fromDegrees(...e,t);return[e.x,e.y,e.z]}function h(e,t){return[t[0]+e[0],t[1]+e[1]]}return l.push(...c(n,e),...c(r),...c(o),...c(a),...c(s)),this.v1=new u.Cartesian3(...c(n,e)),this.v2=new u.Cartesian3(...c(n,i)),new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:u.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(l)}),st:new u.GeometryAttribute({componentDatatype:u.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array([.5,.5,0,1,1,1,0,0,1,0])})},indices:[0,1,3,0,1,2,0,2,4,0,3,4,1,2,3,2,3,4],boundingSphere:u.BoundingSphere.fromVertices(l)})},new t(e)},customPrimivive(e){return this._initCustomPrimitive(e)}};let v=null;class y{constructor(e,t){v=t,this._viewer=e,this._labelEntity=null,this.$graphics=new s(e,t),this.isInit=!1}initTool(){this.isInit||(this._labelEntity=this._viewer.entities.add({position:v.Cartesian3.fromDegrees(0,0),label:this.$graphics.getLabelGraphics({l_text:"操作提示",l_fillColor:v.Color.CYAN,l_outlineColor:v.Color.BLACK})}),this._labelEntity.show=!1,this.isInit=!0)}setVisible(e){this.isInit&&(this._labelEntity.show=!!e)}showAt(e,t){this.isInit&&e&&t&&(this._labelEntity.show=!0,(e=this._viewer.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid))?(this._labelEntity.position=e,this._labelEntity.show=!0,this._labelEntity.label.text=t):this._labelEntity.show=!1)}showAtCartesian(e,t){this.isInit&&e&&t&&(this._labelEntity.show=!0,this._labelEntity.position=e,this._labelEntity.show=!0,this._labelEntity.label.text=t)}}let w=null,C=null;function _(e,t,i){e&&(w=t,this._drawLayer=new w.CustomDataSource("drawLayer"),s.prototype={...s.prototype,...p.prototype},this.$graphics=new s(e,t),e&&e.dataSources.add(this._drawLayer),this.tooltip=new y(e,t),this.tooltip.initTool())}_.prototype={drawPointGraphics:function(t){var i,n,e,r,o,a;(t=t||{}).style=t.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:!0,scale:1,pixelOffset:new w.Cartesian2(0,-20)},this._viewer&&t&&(e=new w.Entity,r=[],o=this,a=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas),(C=a).setInputAction(function(e){e=o.getCatesian3FromPX(e.position);o.tooltip.showAtCartesian(e,"右键单击结束!"),e&&e.x&&(i=e,r.push(e))},w.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){e=o.getCatesian3FromPX(e.endPosition);e&&e.x&&(i=e,(r=[]).push(e)),a.destroy(),a=null,o.tooltip.setVisible(!1),"function"==typeof t.callback&&t.callback(o.transformCartesianArrayToWGS84Array(r),n)},w.ScreenSpaceEventType.RIGHT_CLICK),e.billboard=t.style,e.position=new w.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(e))},drawLineGraphics:function(t){if(t=t||{},this._viewer&&t){var i,n=[],e=new w.Entity,r=this,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);(C=o).setInputAction(function(e){e=r.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length&&n.push(e.clone()),t.measure&&a(e),2==n.length&&"straightLine"===t.type&&(o.destroy(),o=null,"function"==typeof t.callback)&&t.callback(r.transformCartesianArrayToWGS84Array(n),i),n.push(e))},w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(e){e=r.getCatesian3FromPX(e.endPosition);r.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.length&&e&&e.x&&(n.pop(),n.push(e))},w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(function(e){r.tooltip.setVisible(!1),o.destroy(),o=null;e=r.getCatesian3FromPX(e.position);t.measure&&a(e),"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(n),i)},w.ScreenSpaceEventType.RIGHT_CLICK),e.polyline={width:t.width||5,material:t.material||w.Color.BLUE.withAlpha(.8),clampToGround:t.clampToGround||!1,clampToS3M:t.clampToS3M||!1},e.polyline.positions=new w.CallbackProperty(function(){return n},!1),i=this._drawLayer.entities.add(e);const a=function(e){var t=new w.Entity;t.position=e,t.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},t.label={text:(r.getPositionDistance(r.transformCartesianArrayToWGS84Array(n))/1e3).toFixed(4)+"公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-80)},r._drawLayer.entities.add(t)}}},drawPolygonGraphics:function(i){i=i||{};const t={width:3,material:w.Color.BLUE.withAlpha(.8),clampToGround:!0};if(i.style?i.style=Object.assign({},t,i.style):i.style=t,this._viewer&&i){var n=[],r=new w.PolygonHierarchy,o=new w.Entity,a=this,s=null,l=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);C=l;const t=function(){o.polyline=i.style,o.polyline.positions=new w.CallbackProperty(function(){return n},!1),o.polygon={hierarchy:new w.CallbackProperty(function(){return r},!1),material:w.Color.WHITE.withAlpha(.1),clampToGround:a._objHasOwnProperty(i,"clampToGround",!1)},o.clampToS3M=!0,s=a._drawLayer.entities.add(o)};l.setInputAction(function(e){e=a.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length&&(r.positions.push(e.clone()),n.push(e.clone())),n.push(e.clone()),r.positions.push(e.clone()),s||t())},w.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(e){e=a.getCatesian3FromPX(e.endPosition);a.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.length&&e&&e.x&&(n.pop(),n.push(e),r.positions.pop(),r.positions.push(e))},w.ScreenSpaceEventType.MOUSE_MOVE),l.setInputAction(function(){var e,t;l.destroy(),a.tooltip.setVisible(!1),n.push(n[0]),i.height&&(o.polygon.extrudedHeight=i.height,o.polygon.material=w.Color.BLUE.withAlpha(.5)),i.measure&&(e=n[0],(t=new w.Entity).position=e,t.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},t.label={text:(a.getPositionsArea(a.transformCartesianArrayToWGS84Array(n))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-50)},a._drawLayer.entities.add(t)),"function"==typeof i.callback&&i.callback(a.transformCartesianArrayToWGS84Array(n),s)},w.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(t){var i,n,e,r,o,a;(t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t&&(n=[],e=new w.Entity,r=new w.Rectangle,o=this,a=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas),(C=a).setInputAction(function(e){e=o.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length?n.push(e.clone()):(a.destroy(),n.push(e.clone()),r=w.Rectangle.fromCartesianArray([...n,e],w.Ellipsoid.WGS84),"function"==typeof t.callback&&t.callback(o.transformCartesianArrayToWGS84Array(n),i)))},w.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){e=o.getCatesian3FromPX(e.endPosition);e&&(r=w.Rectangle.fromCartesianArray([...n,e],w.Ellipsoid.WGS84))},w.ScreenSpaceEventType.MOUSE_MOVE),e.rectangle=t.style,t.height&&(e.rectangle.extrudedHeight=t.height),e.rectangle.coordinates=new w.CallbackProperty(function(){return r},!1),i=this._drawLayer.entities.add(e))},drawCircleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var i,n=void 0,r=new w.Entity,o=this,a=1,s=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);C=s;const l=function(e,t){var e=w.Cartographic.fromCartesian(e),t=w.Cartographic.fromCartesian(t),i=new w.EllipsoidGeodesic,i=(i.setEndPoints(e,t),i.surfaceDistance);a=Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2))};s.setInputAction(function(e){e=o.getCatesian3FromPX(e.position);o.tooltip.showAtCartesian(e,"左键单击结束!"),e&&e.x&&(n?(l(n,e),o.tooltip.setVisible(!1),s.destroy(),"function"==typeof t.callback&&t.callback({center:n,radius:a},i)):(n=e,r.ellipse=t.style,r.ellipse.semiMajorAxis=new w.CallbackProperty(function(){return a},!1),r.ellipse.semiMinorAxis=new w.CallbackProperty(function(){return a},!1),r.position=new w.CallbackProperty(function(){return n},!1),r.point={pixelSize:5,outlineColor:w.Color.RED,outlineWidth:3},t.height&&(r.ellipse.extrudedHeight=t.height),i=o._drawLayer.entities.add(r)))},w.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(e){e=o._viewer.scene.camera.pickEllipsoid(e.endPosition,o._viewer.scene.globe.ellipsoid);n&&e&&e.x&&l(n,e)},w.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5)},this._viewer&&t){var i=new w.Entity,n=new w.Entity,r=new w.Entity,o=[],a=[],s=[],l=this,c=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);C=c;c.setInputAction(function(e){e=l.getCatesian3FromPX(e.position);if(!e)return!1;0==o.length?(o.push(e.clone()),o.push(e.clone()),a.push(e.clone()),a.push(e.clone())):(c.destroy(),"function"==typeof t.callback&&t.callback({e:i,e2:n,e3:r}))},w.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){var t,i,e=l.getCatesian3FromPX(e.endPosition);e&&0<o.length&&(o.pop(),o.push(e.clone()),t=o,i=w.Cartographic.fromCartesian(t[0]),t=w.Cartographic.fromCartesian(t[1]),i=w.Cartesian3.fromDegrees(w.Math.toDegrees(i.longitude),w.Math.toDegrees(i.latitude),t.height),a.pop(),a.push(i.clone()),s.pop(),s.pop(),s.push(e.clone()),s.push(i.clone()))},w.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new w.CallbackProperty(function(){return o},!1),...t.style},i.position=new w.CallbackProperty(function(){return o[0]},!1),i.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:new w.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(o))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(50,-100)},n.polyline={positions:new w.CallbackProperty(function(){return a},!1),...t.style},n.position=new w.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},n.label={text:new w.CallbackProperty(function(){return"高度:"+(t=a[1],!(e=a[0])&&!t||w.Cartesian3.equals(e,t)?0:(e=w.Cartographic.fromCartesian(e),(w.Cartographic.fromCartesian(t).height-e.height).toFixed(2)))+"米";var e,t},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,100)},r.polyline={positions:new w.CallbackProperty(function(){return s},!1),...t.style},r.position=new w.CallbackProperty(function(){return o[1]},!1),r.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},r.label={text:new w.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-150,-20)},this._drawLayer.entities.add(r),this._drawLayer.entities.add(n),this._drawLayer.entities.add(i)}},drawWallGraphics:function(a){a=a||{};var s,e={material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE};a.style?a.style=Object.assign({},e,a.style):a.style=e,this._viewer&&a&&(s=this).drawPolygonGraphics({clampToGround:s._objHasOwnProperty(a.style,"clampToGround",!0),style:{material:a.style.material},callback:function(e,t){var i=s.transformWGS84ArrayToCartesianArray(e),n=[],r=[];if(a.style.maximumHeights){let e=0;for(;e<i.length;)n.push(a.style.maximumHeights[e%2]),e++;a.style.maximumHeights=n}if(a.style.minimumHeights){let e=0;for(;e<i.length;)r.push(a.style.minimumHeights[e%2]),e++;a.style.minimumHeights=r}var o=s._drawLayer.entities.add({wall:{positions:i,...a.style}});"function"==typeof a.callback&&a.callback(e,o)}})},drawEllipsoidGraphics:function(n){var r;(n=n||{}).style=n.style||{},this._viewer&&n&&(r=this).drawCircleGraphics({callback:function(e,t){var i=r.createGraphics(),t=(i.ellipsoid=r.$graphics.getEllipsoidGraphics({radii:e.radius}),i.position=e.center,r._drawLayer.entities.remove(t),r._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback({center:e.center,radius:e.radius},t)}})},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,drawCylinderGraphics:function(n){var r;(n=n||{}).style=n.style||{},this._viewer&&n&&(r=this).drawCircleGraphics({callback:function(e,t){var i=r._drawLayer.entities.add({position:e.center,cylinder:{length:2*e.radius||n.length,topRadius:n.topRadius||e.radius,bottomRadius:n.bottomRadius||e.radius,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE}});r._drawLayer.entities.remove(t),"function"==typeof n.callback&&n.callback({center:e.center,radius:e.radius},i)}})},drawCorridorGraphics:function(n){var r;(n=n||{}).style=n.style||{},this._viewer&&n&&(r=this).drawLineGraphics({callback:function(e,t){var i=r.createGraphics(),t=(i.corridor={positions:r.transformWGS84ArrayToCartesianArray(e),height:n.height||1,width:n.width||100,cornerType:w.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},r._drawLayer.entities.remove(t),r._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback(e,t)}})},drawPolylineVolumeGraphics:function(r){(r=r||{}).style=r.style||{};const o=r.circleRadius||20,a=r.arms||7,s=r.rOuter||150,l=r.rInner||75;var c;this._viewer&&r&&(c=this).drawLineGraphics({callback:function(e,t){var i=c.createGraphics(),n="fivePoint"===r.shape?c.computeStar2d(a,s,l):c.computeCircleShap(o),n=(i.polylineVolume={positions:c.transformWGS84ArrayToCartesianArray(e),shape:n,cornerType:w.CornerType.MITERED,material:r.color||w.Color.RED},c._drawLayer.entities.remove(t),c._drawLayer.entities.add(i));"function"==typeof r.callback&&r.callback(e,n)}})},removeAll(){this._drawLayer.entities.removeAll()},removeEventHandler(){C&&!C.isDestroyed()&&(C.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),C.removeInputAction(w.ScreenSpaceEventType.RIGHT_CLICK),C.removeInputAction(w.ScreenSpaceEventType.LEFT_CLICK))}};let P={};function x(e,t){e&&(this._viewer=e,P=t)}x.prototype={mathDistance2d:function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},getCirclePoints2d:function(e,t,i,n){for(var r=[],o=Math.PI/180*Math.round(360/n),a=0;a<n;a++){var s=t+e*Math.sin(o*a),l=i+e*Math.cos(o*a);r.unshift({x:s,y:l})}return r},wholeDistance2d:function(i){let n=0;return i&&Array.isArray(i)&&0<i.length&&i.forEach((e,t)=>{t<i.length-1&&(n+=this.mathDistance2d(e,i[t+1]))}),n},getBaseLength2d:function(e){return Math.pow(this.wholeDistance2d(e),.99)},computeStar2d(e,t,i){for(var n=Math.PI/e,r=2*e,o=new Array(r),a=0;a<r;a++){var s=a%2==0?t:i;o[a]=new P.Cartesian2(Math.cos(a*n)*s,Math.sin(a*n)*s)}return o},computeCircleShap(t){var i=[];for(let e=0;e<360;e++){var n=P.Math.toRadians(e);i.push(new P.Cartesian2(t*Math.cos(n),t*Math.sin(n)))}return i},mid2d:function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},getCircleCenterOfThreePoints2d:function(e,t,i){var n=[(e[0]+t[0])/2,(e[1]+t[1])/2],t=[n[0]-e[1]+t[1],n[1]+e[0]-t[0]],r=[(e[0]+i[0])/2,(e[1]+i[1])/2],e=[r[0]-e[1]+i[1],r[1]+e[0]-i[0]];return this.getIntersectPoint2d(n,t,r,e)},getIntersectPoint2d:function(e,t,i,n){return e[1]===t[1]?[(n[0]-i[0])/(n[1]-i[1])*(e[1]-i[1])+i[0],e[1]]:i[1]===n[1]?[(t[0]-e[0])/(t[1]-e[1])*(i[1]-e[1])+e[0],i[1]]:(t=(t[0]-e[0])/(t[1]-e[1]),n=(n[0]-i[0])/(n[1]-i[1]),[t*(i=(t*e[1]-e[0]-n*i[1]+i[0])/(t-n))-t*e[1]+e[0],i])},getAzimuth2d:function(e,t){let i,n=Math.asin(Math.abs(t[1]-e[1])/this.mathDistance2d(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=n+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=2*Math.PI-n:t[1]<e[1]&&t[0]<e[0]?i=n:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-n),i},getAngleOfThreePoints2d:function(e,t,i){e=this.getAzimuth2d(t,e)-this.getAzimuth2d(t,i);return e<0?e+2*Math.PI:e},isClockWise2d:function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},getPointOnLine2d:function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},getCubicValue2d:function(e,t,i,n,r){var[o,a]=[1-(e=Math.max(Math.min(e,1),0)),e*e],s=a*e,l=o*o,c=l*o;return[c*t[0]+3*l*e*i[0]+3*o*a*n[0]+s*r[0],c*t[1]+3*l*e*i[1]+3*o*a*n[1]+s*r[1]]},getThirdPoint2d:function(e,t,i,n,r){e=this.getAzimuth2d(e,t),r=r?e+i:e-i,e=n*Math.cos(r),i=n*Math.sin(r);return[t[0]+e,t[1]+i]},inherits2d:function(e,r){function t(){}t.prototype=r.prototype,e.superClass_=r.prototype,e.prototype=new t,(e.prototype.constructor=e).base=function(e,t,i){var n=Array.prototype.slice.call(arguments,2);return r.prototype[t].apply(e,n)}},getArcPoints2d:function(t,i,n,e){var[r,o,a,s]=[null,null,[],e-n],s=s<0?s+2*Math.PI:s;for(let e=0;e<=100;e++){var l=n+s*e/100,r=t[0]+i*Math.cos(l),o=t[1]+i*Math.sin(l);a.push([r,o])}return a},getBisectorNormals2d:function(e,t,i,n){let r=this.getNormal2d(t,i,n),[o,a,s,l,c]=[null,null,null,null,null],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),u=r[0]/h,d=r[1]/h,p=this.mathDistance2d(t,i),m=this.mathDistance2d(i,n);return a=(c=1e-4<h?this.isClockWise(t,i,n)?(s=e*p,l=i[0]-s*d,c=i[1]+s*u,o=[l,c],s=e*m,l=i[0]+s*d,i[1]-s*u):(s=e*p,l=i[0]+s*d,c=i[1]-s*u,o=[l,c],s=e*m,l=i[0]-s*d,i[1]+s*u):(l=i[0]+e*(t[0]-i[0]),c=i[1]+e*(t[1]-i[1]),o=[l,c],l=i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])),[l,c]),[o,a]},getNormal2d:function(e,t,i){var n=e[0]-t[0],e=e[1]-t[1],r=Math.sqrt(n*n+e*e),r=(n/=r,e/=r,i[0]-t[0]),i=i[1]-t[1],t=Math.sqrt(r*r+i*i);return[n+(r/=t),e+(i/=t)]},getLeftMostControlPoint2d:function(e,t){let[i,n,r,o,a]=[e[0],e[1],e[2],null,null],s=this.getBisectorNormals2d(0,i,n,r)[0],l=this.getNormal2d(i,n,r);var c,h,u,d,p;return a=1e-4<Math.sqrt(l[0]*l[0]+l[1]*l[1])?(e=this.mid2d(i,n),u=i[0]-e[0],c=i[1]-e[1],u=2*(c=-(h=2/this.mathDistance2d(i,n))*c)*(h=h*u),d=s[0]-e[0],p=s[1]-e[1],o=e[0]+(c*c-h*h)*d+u*p,e[1]+u*d+(h*h-c*c)*p):(o=i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])),[o,a]},getRightMostControlPoint2d:function(e,t){let i=e.length,n=e[i-3],r=e[i-2],o=e[i-1],a=this.getBisectorNormals2d(0,n,r,o)[1],s=this.getNormal2d(n,r,o),l=Math.sqrt(s[0]*s[0]+s[1]*s[1]),[c,h]=[null,null];var u,d,p,m,g;return h=1e-4<l?(e=this.mid2d(r,o),p=o[0]-e[0],u=o[1]-e[1],p=2*(u=-(d=2/this.mathDistance2d(r,o))*u)*(d=d*p),m=a[0]-e[0],g=a[1]-e[1],c=e[0]+(u*u-d*d)*m+p*g,e[1]+p*m+(d*d-u*u)*g):(c=o[0]+t*(r[0]-o[0]),o[1]+t*(r[1]-o[1])),[c,h]},getCurvePoints2d:function(t,i){let e=this.getLeftMostControlPoint2d(i,t),[n,r,o,a,s]=[null,null,null,[e],[]];for(let e=0;e<i.length-2;e++){[n,r,o]=[i[e],i[e+1],i[e+2]];var l=this.getBisectorNormals2d(t,n,r,o);a=a.concat(l)}var c=this.getRightMostControlPoint2d(i,t);c&&a.push(c);for(let t=0;t<i.length-1;t++){n=i[t],r=i[t+1],s.push(n);for(let e=0;e<100;e++){var h=this.getCubicValue2d(e/100,n,a[2*t],a[2*t+1],r);s.push(h)}s.push(r)}return s},getBezierPoints2d:function(r){if(r.length<=2)return r;var e=[],o=r.length-1;for(let n=0;n<=1;n+=.01){let[t,i]=[0,0];for(let e=0;e<=o;e++){var a=this.getBinomialFactor2d(o,e),s=Math.pow(n,e),l=Math.pow(1-n,o-e);t+=a*s*l*r[e][0],i+=a*s*l*r[e][1]}e.push([t,i])}return e.push(r[o]),e},getFactorial2d:function(t){let i=1;switch(t){case t<=1:i=1;break;case 2===t:i=2;break;case 3===t:i=6;break;case 24===t:i=24;break;case 5===t:i=120;break;default:for(let e=1;e<=t;e++)i*=e}return i},getBinomialFactor2d:function(e,t){return this.getFactorial2d(e)/(this.getFactorial2d(t)*this.getFactorial2d(e-t))},getQBSplinePoints2d:function(o){if(o.length<=2)return o;var[a,e]=[2,[]],t=o.length-a-1;e.push(o[0]);for(let r=0;r<=t;r++)for(let n=0;n<=1;n+=.05){let[t,i]=[0,0];for(let e=0;e<=a;e++){var s=this.getQuadricBSplineFactor2d(e,n);t+=s*o[r+e][0],i+=s*o[r+e][1]}e.push([t,i])}return e.push(o[o.length-1]),e},getQuadricBSplineFactor2d:function(e,t){let i=0;return 0===e?i=Math.pow(t-1,2)/2:1===e?i=(-2*Math.pow(t,2)+2*t+1)/2:2===e&&(i=Math.pow(t,2)/2),i}};let b=null;function S(e,t){e&&(this._viewer=e,s.prototype={...s.prototype,...p.prototype},this.$graphics=new s(e,t),b=t)}S.prototype={setCircleScanEffect:function(e){var t,i,n,r,o,a,s,l,c,h,u;if(e&&e.position)return t=e.id||"CircleScan"+parseInt(1e3*Math.random()),l=e.position,i=e.radius,n=e.color||b.Color.RED,r=e.duration||1500,o=this,a=e.circleMode||"CircleScan",e=e.border||4,u=l,s=new b.Cartesian4(u.x,u.y,u.z,1),u=this.transformCartesianToWGS84(l),l=this.transformWGS84ToCartesian({lng:u.lng,lat:u.lat,alt:u.alt+500}),c=new b.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),u=new b.PostProcessStage({name:t,fragmentShader:this._getCircleScanShader({get:!0,border:e}),uniforms:{u_scanCenterEC:function(){return b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,new b.Cartesian4)},u_scanPlaneNormalEC:function(){var e=b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,new b.Cartesian4),t=b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,c,new b.Cartesian4),i=new b.Cartesian3;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,b.Cartesian3.normalize(i,i),i},u_radius:function(){return"CircleScan"==a?i*(((new Date).getTime()-h)%r)/r:i},u_scanColor:n}}),this._viewer.scene.postProcessStages.add(u),u},setRadarScanEffect:function(e){var t,i,n,r,o,a,s,l,c,h,u,d,p,m,g,f,A,y,v;if(e&&e.position)return t=e.id||"radarScan"+parseInt(1e3*Math.random()),c=e.position,i=e.radius,n=e.color||b.Color.RED,r=e.duration||1500,o=this,a=e.border||1,e=e.width||3,v=c,s=new b.Cartesian4(v.x,v.y,v.z,1),v=this.transformCartesianToWGS84(c),c=this.transformWGS84ToCartesian({lng:v.lng,lat:v.lat,alt:v.alt+500}),l=new b.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:v.lng+.001,lat:v.lat,alt:v.alt}),h=new b.Cartesian4(c.x,c.y,c.z,1),u=(new Date).getTime(),d=new b.Quaternion,p=new b.Matrix3,m=new b.Cartesian4,g=new b.Cartesian4,f=new b.Cartesian4,A=new b.Cartesian3,y=new b.Cartesian3,v=new b.PostProcessStage({name:t,fragmentShader:this._getRadarScanShader({border:a,width:e,get:!0}),uniforms:{u_scanCenterEC:function(){return b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m)},u_scanPlaneNormalEC:function(){var e=b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m),t=b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,l,g);return A.x=t.x-e.x,A.y=t.y-e.y,A.z=t.z-e.z,b.Cartesian3.normalize(A,A),A},u_scanLineNormalEC:function(){var e=b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m),t=b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,l,g),i=b.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,f),t=(A.x=t.x-e.x,A.y=t.y-e.y,A.z=t.z-e.z,b.Cartesian3.normalize(A,A),y.x=i.x-e.x,y.y=i.y-e.y,y.z=i.z-e.z,((new Date).getTime()-u)%r/r);return b.Quaternion.fromAxisAngle(A,t*b.Math.PI*2,d),b.Matrix3.fromQuaternion(d,p),b.Matrix3.multiplyByVector(p,y,y),b.Cartesian3.normalize(y,y),y},u_radius:i,u_scanColor:n}}),this._viewer.scene.postProcessStages.add(v),v},satelliteScan:function(e){var t,i,n,r,o,a,s,l,c,h,u,d;if(e&&e.position)return t=b.Cartesian3,i=b.GeometryInstance,n=b.Primitive,r=b.MaterialAppearance,o=b.Material,a=b.Color,s=b.Matrix4,h=b.Transforms,r=b.MaterialAppearance,l=b.CylinderGeometry,u=e.position||[116.39,39.9],c=e.length||4e4,u=t.fromDegrees(u[0],u[1]),h=s.multiplyByTranslation(h.eastNorthUpToFixedFrame(u),new t(0,0,.5*c),new s),u=new i({geometry:new l({length:c,topRadius:0,bottomRadius:.5*c,vertexFormat:r.MaterialSupport.TEXTURED.vertexFormat}),modelMatrix:h}),d=this._viewer.scene.primitives.add(new n({geometryInstances:u,appearance:new r({material:new o({fabric:{uniforms:{color:e.color||new a(.2,1,0,1),repeat:e.repeat||30,offset:0,thickness:e.thickness||.2},source:"\n uniform vec4 color;\n uniform float repeat;\n uniform float offset;\n uniform float thickness;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m);\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n vec3 normalMC = material.normal;\n if(normalMC.y < 0.0 && normalMC.z < 0.0)\n { \n discard;\n }\n return material;\n }"},translucent:!0}),faceForward:!1,closed:!0,vertexShaderSource:"\n in vec3 position3DHigh;\n in vec3 position3DLow;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n void main()\n {\n vec4 p = czm_computePosition();\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = normal; // normal in world coordinates\n v_st = st;\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n }"})})),this._viewer.scene.preUpdate.addEventListener(function(){var e=d.appearance.material.uniforms.offset;1<(e-=.001)&&(e=0),d.appearance.material.uniforms.offset=e}),d},lighitCentrumScanEffect:function(t){var i=this.createLightScan_getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),n=this.createLightScan_entityCList(this._viewer,i,t);for(let e=0;e<n.length;e++)e!==n.length-1?this.createLightScan_changeOnePosition(t,n[e],[i[e].x,i[e].y,i[e+1].x,i[e+1].y]):this.createLightScan_changeOnePosition(t,n[e],[i[e].x,i[e].y,i[0].x,i[0].y]);return n},createLightScan_getCirclePoints:function(e,t,i,n){let r=[],o=Math.PI/180*Math.round(360/n),a=0;for(;a<n;a++){var s=t+e*Math.sin(o*a),l=i+e*Math.cos(o*a);r.unshift({x:s,y:l})}return r},createLightScan_changeOnePosition:function(t,e,i){const n=t.positionList;let r,o,a,s,l,c,h=0,u=0;function d(e){r=n[e+1][0]-n[e][0],o=n[e+1][1]-n[e][1],a=r/t.number,s=o/t.number,u=0}d(h),e.polygon.hierarchy=new b.CallbackProperty(function(){return Math.abs(l)>=Math.abs(r)&&Math.abs(c)>=Math.abs(o)&&((h+=1)===n.length-1&&(h=0),i[0]=i[0]+l,i[1]=i[1]+c,i[2]=i[2]+l,i[3]=i[3]+c,d(h)),l=u*a,c=u*s,u++,new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+l,i[1]+c,0,i[2]+l,i[3]+c,0]))},!1)},createLightScan_entityCList:function(t,i,n){var r=n.observer[0],o=n.observer[1],a=n.observer[2],s=[];for(let e=0;e<i.length;e++){var l=e===i.length-1?new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights([r,o,a,i[e].x,i[e].y,0,i[0].x,i[0].y,0])):new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights([r,o,a,i[e].x,i[e].y,0,i[e+1].x,i[e+1].y,0])),l=t.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:n.material}});s.push(l)}return s},createFireParticleSystem(e){var t,i,n,r,o,a,s,l,c,h,u,d;if(e&&e.position)return{fireImage:e,startScale:t,endScale:i,minimumParticleLife:n,maximumParticleLife:r,minimumSpeed:o,maximumSpeed:a,particleSize:s,emissionRate:l,position:c,startColor:h,endColor:u,emitter:d}=Object.assign({},{fireImage:"static/data/images/file/fire.png",startScale:3,endScale:1.5,minimumParticleLife:1.5,maximumParticleLife:1.8,minimumSpeed:7,maximumSpeed:9,particleSize:2,emissionRate:200,startColor:new b.Color(1,1,1,1),endColor:new b.Color(.5,0,0,0),emitter:new b.ConeEmitter(b.Math.toRadians(45))},e),new b.ParticleSystem({image:e,startScale:t,endScale:i,minimumParticleLife:n,maximumParticleLife:r,minimumSpeed:o,maximumSpeed:a,emissionRate:l,startColor:h,endColor:u,emitter:d,imageSize:new b.Cartesian2(s,s),lifetime:16,loop:!0,sizeInMeters:!0,modelMatrix:b.Transforms.eastNorthUpToFixedFrame(c)})}};const M="uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nuniform vec4 u_lineColor;\n\nbool inSensorShadow(vec3 coneVertexWC, vec3 inverseRadii, vec3 pointWC) {\n // Diagonal matrix from the unscaled ellipsoid space to the scaled space.\n vec3 D = inverseRadii;\n\n // Sensor vertex in the scaled ellipsoid space\n vec3 q = D * coneVertexWC;\n float qMagnitudeSquared = dot(q, q);\n float test = qMagnitudeSquared - 1.0;\n\n // Sensor vertex to fragment vector in the ellipsoid's scaled space\n vec3 temp = D * pointWC - q;\n float d = dot(temp, q);\n\n // Behind silhouette plane and inside silhouette cone\n return (d < -test) && (d / length(temp) < -sqrt(test));\n}\n\n///////////////////////////////////////////////////////////////////////////////\n\nvec4 getLineColor() { return u_lineColor; }\n\nvec4 getIntersectionColor() { return u_intersectionColor; }\n\nfloat getIntersectionWidth() { return u_intersectionWidth; }\n\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) {\n // (s, t) both in the range [0, 1]\n float t = pointMC.z / sensorRadius;\n float s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\n s = s - floor(s);\n\n return vec2(s, t);\n}",E='#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n uniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\n\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\n\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\n\nvec4 getColor(float sensorRadius, vec3 pointEC) {\n czm_materialInput materialInput;\n\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n\n czm_material material = czm_getMaterial(materialInput);\n\n return mix(\n czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),\n vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon) {\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the\n // tolerance. We also want to check if the value of an adjacent pixel is\n // within the tolerance, but we don\'t want to admit points that are obviously\n // not on the surface. For example, if we are looking for "value" to be close\n // to 0, but value is 1 and the adjacent value is 2, then the delta would be 1\n // and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels ||\n (delta < 10.0 * tolerance && temp - delta < tolerance &&\n temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\n\nvec4 shade(bool isOnBoundary) {\n if (u_showIntersection && isOnBoundary) {\n return getIntersectionColor();\n }\n if (u_type == 1.0) {\n return getLineColor();\n }\n return getColor(u_radius, v_positionEC);\n}\n\nfloat ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {\n vec3 scaled = inverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main() {\n vec3 sensorVertexWC =\n czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC =\n czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n\n // vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0, positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if (resX < cos(u_xHalfAngle) - 0.00001) {\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if (resY < cos(u_yHalfAngle) - 0.00001) {\n discard;\n }\n\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue =\n ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);\n\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid) {\n // Discard if in the ellipsoid\n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done\n // on the CPU first.\n if (ellipsoidValue < 0.0) {\n discard;\n }\n\n // Discard if in the sensor\'s shadow\n if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,\n v_positionWC)) {\n discard;\n }\n }\n\n // Notes: Each surface functions should have an associated tolerance based on\n // the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n // isOnEllipsoid = false;\n // if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81)){\n /*if(false){\n out_FragColor = vec4(1.0,0.0,0.0,1.0);\n }else{\n out_FragColor = shade(isOnEllipsoid);\n }\n*/\nout_FragColor = shade(isOnEllipsoid);\n}';let I={};function T(t){var _=(I=t).BoundingSphere,P=I.Cartesian3,i=I.Color,d=I.combine,b=I.ComponentDatatype,n=I.defaultValue,r=I.defined,x=(I.destroyObject,I.DeveloperError),S=I.Matrix4,o=I.PrimitiveType,T=I.Buffer,L=I.BufferUsage,a=I.DrawCommand,D=I.Pass,G=I.RenderState,k=I.ShaderProgram,B=I.ShaderSource,z=I.VertexArray,R=I.BlendingState,F=I.CullFace,s=I.Material,Z=I.SceneMode,O=I.VertexFormat,V=I.Math,U=I.Matrix3,H=(S=I.Matrix4,I.JulianDate),u=(I.BoxGeometry,I.EllipsoidGeometry,Math.sin),W=Math.cos,N=Math.tan,Y=Math.atan,j={position:0,normal:1};function e(e){var t=this;e=n(e,n.EMPTY_OBJECT),this.show=n(e.show,!0),this.slice=n(e.slice,32),this.modelMatrix=S.clone(e.modelMatrix,new S),this._modelMatrix=new S,this._computedModelMatrix=new S,this._computedScanPlaneModelMatrix=new S,this.radius=n(e.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=n(e.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=n(e.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=n(e.lineColor,i.WHITE),this.showSectorLines=n(e.showSectorLines,!0),this.showSectorSegmentLines=n(e.showSectorSegmentLines,!0),this.showLateralSurfaces=n(e.showLateralSurfaces,!0),this.material=r(e.material)?e.material:s.fromType(s.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=r(e.lateralSurfaceMaterial)?e.lateralSurfaceMaterial:s.fromType(s.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=n(e.showDomeSurfaces,!0),this.domeSurfaceMaterial=r(e.domeSurfaceMaterial)?e.domeSurfaceMaterial:s.fromType(s.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=n(e.showDomeLines,!0),this.showIntersection=n(e.showIntersection,!0),this.intersectionColor=n(e.intersectionColor,i.WHITE),this.intersectionWidth=n(e.intersectionWidth,5),this.showThroughEllipsoid=n(e.showThroughEllipsoid,!1),this._showThroughEllipsoid=void 0,this.showScanPlane=n(e.showScanPlane,!0),this.scanPlaneColor=n(e.scanPlaneColor,i.WHITE),this.scanPlaneMode=n(e.scanPlaneMode,"horizontal"),this.scanPlaneRate=n(e.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=H.now(),this._boundingSphere=new _,this._boundingSphereWC=new _,this._sectorFrontCommand=new a({owner:this,primitiveType:o.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new a({owner:this,primitiveType:o.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new a({owner:this,primitiveType:o.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new a({owner:this,primitiveType:o.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new a({owner:this,primitiveType:o.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new a({owner:this,primitiveType:o.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new a({owner:this,primitiveType:o.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new a({owner:this,primitiveType:o.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new a({owner:this,primitiveType:o.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 t.xHalfAngle},u_yHalfAngle:function(){return t.yHalfAngle},u_radius:function(){return t.radius},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return t._scanePlaneXHalfAngle},u_yHalfAngle:function(){return t._scanePlaneYHalfAngle},u_radius:function(){return t.radius},u_color:function(){return t.scanPlaneColor},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}}}e.prototype.update=function(e){var t,i,n,r,o=e.mode;if(this.show&&o===Z.SCENE3D){var o=!1,a=!1,s=!1,l=this.xHalfAngle,c=this.yHalfAngle;if(l<0||c<0)throw new x("halfAngle must be greater than or equal to zero.");if(0!=l&&0!=c){this._xHalfAngle===l&&this._yHalfAngle===c||(this._xHalfAngle=l,this._yHalfAngle=c,o=!0);var h=this.radius;if(h<0)throw new x("this.radius must be greater than or equal to zero.");var u,d,p,m,g=!1,h=(this._radius!==h&&(g=!0,this._radius=h,this._boundingSphere=new _(P.ZERO,this.radius)),S.equals(this.modelMatrix,this._modelMatrix)&&!g||(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),_.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC)),this.showThroughEllipsoid),g=(this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=h,a=!0),this.material),f=(this._material!==g&&(this._material=g,s=a=!0),g.isTranslucent()),A=(this._translucent!==f&&(this._translucent=f,a=!0),this.showScanPlane&&(m=e.time,(p=H.secondsDifference(m,this._time))<0&&(this._time=H.clone(m,this._time)),m=Math.max(p%this.scanPlaneRate/this.scanPlaneRate,0),"horizontal"==this.scanPlaneMode?(p=W(u=2*c*m-c),d=N(l),p=Y(p*d),this._scanePlaneXHalfAngle=p,this._scanePlaneYHalfAngle=u,I.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,X)):(u=2*l*m-l,d=N(c),p=W(u),m=Y(p*d),this._scanePlaneXHalfAngle=u,this._scanePlaneYHalfAngle=m,I.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,X)),I.Matrix4.multiplyByMatrix3(this.modelMatrix,X,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix)),o&&(l=this,c=e.context,d=Q(p=l,l.xHalfAngle,l.yHalfAngle),u=p.xHalfAngle,p=p.yHalfAngle,m=d.zoy,d=d.zox,o=[],n=U.fromRotationY(u,X),o.push(m.map(function(e){return U.multiplyByVector(n,e,new I.Cartesian3)})),n=U.fromRotationX(-p,X),o.push(d.map(function(e){return U.multiplyByVector(n,e,new I.Cartesian3)}).reverse()),n=U.fromRotationY(-u,X),o.push(m.map(function(e){return U.multiplyByVector(n,e,new I.Cartesian3)}).reverse()),n=U.fromRotationX(p,X),o.push(d.map(function(e){return U.multiplyByVector(n,e,new I.Cartesian3)})),u=o,l.showLateralSurfaces&&(l._sectorVA=function(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,n=new Float32Array(18*i),r=0,o=0,a=t.length;o<a;o++)for(var s=t[o],l=P.normalize(P.cross(s[0],s[s.length-1],q),q),c=0,i=s.length-1;c<i;c++)n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=-l.x,n[r++]=-l.y,n[r++]=-l.z,n[r++]=s[c].x,n[r++]=s[c].y,n[r++]=s[c].z,n[r++]=-l.x,n[r++]=-l.y,n[r++]=-l.z,n[r++]=s[c+1].x,n[r++]=s[c+1].y,n[r++]=s[c+1].z,n[r++]=-l.x,n[r++]=-l.y,n[r++]=-l.z;var h=T.createVertexBuffer({context:e,typedArray:n,usage:L.STATIC_DRAW}),u=6*Float32Array.BYTES_PER_ELEMENT,h=[{index:j.position,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:u},{index:j.normal,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:u}];return new z({context:e,attributes:h})}(c,u)),l.showSectorLines&&(l._sectorLineVA=function(e,t){for(var i=new Float32Array(9*t.length),n=0,r=0,o=t.length;r<o;r++){var a=t[r];i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=a[0].x,i[n++]=a[0].y,i[n++]=a[0].z}var s=T.createVertexBuffer({context:e,typedArray:i,usage:L.STATIC_DRAW}),l=3*Float32Array.BYTES_PER_ELEMENT,s=[{index:j.position,vertexBuffer:s,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:l}];return new z({context:e,attributes:s})}(c,u)),l.showSectorSegmentLines&&(l._sectorSegmentLineVA=function(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,n=new Float32Array(9*i),r=0,o=0,a=t.length;o<a;o++)for(var s=t[o],l=0,i=s.length-1;l<i;l++)n[r++]=s[l].x,n[r++]=s[l].y,n[r++]=s[l].z,n[r++]=s[l+1].x,n[r++]=s[l+1].y,n[r++]=s[l+1].z;var c=T.createVertexBuffer({context:e,typedArray:n,usage:L.STATIC_DRAW}),h=3*Float32Array.BYTES_PER_ELEMENT,c=[{index:j.position,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:h}];return new z({context:e,attributes:c})}(c,u)),l.showDomeSurfaces&&(l._domeVA=(m=c,p=I.EllipsoidGeometry.createGeometry(new I.EllipsoidGeometry({vertexFormat:O.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),z.fromGeometry({context:m,geometry:p,attributeLocations:j,bufferUsage:L.STATIC_DRAW,interleave:!1}))),l.showDomeLines&&(l._domeLineVA=(d=c,o=I.EllipsoidOutlineGeometry.createGeometry(new I.EllipsoidOutlineGeometry({vertexFormat:O.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),z.fromGeometry({context:d,geometry:o,attributeLocations:j,bufferUsage:L.STATIC_DRAW,interleave:!1}))),l.showScanPlane)&&("horizontal"==l.scanPlaneMode?(r=Q(l,V.PI_OVER_TWO,0),l._scanPlaneVA=K(c,r.zox)):(r=Q(l,0,V.PI_OVER_TWO),l._scanPlaneVA=K(c,r.zoy))),a&&(o=this,l=h,f?(o._frontFaceRS=G.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:R.ALPHA_BLEND,cull:{enabled:!0,face:F.BACK}}),o._backFaceRS=G.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:R.ALPHA_BLEND,cull:{enabled:!0,face:F.FRONT}}),o._pickRS=G.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:R.ALPHA_BLEND})):(o._frontFaceRS=G.fromCache({depthTest:{enabled:!l},depthMask:!0}),o._pickRS=G.fromCache({depthTest:{enabled:!0},depthMask:!0}))),s&&(r=c=this,l=h=g,g=(o=e).context,t="in vec4 position;\nin vec3 normal;\n\nout vec3 v_position;\nout vec3 v_positionWC;\nout vec3 v_positionEC;\nout vec3 v_normalEC;\n\nvoid main() {\n gl_Position = czm_modelViewProjection * position;\n v_position = vec3(position);\n v_positionWC = (czm_model * position).xyz;\n v_positionEC = (czm_modelView * position).xyz;\n v_normalEC = czm_normal * normal;\n}",i=new B({sources:[M,l.shaderSource,E]}),r._sp=k.replaceCache({context:g,shaderProgram:r._sp,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:j}),i=new B({sources:[M,l.shaderSource,E],pickColorQualifier:"uniform"}),r._pickSP=k.replaceCache({context:g,shaderProgram:r._pickSP,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:j}),c.showScanPlane)&&(l=c,g=h,r=o.context,g=new B({sources:[M,g.shaderSource,'#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n uniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\n\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\n\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\n\nvec4 getColor(float sensorRadius, vec3 pointEC) {\n czm_materialInput materialInput;\n\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n\n czm_material material = czm_getMaterial(materialInput);\n\n material.diffuse = u_color.rgb;\n material.alpha = u_color.a;\n\n return mix(\n czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),\n vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon) {\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the\n // tolerance. We also want to check if the value of an adjacent pixel is\n // within the tolerance, but we don\'t want to admit points that are obviously\n // not on the surface. For example, if we are looking for "value" to be close\n // to 0, but value is 1 and the adjacent value is 2, then the delta would be 1\n // and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels ||\n (delta < 10.0 * tolerance && temp - delta < tolerance &&\n temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\n\nvec4 shade(bool isOnBoundary) {\n if (u_showIntersection && isOnBoundary) {\n return getIntersectionColor();\n }\n return getColor(u_radius, v_positionEC);\n}\n\nfloat ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {\n vec3 scaled = inverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main() {\n vec3 sensorVertexWC =\n czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC =\n czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n\n // vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0, positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if (resX < cos(u_xHalfAngle) - 0.0001) {\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if (resY < cos(u_yHalfAngle) - 0.0001) {\n discard;\n }\n\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue =\n ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);\n\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid) {\n // Discard if in the ellipsoid\n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done\n // on the CPU first.\n if (ellipsoidValue < 0.0) {\n discard;\n }\n\n // Discard if in the sensor\'s shadow\n if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,\n v_positionWC)) {\n discard;\n }\n }\n\n // Notes: Each surface functions should have an associated tolerance based on\n // the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n out_FragColor = shade(isOnEllipsoid);\n}']}),l._scanePlaneSP=k.replaceCache({context:r,shaderProgram:l._scanePlaneSP,vertexShaderSource:"in vec4 position;\nin vec3 normal;\n\nout vec3 v_position;\nout vec3 v_positionWC;\nout vec3 v_positionEC;\nout vec3 v_normalEC;\n\nvoid main() {\n gl_Position = czm_modelViewProjection * position;\n v_position = vec3(position);\n v_positionWC = (czm_model * position).xyz;\n v_positionEC = (czm_modelView * position).xyz;\n v_normalEC = czm_normal * normal;\n}",fragmentShaderSource:g,attributeLocations:j})),(a||s)&&(t=f,(i=this)._colorCommands.length=0,c=t?D.TRANSLUCENT:D.OPAQUE,i.showLateralSurfaces&&J(i,i._sectorFrontCommand,i._sectorBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorVA,i._uniforms,i._computedModelMatrix,t,c),i.showSectorLines&&J(i,i._sectorLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showSectorSegmentLines&&J(i,i._sectorSegmentLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorSegmentLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showDomeSurfaces&&J(i,i._domeFrontCommand,i._domeBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._domeVA,i._uniforms,i._computedModelMatrix,t,c),i.showDomeLines&&J(i,i._domeLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._domeLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showScanPlane)&&J(i,i._scanPlaneFrontCommand,i._scanPlaneBackCommand,i._frontFaceRS,i._backFaceRS,i._scanePlaneSP,i._scanPlaneVA,i._scanUniforms,i._computedScanPlaneModelMatrix,t,c),e.commandList),h=e.passes,y=this._colorCommands;if(h.render)for(var v=0,w=y.length;v<w;v++){var C=y[v];A.push(C)}}}},e.prototype.isDestroyed=function(){return!1};var X=new U,q=new P;function Q(e,t,i){for(var n=e.slice,e=W(i),i=N(i),r=W(t),t=N(t),o=Y(r*i),a=Y(e*t),s=[],l=0;l<n;l++){var c=2*o*l/(n-1)-o;s.push(new P(0,u(c),W(c)))}for(var h=[],l=0;l<n;l++)h.push(new P(u(c=2*a*l/(n-1)-a),0,W(c)));return{zoy:s,zox:h}}function K(e,t){for(var i=t.length-1,n=new Float32Array(9*i),r=0,o=0;o<i;o++)n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=t[o].x,n[r++]=t[o].y,n[r++]=t[o].z,n[r++]=t[o+1].x,n[r++]=t[o+1].y,n[r++]=t[o+1].z;var a=T.createVertexBuffer({context:e,typedArray:n,usage:L.STATIC_DRAW}),s=3*Float32Array.BYTES_PER_ELEMENT,a=[{index:j.position,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:b.FLOAT,offsetInBytes:0,strideInBytes:s}];return new z({context:e,attributes:a})}function J(e,t,i,n,r,o,a,s,l,c,h,u){c&&i&&(i.vertexArray=a,i.renderState=r,i.shaderProgram=o,i.uniformMap=d(s,e._material._uniforms),i.uniformMap.u_normalDirection=function(){return-1},i.pass=h,i.modelMatrix=l,e._colorCommands.push(i)),t.vertexArray=a,t.renderState=n,t.shaderProgram=o,t.uniformMap=d(s,e._material._uniforms),u&&(t.uniformMap.u_type=function(){return 1}),t.pass=h,t.modelMatrix=l,e._colorCommands.push(t)}return e}let L={};function D(e){var t=(L=e).defaultValue,i=L.defined,e=Object.defineProperties,n=L.DeveloperError,r=L.Event,o=L.createMaterialPropertyDescriptor,a=L.createPropertyDescriptor;function s(e){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 r,this.merge(t(e,t.EMPTY_OBJECT))}return e(s.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:o("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")}),s.prototype.clone=function(e){return(e=i(e)?e:new s).show=this.show,e.radius=this.radius,e.xHalfAngle=this.xHalfAngle,e.yHalfAngle=this.yHalfAngle,e.lineColor=this.lineColor,e.showSectorLines=this.showSectorLines,e.showSectorSegmentLines=this.showSectorSegmentLines,e.showLateralSurfaces=this.showLateralSurfaces,e.material=this.material,e.showDomeSurfaces=this.showDomeSurfaces,e.showDomeLines=this.showDomeLines,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.showThroughEllipsoid=this.showThroughEllipsoid,e.gaze=this.gaze,e.showScanPlane=this.showScanPlane,e.scanPlaneColor=this.scanPlaneColor,e.scanPlaneMode=this.scanPlaneMode,e.scanPlaneRate=this.scanPlaneRate,e},s.prototype.merge=function(e){if(!i(e))throw new n("source is required.");this.show=t(this.show,e.show),this.radius=t(this.radius,e.radius),this.xHalfAngle=t(this.xHalfAngle,e.xHalfAngle),this.yHalfAngle=t(this.yHalfAngle,e.yHalfAngle),this.lineColor=t(this.lineColor,e.lineColor),this.showSectorLines=t(this.showSectorLines,e.showSectorLines),this.showSectorSegmentLines=t(this.showSectorSegmentLines,e.showSectorSegmentLines),this.showLateralSurfaces=t(this.showLateralSurfaces,e.showLateralSurfaces),this.material=t(this.material,e.material),this.showDomeSurfaces=t(this.showDomeSurfaces,e.showDomeSurfaces),this.showDomeLines=t(this.showDomeLines,e.showDomeLines),this.showIntersection=t(this.showIntersection,e.showIntersection),this.intersectionColor=t(this.intersectionColor,e.intersectionColor),this.intersectionWidth=t(this.intersectionWidth,e.intersectionWidth),this.showThroughEllipsoid=t(this.showThroughEllipsoid,e.showThroughEllipsoid),this.gaze=t(this.gaze,e.gaze),this.showScanPlane=t(this.showScanPlane,e.showScanPlane),this.scanPlaneColor=t(this.scanPlaneColor,e.scanPlaneColor),this.scanPlaneMode=t(this.scanPlaneMode,e.scanPlaneMode),this.scanPlaneRate=t(this.scanPlaneRate,e.scanPlaneRate)},s}let k={};function B(e,y){function c(e,t,i){var n=t[e.id];C(n)&&(n=n.primitive,i.remove(n),n&&!n.isDestroyed()&&n.destroy(),delete t[e.id])}var i,v,w,C,r,_,P,b,x,S,M,I,E,T,L,D,G,n;if(e)return i=(k=e).AssociativeArray,v=k.Cartesian3,w=k.Color,C=k.defined,r=k.destroyObject,_=k.DeveloperError,P=k.Matrix3,b=k.Matrix4,x=k.Quaternion,S=k.MaterialProperty,M=k.Property,I=new P,new b,E=new v,T=new v,L=new x,D=new v,G=new x,(n=function(e,t){if(!C(e))throw new _("scene is required.");if(!C(t))throw new _("entityCollection is required.");t.collectionChanged.addEventListener(n.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._hash={},this._entitiesToVisualize=new i,this._onCollectionChanged(t,t.values,[],[])}).prototype.update=function(e){if(!C(e))throw new _("time is required.");for(var t=this._entitiesToVisualize.values,i=this._hash,n=this._primitives,r=0,o=t.length;r<o;r++){var a,s,l,c=t[r],h=c._rectangularSensor,u=i[c.id],d=c.isShowing&&c.isAvailable(e)&&M.getValueOrDefault(h._show,e,!0);if(d&&(a=M.getValueOrUndefined(c._position,e,E),f=M.getValueOrUndefined(c._orientation,e,L),A=M.getValueOrUndefined(h._radius,e),s=M.getValueOrUndefined(h._xHalfAngle,e),l=M.getValueOrUndefined(h._yHalfAngle,e),d=C(a)&&C(s)&&C(l)),d){d=C(u)?u.primitive:void 0,c=(C(d)||((d=new y).id=c,n.add(d),i[c.id]=u={primitive:d,position:void 0,orientation:void 0}),M.getValueOrUndefined(h._gaze,e));if(C(c)){var p=M.getValueOrUndefined(c._position,e,T);if(!C(a)||!C(p))continue;var m=v.subtract(a,p,D),g=v.angleBetween(k.Cartesian3.UNIT_Z,m),m=v.cross(k.Cartesian3.UNIT_Z,m,D),f=x.fromAxisAngle(m,g-Math.PI,G),A=v.distance(a,p);d.modelMatrix=b.fromRotationTranslation(P.fromQuaternion(f,I),a,d.modelMatrix)}else v.equals(a,u.position)&&x.equals(f,u.orientation)||(C(f)?(d.modelMatrix=b.fromRotationTranslation(P.fromQuaternion(f,I),a,d.modelMatrix),u.position=v.clone(a,u.position),u.orientation=x.clone(f,u.orientation)):(d.modelMatrix=k.Transforms.eastNorthUpToFixedFrame(a),u.position=v.clone(a,u.position)));d.show=!0,d.gaze=c,d.radius=A,d.xHalfAngle=s,d.yHalfAngle=l,d.lineColor=M.getValueOrDefault(h._lineColor,e,w.WHITE),d.showSectorLines=M.getValueOrDefault(h._showSectorLines,e,!0),d.showSectorSegmentLines=M.getValueOrDefault(h._showSectorSegmentLines,e,!0),d.showLateralSurfaces=M.getValueOrDefault(h._showLateralSurfaces,e,!0),d.material=S.getValue(e,h._material,d.material),d.showDomeSurfaces=M.getValueOrDefault(h._showDomeSurfaces,e,!0),d.showDomeLines=M.getValueOrDefault(h._showDomeLines,e,!0),d.showIntersection=M.getValueOrDefault(h._showIntersection,e,!0),d.intersectionColor=M.getValueOrDefault(h._intersectionColor,e,w.WHITE),d.intersectionWidth=M.getValueOrDefault(h._intersectionWidth,e,1),d.showThroughEllipsoid=M.getValueOrDefault(h._showThroughEllipsoid,e,!0),d.scanPlaneMode=M.getValueOrDefault(h._scanPlaneMode,e),d.scanPlaneColor=M.getValueOrDefault(h._scanPlaneColor,e,w.WHITE),d.showScanPlane=M.getValueOrDefault(h._showScanPlane,e,!0),d.scanPlaneRate=M.getValueOrDefault(h._scanPlaneRate,e,1)}else C(u)&&(u.primitive.show=!1)}return!0},n.prototype.isDestroyed=function(){return!1},n.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,t=this._hash,i=this._primitives,n=e.length-1;-1<n;n--)c(e[n],t,i);return r(this)},n.prototype._onCollectionChanged=function(e,t,i,n){for(var r,o=this._entitiesToVisualize,a=this._hash,s=this._primitives,l=t.length-1;-1<l;l--)r=t[l],C(r._rectangularSensor)&&C(r._position)&&o.set(r.id,r);for(l=n.length-1;-1<l;l--)r=n[l],C(r._rectangularSensor)&&C(r._position)?o.set(r.id,r):(c(r,a,s),o.remove(r.id));for(l=i.length-1;-1<l;l--)c(r=i[l],a,s),o.remove(r.id)},n}let G=null;function z(e,t){e&&(this.viewer=e,G=t,this._installPlugin())}z.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive()},_installCylinderGeometry:function(){function b(e){this.length=e.length,this.topRadius=e.topRadius,this.bottomRadius=e.bottomRadius,this.slices=e.slices||64,this.zReverse=e.zReverse}var S=new G.Cartesian2,x=new G.Cartesian3,M=new G.Ray;b._createGeometry=function(e){var t=e.length,i=e.topRadius,n=e.bottomRadius,r=e.slices,o=2*Math.PI/(r-1),a=[],s=[],l=[],c=[],h=[n,i],u=[0,e.zReverse?-t:t],d=0,e=Math.atan2(n-i,t),p=S;p.z=Math.sin(e);for(var m=Math.cos(e),g=0;g<u.length;g++){c[g]=[];for(var f=h[g],A=0;A<r;A++){c[g].push(d++);var y=o*A,v=f*Math.cos(y),w=f*Math.sin(y);a.push(v,w,u[g]),v=m*Math.cos(y),w=m*Math.sin(y),s.push(v,w,p.z),l.push(g/(u.length-1),0)}}for(var C=[],g=1;g<u.length;g++)for(A=1;A<r;A++){var _=c[g-1][A-1],P=c[g][A-1],b=c[g][A],x=c[g-1][A];C.push(b),C.push(x),C.push(_),C.push(b),C.push(_),C.push(P),A==c[g].length-1&&(_=c[g-1][A],P=c[g][A],b=c[g][0],x=c[g-1][0],C.push(b),C.push(x),C.push(_),C.push(b),C.push(_),C.push(P))}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=G.BoundingSphere.fromVertices(a),t=new G.Geometry({attributes:n,indices:C,primitiveType:G.PrimitiveType.TRIANGLES,boundingSphere:i});return a=[],C=[],l=[],t},b.createGeometry=function(e,t){if(!t)return b._createGeometry(e);G.Matrix4.multiplyByPoint(t,G.Cartesian3.ZERO,x),x.clone(M.origin);var i=e.length,n=e.topRadius,r=(e.bottomRadius,e.slices),o=2*Math.PI/(r-1),a=[],s=[],l=[],c=[],h=[0,e.zReverse?-i:i],u=0,u=0;a.push(0,0,0),s.push(1,1),u++;for(var d=new G.Cartesian3,p=n/15,m=0;m<16;m++){for(var g=p*m,f=[],A=0;A<r;A++){var y=o*A,v=g*Math.cos(y),y=g*Math.sin(y);d.x=v,d.y=y,d.z=h[1],(0,G.Scene.extend2Earth)(d,t,M)?(f.push(u),a.push(v,y,h[1]),s.push(m/15,1),u++):f.push(-1)}c.push(f)}for(var w,C,_=[0,c.length-1],P=0;P<_.length;P++)for(m=_[P],A=1;A<c[m].length;A++)w=c[m][A-1],C=c[m][A],0<=w&&0<=C&&l.push(0,w,C);a=new Float32Array(a),l=new Int32Array(l),s=new Float32Array(s),e={position:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),st:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=G.BoundingSphere.fromVertices(a),n=new G.Geometry({attributes:e,indices:l,primitiveType:G.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,G.Scene.computeVertexNormals)(n),a=[],l=[],n},b.createOutlineGeometry=function(e){var t=e.length,i=e.topRadius,n=e.bottomRadius,r=e.slices,o=2*Math.PI/(r-1),a=[],s=[],l=[],c=[],h=[n,i],u=[0,e.zReverse?-t:t],d=0,e=Math.atan2(n-i,t),p=S;p.z=Math.sin(e);for(var m=Math.cos(e),g=0;g<u.length;g++){c[g]=[];for(var f=h[g],A=0;A<r;A++){c[g].push(d++);var y=o*A,v=f*Math.cos(y),w=f*Math.sin(y);a.push(v,w,u[g]),v=m*Math.cos(y),w=m*Math.sin(y),s.push(v,w,p.z),l.push(g/(u.length-1),0)}}for(var C=[],g=1;g<u.length;g++)for(A=1;A<r;A+=1){var _=c[g-1][A-1],P=c[g][A-1];c[g][A],c[g-1][A],A%8==1&&C.push(_,P)}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=G.BoundingSphere.fromVertices(a),t=new G.Geometry({attributes:n,indices:C,primitiveType:G.PrimitiveType.LINES,boundingSphere:i});return a=[],C=[],l=[],t},b.fromAngleAndLength=function(e,t,i){return e=G.Math.toRadians(e),new b({topRadius:Math.tan(e)*t/2,bottomRadius:0,length:t,zReverse:i})},G.Scene.CylinderGeometry=b},_installRadarPrimitive:function(){var i;function e(e,t){t=t||{},i=e.scene.globe.ellipsoid,this._geometry=null,this._angle=t.angle,this._radius=t.radius||5,this._position=t.position,this._rotation=t.rotation||{heading:0,pitch:0,roll:0},this._trackedEntity=t.trackedEntity,this.defaultColor=t.color||G.Color.YELLOW,this.defaultLineColor=t.lineColor||this.defaultColor,this._show=G.defaultValue(t.show,!0),this._outline=G.defaultValue(t.outline,!1),this._topShow=G.defaultValue(t.top,!0),this._topOutline=G.defaultValue(t.topOutline,!0),this._modelMatrix=G.Matrix4.clone(G.Matrix4.IDENTITY),this._quaternion=new G.Quaternion,this._translation=new G.Cartesian3,this._scale=new G.Cartesian3(1,1,1),this._matrix=new G.Matrix4,this._inverseMatrix=new G.Matrix4,this._positionCartographic=new G.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=e,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=G.defaultValue(t.groundArea,!1),this.addGroundAreaEntity(this._groundArea)}Object.defineProperties(e.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(e){this._trackedEntity=e}},color:{get:function(){return this.defaultColor},set:function(e){this.defaultColor=e}},lineColor:{get:function(){return this.defaultLineColor},set:function(e){this.defaultLineColor=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},outline:{get:function(){return this._outline},set:function(e){this._outline=e,this.updateGeometry()}},top:{get:function(){return this._topShow},set:function(e){this._topShow=e,this.updateGeometry()}},topOutline:{get:function(){return this._topOutline},set:function(e){this._topOutline=e,this.updateGeometry()}},groundArea:{get:function(){return this._groundArea},set:function(e){this._groundArea=e,this.addGroundAreaEntity(this._groundArea)}},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this.updateGroundCircleRadius(),this.updateGeometry()}},radius:{get:function(){return this._radius},set:function(e){this._radius=e,this.updateGroundCircleRadius(),this.updateGeometry()}},heading:{get:function(){return this._rotation.heading},set:function(e){this._rotation.heading=e}},pitch:{get:function(){return this._rotation.pitch},set:function(e){this._rotation.pitch=e}},roll:{get:function(){return this._rotation.roll},set:function(e){this._rotation.roll=e}},position:{get:function(){return this._position},set:function(e){this._position=e}}}),e.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(G.Math.toRadians(this._angle))},e.prototype.isDestroyed=function(){return!1},e.prototype.addGroundAreaEntity=function(e){var t;e&&!this.groundAreaEntity&&((t=this).updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:0===this._rotation.pitch&&0===this._rotation.roll,semiMinorAxis:new G.CallbackProperty(function(e){return t._ground_radius},!1),semiMajorAxis:new G.CallbackProperty(function(e){return t._ground_radius},!1),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll),positions:new G.CallbackProperty(function(e){return!t._trackedEntityPosition||G.Cartesian3.distance(t._position,t._trackedEntityPosition)>t._radius?[]:[t._position,t._trackedEntityPosition]},!1),followSurface:!1,material:new G.PolylineDashMaterialProperty({color:G.Color.CYAN}),width:1}}))};var n=new G.Cartesian3;e.prototype.computeMatrix=function(e,t){return this._positionCartesian||(this._positionCartesian=new G.Cartesian3),this.position instanceof G.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(e):this.position._value&&this.position._value instanceof G.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,e=G.Property.getValueOrUndefined(this._trackedEntity.position,e,n))&&(this._trackedEntityPosition=e,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=G.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),this._positionCartographic=G.Cartographic.fromCartesian(this._positionCartesian,i,this._positionCartographic),G.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),G.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=G.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),G.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),G.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},e.prototype.getTopGeometry=function(){for(var e=this.radius,t=[],i=[],n=[],r=[],o=90-parseInt(this.angle),a=o<1?o/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=a){for(var h=G.Math.toRadians(c<90?c:90),h=Math.cos(h)*e,u=[],d=0;d<128;d++){var p=s*d,m=h*Math.cos(p),p=h*Math.sin(p),g=Math.sqrt(e*e-m*m-p*p);t.push(m,p,g),i.push(1,1),u.push(l++)}r.push(u)}for(c=1;c<r.length;c++)for(d=1;d<r[c].length;d++){var f=r[c-1][d-1],A=r[c][d-1],y=r[c][d],v=r[c-1][d];n.push(f,A,y),n.push(f,y,v)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),o={position:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},w=G.BoundingSphere.fromVertices(t),o=new G.Geometry({attributes:o,indices:n,primitiveType:G.PrimitiveType.TRIANGLES,boundingSphere:w});return(0,G.Scene.computeVertexNormals)(o),o},e.prototype.getTopOutlineGeometry=function(){for(var e=this.radius,t=[],i=[],n=[],r=[],o=90-parseInt(this.angle),a=o<1?o/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=a){for(var h=G.Math.toRadians(c<90?c:90),h=Math.cos(h)*e,u=[],d=0;d<128;d++){var p=s*d,m=h*Math.cos(p),p=h*Math.sin(p),g=Math.sqrt(e*e-m*m-p*p);t.push(m,p,g),i.push(1,1),u.push(l++)}r.push(u)}for(c=1;c<r.length;c++)for(d=1;d<r[c].length;d++){var f=r[c-1][d-1],A=r[c][d-1],y=r[c][d];r[c-1][d],d%8==1&&n.push(f,A),c%8==1&&n.push(A,y)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),o={position:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},v=G.BoundingSphere.fromVertices(t),o=new G.Geometry({attributes:o,indices:n,primitiveType:G.PrimitiveType.LINES,boundingSphere:v});return(0,G.Scene.computeVertexNormals)(o),o},e.prototype.updateGeometry=function(){this._geometry=G.Scene.CylinderGeometry.createGeometry(new G.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(G.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(G.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=G.Scene.CylinderGeometry.createOutlineGeometry(new G.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(G.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(G.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var e=0;e<this._positions.length;e++)this._positions[e]=this._geometry.attributes.position.values[e];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))},e.prototype.update=function(t){this._show&&(this.computeMatrix(t.time),t.mode===G.SceneMode.SCENE3D?(this._geometry.boundingSphere=G.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,t)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,t)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,t)),this._topOutline)&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,t))),this._drawCommands.forEach(function(e){t.commandList.push(e)}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=!1)):(this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.ellipse.show=0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll)))},e.prototype.getFragmentShaderSource=function(e){return"#version 300 es\n in vec3 v_position;\n in vec3 v_normal; \n uniform float picked; \n uniform vec4 pickedColor; \n uniform vec4 defaultColor; \n uniform float specular; \n uniform float shininess; \n uniform vec3 emission; \n in vec2 v_st; \n uniform bool isLine; \n uniform float glowPower; \n void main() { \n vec3 positionToEyeEC = -v_position; \n vec3 normalEC = normalize(v_normal); \n vec4 color = defaultColor; \n if (picked != 0.0) { \n color = pickedColor; \n } \n czm_material material; \n material.specular = specular; \n material.shininess = shininess; \n material.normal = normalEC; \n material.emission = emission;//vec3(0.2,0.2,0.2);\n material.diffuse = color.rgb ;\n if(isLine){\n material.alpha = 1.0; \n }\n else{ \n material.alpha = color.a; \n }\n if(v_st.x==0.0){ \n out_FragColor =color ;\n }else { \n out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ; \n } \n }"},e.prototype.getVertexShaderSource=function(e){return"#version 300 es\n #ifdef GL_ES\n precision highp float;\n #endif\n\n in vec3 position;\n in vec2 st;\n in vec3 normal;\n uniform mat4 modelViewMatrix;\n uniform mat3 normalMatrix;\n uniform mat4 projectionMatrix;\n out vec3 v_position;\n out vec3 v_normal;\n out vec2 v_st;\n\n out vec3 v_light0Direction;\n\n void main(void) \n {\n vec4 pos = modelViewMatrix * vec4( position,1.0);\n v_normal = normalMatrix * normal;\n v_st = st;\n v_position = pos.xyz;\n v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n gl_Position = projectionMatrix * pos;\n }"},e.prototype.createDrawCommand=function(e,t,i){var n=t.context,r=new G.Cartesian3,r=(G.Matrix4.multiplyByPoint(this._matrix,e.boundingSphere.center,r),new G.BoundingSphere(r,e.boundingSphere.radius)),i=new G.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:e.primitiveType,pass:G.Pass.TRANSLUCENT,boundingVolume:r}),o=this,r=G.GeometryPipeline.createAttributeLocations(e);return i.vertexArray=G.VertexArray.fromGeometry({context:n,geometry:e,attributeLocations:r,bufferUsage:G.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=r,i.shaderProgram=G.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(e),fragmentShaderSource:this.getFragmentShaderSource(e),attributeLocations:r}),i.renderState=G.RenderState.fromCache({blending:G.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:G.DepthFunction.LESS},cull:{enabled:!1,face:G.CullFace.BACK}}),i.uniformMap={},i.uniformMap.projectionMatrix=function(){return t.context.uniformState.projection},i.uniformMap.modelViewMatrix=function(){return t.context.uniformState.modelView},i.uniformMap.shininess=function(){return o.shininess||(o.shininess=0),o.shininess},i.uniformMap.emission=function(){return o.emission||(o.emission=new G.Cartesian3(.2,.2,.2)),o.emission},i.uniformMap.specular=function(){return o.specular||(o.specular=0),o.specular},i.uniformMap.isLine=function(){return e.primitiveType==G.PrimitiveType.LINES||e.primitiveType==G.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return e.primitiveType==G.PrimitiveType.LINES||e.primitiveType==G.PrimitiveType.LINE_STRIP?(o.defaultLineColor||(o.defaultLineColor=new G.Color(1,1,0,1)),o.defaultLineColor):(o.defaultColor||(o.defaultColor=new G.Color(1,0,0,1)),o.defaultColor)},i.uniformMap.picked=function(){return o.picked||(o.picked=0),o.picked},i.uniformMap.pickedColor=function(){return o.pickedColor||(o.pickedColor=new G.Color(1,1,0,1)),o.pickedColor},i.uniformMap.normalMatrix=function(){return t.context.uniformState.normal},i.uniformMap.glowPower=function(){return.25},i},e.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity)},e.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity)},e.prototype.destroy=function(e){e&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy()}),this._drawCommands=[])},G.Scene.ConeSensorPrimitive=e},_installCounputeVertex:function(){var r=new G.Cartesian3,o=(new G.Ray,new G.Cartographic);G.Scene.computeVertexNormals=function(e){var t=e.indices,i=e.attributes,n=t.length;if(i.position){var r=i.position.values;if(void 0===i.normal)i.normal=new G.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(r.length)});else for(var o=i.normal.values,a=0;a<n;a++)o[a]=0;for(var s,l,c,h=i.normal.values,u=new G.Cartesian3,d=new G.Cartesian3,p=new G.Cartesian3,m=new G.Cartesian3,g=new G.Cartesian3,a=0;a<n;a+=3)s=3*t[a+0],l=3*t[a+1],c=3*t[a+2],G.Cartesian3.fromArray(r,s,u),G.Cartesian3.fromArray(r,l,d),G.Cartesian3.fromArray(r,c,p),G.Cartesian3.subtract(p,d,m),G.Cartesian3.subtract(u,d,g),G.Cartesian3.cross(m,g,m),h[s]+=m.x,h[1+s]+=m.y,h[2+s]+=m.z,h[l]+=m.x,h[1+l]+=m.y,h[2+l]+=m.z,h[c]+=m.x,h[1+c]+=m.y,h[2+c]+=m.z;for(var f,A,y,v,w=e.attributes.normal.values,C=0;C<w.length;C+=3)f=w[C],A=w[C+1],y=w[C+2],v=1/Math.sqrt(f*f+A*A+y*y),w[C]=f*v,w[C+1]=A*v,w[C+2]=y*v;i.normal.needsUpdate=!0}return e},G.Scene.extend2Earth=function(e,t,i,n){n=n||G.Ellipsoid.WGS84,G.Matrix4.multiplyByPoint(t,e,r),G.Cartesian3.subtract(r,i.origin,i.direction),G.Cartesian3.normalize(i.direction,i.direction);t=G.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=t?G.Ray.getPoint(i,t.start):n)try{G.Cartographic.fromCartesian(n,null,o)}catch(e){return null}return n}}};let R={};function O(e,t){if(t){new z(e,R=t);const i=new T(t),n=new D(t),o=new B(t,i);R.Scene.RectangularSensorPrimitive=i,R.Scene.RectangularSensorGraphics=n,R.Scene.RectangularSensorVisualizer=o;var e=R.DataSourceDisplay,r=e.defaultVisualizersCallback;e.defaultVisualizersCallback=function(e,t,i){var n=i.entities;return r(e,t,i).concat([new o(e,n)])}}}let F=null;function V(e,t){e&&(this._viewer=e,F=t,this._customPluginLayer=new F.CustomDataSource("_customPluginLayer"),new O(e,t),e)&&e.dataSources.add(this._customPluginLayer)}V.prototype={createRectangularSensorGraphics:function(e){var t,i;if(this._customPluginLayer&&e)return t=new F.HeadingPitchRoll(F.Math.toRadians(e.heading||90),F.Math.toRadians(e.pitch||0),F.Math.toRadians(e.roll||0)),i=e.position,this._customPluginLayer.entities.add({position:i,orientation:F.Transforms.headingPitchRollQuaternion(i,t),rectangularSensor:new F.Scene.RectangularSensorGraphics({radius:e.radius||1e5,xHalfAngle:F.Math.toRadians(e.xHalfAngle||45),yHalfAngle:F.Math.toRadians(e.yHalfAngle||45),material:e.material||new F.Color(1,0,1,.4),lineColor:e.lineColor||new F.Color(1,0,1,1),showScanPlane:this._objHasOwnProperty(e,"showScanPlane",!0),showSectorLines:this._objHasOwnProperty(e,"showSectorLines",!0),showLateralSurfaces:this._objHasOwnProperty(e,"showLateralSurfaces",!0),modelMatrix:e.modelMatrix||new F.Matrix4,scanPlaneColor:e.scanPlaneColor||new F.Color(1,0,1,1),scanPlaneMode:e.scanPlaneMode||"vertical",scanPlaneRate:e.scanPlaneRate||3,showThroughEllipsoid:this._objHasOwnProperty(e,"showThroughEllipsoid",!1),show:this._objHasOwnProperty(e,"show",!0)})})},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e.field:i,createSatelliteCoverageSimulationGraphics:function(e){if(e)return new F.Scene.SatelliteCoverageSimulation(this._viewer,{position:e.position,angle1:e.angle1||30,angle2:e.angle2||45,areaType:e.areaType||2,rotation:{heading:F.Math.toRadians(e.heading||0),pitch:F.Math.toRadians(e.pitch||0),roll:F.Math.toRadians(e.roll||0)},color:e.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(e){if(e)return new F.Scene.ConeSensorPrimitive(this._viewer,{position:e.position,angle:e.angle||80,radius:e.radius||7e5,rotation:{heading:F.Math.toRadians(e.heading||0),pitch:F.Math.toRadians(e.pitch||40),roll:F.Math.toRadians(e.roll||0)},color:e.color||{red:1,green:0,blue:0,alpha:.4},lineColor:e.lineColor||{red:1,green:1,blue:1,alpha:.9}})}};let H,W,U=null,N={},j="move",X=null;function q(e,t){e&&(this._viewer=e,X=e,U=t,this._installFileDragDropHandler())}q.prototype={_installFileDragDropHandler(){function i(e,t){var i=document.createElement("div");i.id="fileDragDrop",i.classList.add("filedragdrop"),i.innerHTML="请将Json文件拖拽到此区域",this._dragBox=i,this._viewer=t,(this._parentDiv=e).appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}i.prototype.startuploadfile=function(){var i=this,e=i._dragBox,t=null;document.ondragover=function(){clearTimeout(t),t=setTimeout(function(){e.innerHTML="请将文件拖拽到此区域"},200)},e.ondragenter=function(){e.innerHTML="请释放鼠标"},e.ondragover=function(){return!1},e.ondragleave=function(){e.innerHTML="请将文件拖拽到此区域"},e.ondrop=function(e){e.preventDefault();var e=e.dataTransfer.files[0],t=new FileReader;return t.readAsText(e,"UTF-8"),t.onload=function(){var e=JSON.parse(this.result);i.fileDragDropCallBack&&i.fileDragDropCallBack(i.callBackParms,e,i._viewer)},t.onloadstart=function(){},t.onloadend=function(){},t.onabort=function(){alert("读取数据中断")},!(t.onerror=function(){alert("读取数据失败")})}},U.Scene.FileDragDropMixin=function(e){var t=new i(document.querySelector(".cesium-viewer"),e);Object.defineProperties(e,{fileDragDropMixin:{get:function(){return t}}})}},showLoadDataToScenePanel(e){if(e=e||{}){let e=new i,r=this._viewer,t=e.addFolder("加载数据文件"),n=e=>{let t=document.createElement("input");t.type="file",t.className="datgui_upload",t.onchange=function(){"function"==typeof e&&t.files.length&&e(URL.createObjectURL(t.files[0]))},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(t),t.click()},o={point:()=>{n(e=>{U.GeoJsonDataSource.load(e).then(function(e){r.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.point={color:U.Color.BLUE}}r.flyTo(e)})})},polyline:()=>{n(e=>{U.GeoJsonDataSource.load(e).then(function(e){r.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.polyline.width=5,n.polyline.material=new U.PolylineGlowMaterialProperty({glowPower:.1,color:U.Color.ORANGERED.withAlpha(.9)})}r.flyTo(e)})})},polygon:()=>{n(e=>{U.GeoJsonDataSource.load(e).then(function(e){r.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.polygon.width=10,n.polygon.material=U.Color.BLUE.withAlpha(.9)}r.flyTo(e)})})},model:()=>{n(e=>{r.flyTo(d3kit.createModelGraphics({position:U.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:e}))})},czml:()=>{n(e=>{r.flyTo(r.dataSources.add(U.CzmlDataSource.load(e)))})},"3dtilset":()=>{n(e=>{r.flyTo(r.scene.primitives.add(new U.Cesium3DTileset({url:e})))})}};t.add(o,"point"),t.add(o,"polyline"),t.add(o,"polygon"),t.add(o,"model"),t.add(o,"czml"),t.add(o,"3dtilset"),t.open()}},showPostProcessStagesPanel(e){e=e||{};let t=null,n=new function(){this.blackAndWhiteShow=!1,this.blackAndWhiteGradations=5,this.brightnessShow=!1,this.brightnessValue=.5,this.nightVisionShow=!1,this.silhouette=!1},r=(e&&e.elementId?(t=new i({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new i,this._viewer.scene.postProcessStages),o=r.add(U.PostProcessStageLibrary.createSilhouetteStage()),a=r.add(U.PostProcessStageLibrary.createBlackAndWhiteStage()),s=r.add(U.PostProcessStageLibrary.createBrightnessStage()),l=r.add(U.PostProcessStageLibrary.createNightVisionStage());o.uniforms.color=e.silhouetteColor||U.Color.YELLOW,o.enabled=!1,a.enabled=!1,a.uniforms.gradations=5,s.enabled=!1,s.uniforms.brightness=.5,l.enabled=!1,t.add(n,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(e){a.enabled=e}),t.add(n,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(e){a.uniforms.gradations=e}),t.add(n,"brightnessShow").name("brightnessShow").onChange(function(e){s.enabled=e}),t.add(n,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(e){s.uniforms.brightness=e}),t.add(n,"nightVisionShow").name("nightVisionShow").onChange(function(e){l.enabled=e}),t.add(n,"silhouette").name("silhouette").onChange(function(e){o.enabled=e})},showSceneBloomPanel(e){let t=null,n=new function(){this.contrast=128,this.brightness=-.3,this.delta=1,this.gamma=3.5,this.enabled=!1,this.highDynamicRange=!1,this.shadows=!1,this.glowOnly=!1,this.sigma=1,this.stepSize=5},r=(e&&e.elementId?(t=new i({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new i,this._viewer),o=(t.__closeButton.innerHTML="收缩面板",r.scene.postProcessStages.bloom);t.add(n,"enabled").name("bloom").onChange(function(e){o.enabled=e}),t.add(n,"glowOnly").name("发光").onChange(function(e){o.uniforms.glowOnly=e}),t.add(n,"enabled").name("启用模糊").onChange(function(e){o.enabled=e}),t.add(n,"contrast",-255,255,.01).name("对比度").onChange(function(e){o.uniforms.contrast=e}),t.add(n,"brightness",-1,1,.01).name("光泽亮度").onChange(function(e){o.uniforms.brightness=e}),t.add(n,"delta",1,5,.01).name("因子").onChange(function(e){o.uniforms.delta=e}),t.add(n,"sigma",1,10,.01).name("sigma").onChange(function(e){o.uniforms.sigma=e}),t.add(n,"stepSize",.1,10).name("stepSize").onChange(function(e){o.uniforms.stepSize=e}),t.add(n,"shadows").name("启用阴影").onChange(function(e){r.shadows=e}),t.add(n,"highDynamicRange").name("高动态范围").onChange(function(e){r.scene.highDynamicRange=e}),t.add(n,"gamma",1,10,.01).name("伽马亮度").onChange(function(e){r.scene.gamma=e})},showPrimitiveMatrixPanel(t){let n=t.primitives._delegate||t.primitives,r=t.primitives,e=(this._viewer,null);t&&t.elementId?(e=new i({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new i;var o=e.addFolder("离地高度"),o=(o.add({height:100},"height",0,1e3,1).onChange(function(e){var t=r.boundingSphere,t=U.Cartographic.fromCartesian(t.center),i=U.Cartesian3.fromRadians(t.longitude,t.latitude,0),t=U.Cartesian3.fromRadians(t.longitude,t.latitude,e),e=U.Cartesian3.subtract(t,i,new U.Cartesian3);r.modelMatrix=U.Matrix4.fromTranslation(e)}),o.open(),e.addFolder("缩放大小")),a={"m+Scale":()=>{n.readyPromise.then(e=>{var t=e.root.transform;U.Matrix4.multiplyByUniformScale(t,1.2,t),e.root.transform=t})},"m-Scale":()=>{n.readyPromise.then(e=>{var t=e.root.transform;U.Matrix4.multiplyByUniformScale(t,.8,t),e.root.transform=t})}},a=(o.add(a,"m+Scale"),o.add(a,"m-Scale"),o.open(),{"x+Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(20,0,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"x-Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(-20,0,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"y+Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,20,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"y-Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,-20,0));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"z+Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,0,20));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)},"z-Axis":()=>{var e=U.Matrix4.fromTranslation(new U.Cartesian3(0,0,-20));U.Matrix4.multiply(n.modelMatrix,e,n.modelMatrix)}}),o=e.addFolder("矩阵平移");o.add(a,"x+Axis"),o.add(a,"x-Axis"),o.add(a,"y+Axis"),o.add(a,"y-Axis"),o.add(a,"z+Axis"),o.add(a,"z-Axis"),o.open();let s={x:0,y:0,z:0},l={"x+Axis":()=>{s.x+=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationX(U.Math.toRadians(s.x)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"x-Axis":()=>{s.x-=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationX(U.Math.toRadians(s.x)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"y+Axis":()=>{s.y+=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationY(U.Math.toRadians(s.y)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"y-Axis":()=>{s.y-=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationY(U.Math.toRadians(s.y)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"z+Axis":()=>{s.z+=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationZ(U.Math.toRadians(s.z)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})},"z-Axis":()=>{s.z-=15,n.readyPromise.then(e=>{var t=U.Matrix3.fromRotationZ(U.Math.toRadians(s.z)),t=U.Matrix4.fromRotationTranslation(t),i=U.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);U.Matrix4.multiply(i,t,i),e._root.transform=i})}},c=e.addFolder("旋转矩阵");c.add(l,"x+Axis"),c.add(l,"x-Axis"),c.add(l,"y+Axis"),c.add(l,"y-Axis"),c.add(l,"z+Axis"),c.add(l,"z-Axis"),c.open(),t.cb&&((a=e.addFolder("获取调整后的模型矩阵")).add({getModelMaterix:()=>{n.readyPromise.then(e=>{e=e.root.transform;t.cb({modelTransformMatrix:U.Matrix4.toArray(e),modelMatrix:U.Matrix4.toArray(r.modelMatrix)})})}},"getModelMaterix").name("获取模型矩阵"),a.open()),e.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(t,n){if(t){let e=null;n&&n.elementId?(e=new i({autoPlace:!1}),document.getElementById(n.elementId).appendChild(e.domElement)):e=new i;var n=new function(){this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.gamma=t.gamma,this.hue=t.hue,this.dayAlpha=t.dayAlpha,this.nightAlpha=t.nightAlpha,this.saturation=t.saturation},r=e.addFolder("图层调整");r.add(n,"alpha",0,1,.05).name("透明度").onChange(function(e){t.alpha=e}),r.add(n,"brightness",0,5,.05).name("亮度").onChange(function(e){t.brightness=e}),r.add(n,"contrast",0,5,.05).name("对比").onChange(function(e){t.contrast=e}),r.add(n,"gamma",0,5,.05).name("伽马").onChange(function(e){t.gamma=e}),r.add(n,"hue",0,5,.05).name("色调").onChange(function(e){t.hue=e}),r.add(n,"dayAlpha",0,1,.05).name("白天透明").onChange(function(e){t.dayAlpha=e}),r.add(n,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(e){t.nightAlpha=e}),r.add(n,"saturation",0,5,.05).name("饱和").onChange(function(e){t.saturation=e}),r.open()}},showLayerSwitchPanel:function(t,n,r){if(t&&t.length){let e=null;n&&n.elementId?(e=new i({autoPlace:!1}),document.getElementById(n.elementId).appendChild(e.domElement)):e=new i;var o=new function(){t.forEach(e=>{this[e.id]=e.show})},a=e.addFolder("图层切换"),s=(t.forEach(t=>{a.add(o,t.id).name(t.name).onChange(function(e){t.show=e,r&&r({key:t.id,val:e})})}),new function(){t.forEach(e=>{this[e.id]=e.alpha})}),l=e.addFolder("透明度");t.forEach(t=>{l.add(s,t.id,0,1,.05).name(t.name).onChange(function(e){t.alpha=e})}),a.open(),l.open()}},showSceneEffectEditPanel:function(e){var t,n,r;e=e||{},i&&this._viewer.scene.colorCorrection&&(r=new i,(t=this._viewer).scene.lightSource.ambientLightColor=e.ambientLightColor||new U.Color(.3,.3,.3,1),t.scene.colorCorrection.show=e.colorCorrection||!1,t.scene.colorCorrection.saturation=e.saturation||3.1,t.scene.colorCorrection.brightness=e.brightness||1.8,t.scene.colorCorrection.contrast=e.contrast||1.2,t.scene.colorCorrection.hue=e.hue||0,t.scene.bloomEffect.show=e.bloomEffect||!1,t.scene.hdrEnabled=e.hdrEnabled||!0,t.scene.bloomEffect.threshold=e.threshold||1,t.scene.bloomEffect.bloomIntensity=e.bloomIntensity||2,n=new function(){this.bloomEffectShow=e.bloomEffect||!1,this.bloomThreshold=e.threshold||1,this.bloomIntensity=e.bloomIntensity||2,this.ambientLightColor=e.ambientLightColor||.3,this.hdrEnabled=e.hdrEnabled||!0,this.colorCorrectionShow=!1,this.colorCorrectionSaturation=e.saturation||3.1,this.colorCorrectionBrightness=e.brightness||1.8,this.colorCorrectionContrast=e.contrast||1.2,this.colorCorrectionHue=e.hue||0},(r=r.addFolder("场景效果")).add(n,"bloomEffectShow").name("泛光开关").onChange(function(e){t.scene.bloomEffect.show=e,t.scene.bloomEffect.threshold=n.bloomThreshold,t.scene.bloomEffect.bloomIntensity=n.bloomIntensity}),r.add(n,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(e){t.scene.bloomEffect.threshold=e}),r.add(n,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(e){t.scene.bloomEffect.bloomIntensity=e}),r.add(n,"hdrEnabled").name("HDR开关").onChange(function(e){t.scene.hdrEnabled=e}),r.add(n,"colorCorrectionShow").name("颜色校正").onChange(function(e){t.scene.colorCorrection.show=e}),r.add(n,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(e){t.scene.colorCorrection.saturation=e}),r.add(n,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(e){t.scene.colorCorrection.brightness=e}),r.add(n,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(e){t.scene.colorCorrection.contrast=e}),r.add(n,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(e){t.scene.hdrEnabled=e}),r.add(n,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(e){t.scene.lightSource.ambientLightColor=new U.Color(e,e,e,1)}),r.open())},showEntityOrientationEditPanel:function(n={}){if(n.entity){let t=n.entity;var e=new i,r=(n&&n.elementId?(e=new i({autoPlace:!1}),document.getElementById(n.elementId).appendChild(e.domElement)):e=new i,new function(){this.heading=360,this.pitch=1,this.roll=1}),e=e.addFolder("实体姿态调整"),o=this;e.add(r,"heading",0,360,1).name("角度").onChange(function(e){r.heading=e;e=U.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new U.HeadingPitchRoll(U.Math.toRadians(r.heading),U.Math.toRadians(r.pitch),U.Math.toRadians(r.roll)));t.orientation=e,n.cb&&n.cb({orientation:e})}),e.add(r,"pitch",0,360,1).name("航向").onChange(function(e){r.pitch=e;e=U.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new U.HeadingPitchRoll(U.Math.toRadians(r.heading),U.Math.toRadians(r.pitch),U.Math.toRadians(r.roll)));t.orientation=e,n.cb&&n.cb({orientation:e})}),e.add(r,"roll",0,360,1).name("翻转").onChange(function(e){r.roll=e;e=U.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new U.HeadingPitchRoll(U.Math.toRadians(r.heading),U.Math.toRadians(r.pitch),U.Math.toRadians(r.roll)));t.orientation=e,n.cb&&n.cb({orientation:e})}),e.open()}},definedMouseEvent({targetEntity:e,ctrlFlag:t}){W=e,N=t,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(t){if(N.leftDown&&H){let e=X.camera.getPickRay(t.endPosition),r=X.scene.globe.pick(e,X.scene);if(document.body.style.cursor="pointer",H&&H.id&&"move"===j){let e=U.JulianDate.fromDate(new Date),t=W.position.getValue(e),i=U.Cartographic.fromCartesian(t),n=Number(i.height.toFixed(3));W.position=new U.CallbackProperty(()=>{var e=X.scene.globe.ellipsoid.cartesianToCartographic(r),t=U.Math.toDegrees(e.longitude),e=U.Math.toDegrees(e.latitude);return U.Cartesian3.fromDegrees(t,e,n)},!1)}else{var i,n,o;H&&H.id&&"rotate"===j&&(n=U.JulianDate.fromDate(new Date),n=W.position.getValue(n),o=X.scene.camera.pickEllipsoid(t.startPosition),t=X.scene.camera.pickEllipsoid(t.endPosition),i=U.Cartesian3.subtract(n,t,new U.Cartesian3),i=U.Cartesian3.normalize(i,new U.Cartesian3),o=U.Cartesian3.subtract(o,n,new U.Cartesian3),t=U.Cartesian3.subtract(t,n,new U.Cartesian3),n=U.Cartesian3.angleBetween(o,t),o=U.Quaternion.fromAxisAngle(i,100*n),W.orientation=o)}}},defLeftDown(e){H=X.scene.pick(e.position),U.defined(H)&&j?(N.selected=!0,N.leftDown=!0):N.selected=!1},defMouseWheel(n){if(H&&H.id&&"scale"===j){let e=U.JulianDate.fromDate(new Date),t=W.box.dimensions.getValue(e),i=0<n?2:.5;W.box.dimensions=new U.CallbackProperty(()=>U.Cartesian3.multiplyByScalar(t,i,new U.Cartesian3),!1)}},defLeftUp(e){N.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(e){j=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(e){j=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(e){j=e,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let Y=null;var Q=3.141592653589793,K=6378245,J=.006693421622965943;function Z(e,t,i){e&&(this._viewer=e,Y=t,this._queryRouteKey="8dc49b1fa65a79d306ef12dae4229842",this._pluginLayer=new Y.CustomDataSource("pluginLayer"),e&&e.dataSources.add(this._pluginLayer),this._installPlugin())}Z.routeQueryType={DRIVE:"drive",WALK:"walk",CYCLE:"cycle"},Z.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan(),this._installClusterLayer(),this._installBar3DLayer()},_installTerrainClipPlan:function(){function e(e,t){this.viewer=e,this.options=t||{},this._positions=t.positions,this._height=this.options.height||0,this.bottomImg=t.bottomImg,this.wallImg=t.wallImg,this.splitNum=Y.defaultValue(t.splitNum,50),this._positions&&0<this._positions.length&&this.updateData(this._positions)}Object.defineProperties(e.prototype,{show:{get:function(){return this._show},set:function(e){this._show=e,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=e),this._switchExcavate(e)}},height:{get:function(){return this._height},set:function(e){this._height=e,this._updateExcavateDepth(e)}}}),e.prototype.updateData=function(e){var t=[],i=e.length-1,n=new Y.Cartesian3,r=0<Y.Cartesian3.subtract(e[0],e[1],n).x;this.excavateMinHeight=9999;for(var o=0;o<i;o++){var a=(o+1)%i,s=Y.Cartesian3.midpoint(e[o],e[a],new Y.Cartesian3),l=Y.Cartographic.fromCartesian(e[o]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=Y.Cartesian3.normalize(s,new Y.Cartesian3),a=r?Y.Cartesian3.subtract(e[o],s,new Y.Cartesian3):Y.Cartesian3.subtract(e[a],s,new Y.Cartesian3),a=(a=Y.Cartesian3.normalize(a,a),Y.Cartesian3.cross(a,l,new Y.Cartesian3)),a=Y.Cartesian3.normalize(a,a),l=new Y.Plane(a,0),l=Y.Plane.getPointDistance(l,s);t.push(new Y.ClippingPlane(a,l))}this.viewer.scene.globe.clippingPlanes=new Y.ClippingPlaneCollection({planes:t,edgeWidth:1,edgeColor:Y.Color.WHITE,enabled:!0}),this._prepareWell(e),this._createWell(this.wellData)},e.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()},e.prototype._prepareWell=function(e){var t=this.splitNum,i=e.length;if(0!=i){for(var n=this.excavateMinHeight-this.height,r=[],o=[],a=[],s=0;s<i;s++){var l=s==i-1?0:s+1,c=Y.Cartographic.fromCartesian(e[s]),l=Y.Cartographic.fromCartesian(e[l]),h=[c.longitude,c.latitude],u=[l.longitude,l.latitude];0==s&&(a.push(new Y.Cartographic(h[0],h[1])),o.push(Y.Cartesian3.fromRadians(h[0],h[1],n)),r.push(Y.Cartesian3.fromRadians(h[0],h[1],0)));for(var d=1;d<=t;d++){var p=Y.Math.lerp(h[0],u[0],d/t),m=Y.Math.lerp(h[1],u[1],d/t);s==i-1&&d==t||(a.push(new Y.Cartographic(p,m)),o.push(Y.Cartesian3.fromRadians(p,m,n)),r.push(Y.Cartesian3.fromRadians(p,m,0)))}}this.wellData={lerp_pos:a,bottom_pos:o,no_height_top:r}}},e.prototype._createWell=function(o){var a;this.viewer.terrainProvider._layers?((a=this)._createBottomSurface(o.bottom_pos),Y.sampleTerrainMostDetailed(this.viewer.terrainProvider,o.lerp_pos).then(function(e){for(var t=e.length,i=[],n=0;n<t;n++){var r=Y.Cartesian3.fromRadians(e[n].longitude,e[n].latitude,e[n].height);i.push(r)}a._createWellWall(o.bottom_pos,i)})):(this._createBottomSurface(o.bottom_pos),this._createWellWall(o.bottom_pos,o.no_height_top))},e.prototype._getMinHeight=function(t){let i=5e6,n=null;for(let e=0;e<t.length;e++){var r=t[e].z;r<i&&(i=r,n=this._ellipsoidToLonLat(t[e]))}return n.altitude},e.prototype._ellipsoidToLonLat=function(e){var t=this.viewer.scene.globe.ellipsoid,e=new Y.Cartesian3(e.x,e.y,e.z),t=t.cartesianToCartographic(e),e=Y.Math.toDegrees(t.latitude);return{longitude:Y.Math.toDegrees(t.longitude),latitude:e,altitude:t.height}},e.prototype._createBottomSurface=function(t){if(t.length){var i=this._getMinHeight(t),n=[];for(let e=0;e<t.length;e++){var r=this._ellipsoidToLonLat(t[e]);n.push(r.longitude),n.push(r.latitude),n.push(i)}var e=new Y.PolygonGeometry({polygonHierarchy:new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),e=Y.PolygonGeometry.createGeometry(e),o=new Y.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),o=new Y.MaterialAppearance({translucent:!1,flat:!0,material:o});this.bottomSurface=new Y.Primitive({geometryInstances:new Y.GeometryInstance({geometry:e}),appearance:o,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},e.prototype._createWellWall=function(e,t){var i=this._getMinHeight(e),n=[],r=[];for(let e=0;e<t.length;e++)n.push(this._ellipsoidToLonLat(t[e]).altitude),r.push(i);var e=new Y.WallGeometry({positions:t,maximumHeights:n,minimumHeights:r}),e=Y.WallGeometry.createGeometry(e),o=new Y.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),o=new Y.MaterialAppearance({translucent:!1,flat:!0,material:o});this.wellWall=new Y.Primitive({geometryInstances:new Y.GeometryInstance({geometry:e,attributes:{color:Y.ColorGeometryInstanceAttribute.fromColor(Y.Color.GREY)},id:"PitWall"}),appearance:o,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},e.prototype._switchExcavate=function(e){e?(this.viewer.scene.globe.material=Y.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)},e.prototype._updateExcavateDepth=function(e){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var t=this.wellData.lerp_pos,i=[],n=t.length,r=0;r<n;r++)i.push(Y.Cartesian3.fromRadians(t[r].longitude,t[r].latitude,this.excavateMinHeight-e));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)},Y.Scene.TerrainClipPlan=e},buildLightScanGraphics:function(e){if(this._viewer&&e){function t(t,e,i){var n,r,o,a,s,l,c=t.positionList,h=0,u=0;function d(e){n=c[e+1][0]-c[e][0],r=c[e+1][1]-c[e][1],o=n/t.number,a=r/t.number,u=0}d(h),e.polygon.hierarchy=new Y.CallbackProperty(function(){return Math.abs(s)>=Math.abs(n)&&Math.abs(l)>=Math.abs(r)&&((h+=1)===c.length-1&&(h=0),i[0]=i[0]+s,i[1]=i[1]+l,i[2]=i[2]+s,i[3]=i[3]+l,d(h)),s=u*o,l=u*a,u++,new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))},!1)}for(var l=this,i=function(e,t,i,n){let r=[],o=Math.PI/180*Math.round(360/n),a=0;for(;a<n;a++){var s=t+e*Math.sin(o*a),l=i+e*Math.cos(o*a);r.unshift({x:s,y:l})}return r}(e.circle[0],e.circle[1],e.circle[2],e.circle[3]),n=function(e,t){for(var i=t.observer[0],n=t.observer[1],r=t.observer[2],o=[],a=0;a<e.length;a++){var s=a===e.length-1?new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights([i,n,r,e[a].x,e[a].y,0,e[0].x,e[0].y,0])):new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights([i,n,r,e[a].x,e[a].y,0,e[a+1].x,e[a+1].y,0])),s=l._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:s,outline:!1,perPositionHeight:!0,material:t.material}});o.push(s)}return o}(i,e),r=0;r<n.length;r++)r!==n.length-1?t(e,n[r],[i[r].x,i[r].y,i[r+1].x,i[r+1].y]):t(e,n[r],[i[r].x,i[r].y,i[0].x,i[0].y]);return n}},buildPathRoaming:function(e){if(this._viewer&&e&&e.paths){for(var t=e.paths,i=this.createGraphics(),n=[],r=0;r<t.length;r++){var o=Y.Cartesian3.fromDegrees(Number(t[r].lng),Number(t[r].lat),Number(t[r].alt));n.push(o)}if(i.position=this._createSampledPosition(n),i.name=e.name||"路径漫游",i.availability=new Y.TimeIntervalCollection([new Y.TimeInterval({start:this.startTime,stop:this.stopTime})]),i.orientation=this._sampleOrientation(),e.polyline){const{width:t,material:r,clampToGround:o,...a}=e.polyline;i.polyline={positions:new Y.CallbackProperty(function(){return n},!1),width:t||10,material:r||new Y.PolylineGlowMaterialProperty({glowPower:1,color:Y.Color.RED}),clampToGround:o||!0,resOpt:a}}return e.model&&(i.model=this.getModelGraphics(e.model)),e.label&&(i.label=this.getLabelGraphics(e)),e.billboard&&(i.billboard=this.getBillboardGraphics(e)),this.droneEntity=i,this._beginRoamTrace(e),this._viewer.entities.add(i)}},_beginRoamTrace(i){this._viewer.clock.onTick.addEventListener(()=>{var e,t;this._viewer.clock.shouldAnimate&&(t=this._viewer.clock.currentTime,e=this.droneEntity.position.getValue(t),t=this.droneEntity.orientation.getValue(t),e)&&t&&(t=Y.Matrix4.fromRotationTranslation(Y.Matrix3.fromQuaternion(t),e),this._viewer.camera.lookAtTransform(t,i.cameraOffset()))})},_createSampledPosition(t){this.startTime=Y.JulianDate.now(),this.stopTime=Y.JulianDate.addSeconds(this.startTime,60*t.length,new Y.JulianDate),this._viewer.clock.startTime=this.startTime.clone(),this._viewer.clock.stopTime=this.stopTime.clone(),this._viewer.clock.currentTime=this.startTime.clone(),this._viewer.clock.clockRange=Y.ClockRange.CLAMPED;var i=new Y.SampledPositionProperty;for(let e=0;e<t.length;e++){var n=Y.JulianDate.addSeconds(this.startTime,60*e,new Y.JulianDate),r=t[e];i.addSample(n,r)}return i},_sampleOrientation(){let r,o,a;return new Y.CallbackProperty(e=>{var t=this.droneEntity.position.getValue(e);if(o=this.droneEntity.position.getValue(Y.JulianDate.addSeconds(e,1/60,new Y.JulianDate)),t&&o){r=t;const e=Y.Cartesian3.subtract(o,r,new Y.Cartesian3),i=Y.Cartesian3.normalize(e,new Y.Cartesian3),n=Y.Transforms.rotationMatrixFromPositionVelocity(r,i,Y.Ellipsoid.WGS84);a=Y.Quaternion.fromRotationMatrix(n)}return a},!1)},_installCss3Renderer:function(){function e(e,t){this._scratch=new Y.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=e,this._isBackHide=t,this._parentEleId=0<e.length&&e[0].parentEleId||"info-warp",this.init()}var i;this._viewer&&(i=this._viewer,e.prototype.init=function(){var o=document.createElement("div");o.className="ys-css3-container";const e=this._parentEleId,a=document.getElementById(e);a.appendChild(o),this._container=o,this._elements=this._elements.filter(e=>e.position),this._elements.forEach(function(e){o.insertAdjacentHTML("beforeend",e.element)});var s=this;this._scene.preRender.addEventListener(function(){document.querySelectorAll(".close__box__btn").forEach(function(e){e.addEventListener("click",function(){a.contains(o)&&a.removeChild(o)})});for(var e=0;e<o.children.length;e++){var t,i=Y.Cartesian3.fromDegrees(s._elements[e].position[0],s._elements[e].position[1],s._elements[e].position[2]||0),n=s._scene.cartesianToCanvasCoordinates(i,s._scratch);const a=s._elements[e].offset?s._elements[e].offset[0]:0,r=s._elements[e].offset?s._elements[e].offset[1]:0;Y.defined(n)&&(o.children[e].style.left=parseFloat(n.x)+parseFloat(a)+"px",o.children[e].style.top=parseFloat(n.y)+parseFloat(r)+"px",s._isBackHide)&&(n=s._camera.position,t=s._scene.globe.ellipsoid.cartesianToCartographic(n).height,t+=+s._scene.globe.ellipsoid.maximumRadius,Y.Cartesian3.distance(n,i)>t?o.children[e].style.display="none":o.children[e].style.display="block")}})},e.prototype.remove=function(e){this._elements=this._elements.filter(function(e){e.id}),this._container.removeChild(document.getElementById(e))},e.prototype.removeChild=function(){var e=document.getElementById(this._parentEleId);e.contains(this._container)&&e.removeChild(this._container)},e.prototype.close=function(){var e=document.getElementById(this._parentEleId);e.contains(this._container)&&e.removeChild(this._container)},e.prototype.append=function(e){this._elements.push(e),this._container.insertAdjacentHTML("beforeend",e.element)},e.prototype.removeEntityLayer=function(e){this._viewer.entities.removeById(e+"_1"),this._viewer.entities.removeById(e+"_2"),this._viewer.entities.removeById(e+"_3"),this.remove(e)},e.prototype.addEntityLayer=function(e){var t=e.position[0],i=e.position[1],n=this,r=(setTimeout(function(e){},300),Y.Math.toRadians(30)),o=Y.Math.toRadians(30),a=e.boxHeight||300,s=e.boxHeightMax||400,l=e.boxHeightDif||10,c=!0;e.boxShow?this._viewer.entities.add({id:e.id+"_1",name:"立方体盒子",position:new Y.CallbackProperty(function(){return(a+=l)>=s&&(a=s),Y.Cartesian3.fromDegrees(t,i,a/2)},!1),box:{dimensions:new Y.CallbackProperty(function(){return(a+=l)>=s&&(a=s,c)&&(c=!1,n.append(e,!0)),new Y.Cartesian3(e.boxSide||100,e.boxSide||100,a)},!1),material:e.boxMaterial||Y.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){n.append(e,!0)},100),e.circleShow&&(e.circleSize=e.circleSize||120,this._viewer.entities.add({id:e.id+"_2",name:"椭圆",position:Y.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new Y.CallbackProperty(function(){return.001},!1),semiMajorAxis:new Y.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new Y.CallbackProperty(function(){return r+=.05},!1),stRotation:new Y.CallbackProperty(function(){return r+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:e.id+"_3",name:"椭圆",position:Y.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new Y.CallbackProperty(function(){return.001},!1),semiMajorAxis:new Y.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new Y.CallbackProperty(function(){return o-=.03},!1),stRotation:new Y.CallbackProperty(function(){return o-=.03},!1),zIndex:3}}))},Y.Scene.Css3Renderer=e)},_installClusterLayer:function(){if(this._viewer){const t=this._viewer,i={pixelRange:40,minimumClusterSize:5,image:"data:image/png;base64,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MAwABSh1ZkDGA+JDfpOR+l+ZrpQSEGQAb/LldpdBgoI8ZxXd56909O3T8wlkgpGMFVwcO9g1MHNvKH/fN703/TtH/AsVA0CByjhd2GlgNl3woJuvUsLdlfAGDQR8VtDzw2n9FTYZq7etABUkXg5coKyBMtPIXHHsC2gGpCtm+mfn48VtPJ/hbbEHk+lzM0tAJTnHv4AxABQwY83z7TDV2sDKGVR5M1XobJU7qFI7M4n0Y9BHZA8acrrvFp7uK2zsAhQB35mBNGdKnr6yzvua9+eg17M9NxzOLoZ9rp8j/gWOGUARSM2a81cmZ+udLb0PqtRBrXxQQPDtDDLspLNLogf9WPmLAgNAsTCTMh6QyLqNVM5saXlQtyBbvz4wG8jQtRjY9msc8S8e7AIUkYvThV3pPYLPBAQZbYo/6OcYHbryLwYVDWYARcRY81yHNSjoGvH3bjSEAb/ADx9iW+AdWxh41IN+/TzdV2SYARShjIOCQSJv9cFpvkWMGUAR8g0Kelvv4L756GT7HFnQk5W/KDEAFCt7ULA7cApuJtb5/CHODxjqZ3DQr6gxABSpizMFfbP9VObW2vvacLODdLBxX9u/DlS0GACKmD1T0HEnnaG06EPdZrDZh5J9cKZf0eMgYAkY0eXDaYMN7mW6KCiJtToA8fLeIscMoBQkrQtuEkPa1tu6D7fyC1O1sfKXBgaAEpAaD1gz8ESGxC5bi+6VeXwgAZVsBZUEBoASYY0H6BF565dsg4BBrw9nMNBUrVzTr3RwDKDEZBwPGKz19y70EfQz7+FXcpgBlBp7PMA9Mu+6bNjDeVrPFSB8pwuZ+pcgBoASY6XnhnJX1KAKnulU38AG7l+Z+pckdgFKlKsrMNjiIE6BMwv1qP+dTP1LETOAUjXcrkCaf4AwoT+LqX+JYgAoUfapQd0VGOyc/2AzA5n6lzR2AUpc4FkB5yIi2XUYq7ZxgY8Sxgyg1CUDluX2Lh6aKQuwrzikEsYAUOIudgUy8a7uM/BOpv5jAAPAmGDKvP2E9WPQ4iHpuQADryV4jf/YwAAwBliX7KbnBmSbBpz+OVvGQCWFg4BjiHpgqR4QVC1ZBwENbNLn/Nn3HyOYAYwlSaSygIDX0ul/MrkWNGYwAIwh1hWDBtoHnvCOB6CNA39jCwPAWJNMLSHmnRXIGX9jEgPAGGNnAUa7/wIhYyNb/7GHAWAsShoD/Xz7Yh+e9hujGADGIPsWY47Vg0ww9R+jGADGLGs9f7laMKEjQDuIaGxRG5a2qA1LloOIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIgo5/4fgca0NGwEH+0AAAAASUVORK5CYII=",selectImage:"data:image/png;base64,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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHL+JwHeg+eol/LPAAAAAElFTkSuQmCC",scale:.7,type:0,cluserColors:[{value:40,color:"rgb(255,0,0)"},{value:30,color:"rgb(255,0,255)"},{value:20,color:"rgb(255,255,0)"},{value:10,color:"rgb(0,255,255)"},{value:1,color:"rgb(0,255,0)"}]};function r(i,n){return"object"!=typeof i&&(i={}),Array.isArray(n)?n.slice():(Object.keys(n).forEach(e=>{var t=n[e];i[e]="object"==typeof t?r(i[e],t):t}),i)}function e(e={}){this.style=r(i,e||{}),this.layer=null,this.unClusterLayer=null,this.lastCluster=[],this.cluserCanvasImages={},this._init()}e.prototype._init=function(){this.layer=new Y.CustomDataSource("clusterLayer"),this.unClusterLayer=new Y.CustomDataSource("unClusterLayer"),t.dataSources.add(this.unClusterLayer),this.layer.clustering.enabled=!0,this.layer.clustering.pixelRange=this.style.pixelRange,this.layer.clustering.minimumClusterSize=this.style.minimumClusterSize,this.setCanvasClusterEvent()},e.prototype.addDataToLayer=function(t){t.forEach(e=>{e=new Y.Entity({id:e.id||Math.random().toString(36).substring(2),props:e,position:Y.Cartesian3.fromDegrees(e.position[0],e.position[1]),billboard:{image:this.style.image,scale:this.style.scale,disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.otherProperty&&null!==t.otherProperty&&void 0!==t.otherProperty&&(e.otherProperty=t.otherProperty),e.layer=this.layer,this.layer.entities.add(e)})},e.prototype.manualRaiseClusterEvent=function(e=2e3){setTimeout(()=>{this.layer.clustering._cluster(1)},e)},e.prototype.setCanvasClusterEvent=function(){this.layer.clustering.clusterEvent.addEventListener((e,t)=>{this.unClusterLayer&&this.unClusterLayer.entities.removeAll(),t.label.show=!1,t.layer=this.layer,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=Y.VerticalOrigin.BOTTOM,t.billboard.disableDepthTestDistance=Number.POSITIVE_INFINITY;let i=null;switch(this.style.type){case 0:i=this.getCluserCanvasImage(e.length);break;case 1:i=this.getCluserCanvasImage2(e.length)}t.billboard.image=i})},e.prototype.unClusterFn=function(e){e.primitive.show=!1,e.id.forEach(e=>{this.unClusterLayer.entities.add(e)})},e.prototype.getCluserCanvasImage=function(e){var t,i,n,r;return this.cluserCanvasImages[e]||((t=document.createElement("canvas")).width=t.height=i=12*(e+"").length+50,(n=t.getContext("2d")).beginPath(),n.globalAlpha=.5,n.fillStyle=this.getCluseColor(e),n.arc(i/2,i/2,i/2-5,0,2*Math.PI),n.fill(),n.beginPath(),n.globalAlpha=.8,n.fillStyle=this.getCluseColor(e),n.arc(i/2,i/2,i/2-10,0,2*Math.PI),n.fill(),n.font="20px alpht",n.globalAlpha=1,n.fillStyle="rgb(255,255,255)",r=i/2-12*e.toString().length/2,n.fillText(e,r,i/2+7),this.cluserCanvasImages[e]=t)},e.prototype.getCluserCanvasImage2=function(e){if(this.cluserCanvasImages[e])return this.cluserCanvasImages[e];var t=document.createElement("canvas"),i=12*(e+"").length+50,n=(t.width=t.height=i,t.getContext("2d")),r=(n.translate(i/2,i/2),n.fillStyle=this.getCluseColor(e),Math.PI/2),o=Math.PI/6;let a,s=0;for(let e=0;e<3;e++)n.beginPath(),n.moveTo(0,0),n.globalAlpha=.5,a=s+o,s=a+r,n.arc(0,0,i/2-5,a,s),n.closePath(),n.fill();n.beginPath(),n.moveTo(0,0),n.globalAlpha=1,n.arc(0,0,i/4,0,2*Math.PI),n.fill(),n.translate(-i/2,-i/2),n.font="20px alpht",n.globalAlpha=1,n.fillStyle="rgb(255,255,255)";var l=i/2-12*e.toString().length/2;return n.fillText(e,l,i/2+7),this.cluserCanvasImages[e]=t},e.prototype.getCluseColor=function(t){for(let e=0;e<this.style.cluserColors.length;e++){var i=this.style.cluserColors[e];if(t>=i.value)return i.color}},e.prototype.updateStyle=function(e){this.style=r(this.style,e),this.layer.clustering.pixelRange=this.style.pixelRange,this.layer.clustering.minimumClusterSize=this.style.minimumClusterSize},e.prototype.setType=function(e){this.style.type=e},e.prototype.setSelectById=function(e,t){this.layer&&(e=this.layer.entities.getById(e))&&(e.billboard.image=t?this.style.selectImage:this.style.image)},e.prototype.getEntityById=function(e){return this.layer.entities.getById(e)},e.prototype.clear=function(){this.cluserCanvasImages={},this.layer&&this.layer.entities.removeAll()},Y.Scene.ClusterLayer=e}},_installBar3DLayer:function(){if(this._viewer){const t=this._viewer,i={duration:2e3,loop:!1,boxWidth:4e4,boxDepth:4e4,icon:!0,iconUrlArr:[],labelShow:!0,label:{font:"bold 24px Arial",fillColor:Y.Color.WHITE,showBackground:!0,verticalOrigin:Y.VerticalOrigin.BOTTOM,pixelOffset:new Y.Cartesian2(0,0)},billboard:{width:25,height:25,pixelOffset:new Y.Cartesian2(-35,0)}};function e(e){this.barLayer=null,this.config=function i(n,r){return"object"!=typeof n&&(n={}),Array.isArray(r)?r.slice():(Object.keys(r).forEach(e=>{var t=r[e];n[e]="object"==typeof t?i(n[e],t):t}),n)}(i,e||{}),this._init()}e.prototype._init=function(){this.barLayer=new Y.CustomDataSource("threeDimensionalBarLayer"),t.dataSources.add(this.barLayer)},e.prototype._findWeight=function(e){return{max:Math.max(...e),min:Math.min(...e)}},e.prototype._limitNumberWithinRange=function(e,t,i){t=t||1,i=i||20,e=parseInt(e);return Math.min(Math.max(e,t),i)},e.prototype.addDataToLayer=function(e){const{barData:t,numField:o="count",multiple:a}=e,{max:s,min:l}=this._findWeight(t.map(e=>e[o]));let c=this.config.iconUrlArr;0<c.length&&c.length<3&&(c.length<2?(c[1]=c[0],c[2]=c[0]):c.length<3&&(c[2]=c[0]));const h=(s-l)/2;t.forEach((e,t)=>{var i=e[o];let n=null;this.config.icon&&(n=e.iconUrl||(i>=s?c[0]||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADK0lEQVR4AdSWXUhTYRjHt1lK7eSmsyzNpbVZmYGLvBiU7SJlE2cXijd9SkVGSXXTVZQpInSRECGBSDgwpDApByGiWyEOolxYSpmIUtqXWXO6TWmz/5sxd96Z7p1t0fj/9n6cPef5v+/Oec4RCf7x57808ACb9gW8A2VgWWLdATGy5XfV1Nj6DAa3IjExB+OHIGixGlhLMqnT0rZsl8s3vW1oUEs5LgVz10FQCsqAb6by4mI7xheAAjCL1UA8naG0oEAdLRb3Yl4HmMVqIEEkFI7TWQqzssYwdxAwi9mAhOPI1c9LdEKvX4+JjYBZrAZkioSECTrLNrmcGCCsoY8tNWY1EJeekuKhTxrDcRKhUDiJeXJHoAlctAFSWGYRTnMbc7lgnUqpjETrp9VRUR8xmQ9KwRFwAGiACmwGMrAC8EQbuGLNyHlBky2Nz0DU/Ty1WkSuevT9lJ2Z+UGjUu3fpVQWoUCVbJDJLmFnbqyKimpcGRFhxsXbLxQIRhBIFolmTqK5Zv47ZkVkBg05WqjRWFqqqsiKyNCP5ooKjam6et/z2to9pECNNjXtHjcadzpaW1Nn2tuT3CZTbHNl5WiESFTiG+xnwPfg3+4bLZavbo+nw/e8YTVwp62N3Cm3gjKA/w/yDWXrN3Z0WBzT0zsQ9QR4FfAOzAoEkDeOubNVLv/1IEMg7zoK2AAClyWT1foZJ3gKzMCrgA1g/yFvHHPncl1dLIKuAZ4CNsCLYhzcNZm6p1wuUsCa6NCwGFAmJUUjMamGyWh5CouBlq4uUqbfIPMQ4CksBirq68nKL/Iy/x6E3EC5wdD5w+0eRr4FX15DbuDV4KAbyckrGxp/hdyAyWqV+KednwmpgaKyssdjNht5lN+cT8nv+RmY8bgH+D+ZG2ElUple3wN6Y/X6Pmle3mvQL8nNHQCD0TrdEKfTDXNa7XuxVjtCuGc2xyF6L3gJFhRt4Gpq9yNF8jOjwJe27596sJLz43b7OXD2m91+xjY5eRqcmnA4ToLjdqezeMrpPIaCc9jhch0iIGM66AR/FG2AvK2QkktzFGcgNZwVhC0u2sDivw7i6FIhPwEAAP//c8uOZAAAAAZJREFUAwAS2vhBEdJeLwAAAABJRU5ErkJggg==":i>=i*(h/i/100)?c[1]||"data:image/png;base64,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":c[2]||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFCElEQVR4AexWWUjuVRCfz12v+5L7mqKmoqaCae744oJL+qKiSQgRET710Ms1CALlopIP6oNJoiCICylCoJQhKmIppKLmVi647+un2PzO9f/xrZp1I4r78c2ZOefMnPmdOXPm/PXoX/69BvDfikBFRYVlXV3dIPM7UHV19XF9ff1QS0vLj5WVlTdVVVXyhoaG35+SVn8qAo2NjWWtra0dJiYm27u7u0kREREEsrS0tDg6OopbW1t718XFRT8gIMBgc3PTrba2dpeBHjQ1Nf3S1tbW8hCgRwHU1NTMbmxsNC4sLLx3eXlpHBcXJ5wDAPfJ1taWcnJyKDk5mXx8fMjU1JSOj4/t2Kn1zc1N0MrKShEDOuvu7n6LxzT+DwJg9OOHh4cBcObp6Un29vYUGBhI+C0tLdHOzg4BEEcCQzQ8PCx08vPzKTc3lzIyMqigoICMjIzMtre3vxNKao1OAO3t7c/n5+cjo6KiKDw8nDjM5OzsrDDnOXJ3dyfJ+cTEBO3v71NMTIxiDMrsnMLCwoij6NrZ2ZmPMWXSCYDP+n0+V+EcO729vSVEQTI+PT0lV1dXqSsAQt/KykoxJgmwMzMzI7b5SBqTuE4ArOzs4eFB19fXdHJyIvT39vawEyFfXFzQs2fPhIxma2uLbGxsIGolJycnrOOvPqkVAF8xS3ZgzIlHzc3NNDg4KOxGRkaot7eXenp6iOdFwokJHQ2OBYRpgON8egOyMmkA6Orqem5tbb0rk8mIuTjTzMxMKi0tJSRXQkKCcI5FFhcXwXQSbsn09LSYBwC5XK7Pm3tbDNw3KgD6+vqcVldXPzM2NjYsLi6mlJQUCg4OFslnaGgoQuzv70/x8fGkp6dHrHu/zEvGDl4K9y2iJOUE1xAxam5u7iCE+0YFACfbxxwmIzhgEPcqmgzJhqQ6Pz+nmZkZoYDryYkrZKm5uroSdULqg7OdKbhEKgB4B++gsCBckoI2fnBwQAivo6MjjY2NERLQy8tL1AXIsEFNWF9f1wDAhcoM8xKpAEDlcnBQiZC425IyOJwPDAyII4iOjhZ3HknZ399PvAGRoFxDCGfv6+tLQUFBMFOQgYHBgwBkrKBQhoBEa+ab0NHRQSBOUkI+JCUlESKQnp5OsbGxojyj+qFqhoaGUlpamijPWEOZuDCZKfdVIsDF5pIfF+V5CgkJocTERELygSBnZWURigsUkVzYJRyjVIPzo0Rubm6YVhDyBR2uHXPgEqkA4MlulFyUVEkBDnC+AALCgyPNPYVLG+PkHlW2UwFwdnb2Ql9f/255eVlZ55XIfLvIwsJCnpqaeqS8oAqA8vLy3zh0P09NTRHKrrLi35ERfv5OIL6C++rrqADAJJ9zKlfAk8nJSXRfCc3OzhJAcI7Uqi+oAYCf033O7s+R/VIdVzd6Sh+OAYBfziUu5V+q22oAgAIrvvDz8+sGABDG/iqNj4+L3dvZ2X2hbQ2tAKBYWFiY4+3t/QMAjI6O7vDYxN3d3a/Mt5lfMX/0z59jNDc3R1yQerlGfK3NQCcAKJeUlCSycR8/PB9w/Y/kMPoxd2Ruwl84RqzjwNXTlwFFyGSyJObZzEuYf8JPecPQ0BA+WpaKiooyWVfr/0EAsGDjjOzs7G8hK1NkZKScwezyR8siA/qJP9e+Z97D/BvmXyUkJHzI4KvKysreVLZTlx8FoG7wlH5eXt6nj+n/owAec475/z8A7PIh+gMAAP//rzDbCQAAAAZJREFUAwDEKgBfgUOdbAAAAABJRU5ErkJggg=="));var r=i>h?i*(h/i/100):(h-i)/100*5,r=Y.defined(a)?a:this._limitNumberWithinRange(r,l,h);this._add3DBarWithIcon({id:e.name+t,value:i,color:e.color,imgSrc:n,position:e.center,weight:r})})},e.prototype.clear=function(){this.barLayer&&this.barLayer.entities.removeAll()},e.prototype._add3DBarWithIcon=function({id:e,value:t,color:i,imgSrc:n,position:r,weight:o=1}){const a=this,s=a.barLayer.entities.getById(e+"-icon"),l=(s&&a.barLayer.entities.remove(s),a.config.boxWidth),c=a.config.boxDepth,h=t*o;let u=0,d=0,p;p=i instanceof Y.Color?i:Y.Color.fromCssColorString(i).withAlpha(.85),a.barLayer.entities.add({id:e+"-bar",name:"3DBar",position:new Y.CallbackProperty(function(){return Y.Cartesian3.fromDegrees(r[0],r[1],d/2)},!1),box:{dimensions:new Y.CallbackProperty(function(){return new Y.Cartesian3(l,c,d)},!1),material:p,outline:!1},show:!0});o=i instanceof Y.Color?i:Y.Color.fromCssColorString(i).withAlpha(.7);a.config.labelShow&&a.barLayer.entities.add({id:e+"-label",position:new Y.CallbackProperty(function(){return Y.Cartesian3.fromDegrees(r[0],r[1],d+3e3)},!1),label:{text:t+"",backgroundColor:o,...a.config.label},show:!0}),a.config.icon&&a.barLayer.entities.add({id:e+"-icon",position:new Y.CallbackProperty(function(){return Y.Cartesian3.fromDegrees(r[0],r[1],d+22e3)},!1),billboard:{image:n,...a.config.billboard},show:!0}),function e(){d=u+=a.config.duration,(a.config.loop||u<h)&&requestAnimationFrame(e)}()},Y.Scene.ThreeDimensionalBar=e}},transformJD(e,t){t=300+e+2*t+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return(t+=2*(20*Math.sin(6*e*Q)+20*Math.sin(2*e*Q))/3)+2*(20*Math.sin(e*Q)+40*Math.sin(e/3*Q))/3+2*(150*Math.sin(e/12*Q)+300*Math.sin(e/30*Q))/3},transformWD(e,t){var i=2*e-100+3*t+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return(i+=2*(20*Math.sin(6*e*Q)+20*Math.sin(2*e*Q))/3)+2*(20*Math.sin(t*Q)+40*Math.sin(t/3*Q))/3+2*(160*Math.sin(t/12*Q)+320*Math.sin(t*Q/30))/3},gcj2wgs(e){var t=Number(e[0]),e=Number(e[1]),i=this.transformWD(t-105,e-35),n=this.transformJD(t-105,e-35),r=e/180*Q,o=Math.sin(r),o=1-J*o*o,a=Math.sqrt(o),i=180*i/(K*(1-J)/(o*a)*Q),o=2*t-(t+180*n/(K/a*Math.cos(r)*Q)),t=2*e-(e+i);return[o=Number(o.toFixed(6)),t=Number(t.toFixed(6))]},wgs2gcj(e){var t=Number(e[0]),e=Number(e[1]),i=this.transformWD(t-105,e-35),n=this.transformJD(t-105,e-35),r=e/180*Q,o=Math.sin(r),o=1-J*o*o,a=Math.sqrt(o),e=e+180*i/(K*(1-J)/(o*a)*Q),i=t+180*n/(K/a*Math.cos(r)*Q);return[i=Number(i.toFixed(6)),e=Number(e.toFixed(6))]},transformData(s,l,e){for(var c=this,h=e.paths,u=[],t=0;t<h.length;t++)!function(e){for(var t=h[e],i=[],n=[],e=t.distance,r=0;r<t.steps.length;r++){var o=t.steps[r],a=t.steps[r].instruction;o.polyline.split(";").forEach(function(e){e=e.split(","),e=c.gcj2wgs(e),i.push([e[0],e[1]])}),n.push(a)}i.unshift(s),i.push(l),u.push({lnglats:i,instructions:n,distance:e})}(t);return u},_queryDrivingRoute(e,i,n,r){if((i=i||{}).origin)if(i.destination){var o=i.key||this._queryRouteKey,a=(delete i.key,i.origin),s=(s=this.wgs2gcj(a))[0]+","+s[1],l=(delete i.origin,i.destination),c=(c=this.wgs2gcj(l))[0]+","+c[1],h=(delete i.destination,"");if(i.avoidpolygons)for(var u=0;u<i.avoidpolygons.length;u++){for(var d=i.avoidpolygons[u],p="",m="",g=0;g<d.length;g++){var f=d[g];m+=(f=this.wgs2gcj(f))[0]+","+f[1]+",",0==g&&(p=f[0]+","+f[1])}m+=p,u==i.avoidpolygons.length-1?h+=m:h+=m+"|"}delete i.avoidpolygons;var A={key:o,origin:s,destination:c,strategy:0,avoidpolygons:h,show_fields:"polyline"},A=Object.assign(A,i||{}),y=this;let t="";Object.keys(A).map(e=>{t+=t?`&${e}=`+A[e]:`?${e}=`+A[e]}),fetch(e+t).then(function(e){return e.json()}).then(function(e){"1"!=e.status||"10000"!=e.infocode?(console.log("查询失败!"),r&&r(e)):(e=y.transformData(a,l,e.route),n&&n(e))})}else alert("缺少终点坐标!");else alert("缺少起点坐标!")},queryPathPlan(e,t,i,n){let r;e===Z.routeQueryType.DRIVE?(r=t.url||"https://restapi.amap.com/v5/direction/driving",delete t.url,this._queryDrivingRoute(r,t,i,n)):e===Z.routeQueryType.WALK?(r=t.url||"https://restapi.amap.com/v3/direction/walking",delete t.url,this._queryWalkCycleRoute(r,t,i,n)):e===Z.routeQueryType.CYCLE?(r=t.url||"https://restapi.amap.com/v5/direction/bicycling",delete t.url,this._queryWalkCycleRoute(r,t,i,n)):alert("查询参数type 错误(walk:步行,cycle:骑行)!")},_queryWalkCycleRoute(e,i,n,r){if((i=i||{}).origin)if(i.destination){var o,a=i.key||this._queryRouteKey,s=(delete i.key,i.origin),l=(this.wgs2gcj(s),s[0]+","+s[1]),c=(delete i.origin,i.destination),h=(this.wgs2gcj(c),c[0]+","+c[1]),u=(delete i.destination,{key:a,origin:l,destination:h,show_fields:"polyline"}),u=Object.assign(u,i||{}),d=this;let t="";Object.keys(u).map(e=>{t+=t?`&${e}=`+u[e]:`?${e}=`+u[e]}),fetch(e+t).then(function(e){return e.json()}).then(function(e){e.hasOwnProperty("errcode")?0!=e.errcode||"OK"!=e.errmsg?(console.log("查询失败!",e.errdetail),r&&r(e)):(o=d.transformData(s,c,e.data),n&&n(o)):e.hasOwnProperty("status")?"1"!=e.status||"10000"!=e.infocode?(console.log("查询失败!",e.info),r&&r(e)):(o=d.transformData(s,c,e.route),n&&n(o)):(console.log("查询失败,未知错误!"),r&&r(e))})}else alert("缺少终点坐标!");else alert("缺少起点坐标!")}};let $=null;function ee(e,t,i){e&&($=t,this._analysisLayer=new $.CustomDataSource("analysisLayer"),f.prototype={...f.prototype,...p.prototype},s.prototype={...s.prototype,...p.prototype},this.$math3d=new f(e,t),this.$graphics=new s(e,t),e)&&e.dataSources.add(this._analysisLayer)}function te(e){if(e&&e.positions){var t=e.positions,i=e.that,n=[],e=[],r=[],o=i.transformWGS84ToCartesian(t[0]),t=i.transformWGS84ToCartesian(t[1]),n=i.$graphics.createPointsGraphics({point:!0,positions:[o,t]}),a=i.$math3d.getIntersectObj(o,t,n,!0);if(0===a.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;for(let e=a.length-1;0<=e;e--){const l=a[e];$.defined(l.position)||a.splice(e,1)}if(!$.defined(a[0].position))throw new $.DeveloperError("position is undefined");var s=a[0].position,l=$.Cartesian3.distance(s,t)<5,s=[o,a[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:$.ArcType.NONE,material:new $.PolylineArrowMaterialProperty($.Color.GREEN)}});e.push(s),l||(s=[a[0].position,t],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:$.ArcType.NONE,material:new $.PolylineArrowMaterialProperty($.Color.RED)}}),e.push(s));for(let e=0;e<a.length;++e){var c,h=a[e].object;h&&(h instanceof $.Cesium3DTileFeature?(r.push(h),h.oldColor=h.color.clone(),h.color=$.Color.fromAlpha($.Color.YELLOW,h.color.alpha)):h.id instanceof $.Entity&&(c=(h=h.id).polygon||h.polyline,r.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=$.Color.fromAlpha($.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:a[e].position,ellipsoid:{radii:new $.Cartesian3(.8,.8,.8),material:$.Color.RED}}))}var s=$.Cartographic.fromCartesian(o),e=$.Cartographic.fromCartesian(t),s={longitude:s.longitude/Math.PI*180,latitude:s.latitude/Math.PI*180,height:s.height},e={longitude:e.longitude/Math.PI*180,latitude:e.latitude/Math.PI*180,height:e.height},o=Math.sqrt(Math.pow(o.x-t.x,2)+Math.pow(o.y-t.y,2)+Math.pow(o.z-t.z,2)),t=Math.abs(e.height-s.height),u=Math.sqrt(Math.pow(o,2)+Math.pow(t,2)),l=l?"是":"否",s="起点坐标: ("+s.longitude.toFixed(6)+"°,"+s.latitude.toFixed(6)+"°,"+s.height.toFixed(2)+")\n终点坐标: ("+e.longitude.toFixed(6)+"°,"+e.latitude.toFixed(6)+"°,"+e.height.toFixed(2)+")\n垂直距离: "+t.toFixed(2)+"m\n水平距离: "+o.toFixed(2)+"m\n空间距离: "+u.toFixed(2)+"m\n是否可视: "+l;n&&n[0]&&(n[0].label={text:s,showBackground:!0,font:"14px monospace",fillColor:$.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:$.VerticalOrigin.BOTTOM,horizontalOrigin:$.HorizontalOrigin.LEFT})}te.prototype.remove=function(){}}function ie(e){if(!e&&!e.center&&!e.radius&&e.that)return alert("没有获取到分析参数"),!1;var l=e.that,t=this;if(!l._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var c=e.viewHeight||10,i=$.Cartographic.fromCartesian(e.center);try{var n=e.radius,r={},o=(r.semiMinorAxis=n,r.semiMajorAxis=n,r.rotation=0,r.center=e.center,r.granularity=Math.PI/30,l.computeEllipseEdgePositions(r));for(let e=0;e<o.outerPositions.length;e+=3){var a=new $.Cartesian3(o.outerPositions[e],o.outerPositions[e+1],o.outerPositions[e+2]),s=$.Cartographic.fromCartesian(a),h=5e-4*Math.PI/180,u=l.computeInterpolateLineCartographic(i,s,h);l.computeCartographicPointsTerrainData(u,function(o){if(0<o.length){let i=!0,n=[],r=[];for(let e=1;e<o.length;e++){let t=!0;if(1<e){var a=new $.Cartographic(o[0].longitude,o[0].latitude,o[0].height+c);if(i)t=l.computeInterpolateIndexLineHeightCartographic(a,o[e],e,e-1).height>=o[e-1].height?i=!0:i=!1;else{var s=l.computeInterpolateIndexLineHeightCartographic(a,o[e],e,e-1);for(let e=0;e<s.length;e++){if(!(s[e].height>=o[e].height)){i=!1,t=!1;break}i=!0,t=!0}}}a=$.Cartesian3.fromRadians(o[e].longitude,o[e].latitude,o[e].height+1);n.push(a),t?(r.push(0),r.push(0),r.push(1)):(r.push(1),r.push(0),r.push(0)),r.push(1)}t._pointsKSYResult=new $.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:r})}else alert("高程异常!")})}}catch(e){console.log(e)}ie.prototype.remove=function(){}}function ne(e){if(e&&e.positions){for(var t=e.positions,i=e.that,r=i.transformWGS84ToCartesian(t[0]),o=i.transformWGS84ToCartesian(t[1]),a=[$.Cartographic.fromCartesian(r)],s=new $.Cartesian3,l=[0],c=[0],h=1;h<=10;h++){$.Cartesian3.lerp(r,o,h/10,s);var u=$.Cartographic.fromCartesian(s),d=i._viewer.scene.globe.getHeight(u),d=(u.height=d,a.push(u),a[h-1]),p=$.Cartesian3.distance($.Cartographic.toCartesian(d),$.Cartographic.toCartesian(u));c.push(c[h-1]+p),u=Math.asin((u.height-d.height)/p),l.push(100*Math.tan(u))}e=document.createElement("div"),t=(e.className="echart-viewer",i._viewer.container.appendChild(e,"dark",{renderer:"canvas",width:640,height:480}),e.style.position="absolute",e.style.left="20px",e.style.bottom="20px",e.style.height="300px",e.style.width="640px",e.style.overflow="hidden",e.style.zIndex="9999",{title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!(e.style.opacity=.9),feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0,xAxis:[{type:"category",name:"长度(米)",boundaryGap:!1,data:c,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"坡度(%)",axisLabel:{formatter:function(e){return e.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"坡度",type:"line",areaStyle:{},smooth:!0,data:l,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]});n.init(e).setOption(t)}}function re(e){if(e&&e.positions&&e.that){var t=e.that,e=e.positions,i=this;if(t._viewer.terrainProvider.availability){var n=Math.PI/Math.pow(2,11);n/=64;var r,o,a,s,l,c,h,u,n=new $.PolygonGeometry.fromPositions({positions:e,vertexFormat:$.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:n}),d=new $.PolygonGeometry.createGeometry(n),p=0,m=0,g=new $.Cartesian3;for(let e=0;e<d.indices.length;e+=3){h=d.indices[e],o=d.indices[e+1],l=d.indices[e+2],c=d.attributes.position.values,g.x=c[3*h],g.y=c[3*h+1],g.z=c[3*h+2],h=$.Cartographic.fromCartesian(g),r=t._viewer.scene.globe.getHeight(h),a=$.Cartesian3.fromRadians(h.longitude,h.latitude,r),u=$.Cartesian3.fromRadians(h.longitude,h.latitude,0),m<r&&(m=r),g.x=c[3*o],g.y=c[3*o+1],g.z=c[3*o+2],h=$.Cartographic.fromCartesian(g),o=t._viewer.scene.globe.getHeight(h),s=$.Cartesian3.fromRadians(h.longitude,h.latitude,o),A=$.Cartesian3.fromRadians(h.longitude,h.latitude,0),m<o&&(m=o),g.x=c[3*l],g.y=c[3*l+1],g.z=c[3*l+2],h=$.Cartographic.fromCartesian(g),c=t._viewer.scene.globe.getHeight(h),l=$.Cartesian3.fromRadians(h.longitude,h.latitude,c),m<c&&(m=c),u=u,A=A,h=$.Cartesian3.fromRadians(h.longitude,h.latitude,0),u=((f=$.Cartesian3.distance(u,A))+(A=$.Cartesian3.distance(A,h))+(h=$.Cartesian3.distance(h,u)))/2,p+=Math.sqrt(u*(u-f)*(u-A)*(u-h))*(r-15e3+o-15e3+c-15e3)/3;var f=[],A=(f.push(a),f.push(s),f.push(l),{polygon:{hierarchy:{positions:f},extrudedHeight:0,perPositionHeight:!0,material:$.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:$.Color.WHITE,outlineWidth:2}});t._analysisLayer.entities.add(A)}n=function(e){for(var t=[],i=[],n=0;n<e.length;n++){var r=$.Cartographic.fromCartesian(e[n]);t.push(r.longitude),i.push(r.latitude)}for(var o,a,s,l=0,c=0,h=0,u=0,d=0,n=0;n<e.length;n++)h+=s=(o=t[n])*(c=n==e.length-1?(l=t[0],i[0]):(l=t[n+1],i[n+1]))-l*(a=i[n]),u+=(o+l)*s,d+=(a+c)*s;return u/=6*(h*=.5),d/=6*h,new $.Cartographic(u,d)}(e),i._volumeLabel=t._analysisLayer.entities.add({position:$.Cartesian3.fromRadians(n.longitude,n.latitude,m+1e3),label:{text:"Cut Volume "+p.toString()+"m3"}})}else alert("未获取到地形")}}ee.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new te({positions:e,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(t),"function"==typeof i.callback&&i.callback(e)}})},createLookAroundAnalysis:function(i){var n;i=i||{},this._viewer&&i&&(n=this).drawCircleGraphics({callback:function(e,t){n._drawLayer.entities.remove(t);t=new ie({that:n,radius:e.radius,center:e.center});"function"==typeof i.callback&&i.callback(t)}})},createVisualFieldAnalysis:function(e){var i,n;e=e||{},this._viewer&&e&&(n=null,(i=this).bindHandelEvent({leftClick:function(e,t){e=i._viewer.scene.pickPosition(e.position);if(!e)return!1;$.defined(n)?t.destroy():(n=new $.Scene.ShadowPrimitive({scene:i._viewer.scene,viewerPosition:e}),i._analysisLayer._primitives.add(n))},mouseMove:function(e){e=i._viewer.scene.pickPosition(e.endPosition);if(!e)return!1;n&&n.setPoseByTargetPoint(e)}}))},createClipPlanAnalysis:function(i){var n,r,o,a,s;i=i||{},this._viewer&&i&&(n=this,r=i.height||30,o=i.splitNum||50,a=i.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",s=i.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg",n.drawPolygonGraphics({callback:function(e,t){n._drawLayer.entities.remove(t);t=new $.Scene.TerrainClipPlan(n._viewer,{height:r,splitNum:o,wallImg:a,bottomImg:s}),e=n.transformWGS84ArrayToCartesianArray(e);t.updateData(e),"function"==typeof i.callback&&i.callback(t)}}))},createSubmergedAnalysis:function(e){var t,n,r,o,a;e=e||{},this._viewer&&e&&(t=this,n=e.maxH||15,r=e.speed||1,o=e.interval||10,a=e.matrialUrl||this.getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png",t.drawPolygonGraphics({height:1,callback:function(e,i){if(!t._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;i&&setTimeout(()=>{i.polygon.heightReference="CLAMP_TO_GROUND",i.polygon.material=a;var e=0,t=(i.polygon.extrudedHeight=e,setInterval(function(){(e+=r)>=n&&(e=n,clearTimeout(t)),i.polygon.extrudedHeight=e},o))},2e3)}}))},createSlopeAnalysis:function(i){if(i=i||{},!n)return alert("需要引入echarts库"),!1;var r=this;this._viewer&&i&&r.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new ne({positions:e,that:r});r._graphicsLayer&&r._graphicsLayer.entities.remove(t),"function"==typeof i.callback&&i.callback(e)}})},createCutVolumeAnalysis:function(t){var i;t=t||{},this._viewer&&t&&(i=this).drawWallGraphics({callback:function(e){e=new re({positions:i.transformWGS84ArrayToCartesianArray(e,100),that:i});"function"==typeof t.callback&&t.callback(e)}})}};var oe={version:"1.0.0",PlotUtils:{}},ae=(oe.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},oe.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=oe.PlotUtils.distance(e[i],e[i+1]);return t},oe.PlotUtils.getBaseLength=function(e){return Math.pow(oe.PlotUtils.wholeDistance(e),.99)},oe.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},oe.PlotUtils.getCircleCenterOfThreePoints=function(e,t,i){var n=[(e[0]+t[0])/2,(e[1]+t[1])/2],t=[n[0]-e[1]+t[1],n[1]+e[0]-t[0]],r=[(e[0]+i[0])/2,(e[1]+i[1])/2],e=[r[0]-e[1]+i[1],r[1]+e[0]-i[0]];return oe.PlotUtils.getIntersectPoint(n,t,r,e)},oe.PlotUtils.getIntersectPoint=function(e,t,i,n){var r,o,a;return e[1]==t[1]?[(r=(n[0]-i[0])/(n[1]-i[1]))*(e[1]-i[1])+i[0],o=e[1]]:i[1]==n[1]?[(a=(t[0]-e[0])/(t[1]-e[1]))*(i[1]-e[1])+e[0],o=i[1]]:(a=(t[0]-e[0])/(t[1]-e[1]),r=(n[0]-i[0])/(n[1]-i[1]),[a*(o=(a*e[1]-e[0]-r*i[1]+i[0])/(a-r))-a*e[1]+e[0],o])},oe.PlotUtils.getAzimuth=function(e,t){var i,n=Math.asin(Math.abs(t[1]-e[1])/oe.PlotUtils.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=n+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=oe.Constants.TWO_PI-n:t[1]<e[1]&&t[0]<e[0]?i=n:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-n),i},oe.PlotUtils.getAngleOfThreePoints=function(e,t,i){e=oe.PlotUtils.getAzimuth(t,e)-oe.PlotUtils.getAzimuth(t,i);return e<0?e+oe.Constants.TWO_PI:e},oe.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},oe.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},oe.PlotUtils.getCubicValue=function(e,t,i,n,r){var o=1-(e=Math.max(Math.min(e,1),0)),a=e*e,s=a*e,l=o*o,c=l*o;return[c*t[0]+3*l*e*i[0]+3*o*a*n[0]+s*r[0],c*t[1]+3*l*e*i[1]+3*o*a*n[1]+s*r[1]]},oe.PlotUtils.getThirdPoint=function(e,t,i,n,r){e=oe.PlotUtils.getAzimuth(e,t),r=r?e+i:e-i,e=n*Math.cos(r),i=n*Math.sin(r);return[t[0]+e,t[1]+i]},oe.PlotUtils.getArcPoints=function(e,t,i,n){for(var r=[],o=(o=n-i)<0?o+oe.Constants.TWO_PI:o,a=0;a<=oe.Constants.FITTING_COUNT;a++){var s=i+o*a/oe.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);r.push([l,s])}return r},oe.PlotUtils.getBisectorNormals=function(e,t,i,n){var r,o,a=oe.PlotUtils.getNormal(t,i,n),s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=a[0]/s,a=a[1]/s,c=oe.PlotUtils.distance(t,i),h=oe.PlotUtils.distance(i,n),s=s>oe.Constants.ZERO_TOLERANCE?oe.PlotUtils.isClockWise(t,i,n)?(r=[i[0]-(o=e*c)*a,i[1]+o*l],[i[0]+(o=e*h)*a,i[1]-o*l]):(r=[i[0]+(o=e*c)*a,i[1]-o*l],[i[0]-(o=e*h)*a,i[1]+o*l]):(r=[i[0]+e*(t[0]-i[0]),i[1]+e*(t[1]-i[1])],[i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])]);return[r,s]},oe.PlotUtils.getNormal=function(e,t,i){var n=e[0]-t[0],e=e[1]-t[1],r=Math.sqrt(n*n+e*e),r=(n/=r,e/=r,i[0]-t[0]),i=i[1]-t[1],t=Math.sqrt(r*r+i*i);return[n+(r/=t),e+(i/=t)]},oe.PlotUtils.getCurvePoints=function(e,t){for(var i=[oe.PlotUtils.getLeftMostControlPoint(t)],n=0;n<t.length-2;n++)var r=t[n],o=t[n+1],a=t[n+2],a=oe.PlotUtils.getBisectorNormals(e,r,o,a),i=i.concat(a);for(var s=oe.PlotUtils.getRightMostControlPoint(t),l=(i.push(s),[]),n=0;n<t.length-1;n++){for(r=t[n],o=t[n+1],l.push(r),e=0;e<oe.Constants.FITTING_COUNT;e++){var c=oe.PlotUtils.getCubicValue(e/oe.Constants.FITTING_COUNT,r,i[2*n],i[2*n+1],o);l.push(c)}l.push(o)}return l},oe.PlotUtils.getLeftMostControlPoint=function(e){var i,n,r,o,a,s=e[0],l=e[1],e=e[2],c=oe.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=oe.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>oe.Constants.ZERO_TOLERANCE?(e=oe.PlotUtils.mid(s,l),r=s[0]-e[0],i=s[1]-e[1],n=2/oe.PlotUtils.distance(s,l),o=c[0]-e[0],c=c[1]-e[1],a=e[0]+((i=-n*i)*i-(n=n*r)*n)*o+(r=2*i*n)*c,e[1]+r*o+(n*n-i*i)*c):(a=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[a,e]},oe.PlotUtils.getRightMostControlPoint=function(e){var i,n,r,o,a,s=e.length,l=e[s-3],c=e[s-2],e=e[s-1],s=oe.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=oe.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>oe.Constants.ZERO_TOLERANCE?(l=oe.PlotUtils.mid(c,e),r=e[0]-l[0],i=e[1]-l[1],n=2/oe.PlotUtils.distance(c,e),o=s[0]-l[0],s=s[1]-l[1],a=l[0]+((i=-n*i)*i-(n=n*r)*n)*o+(r=2*i*n)*s,l[1]+r*o+(n*n-i*i)*s):(a=e[0]+t*(c[0]-e[0]),e[1]+t*(c[1]-e[1]));return[a,l]},oe.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;for(var t=[],i=e.length-1,n=0;n<=1;n+=.01){for(var r=0,o=0,a=0;a<=i;a++){var s=oe.PlotUtils.getBinomialFactor(i,a),l=Math.pow(n,a),c=Math.pow(1-n,i-a);r+=s*l*c*e[a][0],o+=s*l*c*e[a][1]}t.push([r,o])}return t.push(e[i]),t},oe.PlotUtils.getBinomialFactor=function(e,t){return oe.PlotUtils.getFactorial(e)/(oe.PlotUtils.getFactorial(t)*oe.PlotUtils.getFactorial(e-t))},oe.PlotUtils.getFactorial=function(e){if(e<=1)return 1;if(2==e)return 2;if(3==e)return 6;if(4==e)return 24;if(5==e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},oe.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;var t=[],i=e.length-2-1;t.push(e[0]);for(var n=0;n<=i;n++)for(var r=0;r<=1;r+=.05){for(var o=0,a=0,s=0;s<=2;s++){var l=oe.PlotUtils.getQuadricBSplineFactor(s,r);o+=l*e[n+s][0],a+=l*e[n+s][1]}t.push([o,a])}return t.push(e[e.length-1]),t},oe.PlotUtils.getQuadricBSplineFactor=function(e,t){return 0==e?Math.pow(t-1,2)/2:1==e?(-2*Math.pow(t,2)+2*t+1)/2:2==e?Math.pow(t,2)/2:0},oe.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},{version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"}),se="doublearrow",le={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},ce={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};ae.algorithm={},ae.algorithm.doubleArrow=function(e,t){this.connPoint=null;var i={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((a=(this.points=e).length)<2)){if(2==a)return e;var n=this.points[0],r=this.points[1],o=this.points[2],a=e.length,a=(this.tempPoint4=3==a?ae.algorithm.getTempPoint4(n,r,o):this.points[3],this.connPoint=3==a||4==a?oe.PlotUtils.mid(n,r):this.points[4],e=oe.PlotUtils.isClockWise(n,r,o)?(h=ae.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),ae.algorithm.getArrowPoints(this.connPoint,r,o,!0)):(h=ae.algorithm.getArrowPoints(r,this.connPoint,o,!1),ae.algorithm.getArrowPoints(this.connPoint,n,this.tempPoint4,!0)),h.length),s=(a-5)/2,l=h.slice(0,s),c=h.slice(s,5+s),h=h.slice(5+s,a),u=e.slice(0,s),d=e.slice(s,5+s),e=e.slice(5+s,a),u=oe.PlotUtils.getBezierPoints(u),s=oe.PlotUtils.getBezierPoints(e.concat(l.slice(1))),h=oe.PlotUtils.getBezierPoints(h),a=u.concat(d,s,c,h),e=ae.algorithm.array2Dto1D(a);i.controlPoint=[n,r,o,this.tempPoint4,this.connPoint],i.polygonalPoint=t.Cartesian3.fromDegreesArray(e)}return i},ae.algorithm.threeArrow=function(e){this.connPoint=null,this.tempPoint4=null;var t={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(o=(this.points=e).length)){if(2==o)return e;var i=this.points[0],n=this.points[1],r=this.points[2],o=(3==(o=e.length)?(this.tempPoint4=ae.algorithm.getTempPoint4(i,n,r),this.tempPoint5=oe.PlotUtils.mid(r,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=o<6?oe.PlotUtils.mid(i,n):this.points[5],e=oe.PlotUtils.isClockWise(i,n,r)?(c=ae.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),ae.algorithm.getArrowPoints(this.connPoint,n,r,!0)):(c=ae.algorithm.getArrowPoints(n,this.connPoint,r,!1),ae.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),a=(o-5)/2,s=c.slice(0,a),l=c.slice(a,5+a),c=c.slice(5+a,o),h=e.slice(0,a),u=e.slice(a,5+a),e=e.slice(5+a,o),h=oe.PlotUtils.getBezierPoints(h),a=oe.PlotUtils.getBezierPoints(e.concat(s.slice(1))),c=oe.PlotUtils.getBezierPoints(c),o=h.concat(u,a,l,c),e=ae.algorithm.array2Dto1D(o);t.controlPoint=[i,n,r,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},ae.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},ae.algorithm.getArrowPoints=function(e,t,i,n){this.type=se,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var r=oe.PlotUtils.mid(e,t),o=oe.PlotUtils.distance(r,i),a=oe.PlotUtils.getThirdPoint(i,r,0,.3*o,!0),s=oe.PlotUtils.getThirdPoint(i,r,0,.5*o,!0),a=[r,oe.PlotUtils.getThirdPoint(r,a,oe.Constants.HALF_PI,o/5,n),oe.PlotUtils.getThirdPoint(r,s,oe.Constants.HALF_PI,o/4,n),i],r=ae.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=r[0],o=r[4],n=oe.PlotUtils.distance(e,t)/oe.PlotUtils.getBaseLength(a)/2,i=ae.algorithm.getArrowBodyPoints(a,s,o,n),a=i.length,n=i.slice(0,a/2),i=i.slice(a/2,a);return n.push(s),i.push(o),(n=n.reverse()).push(t),(i=i.reverse()).push(e),n.reverse().concat(r,i)},ae.algorithm.getArrowHeadPoints=function(e,t,i){this.type=se,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var n=oe.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],t=(oe.PlotUtils.distance(t,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,o=n*this.neckHeightFactor,n=oe.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),e=oe.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),o=oe.PlotUtils.getThirdPoint(r,n,oe.Constants.HALF_PI,t,!1),n=oe.PlotUtils.getThirdPoint(r,n,oe.Constants.HALF_PI,t,!0);return[oe.PlotUtils.getThirdPoint(r,e,oe.Constants.HALF_PI,i,!1),o,r,n,oe.PlotUtils.getThirdPoint(r,e,oe.Constants.HALF_PI,i,!0)]},ae.algorithm.getArrowBodyPoints=function(e,t,i,n){for(var r=oe.PlotUtils.wholeDistance(e),o=oe.PlotUtils.getBaseLength(e)*n,a=(o-oe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=oe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(o/2-(s+=oe.PlotUtils.distance(e[h-1],e[h]))/r*a)/Math.sin(u),p=oe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=oe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ae.algorithm.getTempPoint4=function(e,t,i){var n,r,o,t=oe.PlotUtils.mid(e,t),a=oe.PlotUtils.distance(t,i),i=oe.PlotUtils.getAngleOfThreePoints(e,t,i),a=i<oe.Constants.HALF_PI?(n=a*Math.sin(i),r=a*Math.cos(i),o=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!1),oe.PlotUtils.getThirdPoint(t,o,oe.Constants.HALF_PI,r,!0)):i>=oe.Constants.HALF_PI&&i<Math.PI?(n=a*Math.sin(Math.PI-i),r=a*Math.cos(Math.PI-i),o=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!1),oe.PlotUtils.getThirdPoint(t,o,oe.Constants.HALF_PI,r,!1)):i>=Math.PI&&i<1.5*Math.PI?(n=a*Math.sin(i-Math.PI),r=a*Math.cos(i-Math.PI),o=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!0),oe.PlotUtils.getThirdPoint(t,o,oe.Constants.HALF_PI,r,!0)):(n=a*Math.sin(2*Math.PI-i),r=a*Math.cos(2*Math.PI-i),o=oe.PlotUtils.getThirdPoint(e,t,oe.Constants.HALF_PI,n,!0),oe.PlotUtils.getThirdPoint(t,o,oe.Constants.HALF_PI,r,!1));return a},ae.algorithm.tailedAttackArrow=function(e,t){e=ae.algorithm.dereplication(e),this.tailWidthFactor=le.tailWidthFactor,this.swallowTailFactor=le.swallowTailFactor,this.swallowTailPnt=le.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(!((i.controlPoint=e).length<2)){if(2==e.length)return i.polygonalPoint=e,i;var n=e[0],r=e[1],e=(oe.PlotUtils.isClockWise(e[0],e[1],e[2])&&(n=e[1],r=e[0]),[oe.PlotUtils.mid(n,r)].concat(e.slice(2))),o=ae.algorithm.getAttackArrowHeadPoints(e,n,r,le),a=o[0],s=o[4],l=oe.PlotUtils.distance(n,r),c=oe.PlotUtils.getBaseLength(e),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=oe.PlotUtils.getThirdPoint(e[1],e[0],0,h,!0);h=ae.algorithm.getAttackArrowBodyPoints(e,a,s,l/c),e=h.length,l=[n].concat(h.slice(0,e/2));l.push(a);c=[r].concat(h.slice(e/2,e));c.push(s),l=oe.PlotUtils.getQBSplinePoints(l),c=oe.PlotUtils.getQBSplinePoints(c),n=ae.algorithm.array2Dto1D(l.concat(o,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=t.Cartesian3.fromDegreesArray(n)}return i},ae.algorithm.getAttackArrowHeadPoints=function(e,t,i,n){this.headHeightFactor=n.headHeightFactor,this.headTailFactor=n.headTailFactor,this.headWidthFactor=n.headWidthFactor,this.neckWidthFactor=n.neckWidthFactor,this.neckHeightFactor=n.neckHeightFactor;var n=oe.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],o=oe.PlotUtils.distance(r,e[e.length-2]),t=oe.PlotUtils.distance(t,i),i=(n=n>t*this.headTailFactor?t*this.headTailFactor:n)*this.headWidthFactor,t=n*this.neckWidthFactor,o=(n=o<n?o:n)*this.neckHeightFactor,n=oe.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),e=oe.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),o=oe.PlotUtils.getThirdPoint(r,n,oe.Constants.HALF_PI,i,!1),n=oe.PlotUtils.getThirdPoint(r,n,oe.Constants.HALF_PI,i,!0);return[oe.PlotUtils.getThirdPoint(r,e,oe.Constants.HALF_PI,t,!1),o,r,n,oe.PlotUtils.getThirdPoint(r,e,oe.Constants.HALF_PI,t,!0)]},ae.algorithm.getAttackArrowBodyPoints=function(e,t,i,n){for(var r=oe.PlotUtils.wholeDistance(e),o=oe.PlotUtils.getBaseLength(e)*n,a=(o-oe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=oe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(o/2-(s+=oe.PlotUtils.distance(e[h-1],e[h]))/r*a)/Math.sin(u),p=oe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=oe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ae.algorithm.dereplication=function(e){var t=e[e.length-1],i=!1,n=[],n=e.filter(function(e){if(e[0]!=t[0]&&e[1]!=t[1])return e;i=!0});return i&&n.push(t),n},ae.algorithm.fineArrow=function(e,t,i){var n,r,o,a,s,l,c;if(!(e.length<2||t.length<2))return n=ce.tailWidthFactor,c=ce.neckWidthFactor,s=ce.headWidthFactor,a=ce.headAngle,l=ce.neckAngle,(r=[])[0]=e,r[1]=t,e=r[0],t=r[1],c=(r=oe.PlotUtils.getBaseLength(r))*c,s=r*s,n=oe.PlotUtils.getThirdPoint(t,e,oe.Constants.HALF_PI,r=r*n,!0),r=oe.PlotUtils.getThirdPoint(t,e,oe.Constants.HALF_PI,r,!1),o=oe.PlotUtils.getThirdPoint(e,t,a,s,!1),a=oe.PlotUtils.getThirdPoint(e,t,a,s,!0),s=oe.PlotUtils.getThirdPoint(e,t,l,c,!1),l=oe.PlotUtils.getThirdPoint(e,t,l,c,!0),(c=[]).push(n[0],n[1],s[0],s[1],o[0],o[1],t[0],t[1],a[0],a[1],l[0],l[1],r[0],r[1],e[0],e[1]),c.some(e=>isNaN(e))?"":i.Cartesian3.fromDegreesArray(c)};let he=null;function ue(e,t){this.viewer=e,he=t,this.handler=new he.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=he.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=ae,this.tooltip=new y(e,t),this.tooltip.initTool()}ue.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},ue.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new he.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let de=null;var pe=function(e,t){ue.call(this,e,t),de=t,this.type="AttackArrow",this.fillMaterial=de.Color.RED.withAlpha(.5)};function me(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}pe.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new de.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){let t=null;t="object"==typeof e?(this.fillMaterial=e.fillMaterial,e.callback):e,this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new de.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){var e=me(e.position,i.viewer);e&&(0==i.positions.length&&(i.floatPoint=i.creatPoint(e),i.floatPoint.wz=-1),i.positions.push(e),e=i.creatPoint(e),2<i.positions.length?e.wz=i.positions.length-1:e.wz=i.positions.length,i.pointArr.push(e))},de.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!i.floatPoint||i.positions.length<2||(e=me(e.endPosition,i.viewer))&&(i.floatPoint.position.setValue(e),i.tooltip.showAtCartesian(e,"右键结束!"),2<=i.positions.length)&&(de.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),i.arrowEntity.objId=i.objId,t&&t(i.objId)))},de.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){e=me(e.position,i.viewer);if(e){for(var t=0;t<i.pointArr.length;t++)i.pointArr[t].show=!1;i.floatPoint.show=!1,i.viewer.entities.remove(i.floatPoint),i.floatPoint=null;e=i.creatPoint(e);e.show=!1,e.wz=i.positions.length,i.pointArr.push(e),i.handler.destroy(),i.handler=null,i.tooltip.setVisible(!1),i.arrowEntity=null}},de.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var n=de.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}for(this.positions=t,i=0;i<this.positions.length;i++){var r=this.creatPoint(this.positions[i]);r.show=!1,r.wz=i+1,this.pointArr.push(r)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new de.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=n.viewer.scene.pick(e.position);if(de.defined(t)&&t.id)n.clickStep++,t.id.objId||(n.selectPoint=t.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null,n.tooltip.setVisible(!1)}2==n.clickStep&&(n.clickStep=0,t=me(e.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.selectPoint=null)},de.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=me(e.endPosition,n.viewer);e&&(n.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),n.selectPoint)&&(n.selectPoint.position.setValue(e),n.positions[n.selectPoint.wz-1]=e)},de.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){e=this.viewer.entities.add({position:e,point:{pixelSize:10,color:de.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(o){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new de.PolygonGraphics({hierarchy:new de.CallbackProperty(function(){if(o.length<3)return null;for(var e=[],t=0;t<o.length;t++){var i=a.cartesianToLatlng(o[t]);e.push(i)}var n=a.xp.algorithm.tailedAttackArrow(e,de),r=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(r=n.polygonalPoint),new de.PolygonHierarchy(r)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=de.Math.toDegrees(e.latitude);return[de.Math.toDegrees(e.longitude),t]}},(pe.prototype=Object.create(Object.assign({},pe.prototype,ue.prototype))).constructor=pe;let fe=null;var ge=function(e,t){ue.call(this,e,t),fe=t,this.type="StraightArrow",this.fillMaterial=fe.Color.fromCssColorString("#0000FF").withAlpha(.8)};function Ae(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}ge.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new fe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){let t=null;t="object"==typeof e?(this.fillMaterial=e.fillMaterial,e.callback):e,this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new fe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=Ae(e.position,i.viewer);e&&(0==i.positions.length&&(i.firstPoint=i.creatPoint(e),i.firstPoint.type="firstPoint",i.floatPoint=i.creatPoint(e),i.floatPoint.type="floatPoint",i.positions.push(e),i.firstPoint.position.setValue(e),i.firstPoint.show=!0),i.positions&&3==i.positions.length&&(i.firstPoint.show=!1,i.floatPoint.show=!1,i.handler.destroy(),i.handler=null,i.tooltip.setVisible(!1),i.arrowEntity=null),i.positions.push(e.clone()))},fe.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){i.positions.length<1||(e=Ae(e.endPosition,i.viewer))&&(i.tooltip.showAtCartesian(e,"左键单击结束!"),i.floatPoint.position.setValue(e),2<=i.positions.length)&&(fe.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),t&&t(i.objId)))},fe.ScreenSpaceEventType.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var i=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new fe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);fe.defined(t)&&t.id?(i.clickStep++,t.id.objId||(i.selectPoint=t.id)):(i.modifyHandler.destroy(),i.modifyHandler=null,i.firstPoint.show=!1,i.floatPoint.show=!1,i.state=-1,i.tooltip.setVisible(!1)),2==i.clickStep&&(i.clickStep=0,t=Ae(e.position,i.viewer))&&i.selectPoint&&i.selectPoint.position&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},fe.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=Ae(e.endPosition,i.viewer);e&&(i.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),i.selectPoint)&&i.selectPoint.position&&(i.selectPoint.position.setValue(e),"firstPoint"==i.selectPoint.type&&(i.positions[1]=e),"floatPoint"==i.selectPoint.type)&&(i.positions[2]=e)},fe.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(e){this.state=-1,this.positions=[];for(var t=[],i=0;i<e.length;i++){var n=fe.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}this.positions=t,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){e=this.viewer.entities.add({position:e,point:{pixelSize:10,color:fe.Color.RED}});return e.attr="editPoint",e},showArrowOnMap:function(a){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new fe.PolygonGraphics({hierarchy:new fe.CallbackProperty(function(){if(a.length<2)return null;var e=a[1],t=a[2],e=s.cartesianToLatlng(e),t=s.cartesianToLatlng(t),i=[],n=s.xp.algorithm.fineArrow([e[0],e[1]],[t[0],t[1]],fe);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var r=0;r<n.length;r++){var o=new fe.Cartesian3(n[r].x,n[r].y,n[r].z);i.push(o)}return new fe.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=fe.Math.toDegrees(e.latitude);return[fe.Math.toDegrees(e.longitude),t]}},(ge.prototype=Object.create(Object.assign({},ge.prototype,ue.prototype))).constructor=ge;let ve=null;var ye=function(e,t){ue.call(this,e,t),ve=t,this.type="PincerArrow",this.fillMaterial=ve.Color.YELLOW.withAlpha(.8)};function we(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}ye.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new ve.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){let t=null;t="object"==typeof e?(this.fillMaterial=e.fillMaterial,e.callback):e,this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=this;this.state=1,this.handler||(this.handler=new ve.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=we(e.position,n.viewer);if(e)if(0==n.positions.length&&(n.floatPoint=n.creatPoint(e)),4<n.positions.length){(i=n.creatPoint(e)).wz=n.positions.length,n.pointArr.push(i);for(var t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!1;n.floatPoint&&(n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null)}else{n.positions.push(e);var i=n.creatPoint(e);2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},ve.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!n.floatPoint||n.positions.length<2||(e=we(e.endPosition,n.viewer))&&(n.floatPoint.position.setValue(e),n.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.positions.length)&&(ve.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(e)):(n.positions.push(e),n.arrowEntity=n.showArrowOnMap(n.positions),n.arrowEntity.objId=n.objId,t&&t(n.objId)))},ve.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){if(4<=n.positions.length){e=we(e.position,n.viewer);if(e){for(var t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;e=n.creatPoint(e);e.show=!1,e.wz=n.positions.length,n.pointArr.push(e),n.handler.destroy(),n.handler=null,n.tooltip.setVisible(!1),n.arrowEntity=null}}},ve.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var n=ve.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}for(this.positions=t,i=0;i<this.positions.length;i++){var r=this.creatPoint(this.positions[i]);r.show=!1,r.wz=i+1,this.pointArr.push(r)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;var i=this;for(let e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new ve.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);if(ve.defined(t)&&t.id)i.clickStep++,t.id.objId||(i.selectPoint=t.id);else{for(let e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!1;i.state=-1,i.modifyHandler.destroy(),i.modifyHandler=null,i.tooltip.setVisible(!1)}2==i.clickStep&&(i.clickStep=0,t=we(e.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},ve.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=we(e.endPosition,i.viewer);e&&(i.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),i.selectPoint)&&(i.selectPoint.position.setValue(e),i.positions[i.selectPoint.wz-1]=e)},ve.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){return this.viewer.entities.add({position:e,point:{pixelSize:10,color:ve.Color.RED},show:!0})},showArrowOnMap:function(o){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new ve.PolygonGraphics({hierarchy:new ve.CallbackProperty(function(){if(o.length<3)return null;for(var e=[],t=0;t<o.length;t++){var i=a.cartesianToLatlng(o[t]);e.push(i)}var n=a.xp.algorithm.doubleArrow(e,ve),r=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(r=n.polygonalPoint),new ve.PolygonHierarchy(r)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=ve.Math.toDegrees(e.latitude);return[ve.Math.toDegrees(e.longitude),t]}},(ye.prototype=Object.create(Object.assign({},ye.prototype,ue.prototype))).constructor=ye;let Ce=null,_e=null;function Pe(e,t,i,n){if(e&&n){const{threeGlobal:i,containerId:r,threeContainerId:o}=n;Ce=t,_e=i,this._viewer=e,this._containerId=r,this._threeContainerId=o,this._Scene=function({THREE:a,Cesium:s,viewer:l}){class e extends a.Scene{constructor(t={}){if(super(),this.type="ThreeCesiumScene",!t.cesiumDom)throw new Error("THREE.ThreeCesiumScene not found cesiumDom.");if(!(t.camera&&t.camera instanceof a.PerspectiveCamera))throw new Error("THREE.ThreeCesiumScene (not found cesiumDom) OR ( not THREE.PerspectiveCamera ).");if(!t.renderer)throw new Error("THREE.ThreeCesiumScene not found THREE.WebGLRender.");this.options=t,this.cesiumViewer=l;var i=("string"==typeof t.cesiumDom?document.getElementById(t.cesiumDom):t.cesiumDom).children[0].children;for(let e=0;e<i.length;e++)0!==e&&(i[e].style.zIndex="100");this.ellipsoid=this.cesiumViewer.scene.globe.ellipsoid,t.threeHabit&&(this.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes=[s.CameraEventType.LEFT_DRAG],this.cesiumViewer.scene.screenSpaceCameraController.zoomEventTypes=[s.CameraEventType.MIDDLE_DRAG,s.CameraEventType.WHEEL,s.CameraEventType.PINCH],this.cesiumViewer.scene.screenSpaceCameraController.rotateEventTypes=[s.CameraEventType.RIGHT_DRAG]),this.camera=t.camera,this.cameraOffset=new a.Vector3,this.renderer=t.renderer,this.lngLat=t.lngLat&&1<t.lngLat.length?t.lngLat:[114.23,31.55],this.cameraCenter=new a.Vector3(0,0,0);var e=new s.EllipsoidGeometry({vertexFormat:s.VertexFormat.POSITION_ONLY,radii:new s.Cartesian3(this.ellipsoid.maximumRadius-1,this.ellipsoid.maximumRadius-1,this.ellipsoid.minimumRadius-1),slicePartitions:1024,stackPartitions:1024}),e=function(e,t){t=t||new a.BufferGeometry;const i=e.attributes;for(const e in i){var n,r;i.hasOwnProperty(e)&&i[e]&&((r=(n=i[e]).values)instanceof Float64Array&&(r=new Float32Array(r)),r=new a.BufferAttribute(r,n.componentsPerAttribute,n.normalize),t.setAttribute(e,r))}if(i.st&&(t.attributes.uv=t.attributes.st,t.deleteAttribute("st")),e.indices){const i=new a.BufferAttribute(e.indices,1,!1);t.setIndex(i)}if(e.boundingSphere){const i=e.boundingSphere;t.boundingSphere||(t.boundingSphere=new a.Sphere),t.boundingSphere.center.copy(i.center),t.boundingSphere.radius=i.radius}return t}(s.EllipsoidGeometry.createGeometry(e)),n=new a.MeshBasicMaterial({color:"#ff00ff",blending:a.MultiplyBlending}),e=new a.Mesh(e,n),n=(t.axesHelper&&e.add(new a.AxesHelper(8e6)),super.add(e),this.sphere=e,new a.Group),e=(super.add(n),this.syncGroup=n,new a.SphereGeometry(this.ellipsoid.minimumRadius,512,256,0,2*Math.PI,3.1,Math.PI-3.1)),r=new a.MeshBasicMaterial({color:"#fff00f",blending:a.MultiplyBlending}),e=new a.Mesh(e,r),r=(e.rotateX(90*Math.PI/180),e.position.z=this.ellipsoid.minimumRadius,new a.Group),o=(r.rotateX(-90*Math.PI/180),r.position.z=-1,this.syncGroup=n,this.childrenGroup=r,this.sunUp=new a.Group,this.sunLightColor=new a.Color,this.sunLightIntensity=1,this.cesiumViewer.scene.light);if(this.sunLightColor.r=o.color.red,this.sunLightColor.g=o.color.green,this.sunLightColor.b=o.color.blue,this.sunLightIntensity=o.intensity,this.sun=new a.DirectionalLight(this.sunLightColor,this.sunLightIntensity),this.sun.castShadow=!0,this.sun.shadow.camera.far=Math.pow(10,14),this.sun.position.set(0,0,2*this.ellipsoid.maximumRadius+1e3),this.sun.target=this.childrenGroup,this.sunUp.add(this.sun),n.add(e),n.add(r),n.add(this.sunUp),this._enableLighting=!1,Object.defineProperty(this,"enableLighting",{get(){return this._enableLighting},set(e){this.cesiumViewer.scene.globe.enableLighting=e,this._enableLighting=e,this.sun.visible=!!e}}),void 0!==t.enableLighting&&null!==t.enableLighting&&(this.enableLighting=t.enableLighting),t.cesiumLayers&&0<t.cesiumLayers.length)for(let e=0;e<t.cesiumLayers.length;e++)this.addImageryProvider(t.cesiumLayers[e].type,t.cesiumLayers[e].option)}renderCesium(){return this.cesiumViewer.render(),this}renderThree(){return this.renderer.render(this,this.camera),this}updateSunMatrix(){var e=this.cesiumViewer.scene.sun._boundingVolume.center,e=this.cartesian3ToVector(e);return this.sunUp.lookAt(e.x-this.cameraOffset.x,e.y-this.cameraOffset.y,-(e.z-this.cameraOffset.z)),this}updateCameraMatrix(){this.camera.fov=s.Math.toDegrees(this.cesiumViewer.camera.frustum.fovy),this.camera.updateProjectionMatrix(),this.camera.matrixAutoUpdate=!1;var e=this.cesiumViewer.camera.viewMatrix,t=this.cesiumViewer.camera.inverseViewMatrix,t=(this.camera.lookAt(this.cameraCenter),this.camera.matrixWorld.set(t[0],t[4],t[8],t[12]-this.cameraOffset.x,t[1],t[5],t[9],t[13]-this.cameraOffset.y,t[2],t[6],t[10],t[14]-this.cameraOffset.z,t[3],t[7],t[11],t[15]),this.camera.matrixWorldInverse.set(e[0],e[4],e[8],e[12]-this.cameraOffset.x,e[1],e[5],e[9],e[13]-this.cameraOffset.y,e[2],e[6],e[10],e[14]-this.cameraOffset.z,e[3],e[7],e[11],e[15]),this.cesiumViewer.scene.canvas.clientWidth),e=this.cesiumViewer.scene.canvas.clientHeight;return this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e),this}updateGroupMatrixWorld(){var e=this.cartesian3ToVector(s.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)),t=this.cartesian3ToVector(s.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],2)),t=(new a.Vector3).subVectors(e,t).normalize();return this.syncGroup.lookAt(t),this.syncGroup.up.copy(t),this.syncGroup.updateMatrix(),this.cameraOffset.copy(e),this.syncGroup.up.set(0,0,-1),this.up.set(0,0,-1),this}update(){this.updateSunMatrix(),this.updateGroupMatrixWorld(),this.updateCameraMatrix(),this.renderThree(),this.renderCesium()}add(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.childrenGroup.add(arguments[e]);else e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this.childrenGroup,this.childrenGroup.children.push(e),e.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e);return this}remove(e){if(1<arguments.length)for(let e=0;e<arguments.length;e++)this.childrenGroup.remove(arguments[e]);else{var t=this.childrenGroup.children.indexOf(e);-1!==t&&(e.parent=null,this.childrenGroup.children.splice(t,1),e.dispatchEvent({type:"removed"}))}return this}clear(){for(let e=0;e<this.childrenGroup.children.length;e++){var t=this.childrenGroup.children[e];t.parent=null,t.dispatchEvent({type:"removed"})}return this.childrenGroup.children.length=0,this}traverse(i){i(this.childrenGroup);var n=this.childrenGroup.children;for(let e=0,t=n.length;e<t;e++)n[e].traverse(i)}traverseVisible(i){if(!1!==this.visible&&!1!==this.childrenGroup.visible){i(this.childrenGroup);var n=this.childrenGroup.children;for(let e=0,t=n.length;e<t;e++)n[e].traverseVisible(i)}}toJSON(t){const e=void 0===t||"string"==typeof t,i={},n=(e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{},options:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}),{});if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(t).uuid),null!==this.fog&&(n.fog=this.fog.toJSON()),this.options){n.options={};for(const t in this.options)["camera","renderer"].includes(t)||(n.options[t]=this.options[t])}if(0<this.childrenGroup.children.length){n.children=[];for(let e=0;e<this.childrenGroup.children.length;e++)n.children.push(this.childrenGroup.children[e].toJSON(t).object)}if(e){const e=r(t.geometries),n=r(t.materials),o=r(t.textures),a=r(t.images),s=r(t.shapes),l=r(t.skeletons),c=r(t.animations),h=r(t.nodes);0<e.length&&(i.geometries=e),0<n.length&&(i.materials=n),0<o.length&&(i.textures=o),0<a.length&&(i.images=a),0<s.length&&(i.shapes=s),0<l.length&&(i.skeletons=l),0<c.length&&(i.animations=c),0<h.length&&(i.nodes=h)}return n.isGIS=!0,i.object=n,i;function r(e){var t=[];for(const n in e){var i=e[n];delete i.metadata,t.push(i)}return t}}dispose(){this.update=()=>{},this.renderCesium=()=>{},this.renderThree=()=>{},this.updateSunMatrix=()=>{},this.updateCameraMatrix=()=>{},this.updateGroupMatrixWorld=()=>{},this.cesiumViewer.destroy()}cartesian3ToVector(e){return new a.Vector3(e.x,e.y,e.z)}}return e.prototype.isScene=!0,e.prototype.isGIS=!0,e}({THREE:_e,Cesium:Ce,viewer:e}),this._initContainer()}}function xe({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:a={},imageryProvider:l={},MapImageryList:u=[],defaultStatic:d,viewer:m}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";var g,y,v;if(i||m)return r=new o(e).init({containerId:i,viewerConfig:r,extraConfig:a,MapImageryList:u,imageryProvider:l,viewer:m}),y=e,v=d,{viewer:g=r,material:(a=function(e,r){var t=null;function i(e){for(var t=Object.keys(e.prototype),i=0,n=t.length;i<n;i++)r.prototype[t[i]]=e.prototype[t[i]]}return Array.isArray(e)?(e.forEach(e=>{i(e)}),t=new r(g,y,v),e.forEach(e=>{e.call(t,g,y,v)})):(i(e),t=new r(g,y,v),e.call(t,g,y,v)),t})([p,h],c),graphics:a(p,s),math3d:a(p,f),math2d:new x(r,e),primitive:a(p,A),draw:a([p,f,x],_),passEffect:a([p,h],S),customCesiumPlugin:a(p,V),control:a(p,q),plugin:a([p,s],Z),base:new p(r,e),analysis:a([p,_,Z],ee),attackArrowObj:new pe(r,e),straightArrowObj:new ge(r,e),pincerArrowObj:new ye(r,e),threeJs:new Pe(r,e,d,t?{threeGlobal:t,containerId:i,threeContainerId:n}:"")};throw"Missing containerId parameter, please check the calling function initCesium."}Pe.prototype={_initContainer:function(){if(this.cesiumContainer=void 0,this.threeContainer=void 0,this.cesiumContainer=document.getElementById(this._containerId),this.threeContainer=document.getElementById(this._threeContainerId),!this.cesiumContainer)return alert("未获取到 cesiumContainer 容器!"),!1;var e;"absolute"!==this.cesiumContainer.style.position&&(this.cesiumContainer.style.position="absolute",this.cesiumContainer.style.top=0,this.cesiumContainer.style.left=0,this.cesiumContainer.style.height="100%",this.cesiumContainer.style.width="100%",this.cesiumContainer.style.margin=0,this.cesiumContainer.style.overflow="hidden",this.cesiumContainer.style.padding=0,this.cesiumContainer.style.fontFamily="sans-serif"),this.threeContainer||(e=document.getElementsByTagName("body")[0])&&(this.threeContainer=document.createElement("div"),this.threeContainer.id=this._threeContainerId,this.threeContainer.style.position="absolute",this.threeContainer.style.top=0,this.threeContainer.style.left=0,this.threeContainer.style.height="100%",this.threeContainer.style.width="100%",this.threeContainer.style.margin=0,this.threeContainer.style.overflow="hidden",this.threeContainer.style.padding=0,this.threeContainer.style.fontFamily="sans-serif",this.threeContainer.style.pointerEvents="none",e.appendChild(this.threeContainer))},initThree:function(e){var t=e.fov||45,i=window.innerWidth,n=window.innerHeight,i=e.aspect||i/n,n=e.near||1,r=e.far||1e7;return this._three={renderer:null,camera:null,scene:null},this._three.camera=new _e.PerspectiveCamera(t,i,n,r),this._three.renderer=new _e.WebGLRenderer({alpha:!0,antialias:!0,logarithmicDepthBuffer:!0,stencil:!0,depth:!0}),this._three.renderer.outputEncoding=_e.sRGBEncoding,this._three.renderer.shadowMap.enabled=!0,this._three.renderer.shadowMap.type=_e.PCFSoftShadowMap,this._three.scene=new this._Scene({cesiumDom:this._containerId,threeHabit:this._objHasOwnProperty(e,"threeHabit",!0),enableLighting:this._objHasOwnProperty(e,"enableLighting",!0),axesHelper:this._objHasOwnProperty(e,"axesHelper",!1),camera:this._three.camera,renderer:this._three.renderer,lngLat:e.center||[104.081701757991,30.627042558105988]}),this.threeContainer&&this.threeContainer.appendChild(this._three.renderer.domElement),this._three},loop(t){function i(){var e=requestAnimationFrame(i);t&&t(e)}i()},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,destroyThreeJS(){this._three.scene.dispose()}};class be{constructor(e){return this.init(e)}init({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:a={},MapImageryList:s=[],defaultStatic:l,baseExtendsCom:c=[],extendsCom:h,extendsComName:u,viewer:d}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";if(i||d)return{viewer:r=new o(e).init({containerId:i,viewerConfig:r,extraConfig:a,MapImageryList:s,viewer:d}),[u]:this.prototypeExtends(r,e,l,t?{threeGlobal:t,containerId:i,threeContainerId:n}:"")(c,h)};throw"Missing containerId parameter, please check the calling function initCesium."}prototypeExtends(n,o,a,s){return function(e,r){var t=null;function i(e){for(var t=Object.keys(e.prototype),i=0,n=t.length;i<n;i++)r.prototype[t[i]]=e.prototype[t[i]]}return Array.isArray(e)?(e.forEach(e=>{i(e)}),t=new r(n,o,a,s),e.forEach(e=>{e.call(t,n,o,a,s)})):(i(e),t=new r(n,o,a,s),e.call(t,n,o,a,s)),t}}}class Se extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:s,extendsComName:"graphics"})}}class Me extends be{constructor(e){return super({...e,baseExtendsCom:[p,h],extendsCom:c,extendsComName:"material"})}}class Ee extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:A,extendsComName:"primitive"})}}class Ie extends be{constructor(e){return super({...e,baseExtendsCom:[p,f,x],extendsCom:_,extendsComName:"draw"})}}class Te{constructor(e){var t=new Ie(e);return this._initCurrMeasure(e,t)}_initCurrMeasure(e,t){var i=new pe(t.viewer,e.cesiumGlobal),n=new ge(t.viewer,e.cesiumGlobal),e=new ye(t.viewer,e.cesiumGlobal);return{...t,attackArrowObj:i,straightArrowObj:n,pincerArrowObj:e}}}class Le extends be{constructor(e){return super({...e,baseExtendsCom:[p,_,Z],extendsCom:ee,extendsComName:"analysis"})}}class De extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:V,extendsComName:"customCesiumPlugin"})}}class ke{constructor(e){return new De(e)}}class Be extends be{constructor(e){return super({...e,baseExtendsCom:[p,h],extendsCom:S,extendsComName:"passEffect"})}}class Ge extends be{constructor(e){return super({...e,baseExtendsCom:[p,s],extendsCom:Z,extendsComName:"plugin"})}}class ze extends be{constructor(e){return super({...e,baseExtendsCom:[],extendsCom:Pe,extendsComName:"threeJs"})}}class Re extends be{constructor(e){return super({...e,baseExtendsCom:p,extendsCom:q,extendsComName:"control"})}}export{Le as Analysis,pe as AttackArrow,Re as Control,ke as CustomCesiumPlugin,Te as Draw,Se as Graphics,Me as Material,x as Math2d,f as Math3d,Be as PassEffect,ye as PincerArrow,Ge as Plugin,Ee as Primitive,ge as StraightArrow,ze as ThreeJs,xe as initCesium};
|