cesium_dev_kit 1.1.20 → 1.1.22
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/LICENSE +21 -21
- 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.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var i=e(require("libgif")),n=require("dat.gui"),r=e(require("echarts"));let o=null;class a{constructor(e){o=e,this.init_data()}init_data(){this.viewer=null}init({containerId:e,viewerConfig:t,extraConfig:i,MapImageryList:n,imageryProvider:r,viewer:a}){var s={contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:o.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0},r=this.findCesiumProvider(r),l=(o.Ion.defaultAccessToken=i.AccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",s=Object.assign(s,t),a||new o.Viewer(e,{...s,...r}));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 o[e.type](e.option)}}}function s(e,t){return null!=e?e:t}s.EMPTY_OBJECT=Object.freeze({});let l=null;function c(e,t,i){e&&(l=t,this._graphicsLayer=new l.CustomDataSource("graphicsLayer"),e)&&e.dataSources.add(this._graphicsLayer)}c.prototype={getPointGraphics:function(e){if(e=e||{})return new l.PointGraphics({color:e.color||l.Color.GREEN,pixelSize:e.pixelSize||5,outlineColor:e.outlineColor||l.Color.WHITE,outlineWidth:e.outlineWidth||1})},getLineGraphics:function(e){if((e=e||{})&&e.positions)return new l.PolylineGraphics({show:!0,positions:e.positions,material:e.material||l.Color.YELLOW,width:e.width||1,arcType:l.ArcType.GEODESIC,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)})},getPolygonGraphics:function(e){if((e=e||{})&&e.positions)return new l.PolygonGraphics({hierarchy:{positions:e.positions},material:e.material||l.Color.RED.withAlpha(.2),clampToGround:e.clampToGround||!1})},getLabelGraphics:function(e){if((e=e||{})&&e.l_text)return new l.LabelGraphics({text:e.l_text,font:e.l_font||"14px sans-serif",fillColor:e.l_fillColor||l.Color.GOLD,style:e.l_style||l.LabelStyle.FILL_AND_OUTLINE,outlineColor:e.l_outlineColor||l.Color.GOLD,outlineWidth:e.l_outlineWidth||2,showBackground:e.l_showBackground||!1,backgroundColor:e.l_backgroundColor||new l.Color(.165,.165,.165,.8),verticalOrigin:e.l_verticalOrigin||l.VerticalOrigin.BOTTOM,pixelOffset:e.l_pixelOffset||new l.Cartesian2(0,-30),heightReference:null!=e.l_heightReference?e.l_heightReference:l.HeightReference.NONE})},getBillboardGraphics:function(e){if((e=e||{})&&e.b_img)return new l.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,eyeOffset:null!=e.b_eyeOffset?e.b_eyeOffset:l.Cartesian3.ZERO,pixelOffset:e.b_pixelOffset||new l.Cartesian2(0,-20),scaleByDistance:e.b_scaleByDistance||void 0,heightReference:null!=e.b_heightReference?e.b_heightReference:l.HeightReference.NONE})},getPathGraphics:function(e){if(e=e||{})return new l.PathGraphics({resolution:e.resolution||1,material:new l.PolylineGlowMaterialProperty({glowPower:e.glowPower||.1,color:e.color||l.Color.YELLOW}),width:e.width||30})},getModelGraphics:function(e){if(e=e||{})return new l.ModelGraphics({uri:e.m_url||e.url,scale:e.m_scale||e.scale||10,clampAnimations:!0})},getEllipseGraphics:function(e){if(e=e||{})return new l.EllipseGraphics({semiMajorAxis:e.e_semiMajorAxis||1e6,semiMinorAxis:e.e_semiMinorAxis||1e6,metarial:e.e_metarial||l.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 l.EllipsoidGraphics({radii:new l.Cartesian3(t,t,t),innerRadii:this._objHasOwnProperty(e,"innerRadii",new l.Cartesian3(t/1.5,t/1.5,t/1.5)),maximumCone:e.maximumCone||l.Math.PI_OVER_TWO,stackPartitions:e.stackPartitions||56,slicePartitions:e.slicePartitions||56,outlineWidth:e.outlineWidth||2,outlineColor:e.outlineColor||l.Color.YELLOW,outline:this._objHasOwnProperty(e,"outline",!0),fill:this._objHasOwnProperty(e,"fill",!0),material:e.material||l.Color.RED.withAlpha(.1)})},getBoxGraphics:function(e){if(e=e||{})return new l.BoxGraphics({show:this._objHasOwnProperty(e,"show",!0),fill:this._objHasOwnProperty(e,"fill",!0),dimensions:e.dimensions||new l.Cartesian3(0,0,0),material:e.material,outline:this._objHasOwnProperty(e,"outline",!0),outlineColor:e.outlineColor||l.Color.BLACK,distanceDisplayCondition:e.distanceDisplayCondition||void 0})},getPlaneGraphics:function(e){if(e=e||{})return new l.PlaneGraphics({plane:e.plane||new l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new l.Cartesian2(170,130),material:e.material||l.Color.BLUE})},getCylinderGraphics:function(e){if(e=e||{})return new l.CylinderGraphics({HeightReference:l.HeightReference.RELATIVE_TO_GROUND,length:e.length||250,topRadius:e.topRadius||0,bottomRadius:e.bottomRadius||0,material:e.material||new l.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 l.Scene.WarnLinkMaterialProperty({freely:"cross",color:l.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||l.Color.CHARTREUSE,width:e.width||5,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)},t.polyline.positions=new l.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 l.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime),e=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=l.Math.toDegrees(e.latitude),e=l.Math.toDegrees(e.longitude);return l.Cartesian3.fromDegrees(e,t,0)},!1),t.cylinder.length=new l.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 l.Scene.CircleFadeMaterialProperty({color:e.color||l.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:l.HeightReference.RELATIVE_TO_GROUND,length:e.length||500,topRadius:e.topRadius||500,bottomRadius:e.bottomRadius||500,material:e.material||new l.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 l.ColorMaterialProperty(new l.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),l.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,a=i.radius||800,s=i.rotateAmount||.05,c=0,h=i.height||1,u=i.scale||null,d=i.scale2||null,i=i.material||new l.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new l.CallbackProperty(function(){return r.transformWGS84ToCartesian(o)},!1),n.orientation=new l.CallbackProperty(function(){return l.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(o),new l.HeadingPitchRoll(l.Math.toRadians(0),l.Math.toRadians(0),l.Math.toRadians(0)))},!1);let e=a,t=!1;return n.ellipse={material:i,height:h,semiMajorAxis:new l.CallbackProperty(function(){return a},!1),semiMinorAxis:new l.CallbackProperty(function(){return a},!1),stRotation:new l.CallbackProperty(function(){return 0<s&&360<=(c+=s)&&(c=0),u&&((t=u<=a||a<=e?!t:t)?a+=2:a-=2),d&&(a<=d?a+=2:a=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||l.Color.RED,r=e.speed||.003,(o=this.createGraphics()).wall={positions:e.positions,material:new l.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new l.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 l.NearFarScalar(150,.7,15e6,.5),verticalOrigin:l.VerticalOrigin.BOTTOM,pixelOffset:t.b_pixelOffset||new l.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 l.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 l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new l.Cartesian2(200,150),material:new l.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 l.Plane(e.normal||l.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new l.Cartesian2(200,150),material:new l.ImageMaterialProperty({image:e.videoElement})},this._graphicsLayer.entities.add(t)},createGifBillboardGraphics:function(e){var t,n,r,o,a,s,c;if(i&&e&&e.position)return n=e.url,r=0,o=n,a=t=[],(s=document.createElement("img")).src=o,s.setAttribute("rel:animated_src",o),s.setAttribute("rel:auto_play","0"),document.body.appendChild(s),c=new i({gif:s}),new Promise(e=>{c.load(()=>{for(let e=1;e<=c.get_length();e++)c.move_to(e),a.push(c.get_canvas().toDataURL());e(a)})}),this._graphicsLayer.entities.add({position:e.position,billboard:{verticalOrigin:l.VerticalOrigin.BASELINE,image:new l.CallbackProperty(function(){return t.length?(r<6*(t.length-1)?r++:r=0,t[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 l.CallbackProperty(function(){return r.transformWGS84ToCartesian(n)},!1),t.orientation=new l.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),l.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(n),new l.HeadingPitchRoll(l.Math.toRadians(n.heading),l.Math.toRadians(n.pitch),l.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,a=e.speed||.06,s=this,c=n,h=!1;o.length?t.positions=new l.CallbackProperty(function(){var e,t=s.transformCartesianArrayToWGS84Array(o);for(e in t){var i=t[e];(h=r<=n||n<=c?!h:h)?n+=a:n-=a,i.alt=n}return s.transformWGS84ArrayToCartesianArray(t)},!1):t.position=new l.CallbackProperty(function(){var e=s.transformCartesianToWGS84(o);return(h=r<=n||n<=c?!h:h)?n+=a:n-=a,e.alt=n,s.transformWGS84ToCartesian(e)},!1)}catch(e){console.log(e)}},createCanvasGraphics:function(r){r&&r.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:r.positions,material:new l.ImageMaterialProperty({image:new l.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:a="+"}){var s,c,h;if(e)return s=this.createGraphics(),c=0,h=this._calcPoints(t,i,n,c),s.wall={positions:new l.CallbackProperty(()=>l.Cartesian3.fromDegreesArrayHeights(h),!1),material:r||l.Color.AQUAMARINE.withAlpha(.5)},e.clock.onTick.addEventListener(()=>{0<o&&(c+=o,h=this._calcPoints(t,i,n,a+c))}),this._graphicsLayer.entities.add(s)},_computeCirclularFlight(t,i,n,r,o,a){var s=[],c=(s.push(t),s.push(i),s.push(0),l.Cartesian3.distance(l.Cartesian3.fromDegrees(t,i),l.Cartesian3.fromDegrees(n,r)));for(let e=o;e<=o+a;e++){var h=c*Math.sin(e*Math.PI/180),u=Math.cos(e*Math.PI/180),d=(r-i)*u+i;s.push((n-t)*u+t),s.push(d),s.push(h)}return s},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,_calcPoints(e,t,i,n){var r=l.Transforms.eastNorthUpToFixedFrame(l.Cartesian3.fromDegrees(e,t)),o=i*Math.cos(n*Math.PI/180),i=i*Math.sin(n*Math.PI/180),n=l.Cartesian3.fromElements(o,i,0),o=l.Matrix4.multiplyByPoint(r,n,new l.Cartesian3),i=l.Cartographic.fromCartesian(o),r=l.Math.toDegrees(i.longitude),n=l.Math.toDegrees(i.latitude);return this._computeCirclularFlight(e,t,r,n,0,90)}};let h=null;function u(e,t,i){e&&(h=t,this._installMaterial())}function d(){}u.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 h.PolylineCustomMaterialProperty({color:e.color||h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,n=h.defined,r=Object.defineProperties,o=h.Event,a=h.createPropertyDescriptor,s=h.Property,l=h.Material,c=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||h.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,c,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)},l._materialCache.addMaterial(u,{fabric:{type:u,uniforms:{color:i.color||new h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,r=h.defined,e=Object.defineProperties,o=h.Event,a=h.createPropertyDescriptor,s=h.Property,l=h.Material,c=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 c},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)},l._materialCache.addMaterial(c,{fabric:{type:c,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=h.Color,i=h.defaultValue||h.Scene.defaultValue,e=Object.defineProperties,n=h.Event,r=h.Property,o=h.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&&h.Property.equals(this._color,e._color)},e(a.prototype,{color:h.createPropertyDescriptor("color"),duration:h.createPropertyDescriptor("duration")}),h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,i=Object.defineProperties,n=h.Event,r=h.Property,o=h.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&&h.Property.equals(this._color,e._color)},i(s.prototype,{color:h.createPropertyDescriptor("color")}),h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,i=h.defined,n=Object.defineProperties,r=h.Event,o=h.createPropertyDescriptor,a=h.Property,s=h.Material,l=e.WHITE;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||h.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0,this._img=e.imgUrl||s.PolylineCityLinkImage}n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),c.prototype.getType=function(){return s.PolylineCityLinkType},c.prototype.getValue=function(e,t){return(t=i(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.image=this._img,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},c.prototype.equals=function(e){return this===e||e instanceof c&&a.equals(this._color,e._color)},h.Scene.PolylineCityLinkMaterialProperty=c,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=h.Color,t=h.defaultValue||h.Scene.defaultValue,n=h.defined,e=Object.defineProperties,r=h.Event,o=h.createPropertyDescriptor,a=h.Property,s=h.Material;function l(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(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.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},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._color,e._color)},e(l.prototype,{color:o("color")}),h.Scene.WarnLinkMaterialProperty=l,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=h.Color,i=h.defaultValue||h.Scene.defaultValue,e=Object.defineProperties,n=h.Event,r=h.createPropertyDescriptor,o=h.Property,a=h.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,h.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")}),h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,i=Object.defineProperties,n=h.createPropertyDescriptor,r=h.Event,o=h.Property,a=h.Material,s=this.getDfSt(["primitive","WaterPrimitive"]);function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this.color=e.color||h.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(l.prototype,{isConstant:{get:function(){return!1},configurable:!0},definitionChanged:{get:function(){return this._definitionChanged},configurable:!0},color:n("color"),duration:n("duration")}),l.prototype.getType=function(){return a.PolylineTrailLinkType},l.prototype.getValue=function(e,t){return(t=h.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},l.prototype.equals=function(e){return this===e||e instanceof l&&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 }",h.Scene.PolylineTrailLinkMaterial=l,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}})}},d.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 p={},m=void 0;function f(e,t,i){e&&(this._viewer=e,p=t,m=i,this._drawLayer=new p.CustomDataSource("drawLayer"),e&&e.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}f.prototype={createGraphics:function(){return new p.Entity},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,getDfSt(e){if(m)return e=e.reduce((e,t)=>(e||m)[t],void 0),m.baseService+e},setOneSkyBox:function(){return new p.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 p.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 p.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 p.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 p.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 p.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 p.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 p.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(e){if(this._viewer&&e)return this._viewer.scene.postProcessStages.add(new p.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 p.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 p.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 p.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 p.Cartesian4(10,0,200,.3),fogColor:p.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 p.Cartesian3(0,e.distance,window.opt.distance),e.position=p.Cartesian3.add(e.position,t,new p.Cartesian3)),this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)}}))},flyTo:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new p.Cartesian3(0,e.distance,0),e.position=p.Cartesian3.add(e.position,t,new p.Cartesian3)),this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)},easingFunction:e.easingFunction||p.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback}))},transformCartesianToWGS84:function(e){if(this._viewer&&e)return e=p.Cartographic.fromCartesian(e),{lng:p.Math.toDegrees(e.longitude),lat:p.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?p.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=t||e.alt,p.Ellipsoid.WGS84):p.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?p.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):p.Cartographic.ZERO},lnglatArrayToCartesians:function(t){if(!t||t.length<1)return[];var i=[];for(let e=0;e<t.length;e++){var n=p.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=p.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=p.Math.toRadians(-30),r=12,o=5e3,e=p.JulianDate.fromDate(new Date),a=(t.clock.startTime=e.clone(),t.clock.currentTime=e.clone(),t.clock.clockRange=p.ClockRange.CLAMPED,t.clock.clockStep=p.ClockStep.SYSTEM_CLOCK,t.camera.heading),s=function(){var e=p.JulianDate.secondsDifference(t.clock.currentTime,t.clock.startTime),e=p.Math.toRadians(e*r)+a;t.scene.camera.setView({destination:i,orientation:{heading:e,pitch:n}}),t.scene.camera.moveBackward(o),0<=p.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 p.Cesium3DTileFeature?!0:o)&&(r=this._viewer.scene.pickPosition(e))&&((i=p.Cartographic.fromCartesian(r)).height<0&&(i.height=0),s=p.Math.toDegrees(i.longitude),t=p.Math.toDegrees(i.latitude),i=i.height,r=this.transformWGS84ToCartesian({lng:s,lat:t,alt:i})),!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 n&&!o&&(r=this._viewer.scene.pickPosition(e))&&((t=p.Cartographic.fromCartesian(r)).height<0&&(t.height=0),i=p.Math.toDegrees(t.longitude),s=p.Math.toDegrees(t.latitude),t=t.height,r=this.transformWGS84ToCartesian({lng:i,lat:s,alt:t})),(r=o||a||n?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,u=this._viewer.scene.camera.pickEllipsoid(new p.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(u)return e=180*(u=p.Ellipsoid.WGS84.cartesianToCartographic(u)).longitude/Math.PI,u=180*u.latitude/Math.PI,n=this._viewer.camera._direction,t=p.Math.toDegrees(n.x),i=p.Math.toDegrees(n.y),n=p.Math.toDegrees(n.z),r=this._viewer.camera.positionCartographic.height,o=p.Math.toDegrees(this._viewer.camera.heading),a=p.Math.toDegrees(this._viewer.camera.pitch),s=p.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:u,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 p.Cartesian3(t,i,n)}}},pickUpPosition(e){return this.getCatesian3FromPX(e.position)},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={cameraPosistion:t.camera.position,heading:t.camera.heading,pitch:t.camera.pitch,roll:t.camera.roll},(i=p.Cartographic.fromCartesian(i)).height<0&&(i.height=0),i={alt:i.height,lat:p.Math.toDegrees(i.latitude),lon:p.Math.toDegrees(i.longitude)},n=n.pickPosition(e.position),{wgs84Coor:i,graphicCoor:{height:(e=p.Cartographic.fromCartesian(n)).height,latitude:p.Math.toDegrees(e.latitude),longitude:p.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 p.ScreenSpaceEventHandler(this._viewer.canvas),t&&s.setInputAction(function(e){t(e,s)},p.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(e){i(e,s)},p.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(e){n(e,s)},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),r&&s.setInputAction(function(e){r(e,s)},p.ScreenSpaceEventType.LEFT_DOWN),o&&s.setInputAction(function(e){o(e,s)},p.ScreenSpaceEventType.WHEEL),a)&&s.setInputAction(function(e){a(e,s)},p.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(t){var i,n;this._viewer&&(i=new p.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)},p.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(){p.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 p.UrlTemplateImageryProvider(e)}},_installTdtImageryProvider:function(){p.Scene.TdtImageryProvider=function(e){return new p.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(){p.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 p.UrlTemplateImageryProvider(e)}},_installGooGleImageryProvider:function(){p.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 p.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 p.WebMercatorTilingScheme({rectangleSouthwestInMeters:new p.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new p.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 p.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new p.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new p.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new p.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),p.ImageryProvider.loadImage(this,o);throw new p.DeveloperError("requestImage must not be called before the imagery provider is ready.")},p.Scene.BaiduImageryProvider=e},_installGroundSkyBox:function(){var a=p.BoxGeometry,s=p.Cartesian3,t=p.defaultValue||p.Scene.defaultValue,l=p.defined,i=p.destroyObject,c=p.DeveloperError,h=p.GeometryPipeline,e=p.Matrix3,u=p.Matrix4,d=p.Transforms,m=p.VertexFormat,f=p.BufferUsage,g=p.CubeMap,n=p.DrawCommand,A=p.loadCubeMap,y=p.RenderState,v=p.VertexArray,w=p.BlendingState,C=p.SceneMode,_=p.ShaderProgram,P=p.ShaderSource;function r(e){this.sources=e.sources,this._sources=void 0,this.show=t(e.show,!0),this._command=new n({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(u.getRotation)||(u.getRotation=u.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 g({context:n,source:r}))}var o=this._command;if(o.modelMatrix=d.eastNorthUpToFixedFrame(e.camera._positionWC),l(o.vertexArray)||(o.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return u.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:f._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)},p.Scene.GroundSkyBox=r},removeHandlerByName(e=[]){e.forEach(e=>{this._viewer.screenSpaceEventHandler.removeInputAction(p.ScreenSpaceEventType[e])})}};let g={};function A(e,t){e&&(this._viewer=e,g=t)}A.prototype={splitCartesians3:function(e){for(var t=[],i=0;i<e.length;i+=3){var n=new g.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=g.Cartographic.fromCartesian(e),a=g.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=g.Cartesian3.clone(e),u=g.Cartesian3.clone(t),d=g.Cartesian3.distance(h,g.Cartesian3.ZERO),p=g.Cartesian3.distance(u,g.Cartesian3.ZERO);if(g.Cartesian3.normalize(h,h),g.Cartesian3.normalize(u,u),0!=g.Cartesian3.distance(h,u)){var m=g.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*m)/Math.sin(m),w=Math.sin(A*m)/Math.sin(m),v=g.Cartesian3.multiplyByScalar(h,v,new g.Cartesian3),w=g.Cartesian3.multiplyByScalar(u,w,new g.Cartesian3),v=g.Cartesian3.add(v,w,new g.Cartesian3),w=A*Math.PI,y=d*y+p*A+Math.sin(w)*c,v=g.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=g.Transforms.eastNorthUpToFixedFrame(i),n=g.Matrix4.inverse(n,new g.Matrix4),i=g.Matrix4.multiplyByPoint(n,i,new g.Cartesian3),n=g.Matrix4.multiplyByPoint(n,r,new g.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=g.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=g.Cartographic.fromCartesian(e),t=g.Cartographic.fromCartesian(t),(i=new g.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 g.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=g.Cartesian3.normalize(g.Cartesian3.subtract(t,e,new g.Cartesian3),new g.Cartesian3),e=new g.Ray(e,t),t=[],n?t=this._viewer.scene.drillPickFromRay(e,10,i):(n=this._viewer.scene.pickFromRay(e,i),g.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 g.Cartesian3,u=new g.Cartesian3,d=new g.Quaternion,p=new g.Matrix3,t=e+t,g.Cartesian3.multiplyByScalar(n,Math.cos(t),h),g.Cartesian3.multiplyByScalar(i,Math.sin(t),u),g.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,g.Quaternion.fromAxisAngle(h,t,d),g.Matrix3.fromQuaternion(d,p),g.Matrix3.multiplyByVector(p,l,c),g.Cartesian3.normalize(c,c),g.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(e,t,i){if(this._viewer){for(var n=new g.Cartesian3,r=new g.Cartesian3,o=new g.Cartesian3,a=new g.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 m=p+1,f=p+2,A=g.Cartesian3.fromArray(e,p,n),y=(s.scaleToGeodeticSurface(A,A),g.Cartesian3.clone(A,r)),v=s.geodeticSurfaceNormal(A,a),w=g.Cartesian3.multiplyByScalar(v,l,o);g.Cartesian3.add(A,w,A),i&&(g.Cartesian3.multiplyByScalar(v,c,w),g.Cartesian3.add(y,w,y),h[p+d]=y.x,h[m+d]=y.y,h[f+d]=y.z),h[p]=A.x,h[m]=A.y,h[f]=A.z}return h}},computeEllipseEdgePositions:function(e){if(this._viewer){for(var t=new g.Cartesian3,i=new g.Cartesian3,n=new g.Cartesian3,r=new g.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=g.Cartesian3.magnitude(l),p=g.Cartesian3.normalize(l,t),m=g.Cartesian3.cross(g.Cartesian3.UNIT_Z,l,i),m=g.Cartesian3.normalize(m,m),f=g.Cartesian3.cross(p,m,n),A=Math.ceil(2*g.Math.PI/e),y=e,v=r,w=0,C=[],_=0;_<A;_++)v=this.getPointOnEllipsoid(_*y,s,f,m,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 g.Cartesian3,i=new g.Cartesian3,n=new g.Cartesian3,r=new g.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=g.Cartesian3.magnitude(c),m=g.Cartesian3.normalize(c,t),f=g.Cartesian3.cross(g.Cartesian3.UNIT_Z,c,i),f=g.Cartesian3.normalize(f,f),A=g.Cartesian3.cross(m,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,m,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(g.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(g.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 g.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 g.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 g.Cartographic(c,h))}n.push(new g.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 g.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 g.Cartographic(c,h,u))}return i.push(new g.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 g.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 g.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 g.Cartographic(i,r,o)):null}};v={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},y=function(){function e(e){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=e.xField||e.defaultXField,this._yField=e.yField||e.defaultYField,this._valueField=e.valueField||e.defaultValueField,e.radius&&(this._cfgRadius=e.radius)}var c=v.defaultRadius;return e.prototype={_organiseData:function(e,t){var i=e[this._xField],n=e[this._yField],r=this._radi,o=this._data,a=this._max,s=this._min,l=e[this._valueField]||1,e=e.radius||this._cfgRadius||c;return o[i]||(o[i]=[],r[i]=[]),o[i][n]?o[i][n]+=l:(o[i][n]=l,r[i][n]=e),o[i][n]>a?(t?this.setDataMax(o[i][n]):this._max=o[i][n],!1):{x:i,y:n,value:l,radius:e,min:s,max:a}},_unOrganizeData:function(){var e,t=[],i=this._data,n=this._radi;for(e in i)for(var r in i[e])t.push({x:e,y:r,radius:n[e][r],value:i[e][r]});return{min:this._min,max:this._max,data:t}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(0<arguments[0].length)for(var e=arguments[0],t=e.length;t--;)this.addData.call(this,e[t]);else{var i=this._organiseData(arguments[0],!0);i&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[i]})}return this},setData:function(e){var t=e.data,i=t.length;this._data=[],this._radi=[];for(var n=0;n<i;n++)this._organiseData(t[n],!1);return this._max=e.max,this._min=e.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(e){return this._max=e,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(e){return this._min=e,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(e){this._coordinator=e},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},e}(),w=function(){function o(e){var t,i=e.gradient||e.defaultGradient,n=(e=document.createElement("canvas")).getContext("2d"),r=(e.width=256,e.height=1,n.createLinearGradient(0,0,256,1));for(t in i)r.addColorStop(t,i[t]);return n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}function e(e){var t=e.container,i=this.shadowCanvas=document.createElement("canvas"),n=this.canvas=e.canvas||document.createElement("canvas"),r=(this._renderBoundaries=[1e4,1e4,0,0],getComputedStyle(e.container)||{});n.className="heatmap-canvas",this._width=n.width=i.width=e.width||+r.width.replace(/px/,""),this._height=n.height=i.height=e.height||+r.height.replace(/px/,""),this.shadowCtx=i.getContext("2d"),this.ctx=n.getContext("2d"),n.style.cssText=i.style.cssText="position:absolute;left:0;top:0;",t.style.position="relative",t.appendChild(n),this._palette=o(e),this._templates={},this._setStyles(e)}return e.prototype={renderPartial:function(e){0<e.data.length&&(this._drawAlpha(e),this._colorize())},renderAll:function(p){this._clear(),0<p.data.length&&(this._drawAlpha(function(e){for(var t=[],i=p.min,n=p.max,r=p.radi,o=(e=p.data,Object.keys(e)),a=o.length;a--;)for(var s=o[a],l=Object.keys(e[s]),c=l.length;c--;){var h=l[c],u=e[s][h],d=r[s][h];t.push({x:s,y:h,value:u,radius:d})}return{min:i,max:n,data:t}}()),this._colorize())},_updateGradient:function(e){this._palette=o(e)},updateConfig:function(e){e.gradient&&this._updateGradient(e),this._setStyles(e)},setDimensions:function(e,t){this._width=e,this._height=t,this.canvas.width=this.shadowCanvas.width=e,this.canvas.height=this.shadowCanvas.height=t},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(e){this._blur=0==e.blur?0:e.blur||e.defaultBlur,e.backgroundColor&&(this.canvas.style.backgroundColor=e.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=e.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=e.height||this._height,this._opacity=255*(e.opacity||0),this._maxOpacity=255*(e.maxOpacity||e.defaultMaxOpacity),this._minOpacity=255*(e.minOpacity||e.defaultMinOpacity),this._useGradientOpacity=!!e.useGradientOpacity},_drawAlpha:function(e){for(var t,i,n,r,o,a=this._min=e.min,s=this._max=e.max,l=(e=e.data||[]).length,c=1-this._blur;l--;){var h,u=e[l],d=u.x,p=u.y,m=u.radius,u=Math.min(u.value,s),d=d-m,p=p-m,f=this.shadowCtx,g=(this._templates[m]?h=this._templates[m]:this._templates[m]=(t=m,i=c,o=g=r=n=void 0,n=document.createElement("canvas"),r=n.getContext("2d"),o=g=t,n.width=n.height=2*t,1==i?(r.beginPath(),r.arc(g,o,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((i=r.createRadialGradient(g,o,t*i,g,o,t)).addColorStop(0,"rgba(0,0,0,1)"),i.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=i,r.fillRect(0,0,2*t,2*t)),h=n),(u-a)/(s-a));f.globalAlpha=g<.01?.01:g,f.drawImage(h,d,p),d<this._renderBoundaries[0]&&(this._renderBoundaries[0]=d),p<this._renderBoundaries[1]&&(this._renderBoundaries[1]=p),d+2*m>this._renderBoundaries[2]&&(this._renderBoundaries[2]=d+2*m),p+2*m>this._renderBoundaries[3]&&(this._renderBoundaries[3]=p+2*m)}},_colorize:function(){for(var e=this._renderBoundaries[0],t=this._renderBoundaries[1],i=this._renderBoundaries[2]-e,n=this._renderBoundaries[3]-t,r=this._width,o=this._height,a=this._opacity,s=this._maxOpacity,l=this._minOpacity,c=this._useGradientOpacity,r=this.shadowCtx.getImageData(e=e<0?0:e,t=t<0?0:t,i=r<e+i?r-e:i,n=o<t+n?o-t:n),h=r.data,u=h.length,d=this._palette,p=3;p<u;p+=4){var m=h[p],f=4*m;f&&(m=0<a?a:m<s?m<l?l:m:s,h[p-3]=d[f],h[p-2]=d[1+f],h[p-1]=d[2+f],h[p]=c?d[3+f]:m)}this.ctx.putImageData(r,e,t),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(e){var e=this.shadowCtx.getImageData(e.x,e.y,1,1).data[3],t=this._max,i=this._min;return Math.abs(t-i)*(e/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}},e}(),C=function(){var e=!1;return e="canvas2d"===v.defaultRenderer?w:e}(),_=function(){for(var e={},t=arguments.length,i=0;i<t;i++){var n,r=arguments[i];for(n in r)e[n]=r[n]}return e},P=function(){e.prototype={on:function(e,t,i){var n=this.cStore;n[e]||(n[e]=[]),n[e].push(function(e){return t.call(i,e)})},emit:function(e,t){var i=this.cStore;if(i[e])for(var n=i[e].length,r=0;r<n;r++)(0,i[e][r])(t)}};var r=e;function e(){this.cStore={}}function t(){var t,e,i=this._config=_(v,arguments[0]||{});if(this._coordinator=new r,i.plugin){var n=i.plugin;if(!v.plugins[n])throw new Error("Plugin '"+n+"' not found. Maybe it was not registered.");var n=v.plugins[n];this._renderer=new n.renderer(i),this._store=new n.store(i)}else this._renderer=new C(i),this._store=new y(i);n=(t=this)._renderer,i=t._coordinator,e=t._store,i.on("renderpartial",n.renderPartial,n),i.on("renderall",n.renderAll,n),i.on("extremachange",function(e){t._config.onExtremaChange&&t._config.onExtremaChange({min:e.min,max:e.max,gradient:t._config.gradient||t._config.defaultGradient})}),e.setCoordinator(i)}return t.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(e){return this._config=_(this._config,e),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(e){return this._store.getValueAt?this._store.getValueAt(e):this._renderer.getValueAt?this._renderer.getValueAt(e):null}},t}();var v,y,w,C,_,P,x={create:function(e){return new P(e)},register:function(e,t){v.plugins[e]=t}};let b=null;function S(e,t,i){e&&(this._viewer=e,b=t,this._installPrimitives())}S.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive()},_installTetrahedronPrimitive:function(){try{var i=b.Cartesian3,n=b.ComponentDatatype,a=b.PrimitiveType,r=b.BoundingSphere,o=b.GeometryAttribute,s=b.GeometryPipeline,l=b.Geometry,c=b.defined,h=b.RenderState,u=b.ShaderSource,d=b.ShaderProgram,p=b.DrawCommand,m=b.Pass,f=b.Appearance,g=b.BufferUsage,t=b.Color,A=b.VertexArray,y=(b.buildModuleUrl,b.Matrix4),v=b.Matrix3,w=b.Texture,e=b.Resource,C=b.Transforms,_=b.defaultValue||b.Scene.defaultValue,P=this._viewer,x=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png",S=function(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=_(e.distance,1),this._setInterval=void 0,this._viewer=P,this._speed=_(e.speed,1),this._color=_(e.color,new t(1,1,0,.8)),this._scale=_(e.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=x,this._modelMatrix=k(this),this._height=B(this),L(this)};S.prototype.update=function(e){this.show&&(c(this._command)||(this._command=this._createCommand(e.context,this)),c(this._command))&&e.commandList.push(this._command)},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},S.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 b.Cartesian3(0,0,t._height),e=(y.multiplyByTranslation(t._modelMatrix,e,t._modelMatrix),y.fromRotationTranslation(v.fromRotationZ(b.Math.toRadians(t._speed))));y.multiply(t._modelMatrix,e,t._modelMatrix)},5)},S.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const M=function(e,t){var i=T(),n=D(),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:E(e),primitiveType:a.TRIANGLES,renderState:r,shaderProgram:i,uniformMap:o,owner:this,pass:m.TRANSLUCENT,modelMatrix:t._modelMatrix})},E=function(e){var t=I(),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 A.fromGeometry({context:e,geometry:t,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:g.STATIC_DRAW})},I=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 "},D=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 "},L=function(i){e.createIfNeeded(i._imageUrl).fetchImage().then(function(e){var t=i._viewer.scene.context,t=c(e.internalFormat)?new w({context:t,pixelFormat:e.internalFormat,width:e.naturalWidth,height:e.naturalHeight,source:{arrayBufferView:e.bufferView}}):new w({context:t,source:e});i._texture=t})},k=function(e){var t=C.eastNorthUpToFixedFrame(e._localPosition),i=y.fromScale(e._scale),n=y.multiply(t,i,new y);return e._scaleMatrix=i,e._enuMatrix=t,n},B=function(e){var t=i.fromElements(0,0,e._distance,new b.Cartesian3),t=b.Matrix4.multiplyByPoint(e._enuMatrix,t,new i),t=y.multiplyByPoint(e._viewer.scene.camera._viewMatrix,t,new i),e=y.multiplyByPoint(e._viewer.scene.camera.frustum.projectionMatrix,t,new i);return i.normalize(e,new i).z};b.Scene.TetrahedronPrimitive=S}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 b.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new b.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=b.Matrix4.getTranslation(e.modelMatrix,new b.Cartesian3),e=e.boundingSphere,i=e.radius,n=new b.ArrowPolylinePrimitive({id:"axisZ",color:b.Color.RED,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),r=new b.ArrowPolylinePrimitive({id:"axisX",color:b.Color.GREEN,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),t=new b.ArrowPolylinePrimitive({id:"axisY",color:b.Color.BLUE,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),i=b.Matrix3.fromRotationY(b.Math.toRadians(90)),i=(this._rotationX=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(r.geometryInstances[0].modelMatrix,this._rotationX,r.geometryInstances[0].modelMatrix),b.Matrix4.multiply(r.geometryInstances[1].modelMatrix,this._rotationX,r.geometryInstances[1].modelMatrix),b.Matrix3.fromRotationX(b.Math.toRadians(90)));this._rotationY=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(t.geometryInstances[0].modelMatrix,this._rotationY,t.geometryInstances[0].modelMatrix),b.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(b.Math.toRadians(e)),n=Math.cos(b.Math.toRadians(e)),r=this._radius*n,o=this._radius*i;t.push(new b.Cartesian3(r,o,0))}var e=this._createAxisSpheres("axisSphereZ",t,this._matrix,b.Color.RED);this._layer._primitives.add(e);const i=this._createAxisSpheres("axisSphereY",t,this._matrix,b.Color.GREEN),n=(this._layer._primitives.add(i),b.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",t,this._matrix,b.Color.BLUE));this._layer._primitives.add(n),b.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(e,t,i,n){t=new b.PolylineGeometry({positions:t,width:10}),t=new b.GeometryInstance({geometry:t,id:e,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(n)}});return new b.Primitive({geometryInstances:t,appearance:new b.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=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.Matrix4.multiply(r.modelMatrix,o,r.modelMatrix)}}var e=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.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=b.Matrix4.fromRotationTranslation(i);b.Matrix4.multiply(r.modelMatrix,o,r.modelMatrix)}}var e=b.Matrix4.fromRotationTranslation(i);b.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(b.Matrix3.fromRotationX(b.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(b.Matrix3.fromRotationY(b.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(b.Matrix3.fromRotationZ(b.Math.toRadians(1)))}},b.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(e=>{e=viewer.scene.pick(e.position);e&&e.id&&(this._xyzPid=e.id,this._xyzState=!0)},b.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},b.ScreenSpaceEventType.LEFT_UP)}},b.Scene.XyzAxisPrimitive=e},_installArrowPolylinePrimitive:function(){b.Scene.ArrowPolylinePrimitive=function(e={}){this._color=e.color||b.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=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=b.CylinderGeometry.createGeometry(new b.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 b.Cartesian3;o.length?(a.x=o[0],a.y=o[1],a.z=o[2]):b.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 b.Primitive({modelMatrix:b.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new b.GeometryInstance({id:e+"-line",geometry:t}),new b.GeometryInstance({id:e+"-arrow",geometry:i})],appearance:new b.MaterialAppearance({material:b.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){const n=b.defaultValue||b.Scene.defaultValue;function e(e){var t=(e=n(e,n.EMPTY_OBJECT)).scene;if(!b.defined(t))throw new b.DeveloperError("scene is required.");var i=(this._scene=t)._context;if(!b.defined(i))throw new b.DeveloperError("context is required.");if(!b.defined(e.viewerPosition))throw new b.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 b.Camera(t),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=n(e.horizontalFov,60),this._verticalFov=n(e.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();t=new b.Cartesian3(0,0,100),e=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.multiplyByPoint(e,t,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new b.Matrix4,this._shadowMap=new b.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=b.Color.RED,this._visiblyColor=b.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:b.Color.RED,visibly:b.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&&!b.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new b.DebugCameraPrimitive({camera:this._depthCamera,color:b.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=b.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:b.Math.toRadians(this._direction),pitch:b.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},e.prototype.setPoseByTargetPoint=function(e){this.distance=b.Cartesian3.distance(this._viewerPosition,e);var t=new b.Cartesian3,i=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.inverse(i,i),b.Matrix4.multiplyByPoint(i,e,t),b.Cartesian3.normalize(t,t),this.direction=b.Math.toDegrees(Math.atan2(t.x,t.y)),this.pitch=b.Math.toDegrees(Math.asin(t.z))},e.prototype._updateHintLine=function(e){var t,i=this._positions,n=b.Math.toRadians(this._horizontalFov),r=b.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 b.Cartesian3(a,r,-this._distance),r=new b.Cartesian3(o,t,0),o=(b.Matrix4.multiplyByPoint(this._modelMatrix,a,a),b.Matrix4.multiplyByPoint(this._modelMatrix,r,r),b.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=-(y=Math.atan(p)),f=y/10,g=0;g<21;++g)l=m+g*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,A=0;A<21;++A){d=c+A*h;for(var y,p=t/(this._distance/Math.cos(d)),m=-(y=Math.atan(p)),f=y/2,v=0;v<5;++v)l=m+v*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 w,C=e.context,a=b.Buffer.createIndexBuffer({context:C,typedArray:new Uint32Array(this._indices),usage:b.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),r=b.Buffer.createVertexBuffer({context:C,typedArray:b.ComponentDatatype.createTypedArray(b.ComponentDatatype.FLOAT,this._positions),usage:b.BufferUsage.STATIC_DRAW}),n=[],e=(n.push({index:0,vertexBuffer:r,componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new b.VertexArray({context:C,attributes:n,indexBuffer:a}));b.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=e,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=o):(r=b.ShaderProgram.fromCache({context:C,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=b.RenderState.fromCache({depthTest:{enabled:!0}}),a={u_bgColor:function(){return w._lineColor},u_modelViewMatrix:function(){return C.uniformState.modelView}},(w=this)._drawLineCommand=new b.DrawCommand({boundingVolume:o,modelMatrix:w._modelMatrix,primitiveType:b.PrimitiveType.LINES,vertexArray:e,shaderProgram:r,castShadows:!1,receiveShadows:!1,uniformMap:a,renderState:n,pass:b.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},b.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=b.Cartesian3.fromDegrees(0,0,-10),l=b.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 b.Primitive({geometryInstances:new b.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 b.Appearance({renderState:{blending:b.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:e,vertexShaderSource:t})},createGeometry:function(e,t,i){return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),color:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:t})},indices:i,primitiveType:b.PrimitiveType.POINTS,boundingSphere:b.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 b.Primitive({geometryInstances:new b.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 b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},b.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 b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createAppearence=function(){return new b.EllipsoidSurfaceAppearance({material:new b.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 b.PolygonGeometry({polygonHierarchy:new b.PolygonHierarchy(b.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 "},S.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 b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:e}),appearance:this._appearance,asynchronous:!1})))},b.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 b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createGeometry=function(){var e=new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:e},indices:this._indices,primitiveType:b.PrimitiveType.TRIANGLES,boundingSphere:b.BoundingSphere.fromVertices(positions)})},e.prototype._createAppearence=function(){return new b.Appearance({material:new b.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:b.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; } "},b.Scene.TexturePrimitive=e},_installProbingPrimitive:function(){var t={color:new b.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:b.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 b.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:b.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),e=new b.GeometryInstance({geometry:e,modelMatrix:this.getModelMatrix()}),t=new b.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new b.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 b.Matrix4.multiplyByTranslation(b.Transforms.eastNorthUpToFixedFrame(this._center),new b.Cartesian3(0,0,.5*this._length),new b.Matrix4)},e.prototype.updateModelMatrix=function(){},e.prototype.getMaterial=function(){return new b.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)},b.Scene.ProbingPrimitive=e},_initCustomPrimitive:function(e){let u=b;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)},_heatmap:function(){let P=null,S=[103.8258,30.58595,104.252263,30.87];return{getHeatmap({heatData:e,boundsArr:t}){S=t||S;var i=[];for(const t of e){var n=t.lng,r=t.lat,n=Math.round((n-S[0])/(S[2]-S[0])*1920),r=1080-Math.round((r-S[1])/(S[3]-S[1])*1080);i.push({x:n,y:r,value:t.num})}return this.createHeatmap(i),this.createPrimitive()},createHeatmap(e){var t=document.createElement("div");t.setAttribute("style","width: 1920px; height: 1080px; margin: 0px; display: none;"),document.body.appendChild(t),(P=x.create({container:t,radius:24,maxOpacity:1,minOpacity:.1,blur:.85,gradient:{".2":"blue",".4":"green",".6":"yellow",".8":"orange",".9":"red"}})).setData({min:0,max:100,data:e})},createPrimitive(){var e=new b.ImageMaterialProperty({image:P._renderer.canvas}),e={geometryInstances:this.generateGeometryInstance(),appearance:new b.MaterialAppearance({material:b.Material.fromType(b.Material.ImageType,e.getValue(new b.JulianDate))}),allowPicking:!1,asynchronous:!1,show:!1};return new b.Primitive(e)},generateGeometryInstance(){var i=S[2]-S[0],n=S[3]-S[1],r=S[0],o=S[1],a=Math.floor(i/.001),s=Math.floor(n/.001),l=[];for(let t=0;t<s+1;t++){var c=[];for(let e=0;e<a+1;e++){var h=r+(e==a?i:.001*e),u=o+(t==s?n:.001*t),d={x:Math.round((h-r)/i*1920),y:1080-Math.round((u-o)/n*1080)},p=P.getValueAt(d),d=P._renderer.ctx.getImageData(d.x,d.y,1,1).data;c.push([h,u,0+5*p,d.map(e=>e/255),[(h-r)/i,(u-o)/n]])}l.push(c)}var m=[],f=[],g=[],A=[];let y=0;for(let t=0;t<s;t++)for(let e=0;e<a;e++){var v=l[t][e],w=l[t][e+1],C=l[t+1][e+1],_=l[t+1][e];this.addVertices(v,m,g,A),this.addVertices(w,m,g,A),this.addVertices(C,m,g,A),this.addVertices(v,m,g,A),this.addVertices(C,m,g,A),this.addVertices(_,m,g,A),f.push(y+0,y+1,y+2,y+3,y+4,y+5),y+=6}return new b.GeometryInstance({geometry:b.GeometryPipeline.computeNormal(this.generateGeometry(m,g,f,A))})},addVertices(e,t,i,n){var r=b.Cartesian3.fromDegrees(e[0],e[1],e[2]);t.push(r.x,r.y,r.z),i.push(e[3][0],e[3][1],e[3][2],e[3][3]),n.push(e[4][0],e[4][1])},generateGeometry(e,t,i,n){t=new b.GeometryAttributes({position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(e)}),color:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:new Float32Array(t)}),st:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),n=b.BoundingSphere.fromVertices(e,new b.Cartesian3(0,0,0),3);return new b.Geometry({attributes:t,indices:i,primitiveType:b.PrimitiveType.TRIANGLES,boundingSphere:n})}}},createHeatmap3d(e){return this._heatmap().getHeatmap(e)}};let M=null;class I{constructor(e,t){M=t,this._viewer=e,this._labelEntity=null,this.$graphics=new c(e,t),this.isInit=!1}initTool(){this.isInit||(this._labelEntity=this._viewer.entities.add({position:M.Cartesian3.fromDegrees(0,0),label:this.$graphics.getLabelGraphics({l_text:"操作提示",l_fillColor:M.Color.CYAN,l_outlineColor:M.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 E=null,T=null;function L(e,t,i){e&&(E=t,this._drawLayer=new E.CustomDataSource("drawLayer"),c.prototype={...c.prototype,...f.prototype},this.$graphics=new c(e,t),e&&e.dataSources.add(this._drawLayer),this.tooltip=new I(e,t),this.tooltip.initTool())}L.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 E.Cartesian2(0,-20)},this._viewer&&t&&(e=new E.Entity,r=[],o=this,a=new E.ScreenSpaceEventHandler(this._viewer.scene.canvas),(T=a).setInputAction(function(e){e=o.getCatesian3FromPX(e.position);o.tooltip.showAtCartesian(e,"右键单击结束!"),e&&e.x&&(i=e,r.push(e))},E.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)},E.ScreenSpaceEventType.RIGHT_CLICK),e.billboard=t.style,e.position=new E.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(e))},_drawComand:function(n,o){var t,i,r,a=[],s=this,l=new E.PolygonHierarchy,c=new E.ScreenSpaceEventHandler(this._viewer.scene.canvas);function h(e,t){var i=new E.Entity;return"line"==o?i.polyline={positions:e,width:n.width||5,granularity:s._objHasOwnProperty(n,"granularity",E.Math.RADIANS_PER_DEGREE),arcType:s._objHasOwnProperty(n,"arcType",E.ArcType.GEODESIC),material:n.material||E.Color.BLUE.withAlpha(.8),clampToGround:s._objHasOwnProperty(n,"clampToGround",!1),clampToS3M:s._objHasOwnProperty(n,"clampToS3M",!1)}:"polygon"===o&&(i.polyline=n.style,i.polyline.positions=e,i.polygon={hierarchy:t,material:n.material||E.Color.WHITE.withAlpha(.7),clampToGround:s._objHasOwnProperty(n,"clampToGround",!1)},i.clampToS3M=!0),s._drawLayer.entities.add(i)}function u(){"polygon"==o&&(a.push(a[0]),l.positions.push(a[0])),t=h(a,a),n.height&&(t.polygon.extrudedHeight=n.height,t.polygon.material=E.Color.BLUE.withAlpha(.5)),n.measure&&"polygon"==o&&d(a[0],!0),"function"==typeof n.callback&&n.callback(a,t),s._drawLayer.entities.remove(r),s._drawLayer.entities.remove(i),i=r=void 0,a=[]}T=c;const d=function(e,t=!1,i=!1){var n=new E.Entity,e=(n.position=e,n.point={pixelSize:10,outlineColor:E.Color.BLUE,outlineWidth:5},""),r=s.transformCartesianArrayToWGS84Array(a);return"line"===o?e=(s.getPositionDistance(r)/1e3).toFixed(4)+"公里":"polygon"===o&&t&&(e=(s.getPositionsArea(r)/1e6).toFixed(4)+"平方公里"),("line"===o||"polygon"===o&&t)&&!i&&(n.label={text:e,show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:E.HorizontalOrigin.LEFT,verticalOrigin:E.VerticalOrigin.BOTTOM,pixelOffset:new E.Cartesian2(-20,-80)}),s._drawLayer.entities.add(n)};c.setInputAction(function(e){var t=s.getCatesian3FromPX(e.position);if(E.defined(t)){const e=t.clone();if(0===a.length){r=d(e,"",!0),l.positions.push(t.clone()),a.push(e);const n=new E.CallbackProperty(function(){return a},!1),s=new E.CallbackProperty(function(){return"polygon"===o?l:a},!1);i=h(n,s)}l.positions.push(t.clone()),a.push(e),n.measure&&d(e),"straightLine"===n.type&&3==a.length&&(a.pop(),c.destroy(),c=null,s.tooltip.setVisible(!1),"function"==typeof n.callback)&&(a=s._excludeDuplicatesCartesian(a),n.callback(a,i),u())}},E.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){e=s.getCatesian3FromPX(e.endPosition);s.tooltip.showAtCartesian(e,"右键单击结束!"),E.defined(r)&&E.defined(e)&&(a.pop(),a.push(e.clone()),l.positions.pop(),l.positions.push(e.clone()),r.position.setValue(e))},E.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(function(e){a=s._excludeDuplicatesCartesian(a),u(),t=void 0,s.tooltip.setVisible(!1),c.destroy(),c=null},E.ScreenSpaceEventType.RIGHT_CLICK)},_excludeDuplicatesCartesian:e=>e.reduce((e,t)=>{var i=e.length;return i<1||!e[i-1].equals(t)?e.concat(t):e},[]),drawLineGraphics:function(e){e=e||{},this._viewer&&e&&this._drawComand(e,"line")},drawPolygonGraphics:function(e){e=e||{};var t={width:3,material:E.Color.BLUE.withAlpha(.8),clampToGround:!0};e.style?e.style=Object.assign({},t,e.style):e.style=t,this._viewer&&e&&this._drawComand(e,"polygon")},drawRectangleGraphics:function(t){var i,n,e,r,o,a;(t=t||{}).style=t.style||{width:3,material:E.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t&&(n=[],e=new E.Entity,r=new E.Rectangle,o=this,a=new E.ScreenSpaceEventHandler(this._viewer.scene.canvas),(T=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=E.Rectangle.fromCartesianArray([...n,e],E.Ellipsoid.WGS84),"function"==typeof t.callback&&t.callback(o.transformCartesianArrayToWGS84Array(n),i)))},E.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){e=o.getCatesian3FromPX(e.endPosition);e&&(r=E.Rectangle.fromCartesianArray([...n,e],E.Ellipsoid.WGS84))},E.ScreenSpaceEventType.MOUSE_MOVE),e.rectangle=t.style,t.height&&(e.rectangle.extrudedHeight=t.height),e.rectangle.coordinates=new E.CallbackProperty(function(){return r},!1),i=this._drawLayer.entities.add(e))},drawCircleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:E.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var i,n=void 0,r=new E.Entity,o=this,a=1,s=new E.ScreenSpaceEventHandler(this._viewer.scene.canvas);T=s;const l=function(e,t){var e=E.Cartographic.fromCartesian(e),t=E.Cartographic.fromCartesian(t),i=new E.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 E.CallbackProperty(function(){return a},!1),r.ellipse.semiMinorAxis=new E.CallbackProperty(function(){return a},!1),r.position=new E.CallbackProperty(function(){return n},!1),r.point={pixelSize:5,outlineColor:E.Color.RED,outlineWidth:3},t.height&&(r.ellipse.extrudedHeight=t.height),i=o._drawLayer.entities.add(r)))},E.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)},E.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:E.Color.BLUE.withAlpha(.5)},this._viewer&&t){var i=new E.Entity,n=new E.Entity,r=new E.Entity,o=[],a=[],s=[],l=this,c=new E.ScreenSpaceEventHandler(this._viewer.scene.canvas);T=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}))},E.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=E.Cartographic.fromCartesian(t[0]),t=E.Cartographic.fromCartesian(t[1]),i=E.Cartesian3.fromDegrees(E.Math.toDegrees(i.longitude),E.Math.toDegrees(i.latitude),t.height),a.pop(),a.push(i.clone()),s.pop(),s.pop(),s.push(e.clone()),s.push(i.clone()))},E.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new E.CallbackProperty(function(){return o},!1),...t.style},i.position=new E.CallbackProperty(function(){return o[0]},!1),i.point={pixelSize:5,outlineColor:E.Color.BLUE,outlineWidth:5},i.label={text:new E.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(o))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:E.HorizontalOrigin.LEFT,verticalOrigin:E.VerticalOrigin.BOTTOM,pixelOffset:new E.Cartesian2(50,-100)},n.polyline={positions:new E.CallbackProperty(function(){return a},!1),...t.style},n.position=new E.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:E.Color.BLUE,outlineWidth:5},n.label={text:new E.CallbackProperty(function(){return"高度:"+(t=a[1],!(e=a[0])&&!t||E.Cartesian3.equals(e,t)?0:(e=E.Cartographic.fromCartesian(e),(E.Cartographic.fromCartesian(t).height-e.height).toFixed(2)))+"米";var e,t},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:E.HorizontalOrigin.LEFT,verticalOrigin:E.VerticalOrigin.BOTTOM,pixelOffset:new E.Cartesian2(-20,100)},r.polyline={positions:new E.CallbackProperty(function(){return s},!1),...t.style},r.position=new E.CallbackProperty(function(){return o[1]},!1),r.point={pixelSize:5,outlineColor:E.Color.BLUE,outlineWidth:5},r.label={text:new E.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:E.HorizontalOrigin.LEFT,verticalOrigin:E.VerticalOrigin.BOTTOM,pixelOffset:new E.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:E.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:E.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=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:E.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:E.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:e,height:n.height||1,width:n.width||100,cornerType:E.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:E.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:E.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:e,shape:n,cornerType:E.CornerType.MITERED,material:r.color||E.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(){T&&!T.isDestroyed()&&(T.removeInputAction(E.ScreenSpaceEventType.MOUSE_MOVE),T.removeInputAction(E.ScreenSpaceEventType.RIGHT_CLICK),T.removeInputAction(E.ScreenSpaceEventType.LEFT_CLICK))}};let D={};function B(e,t){e&&(this._viewer=e,D=t)}B.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 D.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=D.Math.toRadians(e);i.push(new D.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,f;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],f=a[1]-e[1],c=e[0]+(u*u-d*d)*m+p*f,e[1]+p*m+(d*d-u*u)*f):(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 k=null;function G(e,t){e&&(this._viewer=e,c.prototype={...c.prototype,...f.prototype},this.$graphics=new c(e,t),k=t)}G.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||k.Color.RED,r=e.duration||1500,o=this,a=e.circleMode||"CircleScan",e=e.border||4,u=l,s=new k.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 k.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),u=new k.PostProcessStage({name:t,fragmentShader:this._getCircleScanShader({get:!0,border:e}),uniforms:{u_scanCenterEC:function(){return k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,new k.Cartesian4)},u_scanPlaneNormalEC:function(){var e=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,new k.Cartesian4),t=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,c,new k.Cartesian4),i=new k.Cartesian3;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,k.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,f,g,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||k.Color.RED,r=e.duration||1500,o=this,a=e.border||1,e=e.width||3,v=c,s=new k.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 k.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:v.lng+.001,lat:v.lat,alt:v.alt}),h=new k.Cartesian4(c.x,c.y,c.z,1),u=(new Date).getTime(),d=new k.Quaternion,p=new k.Matrix3,m=new k.Cartesian4,f=new k.Cartesian4,g=new k.Cartesian4,A=new k.Cartesian3,y=new k.Cartesian3,v=new k.PostProcessStage({name:t,fragmentShader:this._getRadarScanShader({border:a,width:e,get:!0}),uniforms:{u_scanCenterEC:function(){return k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m)},u_scanPlaneNormalEC:function(){var e=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m),t=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,l,f);return A.x=t.x-e.x,A.y=t.y-e.y,A.z=t.z-e.z,k.Cartesian3.normalize(A,A),A},u_scanLineNormalEC:function(){var e=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m),t=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,l,f),i=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,g),t=(A.x=t.x-e.x,A.y=t.y-e.y,A.z=t.z-e.z,k.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 k.Quaternion.fromAxisAngle(A,t*k.Math.PI*2,d),k.Matrix3.fromQuaternion(d,p),k.Matrix3.multiplyByVector(p,y,y),k.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=k.Cartesian3,i=k.GeometryInstance,n=k.Primitive,r=k.MaterialAppearance,o=k.Material,a=k.Color,s=k.Matrix4,h=k.Transforms,r=k.MaterialAppearance,l=k.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 k.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 k.PolygonHierarchy(k.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 k.PolygonHierarchy(k.Cartesian3.fromDegreesArrayHeights([r,o,a,i[e].x,i[e].y,0,i[0].x,i[0].y,0])):new k.PolygonHierarchy(k.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 k.Color(1,1,1,1),endColor:new k.Color(.5,0,0,0),emitter:new k.ConeEmitter(k.Math.toRadians(45))},e),new k.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 k.Cartesian2(s,s),lifetime:16,loop:!0,sizeInMeters:!0,modelMatrix:k.Transforms.eastNorthUpToFixedFrame(c)})}};const R="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}",O="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}",z='#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 F={};function V(t){var _=(F=t).BoundingSphere,P=F.Cartesian3,i=F.Color,d=F.combine,b=F.ComponentDatatype,n=F.defaultValue||F.Scene.defaultValue,r=F.defined,x=(F.destroyObject,F.DeveloperError),S=F.Matrix4,o=F.PrimitiveType,M=F.Buffer,E=F.BufferUsage,a=F.DrawCommand,I=F.Pass,T=F.RenderState,D=F.ShaderProgram,L=F.ShaderSource,k=F.VertexArray,B=F.BlendingState,G=F.CullFace,s=F.Material,$=F.SceneMode,V=F.VertexFormat,H=F.Math,U=F.Matrix3,W=(S=F.Matrix4,F.JulianDate),u=(F.BoxGeometry,F.EllipsoidGeometry,Math.sin),j=Math.cos,N=Math.tan,X=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=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=W.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===$.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,f=!1,h=(this._radius!==h&&(f=!0,this._radius=h,this._boundingSphere=new _(P.ZERO,this.radius)),S.equals(this.modelMatrix,this._modelMatrix)&&!f||(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),_.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC)),this.showThroughEllipsoid),f=(this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=h,a=!0),this.material),g=(this._material!==f&&(this._material=f,s=a=!0),f.isTranslucent()),A=(this._translucent!==g&&(this._translucent=g,a=!0),this.showScanPlane&&(m=e.time,(p=W.secondsDifference(m,this._time))<0&&(this._time=W.clone(m,this._time)),m=Math.max(p%this.scanPlaneRate/this.scanPlaneRate,0),"horizontal"==this.scanPlaneMode?(p=j(u=2*c*m-c),d=N(l),p=X(p*d),this._scanePlaneXHalfAngle=p,this._scanePlaneYHalfAngle=u,F.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,Y)):(u=2*l*m-l,d=N(c),p=j(u),m=X(p*d),this._scanePlaneXHalfAngle=u,this._scanePlaneYHalfAngle=m,F.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,Y)),F.Matrix4.multiplyByMatrix3(this.modelMatrix,Y,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix)),o&&(l=this,c=e.context,p=K(l,l.xHalfAngle,l.yHalfAngle),d=l.xHalfAngle,u=l.yHalfAngle,m=p.zoy,p=p.zox,o=[],n=U.fromRotationY(d,Y),o.push(m.map(function(e){return U.multiplyByVector(n,e,new F.Cartesian3)})),n=U.fromRotationX(-u,Y),o.push(p.map(function(e){return U.multiplyByVector(n,e,new F.Cartesian3)}).reverse()),n=U.fromRotationY(-d,Y),o.push(m.map(function(e){return U.multiplyByVector(n,e,new F.Cartesian3)}).reverse()),n=U.fromRotationX(u,Y),o.push(p.map(function(e){return U.multiplyByVector(n,e,new F.Cartesian3)})),d=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=M.createVertexBuffer({context:e,typedArray:n,usage:E.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 k({context:e,attributes:h})}(c,d)),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=M.createVertexBuffer({context:e,typedArray:i,usage:E.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 k({context:e,attributes:s})}(c,d)),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=M.createVertexBuffer({context:e,typedArray:n,usage:E.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 k({context:e,attributes:c})}(c,d)),l.showDomeSurfaces&&(l._domeVA=(m=c,u=F.EllipsoidGeometry.createGeometry(new F.EllipsoidGeometry({vertexFormat:V.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),k.fromGeometry({context:m,geometry:u,attributeLocations:q,bufferUsage:E.STATIC_DRAW,interleave:!1}))),l.showDomeLines&&(l._domeLineVA=(p=c,o=F.EllipsoidOutlineGeometry.createGeometry(new F.EllipsoidOutlineGeometry({vertexFormat:V.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),k.fromGeometry({context:p,geometry:o,attributeLocations:q,bufferUsage:E.STATIC_DRAW,interleave:!1}))),l.showScanPlane)&&("horizontal"==l.scanPlaneMode?(r=K(l,H.PI_OVER_TWO,0),l._scanPlaneVA=J(c,r.zox)):(r=K(l,0,H.PI_OVER_TWO),l._scanPlaneVA=J(c,r.zoy))),a&&(o=this,l=h,g?(o._frontFaceRS=T.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:B.ALPHA_BLEND,cull:{enabled:!0,face:G.BACK}}),o._backFaceRS=T.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:B.ALPHA_BLEND,cull:{enabled:!0,face:G.FRONT}}),o._pickRS=T.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:B.ALPHA_BLEND})):(o._frontFaceRS=T.fromCache({depthTest:{enabled:!l},depthMask:!0}),o._pickRS=T.fromCache({depthTest:{enabled:!0},depthMask:!0}))),s&&(r=c=this,l=h=f,f=(o=e).context,t=R,i=new L({sources:[O,l.shaderSource,z]}),r._sp=D.replaceCache({context:f,shaderProgram:r._sp,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:q}),i=new L({sources:[O,l.shaderSource,z],pickColorQualifier:"uniform"}),r._pickSP=D.replaceCache({context:f,shaderProgram:r._pickSP,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:q}),c.showScanPlane)&&(l=c,f=h,r=o.context,f=new L({sources:[O,f.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=D.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:f,attributeLocations:q})),(a||s)&&(t=g,(i=this)._colorCommands.length=0,c=t?I.TRANSLUCENT:I.OPAQUE,i.showLateralSurfaces&&Z(i,i._sectorFrontCommand,i._sectorBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorVA,i._uniforms,i._computedModelMatrix,t,c),i.showSectorLines&&Z(i,i._sectorLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showSectorSegmentLines&&Z(i,i._sectorSegmentLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorSegmentLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showDomeSurfaces&&Z(i,i._domeFrontCommand,i._domeBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._domeVA,i._uniforms,i._computedModelMatrix,t,c),i.showDomeLines&&Z(i,i._domeLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._domeLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showScanPlane)&&Z(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 Y=new U,Q=new P;function K(e,t,i){for(var n=e.slice,e=j(i),i=N(i),r=j(t),t=N(t),o=X(r*i),a=X(e*t),s=[],l=0;l<n;l++){var c=2*o*l/(n-1)-o;s.push(new P(0,u(c),j(c)))}for(var h=[],l=0;l<n;l++)h.push(new P(u(c=2*a*l/(n-1)-a),0,j(c)));return{zoy:s,zox:h}}function J(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=M.createVertexBuffer({context:e,typedArray:n,usage:E.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 k({context:e,attributes:a})}function Z(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 H={};function W(e){var t=(H=e).defaultValue||H.Scene.defaultValue,i=H.defined,e=Object.defineProperties,n=H.DeveloperError,r=H.Event,o=H.createMaterialPropertyDescriptor,a=H.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 U={};function N(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,E,I,T,D,L,k,n;if(e)return i=(U=e).AssociativeArray,v=U.Cartesian3,w=U.Color,C=U.defined,r=U.destroyObject,_=U.DeveloperError,P=U.Matrix3,b=U.Matrix4,x=U.Quaternion,S=U.MaterialProperty,M=U.Property,E=new P,new b,I=new v,T=new v,D=new x,L=new v,k=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,I),g=M.getValueOrUndefined(c._orientation,e,D),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,L),f=v.angleBetween(U.Cartesian3.UNIT_Z,m),m=v.cross(U.Cartesian3.UNIT_Z,m,L),g=x.fromAxisAngle(m,f-Math.PI,k),A=v.distance(a,p);d.modelMatrix=b.fromRotationTranslation(P.fromQuaternion(g,E),a,d.modelMatrix)}else v.equals(a,u.position)&&x.equals(g,u.orientation)||(C(g)?(d.modelMatrix=b.fromRotationTranslation(P.fromQuaternion(g,E),a,d.modelMatrix),u.position=v.clone(a,u.position),u.orientation=x.clone(g,u.orientation)):(d.modelMatrix=U.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 j=null;function X(e,t){e&&(this.viewer=e,j=t,this._installPlugin())}X.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 j.Cartesian2,x=new j.Cartesian3,M=new j.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),f=0;f<u.length;f++){c[f]=[];for(var g=h[f],A=0;A<r;A++){c[f].push(d++);var y=o*A,v=g*Math.cos(y),w=g*Math.sin(y);a.push(v,w,u[f]),v=m*Math.cos(y),w=m*Math.sin(y),s.push(v,w,p.z),l.push(f/(u.length-1),0)}}for(var C=[],f=1;f<u.length;f++)for(A=1;A<r;A++){var _=c[f-1][A-1],P=c[f][A-1],b=c[f][A],x=c[f-1][A];C.push(b),C.push(x),C.push(_),C.push(b),C.push(_),C.push(P),A==c[f].length-1&&(_=c[f-1][A],P=c[f][A],b=c[f][0],x=c[f-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 j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=j.BoundingSphere.fromVertices(a),t=new j.Geometry({attributes:n,indices:C,primitiveType:j.PrimitiveType.TRIANGLES,boundingSphere:i});return a=[],C=[],l=[],t},b.createGeometry=function(e,t){if(!t)return b._createGeometry(e);j.Matrix4.multiplyByPoint(t,j.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 j.Cartesian3,p=n/15,m=0;m<16;m++){for(var f=p*m,g=[],A=0;A<r;A++){var y=o*A,v=f*Math.cos(y),y=f*Math.sin(y);d.x=v,d.y=y,d.z=h[1],(0,j.Scene.extend2Earth)(d,t,M)?(g.push(u),a.push(v,y,h[1]),s.push(m/15,1),u++):g.push(-1)}c.push(g)}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 j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=j.BoundingSphere.fromVertices(a),n=new j.Geometry({attributes:e,indices:l,primitiveType:j.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,j.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),f=0;f<u.length;f++){c[f]=[];for(var g=h[f],A=0;A<r;A++){c[f].push(d++);var y=o*A,v=g*Math.cos(y),w=g*Math.sin(y);a.push(v,w,u[f]),v=m*Math.cos(y),w=m*Math.sin(y),s.push(v,w,p.z),l.push(f/(u.length-1),0)}}for(var C=[],f=1;f<u.length;f++)for(A=1;A<r;A+=1){var _=c[f-1][A-1],P=c[f][A-1];c[f][A],c[f-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 j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=j.BoundingSphere.fromVertices(a),t=new j.Geometry({attributes:n,indices:C,primitiveType:j.PrimitiveType.LINES,boundingSphere:i});return a=[],C=[],l=[],t},b.fromAngleAndLength=function(e,t,i){return e=j.Math.toRadians(e),new b({topRadius:Math.tan(e)*t/2,bottomRadius:0,length:t,zReverse:i})},j.Scene.CylinderGeometry=b},_installRadarPrimitive:function(){var n;function e(e,t){var i=j.defaultValue||j.Scene.defaultValue;t=t||{},n=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||j.Color.YELLOW,this.defaultLineColor=t.lineColor||this.defaultColor,this._show=i(t.show,!0),this._outline=i(t.outline,!1),this._topShow=i(t.top,!0),this._topOutline=i(t.topOutline,!0),this._modelMatrix=j.Matrix4.clone(j.Matrix4.IDENTITY),this._quaternion=new j.Quaternion,this._translation=new j.Cartesian3,this._scale=new j.Cartesian3(1,1,1),this._matrix=new j.Matrix4,this._inverseMatrix=new j.Matrix4,this._positionCartographic=new j.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=e,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=i(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(j.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 j.CallbackProperty(function(e){return t._ground_radius},!1),semiMajorAxis:new j.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 j.CallbackProperty(function(e){return!t._trackedEntityPosition||j.Cartesian3.distance(t._position,t._trackedEntityPosition)>t._radius?[]:[t._position,t._trackedEntityPosition]},!1),followSurface:!1,material:new j.PolylineDashMaterialProperty({color:j.Color.CYAN}),width:1}}))};var i=new j.Cartesian3;e.prototype.computeMatrix=function(e,t){return this._positionCartesian||(this._positionCartesian=new j.Cartesian3),this.position instanceof j.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(e):this.position._value&&this.position._value instanceof j.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,e=j.Property.getValueOrUndefined(this._trackedEntity.position,e,i))&&(this._trackedEntityPosition=e,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=j.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,n,this._modelMatrix),this._positionCartographic=j.Cartographic.fromCartesian(this._positionCartesian,n,this._positionCartographic),j.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,n,this._modelMatrix),j.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=j.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),j.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),j.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=j.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),f=Math.sqrt(e*e-m*m-p*p);t.push(m,p,f),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 g=r[c-1][d-1],A=r[c][d-1],y=r[c][d],v=r[c-1][d];n.push(g,A,y),n.push(g,y,v)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),o={position:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},w=j.BoundingSphere.fromVertices(t),o=new j.Geometry({attributes:o,indices:n,primitiveType:j.PrimitiveType.TRIANGLES,boundingSphere:w});return(0,j.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=j.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),f=Math.sqrt(e*e-m*m-p*p);t.push(m,p,f),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 g=r[c-1][d-1],A=r[c][d-1],y=r[c][d];r[c-1][d],d%8==1&&n.push(g,A),c%8==1&&n.push(A,y)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),o={position:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},v=j.BoundingSphere.fromVertices(t),o=new j.Geometry({attributes:o,indices:n,primitiveType:j.PrimitiveType.LINES,boundingSphere:v});return(0,j.Scene.computeVertexNormals)(o),o},e.prototype.updateGeometry=function(){this._geometry=j.Scene.CylinderGeometry.createGeometry(new j.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(j.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(j.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=j.Scene.CylinderGeometry.createOutlineGeometry(new j.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(j.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(j.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===j.SceneMode.SCENE3D?(this._geometry.boundingSphere=j.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 j.Cartesian3,r=(j.Matrix4.multiplyByPoint(this._matrix,e.boundingSphere.center,r),new j.BoundingSphere(r,e.boundingSphere.radius)),i=new j.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:e.primitiveType,pass:j.Pass.TRANSLUCENT,boundingVolume:r}),o=this,r=j.GeometryPipeline.createAttributeLocations(e);return i.vertexArray=j.VertexArray.fromGeometry({context:n,geometry:e,attributeLocations:r,bufferUsage:j.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=r,i.shaderProgram=j.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(e),fragmentShaderSource:this.getFragmentShaderSource(e),attributeLocations:r}),i.renderState=j.RenderState.fromCache({blending:j.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:j.DepthFunction.LESS},cull:{enabled:!1,face:j.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 j.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==j.PrimitiveType.LINES||e.primitiveType==j.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return e.primitiveType==j.PrimitiveType.LINES||e.primitiveType==j.PrimitiveType.LINE_STRIP?(o.defaultLineColor||(o.defaultLineColor=new j.Color(1,1,0,1)),o.defaultLineColor):(o.defaultColor||(o.defaultColor=new j.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 j.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=[])},j.Scene.ConeSensorPrimitive=e},_installCounputeVertex:function(){var r=new j.Cartesian3,o=(new j.Ray,new j.Cartographic);j.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 j.GeometryAttribute({componentDatatype:j.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 j.Cartesian3,d=new j.Cartesian3,p=new j.Cartesian3,m=new j.Cartesian3,f=new j.Cartesian3,a=0;a<n;a+=3)s=3*t[a+0],l=3*t[a+1],c=3*t[a+2],j.Cartesian3.fromArray(r,s,u),j.Cartesian3.fromArray(r,l,d),j.Cartesian3.fromArray(r,c,p),j.Cartesian3.subtract(p,d,m),j.Cartesian3.subtract(u,d,f),j.Cartesian3.cross(m,f,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 g,A,y,v,w=e.attributes.normal.values,C=0;C<w.length;C+=3)g=w[C],A=w[C+1],y=w[C+2],v=1/Math.sqrt(g*g+A*A+y*y),w[C]=g*v,w[C+1]=A*v,w[C+2]=y*v;i.normal.needsUpdate=!0}return e},j.Scene.extend2Earth=function(e,t,i,n){n=n||j.Ellipsoid.WGS84,j.Matrix4.multiplyByPoint(t,e,r),j.Cartesian3.subtract(r,i.origin,i.direction),j.Cartesian3.normalize(i.direction,i.direction);t=j.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=t?j.Ray.getPoint(i,t.start):n)try{j.Cartographic.fromCartesian(n,null,o)}catch(e){return null}return n}}};let q={};function Y(e,t){if(t){new X(e,q=t);const i=new V(t),n=new W(t),o=new N(t,i);q.Scene.RectangularSensorPrimitive=i,q.Scene.RectangularSensorGraphics=n,q.Scene.RectangularSensorVisualizer=o;var e=q.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 Q=null;function J(e,t){e&&(this._viewer=e,Q=t,this._customPluginLayer=new Q.CustomDataSource("_customPluginLayer"),new Y(e,t),e)&&e.dataSources.add(this._customPluginLayer)}J.prototype={createRectangularSensorGraphics:function(e){var t,i;if(this._customPluginLayer&&e)return t=new Q.HeadingPitchRoll(Q.Math.toRadians(e.heading||90),Q.Math.toRadians(e.pitch||0),Q.Math.toRadians(e.roll||0)),i=e.position,this._customPluginLayer.entities.add({position:i,orientation:Q.Transforms.headingPitchRollQuaternion(i,t),rectangularSensor:new Q.Scene.RectangularSensorGraphics({radius:e.radius||1e5,xHalfAngle:Q.Math.toRadians(e.xHalfAngle||45),yHalfAngle:Q.Math.toRadians(e.yHalfAngle||45),material:e.material||new Q.Color(1,0,1,.4),lineColor:e.lineColor||new Q.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 Q.Matrix4,scanPlaneColor:e.scanPlaneColor||new Q.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 Q.Scene.SatelliteCoverageSimulation(this._viewer,{position:e.position,angle1:e.angle1||30,angle2:e.angle2||45,areaType:e.areaType||2,rotation:{heading:Q.Math.toRadians(e.heading||0),pitch:Q.Math.toRadians(e.pitch||0),roll:Q.Math.toRadians(e.roll||0)},color:e.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(e){if(e)return new Q.Scene.ConeSensorPrimitive(this._viewer,{position:e.position,angle:e.angle||80,radius:e.radius||7e5,rotation:{heading:Q.Math.toRadians(e.heading||0),pitch:Q.Math.toRadians(e.pitch||40),roll:Q.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 K,Z,$=null,ee={},te="move",ie=null;function ne(e,t){e&&(this._viewer=e,ie=e,$=t,this._installFileDragDropHandler())}ne.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("读取数据失败")})}},$.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 n.GUI,r=this._viewer,t=e.addFolder("加载数据文件"),i=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:()=>{i(e=>{$.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:$.Color.BLUE}}r.flyTo(e)})})},polyline:()=>{i(e=>{$.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 $.PolylineGlowMaterialProperty({glowPower:.1,color:$.Color.ORANGERED.withAlpha(.9)})}r.flyTo(e)})})},polygon:()=>{i(e=>{$.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=$.Color.BLUE.withAlpha(.9)}r.flyTo(e)})})},model:()=>{i(e=>{r.flyTo(d3kit.createModelGraphics({position:$.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:e}))})},czml:()=>{i(e=>{r.flyTo(r.dataSources.add($.CzmlDataSource.load(e)))})},"3dtilset":()=>{i(e=>{r.flyTo(r.scene.primitives.add(new $.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,i=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 n.GUI({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new n.GUI,this._viewer.scene.postProcessStages),o=r.add($.PostProcessStageLibrary.createSilhouetteStage()),a=r.add($.PostProcessStageLibrary.createBlackAndWhiteStage()),s=r.add($.PostProcessStageLibrary.createBrightnessStage()),l=r.add($.PostProcessStageLibrary.createNightVisionStage());o.uniforms.color=e.silhouetteColor||$.Color.YELLOW,o.enabled=!1,a.enabled=!1,a.uniforms.gradations=5,s.enabled=!1,s.uniforms.brightness=.5,l.enabled=!1,t.add(i,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(e){a.enabled=e}),t.add(i,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(e){a.uniforms.gradations=e}),t.add(i,"brightnessShow").name("brightnessShow").onChange(function(e){s.enabled=e}),t.add(i,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(e){s.uniforms.brightness=e}),t.add(i,"nightVisionShow").name("nightVisionShow").onChange(function(e){l.enabled=e}),t.add(i,"silhouette").name("silhouette").onChange(function(e){o.enabled=e})},showSceneBloomPanel(e){let t=null,i=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 n.GUI({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new n.GUI,this._viewer),o=(t.__closeButton.innerHTML="收缩面板",r.scene.postProcessStages.bloom);t.add(i,"enabled").name("bloom").onChange(function(e){o.enabled=e}),t.add(i,"glowOnly").name("发光").onChange(function(e){o.uniforms.glowOnly=e}),t.add(i,"enabled").name("启用模糊").onChange(function(e){o.enabled=e}),t.add(i,"contrast",-255,255,.01).name("对比度").onChange(function(e){o.uniforms.contrast=e}),t.add(i,"brightness",-1,1,.01).name("光泽亮度").onChange(function(e){o.uniforms.brightness=e}),t.add(i,"delta",1,5,.01).name("因子").onChange(function(e){o.uniforms.delta=e}),t.add(i,"sigma",1,10,.01).name("sigma").onChange(function(e){o.uniforms.sigma=e}),t.add(i,"stepSize",.1,10).name("stepSize").onChange(function(e){o.uniforms.stepSize=e}),t.add(i,"shadows").name("启用阴影").onChange(function(e){r.shadows=e}),t.add(i,"highDynamicRange").name("高动态范围").onChange(function(e){r.scene.highDynamicRange=e}),t.add(i,"gamma",1,10,.01).name("伽马亮度").onChange(function(e){r.scene.gamma=e})},showPrimitiveMatrixPanel(t){let i=t.primitives._delegate||t.primitives,r=t.primitives,e=(this._viewer,null);t&&t.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n.GUI;var o=e.addFolder("离地高度"),o=(o.add({height:100},"height",0,1e3,1).onChange(function(e){var t=r.boundingSphere,t=$.Cartographic.fromCartesian(t.center),i=$.Cartesian3.fromRadians(t.longitude,t.latitude,0),t=$.Cartesian3.fromRadians(t.longitude,t.latitude,e),e=$.Cartesian3.subtract(t,i,new $.Cartesian3);r.modelMatrix=$.Matrix4.fromTranslation(e)}),o.open(),e.addFolder("缩放大小")),a={"m+Scale":()=>{i.readyPromise.then(e=>{var t=e.root.transform;$.Matrix4.multiplyByUniformScale(t,1.2,t),e.root.transform=t})},"m-Scale":()=>{i.readyPromise.then(e=>{var t=e.root.transform;$.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=$.Matrix4.fromTranslation(new $.Cartesian3(20,0,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"x-Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(-20,0,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"y+Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,20,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"y-Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,-20,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"z+Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,0,20));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"z-Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,0,-20));$.Matrix4.multiply(i.modelMatrix,e,i.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,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationX($.Math.toRadians(s.x)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"x-Axis":()=>{s.x-=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationX($.Math.toRadians(s.x)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"y+Axis":()=>{s.y+=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationY($.Math.toRadians(s.y)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"y-Axis":()=>{s.y-=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationY($.Math.toRadians(s.y)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"z+Axis":()=>{s.z+=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationZ($.Math.toRadians(s.z)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"z-Axis":()=>{s.z-=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationZ($.Math.toRadians(s.z)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.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:()=>{i.readyPromise.then(e=>{e=e.root.transform;t.cb({modelTransformMatrix:$.Matrix4.toArray(e),modelMatrix:$.Matrix4.toArray(r.modelMatrix)})})}},"getModelMaterix").name("获取模型矩阵"),a.open()),e.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(t,i){if(t){let e=null;i&&i.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new n.GUI;var i=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(i,"alpha",0,1,.05).name("透明度").onChange(function(e){t.alpha=e}),r.add(i,"brightness",0,5,.05).name("亮度").onChange(function(e){t.brightness=e}),r.add(i,"contrast",0,5,.05).name("对比").onChange(function(e){t.contrast=e}),r.add(i,"gamma",0,5,.05).name("伽马").onChange(function(e){t.gamma=e}),r.add(i,"hue",0,5,.05).name("色调").onChange(function(e){t.hue=e}),r.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange(function(e){t.dayAlpha=e}),r.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(e){t.nightAlpha=e}),r.add(i,"saturation",0,5,.05).name("饱和").onChange(function(e){t.saturation=e}),r.open()}},showLayerSwitchPanel:function(t,i,r){if(t&&t.length){let e=null;i&&i.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new n.GUI;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,i,r;e=e||{},n.GUI&&this._viewer.scene.colorCorrection&&(r=new n.GUI,(t=this._viewer).scene.lightSource.ambientLightColor=e.ambientLightColor||new $.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,i=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(i,"bloomEffectShow").name("泛光开关").onChange(function(e){t.scene.bloomEffect.show=e,t.scene.bloomEffect.threshold=i.bloomThreshold,t.scene.bloomEffect.bloomIntensity=i.bloomIntensity}),r.add(i,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(e){t.scene.bloomEffect.threshold=e}),r.add(i,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(e){t.scene.bloomEffect.bloomIntensity=e}),r.add(i,"hdrEnabled").name("HDR开关").onChange(function(e){t.scene.hdrEnabled=e}),r.add(i,"colorCorrectionShow").name("颜色校正").onChange(function(e){t.scene.colorCorrection.show=e}),r.add(i,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(e){t.scene.colorCorrection.saturation=e}),r.add(i,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(e){t.scene.colorCorrection.brightness=e}),r.add(i,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(e){t.scene.colorCorrection.contrast=e}),r.add(i,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(e){t.scene.hdrEnabled=e}),r.add(i,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(e){t.scene.lightSource.ambientLightColor=new $.Color(e,e,e,1)}),r.open())},showEntityOrientationEditPanel:function(i={}){if(i.entity){let t=i.entity;var e=new n.GUI,r=(i&&i.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new n.GUI,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=$.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new $.HeadingPitchRoll($.Math.toRadians(r.heading),$.Math.toRadians(r.pitch),$.Math.toRadians(r.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.add(r,"pitch",0,360,1).name("航向").onChange(function(e){r.pitch=e;e=$.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new $.HeadingPitchRoll($.Math.toRadians(r.heading),$.Math.toRadians(r.pitch),$.Math.toRadians(r.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.add(r,"roll",0,360,1).name("翻转").onChange(function(e){r.roll=e;e=$.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new $.HeadingPitchRoll($.Math.toRadians(r.heading),$.Math.toRadians(r.pitch),$.Math.toRadians(r.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.open()}},definedMouseEvent({targetEntity:e,ctrlFlag:t}){Z=e,ee=t,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(t){if(ee.leftDown&&K){let e=ie.camera.getPickRay(t.endPosition),r=ie.scene.globe.pick(e,ie.scene);if(document.body.style.cursor="pointer",K&&K.id&&"move"===te){let e=$.JulianDate.fromDate(new Date),t=Z.position.getValue(e),i=$.Cartographic.fromCartesian(t),n=Number(i.height.toFixed(3));Z.position=new $.CallbackProperty(()=>{var e=ie.scene.globe.ellipsoid.cartesianToCartographic(r),t=$.Math.toDegrees(e.longitude),e=$.Math.toDegrees(e.latitude);return $.Cartesian3.fromDegrees(t,e,n)},!1)}else{var i,n,o;K&&K.id&&"rotate"===te&&(n=$.JulianDate.fromDate(new Date),n=Z.position.getValue(n),o=ie.scene.camera.pickEllipsoid(t.startPosition),t=ie.scene.camera.pickEllipsoid(t.endPosition),i=$.Cartesian3.subtract(n,t,new $.Cartesian3),i=$.Cartesian3.normalize(i,new $.Cartesian3),o=$.Cartesian3.subtract(o,n,new $.Cartesian3),t=$.Cartesian3.subtract(t,n,new $.Cartesian3),n=$.Cartesian3.angleBetween(o,t),o=$.Quaternion.fromAxisAngle(i,100*n),Z.orientation=o)}}},defLeftDown(e){K=ie.scene.pick(e.position),$.defined(K)&&te?(ee.selected=!0,ee.leftDown=!0):ee.selected=!1},defMouseWheel(n){if(K&&K.id&&"scale"===te){let e=$.JulianDate.fromDate(new Date),t=Z.box.dimensions.getValue(e),i=0<n?2:.5;Z.box.dimensions=new $.CallbackProperty(()=>$.Cartesian3.multiplyByScalar(t,i,new $.Cartesian3),!1)}},defLeftUp(e){ee.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(e){te=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(e){te=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(e){te=e,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let re=null;var oe=3.141592653589793,ae=6378245,se=.006693421622965943;function le(e,t,i){e&&(this._viewer=e,re=t,this._queryRouteKey="8dc49b1fa65a79d306ef12dae4229842",this._pluginLayer=new re.CustomDataSource("pluginLayer"),e&&e.dataSources.add(this._pluginLayer),this._installPlugin())}le.routeQueryType={DRIVE:"drive",WALK:"walk",CYCLE:"cycle"},le.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan(),this._installClusterLayer(),this._installBar3DLayer()},_installTerrainClipPlan:function(){let i=re.defaultValue||re.Scene.defaultValue;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=i(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 re.Cartesian3,r=0<re.Cartesian3.subtract(e[0],e[1],n).x;this.excavateMinHeight=9999;for(var o=0;o<i;o++){var a=(o+1)%i,s=re.Cartesian3.midpoint(e[o],e[a],new re.Cartesian3),l=re.Cartographic.fromCartesian(e[o]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=re.Cartesian3.normalize(s,new re.Cartesian3),a=r?re.Cartesian3.subtract(e[o],s,new re.Cartesian3):re.Cartesian3.subtract(e[a],s,new re.Cartesian3),a=(a=re.Cartesian3.normalize(a,a),re.Cartesian3.cross(a,l,new re.Cartesian3)),a=re.Cartesian3.normalize(a,a),l=new re.Plane(a,0),l=re.Plane.getPointDistance(l,s);t.push(new re.ClippingPlane(a,l))}this.viewer.scene.globe.clippingPlanes=new re.ClippingPlaneCollection({planes:t,edgeWidth:1,edgeColor:re.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=re.Cartographic.fromCartesian(e[s]),l=re.Cartographic.fromCartesian(e[l]),h=[c.longitude,c.latitude],u=[l.longitude,l.latitude];0==s&&(a.push(new re.Cartographic(h[0],h[1])),o.push(re.Cartesian3.fromRadians(h[0],h[1],n)),r.push(re.Cartesian3.fromRadians(h[0],h[1],0)));for(var d=1;d<=t;d++){var p=re.Math.lerp(h[0],u[0],d/t),m=re.Math.lerp(h[1],u[1],d/t);s==i-1&&d==t||(a.push(new re.Cartographic(p,m)),o.push(re.Cartesian3.fromRadians(p,m,n)),r.push(re.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),re.sampleTerrainMostDetailed(this.viewer.terrainProvider,o.lerp_pos).then(function(e){for(var t=e.length,i=[],n=0;n<t;n++){var r=re.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 re.Cartesian3(e.x,e.y,e.z),t=t.cartesianToCartographic(e),e=re.Math.toDegrees(t.latitude);return{longitude:re.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 re.PolygonGeometry({polygonHierarchy:new re.PolygonHierarchy(re.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),e=re.PolygonGeometry.createGeometry(e),o=new re.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),o=new re.MaterialAppearance({translucent:!1,flat:!0,material:o});this.bottomSurface=new re.Primitive({geometryInstances:new re.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 re.WallGeometry({positions:t,maximumHeights:n,minimumHeights:r}),e=re.WallGeometry.createGeometry(e),o=new re.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),o=new re.MaterialAppearance({translucent:!1,flat:!0,material:o});this.wellWall=new re.Primitive({geometryInstances:new re.GeometryInstance({geometry:e,attributes:{color:re.ColorGeometryInstanceAttribute.fromColor(re.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=re.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(re.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)},re.Scene.TerrainClipPlan=e},buildLightScanGraphics:function(e){if(this._viewer&&e){for(var l=this,t=function(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 re.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 re.PolygonHierarchy(re.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)},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 re.PolygonHierarchy(re.Cartesian3.fromDegreesArrayHeights([i,n,r,e[a].x,e[a].y,0,e[0].x,e[0].y,0])):new re.PolygonHierarchy(re.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=re.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 re.TimeIntervalCollection([new re.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 re.CallbackProperty(function(){return n},!1),width:t||10,material:r||new re.PolylineGlowMaterialProperty({glowPower:1,color:re.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=re.Matrix4.fromRotationTranslation(re.Matrix3.fromQuaternion(t),e),this._viewer.camera.lookAtTransform(t,i.cameraOffset()))})},_createSampledPosition(t){this.startTime=re.JulianDate.now(),this.stopTime=re.JulianDate.addSeconds(this.startTime,60*t.length,new re.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=re.ClockRange.CLAMPED;var i=new re.SampledPositionProperty;for(let e=0;e<t.length;e++){var n=re.JulianDate.addSeconds(this.startTime,60*e,new re.JulianDate),r=t[e];i.addSample(n,r)}return i},_sampleOrientation(){let r,o,a;return new re.CallbackProperty(e=>{var t=this.droneEntity.position.getValue(e);if(o=this.droneEntity.position.getValue(re.JulianDate.addSeconds(e,1/60,new re.JulianDate)),t&&o){r=t;const e=re.Cartesian3.subtract(o,r,new re.Cartesian3),i=re.Cartesian3.normalize(e,new re.Cartesian3),n=re.Transforms.rotationMatrixFromPositionVelocity(r,i,re.Ellipsoid.WGS84);a=re.Quaternion.fromRotationMatrix(n)}return a},!1)},_installCss3Renderer:function(){function e(e,t){this._scratch=new re.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=e,this._isBackHide=t,this._postBuildFun=null,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;s._scene.canvas.clientHeight;let l=new re.Cartesian2;this._postBuildFun=function(){document.querySelectorAll(".close__box__btn").forEach(function(e){e.addEventListener("click",function(){a.contains(o)&&(a.removeChild(o),s._postBuildFun)&&s._scene.postRender.removeEventListener(s._postBuildFun)})});for(var e=0;e<o.children.length;e++){var t,i=s._elements[e],n=i.position,n=n instanceof re.Cartesian3?n:re.Cartesian3.fromDegrees(n[0],n[1],n[2]||0),r=(re.SceneTransforms.worldToWindowCoordinates(s._scene,n,l),i.offset?i.offset[0]:0),i=i.offset?i.offset[1]:0;re.defined(l)&&((t=o.children[e]).style.left=l.x+r+"px",t.style.top=l.y-t.offsetHeight+i+"px",s._isBackHide)&&(r=s._camera.position,t=s._scene.globe.ellipsoid.cartesianToCartographic(r).height,t+=+s._scene.globe.ellipsoid.maximumRadius,re.Cartesian3.distance(r,n)>t?o.children[e].style.display="none":o.children[e].style.display="block")}},this._scene.postRender.addEventListener(this._postBuildFun)},e.prototype.remove=function(e){this._elements=this._elements.filter(function(e){e.id}),this._container.removeChild(document.getElementById(e)),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun)},e.prototype.removeChild=function(){var e=document.getElementById(this._parentEleId);e.contains(this._container)&&e.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun)},e.prototype.close=function(){var e=document.getElementById(this._parentEleId);e.contains(this._container)&&e.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun)},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),re.Math.toRadians(30)),o=re.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 re.CallbackProperty(function(){return(a+=l)>=s&&(a=s),re.Cartesian3.fromDegrees(t,i,a/2)},!1),box:{dimensions:new re.CallbackProperty(function(){return(a+=l)>=s&&(a=s,c)&&(c=!1,n.append(e,!0)),new re.Cartesian3(e.boxSide||100,e.boxSide||100,a)},!1),material:e.boxMaterial||re.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:re.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new re.CallbackProperty(function(){return.001},!1),semiMajorAxis:new re.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new re.CallbackProperty(function(){return r+=.05},!1),stRotation:new re.CallbackProperty(function(){return r+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:e.id+"_3",name:"椭圆",position:re.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new re.CallbackProperty(function(){return.001},!1),semiMajorAxis:new re.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new re.CallbackProperty(function(){return o-=.03},!1),stRotation:new re.CallbackProperty(function(){return o-=.03},!1),zIndex:3}}))},re.Scene.Css3Renderer=e)},_installClusterLayer:function(){if(this._viewer){const t=this._viewer,i={pixelRange:40,minimumClusterSize:5,image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABmDSURBVHgB7d0LdBTXeQfw/+gFkhEsCBACCa8BY2OcIAx2gh+x3MRpmpzEkDatSRwDTdLG6cOmdU6b06ZG7WnTJO3BSZr2tDkJwkmbJk1rktoxcZwix8bxCyPbGBts8GKBeIOMeEraub3fzC6a165eM/vS/3fO9Uq7s6thvPe7371z5w5ARERERERERGOBASp5avu/xAEzBlSkHoOUdevXdEHCWHxXAjQmMACUGPXsN5tRbrSgrGyR/rVZPxPXj7ERfJQOBkYHytCBfnMfzGSHce0ftYNKCgNAkVPb18dgVq7WFf5m/VuL/l86kso+DEY7ynRg6O37MQNC8WMAKEIDlR63QenWPn8S+hvUrjOEjQwGxYkBoIio59a3oKLyNphqNUa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"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 re.CustomDataSource("clusterLayer"),this.unClusterLayer=new re.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 re.Entity({id:e.id||Math.random().toString(36).substring(2),props:e,position:re.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=re.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()},re.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:re.Color.WHITE,showBackground:!0,verticalOrigin:re.VerticalOrigin.BOTTOM,pixelOffset:new re.Cartesian2(0,0)},billboard:{width:25,height:25,pixelOffset:new re.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 re.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+OHIGixGlhLMqnT0rZsl8s3vW1oUEs5LgVz10FQCsqAb6by4mI7xheAAjCL1UA8naG0oEAdLRb3Yl4HmMVqIEEkFI7TWQq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bk5G38yttLVPikYoejk5XQPAciL6VazP4nZvSXIVPkPs/DLagPTm+YAUaGXOIMmvOy737WhGR0X0ApKnAm2K0Ua/osabiol6kn2tpmfxFMg4Jt29kl9/lvnlv+LoQlLpTi9rZVldTSkByLS9/0Awge7LEbswmXUxDFmvG4bcYB1F8dftp80l6QCI/OLknBKA5cytOMzZTuUpKIVyDxXb4Ml632pzyxZg+vqQdqmW9TXULgDLm7PdBpX7IVhLPkQw/TWU+4bV1hHzQcpGWtZ69gnZW+fQoUMAVh+xst+Mj6D8LGAw6WS+hryzqack674g4L0w9SDiF+alcnQFwOosRXsO8tkdDJhbqP9NXkkQH2il96oLRjcM7017NUxjES+nsXxLFtr5xA5O5BqA1dl6diUQLeEteStEpiKRF0e1IreGQJZy4FXwmHWAfA1/2CsuErVTAJAs8nj9ed6E1RKMjIOhE5moEahcAvgKeoxREgivFoHCRekUAM5yknUBtY4rhdEtHHAxFAc4+4+lYPeR1u0dya4BJB+pzTBlqBVU+fPJJbf+Ay0VEAQRl83WPwQ6UVwDgOhSiOxDIFplxzfN21gPIidI9EUKg1Hp69Qt6R6AogIaL7qyt0acA5pkm8Qf2QtBETz41ja4/LgGIMHwJgnUfd8SV3U7r+bhLToFgqiQgvABii3UkfAvAAAA//+8EYjPAAAABklEQVQDAEtuHlwOonB4AAAAAElFTkSuQmCC":c[2]||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFCElEQVR4AexWWUjuVRCfz12v+5L7mqKmoqaCae744oJL+qKiSQgRET710Ms1CALlopIP6oNJoiCICylCoJQhKmIppKLmVi647+un2PzO9f/xrZp1I4r78c2ZOefMnPmdOXPm/PXoX/69BvDfikBFRYVlXV3dIPM7UHV19XF9ff1QS0vLj5WVlTdVVVXyhoaG35+SVn8qAo2NjWWtra0dJiYm27u7u0kREREEsrS0tDg6OopbW1t718XFRT8gIMBgc3PTrba2dpeBHjQ1Nf3S1tbW8hCgRwHU1NTMbmxsNC4sL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JSXRfCc3OzhJAcI7Uqi+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=re.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 re.Color?i:re.Color.fromCssColorString(i).withAlpha(.85),a.barLayer.entities.add({id:e+"-bar",name:"3DBar",position:new re.CallbackProperty(function(){return re.Cartesian3.fromDegrees(r[0],r[1],d/2)},!1),box:{dimensions:new re.CallbackProperty(function(){return new re.Cartesian3(l,c,d)},!1),material:p,outline:!1},show:!0});o=i instanceof re.Color?i:re.Color.fromCssColorString(i).withAlpha(.7);a.config.labelShow&&a.barLayer.entities.add({id:e+"-label",position:new re.CallbackProperty(function(){return re.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 re.CallbackProperty(function(){return re.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)}()},re.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=(t+=2*(20*Math.sin(6*e*oe)+20*Math.sin(2*e*oe))/3)+2*(20*Math.sin(e*oe)+40*Math.sin(e/3*oe))/3)+2*(150*Math.sin(e/12*oe)+300*Math.sin(e/30*oe))/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=(i+=2*(20*Math.sin(6*e*oe)+20*Math.sin(2*e*oe))/3)+2*(20*Math.sin(t*oe)+40*Math.sin(t/3*oe))/3)+2*(160*Math.sin(t/12*oe)+320*Math.sin(t*oe/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*oe,o=Math.sin(r),o=1-se*o*o,a=Math.sqrt(o),i=180*i/(ae*(1-se)/(o*a)*oe),o=2*t-(t+180*n/(ae/a*Math.cos(r)*oe)),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*oe,o=Math.sin(r),o=1-se*o*o,a=Math.sqrt(o),e=e+180*i/(ae*(1-se)/(o*a)*oe),i=t+180*n/(ae/a*Math.cos(r)*oe);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="",f=0;f<d.length;f++){var g=d[f];m+=(g=this.wgs2gcj(g))[0]+","+g[1]+",",0==f&&(p=g[0]+","+g[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===le.routeQueryType.DRIVE?(r=t.url||"https://restapi.amap.com/v5/direction/driving",delete t.url,this._queryDrivingRoute(r,t,i,n)):e===le.routeQueryType.WALK?(r=t.url||"https://restapi.amap.com/v3/direction/walking",delete t.url,this._queryWalkCycleRoute(r,t,i,n)):e===le.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 ce=null;function he(e,t,i){e&&(ce=t,this._analysisLayer=new ce.CustomDataSource("analysisLayer"),A.prototype={...A.prototype,...f.prototype},c.prototype={...c.prototype,...f.prototype},this.$math3d=new A(e,t),this.$graphics=new c(e,t),e)&&e.dataSources.add(this._analysisLayer)}function ue(e){if(e&&e.positions){var t=e.positions,i=e.that,n=[],e=[],r=[],o=t[0],t=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];ce.defined(l.position)||a.splice(e,1)}if(!ce.defined(a[0].position))throw new ce.DeveloperError("position is undefined");var s=a[0].position,l=ce.Cartesian3.distance(s,t)<5,s=[o,a[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:ce.ArcType.NONE,material:new ce.PolylineArrowMaterialProperty(ce.Color.GREEN)}});e.push(s),l||(s=[a[0].position,t],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:ce.ArcType.NONE,material:new ce.PolylineArrowMaterialProperty(ce.Color.RED)}}),e.push(s));for(let e=0;e<a.length;++e){var c,h=a[e].object;h&&(h instanceof ce.Cesium3DTileFeature?(r.push(h),h.oldColor=h.color.clone(),h.color=ce.Color.fromAlpha(ce.Color.YELLOW,h.color.alpha)):h.id instanceof ce.Entity&&(c=(h=h.id).polygon||h.polyline,r.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=ce.Color.fromAlpha(ce.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:a[e].position,ellipsoid:{radii:new ce.Cartesian3(.8,.8,.8),material:ce.Color.RED}}))}var s=ce.Cartographic.fromCartesian(o),e=ce.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:ce.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:ce.VerticalOrigin.BOTTOM,horizontalOrigin:ce.HorizontalOrigin.LEFT})}ue.prototype.remove=function(){}}function de(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=ce.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 ce.Cartesian3(o.outerPositions[e],o.outerPositions[e+1],o.outerPositions[e+2]),s=ce.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 ce.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=ce.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 ce.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:r})}else alert("高程异常!")})}}catch(e){console.log(e)}de.prototype.remove=function(){}}function pe(e){if(e&&e.positions){for(var t=e.positions,i=e.that,n=t[0],o=t[1],a=[ce.Cartographic.fromCartesian(n)],s=new ce.Cartesian3,l=[0],c=[0],h=1;h<=10;h++){ce.Cartesian3.lerp(n,o,h/10,s);var u=ce.Cartographic.fromCartesian(s),d=i._viewer.scene.globe.getHeight(u),d=(u.height=d,a.push(u),a[h-1]),p=ce.Cartesian3.distance(ce.Cartographic.toCartesian(d),ce.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");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",e.style.opacity=.9,r.init(e).setOption({title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!1,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:"平均值"}]}}]})}}function me(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 ce.PolygonGeometry.fromPositions({positions:e,vertexFormat:ce.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:n}),d=new ce.PolygonGeometry.createGeometry(n),p=0,m=0,f=new ce.Cartesian3;for(let e=0;e<d.indices.length;e+=3){u=d.indices[e],o=d.indices[e+1],l=d.indices[e+2],c=d.attributes.position.values,f.x=c[3*u],f.y=c[3*u+1],f.z=c[3*u+2],u=ce.Cartographic.fromCartesian(f),r=t._viewer.scene.globe.getHeight(u),a=ce.Cartesian3.fromRadians(u.longitude,u.latitude,r),h=ce.Cartesian3.fromRadians(u.longitude,u.latitude,0),m<r&&(m=r),f.x=c[3*o],f.y=c[3*o+1],f.z=c[3*o+2],u=ce.Cartographic.fromCartesian(f),o=t._viewer.scene.globe.getHeight(u),s=ce.Cartesian3.fromRadians(u.longitude,u.latitude,o),A=ce.Cartesian3.fromRadians(u.longitude,u.latitude,0),m<o&&(m=o),f.x=c[3*l],f.y=c[3*l+1],f.z=c[3*l+2],u=ce.Cartographic.fromCartesian(f),c=t._viewer.scene.globe.getHeight(u),l=ce.Cartesian3.fromRadians(u.longitude,u.latitude,c),u=ce.Cartesian3.fromRadians(u.longitude,u.latitude,0),m<c&&(m=c),h=h,A=A,u=u,g=void 0,g=ce.Cartesian3.distance(h,A),A=ce.Cartesian3.distance(A,u),u=ce.Cartesian3.distance(u,h),h=(g+A+u)/2,p+=Math.sqrt(h*(h-g)*(h-A)*(h-u))*(r-15e3+o-15e3+c-15e3)/3;var g=[],A=(g.push(a),g.push(s),g.push(l),{polygon:{hierarchy:{positions:g},extrudedHeight:0,perPositionHeight:!0,material:ce.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:ce.Color.WHITE,outlineWidth:2}});t._analysisLayer.entities.add(A)}n=function(e){for(var t=[],i=[],n=0;n<e.length;n++){var r=ce.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 ce.Cartographic(u,d)}(e),i._volumeLabel=t._analysisLayer.entities.add({position:ce.Cartesian3.fromRadians(n.longitude,n.latitude,m+1e3),label:{text:"Cut Volume "+p.toString()+"m3"}})}else alert("未获取到地形")}}he.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new ue({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 de({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;ce.defined(n)?t.destroy():(n=new ce.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),e.pop();t=new ce.Scene.TerrainClipPlan(n._viewer,{height:r,splitNum:o,wallImg:a,bottomImg:s});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||{},!r)return alert("需要引入echarts库"),!1;var n=this;this._viewer&&i&&n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new pe({positions:e,that:n});n._graphicsLayer&&n._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 me({positions:e,that:i});"function"==typeof t.callback&&t.callback(e)}})}};var fe={version:"1.0.0",PlotUtils:{}},ge=(fe.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},fe.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=fe.PlotUtils.distance(e[i],e[i+1]);return t},fe.PlotUtils.getBaseLength=function(e){return Math.pow(fe.PlotUtils.wholeDistance(e),.99)},fe.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},fe.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 fe.PlotUtils.getIntersectPoint(n,t,r,e)},fe.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])},fe.PlotUtils.getAzimuth=function(e,t){var i,n=Math.asin(Math.abs(t[1]-e[1])/fe.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=fe.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},fe.PlotUtils.getAngleOfThreePoints=function(e,t,i){e=fe.PlotUtils.getAzimuth(t,e)-fe.PlotUtils.getAzimuth(t,i);return e<0?e+fe.Constants.TWO_PI:e},fe.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},fe.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},fe.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]]},fe.PlotUtils.getThirdPoint=function(e,t,i,n,r){e=fe.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]},fe.PlotUtils.getArcPoints=function(e,t,i,n){for(var r=[],o=(o=n-i)<0?o+fe.Constants.TWO_PI:o,a=0;a<=fe.Constants.FITTING_COUNT;a++){var s=i+o*a/fe.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);r.push([l,s])}return r},fe.PlotUtils.getBisectorNormals=function(e,t,i,n){var r,o,a=fe.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=fe.PlotUtils.distance(t,i),h=fe.PlotUtils.distance(i,n),s=s>fe.Constants.ZERO_TOLERANCE?fe.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]},fe.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)]},fe.PlotUtils.getCurvePoints=function(e,t){for(var i=[fe.PlotUtils.getLeftMostControlPoint(t)],n=0;n<t.length-2;n++)var r=t[n],o=t[n+1],a=t[n+2],a=fe.PlotUtils.getBisectorNormals(e,r,o,a),i=i.concat(a);for(var s=fe.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<fe.Constants.FITTING_COUNT;e++){var c=fe.PlotUtils.getCubicValue(e/fe.Constants.FITTING_COUNT,r,i[2*n],i[2*n+1],o);l.push(c)}l.push(o)}return l},fe.PlotUtils.getLeftMostControlPoint=function(e){var i,n,r,o,a,s=e[0],l=e[1],e=e[2],c=fe.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=fe.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>fe.Constants.ZERO_TOLERANCE?(e=fe.PlotUtils.mid(s,l),r=s[0]-e[0],i=s[1]-e[1],n=2/fe.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]},fe.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=fe.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=fe.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>fe.Constants.ZERO_TOLERANCE?(l=fe.PlotUtils.mid(c,e),r=e[0]-l[0],i=e[1]-l[1],n=2/fe.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]},fe.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=fe.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},fe.PlotUtils.getBinomialFactor=function(e,t){return fe.PlotUtils.getFactorial(e)/(fe.PlotUtils.getFactorial(t)*fe.PlotUtils.getFactorial(e-t))},fe.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},fe.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=fe.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},fe.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},fe.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"}),Ae="doublearrow",ve=.25,ye=.3,we=.85,Ce=.15,_e={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},Pe={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};ge.algorithm={},ge.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?ge.algorithm.getTempPoint4(n,r,o):this.points[3],this.connPoint=3==a||4==a?fe.PlotUtils.mid(n,r):this.points[4],e=fe.PlotUtils.isClockWise(n,r,o)?(h=ge.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),ge.algorithm.getArrowPoints(this.connPoint,r,o,!0)):(h=ge.algorithm.getArrowPoints(r,this.connPoint,o,!1),ge.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=fe.PlotUtils.getBezierPoints(u),s=fe.PlotUtils.getBezierPoints(e.concat(l.slice(1))),h=fe.PlotUtils.getBezierPoints(h),a=u.concat(d,s,c,h),e=ge.algorithm.array2Dto1D(a);i.controlPoint=[n,r,o,this.tempPoint4,this.connPoint],i.polygonalPoint=t.Cartesian3.fromDegreesArray(e)}return i},ge.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=ge.algorithm.getTempPoint4(i,n,r),this.tempPoint5=fe.PlotUtils.mid(r,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=o<6?fe.PlotUtils.mid(i,n):this.points[5],e=fe.PlotUtils.isClockWise(i,n,r)?(c=ge.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),ge.algorithm.getArrowPoints(this.connPoint,n,r,!0)):(c=ge.algorithm.getArrowPoints(n,this.connPoint,r,!1),ge.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=fe.PlotUtils.getBezierPoints(h),a=fe.PlotUtils.getBezierPoints(e.concat(s.slice(1))),c=fe.PlotUtils.getBezierPoints(c),o=h.concat(u,a,l,c),e=ge.algorithm.array2Dto1D(o);t.controlPoint=[i,n,r,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},ge.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},ge.algorithm.getArrowPoints=function(e,t,i,n){this.type=Ae,this.headHeightFactor=ve,this.headWidthFactor=ye,this.neckHeightFactor=we,this.neckWidthFactor=Ce;var r=fe.PlotUtils.mid(e,t),o=fe.PlotUtils.distance(r,i),a=fe.PlotUtils.getThirdPoint(i,r,0,.3*o,!0),s=fe.PlotUtils.getThirdPoint(i,r,0,.5*o,!0),a=[r,fe.PlotUtils.getThirdPoint(r,a,fe.Constants.HALF_PI,o/5,n),fe.PlotUtils.getThirdPoint(r,s,fe.Constants.HALF_PI,o/4,n),i],r=ge.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=r[0],o=r[4],n=fe.PlotUtils.distance(e,t)/fe.PlotUtils.getBaseLength(a)/2,i=ge.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)},ge.algorithm.getArrowHeadPoints=function(e,t,i){this.type=Ae,this.headHeightFactor=ve,this.headWidthFactor=ye,this.neckHeightFactor=we,this.neckWidthFactor=Ce;var n=fe.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],t=(fe.PlotUtils.distance(t,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,o=n*this.neckHeightFactor,n=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),e=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),o=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,t,!1),n=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,t,!0);return[fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,i,!1),o,r,n,fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,i,!0)]},ge.algorithm.getArrowBodyPoints=function(e,t,i,n){for(var r=fe.PlotUtils.wholeDistance(e),o=fe.PlotUtils.getBaseLength(e)*n,a=(o-fe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=fe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(o/2-(s+=fe.PlotUtils.distance(e[h-1],e[h]))/r*a)/Math.sin(u),p=fe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=fe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ge.algorithm.getTempPoint4=function(e,t,i){var n,r,o,t=fe.PlotUtils.mid(e,t),a=fe.PlotUtils.distance(t,i),i=fe.PlotUtils.getAngleOfThreePoints(e,t,i),a=i<fe.Constants.HALF_PI?(n=a*Math.sin(i),r=a*Math.cos(i),o=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!1),fe.PlotUtils.getThirdPoint(t,o,fe.Constants.HALF_PI,r,!0)):i>=fe.Constants.HALF_PI&&i<Math.PI?(n=a*Math.sin(Math.PI-i),r=a*Math.cos(Math.PI-i),o=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!1),fe.PlotUtils.getThirdPoint(t,o,fe.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=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!0),fe.PlotUtils.getThirdPoint(t,o,fe.Constants.HALF_PI,r,!0)):(n=a*Math.sin(2*Math.PI-i),r=a*Math.cos(2*Math.PI-i),o=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!0),fe.PlotUtils.getThirdPoint(t,o,fe.Constants.HALF_PI,r,!1));return a},ge.algorithm.tailedAttackArrow=function(e,t){e=ge.algorithm.dereplication(e),this.tailWidthFactor=_e.tailWidthFactor,this.swallowTailFactor=_e.swallowTailFactor,this.swallowTailPnt=_e.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=(fe.PlotUtils.isClockWise(e[0],e[1],e[2])&&(n=e[1],r=e[0]),[fe.PlotUtils.mid(n,r)].concat(e.slice(2))),o=ge.algorithm.getAttackArrowHeadPoints(e,n,r,_e),a=o[0],s=o[4],l=fe.PlotUtils.distance(n,r),c=fe.PlotUtils.getBaseLength(e),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=fe.PlotUtils.getThirdPoint(e[1],e[0],0,h,!0);h=ge.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=fe.PlotUtils.getQBSplinePoints(l),c=fe.PlotUtils.getQBSplinePoints(c),n=ge.algorithm.array2Dto1D(l.concat(o,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=t.Cartesian3.fromDegreesArray(n)}return i},ge.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=fe.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],o=fe.PlotUtils.distance(r,e[e.length-2]),t=fe.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=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),e=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),o=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,i,!1),n=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,i,!0);return[fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,t,!1),o,r,n,fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,t,!0)]},ge.algorithm.getAttackArrowBodyPoints=function(e,t,i,n){for(var r=fe.PlotUtils.wholeDistance(e),o=fe.PlotUtils.getBaseLength(e)*n,a=(o-fe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=fe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(o/2-(s+=fe.PlotUtils.distance(e[h-1],e[h]))/r*a)/Math.sin(u),p=fe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=fe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ge.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},ge.algorithm.fineArrow=function(e,t,i){var n,r,o,a,s,l,c;if(!(e.length<2||t.length<2))return n=Pe.tailWidthFactor,c=Pe.neckWidthFactor,s=Pe.headWidthFactor,a=Pe.headAngle,l=Pe.neckAngle,(r=[])[0]=e,r[1]=t,e=r[0],t=r[1],c=(r=fe.PlotUtils.getBaseLength(r))*c,s=r*s,n=fe.PlotUtils.getThirdPoint(t,e,fe.Constants.HALF_PI,r=r*n,!0),r=fe.PlotUtils.getThirdPoint(t,e,fe.Constants.HALF_PI,r,!1),o=fe.PlotUtils.getThirdPoint(e,t,a,s,!1),a=fe.PlotUtils.getThirdPoint(e,t,a,s,!0),s=fe.PlotUtils.getThirdPoint(e,t,l,c,!1),l=fe.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 xe=null;function be(e,t){this.viewer=e,xe=t,this.handler=new xe.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=xe.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=ge,this.tooltip=new I(e,t),this.tooltip.initTool()}be.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},be.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new xe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let Se=null;var Me=function(e,t){be.call(this,e,t),Se=t,this.type="AttackArrow",this.fillMaterial=Se.Color.RED.withAlpha(.5)};function Ie(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}Me.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 Se.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 Se.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){var e=Ie(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))},Se.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!i.floatPoint||i.positions.length<2||(e=Ie(e.endPosition,i.viewer))&&(i.floatPoint.position.setValue(e),i.tooltip.showAtCartesian(e,"右键结束!"),2<=i.positions.length)&&(Se.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)))},Se.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){e=Ie(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}},Se.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=Se.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 Se.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=n.viewer.scene.pick(e.position);if(Se.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=Ie(e.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.selectPoint=null)},Se.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=Ie(e.endPosition,n.viewer);e&&(n.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),n.selectPoint)&&(n.selectPoint.position.setValue(e),n.positions[n.selectPoint.wz-1]=e)},Se.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:Se.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(o){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new Se.PolygonGraphics({hierarchy:new Se.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,Se),r=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(r=n.polygonalPoint),new Se.PolygonHierarchy(r)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=Se.Math.toDegrees(e.latitude);return[Se.Math.toDegrees(e.longitude),t]}},(Me.prototype=Object.create(Object.assign({},Me.prototype,be.prototype))).constructor=Me;let Ee=null;var Te=function(e,t){be.call(this,e,t),Ee=t,this.type="StraightArrow",this.fillMaterial=Ee.Color.fromCssColorString("#0000FF").withAlpha(.8)};function Le(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}Te.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 Ee.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 Ee.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=Le(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()))},Ee.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){i.positions.length<1||(e=Le(e.endPosition,i.viewer))&&(i.tooltip.showAtCartesian(e,"左键单击结束!"),i.floatPoint.position.setValue(e),2<=i.positions.length)&&(Ee.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),t&&t(i.objId)))},Ee.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 Ee.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);Ee.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=Le(e.position,i.viewer))&&i.selectPoint&&i.selectPoint.position&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},Ee.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=Le(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)},Ee.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(e){this.state=-1,this.positions=[];for(var t=[],i=0;i<e.length;i++){var n=Ee.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:Ee.Color.RED}});return e.attr="editPoint",e},showArrowOnMap:function(a){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new Ee.PolygonGraphics({hierarchy:new Ee.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]],Ee);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var r=0;r<n.length;r++){var o=new Ee.Cartesian3(n[r].x,n[r].y,n[r].z);i.push(o)}return new Ee.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=Ee.Math.toDegrees(e.latitude);return[Ee.Math.toDegrees(e.longitude),t]}},(Te.prototype=Object.create(Object.assign({},Te.prototype,be.prototype))).constructor=Te;let De=null;var Be=function(e,t){be.call(this,e,t),De=t,this.type="PincerArrow",this.fillMaterial=De.Color.YELLOW.withAlpha(.8)};function ke(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}function Ge({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}Be.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 n=this;this.state=1,this.handler||(this.handler=new De.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=ke(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)}},De.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!n.floatPoint||n.positions.length<2||(e=ke(e.endPosition,n.viewer))&&(n.floatPoint.position.setValue(e),n.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.positions.length)&&(De.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)))},De.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){if(4<=n.positions.length){e=ke(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}}},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;var i=this;for(let e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new De.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);if(De.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=ke(e.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},De.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=ke(e.endPosition,i.viewer);e&&(i.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),i.selectPoint)&&(i.selectPoint.position.setValue(e),i.positions[i.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){return this.viewer.entities.add({position:e,point:{pixelSize:10,color:De.Color.RED},show:!0})},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.doubleArrow(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]}},(Be.prototype=Object.create(Object.assign({},Be.prototype,be.prototype))).constructor=Be;let Re=null,Oe=null;function ze(e,t,i,n){if(e&&n){const{threeGlobal:i,containerId:r,threeContainerId:o}=n;Re=t,Oe=i,this._viewer=e,this._containerId=r,this._threeContainerId=o,this._Scene=Ge({THREE:Oe,Cesium:Re,viewer:e}),this._initContainer()}}ze.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 Oe.PerspectiveCamera(t,i,n,r),this._three.renderer=new Oe.WebGLRenderer({alpha:!0,antialias:!0,logarithmicDepthBuffer:!0,stencil:!0,depth:!0}),this._three.renderer.outputEncoding=Oe.sRGBEncoding,this._three.renderer.shadowMap.enabled=!0,this._three.renderer.shadowMap.type=Oe.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 Fe{constructor(e){return this.init(e)}init({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:o={},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 a(e).init({containerId:i,viewerConfig:r,extraConfig:o,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 Ve extends Fe{constructor(e){return super({...e,baseExtendsCom:[f,A,B],extendsCom:L,extendsComName:"draw"})}}class He extends Fe{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:J,extendsComName:"customCesiumPlugin"})}}exports.Analysis=class extends Fe{constructor(e){return super({...e,baseExtendsCom:[f,L,le],extendsCom:he,extendsComName:"analysis"})}},exports.AttackArrow=Me,exports.Control=class extends Fe{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:ne,extendsComName:"control"})}},exports.CustomCesiumPlugin=class{constructor(e){return new He(e)}},exports.Draw=class{constructor(e){var t=new Ve(e);return this._initCurrMeasure(e,t)}_initCurrMeasure(e,t){var i=new Me(t.viewer,e.cesiumGlobal),n=new Te(t.viewer,e.cesiumGlobal),e=new Be(t.viewer,e.cesiumGlobal);return{...t,attackArrowObj:i,straightArrowObj:n,pincerArrowObj:e}}},exports.Graphics=class extends Fe{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:c,extendsComName:"graphics"})}},exports.Material=class extends Fe{constructor(e){return super({...e,baseExtendsCom:[f,d],extendsCom:u,extendsComName:"material"})}},exports.Math2d=B,exports.Math3d=A,exports.PassEffect=class extends Fe{constructor(e){return super({...e,baseExtendsCom:[f,d],extendsCom:G,extendsComName:"passEffect"})}},exports.PincerArrow=Be,exports.Plugin=class extends Fe{constructor(e){return super({...e,baseExtendsCom:[f,c],extendsCom:le,extendsComName:"plugin"})}},exports.Primitive=class extends Fe{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:S,extendsComName:"primitive"})}},exports.StraightArrow=Te,exports.ThreeJs=class extends Fe{constructor(e){return super({...e,baseExtendsCom:[],extendsCom:ze,extendsComName:"threeJs"})}},exports.initCesium=function({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:o={},imageryProvider:l={},MapImageryList:h=[],defaultStatic:p,viewer:m}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";if(!i&&!m)throw"Missing containerId parameter, please check the calling function initCesium.";e.defaultValue||(e.Scene.defaultValue=s);var g,y,v,r=new a(e).init({containerId:i,viewerConfig:r,extraConfig:o,MapImageryList:h,imageryProvider:l,viewer:m}),o=(y=e,v=p,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});return{viewer:g=r,material:o([f,d],u),graphics:o(f,c),math3d:o(f,A),math2d:new B(r,e),primitive:o(f,S),draw:o([f,A,B],L),passEffect:o([f,d],G),customCesiumPlugin:o(f,J),control:o(f,ne),plugin:o([f,c],le),base:new f(r,e),analysis:o([f,L,le],he),attackArrowObj:new Me(r,e),straightArrowObj:new Te(r,e),pincerArrowObj:new Be(r,e),threeJs:new ze(r,e,p,t?{threeGlobal:t,containerId:i,threeContainerId:n}:"")}};
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var i=e(require("libgif")),n=require("dat.gui"),r=e(require("echarts"));let o=null;class a{constructor(e){o=e,this.init_data()}init_data(){this.viewer=null}init({containerId:e,viewerConfig:t,extraConfig:i,MapImageryList:n,imageryProvider:r,viewer:a}){var s=e,e={contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:o.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0},r=this.findCesiumProvider(r),l=(o.Ion.defaultAccessToken=i.AccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",e=Object.assign(e,t),a||new o.Viewer(s,{...e,...r}));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);if(!a){const e=s&&1===s.nodeType?s:document.getElementById(s);this.bindContainerResize(l,e)}return this.viewer=l}bindContainerResize(e,t){if("undefined"!=typeof ResizeObserver&&t){const i=()=>{try{"function"==typeof e.isDestroyed&&e.isDestroyed()||e.resize()}catch(e){}},n=new ResizeObserver(i),r=(n.observe(t),requestAnimationFrame(i),e.destroy.bind(e));e.destroy=function(){try{n.disconnect()}catch(e){}return r()}}}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 o[e.type](e.option)}}}function s(e,t){return null!=e?e:t}s.EMPTY_OBJECT=Object.freeze({});let l=null;function c(e,t,i){e&&(l=t,this._graphicsLayer=new l.CustomDataSource("graphicsLayer"),e)&&e.dataSources.add(this._graphicsLayer)}c.prototype={getPointGraphics:function(e){if(e=e||{})return new l.PointGraphics({color:e.color||l.Color.GREEN,pixelSize:e.pixelSize||5,outlineColor:e.outlineColor||l.Color.WHITE,outlineWidth:e.outlineWidth||1})},getLineGraphics:function(e){if((e=e||{})&&e.positions)return new l.PolylineGraphics({show:!0,positions:e.positions,material:e.material||l.Color.YELLOW,width:e.width||1,arcType:l.ArcType.GEODESIC,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)})},getPolygonGraphics:function(e){if((e=e||{})&&e.positions)return new l.PolygonGraphics({hierarchy:{positions:e.positions},material:e.material||l.Color.RED.withAlpha(.2),clampToGround:e.clampToGround||!1})},getLabelGraphics:function(e){if((e=e||{})&&e.l_text)return new l.LabelGraphics({text:e.l_text,font:e.l_font||"14px sans-serif",fillColor:e.l_fillColor||l.Color.GOLD,style:e.l_style||l.LabelStyle.FILL_AND_OUTLINE,outlineColor:e.l_outlineColor||l.Color.GOLD,outlineWidth:e.l_outlineWidth||2,showBackground:e.l_showBackground||!1,backgroundColor:e.l_backgroundColor||new l.Color(.165,.165,.165,.8),verticalOrigin:e.l_verticalOrigin||l.VerticalOrigin.BOTTOM,pixelOffset:e.l_pixelOffset||new l.Cartesian2(0,-30),heightReference:null!=e.l_heightReference?e.l_heightReference:l.HeightReference.NONE})},getBillboardGraphics:function(e){if((e=e||{})&&e.b_img)return new l.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,eyeOffset:null!=e.b_eyeOffset?e.b_eyeOffset:l.Cartesian3.ZERO,pixelOffset:e.b_pixelOffset||new l.Cartesian2(0,-20),scaleByDistance:e.b_scaleByDistance||void 0,heightReference:null!=e.b_heightReference?e.b_heightReference:l.HeightReference.NONE})},getPathGraphics:function(e){if(e=e||{})return new l.PathGraphics({resolution:e.resolution||1,material:new l.PolylineGlowMaterialProperty({glowPower:e.glowPower||.1,color:e.color||l.Color.YELLOW}),width:e.width||30})},getModelGraphics:function(e){if(e=e||{})return new l.ModelGraphics({uri:e.m_url||e.url,scale:e.m_scale||e.scale||10,clampAnimations:!0})},getEllipseGraphics:function(e){if(e=e||{})return new l.EllipseGraphics({semiMajorAxis:e.e_semiMajorAxis||1e6,semiMinorAxis:e.e_semiMinorAxis||1e6,metarial:e.e_metarial||l.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 l.EllipsoidGraphics({radii:new l.Cartesian3(t,t,t),innerRadii:this._objHasOwnProperty(e,"innerRadii",new l.Cartesian3(t/1.5,t/1.5,t/1.5)),maximumCone:e.maximumCone||l.Math.PI_OVER_TWO,stackPartitions:e.stackPartitions||56,slicePartitions:e.slicePartitions||56,outlineWidth:e.outlineWidth||2,outlineColor:e.outlineColor||l.Color.YELLOW,outline:this._objHasOwnProperty(e,"outline",!0),fill:this._objHasOwnProperty(e,"fill",!0),material:e.material||l.Color.RED.withAlpha(.1)})},getBoxGraphics:function(e){if(e=e||{})return new l.BoxGraphics({show:this._objHasOwnProperty(e,"show",!0),fill:this._objHasOwnProperty(e,"fill",!0),dimensions:e.dimensions||new l.Cartesian3(0,0,0),material:e.material,outline:this._objHasOwnProperty(e,"outline",!0),outlineColor:e.outlineColor||l.Color.BLACK,distanceDisplayCondition:e.distanceDisplayCondition||void 0})},getPlaneGraphics:function(e){if(e=e||{})return new l.PlaneGraphics({plane:e.plane||new l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new l.Cartesian2(170,130),material:e.material||l.Color.BLUE})},getCylinderGraphics:function(e){if(e=e||{})return new l.CylinderGraphics({HeightReference:l.HeightReference.RELATIVE_TO_GROUND,length:e.length||250,topRadius:e.topRadius||0,bottomRadius:e.bottomRadius||0,material:e.material||new l.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 l.Scene.WarnLinkMaterialProperty({freely:"cross",color:l.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||l.Color.CHARTREUSE,width:e.width||5,clampToGround:this._objHasOwnProperty(e,"clampToGround",!1)},t.polyline.positions=new l.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 l.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime),e=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=l.Math.toDegrees(e.latitude),e=l.Math.toDegrees(e.longitude);return l.Cartesian3.fromDegrees(e,t,0)},!1),t.cylinder.length=new l.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 l.Scene.CircleFadeMaterialProperty({color:e.color||l.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:l.HeightReference.RELATIVE_TO_GROUND,length:e.length||500,topRadius:e.topRadius||500,bottomRadius:e.bottomRadius||500,material:e.material||new l.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 l.ColorMaterialProperty(new l.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),l.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,a=i.radius||800,s=i.rotateAmount||.05,c=0,h=i.height||1,u=i.scale||null,d=i.scale2||null,i=i.material||new l.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new l.CallbackProperty(function(){return r.transformWGS84ToCartesian(o)},!1),n.orientation=new l.CallbackProperty(function(){return l.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(o),new l.HeadingPitchRoll(l.Math.toRadians(0),l.Math.toRadians(0),l.Math.toRadians(0)))},!1);let e=a,t=!1;return n.ellipse={material:i,height:h,semiMajorAxis:new l.CallbackProperty(function(){return a},!1),semiMinorAxis:new l.CallbackProperty(function(){return a},!1),stRotation:new l.CallbackProperty(function(){return 0<s&&360<=(c+=s)&&(c=0),u&&((t=u<=a||a<=e?!t:t)?a+=2:a-=2),d&&(a<=d?a+=2:a=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||l.Color.RED,r=e.speed||.003,(o=this.createGraphics()).wall={positions:e.positions,material:new l.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new l.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 l.NearFarScalar(150,.7,15e6,.5),verticalOrigin:l.VerticalOrigin.BOTTOM,pixelOffset:t.b_pixelOffset||new l.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 l.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 l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new l.Cartesian2(200,150),material:new l.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 l.Plane(e.normal||l.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new l.Cartesian2(200,150),material:new l.ImageMaterialProperty({image:e.videoElement})},this._graphicsLayer.entities.add(t)},createGifBillboardGraphics:function(e){var t,n,r,o,a,s,c;if(i&&e&&e.position)return n=e.url,r=0,o=n,a=t=[],(s=document.createElement("img")).src=o,s.setAttribute("rel:animated_src",o),s.setAttribute("rel:auto_play","0"),document.body.appendChild(s),c=new i({gif:s}),new Promise(e=>{c.load(()=>{for(let e=1;e<=c.get_length();e++)c.move_to(e),a.push(c.get_canvas().toDataURL());e(a)})}),this._graphicsLayer.entities.add({position:e.position,billboard:{verticalOrigin:l.VerticalOrigin.BASELINE,image:new l.CallbackProperty(function(){return t.length?(r<6*(t.length-1)?r++:r=0,t[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 l.CallbackProperty(function(){return r.transformWGS84ToCartesian(n)},!1),t.orientation=new l.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),l.Transforms.headingPitchRollQuaternion(r.transformWGS84ToCartesian(n),new l.HeadingPitchRoll(l.Math.toRadians(n.heading),l.Math.toRadians(n.pitch),l.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,a=e.speed||.06,s=this,c=n,h=!1;o.length?t.positions=new l.CallbackProperty(function(){var e,t=s.transformCartesianArrayToWGS84Array(o);for(e in t){var i=t[e];(h=r<=n||n<=c?!h:h)?n+=a:n-=a,i.alt=n}return s.transformWGS84ArrayToCartesianArray(t)},!1):t.position=new l.CallbackProperty(function(){var e=s.transformCartesianToWGS84(o);return(h=r<=n||n<=c?!h:h)?n+=a:n-=a,e.alt=n,s.transformWGS84ToCartesian(e)},!1)}catch(e){console.log(e)}},createCanvasGraphics:function(r){r&&r.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:r.positions,material:new l.ImageMaterialProperty({image:new l.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:a="+"}){var s,c,h;if(e)return s=this.createGraphics(),c=0,h=this._calcPoints(t,i,n,c),s.wall={positions:new l.CallbackProperty(()=>l.Cartesian3.fromDegreesArrayHeights(h),!1),material:r||l.Color.AQUAMARINE.withAlpha(.5)},e.clock.onTick.addEventListener(()=>{0<o&&(c+=o,h=this._calcPoints(t,i,n,a+c))}),this._graphicsLayer.entities.add(s)},_computeCirclularFlight(t,i,n,r,o,a){var s=[],c=(s.push(t),s.push(i),s.push(0),l.Cartesian3.distance(l.Cartesian3.fromDegrees(t,i),l.Cartesian3.fromDegrees(n,r)));for(let e=o;e<=o+a;e++){var h=c*Math.sin(e*Math.PI/180),u=Math.cos(e*Math.PI/180),d=(r-i)*u+i;s.push((n-t)*u+t),s.push(d),s.push(h)}return s},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,_calcPoints(e,t,i,n){var r=l.Transforms.eastNorthUpToFixedFrame(l.Cartesian3.fromDegrees(e,t)),o=i*Math.cos(n*Math.PI/180),i=i*Math.sin(n*Math.PI/180),n=l.Cartesian3.fromElements(o,i,0),o=l.Matrix4.multiplyByPoint(r,n,new l.Cartesian3),i=l.Cartographic.fromCartesian(o),r=l.Math.toDegrees(i.longitude),n=l.Math.toDegrees(i.latitude);return this._computeCirclularFlight(e,t,r,n,0,90)}};let h=null;function u(e,t,i){e&&(h=t,this._installMaterial())}function d(){}u.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 h.PolylineCustomMaterialProperty({color:e.color||h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,n=h.defined,r=Object.defineProperties,o=h.Event,a=h.createPropertyDescriptor,s=h.Property,l=h.Material,c=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||h.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,c,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)},l._materialCache.addMaterial(u,{fabric:{type:u,uniforms:{color:i.color||new h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,r=h.defined,e=Object.defineProperties,o=h.Event,a=h.createPropertyDescriptor,s=h.Property,l=h.Material,c=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 c},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)},l._materialCache.addMaterial(c,{fabric:{type:c,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=h.Color,i=h.defaultValue||h.Scene.defaultValue,e=Object.defineProperties,n=h.Event,r=h.Property,o=h.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&&h.Property.equals(this._color,e._color)},e(a.prototype,{color:h.createPropertyDescriptor("color"),duration:h.createPropertyDescriptor("duration")}),h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,i=Object.defineProperties,n=h.Event,r=h.Property,o=h.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&&h.Property.equals(this._color,e._color)},i(s.prototype,{color:h.createPropertyDescriptor("color")}),h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,i=h.defined,n=Object.defineProperties,r=h.Event,o=h.createPropertyDescriptor,a=h.Property,s=h.Material,l=e.WHITE;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||h.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0,this._img=e.imgUrl||s.PolylineCityLinkImage}n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),c.prototype.getType=function(){return s.PolylineCityLinkType},c.prototype.getValue=function(e,t){return(t=i(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.image=this._img,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},c.prototype.equals=function(e){return this===e||e instanceof c&&a.equals(this._color,e._color)},h.Scene.PolylineCityLinkMaterialProperty=c,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=h.Color,t=h.defaultValue||h.Scene.defaultValue,n=h.defined,e=Object.defineProperties,r=h.Event,o=h.createPropertyDescriptor,a=h.Property,s=h.Material;function l(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(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.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},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._color,e._color)},e(l.prototype,{color:o("color")}),h.Scene.WarnLinkMaterialProperty=l,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=h.Color,i=h.defaultValue||h.Scene.defaultValue,e=Object.defineProperties,n=h.Event,r=h.createPropertyDescriptor,o=h.Property,a=h.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,h.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")}),h.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=h.Color,t=h.defaultValue||h.Scene.defaultValue,i=Object.defineProperties,n=h.createPropertyDescriptor,r=h.Event,o=h.Property,a=h.Material,s=this.getDfSt(["primitive","WaterPrimitive"]);function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this.color=e.color||h.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(l.prototype,{isConstant:{get:function(){return!1},configurable:!0},definitionChanged:{get:function(){return this._definitionChanged},configurable:!0},color:n("color"),duration:n("duration")}),l.prototype.getType=function(){return a.PolylineTrailLinkType},l.prototype.getValue=function(e,t){return(t=h.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},l.prototype.equals=function(e){return this===e||e instanceof l&&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 }",h.Scene.PolylineTrailLinkMaterial=l,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}})}},d.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 p={},m=void 0;function f(e,t,i){e&&(this._viewer=e,p=t,m=i,this._drawLayer=new p.CustomDataSource("drawLayer"),e&&e.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}f.prototype={createGraphics:function(){return new p.Entity},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,getDfSt(e){if(m)return e=e.reduce((e,t)=>(e||m)[t],void 0),m.baseService+e},setOneSkyBox:function(){return new p.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 p.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 p.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 p.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 p.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 p.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 p.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 p.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(e){if(this._viewer&&e)return this._viewer.scene.postProcessStages.add(new p.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 p.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 p.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 p.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 p.Cartesian4(10,0,200,.3),fogColor:p.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 p.Cartesian3(0,e.distance,window.opt.distance),e.position=p.Cartesian3.add(e.position,t,new p.Cartesian3)),this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)}}))},flyTo:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new p.Cartesian3(0,e.distance,0),e.position=p.Cartesian3.add(e.position,t,new p.Cartesian3)),this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)},easingFunction:e.easingFunction||p.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback}))},transformCartesianToWGS84:function(e){if(this._viewer&&e)return e=p.Cartographic.fromCartesian(e),{lng:p.Math.toDegrees(e.longitude),lat:p.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?p.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=t||e.alt,p.Ellipsoid.WGS84):p.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?p.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):p.Cartographic.ZERO},lnglatArrayToCartesians:function(t){if(!t||t.length<1)return[];var i=[];for(let e=0;e<t.length;e++){var n=p.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=p.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=p.Math.toRadians(-30),r=12,o=5e3,e=p.JulianDate.fromDate(new Date),a=(t.clock.startTime=e.clone(),t.clock.currentTime=e.clone(),t.clock.clockRange=p.ClockRange.CLAMPED,t.clock.clockStep=p.ClockStep.SYSTEM_CLOCK,t.camera.heading),s=function(){var e=p.JulianDate.secondsDifference(t.clock.currentTime,t.clock.startTime),e=p.Math.toRadians(e*r)+a;t.scene.camera.setView({destination:i,orientation:{heading:e,pitch:n}}),t.scene.camera.moveBackward(o),0<=p.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 p.Cesium3DTileFeature?!0:o)&&(r=this._viewer.scene.pickPosition(e))&&((i=p.Cartographic.fromCartesian(r)).height<0&&(i.height=0),s=p.Math.toDegrees(i.longitude),t=p.Math.toDegrees(i.latitude),i=i.height,r=this.transformWGS84ToCartesian({lng:s,lat:t,alt:i})),!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 n&&!o&&(r=this._viewer.scene.pickPosition(e))&&((t=p.Cartographic.fromCartesian(r)).height<0&&(t.height=0),i=p.Math.toDegrees(t.longitude),s=p.Math.toDegrees(t.latitude),t=t.height,r=this.transformWGS84ToCartesian({lng:i,lat:s,alt:t})),(r=o||a||n?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,u=this._viewer.scene.camera.pickEllipsoid(new p.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(u)return e=180*(u=p.Ellipsoid.WGS84.cartesianToCartographic(u)).longitude/Math.PI,u=180*u.latitude/Math.PI,n=this._viewer.camera._direction,t=p.Math.toDegrees(n.x),i=p.Math.toDegrees(n.y),n=p.Math.toDegrees(n.z),r=this._viewer.camera.positionCartographic.height,o=p.Math.toDegrees(this._viewer.camera.heading),a=p.Math.toDegrees(this._viewer.camera.pitch),s=p.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:u,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 p.Cartesian3(t,i,n)}}},pickUpPosition(e){return this.getCatesian3FromPX(e.position)},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={cameraPosistion:t.camera.position,heading:t.camera.heading,pitch:t.camera.pitch,roll:t.camera.roll},(i=p.Cartographic.fromCartesian(i)).height<0&&(i.height=0),i={alt:i.height,lat:p.Math.toDegrees(i.latitude),lon:p.Math.toDegrees(i.longitude)},n=n.pickPosition(e.position),{wgs84Coor:i,graphicCoor:{height:(e=p.Cartographic.fromCartesian(n)).height,latitude:p.Math.toDegrees(e.latitude),longitude:p.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 p.ScreenSpaceEventHandler(this._viewer.canvas),t&&s.setInputAction(function(e){t(e,s)},p.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(e){i(e,s)},p.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(e){n(e,s)},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),r&&s.setInputAction(function(e){r(e,s)},p.ScreenSpaceEventType.LEFT_DOWN),o&&s.setInputAction(function(e){o(e,s)},p.ScreenSpaceEventType.WHEEL),a)&&s.setInputAction(function(e){a(e,s)},p.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(t){var i,n;this._viewer&&(i=new p.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)},p.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(){p.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 p.UrlTemplateImageryProvider(e)}},_installTdtImageryProvider:function(){p.Scene.TdtImageryProvider=function(e){return new p.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(){p.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 p.UrlTemplateImageryProvider(e)}},_installGooGleImageryProvider:function(){p.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 p.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 p.WebMercatorTilingScheme({rectangleSouthwestInMeters:new p.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new p.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 p.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new p.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new p.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new p.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),p.ImageryProvider.loadImage(this,o);throw new p.DeveloperError("requestImage must not be called before the imagery provider is ready.")},p.Scene.BaiduImageryProvider=e},_installGroundSkyBox:function(){var a=p.BoxGeometry,s=p.Cartesian3,t=p.defaultValue||p.Scene.defaultValue,l=p.defined,i=p.destroyObject,c=p.DeveloperError,h=p.GeometryPipeline,e=p.Matrix3,u=p.Matrix4,d=p.Transforms,m=p.VertexFormat,f=p.BufferUsage,g=p.CubeMap,n=p.DrawCommand,A=p.loadCubeMap,y=p.RenderState,v=p.VertexArray,w=p.BlendingState,C=p.SceneMode,_=p.ShaderProgram,b=p.ShaderSource;function r(e){this.sources=e.sources,this._sources=void 0,this.show=t(e.show,!0),this._command=new n({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(u.getRotation)||(u.getRotation=u.getMatrix3);var P=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 g({context:n,source:r}))}var o=this._command;if(o.modelMatrix=d.eastNorthUpToFixedFrame(e.camera._positionWC),l(o.vertexArray)||(o.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return u.getRotation(o.modelMatrix,P)}},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:f._DRAW}),o.renderState=y.fromCache({blending:w.ALPHA_BLEND})),l(o.shaderProgram)&&this._useHdr===t||(r=new b({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)},p.Scene.GroundSkyBox=r},removeHandlerByName(e=[]){e.forEach(e=>{this._viewer.screenSpaceEventHandler.removeInputAction(p.ScreenSpaceEventType[e])})}};let g={};function A(e,t){e&&(this._viewer=e,g=t)}A.prototype={splitCartesians3:function(e){for(var t=[],i=0;i<e.length;i+=3){var n=new g.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=g.Cartographic.fromCartesian(e),a=g.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=g.Cartesian3.clone(e),u=g.Cartesian3.clone(t),d=g.Cartesian3.distance(h,g.Cartesian3.ZERO),p=g.Cartesian3.distance(u,g.Cartesian3.ZERO);if(g.Cartesian3.normalize(h,h),g.Cartesian3.normalize(u,u),0!=g.Cartesian3.distance(h,u)){var m=g.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*m)/Math.sin(m),w=Math.sin(A*m)/Math.sin(m),v=g.Cartesian3.multiplyByScalar(h,v,new g.Cartesian3),w=g.Cartesian3.multiplyByScalar(u,w,new g.Cartesian3),v=g.Cartesian3.add(v,w,new g.Cartesian3),w=A*Math.PI,y=d*y+p*A+Math.sin(w)*c,v=g.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=g.Transforms.eastNorthUpToFixedFrame(i),n=g.Matrix4.inverse(n,new g.Matrix4),i=g.Matrix4.multiplyByPoint(n,i,new g.Cartesian3),n=g.Matrix4.multiplyByPoint(n,r,new g.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=g.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=g.Cartographic.fromCartesian(e),t=g.Cartographic.fromCartesian(t),(i=new g.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 g.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=g.Cartesian3.normalize(g.Cartesian3.subtract(t,e,new g.Cartesian3),new g.Cartesian3),e=new g.Ray(e,t),t=[],n?t=this._viewer.scene.drillPickFromRay(e,10,i):(n=this._viewer.scene.pickFromRay(e,i),g.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 g.Cartesian3,u=new g.Cartesian3,d=new g.Quaternion,p=new g.Matrix3,t=e+t,g.Cartesian3.multiplyByScalar(n,Math.cos(t),h),g.Cartesian3.multiplyByScalar(i,Math.sin(t),u),g.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,g.Quaternion.fromAxisAngle(h,t,d),g.Matrix3.fromQuaternion(d,p),g.Matrix3.multiplyByVector(p,l,c),g.Cartesian3.normalize(c,c),g.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(e,t,i){if(this._viewer){for(var n=new g.Cartesian3,r=new g.Cartesian3,o=new g.Cartesian3,a=new g.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 m=p+1,f=p+2,A=g.Cartesian3.fromArray(e,p,n),y=(s.scaleToGeodeticSurface(A,A),g.Cartesian3.clone(A,r)),v=s.geodeticSurfaceNormal(A,a),w=g.Cartesian3.multiplyByScalar(v,l,o);g.Cartesian3.add(A,w,A),i&&(g.Cartesian3.multiplyByScalar(v,c,w),g.Cartesian3.add(y,w,y),h[p+d]=y.x,h[m+d]=y.y,h[f+d]=y.z),h[p]=A.x,h[m]=A.y,h[f]=A.z}return h}},computeEllipseEdgePositions:function(e){if(this._viewer){for(var t=new g.Cartesian3,i=new g.Cartesian3,n=new g.Cartesian3,r=new g.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=g.Cartesian3.magnitude(l),p=g.Cartesian3.normalize(l,t),m=g.Cartesian3.cross(g.Cartesian3.UNIT_Z,l,i),m=g.Cartesian3.normalize(m,m),f=g.Cartesian3.cross(p,m,n),A=Math.ceil(2*g.Math.PI/e),y=e,v=r,w=0,C=[],_=0;_<A;_++)v=this.getPointOnEllipsoid(_*y,s,f,m,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 g.Cartesian3,i=new g.Cartesian3,n=new g.Cartesian3,r=new g.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=g.Cartesian3.magnitude(c),m=g.Cartesian3.normalize(c,t),f=g.Cartesian3.cross(g.Cartesian3.UNIT_Z,c,i),f=g.Cartesian3.normalize(f,f),A=g.Cartesian3.cross(m,f,n),y=Math.ceil(l/e),v=e,w=r,C=0,_=[],b=0;b<y;b++)w=this.getPointOnEllipsoid(b*v,s,A,f,h,d,u,p,m,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(g.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(g.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 g.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 g.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 g.Cartographic(c,h))}n.push(new g.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 g.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 g.Cartographic(c,h,u))}return i.push(new g.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 g.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 g.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 g.Cartographic(i,r,o)):null}};v={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},y=function(){function e(e){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=e.xField||e.defaultXField,this._yField=e.yField||e.defaultYField,this._valueField=e.valueField||e.defaultValueField,e.radius&&(this._cfgRadius=e.radius)}var c=v.defaultRadius;return e.prototype={_organiseData:function(e,t){var i=e[this._xField],n=e[this._yField],r=this._radi,o=this._data,a=this._max,s=this._min,l=e[this._valueField]||1,e=e.radius||this._cfgRadius||c;return o[i]||(o[i]=[],r[i]=[]),o[i][n]?o[i][n]+=l:(o[i][n]=l,r[i][n]=e),o[i][n]>a?(t?this.setDataMax(o[i][n]):this._max=o[i][n],!1):{x:i,y:n,value:l,radius:e,min:s,max:a}},_unOrganizeData:function(){var e,t=[],i=this._data,n=this._radi;for(e in i)for(var r in i[e])t.push({x:e,y:r,radius:n[e][r],value:i[e][r]});return{min:this._min,max:this._max,data:t}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(0<arguments[0].length)for(var e=arguments[0],t=e.length;t--;)this.addData.call(this,e[t]);else{var i=this._organiseData(arguments[0],!0);i&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[i]})}return this},setData:function(e){var t=e.data,i=t.length;this._data=[],this._radi=[];for(var n=0;n<i;n++)this._organiseData(t[n],!1);return this._max=e.max,this._min=e.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(e){return this._max=e,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(e){return this._min=e,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(e){this._coordinator=e},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},e}(),w=function(){function o(e){var t,i=e.gradient||e.defaultGradient,n=(e=document.createElement("canvas")).getContext("2d"),r=(e.width=256,e.height=1,n.createLinearGradient(0,0,256,1));for(t in i)r.addColorStop(t,i[t]);return n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}function e(e){var t=e.container,i=this.shadowCanvas=document.createElement("canvas"),n=this.canvas=e.canvas||document.createElement("canvas"),r=(this._renderBoundaries=[1e4,1e4,0,0],getComputedStyle(e.container)||{});n.className="heatmap-canvas",this._width=n.width=i.width=e.width||+r.width.replace(/px/,""),this._height=n.height=i.height=e.height||+r.height.replace(/px/,""),this.shadowCtx=i.getContext("2d"),this.ctx=n.getContext("2d"),n.style.cssText=i.style.cssText="position:absolute;left:0;top:0;",t.style.position="relative",t.appendChild(n),this._palette=o(e),this._templates={},this._setStyles(e)}return e.prototype={renderPartial:function(e){0<e.data.length&&(this._drawAlpha(e),this._colorize())},renderAll:function(p){this._clear(),0<p.data.length&&(this._drawAlpha(function(e){for(var t=[],i=p.min,n=p.max,r=p.radi,o=(e=p.data,Object.keys(e)),a=o.length;a--;)for(var s=o[a],l=Object.keys(e[s]),c=l.length;c--;){var h=l[c],u=e[s][h],d=r[s][h];t.push({x:s,y:h,value:u,radius:d})}return{min:i,max:n,data:t}}()),this._colorize())},_updateGradient:function(e){this._palette=o(e)},updateConfig:function(e){e.gradient&&this._updateGradient(e),this._setStyles(e)},setDimensions:function(e,t){this._width=e,this._height=t,this.canvas.width=this.shadowCanvas.width=e,this.canvas.height=this.shadowCanvas.height=t},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(e){this._blur=0==e.blur?0:e.blur||e.defaultBlur,e.backgroundColor&&(this.canvas.style.backgroundColor=e.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=e.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=e.height||this._height,this._opacity=255*(e.opacity||0),this._maxOpacity=255*(e.maxOpacity||e.defaultMaxOpacity),this._minOpacity=255*(e.minOpacity||e.defaultMinOpacity),this._useGradientOpacity=!!e.useGradientOpacity},_drawAlpha:function(e){for(var t,i,n,r,o,a=this._min=e.min,s=this._max=e.max,l=(e=e.data||[]).length,c=1-this._blur;l--;){var h,u=e[l],d=u.x,p=u.y,m=u.radius,u=Math.min(u.value,s),d=d-m,p=p-m,f=this.shadowCtx,g=(this._templates[m]?h=this._templates[m]:this._templates[m]=(t=m,i=c,o=g=r=n=void 0,n=document.createElement("canvas"),r=n.getContext("2d"),o=g=t,n.width=n.height=2*t,1==i?(r.beginPath(),r.arc(g,o,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((i=r.createRadialGradient(g,o,t*i,g,o,t)).addColorStop(0,"rgba(0,0,0,1)"),i.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=i,r.fillRect(0,0,2*t,2*t)),h=n),(u-a)/(s-a));f.globalAlpha=g<.01?.01:g,f.drawImage(h,d,p),d<this._renderBoundaries[0]&&(this._renderBoundaries[0]=d),p<this._renderBoundaries[1]&&(this._renderBoundaries[1]=p),d+2*m>this._renderBoundaries[2]&&(this._renderBoundaries[2]=d+2*m),p+2*m>this._renderBoundaries[3]&&(this._renderBoundaries[3]=p+2*m)}},_colorize:function(){for(var e=this._renderBoundaries[0],t=this._renderBoundaries[1],i=this._renderBoundaries[2]-e,n=this._renderBoundaries[3]-t,r=this._width,o=this._height,a=this._opacity,s=this._maxOpacity,l=this._minOpacity,c=this._useGradientOpacity,r=this.shadowCtx.getImageData(e=e<0?0:e,t=t<0?0:t,i=r<e+i?r-e:i,n=o<t+n?o-t:n),h=r.data,u=h.length,d=this._palette,p=3;p<u;p+=4){var m=h[p],f=4*m;f&&(m=0<a?a:m<s?m<l?l:m:s,h[p-3]=d[f],h[p-2]=d[1+f],h[p-1]=d[2+f],h[p]=c?d[3+f]:m)}this.ctx.putImageData(r,e,t),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(e){var e=this.shadowCtx.getImageData(e.x,e.y,1,1).data[3],t=this._max,i=this._min;return Math.abs(t-i)*(e/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}},e}(),C=function(){var e=!1;return e="canvas2d"===v.defaultRenderer?w:e}(),_=function(){for(var e={},t=arguments.length,i=0;i<t;i++){var n,r=arguments[i];for(n in r)e[n]=r[n]}return e},P=function(){e.prototype={on:function(e,t,i){var n=this.cStore;n[e]||(n[e]=[]),n[e].push(function(e){return t.call(i,e)})},emit:function(e,t){var i=this.cStore;if(i[e])for(var n=i[e].length,r=0;r<n;r++)(0,i[e][r])(t)}};var r=e;function e(){this.cStore={}}function t(){var t,e,i=this._config=_(v,arguments[0]||{});if(this._coordinator=new r,i.plugin){var n=i.plugin;if(!v.plugins[n])throw new Error("Plugin '"+n+"' not found. Maybe it was not registered.");var n=v.plugins[n];this._renderer=new n.renderer(i),this._store=new n.store(i)}else this._renderer=new C(i),this._store=new y(i);n=(t=this)._renderer,i=t._coordinator,e=t._store,i.on("renderpartial",n.renderPartial,n),i.on("renderall",n.renderAll,n),i.on("extremachange",function(e){t._config.onExtremaChange&&t._config.onExtremaChange({min:e.min,max:e.max,gradient:t._config.gradient||t._config.defaultGradient})}),e.setCoordinator(i)}return t.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(e){return this._config=_(this._config,e),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(e){return this._store.getValueAt?this._store.getValueAt(e):this._renderer.getValueAt?this._renderer.getValueAt(e):null}},t}();var v,y,w,C,_,P,x={create:function(e){return new P(e)},register:function(e,t){v.plugins[e]=t}};let b=null;function S(e,t,i){e&&(this._viewer=e,b=t,this._installPrimitives())}S.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive()},_installTetrahedronPrimitive:function(){try{var i=b.Cartesian3,n=b.ComponentDatatype,a=b.PrimitiveType,r=b.BoundingSphere,o=b.GeometryAttribute,s=b.GeometryPipeline,l=b.Geometry,c=b.defined,h=b.RenderState,u=b.ShaderSource,d=b.ShaderProgram,p=b.DrawCommand,m=b.Pass,f=b.Appearance,g=b.BufferUsage,t=b.Color,A=b.VertexArray,y=(b.buildModuleUrl,b.Matrix4),v=b.Matrix3,w=b.Texture,e=b.Resource,C=b.Transforms,_=b.defaultValue||b.Scene.defaultValue,P=this._viewer,x=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png",S=function(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=_(e.distance,1),this._setInterval=void 0,this._viewer=P,this._speed=_(e.speed,1),this._color=_(e.color,new t(1,1,0,.8)),this._scale=_(e.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=x,this._modelMatrix=k(this),this._height=B(this),L(this)};S.prototype.update=function(e){this.show&&(c(this._command)||(this._command=this._createCommand(e.context,this)),c(this._command))&&e.commandList.push(this._command)},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},S.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 b.Cartesian3(0,0,t._height),e=(y.multiplyByTranslation(t._modelMatrix,e,t._modelMatrix),y.fromRotationTranslation(v.fromRotationZ(b.Math.toRadians(t._speed))));y.multiply(t._modelMatrix,e,t._modelMatrix)},5)},S.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const M=function(e,t){var i=T(),n=D(),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 A.fromGeometry({context:e,geometry:t,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:g.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 "},D=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 "},L=function(i){e.createIfNeeded(i._imageUrl).fetchImage().then(function(e){var t=i._viewer.scene.context,t=c(e.internalFormat)?new w({context:t,pixelFormat:e.internalFormat,width:e.naturalWidth,height:e.naturalHeight,source:{arrayBufferView:e.bufferView}}):new w({context:t,source:e});i._texture=t})},k=function(e){var t=C.eastNorthUpToFixedFrame(e._localPosition),i=y.fromScale(e._scale),n=y.multiply(t,i,new y);return e._scaleMatrix=i,e._enuMatrix=t,n},B=function(e){var t=i.fromElements(0,0,e._distance,new b.Cartesian3),t=b.Matrix4.multiplyByPoint(e._enuMatrix,t,new i),t=y.multiplyByPoint(e._viewer.scene.camera._viewMatrix,t,new i),e=y.multiplyByPoint(e._viewer.scene.camera.frustum.projectionMatrix,t,new i);return i.normalize(e,new i).z};b.Scene.TetrahedronPrimitive=S}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 b.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new b.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=b.Matrix4.getTranslation(e.modelMatrix,new b.Cartesian3),e=e.boundingSphere,i=e.radius,n=new b.ArrowPolylinePrimitive({id:"axisZ",color:b.Color.RED,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),r=new b.ArrowPolylinePrimitive({id:"axisX",color:b.Color.GREEN,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),t=new b.ArrowPolylinePrimitive({id:"axisY",color:b.Color.BLUE,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),i=b.Matrix3.fromRotationY(b.Math.toRadians(90)),i=(this._rotationX=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(r.geometryInstances[0].modelMatrix,this._rotationX,r.geometryInstances[0].modelMatrix),b.Matrix4.multiply(r.geometryInstances[1].modelMatrix,this._rotationX,r.geometryInstances[1].modelMatrix),b.Matrix3.fromRotationX(b.Math.toRadians(90)));this._rotationY=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(t.geometryInstances[0].modelMatrix,this._rotationY,t.geometryInstances[0].modelMatrix),b.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(b.Math.toRadians(e)),n=Math.cos(b.Math.toRadians(e)),r=this._radius*n,o=this._radius*i;t.push(new b.Cartesian3(r,o,0))}var e=this._createAxisSpheres("axisSphereZ",t,this._matrix,b.Color.RED);this._layer._primitives.add(e);const i=this._createAxisSpheres("axisSphereY",t,this._matrix,b.Color.GREEN),n=(this._layer._primitives.add(i),b.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",t,this._matrix,b.Color.BLUE));this._layer._primitives.add(n),b.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(e,t,i,n){t=new b.PolylineGeometry({positions:t,width:10}),t=new b.GeometryInstance({geometry:t,id:e,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(n)}});return new b.Primitive({geometryInstances:t,appearance:new b.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=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.Matrix4.multiply(r.modelMatrix,o,r.modelMatrix)}}var e=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.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=b.Matrix4.fromRotationTranslation(i);b.Matrix4.multiply(r.modelMatrix,o,r.modelMatrix)}}var e=b.Matrix4.fromRotationTranslation(i);b.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(b.Matrix3.fromRotationX(b.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(b.Matrix3.fromRotationY(b.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(b.Matrix3.fromRotationZ(b.Math.toRadians(1)))}},b.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(e=>{e=viewer.scene.pick(e.position);e&&e.id&&(this._xyzPid=e.id,this._xyzState=!0)},b.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},b.ScreenSpaceEventType.LEFT_UP)}},b.Scene.XyzAxisPrimitive=e},_installArrowPolylinePrimitive:function(){b.Scene.ArrowPolylinePrimitive=function(e={}){this._color=e.color||b.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=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=b.CylinderGeometry.createGeometry(new b.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 b.Cartesian3;o.length?(a.x=o[0],a.y=o[1],a.z=o[2]):b.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 b.Primitive({modelMatrix:b.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new b.GeometryInstance({id:e+"-line",geometry:t}),new b.GeometryInstance({id:e+"-arrow",geometry:i})],appearance:new b.MaterialAppearance({material:b.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){const n=b.defaultValue||b.Scene.defaultValue;function e(e){var t=(e=n(e,n.EMPTY_OBJECT)).scene;if(!b.defined(t))throw new b.DeveloperError("scene is required.");var i=(this._scene=t)._context;if(!b.defined(i))throw new b.DeveloperError("context is required.");if(!b.defined(e.viewerPosition))throw new b.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 b.Camera(t),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=n(e.horizontalFov,60),this._verticalFov=n(e.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();t=new b.Cartesian3(0,0,100),e=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.multiplyByPoint(e,t,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new b.Matrix4,this._shadowMap=new b.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=b.Color.RED,this._visiblyColor=b.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:b.Color.RED,visibly:b.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&&!b.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new b.DebugCameraPrimitive({camera:this._depthCamera,color:b.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=b.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:b.Math.toRadians(this._direction),pitch:b.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},e.prototype.setPoseByTargetPoint=function(e){this.distance=b.Cartesian3.distance(this._viewerPosition,e);var t=new b.Cartesian3,i=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.inverse(i,i),b.Matrix4.multiplyByPoint(i,e,t),b.Cartesian3.normalize(t,t),this.direction=b.Math.toDegrees(Math.atan2(t.x,t.y)),this.pitch=b.Math.toDegrees(Math.asin(t.z))},e.prototype._updateHintLine=function(e){var t,i=this._positions,n=b.Math.toRadians(this._horizontalFov),r=b.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 b.Cartesian3(a,r,-this._distance),r=new b.Cartesian3(o,t,0),o=(b.Matrix4.multiplyByPoint(this._modelMatrix,a,a),b.Matrix4.multiplyByPoint(this._modelMatrix,r,r),b.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=-(y=Math.atan(p)),f=y/10,g=0;g<21;++g)l=m+g*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,A=0;A<21;++A){d=c+A*h;for(var y,p=t/(this._distance/Math.cos(d)),m=-(y=Math.atan(p)),f=y/2,v=0;v<5;++v)l=m+v*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 w,C=e.context,a=b.Buffer.createIndexBuffer({context:C,typedArray:new Uint32Array(this._indices),usage:b.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),r=b.Buffer.createVertexBuffer({context:C,typedArray:b.ComponentDatatype.createTypedArray(b.ComponentDatatype.FLOAT,this._positions),usage:b.BufferUsage.STATIC_DRAW}),n=[],e=(n.push({index:0,vertexBuffer:r,componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new b.VertexArray({context:C,attributes:n,indexBuffer:a}));b.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=e,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=o):(r=b.ShaderProgram.fromCache({context:C,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=b.RenderState.fromCache({depthTest:{enabled:!0}}),a={u_bgColor:function(){return w._lineColor},u_modelViewMatrix:function(){return C.uniformState.modelView}},(w=this)._drawLineCommand=new b.DrawCommand({boundingVolume:o,modelMatrix:w._modelMatrix,primitiveType:b.PrimitiveType.LINES,vertexArray:e,shaderProgram:r,castShadows:!1,receiveShadows:!1,uniformMap:a,renderState:n,pass:b.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},b.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=b.Cartesian3.fromDegrees(0,0,-10),l=b.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 b.Primitive({geometryInstances:new b.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 b.Appearance({renderState:{blending:b.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:e,vertexShaderSource:t})},createGeometry:function(e,t,i){return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),color:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:t})},indices:i,primitiveType:b.PrimitiveType.POINTS,boundingSphere:b.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 b.Primitive({geometryInstances:new b.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 b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},b.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 b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createAppearence=function(){return new b.EllipsoidSurfaceAppearance({material:new b.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 b.PolygonGeometry({polygonHierarchy:new b.PolygonHierarchy(b.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 "},S.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 b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:e}),appearance:this._appearance,asynchronous:!1})))},b.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 b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createGeometry=function(){var e=new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:e},indices:this._indices,primitiveType:b.PrimitiveType.TRIANGLES,boundingSphere:b.BoundingSphere.fromVertices(positions)})},e.prototype._createAppearence=function(){return new b.Appearance({material:new b.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:b.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; } "},b.Scene.TexturePrimitive=e},_installProbingPrimitive:function(){var t={color:new b.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:b.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 b.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:b.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),e=new b.GeometryInstance({geometry:e,modelMatrix:this.getModelMatrix()}),t=new b.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new b.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 b.Matrix4.multiplyByTranslation(b.Transforms.eastNorthUpToFixedFrame(this._center),new b.Cartesian3(0,0,.5*this._length),new b.Matrix4)},e.prototype.updateModelMatrix=function(){},e.prototype.getMaterial=function(){return new b.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)},b.Scene.ProbingPrimitive=e},_initCustomPrimitive:function(e){let u=b;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){!0!==this._destroyed&&(null===this.drawCommand&&this.createDrawCommand(e.context),null===this._texture&&this.createTexture(e.context),e.commandList.push(this.drawCommand))},t.prototype.isDestroyed=function(){return!0===this._destroyed},t.prototype.destroy=function(){this._texture&&!this._texture.isDestroyed()&&this._texture.destroy(),this._texture=null,this.drawCommand&&this.drawCommand.vertexArray&&!this.drawCommand.vertexArray.isDestroyed()&&this.drawCommand.vertexArray.destroy(),this.drawCommand=null,this._destroyed=!0},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)},_heatmap:function(){let P=null,S=[103.8258,30.58595,104.252263,30.87];return{getHeatmap({heatData:e,boundsArr:t}){S=t||S;var i=[];for(const t of e){var n=t.lng,r=t.lat,n=Math.round((n-S[0])/(S[2]-S[0])*1920),r=1080-Math.round((r-S[1])/(S[3]-S[1])*1080);i.push({x:n,y:r,value:t.num})}return this.createHeatmap(i),this.createPrimitive()},createHeatmap(e){var t=document.createElement("div");t.setAttribute("style","width: 1920px; height: 1080px; margin: 0px; display: none;"),document.body.appendChild(t),(P=x.create({container:t,radius:24,maxOpacity:1,minOpacity:.1,blur:.85,gradient:{".2":"blue",".4":"green",".6":"yellow",".8":"orange",".9":"red"}})).setData({min:0,max:100,data:e})},createPrimitive(){var e=new b.ImageMaterialProperty({image:P._renderer.canvas}),e={geometryInstances:this.generateGeometryInstance(),appearance:new b.MaterialAppearance({material:b.Material.fromType(b.Material.ImageType,e.getValue(new b.JulianDate))}),allowPicking:!1,asynchronous:!1,show:!1};return new b.Primitive(e)},generateGeometryInstance(){var i=S[2]-S[0],n=S[3]-S[1],r=S[0],o=S[1],a=Math.floor(i/.001),s=Math.floor(n/.001),l=[];for(let t=0;t<s+1;t++){var c=[];for(let e=0;e<a+1;e++){var h=r+(e==a?i:.001*e),u=o+(t==s?n:.001*t),d={x:Math.round((h-r)/i*1920),y:1080-Math.round((u-o)/n*1080)},p=P.getValueAt(d),d=P._renderer.ctx.getImageData(d.x,d.y,1,1).data;c.push([h,u,0+5*p,d.map(e=>e/255),[(h-r)/i,(u-o)/n]])}l.push(c)}var m=[],f=[],g=[],A=[];let y=0;for(let t=0;t<s;t++)for(let e=0;e<a;e++){var v=l[t][e],w=l[t][e+1],C=l[t+1][e+1],_=l[t+1][e];this.addVertices(v,m,g,A),this.addVertices(w,m,g,A),this.addVertices(C,m,g,A),this.addVertices(v,m,g,A),this.addVertices(C,m,g,A),this.addVertices(_,m,g,A),f.push(y+0,y+1,y+2,y+3,y+4,y+5),y+=6}return new b.GeometryInstance({geometry:b.GeometryPipeline.computeNormal(this.generateGeometry(m,g,f,A))})},addVertices(e,t,i,n){var r=b.Cartesian3.fromDegrees(e[0],e[1],e[2]);t.push(r.x,r.y,r.z),i.push(e[3][0],e[3][1],e[3][2],e[3][3]),n.push(e[4][0],e[4][1])},generateGeometry(e,t,i,n){t=new b.GeometryAttributes({position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(e)}),color:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:new Float32Array(t)}),st:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),n=b.BoundingSphere.fromVertices(e,new b.Cartesian3(0,0,0),3);return new b.Geometry({attributes:t,indices:i,primitiveType:b.PrimitiveType.TRIANGLES,boundingSphere:n})}}},createHeatmap3d(e){return this._heatmap().getHeatmap(e)}};let M=null;class E{constructor(e,t){M=t,this._viewer=e,this._labelEntity=null,this.$graphics=new c(e,t),this.isInit=!1}initTool(){this.isInit||(this._labelEntity=this._viewer.entities.add({position:M.Cartesian3.fromDegrees(0,0),label:this.$graphics.getLabelGraphics({l_text:"操作提示",l_fillColor:M.Color.CYAN,l_outlineColor:M.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 I=null,T=null;function L(e,t,i){e&&(I=t,this._drawLayer=new I.CustomDataSource("drawLayer"),c.prototype={...c.prototype,...f.prototype},this.$graphics=new c(e,t),e&&e.dataSources.add(this._drawLayer),this.tooltip=new E(e,t),this.tooltip.initTool())}L.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 I.Cartesian2(0,-20)},this._viewer&&t&&(e=new I.Entity,r=[],o=this,a=new I.ScreenSpaceEventHandler(this._viewer.scene.canvas),(T=a).setInputAction(function(e){e=o.getCatesian3FromPX(e.position);o.tooltip.showAtCartesian(e,"右键单击结束!"),e&&e.x&&(i=e,r.push(e))},I.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)},I.ScreenSpaceEventType.RIGHT_CLICK),e.billboard=t.style,e.position=new I.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(e))},_drawComand:function(n,o){var t,i,r,a=[],s=this,l=new I.PolygonHierarchy,c=new I.ScreenSpaceEventHandler(this._viewer.scene.canvas);function h(e,t){var i=new I.Entity;return"line"==o?i.polyline={positions:e,width:n.width||5,granularity:s._objHasOwnProperty(n,"granularity",I.Math.RADIANS_PER_DEGREE),arcType:s._objHasOwnProperty(n,"arcType",I.ArcType.GEODESIC),material:n.material||I.Color.BLUE.withAlpha(.8),clampToGround:s._objHasOwnProperty(n,"clampToGround",!1),clampToS3M:s._objHasOwnProperty(n,"clampToS3M",!1)}:"polygon"===o&&(i.polyline=n.style,i.polyline.positions=e,i.polygon={hierarchy:t,material:n.material||I.Color.WHITE.withAlpha(.7),clampToGround:s._objHasOwnProperty(n,"clampToGround",!1)},i.clampToS3M=!0),s._drawLayer.entities.add(i)}function u(){"polygon"==o&&(a.push(a[0]),l.positions.push(a[0])),t=h(a,a),n.height&&(t.polygon.extrudedHeight=n.height,t.polygon.material=I.Color.BLUE.withAlpha(.5)),n.measure&&"polygon"==o&&d(a[0],!0),"function"==typeof n.callback&&n.callback(a,t),s._drawLayer.entities.remove(r),s._drawLayer.entities.remove(i),i=r=void 0,a=[]}T=c;const d=function(e,t=!1,i=!1){var n=new I.Entity,e=(n.position=e,n.point={pixelSize:10,outlineColor:I.Color.BLUE,outlineWidth:5},""),r=s.transformCartesianArrayToWGS84Array(a);return"line"===o?e=(s.getPositionDistance(r)/1e3).toFixed(4)+"公里":"polygon"===o&&t&&(e=(s.getPositionsArea(r)/1e6).toFixed(4)+"平方公里"),("line"===o||"polygon"===o&&t)&&!i&&(n.label={text:e,show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:I.HorizontalOrigin.LEFT,verticalOrigin:I.VerticalOrigin.BOTTOM,pixelOffset:new I.Cartesian2(-20,-80)}),s._drawLayer.entities.add(n)};c.setInputAction(function(e){var t=s.getCatesian3FromPX(e.position);if(I.defined(t)){const e=t.clone();if(0===a.length){r=d(e,"",!0),l.positions.push(t.clone()),a.push(e);const n=new I.CallbackProperty(function(){return a},!1),s=new I.CallbackProperty(function(){return"polygon"===o?l:a},!1);i=h(n,s)}l.positions.push(t.clone()),a.push(e),n.measure&&d(e),"straightLine"===n.type&&3==a.length&&(a.pop(),c.destroy(),c=null,s.tooltip.setVisible(!1),"function"==typeof n.callback)&&(a=s._excludeDuplicatesCartesian(a),n.callback(a,i),u())}},I.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){e=s.getCatesian3FromPX(e.endPosition);s.tooltip.showAtCartesian(e,"右键单击结束!"),I.defined(r)&&I.defined(e)&&(a.pop(),a.push(e.clone()),l.positions.pop(),l.positions.push(e.clone()),r.position.setValue(e))},I.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(function(e){a=s._excludeDuplicatesCartesian(a),u(),t=void 0,s.tooltip.setVisible(!1),c.destroy(),c=null},I.ScreenSpaceEventType.RIGHT_CLICK)},_excludeDuplicatesCartesian:e=>e.reduce((e,t)=>{var i=e.length;return i<1||!e[i-1].equals(t)?e.concat(t):e},[]),drawLineGraphics:function(e){e=e||{},this._viewer&&e&&this._drawComand(e,"line")},drawPolygonGraphics:function(e){e=e||{};var t={width:3,material:I.Color.BLUE.withAlpha(.8),clampToGround:!0};e.style?e.style=Object.assign({},t,e.style):e.style=t,this._viewer&&e&&this._drawComand(e,"polygon")},drawRectangleGraphics:function(t){var i,n,e,r,o,a;(t=t||{}).style=t.style||{width:3,material:I.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t&&(n=[],e=new I.Entity,r=new I.Rectangle,o=this,a=new I.ScreenSpaceEventHandler(this._viewer.scene.canvas),(T=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=I.Rectangle.fromCartesianArray([...n,e],I.Ellipsoid.WGS84),"function"==typeof t.callback&&t.callback(o.transformCartesianArrayToWGS84Array(n),i)))},I.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){e=o.getCatesian3FromPX(e.endPosition);e&&(r=I.Rectangle.fromCartesianArray([...n,e],I.Ellipsoid.WGS84))},I.ScreenSpaceEventType.MOUSE_MOVE),e.rectangle=t.style,t.height&&(e.rectangle.extrudedHeight=t.height),e.rectangle.coordinates=new I.CallbackProperty(function(){return r},!1),i=this._drawLayer.entities.add(e))},drawCircleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:I.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var i,n=void 0,r=new I.Entity,o=this,a=1,s=new I.ScreenSpaceEventHandler(this._viewer.scene.canvas);T=s;const l=function(e,t){var e=I.Cartographic.fromCartesian(e),t=I.Cartographic.fromCartesian(t),i=new I.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 I.CallbackProperty(function(){return a},!1),r.ellipse.semiMinorAxis=new I.CallbackProperty(function(){return a},!1),r.position=new I.CallbackProperty(function(){return n},!1),r.point={pixelSize:5,outlineColor:I.Color.RED,outlineWidth:3},t.height&&(r.ellipse.extrudedHeight=t.height),i=o._drawLayer.entities.add(r)))},I.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)},I.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:I.Color.BLUE.withAlpha(.5)},this._viewer&&t){var i=new I.Entity,n=new I.Entity,r=new I.Entity,o=[],a=[],s=[],l=this,c=new I.ScreenSpaceEventHandler(this._viewer.scene.canvas);T=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}))},I.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=I.Cartographic.fromCartesian(t[0]),t=I.Cartographic.fromCartesian(t[1]),i=I.Cartesian3.fromDegrees(I.Math.toDegrees(i.longitude),I.Math.toDegrees(i.latitude),t.height),a.pop(),a.push(i.clone()),s.pop(),s.pop(),s.push(e.clone()),s.push(i.clone()))},I.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new I.CallbackProperty(function(){return o},!1),...t.style},i.position=new I.CallbackProperty(function(){return o[0]},!1),i.point={pixelSize:5,outlineColor:I.Color.BLUE,outlineWidth:5},i.label={text:new I.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(o))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:I.HorizontalOrigin.LEFT,verticalOrigin:I.VerticalOrigin.BOTTOM,pixelOffset:new I.Cartesian2(50,-100)},n.polyline={positions:new I.CallbackProperty(function(){return a},!1),...t.style},n.position=new I.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:I.Color.BLUE,outlineWidth:5},n.label={text:new I.CallbackProperty(function(){return"高度:"+(t=a[1],!(e=a[0])&&!t||I.Cartesian3.equals(e,t)?0:(e=I.Cartographic.fromCartesian(e),(I.Cartographic.fromCartesian(t).height-e.height).toFixed(2)))+"米";var e,t},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:I.HorizontalOrigin.LEFT,verticalOrigin:I.VerticalOrigin.BOTTOM,pixelOffset:new I.Cartesian2(-20,100)},r.polyline={positions:new I.CallbackProperty(function(){return s},!1),...t.style},r.position=new I.CallbackProperty(function(){return o[1]},!1),r.point={pixelSize:5,outlineColor:I.Color.BLUE,outlineWidth:5},r.label={text:new I.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:I.HorizontalOrigin.LEFT,verticalOrigin:I.VerticalOrigin.BOTTOM,pixelOffset:new I.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:I.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:I.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=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:I.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:I.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:e,height:n.height||1,width:n.width||100,cornerType:I.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:I.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:I.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:e,shape:n,cornerType:I.CornerType.MITERED,material:r.color||I.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(){T&&!T.isDestroyed()&&(T.removeInputAction(I.ScreenSpaceEventType.MOUSE_MOVE),T.removeInputAction(I.ScreenSpaceEventType.RIGHT_CLICK),T.removeInputAction(I.ScreenSpaceEventType.LEFT_CLICK))}};let D={};function B(e,t){e&&(this._viewer=e,D=t)}B.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 D.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=D.Math.toRadians(e);i.push(new D.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,f;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],f=a[1]-e[1],c=e[0]+(u*u-d*d)*m+p*f,e[1]+p*m+(d*d-u*u)*f):(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 k=null;function G(e,t){e&&(this._viewer=e,c.prototype={...c.prototype,...f.prototype},this.$graphics=new c(e,t),k=t)}G.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||k.Color.RED,r=e.duration||1500,o=this,a=e.circleMode||"CircleScan",e=e.border||4,u=l,s=new k.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 k.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),u=new k.PostProcessStage({name:t,fragmentShader:this._getCircleScanShader({get:!0,border:e}),uniforms:{u_scanCenterEC:function(){return k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,new k.Cartesian4)},u_scanPlaneNormalEC:function(){var e=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,new k.Cartesian4),t=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,c,new k.Cartesian4),i=new k.Cartesian3;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,k.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,f,g,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||k.Color.RED,r=e.duration||1500,o=this,a=e.border||1,e=e.width||3,v=c,s=new k.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 k.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:v.lng+.001,lat:v.lat,alt:v.alt}),h=new k.Cartesian4(c.x,c.y,c.z,1),u=(new Date).getTime(),d=new k.Quaternion,p=new k.Matrix3,m=new k.Cartesian4,f=new k.Cartesian4,g=new k.Cartesian4,A=new k.Cartesian3,y=new k.Cartesian3,v=new k.PostProcessStage({name:t,fragmentShader:this._getRadarScanShader({border:a,width:e,get:!0}),uniforms:{u_scanCenterEC:function(){return k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m)},u_scanPlaneNormalEC:function(){var e=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m),t=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,l,f);return A.x=t.x-e.x,A.y=t.y-e.y,A.z=t.z-e.z,k.Cartesian3.normalize(A,A),A},u_scanLineNormalEC:function(){var e=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,s,m),t=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,l,f),i=k.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,g),t=(A.x=t.x-e.x,A.y=t.y-e.y,A.z=t.z-e.z,k.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 k.Quaternion.fromAxisAngle(A,t*k.Math.PI*2,d),k.Matrix3.fromQuaternion(d,p),k.Matrix3.multiplyByVector(p,y,y),k.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=k.Cartesian3,i=k.GeometryInstance,n=k.Primitive,r=k.MaterialAppearance,o=k.Material,a=k.Color,s=k.Matrix4,h=k.Transforms,r=k.MaterialAppearance,l=k.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 k.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 k.PolygonHierarchy(k.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 k.PolygonHierarchy(k.Cartesian3.fromDegreesArrayHeights([r,o,a,i[e].x,i[e].y,0,i[0].x,i[0].y,0])):new k.PolygonHierarchy(k.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 k.Color(1,1,1,1),endColor:new k.Color(.5,0,0,0),emitter:new k.ConeEmitter(k.Math.toRadians(45))},e),new k.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 k.Cartesian2(s,s),lifetime:16,loop:!0,sizeInMeters:!0,modelMatrix:k.Transforms.eastNorthUpToFixedFrame(c)})}};const R="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}",O="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}",z='#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 V={};function F(t){var _=(V=t).BoundingSphere,b=V.Cartesian3,i=V.Color,d=V.combine,P=V.ComponentDatatype,n=V.defaultValue||V.Scene.defaultValue,r=V.defined,x=(V.destroyObject,V.DeveloperError),S=V.Matrix4,o=V.PrimitiveType,M=V.Buffer,I=V.BufferUsage,a=V.DrawCommand,E=V.Pass,T=V.RenderState,D=V.ShaderProgram,L=V.ShaderSource,k=V.VertexArray,B=V.BlendingState,G=V.CullFace,s=V.Material,$=V.SceneMode,F=V.VertexFormat,H=V.Math,U=V.Matrix3,W=(S=V.Matrix4,V.JulianDate),u=(V.BoxGeometry,V.EllipsoidGeometry,Math.sin),j=Math.cos,N=Math.tan,X=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=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=W.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===$.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,f=!1,h=(this._radius!==h&&(f=!0,this._radius=h,this._boundingSphere=new _(b.ZERO,this.radius)),S.equals(this.modelMatrix,this._modelMatrix)&&!f||(S.clone(this.modelMatrix,this._modelMatrix),S.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),_.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC)),this.showThroughEllipsoid),f=(this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=h,a=!0),this.material),g=(this._material!==f&&(this._material=f,s=a=!0),f.isTranslucent()),A=(this._translucent!==g&&(this._translucent=g,a=!0),this.showScanPlane&&(m=e.time,(p=W.secondsDifference(m,this._time))<0&&(this._time=W.clone(m,this._time)),m=Math.max(p%this.scanPlaneRate/this.scanPlaneRate,0),"horizontal"==this.scanPlaneMode?(p=j(u=2*c*m-c),d=N(l),p=X(p*d),this._scanePlaneXHalfAngle=p,this._scanePlaneYHalfAngle=u,V.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,Y)):(u=2*l*m-l,d=N(c),p=j(u),m=X(p*d),this._scanePlaneXHalfAngle=u,this._scanePlaneYHalfAngle=m,V.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,Y)),V.Matrix4.multiplyByMatrix3(this.modelMatrix,Y,this._computedScanPlaneModelMatrix),S.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix)),o&&(l=this,c=e.context,p=K(l,l.xHalfAngle,l.yHalfAngle),d=l.xHalfAngle,u=l.yHalfAngle,m=p.zoy,p=p.zox,o=[],n=U.fromRotationY(d,Y),o.push(m.map(function(e){return U.multiplyByVector(n,e,new V.Cartesian3)})),n=U.fromRotationX(-u,Y),o.push(p.map(function(e){return U.multiplyByVector(n,e,new V.Cartesian3)}).reverse()),n=U.fromRotationY(-d,Y),o.push(m.map(function(e){return U.multiplyByVector(n,e,new V.Cartesian3)}).reverse()),n=U.fromRotationX(u,Y),o.push(p.map(function(e){return U.multiplyByVector(n,e,new V.Cartesian3)})),d=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=b.normalize(b.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=M.createVertexBuffer({context:e,typedArray:n,usage:I.STATIC_DRAW}),u=6*Float32Array.BYTES_PER_ELEMENT,h=[{index:q.position,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:P.FLOAT,offsetInBytes:0,strideInBytes:u},{index:q.normal,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:P.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:u}];return new k({context:e,attributes:h})}(c,d)),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=M.createVertexBuffer({context:e,typedArray:i,usage:I.STATIC_DRAW}),l=3*Float32Array.BYTES_PER_ELEMENT,s=[{index:q.position,vertexBuffer:s,componentsPerAttribute:3,componentDatatype:P.FLOAT,offsetInBytes:0,strideInBytes:l}];return new k({context:e,attributes:s})}(c,d)),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=M.createVertexBuffer({context:e,typedArray:n,usage:I.STATIC_DRAW}),h=3*Float32Array.BYTES_PER_ELEMENT,c=[{index:q.position,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:P.FLOAT,offsetInBytes:0,strideInBytes:h}];return new k({context:e,attributes:c})}(c,d)),l.showDomeSurfaces&&(l._domeVA=(m=c,u=V.EllipsoidGeometry.createGeometry(new V.EllipsoidGeometry({vertexFormat:F.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),k.fromGeometry({context:m,geometry:u,attributeLocations:q,bufferUsage:I.STATIC_DRAW,interleave:!1}))),l.showDomeLines&&(l._domeLineVA=(p=c,o=V.EllipsoidOutlineGeometry.createGeometry(new V.EllipsoidOutlineGeometry({vertexFormat:F.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),k.fromGeometry({context:p,geometry:o,attributeLocations:q,bufferUsage:I.STATIC_DRAW,interleave:!1}))),l.showScanPlane)&&("horizontal"==l.scanPlaneMode?(r=K(l,H.PI_OVER_TWO,0),l._scanPlaneVA=J(c,r.zox)):(r=K(l,0,H.PI_OVER_TWO),l._scanPlaneVA=J(c,r.zoy))),a&&(o=this,l=h,g?(o._frontFaceRS=T.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:B.ALPHA_BLEND,cull:{enabled:!0,face:G.BACK}}),o._backFaceRS=T.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:B.ALPHA_BLEND,cull:{enabled:!0,face:G.FRONT}}),o._pickRS=T.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:B.ALPHA_BLEND})):(o._frontFaceRS=T.fromCache({depthTest:{enabled:!l},depthMask:!0}),o._pickRS=T.fromCache({depthTest:{enabled:!0},depthMask:!0}))),s&&(r=c=this,l=h=f,f=(o=e).context,t=R,i=new L({sources:[O,l.shaderSource,z]}),r._sp=D.replaceCache({context:f,shaderProgram:r._sp,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:q}),i=new L({sources:[O,l.shaderSource,z],pickColorQualifier:"uniform"}),r._pickSP=D.replaceCache({context:f,shaderProgram:r._pickSP,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:q}),c.showScanPlane)&&(l=c,f=h,r=o.context,f=new L({sources:[O,f.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=D.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:f,attributeLocations:q})),(a||s)&&(t=g,(i=this)._colorCommands.length=0,c=t?E.TRANSLUCENT:E.OPAQUE,i.showLateralSurfaces&&Z(i,i._sectorFrontCommand,i._sectorBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorVA,i._uniforms,i._computedModelMatrix,t,c),i.showSectorLines&&Z(i,i._sectorLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showSectorSegmentLines&&Z(i,i._sectorSegmentLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorSegmentLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showDomeSurfaces&&Z(i,i._domeFrontCommand,i._domeBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._domeVA,i._uniforms,i._computedModelMatrix,t,c),i.showDomeLines&&Z(i,i._domeLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._domeLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showScanPlane)&&Z(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 Y=new U,Q=new b;function K(e,t,i){for(var n=e.slice,e=j(i),i=N(i),r=j(t),t=N(t),o=X(r*i),a=X(e*t),s=[],l=0;l<n;l++){var c=2*o*l/(n-1)-o;s.push(new b(0,u(c),j(c)))}for(var h=[],l=0;l<n;l++)h.push(new b(u(c=2*a*l/(n-1)-a),0,j(c)));return{zoy:s,zox:h}}function J(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=M.createVertexBuffer({context:e,typedArray:n,usage:I.STATIC_DRAW}),s=3*Float32Array.BYTES_PER_ELEMENT,a=[{index:q.position,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:P.FLOAT,offsetInBytes:0,strideInBytes:s}];return new k({context:e,attributes:a})}function Z(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 H={};function W(e){var t=(H=e).defaultValue||H.Scene.defaultValue,i=H.defined,e=Object.defineProperties,n=H.DeveloperError,r=H.Event,o=H.createMaterialPropertyDescriptor,a=H.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 U={};function N(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,_,b,P,x,S,M,I,E,T,D,L,k,n;if(e)return i=(U=e).AssociativeArray,v=U.Cartesian3,w=U.Color,C=U.defined,r=U.destroyObject,_=U.DeveloperError,b=U.Matrix3,P=U.Matrix4,x=U.Quaternion,S=U.MaterialProperty,M=U.Property,I=new b,new P,E=new v,T=new v,D=new x,L=new v,k=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),g=M.getValueOrUndefined(c._orientation,e,D),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,L),f=v.angleBetween(U.Cartesian3.UNIT_Z,m),m=v.cross(U.Cartesian3.UNIT_Z,m,L),g=x.fromAxisAngle(m,f-Math.PI,k),A=v.distance(a,p);d.modelMatrix=P.fromRotationTranslation(b.fromQuaternion(g,I),a,d.modelMatrix)}else v.equals(a,u.position)&&x.equals(g,u.orientation)||(C(g)?(d.modelMatrix=P.fromRotationTranslation(b.fromQuaternion(g,I),a,d.modelMatrix),u.position=v.clone(a,u.position),u.orientation=x.clone(g,u.orientation)):(d.modelMatrix=U.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 j=null;function X(e,t){e&&(this.viewer=e,j=t,this._installPlugin())}X.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive()},_installCylinderGeometry:function(){function P(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 j.Cartesian2,x=new j.Cartesian3,M=new j.Ray;P._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),f=0;f<u.length;f++){c[f]=[];for(var g=h[f],A=0;A<r;A++){c[f].push(d++);var y=o*A,v=g*Math.cos(y),w=g*Math.sin(y);a.push(v,w,u[f]),v=m*Math.cos(y),w=m*Math.sin(y),s.push(v,w,p.z),l.push(f/(u.length-1),0)}}for(var C=[],f=1;f<u.length;f++)for(A=1;A<r;A++){var _=c[f-1][A-1],b=c[f][A-1],P=c[f][A],x=c[f-1][A];C.push(P),C.push(x),C.push(_),C.push(P),C.push(_),C.push(b),A==c[f].length-1&&(_=c[f-1][A],b=c[f][A],P=c[f][0],x=c[f-1][0],C.push(P),C.push(x),C.push(_),C.push(P),C.push(_),C.push(b))}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=j.BoundingSphere.fromVertices(a),t=new j.Geometry({attributes:n,indices:C,primitiveType:j.PrimitiveType.TRIANGLES,boundingSphere:i});return a=[],C=[],l=[],t},P.createGeometry=function(e,t){if(!t)return P._createGeometry(e);j.Matrix4.multiplyByPoint(t,j.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 j.Cartesian3,p=n/15,m=0;m<16;m++){for(var f=p*m,g=[],A=0;A<r;A++){var y=o*A,v=f*Math.cos(y),y=f*Math.sin(y);d.x=v,d.y=y,d.z=h[1],(0,j.Scene.extend2Earth)(d,t,M)?(g.push(u),a.push(v,y,h[1]),s.push(m/15,1),u++):g.push(-1)}c.push(g)}for(var w,C,_=[0,c.length-1],b=0;b<_.length;b++)for(m=_[b],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 j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=j.BoundingSphere.fromVertices(a),n=new j.Geometry({attributes:e,indices:l,primitiveType:j.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,j.Scene.computeVertexNormals)(n),a=[],l=[],n},P.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),f=0;f<u.length;f++){c[f]=[];for(var g=h[f],A=0;A<r;A++){c[f].push(d++);var y=o*A,v=g*Math.cos(y),w=g*Math.sin(y);a.push(v,w,u[f]),v=m*Math.cos(y),w=m*Math.sin(y),s.push(v,w,p.z),l.push(f/(u.length-1),0)}}for(var C=[],f=1;f<u.length;f++)for(A=1;A<r;A+=1){var _=c[f-1][A-1],b=c[f][A-1];c[f][A],c[f-1][A],A%8==1&&C.push(_,b)}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=j.BoundingSphere.fromVertices(a),t=new j.Geometry({attributes:n,indices:C,primitiveType:j.PrimitiveType.LINES,boundingSphere:i});return a=[],C=[],l=[],t},P.fromAngleAndLength=function(e,t,i){return e=j.Math.toRadians(e),new P({topRadius:Math.tan(e)*t/2,bottomRadius:0,length:t,zReverse:i})},j.Scene.CylinderGeometry=P},_installRadarPrimitive:function(){var n;function e(e,t){var i=j.defaultValue||j.Scene.defaultValue;t=t||{},n=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||j.Color.YELLOW,this.defaultLineColor=t.lineColor||this.defaultColor,this._show=i(t.show,!0),this._outline=i(t.outline,!1),this._topShow=i(t.top,!0),this._topOutline=i(t.topOutline,!0),this._modelMatrix=j.Matrix4.clone(j.Matrix4.IDENTITY),this._quaternion=new j.Quaternion,this._translation=new j.Cartesian3,this._scale=new j.Cartesian3(1,1,1),this._matrix=new j.Matrix4,this._inverseMatrix=new j.Matrix4,this._positionCartographic=new j.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=e,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=i(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(j.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 j.CallbackProperty(function(e){return t._ground_radius},!1),semiMajorAxis:new j.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 j.CallbackProperty(function(e){return!t._trackedEntityPosition||j.Cartesian3.distance(t._position,t._trackedEntityPosition)>t._radius?[]:[t._position,t._trackedEntityPosition]},!1),followSurface:!1,material:new j.PolylineDashMaterialProperty({color:j.Color.CYAN}),width:1}}))};var i=new j.Cartesian3;e.prototype.computeMatrix=function(e,t){return this._positionCartesian||(this._positionCartesian=new j.Cartesian3),this.position instanceof j.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(e):this.position._value&&this.position._value instanceof j.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,e=j.Property.getValueOrUndefined(this._trackedEntity.position,e,i))&&(this._trackedEntityPosition=e,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=j.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,n,this._modelMatrix),this._positionCartographic=j.Cartographic.fromCartesian(this._positionCartesian,n,this._positionCartographic),j.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,n,this._modelMatrix),j.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=j.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),j.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),j.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=j.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),f=Math.sqrt(e*e-m*m-p*p);t.push(m,p,f),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 g=r[c-1][d-1],A=r[c][d-1],y=r[c][d],v=r[c-1][d];n.push(g,A,y),n.push(g,y,v)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),o={position:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},w=j.BoundingSphere.fromVertices(t),o=new j.Geometry({attributes:o,indices:n,primitiveType:j.PrimitiveType.TRIANGLES,boundingSphere:w});return(0,j.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=j.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),f=Math.sqrt(e*e-m*m-p*p);t.push(m,p,f),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 g=r[c-1][d-1],A=r[c][d-1],y=r[c][d];r[c-1][d],d%8==1&&n.push(g,A),c%8==1&&n.push(A,y)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),o={position:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new j.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},v=j.BoundingSphere.fromVertices(t),o=new j.Geometry({attributes:o,indices:n,primitiveType:j.PrimitiveType.LINES,boundingSphere:v});return(0,j.Scene.computeVertexNormals)(o),o},e.prototype.updateGeometry=function(){this._geometry=j.Scene.CylinderGeometry.createGeometry(new j.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(j.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(j.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=j.Scene.CylinderGeometry.createOutlineGeometry(new j.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(j.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(j.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===j.SceneMode.SCENE3D?(this._geometry.boundingSphere=j.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 j.Cartesian3,r=(j.Matrix4.multiplyByPoint(this._matrix,e.boundingSphere.center,r),new j.BoundingSphere(r,e.boundingSphere.radius)),i=new j.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:e.primitiveType,pass:j.Pass.TRANSLUCENT,boundingVolume:r}),o=this,r=j.GeometryPipeline.createAttributeLocations(e);return i.vertexArray=j.VertexArray.fromGeometry({context:n,geometry:e,attributeLocations:r,bufferUsage:j.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=r,i.shaderProgram=j.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(e),fragmentShaderSource:this.getFragmentShaderSource(e),attributeLocations:r}),i.renderState=j.RenderState.fromCache({blending:j.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:j.DepthFunction.LESS},cull:{enabled:!1,face:j.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 j.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==j.PrimitiveType.LINES||e.primitiveType==j.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return e.primitiveType==j.PrimitiveType.LINES||e.primitiveType==j.PrimitiveType.LINE_STRIP?(o.defaultLineColor||(o.defaultLineColor=new j.Color(1,1,0,1)),o.defaultLineColor):(o.defaultColor||(o.defaultColor=new j.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 j.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=[])},j.Scene.ConeSensorPrimitive=e},_installCounputeVertex:function(){var r=new j.Cartesian3,o=(new j.Ray,new j.Cartographic);j.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 j.GeometryAttribute({componentDatatype:j.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 j.Cartesian3,d=new j.Cartesian3,p=new j.Cartesian3,m=new j.Cartesian3,f=new j.Cartesian3,a=0;a<n;a+=3)s=3*t[a+0],l=3*t[a+1],c=3*t[a+2],j.Cartesian3.fromArray(r,s,u),j.Cartesian3.fromArray(r,l,d),j.Cartesian3.fromArray(r,c,p),j.Cartesian3.subtract(p,d,m),j.Cartesian3.subtract(u,d,f),j.Cartesian3.cross(m,f,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 g,A,y,v,w=e.attributes.normal.values,C=0;C<w.length;C+=3)g=w[C],A=w[C+1],y=w[C+2],v=1/Math.sqrt(g*g+A*A+y*y),w[C]=g*v,w[C+1]=A*v,w[C+2]=y*v;i.normal.needsUpdate=!0}return e},j.Scene.extend2Earth=function(e,t,i,n){n=n||j.Ellipsoid.WGS84,j.Matrix4.multiplyByPoint(t,e,r),j.Cartesian3.subtract(r,i.origin,i.direction),j.Cartesian3.normalize(i.direction,i.direction);t=j.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=t?j.Ray.getPoint(i,t.start):n)try{j.Cartographic.fromCartesian(n,null,o)}catch(e){return null}return n}}};let q={};function Y(e,t){if(t){new X(e,q=t);const i=new F(t),n=new W(t),o=new N(t,i);q.Scene.RectangularSensorPrimitive=i,q.Scene.RectangularSensorGraphics=n,q.Scene.RectangularSensorVisualizer=o;var e=q.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 Q=null;function J(e,t){e&&(this._viewer=e,Q=t,this._customPluginLayer=new Q.CustomDataSource("_customPluginLayer"),new Y(e,t),e)&&e.dataSources.add(this._customPluginLayer)}J.prototype={createRectangularSensorGraphics:function(e){var t,i;if(this._customPluginLayer&&e)return t=new Q.HeadingPitchRoll(Q.Math.toRadians(e.heading||90),Q.Math.toRadians(e.pitch||0),Q.Math.toRadians(e.roll||0)),i=e.position,this._customPluginLayer.entities.add({position:i,orientation:Q.Transforms.headingPitchRollQuaternion(i,t),rectangularSensor:new Q.Scene.RectangularSensorGraphics({radius:e.radius||1e5,xHalfAngle:Q.Math.toRadians(e.xHalfAngle||45),yHalfAngle:Q.Math.toRadians(e.yHalfAngle||45),material:e.material||new Q.Color(1,0,1,.4),lineColor:e.lineColor||new Q.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 Q.Matrix4,scanPlaneColor:e.scanPlaneColor||new Q.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 Q.Scene.SatelliteCoverageSimulation(this._viewer,{position:e.position,angle1:e.angle1||30,angle2:e.angle2||45,areaType:e.areaType||2,rotation:{heading:Q.Math.toRadians(e.heading||0),pitch:Q.Math.toRadians(e.pitch||0),roll:Q.Math.toRadians(e.roll||0)},color:e.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(e){if(e)return new Q.Scene.ConeSensorPrimitive(this._viewer,{position:e.position,angle:e.angle||80,radius:e.radius||7e5,rotation:{heading:Q.Math.toRadians(e.heading||0),pitch:Q.Math.toRadians(e.pitch||40),roll:Q.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 K,Z,$=null,ee={},te="move",ie=null;function ne(e,t){e&&(this._viewer=e,ie=e,$=t,this._installFileDragDropHandler())}ne.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("读取数据失败")})}},$.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 n.GUI,r=this._viewer,t=e.addFolder("加载数据文件"),i=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:()=>{i(e=>{$.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:$.Color.BLUE}}r.flyTo(e)})})},polyline:()=>{i(e=>{$.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 $.PolylineGlowMaterialProperty({glowPower:.1,color:$.Color.ORANGERED.withAlpha(.9)})}r.flyTo(e)})})},polygon:()=>{i(e=>{$.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=$.Color.BLUE.withAlpha(.9)}r.flyTo(e)})})},model:()=>{i(e=>{r.flyTo(d3kit.createModelGraphics({position:$.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:e}))})},czml:()=>{i(e=>{r.flyTo(r.dataSources.add($.CzmlDataSource.load(e)))})},"3dtilset":()=>{i(e=>{r.flyTo(r.scene.primitives.add(new $.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,i=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 n.GUI({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new n.GUI,this._viewer.scene.postProcessStages),o=r.add($.PostProcessStageLibrary.createSilhouetteStage()),a=r.add($.PostProcessStageLibrary.createBlackAndWhiteStage()),s=r.add($.PostProcessStageLibrary.createBrightnessStage()),l=r.add($.PostProcessStageLibrary.createNightVisionStage());o.uniforms.color=e.silhouetteColor||$.Color.YELLOW,o.enabled=!1,a.enabled=!1,a.uniforms.gradations=5,s.enabled=!1,s.uniforms.brightness=.5,l.enabled=!1,t.add(i,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(e){a.enabled=e}),t.add(i,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(e){a.uniforms.gradations=e}),t.add(i,"brightnessShow").name("brightnessShow").onChange(function(e){s.enabled=e}),t.add(i,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(e){s.uniforms.brightness=e}),t.add(i,"nightVisionShow").name("nightVisionShow").onChange(function(e){l.enabled=e}),t.add(i,"silhouette").name("silhouette").onChange(function(e){o.enabled=e})},showSceneBloomPanel(e){let t=null,i=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 n.GUI({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new n.GUI,this._viewer),o=(t.__closeButton.innerHTML="收缩面板",r.scene.postProcessStages.bloom);t.add(i,"enabled").name("bloom").onChange(function(e){o.enabled=e}),t.add(i,"glowOnly").name("发光").onChange(function(e){o.uniforms.glowOnly=e}),t.add(i,"enabled").name("启用模糊").onChange(function(e){o.enabled=e}),t.add(i,"contrast",-255,255,.01).name("对比度").onChange(function(e){o.uniforms.contrast=e}),t.add(i,"brightness",-1,1,.01).name("光泽亮度").onChange(function(e){o.uniforms.brightness=e}),t.add(i,"delta",1,5,.01).name("因子").onChange(function(e){o.uniforms.delta=e}),t.add(i,"sigma",1,10,.01).name("sigma").onChange(function(e){o.uniforms.sigma=e}),t.add(i,"stepSize",.1,10).name("stepSize").onChange(function(e){o.uniforms.stepSize=e}),t.add(i,"shadows").name("启用阴影").onChange(function(e){r.shadows=e}),t.add(i,"highDynamicRange").name("高动态范围").onChange(function(e){r.scene.highDynamicRange=e}),t.add(i,"gamma",1,10,.01).name("伽马亮度").onChange(function(e){r.scene.gamma=e})},showPrimitiveMatrixPanel(t){let i=t.primitives._delegate||t.primitives,r=t.primitives,e=(this._viewer,null);t&&t.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n.GUI;var o=e.addFolder("离地高度"),o=(o.add({height:100},"height",0,1e3,1).onChange(function(e){var t=r.boundingSphere,t=$.Cartographic.fromCartesian(t.center),i=$.Cartesian3.fromRadians(t.longitude,t.latitude,0),t=$.Cartesian3.fromRadians(t.longitude,t.latitude,e),e=$.Cartesian3.subtract(t,i,new $.Cartesian3);r.modelMatrix=$.Matrix4.fromTranslation(e)}),o.open(),e.addFolder("缩放大小")),a={"m+Scale":()=>{i.readyPromise.then(e=>{var t=e.root.transform;$.Matrix4.multiplyByUniformScale(t,1.2,t),e.root.transform=t})},"m-Scale":()=>{i.readyPromise.then(e=>{var t=e.root.transform;$.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=$.Matrix4.fromTranslation(new $.Cartesian3(20,0,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"x-Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(-20,0,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"y+Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,20,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"y-Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,-20,0));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"z+Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,0,20));$.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"z-Axis":()=>{var e=$.Matrix4.fromTranslation(new $.Cartesian3(0,0,-20));$.Matrix4.multiply(i.modelMatrix,e,i.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,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationX($.Math.toRadians(s.x)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"x-Axis":()=>{s.x-=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationX($.Math.toRadians(s.x)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"y+Axis":()=>{s.y+=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationY($.Math.toRadians(s.y)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"y-Axis":()=>{s.y-=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationY($.Math.toRadians(s.y)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"z+Axis":()=>{s.z+=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationZ($.Math.toRadians(s.z)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.Matrix4.multiply(i,t,i),e._root.transform=i})},"z-Axis":()=>{s.z-=15,i.readyPromise.then(e=>{var t=$.Matrix3.fromRotationZ($.Math.toRadians(s.z)),t=$.Matrix4.fromRotationTranslation(t),i=$.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);$.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:()=>{i.readyPromise.then(e=>{e=e.root.transform;t.cb({modelTransformMatrix:$.Matrix4.toArray(e),modelMatrix:$.Matrix4.toArray(r.modelMatrix)})})}},"getModelMaterix").name("获取模型矩阵"),a.open()),e.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(t,i){if(t){let e=null;i&&i.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new n.GUI;var i=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(i,"alpha",0,1,.05).name("透明度").onChange(function(e){t.alpha=e}),r.add(i,"brightness",0,5,.05).name("亮度").onChange(function(e){t.brightness=e}),r.add(i,"contrast",0,5,.05).name("对比").onChange(function(e){t.contrast=e}),r.add(i,"gamma",0,5,.05).name("伽马").onChange(function(e){t.gamma=e}),r.add(i,"hue",0,5,.05).name("色调").onChange(function(e){t.hue=e}),r.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange(function(e){t.dayAlpha=e}),r.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(e){t.nightAlpha=e}),r.add(i,"saturation",0,5,.05).name("饱和").onChange(function(e){t.saturation=e}),r.open()}},showLayerSwitchPanel:function(t,i,r){if(t&&t.length){let e=null;i&&i.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new n.GUI;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,i,r;e=e||{},n.GUI&&this._viewer.scene.colorCorrection&&(r=new n.GUI,(t=this._viewer).scene.lightSource.ambientLightColor=e.ambientLightColor||new $.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,i=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(i,"bloomEffectShow").name("泛光开关").onChange(function(e){t.scene.bloomEffect.show=e,t.scene.bloomEffect.threshold=i.bloomThreshold,t.scene.bloomEffect.bloomIntensity=i.bloomIntensity}),r.add(i,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(e){t.scene.bloomEffect.threshold=e}),r.add(i,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(e){t.scene.bloomEffect.bloomIntensity=e}),r.add(i,"hdrEnabled").name("HDR开关").onChange(function(e){t.scene.hdrEnabled=e}),r.add(i,"colorCorrectionShow").name("颜色校正").onChange(function(e){t.scene.colorCorrection.show=e}),r.add(i,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(e){t.scene.colorCorrection.saturation=e}),r.add(i,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(e){t.scene.colorCorrection.brightness=e}),r.add(i,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(e){t.scene.colorCorrection.contrast=e}),r.add(i,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(e){t.scene.hdrEnabled=e}),r.add(i,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(e){t.scene.lightSource.ambientLightColor=new $.Color(e,e,e,1)}),r.open())},showEntityOrientationEditPanel:function(i={}){if(i.entity){let t=i.entity;var e=new n.GUI,r=(i&&i.elementId?(e=new n.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new n.GUI,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=$.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new $.HeadingPitchRoll($.Math.toRadians(r.heading),$.Math.toRadians(r.pitch),$.Math.toRadians(r.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.add(r,"pitch",0,360,1).name("航向").onChange(function(e){r.pitch=e;e=$.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new $.HeadingPitchRoll($.Math.toRadians(r.heading),$.Math.toRadians(r.pitch),$.Math.toRadians(r.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.add(r,"roll",0,360,1).name("翻转").onChange(function(e){r.roll=e;e=$.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new $.HeadingPitchRoll($.Math.toRadians(r.heading),$.Math.toRadians(r.pitch),$.Math.toRadians(r.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.open()}},definedMouseEvent({targetEntity:e,ctrlFlag:t}){Z=e,ee=t,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(t){if(ee.leftDown&&K){let e=ie.camera.getPickRay(t.endPosition),r=ie.scene.globe.pick(e,ie.scene);if(document.body.style.cursor="pointer",K&&K.id&&"move"===te){let e=$.JulianDate.fromDate(new Date),t=Z.position.getValue(e),i=$.Cartographic.fromCartesian(t),n=Number(i.height.toFixed(3));Z.position=new $.CallbackProperty(()=>{var e=ie.scene.globe.ellipsoid.cartesianToCartographic(r),t=$.Math.toDegrees(e.longitude),e=$.Math.toDegrees(e.latitude);return $.Cartesian3.fromDegrees(t,e,n)},!1)}else{var i,n,o;K&&K.id&&"rotate"===te&&(n=$.JulianDate.fromDate(new Date),n=Z.position.getValue(n),o=ie.scene.camera.pickEllipsoid(t.startPosition),t=ie.scene.camera.pickEllipsoid(t.endPosition),i=$.Cartesian3.subtract(n,t,new $.Cartesian3),i=$.Cartesian3.normalize(i,new $.Cartesian3),o=$.Cartesian3.subtract(o,n,new $.Cartesian3),t=$.Cartesian3.subtract(t,n,new $.Cartesian3),n=$.Cartesian3.angleBetween(o,t),o=$.Quaternion.fromAxisAngle(i,100*n),Z.orientation=o)}}},defLeftDown(e){K=ie.scene.pick(e.position),$.defined(K)&&te?(ee.selected=!0,ee.leftDown=!0):ee.selected=!1},defMouseWheel(n){if(K&&K.id&&"scale"===te){let e=$.JulianDate.fromDate(new Date),t=Z.box.dimensions.getValue(e),i=0<n?2:.5;Z.box.dimensions=new $.CallbackProperty(()=>$.Cartesian3.multiplyByScalar(t,i,new $.Cartesian3),!1)}},defLeftUp(e){ee.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(e){te=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(e){te=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(e){te=e,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let re=null;var oe=3.141592653589793,ae=6378245,se=.006693421622965943;function le(e,t,i){e&&(this._viewer=e,re=t,this._queryRouteKey="8dc49b1fa65a79d306ef12dae4229842",this._pluginLayer=new re.CustomDataSource("pluginLayer"),e&&e.dataSources.add(this._pluginLayer),this._installPlugin())}le.routeQueryType={DRIVE:"drive",WALK:"walk",CYCLE:"cycle"},le.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan(),this._installClusterLayer(),this._installBar3DLayer()},_installTerrainClipPlan:function(){let i=re.defaultValue||re.Scene.defaultValue;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=i(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 re.Cartesian3,r=0<re.Cartesian3.subtract(e[0],e[1],n).x;this.excavateMinHeight=9999;for(var o=0;o<i;o++){var a=(o+1)%i,s=re.Cartesian3.midpoint(e[o],e[a],new re.Cartesian3),l=re.Cartographic.fromCartesian(e[o]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=re.Cartesian3.normalize(s,new re.Cartesian3),a=r?re.Cartesian3.subtract(e[o],s,new re.Cartesian3):re.Cartesian3.subtract(e[a],s,new re.Cartesian3),a=(a=re.Cartesian3.normalize(a,a),re.Cartesian3.cross(a,l,new re.Cartesian3)),a=re.Cartesian3.normalize(a,a),l=new re.Plane(a,0),l=re.Plane.getPointDistance(l,s);t.push(new re.ClippingPlane(a,l))}this.viewer.scene.globe.clippingPlanes=new re.ClippingPlaneCollection({planes:t,edgeWidth:1,edgeColor:re.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=re.Cartographic.fromCartesian(e[s]),l=re.Cartographic.fromCartesian(e[l]),h=[c.longitude,c.latitude],u=[l.longitude,l.latitude];0==s&&(a.push(new re.Cartographic(h[0],h[1])),o.push(re.Cartesian3.fromRadians(h[0],h[1],n)),r.push(re.Cartesian3.fromRadians(h[0],h[1],0)));for(var d=1;d<=t;d++){var p=re.Math.lerp(h[0],u[0],d/t),m=re.Math.lerp(h[1],u[1],d/t);s==i-1&&d==t||(a.push(new re.Cartographic(p,m)),o.push(re.Cartesian3.fromRadians(p,m,n)),r.push(re.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),re.sampleTerrainMostDetailed(this.viewer.terrainProvider,o.lerp_pos).then(function(e){for(var t=e.length,i=[],n=0;n<t;n++){var r=re.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 re.Cartesian3(e.x,e.y,e.z),t=t.cartesianToCartographic(e),e=re.Math.toDegrees(t.latitude);return{longitude:re.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 re.PolygonGeometry({polygonHierarchy:new re.PolygonHierarchy(re.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),e=re.PolygonGeometry.createGeometry(e),o=new re.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),o=new re.MaterialAppearance({translucent:!1,flat:!0,material:o});this.bottomSurface=new re.Primitive({geometryInstances:new re.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 re.WallGeometry({positions:t,maximumHeights:n,minimumHeights:r}),e=re.WallGeometry.createGeometry(e),o=new re.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),o=new re.MaterialAppearance({translucent:!1,flat:!0,material:o});this.wellWall=new re.Primitive({geometryInstances:new re.GeometryInstance({geometry:e,attributes:{color:re.ColorGeometryInstanceAttribute.fromColor(re.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=re.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(re.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)},re.Scene.TerrainClipPlan=e},buildLightScanGraphics:function(e){if(this._viewer&&e){for(var l=this,t=function(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 re.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 re.PolygonHierarchy(re.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)},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 re.PolygonHierarchy(re.Cartesian3.fromDegreesArrayHeights([i,n,r,e[a].x,e[a].y,0,e[0].x,e[0].y,0])):new re.PolygonHierarchy(re.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=re.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 re.TimeIntervalCollection([new re.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 re.CallbackProperty(function(){return n},!1),width:t||10,material:r||new re.PolylineGlowMaterialProperty({glowPower:1,color:re.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=re.Matrix4.fromRotationTranslation(re.Matrix3.fromQuaternion(t),e),this._viewer.camera.lookAtTransform(t,i.cameraOffset()))})},_createSampledPosition(t){this.startTime=re.JulianDate.now(),this.stopTime=re.JulianDate.addSeconds(this.startTime,60*t.length,new re.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=re.ClockRange.CLAMPED;var i=new re.SampledPositionProperty;for(let e=0;e<t.length;e++){var n=re.JulianDate.addSeconds(this.startTime,60*e,new re.JulianDate),r=t[e];i.addSample(n,r)}return i},_sampleOrientation(){let r,o,a;return new re.CallbackProperty(e=>{var t=this.droneEntity.position.getValue(e);if(o=this.droneEntity.position.getValue(re.JulianDate.addSeconds(e,1/60,new re.JulianDate)),t&&o){r=t;const e=re.Cartesian3.subtract(o,r,new re.Cartesian3),i=re.Cartesian3.normalize(e,new re.Cartesian3),n=re.Transforms.rotationMatrixFromPositionVelocity(r,i,re.Ellipsoid.WGS84);a=re.Quaternion.fromRotationMatrix(n)}return a},!1)},_installCss3Renderer:function(){function e(e,t){this._scratch=new re.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=e,this._isBackHide=t,this._postBuildFun=null,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;s._scene.canvas.clientHeight;let l=new re.Cartesian2;this._postBuildFun=function(){document.querySelectorAll(".close__box__btn").forEach(function(e){e.style.position="absolute",e.style.top="5px",e.style.right="5px",e.style.cursor="pointer",e.style.color="#fff",e.addEventListener("click",function(){a.contains(o)&&(a.removeChild(o),s._postBuildFun)&&s._scene.postRender.removeEventListener(s._postBuildFun)})});for(var e=0;e<o.children.length;e++){var t,i=s._elements[e],n=i.position,n=n instanceof re.Cartesian3?n:re.Cartesian3.fromDegrees(n[0],n[1],n[2]||0),r=(re.SceneTransforms.worldToWindowCoordinates(s._scene,n,l),i.offset?i.offset[0]:0),i=i.offset?i.offset[1]:0;re.defined(l)&&((t=o.children[e]).style.position="absolute",t.style.zIndex=99,t.style.left=l.x+r+"px",t.style.top=l.y-t.offsetHeight+i+"px",s._isBackHide)&&(r=s._camera.position,t=s._scene.globe.ellipsoid.cartesianToCartographic(r).height,t+=+s._scene.globe.ellipsoid.maximumRadius,re.Cartesian3.distance(r,n)>t?o.children[e].style.display="none":o.children[e].style.display="block")}},this._scene.postRender.addEventListener(this._postBuildFun)},e.prototype.remove=function(e){this._elements=this._elements.filter(function(e){e.id}),this._container.removeChild(document.getElementById(e)),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun)},e.prototype.removeChild=function(){var e=document.getElementById(this._parentEleId);e.contains(this._container)&&e.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun)},e.prototype.close=function(){var e=document.getElementById(this._parentEleId);e.contains(this._container)&&e.removeChild(this._container),this._postBuildFun&&this._scene.postRender.removeEventListener(this._postBuildFun)},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),re.Math.toRadians(30)),o=re.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 re.CallbackProperty(function(){return(a+=l)>=s&&(a=s),re.Cartesian3.fromDegrees(t,i,a/2)},!1),box:{dimensions:new re.CallbackProperty(function(){return(a+=l)>=s&&(a=s,c)&&(c=!1,n.append(e,!0)),new re.Cartesian3(e.boxSide||100,e.boxSide||100,a)},!1),material:e.boxMaterial||re.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:re.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new re.CallbackProperty(function(){return.001},!1),semiMajorAxis:new re.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new re.CallbackProperty(function(){return r+=.05},!1),stRotation:new re.CallbackProperty(function(){return r+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:e.id+"_3",name:"椭圆",position:re.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new re.CallbackProperty(function(){return.001},!1),semiMajorAxis:new re.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new re.CallbackProperty(function(){return o-=.03},!1),stRotation:new re.CallbackProperty(function(){return o-=.03},!1),zIndex:3}}))},re.Scene.Css3Renderer=e)},_installClusterLayer:function(){if(this._viewer){const t=this._viewer,i={pixelRange:40,minimumClusterSize:5,image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABmDSURBVHgB7d0LdBTXeQfw/+gFkhEsCBACCa8BY2OcIAx2gh+x3MRpmpzEkDatSRwDTdLG6cOmdU6b06ZG7WnTJO3BSZr2tDk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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHL+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 re.CustomDataSource("clusterLayer"),this.unClusterLayer=new re.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 re.Entity({id:e.id||Math.random().toString(36).substring(2),props:e,position:re.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=re.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()},re.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:re.Color.WHITE,showBackground:!0,verticalOrigin:re.VerticalOrigin.BOTTOM,pixelOffset:new re.Cartesian2(0,0)},billboard:{width:25,height:25,pixelOffset:new re.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 re.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,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADK0lE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BgwBkrKBQhoBEa+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=re.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 re.Color?i:re.Color.fromCssColorString(i).withAlpha(.85),a.barLayer.entities.add({id:e+"-bar",name:"3DBar",position:new re.CallbackProperty(function(){return re.Cartesian3.fromDegrees(r[0],r[1],d/2)},!1),box:{dimensions:new re.CallbackProperty(function(){return new re.Cartesian3(l,c,d)},!1),material:p,outline:!1},show:!0});o=i instanceof re.Color?i:re.Color.fromCssColorString(i).withAlpha(.7);a.config.labelShow&&a.barLayer.entities.add({id:e+"-label",position:new re.CallbackProperty(function(){return re.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 re.CallbackProperty(function(){return re.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)}()},re.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=(t+=2*(20*Math.sin(6*e*oe)+20*Math.sin(2*e*oe))/3)+2*(20*Math.sin(e*oe)+40*Math.sin(e/3*oe))/3)+2*(150*Math.sin(e/12*oe)+300*Math.sin(e/30*oe))/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=(i+=2*(20*Math.sin(6*e*oe)+20*Math.sin(2*e*oe))/3)+2*(20*Math.sin(t*oe)+40*Math.sin(t/3*oe))/3)+2*(160*Math.sin(t/12*oe)+320*Math.sin(t*oe/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*oe,o=Math.sin(r),o=1-se*o*o,a=Math.sqrt(o),i=180*i/(ae*(1-se)/(o*a)*oe),o=2*t-(t+180*n/(ae/a*Math.cos(r)*oe)),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*oe,o=Math.sin(r),o=1-se*o*o,a=Math.sqrt(o),e=e+180*i/(ae*(1-se)/(o*a)*oe),i=t+180*n/(ae/a*Math.cos(r)*oe);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="",f=0;f<d.length;f++){var g=d[f];m+=(g=this.wgs2gcj(g))[0]+","+g[1]+",",0==f&&(p=g[0]+","+g[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===le.routeQueryType.DRIVE?(r=t.url||"https://restapi.amap.com/v5/direction/driving",delete t.url,this._queryDrivingRoute(r,t,i,n)):e===le.routeQueryType.WALK?(r=t.url||"https://restapi.amap.com/v3/direction/walking",delete t.url,this._queryWalkCycleRoute(r,t,i,n)):e===le.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 ce=null;function he(e,t,i){e&&(ce=t,this._analysisLayer=new ce.CustomDataSource("analysisLayer"),A.prototype={...A.prototype,...f.prototype},c.prototype={...c.prototype,...f.prototype},this.$math3d=new A(e,t),this.$graphics=new c(e,t),e)&&e.dataSources.add(this._analysisLayer)}function ue(e){if(e&&e.positions){var t=e.positions,i=e.that,n=[],e=[],r=[],o=t[0],t=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];ce.defined(l.position)||a.splice(e,1)}if(!ce.defined(a[0].position))throw new ce.DeveloperError("position is undefined");var s=a[0].position,l=ce.Cartesian3.distance(s,t)<5,s=[o,a[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:ce.ArcType.NONE,material:new ce.PolylineArrowMaterialProperty(ce.Color.GREEN)}});e.push(s),l||(s=[a[0].position,t],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:ce.ArcType.NONE,material:new ce.PolylineArrowMaterialProperty(ce.Color.RED)}}),e.push(s));for(let e=0;e<a.length;++e){var c,h=a[e].object;h&&(h instanceof ce.Cesium3DTileFeature?(r.push(h),h.oldColor=h.color.clone(),h.color=ce.Color.fromAlpha(ce.Color.YELLOW,h.color.alpha)):h.id instanceof ce.Entity&&(c=(h=h.id).polygon||h.polyline,r.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=ce.Color.fromAlpha(ce.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:a[e].position,ellipsoid:{radii:new ce.Cartesian3(.8,.8,.8),material:ce.Color.RED}}))}var s=ce.Cartographic.fromCartesian(o),e=ce.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:ce.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:ce.VerticalOrigin.BOTTOM,horizontalOrigin:ce.HorizontalOrigin.LEFT})}ue.prototype.remove=function(){}}function de(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=ce.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 ce.Cartesian3(o.outerPositions[e],o.outerPositions[e+1],o.outerPositions[e+2]),s=ce.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 ce.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=ce.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 ce.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:r})}else alert("高程异常!")})}}catch(e){console.log(e)}de.prototype.remove=function(){}}function pe(e){if(e&&e.positions){for(var t=e.positions,i=e.that,n=t[0],o=t[1],a=[ce.Cartographic.fromCartesian(n)],s=new ce.Cartesian3,l=[0],c=[0],h=1;h<=10;h++){ce.Cartesian3.lerp(n,o,h/10,s);var u=ce.Cartographic.fromCartesian(s),d=i._viewer.scene.globe.getHeight(u),d=(u.height=d,a.push(u),a[h-1]),p=ce.Cartesian3.distance(ce.Cartographic.toCartesian(d),ce.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");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",e.style.opacity=.9,r.init(e).setOption({title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!1,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:"平均值"}]}}]})}}function me(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 ce.PolygonGeometry.fromPositions({positions:e,vertexFormat:ce.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:n}),d=new ce.PolygonGeometry.createGeometry(n),p=0,m=0,f=new ce.Cartesian3;for(let e=0;e<d.indices.length;e+=3){u=d.indices[e],o=d.indices[e+1],l=d.indices[e+2],c=d.attributes.position.values,f.x=c[3*u],f.y=c[3*u+1],f.z=c[3*u+2],u=ce.Cartographic.fromCartesian(f),r=t._viewer.scene.globe.getHeight(u),a=ce.Cartesian3.fromRadians(u.longitude,u.latitude,r),h=ce.Cartesian3.fromRadians(u.longitude,u.latitude,0),m<r&&(m=r),f.x=c[3*o],f.y=c[3*o+1],f.z=c[3*o+2],u=ce.Cartographic.fromCartesian(f),o=t._viewer.scene.globe.getHeight(u),s=ce.Cartesian3.fromRadians(u.longitude,u.latitude,o),A=ce.Cartesian3.fromRadians(u.longitude,u.latitude,0),m<o&&(m=o),f.x=c[3*l],f.y=c[3*l+1],f.z=c[3*l+2],u=ce.Cartographic.fromCartesian(f),c=t._viewer.scene.globe.getHeight(u),l=ce.Cartesian3.fromRadians(u.longitude,u.latitude,c),u=ce.Cartesian3.fromRadians(u.longitude,u.latitude,0),m<c&&(m=c),h=h,A=A,u=u,g=void 0,g=ce.Cartesian3.distance(h,A),A=ce.Cartesian3.distance(A,u),u=ce.Cartesian3.distance(u,h),h=(g+A+u)/2,p+=Math.sqrt(h*(h-g)*(h-A)*(h-u))*(r-15e3+o-15e3+c-15e3)/3;var g=[],A=(g.push(a),g.push(s),g.push(l),{polygon:{hierarchy:{positions:g},extrudedHeight:0,perPositionHeight:!0,material:ce.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:ce.Color.WHITE,outlineWidth:2}});t._analysisLayer.entities.add(A)}n=function(e){for(var t=[],i=[],n=0;n<e.length;n++){var r=ce.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 ce.Cartographic(u,d)}(e),i._volumeLabel=t._analysisLayer.entities.add({position:ce.Cartesian3.fromRadians(n.longitude,n.latitude,m+1e3),label:{text:"Cut Volume "+p.toString()+"m3"}})}else alert("未获取到地形")}}he.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new ue({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 de({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;ce.defined(n)?t.destroy():(n=new ce.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),e.pop();t=new ce.Scene.TerrainClipPlan(n._viewer,{height:r,splitNum:o,wallImg:a,bottomImg:s});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||{},!r)return alert("需要引入echarts库"),!1;var n=this;this._viewer&&i&&n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new pe({positions:e,that:n});n._graphicsLayer&&n._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 me({positions:e,that:i});"function"==typeof t.callback&&t.callback(e)}})}};var fe={version:"1.0.0",PlotUtils:{}},ge=(fe.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},fe.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=fe.PlotUtils.distance(e[i],e[i+1]);return t},fe.PlotUtils.getBaseLength=function(e){return Math.pow(fe.PlotUtils.wholeDistance(e),.99)},fe.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},fe.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 fe.PlotUtils.getIntersectPoint(n,t,r,e)},fe.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])},fe.PlotUtils.getAzimuth=function(e,t){var i,n=Math.asin(Math.abs(t[1]-e[1])/fe.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=fe.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},fe.PlotUtils.getAngleOfThreePoints=function(e,t,i){e=fe.PlotUtils.getAzimuth(t,e)-fe.PlotUtils.getAzimuth(t,i);return e<0?e+fe.Constants.TWO_PI:e},fe.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},fe.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},fe.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]]},fe.PlotUtils.getThirdPoint=function(e,t,i,n,r){e=fe.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]},fe.PlotUtils.getArcPoints=function(e,t,i,n){for(var r=[],o=(o=n-i)<0?o+fe.Constants.TWO_PI:o,a=0;a<=fe.Constants.FITTING_COUNT;a++){var s=i+o*a/fe.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);r.push([l,s])}return r},fe.PlotUtils.getBisectorNormals=function(e,t,i,n){var r,o,a=fe.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=fe.PlotUtils.distance(t,i),h=fe.PlotUtils.distance(i,n),s=s>fe.Constants.ZERO_TOLERANCE?fe.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]},fe.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)]},fe.PlotUtils.getCurvePoints=function(e,t){for(var i=[fe.PlotUtils.getLeftMostControlPoint(t)],n=0;n<t.length-2;n++)var r=t[n],o=t[n+1],a=t[n+2],a=fe.PlotUtils.getBisectorNormals(e,r,o,a),i=i.concat(a);for(var s=fe.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<fe.Constants.FITTING_COUNT;e++){var c=fe.PlotUtils.getCubicValue(e/fe.Constants.FITTING_COUNT,r,i[2*n],i[2*n+1],o);l.push(c)}l.push(o)}return l},fe.PlotUtils.getLeftMostControlPoint=function(e){var i,n,r,o,a,s=e[0],l=e[1],e=e[2],c=fe.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=fe.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>fe.Constants.ZERO_TOLERANCE?(e=fe.PlotUtils.mid(s,l),r=s[0]-e[0],i=s[1]-e[1],n=2/fe.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]},fe.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=fe.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=fe.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>fe.Constants.ZERO_TOLERANCE?(l=fe.PlotUtils.mid(c,e),r=e[0]-l[0],i=e[1]-l[1],n=2/fe.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]},fe.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=fe.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},fe.PlotUtils.getBinomialFactor=function(e,t){return fe.PlotUtils.getFactorial(e)/(fe.PlotUtils.getFactorial(t)*fe.PlotUtils.getFactorial(e-t))},fe.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},fe.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=fe.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},fe.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},fe.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"}),Ae="doublearrow",ve=.25,ye=.3,we=.85,Ce=.15,_e={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},Pe={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};ge.algorithm={},ge.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?ge.algorithm.getTempPoint4(n,r,o):this.points[3],this.connPoint=3==a||4==a?fe.PlotUtils.mid(n,r):this.points[4],e=fe.PlotUtils.isClockWise(n,r,o)?(h=ge.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),ge.algorithm.getArrowPoints(this.connPoint,r,o,!0)):(h=ge.algorithm.getArrowPoints(r,this.connPoint,o,!1),ge.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=fe.PlotUtils.getBezierPoints(u),s=fe.PlotUtils.getBezierPoints(e.concat(l.slice(1))),h=fe.PlotUtils.getBezierPoints(h),a=u.concat(d,s,c,h),e=ge.algorithm.array2Dto1D(a);i.controlPoint=[n,r,o,this.tempPoint4,this.connPoint],i.polygonalPoint=t.Cartesian3.fromDegreesArray(e)}return i},ge.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=ge.algorithm.getTempPoint4(i,n,r),this.tempPoint5=fe.PlotUtils.mid(r,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=o<6?fe.PlotUtils.mid(i,n):this.points[5],e=fe.PlotUtils.isClockWise(i,n,r)?(c=ge.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),ge.algorithm.getArrowPoints(this.connPoint,n,r,!0)):(c=ge.algorithm.getArrowPoints(n,this.connPoint,r,!1),ge.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=fe.PlotUtils.getBezierPoints(h),a=fe.PlotUtils.getBezierPoints(e.concat(s.slice(1))),c=fe.PlotUtils.getBezierPoints(c),o=h.concat(u,a,l,c),e=ge.algorithm.array2Dto1D(o);t.controlPoint=[i,n,r,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},ge.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},ge.algorithm.getArrowPoints=function(e,t,i,n){this.type=Ae,this.headHeightFactor=ve,this.headWidthFactor=ye,this.neckHeightFactor=we,this.neckWidthFactor=Ce;var r=fe.PlotUtils.mid(e,t),o=fe.PlotUtils.distance(r,i),a=fe.PlotUtils.getThirdPoint(i,r,0,.3*o,!0),s=fe.PlotUtils.getThirdPoint(i,r,0,.5*o,!0),a=[r,fe.PlotUtils.getThirdPoint(r,a,fe.Constants.HALF_PI,o/5,n),fe.PlotUtils.getThirdPoint(r,s,fe.Constants.HALF_PI,o/4,n),i],r=ge.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=r[0],o=r[4],n=fe.PlotUtils.distance(e,t)/fe.PlotUtils.getBaseLength(a)/2,i=ge.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)},ge.algorithm.getArrowHeadPoints=function(e,t,i){this.type=Ae,this.headHeightFactor=ve,this.headWidthFactor=ye,this.neckHeightFactor=we,this.neckWidthFactor=Ce;var n=fe.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],t=(fe.PlotUtils.distance(t,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,o=n*this.neckHeightFactor,n=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),e=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),o=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,t,!1),n=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,t,!0);return[fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,i,!1),o,r,n,fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,i,!0)]},ge.algorithm.getArrowBodyPoints=function(e,t,i,n){for(var r=fe.PlotUtils.wholeDistance(e),o=fe.PlotUtils.getBaseLength(e)*n,a=(o-fe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=fe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(o/2-(s+=fe.PlotUtils.distance(e[h-1],e[h]))/r*a)/Math.sin(u),p=fe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=fe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ge.algorithm.getTempPoint4=function(e,t,i){var n,r,o,t=fe.PlotUtils.mid(e,t),a=fe.PlotUtils.distance(t,i),i=fe.PlotUtils.getAngleOfThreePoints(e,t,i),a=i<fe.Constants.HALF_PI?(n=a*Math.sin(i),r=a*Math.cos(i),o=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!1),fe.PlotUtils.getThirdPoint(t,o,fe.Constants.HALF_PI,r,!0)):i>=fe.Constants.HALF_PI&&i<Math.PI?(n=a*Math.sin(Math.PI-i),r=a*Math.cos(Math.PI-i),o=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!1),fe.PlotUtils.getThirdPoint(t,o,fe.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=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!0),fe.PlotUtils.getThirdPoint(t,o,fe.Constants.HALF_PI,r,!0)):(n=a*Math.sin(2*Math.PI-i),r=a*Math.cos(2*Math.PI-i),o=fe.PlotUtils.getThirdPoint(e,t,fe.Constants.HALF_PI,n,!0),fe.PlotUtils.getThirdPoint(t,o,fe.Constants.HALF_PI,r,!1));return a},ge.algorithm.tailedAttackArrow=function(e,t){e=ge.algorithm.dereplication(e),this.tailWidthFactor=_e.tailWidthFactor,this.swallowTailFactor=_e.swallowTailFactor,this.swallowTailPnt=_e.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=(fe.PlotUtils.isClockWise(e[0],e[1],e[2])&&(n=e[1],r=e[0]),[fe.PlotUtils.mid(n,r)].concat(e.slice(2))),o=ge.algorithm.getAttackArrowHeadPoints(e,n,r,_e),a=o[0],s=o[4],l=fe.PlotUtils.distance(n,r),c=fe.PlotUtils.getBaseLength(e),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=fe.PlotUtils.getThirdPoint(e[1],e[0],0,h,!0);h=ge.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=fe.PlotUtils.getQBSplinePoints(l),c=fe.PlotUtils.getQBSplinePoints(c),n=ge.algorithm.array2Dto1D(l.concat(o,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=t.Cartesian3.fromDegreesArray(n)}return i},ge.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=fe.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],o=fe.PlotUtils.distance(r,e[e.length-2]),t=fe.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=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),e=fe.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),o=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,i,!1),n=fe.PlotUtils.getThirdPoint(r,n,fe.Constants.HALF_PI,i,!0);return[fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,t,!1),o,r,n,fe.PlotUtils.getThirdPoint(r,e,fe.Constants.HALF_PI,t,!0)]},ge.algorithm.getAttackArrowBodyPoints=function(e,t,i,n){for(var r=fe.PlotUtils.wholeDistance(e),o=fe.PlotUtils.getBaseLength(e)*n,a=(o-fe.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=fe.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(o/2-(s+=fe.PlotUtils.distance(e[h-1],e[h]))/r*a)/Math.sin(u),p=fe.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=fe.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},ge.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},ge.algorithm.fineArrow=function(e,t,i){var n,r,o,a,s,l,c;if(!(e.length<2||t.length<2))return n=Pe.tailWidthFactor,c=Pe.neckWidthFactor,s=Pe.headWidthFactor,a=Pe.headAngle,l=Pe.neckAngle,(r=[])[0]=e,r[1]=t,e=r[0],t=r[1],c=(r=fe.PlotUtils.getBaseLength(r))*c,s=r*s,n=fe.PlotUtils.getThirdPoint(t,e,fe.Constants.HALF_PI,r=r*n,!0),r=fe.PlotUtils.getThirdPoint(t,e,fe.Constants.HALF_PI,r,!1),o=fe.PlotUtils.getThirdPoint(e,t,a,s,!1),a=fe.PlotUtils.getThirdPoint(e,t,a,s,!0),s=fe.PlotUtils.getThirdPoint(e,t,l,c,!1),l=fe.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 xe=null;function be(e,t){this.viewer=e,xe=t,this.handler=new xe.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=xe.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=ge,this.tooltip=new E(e,t),this.tooltip.initTool()}be.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},be.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new xe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let Se=null;var Me=function(e,t){be.call(this,e,t),Se=t,this.type="AttackArrow",this.fillMaterial=Se.Color.RED.withAlpha(.5)};function Ee(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}Me.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 Se.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 Se.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){var e=Ee(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))},Se.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!i.floatPoint||i.positions.length<2||(e=Ee(e.endPosition,i.viewer))&&(i.floatPoint.position.setValue(e),i.tooltip.showAtCartesian(e,"右键结束!"),2<=i.positions.length)&&(Se.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)))},Se.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){e=Ee(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}},Se.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=Se.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 Se.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=n.viewer.scene.pick(e.position);if(Se.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=Ee(e.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.selectPoint=null)},Se.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=Ee(e.endPosition,n.viewer);e&&(n.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),n.selectPoint)&&(n.selectPoint.position.setValue(e),n.positions[n.selectPoint.wz-1]=e)},Se.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:Se.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(o){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new Se.PolygonGraphics({hierarchy:new Se.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,Se),r=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(r=n.polygonalPoint),new Se.PolygonHierarchy(r)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=Se.Math.toDegrees(e.latitude);return[Se.Math.toDegrees(e.longitude),t]}},(Me.prototype=Object.create(Object.assign({},Me.prototype,be.prototype))).constructor=Me;let Ie=null;var Te=function(e,t){be.call(this,e,t),Ie=t,this.type="StraightArrow",this.fillMaterial=Ie.Color.fromCssColorString("#0000FF").withAlpha(.8)};function Le(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}Te.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 Ie.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 Ie.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=Le(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()))},Ie.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){i.positions.length<1||(e=Le(e.endPosition,i.viewer))&&(i.tooltip.showAtCartesian(e,"左键单击结束!"),i.floatPoint.position.setValue(e),2<=i.positions.length)&&(Ie.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),t&&t(i.objId)))},Ie.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 Ie.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);Ie.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=Le(e.position,i.viewer))&&i.selectPoint&&i.selectPoint.position&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},Ie.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=Le(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)},Ie.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(e){this.state=-1,this.positions=[];for(var t=[],i=0;i<e.length;i++){var n=Ie.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:Ie.Color.RED}});return e.attr="editPoint",e},showArrowOnMap:function(a){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new Ie.PolygonGraphics({hierarchy:new Ie.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]],Ie);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var r=0;r<n.length;r++){var o=new Ie.Cartesian3(n[r].x,n[r].y,n[r].z);i.push(o)}return new Ie.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=Ie.Math.toDegrees(e.latitude);return[Ie.Math.toDegrees(e.longitude),t]}},(Te.prototype=Object.create(Object.assign({},Te.prototype,be.prototype))).constructor=Te;let De=null;var Be=function(e,t){be.call(this,e,t),De=t,this.type="PincerArrow",this.fillMaterial=De.Color.YELLOW.withAlpha(.8)};function ke(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}function Ge({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,this.sphere3=e,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;return this.isColumbusViewMode()||(e=this.cesiumViewer.scene.sun._boundingVolume.center,e=this.cartesian3ToVector(e),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}isColumbusViewMode(){return this.cesiumViewer.scene.mode===s.SceneMode.COLUMBUS_VIEW}isThreeRenderable(){var e=this.cesiumViewer.scene;return e.mode!==s.SceneMode.SCENE2D&&(Math.abs(e.morphTime)<s.Math.EPSILON6||Math.abs(e.morphTime-1)<s.Math.EPSILON6)}getSceneOriginPosition(){return this.isColumbusViewMode()?this.cartesianToCVWorld(s.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)):s.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)}cartesianToCVWorld(e){e=this.cesiumViewer.scene.mapProjection.project(s.Cartographic.fromCartesian(e));return new a.Vector3(e.z,e.x,e.y)}updateGroupMatrixWorld(){var e,t;return this.isColumbusViewMode()?(this.cameraOffset.copy(this.getSceneOriginPosition()),this.syncGroup.rotation.set(-Math.PI/2,-Math.PI/2,0),this.syncGroup.updateMatrix(),this.syncGroup.up.set(1,0,0),this.up.set(1,0,0),this.sphere.visible=!1,this.sphere3.visible=!1):(this.sphere.visible=!0,this.sphere3.visible=!0,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(),this.syncGroup.up.set(0,0,-1),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.isThreeRenderable()?this.renderThree():this.renderer.clear(),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)}positionToCartesian(e){if(Array.isArray(e))return s.Cartesian3.fromDegrees(e[0],e[1],2<e.length?e[2]:0);if(e&&"object"==typeof e){if("number"==typeof e.longitude&&"number"==typeof e.latitude)return s.Cartesian3.fromRadians(e.longitude,e.latitude,e.height||0);if("number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z)return new s.Cartesian3(e.x,e.y,e.z)}throw new Error("THREE.ThreeCesiumScene: invalid position, expect [lng, lat, height] | Cesium.Cartesian3 | Cesium.Cartographic.")}positionToWorldVector(e){var t=this.positionToCartesian(e),i=this.getSceneOriginPosition();if(this.isColumbusViewMode()){const e=this.cartesianToCVWorld(t);return new a.Vector3(e.x-i.x,e.y-i.y,e.z-i.z)}return new a.Vector3(t.x-i.x,t.y-i.y,t.z-i.z)}setObjectPosition(e,t){return e&&e.isObject3D?(this.updateGroupMatrixWorld(),this.updateMatrixWorld(!0),t=this.positionToWorldVector(t),e.position.copy(this.childrenGroup.worldToLocal(t))):console.error("THREE.ThreeCesiumScene.setObjectPosition: object must be an instance of THREE.Object3D.",e),this}getObjectPosition(e){if(!e||!e.isObject3D)return console.error("THREE.ThreeCesiumScene.getObjectPosition: object must be an instance of THREE.Object3D.",e),null;this.updateGroupMatrixWorld(),this.updateMatrixWorld(!0);var t=this.getSceneOriginPosition(),e=this.childrenGroup.localToWorld(e.position.clone()),e=new s.Cartesian3(e.x+t.x,e.y+t.y,e.z+t.z),t=this.isColumbusViewMode()?this.cesiumViewer.scene.mapProjection.unproject(new s.Cartesian3(e.y,e.z,e.x)):s.Cartographic.fromCartesian(e);return[s.Math.toDegrees(t.longitude),s.Math.toDegrees(t.latitude),t.height]}}return e.prototype.isScene=!0,e.prototype.isGIS=!0,e}Be.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 n=this;this.state=1,this.handler||(this.handler=new De.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){e=ke(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)}},De.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!n.floatPoint||n.positions.length<2||(e=ke(e.endPosition,n.viewer))&&(n.floatPoint.position.setValue(e),n.tooltip.showAtCartesian(e,"右键单击结束!"),2<=n.positions.length)&&(De.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)))},De.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){if(4<=n.positions.length){e=ke(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}}},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;var i=this;for(let e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new De.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);if(De.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=ke(e.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},De.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){e=ke(e.endPosition,i.viewer);e&&(i.tooltip.showAtCartesian(e,"左键选取圆点开始修改,单击停止修改,点击图形之外结束!"),i.selectPoint)&&(i.selectPoint.position.setValue(e),i.positions[i.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){return this.viewer.entities.add({position:e,point:{pixelSize:10,color:De.Color.RED},show:!0})},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.doubleArrow(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]}},(Be.prototype=Object.create(Object.assign({},Be.prototype,be.prototype))).constructor=Be;let Re=null,Oe=null;function ze(e,t,i,n){if(e&&n){const{threeGlobal:i,containerId:r,threeContainerId:o}=n;Re=t,Oe=i,this._viewer=e,this._containerId=r,this._threeContainerId=o,this._Scene=Ge({THREE:Oe,Cesium:Re,viewer:e}),this._initContainer()}}ze.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 Oe.PerspectiveCamera(t,i,n,r),this._three.renderer=new Oe.WebGLRenderer({alpha:!0,antialias:!0,logarithmicDepthBuffer:!0,stencil:!0,depth:!0}),this._three.renderer.outputEncoding=Oe.sRGBEncoding,this._three.renderer.shadowMap.enabled=!0,this._three.renderer.shadowMap.type=Oe.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()},setPosition(e,t){return this._three&&this._three.scene?this._three.scene.setObjectPosition(e,t):console.error("ThreeJs.setPosition: please call initThree first."),this},getPosition(e){return this._three&&this._three.scene?this._three.scene.getObjectPosition(e):(console.error("ThreeJs.getPosition: please call initThree first."),null)},_objHasOwnProperty:(e,t,i)=>e.hasOwnProperty(t)?e[t]:i,destroyThreeJS(){this._three.scene.dispose()}};class Ve{constructor(e){return this.init(e)}init({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:o={},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 a(e).init({containerId:i,viewerConfig:r,extraConfig:o,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 Fe extends Ve{constructor(e){return super({...e,baseExtendsCom:[f,A,B],extendsCom:L,extendsComName:"draw"})}}class He extends Ve{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:J,extendsComName:"customCesiumPlugin"})}}exports.Analysis=class extends Ve{constructor(e){return super({...e,baseExtendsCom:[f,L,le],extendsCom:he,extendsComName:"analysis"})}},exports.AttackArrow=Me,exports.Control=class extends Ve{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:ne,extendsComName:"control"})}},exports.CustomCesiumPlugin=class{constructor(e){return new He(e)}},exports.Draw=class{constructor(e){var t=new Fe(e);return this._initCurrMeasure(e,t)}_initCurrMeasure(e,t){var i=new Me(t.viewer,e.cesiumGlobal),n=new Te(t.viewer,e.cesiumGlobal),e=new Be(t.viewer,e.cesiumGlobal);return{...t,attackArrowObj:i,straightArrowObj:n,pincerArrowObj:e}}},exports.Graphics=class extends Ve{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:c,extendsComName:"graphics"})}},exports.Material=class extends Ve{constructor(e){return super({...e,baseExtendsCom:[f,d],extendsCom:u,extendsComName:"material"})}},exports.Math2d=B,exports.Math3d=A,exports.PassEffect=class extends Ve{constructor(e){return super({...e,baseExtendsCom:[f,d],extendsCom:G,extendsComName:"passEffect"})}},exports.PincerArrow=Be,exports.Plugin=class extends Ve{constructor(e){return super({...e,baseExtendsCom:[f,c],extendsCom:le,extendsComName:"plugin"})}},exports.Primitive=class extends Ve{constructor(e){return super({...e,baseExtendsCom:f,extendsCom:S,extendsComName:"primitive"})}},exports.StraightArrow=Te,exports.ThreeJs=class extends Ve{constructor(e){return super({...e,baseExtendsCom:[],extendsCom:ze,extendsComName:"threeJs"})}},exports.initCesium=function({cesiumGlobal:e,threeGlobal:t,containerId:i,threeContainerId:n,viewerConfig:r={},extraConfig:o={},imageryProvider:l={},MapImageryList:h=[],defaultStatic:p,viewer:m}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";if(!i&&!m)throw"Missing containerId parameter, please check the calling function initCesium.";e.defaultValue||(e.Scene.defaultValue=s);var g,y,v,r=new a(e).init({containerId:i,viewerConfig:r,extraConfig:o,MapImageryList:h,imageryProvider:l,viewer:m}),o=(y=e,v=p,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});return{viewer:g=r,material:o([f,d],u),graphics:o(f,c),math3d:o(f,A),math2d:new B(r,e),primitive:o(f,S),draw:o([f,A,B],L),passEffect:o([f,d],G),customCesiumPlugin:o(f,J),control:o(f,ne),plugin:o([f,c],le),base:new f(r,e),analysis:o([f,L,le],he),attackArrowObj:new Me(r,e),straightArrowObj:new Te(r,e),pincerArrowObj:new Be(r,e),threeJs:new ze(r,e,p,t?{threeGlobal:t,containerId:i,threeContainerId:n}:"")}};
|