月球大数据地理空间分析展示平台-【中台】
Surpriseplus
2023-08-18 1690dbaf68c73ce716776cdd98992c8fad0226d2
资源管理添加预览功能
已添加2个文件
已修改4个文件
715 ■■■■ 文件已修改
public/CIMSDK/CimSDK.min.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/形状 9.png 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/moonMap.vue 317 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/js/server.js 323 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/resourceManagement.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/uploadmanage.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/CIMSDK/CimSDK.min.js
@@ -16748,7 +16748,7 @@
                }
                material.alpha = u_alpha;
            }
            `})};kO.prototype.destroy=function(){this._tileset.customShader===this._customShader&&(this._customShader=void 0,this._tileset.customShader=void 0),this._scene.preUpdate.removeEventListener(this._preUpdate)};function eRi(){this.customShaders={},this.customShaders.lightLine=kO}var uct=eRi;function kH(o,A){this.options=Ae(A,{}),this.earthCtrl=o,this.viewer=o.coreMap,this.CSME=jie,this.Cust=new this.CSME.CustomShaderStage(this.options.primitive,A),this.stageArr=[],this.eventListener=null,this.eventListener=this.viewer.scene.preUpdate.addEventListener(()=>{this.Cust.update()}),this.create()}kH.prototype.create=function(o){let A=this,f=null;o?f=o:f=A.options,f.lineMaterialStage&&(A.LineMaterialStage=new A.CSME.LineMaterialStage(Ae(f.lineMaterialStage,{weight:.5})),A.Cust.addStage(A.LineMaterialStage),A.stageArr.push(A.LineMaterialStage)),f.gradientMaterialStage&&(A.GradientMaterialStage=new A.CSME.GradientMaterialStage(Ae(f.gradientMaterialStage,{weight:.5})),A.Cust.addStage(A.GradientMaterialStage),A.stageArr.push(A.GradientMaterialStage)),f.normalizeMaterialStage&&(A.NormalizeMaterialStage=new A.CSME.NormalizeMaterialStage(Ae(f.normalizeMaterialStage,{weight:.5})),A.Cust.addStage(A.NormalizeMaterialStage),A.stageArr.push(A.NormalizeMaterialStage)),f.dynamicColorMaterialStage&&(A.DynamicColorMaterialStage=new A.CSME.DynamicColorMaterialStage(Ae(f.dynamicColorMaterialStage,{weight:.5})),A.Cust.addStage(A.DynamicColorMaterialStage),A.stageArr.push(A.DynamicColorMaterialStage)),f.reflectMaterialStage&&(A.ReflectMaterialStage=new A.CSME.ReflectMaterialStage(Ae(f.reflectMaterialStage,{weight:.5})),A.Cust.addStage(A.ReflectMaterialStage),A.stageArr.push(A.ReflectMaterialStage)),f.textureMaterialStage&&(A.TextureMaterialStage=new A.CSME.TextureMaterialStage(Ae(f.textureMaterialStage,{weight:.5,url:`${globalThis.GEOWORLD_BASE_URL}Assets/Textures/window.png`})),A.Cust.addStage(A.TextureMaterialStage),A.stageArr.push(A.TextureMaterialStage))};kH.prototype.addStage=function(o){let A=this;A.Cust.addStage(o),A.stageArr.push(o)};kH.prototype.removeStage=function(o){this.Cust.removeStage(o.name)};kH.prototype.update=function(){let o=this;o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=o.viewer.scene.preUpdate.addEventListener(()=>{o.Cust.update()})};kH.prototype.removeFromMap=function(){let o=this;for(let A=0;A<o.stageArr.length;A++)o.removeStage(o.stageArr[A]);o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=null};var cct=kH;function nle(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._options.visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#101010")),this._options.outlineWidth=Ae(A.outlineWidth,1),this._options.thresholdAngle=Ae(A.thresholdAngle,12*Math.PI/180),this.add()}nle.prototype.add=function(){this._edgeStage=j6();let o=this._edgeStage;o.visibleEdgeColor=this._options.visibleEdgeColor,o.outlineWidth=this._options.outlineWidth,o.thresholdAngle=this._options.thresholdAngle,o.selected=[{},{}],o.enabled=!0,this._earthCtrl.Viewer.postProcessStages.add(o)};nle.prototype.removeFromMap=function(){this._edgeStage&&(this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage),this.__edgeStage=null)};Object.defineProperties(nle.prototype,{show:{get:function(){return this._edgeStage.show},set:function(o){this._edgeStage.show=o}},outlineWidth:{get:function(){return this._edgeStage.outlineWidth},set:function(o){this._edgeStage.outlineWidth=o}},thresholdAngle:{get:function(){return this._edgeStage.thresholdAngle},set:function(o){!o||(this._edgeStage.thresholdAngle=o)}},visibleEdgeColor:{get:function(){return this._edgeStage.visibleEdgeColor},set:function(o){!o||(this._edgeStage.visibleEdgeColor=o)}},hiddenEdgeColor:{get:function(){return this._edgeStage.hiddenEdgeColor},set:function(o){!o||(this._edgeStage.hiddenEdgeColor=o)}},showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Act=nle;function ole(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#ff0000")),this._hiddenEdgeColor=Ae(A.hiddenEdgeColor,ht.fromCssColorString("#4d4d4d")),this.handler=null,this.key=Ae(A.key,"id"),this.model=Ae(A.model,null),this.add()}ole.prototype.add=function(){let o=this,A="";this._edgeStage=j6(!0);let f=this._edgeStage;f.visibleEdgeColor=this._visibleEdgeColor,f.hiddenEdgeColor=this._hiddenEdgeColor,f.selected=[],f.enabled=!1,this._earthCtrl.Viewer.postProcessStages.add(f);function m(C,y){function x(E,I){let w=E.featuresLength;for(let Q=0;Q<w;++Q){let M=E.getFeature(Q);if(M.getProperty(o.key)===A){let T={pickId:M.pickId};y.selected=[T],y.enabled=!0}}}function v(E,I){let w=E.content,Q=w.innerContents;if(O(Q)){let M=Q.length;for(let B=0;B<M;++B)x(Q[B],I)}else x(w,I)}C.tileVisible.addEventListener(function(E){A!==""&&v(E,null)})}m(this.model,f),this.handler=new Vr(this._earthCtrl.coreMap.scene.canvas),this.handler.setInputAction(function(C){let y=o._earthCtrl.coreMap.scene.pick(C.position);if(f.selected=[],A="",!y||!y.primitive)return;let v=y.primitive._pickIds,I={pickId:y.pickId};f.selected=[I],f.enabled=!0,A=y.getProperty(o.key)},Ji.LEFT_CLICK)};ole.prototype.removeFromMap=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._edgeStage&&this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage)};Object.defineProperties(ole.prototype,{showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var hct=ole;function Hs(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Hx(){return((1+je.nextRandomNumber())*65536|0).toString(16).substring(1)}Hs.createUUID=function(){return`${Hx()+Hx()}-${Hx()}-${Hx()}-${Hx()}-${Hx()}${Hx()}${Hx()}`};Hs.createUUIDWithoutDash=function(){return Hx()+Hx()+Hx()+Hx()+Hx()+Hx()+Hx()+Hx()};Hs.prototype.createUUID=function(){return Hs.createUUID()};Hs.prototype.createGroup=function(o){let A=new LO;return A.id=o.id||Hs.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};Hs.prototype.createImageryLayer=function(o,A){let f=new zse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.IMAGERYPROVIDERS),f),f};Hs.prototype.createTerrainLayer=function(o,A){let f=new Yse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.TERRAINPROVIDERS),f),f};Hs.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new vP({})};Hs.prototype.createFeatureLayer=function(o,A){let f=new qse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.FEATURELAYERS),f),f};Hs.prototype.createModelLayer=function(o,A){let f=new Wse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.MODELLAYERS),f),f};Hs.prototype.createWfsModel=function(o,A){let f=new c6(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.MODELLAYERS),f),f};Hs.prototype.createModel=function(o,A){let f=new Ese(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.removeModel=function(o){O(o)&&o.removeFromMap()};Hs.prototype.createCZMLObject=function(o,A){let f=this,m=Ae(o.addToMap,!0),C=new fJ(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),C),C};Hs.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,O(o.name)&&(A.name=o.name),O(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};Hs.prototype.removeElement=function(o){O(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};Hs.prototype.createVideoProjection=function(o,A){o.addToMap=Ae(o.addToMap,!0);let f=Ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new sse(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),m)):f==="panorama"?(m=new Yut(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),m)):f==="fisheye"&&(m=new lse(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),m)),m};Hs.prototype.createTrack=function(o,A){let f=new Jut(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createSceneNode=function(o,A,f){let m=new LO(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};Hs.prototype.createFire=function(o,A){let f=new Ase(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createSmoke=function(o,A){let f=new dse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createExplosion=function(o,A){let f=new gse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createFireworks=function(o,A){let f=new mse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createRadarScan=function(o,A){let f=new Cse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createCircleScan=function(o,A){let f=new $ut(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createUpDownScan=function(o){let A=new tct(this._earthCtrl,o);return A.show=!0,A};Hs.prototype.createWaters=function(o,A){let f=new ele(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createHeatmap=function(o,A){let f=Wut.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createLabel=function(o,A){let f=new _se(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createBillboard=function(o,A){let f=new xse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPolyline=function(o,A){let f=new wse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPolygon=function(o,A){let f=new Qse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPoint=function(o,A){let f=new Dse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createBox=function(o,A){let f=new Mse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createEllipsoid=function(o,A){let f=new Fse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createCylinder=function(o,A){let f=new Rse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createRectangle=function(o,A){let f=new kse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createEllipse=function(o,A){let f=new Use(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPolylineVolume=function(o,A){let f=new Hse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createEChartLayer=function(o,A){let f=new Zse(this._earthCtrl);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPointLight=function(o){return new rct(this._earthCtrl,o)};Hs.prototype.createHawkeye=function(o){let A=new tle(this._earthCtrl,o);A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&A.addToMap(o)};Hs.prototype.createSpotLight=function(o){let A=new rle(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderManager=function(o){let A=new uct;return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderStage=function(o){let A=new cct(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createModelOutline=function(o={}){let A=new Act(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.modelClick=function(o={}){let A=new hct(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};var w2=Hs;var ale=class extends l0{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new ase(A);let m=new LO(A);m.id=w2.createUUID(),m.name=Ae(f.ProjectName,"root"),m.version=Ae(f.version,null),m.desc=Ae(f.desc,null),m.createTime=Ae(f.createTime,new Date().toISOString()),m.lastUpdate=Ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new wN("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];O(f)&&this.removeChild(f)}removeChild(A){O(A)&&O(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){O(A)&&O(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);O(m)&&O(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let y=0;y<m.parentNode.childNodes.length;y++)m.parentNode.childNodes[y].id===m.id&&(C=y);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=je.clamp(f,0,A.length-1),m=je.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,y){let x={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},v=0,E=[];for(let I in x){let w=x[I],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let T=Q.childNodes[B].toJSON();M.push(T)}Promise.all(M).then(function(B){let T=[];if(B.length!==0){for(let L=0;L<B.length;L++)T.push(B[L]);let D=T[0].class;D!=="IMAGERY_LAYER"&&D!=="TERRAIN_LAYER"&&D!=="MODEL_LAYER"&&D!=="FEATURE_LAYER"&&(D="USER_SCENE");let F={item:D,objJson:T};E.push(F)}v++,v===5&&(C(E),v=0)})}}).then(function(C){let y={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(y.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(y.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(y.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(y.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(y.userScene=C[w].objJson);let x={class:"ENVIRONMENT",underGround:Ae(f._earthCtrl.camera.undergroundMode,null),shadow:Ae(f._earthCtrl.shadows,null),depthTest:Ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:Ae(f._earthCtrl.environment.rain.show,null),snow:Ae(f._earthCtrl.environment.snow.show,null),fog:Ae(f._earthCtrl.environment.fog.show,null),bwMode:Ae(f._earthCtrl.environment.bwMode.show,null),nightMode:Ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:Ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:Ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:Ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:Ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},v={class:"SKYBOX",positiveX:Ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:Ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:Ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:Ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:Ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:Ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},E={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};y.userScene.push(x),y.userScene.push(v),y.userScene.push(E);let I=JSON.stringify(y);A&&A(I)})}};Object.defineProperties(ale.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var sle=ale;function dct(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var wHi=new xs,bHi=new te,QHi=new te;dct.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let y=document.createElement("div");y.style=f,o.appendChild(y);let x=A.scene.canvas,v=A.scene.globe.ellipsoid;new Vr(x).setInputAction(function(I){let w=A.camera.pickEllipsoid(I.endPosition,v);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=je.toDegrees(Q.latitude).toFixed(6),B=je.toDegrees(Q.longitude).toFixed(6),T=A.camera.positionCartographic.height.toFixed(1);y.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${T}\u7C73`}},Ji.MOUSE_MOVE)};var fct=dct;function uu(){}uu.parseBaseData=function(o,A){let f=[];if(O(A)&&O(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let y=A.imageryProviders[C];if(y.enable===!1||y.show===!1)continue;if(O(y.tilingScheme)){let v=y.tilingScheme;v.type==="GeographicTilingScheme"&&(y.tilingScheme=new kf(v))}let x=w2.createImageryLayer(y);f.push(x)}let m=[];if(O(A)&&O(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let y=A.terrainProviders[C];if(y.enable===!1||y.show===!1)continue;let x=w2.createTerrainLayer(y);m.push(x)}return{imageryProvider:f,terrainProvider:m}};uu.parse=function(o,A){if(!O(A))return;let f=[rl.IMAGERYPROVIDERS,rl.TERRAINPROVIDERS,rl.MODELLAYERS,rl.FEATURELAYERS,rl.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(w2.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}O(A[rl.IMAGERYPROVIDERS])&&OH(o,A[rl.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),O(A[rl.TERRAINPROVIDERS])&&OH(o,A[rl.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),O(A[rl.MODELLAYERS])&&OH(o,A[rl.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),O(A[rl.FEATURELAYERS])&&OH(o,A[rl.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),O(A[rl.USERSCENE])&&OH(o,A[rl.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function OH(o,A,f,m){for(let C=0;C<A.length;C++){let y=A[C],x=null;if(y.enable===!1)continue;O(y.class)?(y.class==="IMAGERY"&&(y.class=Eo.IMAGERY_LAYER),y.class==="TERRAIN"&&(y.class=Eo.TERRAIN_LAYER),x=y.class):(m===0?y.class=Eo.IMAGERY_LAYER:m===1&&(y.class=Eo.TERRAIN_LAYER),x=y.class);let v=uu.parserMap[x];v!==void 0&&v(o,y,f)}}function tRi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=Ae(A.show,!0),o.userScene.addChild(f,m),O(A.childNodes)&&OH(o,A.childNodes,m)}function iRi(o,A,f){let m=A;if(O(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new kf(C))}o.factory.createImageryLayer(m,f)}function rRi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function nRi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function oRi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function aRi(o,A,f){o.coreMap.scene.skyBox=new xN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function sRi(o,A,f){o.camera.undergroundMode=Ae(A.underGround,!1),o.shadows=Ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=Ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function lRi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function uRi(o,A,f){o.factory.createModel(A,f)}function cRi(o,A,f){o.factory.createWaters(A,f)}function ARi(o,A,f){o.factory.createExplosion(A,f)}function hRi(o,A,f){o.factory.createFireworks(A,f)}function dRi(o,A,f){o.factory.createSmoke(A,f)}function fRi(o,A,f){o.factory.createFire(A,f)}function gRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function pRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function mRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function CRi(o,A,f){A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function yRi(o,A,f){o.factory.createBillboard(A,f)}function xRi(o,A,f){A.positions&&(A.positions=uu.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new ht(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function vRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=uu.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function ERi(o,A,f){A.coordinates&&(A.coordinates=Si.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function IRi(o,A,f){o.factory.createEllipse(A,f)}function _Ri(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new te(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function BRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new te(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function wRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function bRi(o,A,f){o.factory.createPolylineVolume(A,f)}function QRi(o,A,f){o.factory.createVideoProjection(A,f)}function SRi(o,A,f){o.factory.createVideoProjection(A,f)}function DRi(o,A,f){o.factory.createTrack(A,f)}function TRi(o,A,f){o.factory.createHeatmap(A,f)}function MRi(o,A,f){o.factory.createEChartLayer(A,f)}function PRi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}uu.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=te.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};uu.parserMap={};uu.parserMap[Eo.NODE]=tRi;uu.parserMap[Eo.IMAGERY_LAYER]=iRi;uu.parserMap[Eo.TERRAIN_LAYER]=rRi;uu.parserMap[Eo.MODEL_LAYER]=nRi;uu.parserMap[Eo.FEATURE_LAYER]=oRi;uu.parserMap[Eo.SKYBOX]=aRi;uu.parserMap[Eo.ENVIRONMENT]=sRi;uu.parserMap[Eo.VIEWPOINT]=lRi;uu.parserMap[Eo.MODEL]=uRi;uu.parserMap[Eo.WATERS]=cRi;uu.parserMap[Eo.EXPLOSION]=ARi;uu.parserMap[Eo.FIREWORK]=hRi;uu.parserMap[Eo.SMOKE]=dRi;uu.parserMap[Eo.FIRE]=fRi;uu.parserMap[Eo.RADARSCAN]=gRi;uu.parserMap[Eo.CIRCLESCAN]=pRi;uu.parserMap[Eo.POINT]=mRi;uu.parserMap[Eo.LABEL]=CRi;uu.parserMap[Eo.BILLBOARD]=yRi;uu.parserMap[Eo.POLYLINE]=xRi;uu.parserMap[Eo.POLYGON]=vRi;uu.parserMap[Eo.RECTANGLE]=ERi;uu.parserMap[Eo.ELLIPSE]=IRi;uu.parserMap[Eo.BOX]=_Ri;uu.parserMap[Eo.ELLIPSOID]=BRi;uu.parserMap[Eo.CYLINDER]=wRi;uu.parserMap[Eo.POLYLINEVOLUME]=bRi;uu.parserMap[Eo.PERSPECTIVE_VIDEO_PROJECTION]=QRi;uu.parserMap[Eo.FISHEYE_VIDEO_PROJECTION]=SRi;uu.parserMap[Eo.TRACK]=DRi;uu.parserMap[Eo.HEATMAP]=TRi;uu.parserMap[Eo.ECHARTLAYER]=MRi;uu.parserMap.ELEMENT=PRi;var gct=uu;var ITe=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,O(this.editBillboard)&&O(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(O(A)&&O(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:O(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},pct=ITe;var _Te=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,O(this.editPoint)&&O(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(O(A)&&O(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:O(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},mct=_Te;var BTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,O(this.editBox)&&O(this.editBox.entity.box)){let y=this.editBox.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te;this.getNorthPointByDistance(v,E),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:v,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:E,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),O(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let y=Vn.eastNorthUpToFixedFrame(C),x=new te,v=this.editBox.entity.box.dimensions._value;v||(v=this.editBox.entity.box.dimensions.getValue(m)),te.divideByScalar(v,2,x),te.clone(x,A),te.clone(x,f),A.y*=-1,Xe.multiplyByPoint(y,A,A),f.y*=-1,f.z*=-1,Xe.multiplyByPoint(y,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=gi.fromDate(f);if(O(this.currentPoint)||O(this.pickEditHeightPoint)||O(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,y=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!y)return;let x=$t.fromCartesian(y),v=te.fromRadians(x.longitude,x.latitude,x.height+this.height);if(O(this.currentPoint))this.currentPoint.position=v,this.editBox.entity.position=new bn(function(){return v},!1);else if(O(this.dragPosition)){if(O(this.pickEditWHPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=te.normalize(w,new te);te.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=te.clone(M);B.x-=w.x,B.y+=w.y,te.abs(B,B),this.editBox.entity.box.dimensions=new bn(function(){return B},!1)}else if(O(this.pickEditHeightPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=te.clone(Q);M.z+=w.z,te.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=y;let E=new te,I=new te;this.getNorthPointByDistance(E,I,m),this.editHeightPoint.position=E,this.editWHPoint.position=I}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(O(A)&&O(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:O(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Cct=BTe;var wTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,O(this.editCylinder)&&O(this.editCylinder.entity.cylinder)){let y=this.editCylinder.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value,I=new te,w=new te,Q=new te;this.getNorthPointByDistance(I,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),v>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:I,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),E>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,y=Vn.eastNorthUpToFixedFrame(C),x=this.editCylinder.entity.cylinder.length._value,v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value;v>0&&(A.z+=x/2,A.x+=v,Xe.multiplyByPoint(y,A,A)),E>0&&(f.x+=E,f.z-=x/2,Xe.multiplyByPoint(y,f,f)),m.z+=x/2,Xe.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.heightPoint)||O(this.topRadiusPoint)||O(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editCylinder.entity.position=y;else if(O(this.dragPosition)){if(O(this.pickHeightPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(O(this.pickTopRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(O(this.pickBottomRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let x=this.editCylinder.entity.cylinder.topRadius._value,v=this.editCylinder.entity.cylinder.bottomRadius._value,E=new te,I=new te,w=new te;this.getNorthPointByDistance(E,I,w),x>0&&(this.topRadiusPoint.position=E),v>0&&(this.bottomRadiusPoint.position=I),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(O(A)&&O(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:O(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},yct=wTe;var bTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,O(this.editEllipse)&&O(this.editEllipse.entity.ellipse)){let y=je.PI_OVER_TWO,x=this.updatePoint(y);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:x,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new te,m=new te,C=new te,y=this.editEllipse.entity.ellipse;this.semiMinorAxis=y.semiMinorAxis._value,this.semiMajorAxis=y.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let x=Ae(y.rotation,0);this.center=this.editEllipse.entity.position._value;let v=this.semiMinorAxis*this.semiMinorAxis,E=this.semiMajorAxis*this.semiMajorAxis,I=this.semiMajorAxis*this.semiMinorAxis,w=te.magnitude(this.center),Q=te.normalize(this.center,f),M=te.cross(te.UNIT_Z,this.center,m);M=te.normalize(M,M);let B=te.cross(Q,M,C),T=new te;return nB.pointOnEllipsoid(A,x,B,M,v,I,E,w,Q,T)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickSemiMajorAxisPoint)||O(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(O(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(O(this.pickSemiMajorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let y=C*this.semiMinorAxis/this.semiMajorAxis;y>C&&(y=C),this.editEllipse.entity.ellipse.semiMinorAxis=y}else if(O(this.pickSemiMinorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(je.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(O(A)&&O(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:O(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},xct=bTe;var QTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,O(this.editEllipsoid)&&O(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let y=this.editEllipsoid.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te,I=new te;this.getNorthPointByDistance(v,E,I),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:E,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:I,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,y=Vn.eastNorthUpToFixedFrame(C),x=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=x.x,Xe.multiplyByPoint(y,A,A),f.y=-x.y,Xe.multiplyByPoint(y,f,f),m.z=x.z,Xe.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickRadiiXPoint)||O(this.pickRadiiYPoint)||O(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editEllipsoid.entity.position=y;else{if(O(this.dragPosition)){let I=te.subtract(m,this.dragPosition,new te),w=te.normalize(I,new te);te.dot(I,w,I);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=te.clone(Q);O(this.pickRadiiXPoint)?M.x-=I.x:O(this.pickRadiiYPoint)?M.y+=I.y:O(this.pickRadiiZPoint)&&(M.z+=I.z,this.editEllipsoid.entity.position=this.addHeight(I.z)),te.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let x=new te,v=new te,E=new te;this.getNorthPointByDistance(x,v,E),this.radiiXPoint.position=x,this.radiiYPoint.position=v,this.radiiZPoint.position=E}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(O(A)&&O(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:O(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},vct=QTe;var STe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,O(this.editPolygon)&&O(this.editPolygon.entity.polygon))for(let y=0;y<this.editPolygon.entity.polygon.hierarchy._value.positions.length;y++){let x=this.editPolygon.entity.polygon.hierarchy._value.positions[y],v=this.mEarthCtrl.entities.add({name:"polygon_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(O(A)&&O(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ect=STe;var DTe=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=ht.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,O(this.editModel)&&O(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=$t.clone(C);y.longitude=je.toDegrees(y.longitude),y.latitude=je.toDegrees(y.latitude),this.editModel.lon=y.longitude,this.editModel.lat=y.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(O(A)&&O(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(O(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Ict=DTe;var TTe=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,O(this.editLabel)&&O(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(O(A)&&O(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:O(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},_ct=TTe;var MTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,O(this.editPolyline)&&O(this.editPolyline.polyline))for(let y=0;y<this.editPolyline.polyline.positions._value.length;y++){let x=this.editPolyline.polyline.positions._value[y],v=this.mEarthCtrl.entities.add({name:"polyline_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(O(A)&&O(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Bct=MTe;var PTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,O(this.editPolylineVolume)&&O(this.editPolylineVolume.entity.polylineVolume))for(let y=0;y<this.editPolylineVolume.entity.polylineVolume.positions._value.length;y++){let x=this.editPolylineVolume.entity.polylineVolume.positions._value[y],v=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:x,point:{color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(O(A)&&O(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:O(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},wct=PTe;var RTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,O(this.editRectangle)&&O(this.editRectangle.entity.rectangle)){let y=this.editRectangle.entity.rectangle.coordinates._value,x=this.editRectangle.entity.rectangle.height._value,v=Si.northwest(y),E=te.fromRadians(v.longitude,v.latitude,x),I=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:E,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(I.id),v=Si.southeast(y);let w=te.fromRadians(v.longitude,v.latitude,x),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.leftTopPoint)||O(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=this.editRectangle.entity.rectangle.coordinates._value;O(this.leftTopPoint)?(this.leftTopPoint.position=m,y.west=C.longitude,y.north=C.latitude):O(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,y.south=C.latitude,y.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=y}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(O(A)&&O(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:O(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},bct=RTe;function bd(o){this._earthCtrl=o,this._coreMap=o.coreMap}bd.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new mct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};bd.prototype.updatePoint=function(o,A){o.updatePoint(A)};bd.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new Bct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};bd.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};bd.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ect(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};bd.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};bd.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new Cct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};bd.prototype.updateBox=function(o,A){o.updateBox(A)};bd.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new vct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};bd.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};bd.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new yct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};bd.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};bd.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ict(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};bd.prototype.updateModel=function(o,A){o.updateModel(A)};bd.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new pct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};bd.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};bd.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new _ct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};bd.prototype.updateLabel=function(o,A){o.updateLabel(A)};bd.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new bct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};bd.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};bd.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new xct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};bd.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};bd.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new wct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};bd.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};bd.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var lle=bd;function xy(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}xy.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],y="",x=[],v,E=this.scene.globe.ellipsoid,I={spot:[],distance:[],label:[],polyline:[]},w={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(w.point=A.point),O(A.polyline)&&(w.polyline=A.polyline));let Q=new iI;this.scene.primitives.add(Q);let M=new NA,B=new Vr(f.scene.canvas),T=document.createElement("div");rA(".map-widget",T),rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let F=document.getElementById("toolTip");F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let L;m=!0;let R=function(V){let H=0,q=`${0}\u7C73`,ie,Z,oe,ne,se,ce;for(let j=0;j<V.length-1;j+=1)ie=E.cartesianToCartographic(V[j]),Z=M.project(ie),oe=Z.x,ne=Z.y,ie=E.cartesianToCartographic(V[j+1]),Z=M.project(ie),se=Z.x,ce=Z.y,H=H+Math.sqrt((oe-se)*(oe-se)+(ne-ce)*(ne-ce));return H>0&&(q=`${H.toFixed(2)}\u7C73`),H/1e3>=1&&(q=`${(H/1e3).toFixed(2)}\u5343\u7C73`),q},k=function(){function V(H){if(!O(H))throw new Vi("positions is required!");if(H.length<2)throw new Vi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let q=as.fromType(as.ColorType);q.uniforms.color=new ht(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=H,this._init()}return V.prototype._init=function(){let H=this,q=function(){return H.path};this.options.polyline.positions=new bn(q,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,I.polyline.push(this.lineEntity)},V}();B.setInputAction(function(V){let H,q;F.style.left=`${V.endPosition.x+10}px`,F.style.top=`${V.endPosition.y+20}px`,F.style.display="block",F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=!1,Z=f.camera.getPickRay(V.endPosition);Z&&(H=f.scene.globe.pick(Z,f.scene));let oe=f.scene.pick(V.endPosition);if(oe){console.log("feature",oe);let ne=f.scene.pickPosition(V.endPosition);ne&&(H=ne),ie=!0}if(!!H&&(q=Pi.WGS84.cartesianToCartographic(H),q)){let ne;ie?ne=f.scene.sampleHeight(q):ne=f.scene.globe.getHeight(q);let se=te.fromDegrees(q.longitude/Math.PI*180,q.latitude/Math.PI*180,ne);if(m){if(C.length<1)return;O(v)?(v.path.pop(),v.path.push(se)):(C.push(se),v=new k(C));let ce=R(v.path);f.entities.remove(L),L=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v.path[v.path.length-1],label:{text:`\u603B\u957F\uFF1A${ce}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},Ji.MOUSE_MOVE);let U=function(V){x.push(V);let H=[];if(x.length>1){let q=x[x.length-2],ie=x[x.length-1],Z=Math.abs(q.longitude-ie.longitude)*1e7,oe=Math.abs(q.latitude-ie.latitude)*1e7;Z>oe&&(oe=Z);let ne=parseInt(oe/10);ne>1e3&&(ne=1e3),ne<2&&(ne=2);for(let se=0;se<ne;++se)H.push(new $t(je.lerp(q.longitude,ie.longitude,se/(ne-1)),je.lerp(q.latitude,ie.latitude,se/(ne-1))));H.push(ie.clone())}else H=x;if(H.length>0)for(let q=0;q<H.length;q++){V=H[q];let ie=f.scene.globe.getHeight(V),Z=te.fromDegrees(V.longitude/Math.PI*180,V.latitude/Math.PI*180,ie);C.push(Z)}};return B.setInputAction(function(V){let H,q,ie=!1,Z=f.camera.getPickRay(V.position);if(Z&&(H=f.scene.globe.pick(Z,f.scene)),f.scene.pick(V.position)){let ne=f.scene.pickPosition(V.position);ne&&(H=ne),ie=!0}if(H&&(q=Pi.WGS84.cartesianToCartographic(H)),q){let ne;ie?ne=f.scene.sampleHeight(q):ne=f.scene.globe.getHeight(q);let se=te.fromDegrees(q.longitude/Math.PI*180,q.latitude/Math.PI*180,ne);if(m){v&&v.path.pop(),U(q);let ce="0\u7C73";v&&(ce=R(v.path)),y=ce,I.spot.push(se),I.distance.push(ce);let j=f.entities.add({position:se,point:{pixelSize:5,color:w.point,outlineColor:ht.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ce,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});I.label.push(j),f._points.push(j)}}},Ji.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(L),f._points[f._points.length-1].label.text=y,B.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(I),F.style.display="none"},Ji.RIGHT_CLICK),this};xy.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new Vr(f.scene.canvas),C=[],y=null,x="0\u7C73",v=null,E,I="",w,Q=document.createElement("div");rA(".map-widget",Q),rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T={name:"",spot:[],distance:[],label:[],ployline:[]},D={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(D.point=A.point),O(A.polyline)&&(D.polyline=A.polyline));let F=function(){function L(R){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:D.polyline,width:3,clampToGround:!1}},this.positions=R,this._init()}return L.prototype._init=function(){let R=this,k=function(){return R.positions};this.options.polyline.positions=new bn(k,!1);let U=f.entities.add(this.options);f.item=U,T.ployline.push(U);let V=f.getuid();T.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${V}`},L}();return m.setInputAction(function(L){if(f.scene.bim){let R=f.scene.bim.PickWorldPositionSync(L.endPosition.x,L.endPosition.y);R[0]===0?v=f.scene.pickPosition(L.endPosition):v=new te(R[0],R[1],R[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.endPosition);!v||(B.style.left=`${L.endPosition.x+10}px`,B.style.top=`${L.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(O(y)?(C.pop(),C.push(v)):y=new F(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',x=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${x}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},Ji.MOUSE_MOVE),m.setInputAction(function(L){if(f.scene.bim){let k=f.scene.bim.PickWorldPositionSync(L.position.x,L.position.y);k[0]===0?v=f.scene.pickPosition(L.position):v=new te(k[0],k[1],k[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.position);if(!v)return;C.length===0&&C.push(v.clone()),C.push(v);let R=x;I=`\u603B\u957F\uFF1A${x}`,E=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:D.point,outlineColor:ht.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:R,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),heightReference:yn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(E),T.spot.push(v),T.distance.push(x),T.label.push(E)},Ji.LEFT_CLICK),m.setInputAction(function(L){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=I),m.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(T)},Ji.RIGHT_CLICK),this};xy.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=$t.fromCartesian(o[m]),y=$t.fromCartesian(o[m+1]),x=new V0;x.setEndPoints(C,y);let v=x.surfaceDistance;v=Math.sqrt(Math.pow(v,2)+Math.pow(y.height-C.height,2)),A=A+v}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};xy.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new Vr(f.scene._imageryLayerCollection),y=document.getElementById("toolTip");y||(rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),y=document.getElementById("toolTip")),y.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let x=[],v={},E=[],I=[],w=null,Q=null,M,B={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(B.point=A.point),O(A.polyline)&&(B.polyline=A.polyline),O(A.polygon)&&(B.polygon=A.polygon));let T={mj:0,label:[],polygon:[]};y.style.display="block";let D=function(){function F(L){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=L,this._init()}return F.prototype._init=function(){let L=this,R=function(){return L.hierarchy};this.options.polygon.hierarchy=new bn(R,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,T.polygon=this.polygon},F}();return C.setInputAction(function(F){if(y.style.left=`${F.endPosition.x+10}px`,y.style.top=`${F.endPosition.y+20}px`,f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.endPosition.x,F.endPosition.y);V[0]===0?Q=f.scene.pickPosition(F.endPosition):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.endPosition);if(!Q)return;let L=$t.fromCartesian(Q),R=je.toDegrees(L.longitude),k=je.toDegrees(L.latitude),U=L.height;if(x.length>=2){O(w)?(x.pop(),x.push(Q),v=new Un(x),I.pop(),I.push({lon:R,lat:k,hei:U})):(v=new Un(x),w=new D(v));let V=f.getArea(I,x);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:V,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),T.label=M}},Ji.MOUSE_MOVE),C.setInputAction(function(F){if(f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.position.x,F.position.y);V[0]===0?Q=f.scene.pickPosition(F.position):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.position);if(!Q)return;let L=$t.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",L);let R=je.toDegrees(L.longitude),k=je.toDegrees(L.latitude),U=L.height;x.length===0&&(x.push(Q.clone()),v=new Un(x),I.push({lon:R,lat:k,hei:U}),x.push(Q.clone()),v=new Un(x),I.push({lon:R,lat:k,hei:U})),x.push(Q),v=new Un(x),E.push({lon:R,lat:k,hei:U}),I.push({lon:R,lat:k,hei:U})},Ji.LEFT_CLICK),C.setInputAction(function(F){y.style.display="none",f.entities.remove(M),C.destroy();let L=f.getArea(I,x);m=L;let R=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:L,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(R),f._lable=R,T.mj=m,T.label=R,O(o)&&typeof o=="function"&&o(T)},Ji.RIGHT_CLICK),this};xy.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,y=[],x={},v,E=f.scene,I=E.globe.ellipsoid,w=new iI;E.primitives.add(w);let Q,M,B=0,T={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(T.point=A.point),O(A.polyline)&&(T.polyline=A.polyline),O(A.polygon)&&(T.polygon=A.polygon));let D=document.createElement("div");rA(".map-widget",D),rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let L=document.getElementById("toolTip");L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R=new Vr(E.canvas),k=function(){function V(H){if(!O(H))throw new Vi("positions is required!");if(H.length<3)throw new Vi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:T.polygon,clampToGround:!1}},this.path=H,this._init()}return V.prototype._init=function(){let H=this,q=function(){return H.path};this.options.polygon.hierarchy=new bn(q,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},V}();R.setInputAction(function(V){let H=0;f.entities.remove(M);let q,ie,Z=f.scene.camera.getPickRay(V.endPosition);Z&&(q=f.scene.globe.pick(Z,f.scene));let oe=f.scene.pick(V.endPosition),ne=!1;if(oe){let ce=f.scene.pickPosition(V.endPosition);ce&&(q=ce),ne=!0}if(!q)return;let se=function(ce){let j=new Array(ce.length),he=function(_e){return _e.longitude=_e.longitude/Math.PI*180,_e.latitude=_e.latitude/Math.PI*180,_e},me=function(_e){let be=0;for(let Be=0;Be<_e.length;Be++){let ve=_e[Be],z;Be<_e.length-1?z=_e[Be+1]:z=_e[0],be+=ve.x*z.y-z.x*ve.y}return be/2};for(let _e=0;_e<ce.length;_e++)j[_e]=he(I.cartesianToCartographic(ce[_e]));let Ee=0;for(let _e=0;_e<j.length;_e++)Ee+=j[_e].longitude;Ee=Ee/j.length;for(let _e=0;_e<j.length;_e++)j[_e]=f.Gauss_to_XY(j[_e].longitude,j[_e].latitude,Ee);return Math.abs(me(j))};if(ie=Pi.WGS84.cartesianToCartographic(q),ie&&C){if(L.style.left=`${V.endPosition.x+10}px`,L.style.top=`${V.endPosition.y+20}px`,L.style.display="block",y.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:q,label:{text:`${H}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(O(v)?(v.path.positions.pop(),v.path.positions.push(q)):(y.push(q),x=new Un(y),v=new k(x)),y.length>=2){L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ce=String(se(v.path.positions));ce=ce.substr(0,ce.indexOf(".",0)),ce.length<6?H=`${ce}\u5E73\u65B9\u7C73`:(ce=String(ce/1e6),ce=ce.substr(0,ce.indexOf(".",0)+3),H=`${ce}\u5E73\u65B9\u5343\u7C73`),m.mj=H,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:q,label:{text:H,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},Ji.MOUSE_MOVE),R.setInputAction(function(V){let H;B=1;let q=f.scene.camera.getPickRay(V.position);q&&(H=f.scene.globe.pick(q,f.scene));let ie=f.scene.pick(V.position),Z=!1;if(ie){let oe=f.scene.pickPosition(V.position);oe&&(H=oe),Z=!0}H&&C&&(y.push(H),x=new Un(y))},Ji.LEFT_CLICK),R.setInputAction(function(){R.removeInputAction(Ji.LEFT_CLICK),R.removeInputAction(Ji.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:y[y.length-1],pixelOffset:new wt(0,20),eyeOffset:new te(0,0,0),horizontalOrigin:eA.CENTER,verticalOrigin:_n.CENTER,scale:1,color:new ht(1,1,1,1)}),L.style.display="none",R.destroy(),O(o)&&typeof o=="function"&&o(m)},Ji.RIGHT_CLICK);let U=function(V){let H=0,q=0,ie=0;for(let oe=0;oe<V.length;oe++)H+=V[oe].x,q+=V[oe].y,ie+=V[oe].z;return new te(H/V.length,q/V.length,ie/V.length)};return this};xy.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};xy.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,y,x,v,E;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,y=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,x=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,v=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,E=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-y/2*Math.sin(2*o)+x/4*Math.sin(4*o)-v/6*Math.sin(6*o)+E/8*Math.sin(8*o))};xy.prototype.to_Radian=function(o){return o*Math.PI/180};xy.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,y=Math.sqrt(6378137*6378137-C*C)/C,x=0,v=0,E=0,I=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);I=this.to_N(A),E=I*Math.cos(A),x=Math.tan(A),v=y*M;let B=Math.pow(x,2),T=Math.pow(x,4),D=Math.pow(v,2),F=Math.pow(v,4),L=Math.pow(M,3),R=Math.pow(M,5),k=this.to_Sm(A)+Math.pow(Q,2)/2*E*M*x+Math.pow(Q,4)/24*x*E*L*(5-B+9*D+4*F)+Math.pow(Q,6)/720*x*E*R*(61-58*x*x+T+270*D-330*x*x*D),U=Q*I*M+Math.pow(Q,3)/6*I*L*(1-x*x+v*v)+Math.pow(Q,5)/120*I*R*(5-18*x*x+T+14*D-58*D*B);return new wt(U,k)};xy.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,y=(m+2)%o.length,x=this.Angle(o[m],o[C],o[y]),v=this.getdistance(A[m],A[C]),E=this.getdistance(A[C],A[y]);f+=v*E*Math.abs(Math.sin(x))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};xy.prototype.getdistance=function(o,A){let f=$t.fromCartesian(o),m=$t.fromCartesian(A),C=new V0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};xy.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,y=o.lon*f,x=A.lat*f,v=A.lon*f,E=-Math.atan2(Math.sin(y-v)*Math.cos(x),Math.cos(C)*Math.sin(x)-Math.sin(C)*Math.cos(x)*Math.cos(y-v));return E<0&&(E+=Math.PI*2),E=E*m,E};xy.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),y=m-C;return y<0&&(y+=360),y};xy.prototype.getuid=function(){return this.uuid(8,16)};xy.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|je.nextRandomNumber()*A];else{let y;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(y=0|je.nextRandomNumber()*16,m[C]=f[C===19?y&3|8:y])}return m.join("")};xy.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var SW=xy;function dw(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=Ae(A.show,!0),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._heading=Ae(A.heading,0),this._pitch=Ae(A.pitch,0),this._distance=Ae(A.distance,300),this._position=te.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=Ae(A.horizontalViewAngle,90),this._verticalViewAngle=Ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=Ae(A.visibleAreaColor,ht.GREEN.withAlpha(.4)),this._invisibleAreaColor=Ae(A.invisibleAreaColor,ht.RED.withAlpha(.4)),this._size=Ae(A.size,10240),this._softShadows=Ae(A.softShadows,!0),this._colorStyle=Ae(A.colorStyle,ht.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(dw.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});dw.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};dw.prototype.removeFromMap=function(){let o=this;O(o.viewShedMap)&&(o.viewShedMap.enabled=!1),O(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};dw.prototype.visualConeShow=function(o){let A=this;O(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};dw.prototype.addVisualPyramid=function(){let o=this,A=new i6({radii:new bn(function(){return new te(o._distance,o._distance,o._distance)},!1),minimumClock:new bn(function(){return je.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new bn(function(){return je.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new bn(function(){return je.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new bn(function(){return je.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new bn(function(){return o._colorStyle},!1)}),f=new kA({position:new bn(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};dw.prototype.createLightCamera=function(){O(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ml(this._coreMap.scene),this._lightCamera.position=this._position};dw.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!O(o)&&(O(o.lon)||O(o.lat)||O(o.height)||O(o.heading)||O(o.pitch)||O(o.roll)||O(o.far)||O(o.distance)||O(o.verticalViewAngle)||O(o.horizontalViewAngle))){let m=this._parameter;for(let v in o)o.hasOwnProperty(v)&&O(m[v])&&(m[v]=o[v]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=te.fromDegrees(m.lon,m.lat,m.height);let C=je.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let y=je.toRadians(A._horizontalViewAngle),x=je.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(y/2)/Math.tan(x/2),y>x?f.frustum.fov=y:f.frustum.fov=x}};dw.prototype.createShadowMap=function(){if(O(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new P6({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Vx=new te;dw.prototype.drawViewCentrum=function(){let o=this;function A(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=new cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let f=this._earthCtrl.entities.add({polyline:{positions:new bn(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=new cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let C=this._earthCtrl.entities.add({polyline:{positions:new bn(m,!1),material:this._colorStyle}});this._lineArray.push(C);function y(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=new cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let x=this._earthCtrl.entities.add({polyline:{positions:new bn(y,!1),material:this._colorStyle}});this._lineArray.push(x);function v(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let E=this._earthCtrl.entities.add({polyline:{positions:new bn(v,!1),material:this._colorStyle}});this._lineArray.push(E)};dw.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};dw.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=je.toRadians(this._horizontalViewAngle),A=je.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:je.toRadians(this._heading),pitch:je.toRadians(this._pitch),roll:0}})};var ule=dw;var LTe=Pi.WGS84;function Vf(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=RRi(this.coreMap.container)}function FTe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?FTe(o[f],null):A[f];return A}function Qct(o,A){let f=FTe(o),m;for(m in A)f[m]===void 0&&(f[m]=FTe(A[m]));return f}function RRi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let y=document.createElement("DIV");y.className="twipsy-inner",m.appendChild(y),this._div=m,this._title=y,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Vf.prototype.addToolbar=function(o,A){return A=Qct(A,{container:o}),new Vf.Toolbar(this,A)};var Sct={shiftX:0,shiftY:0};Vf.prototype.createBillboardGroup=function(o,A,f){let m=new Vf.BillboardGroup(this,A);return m.addBillboards(o,f),m};Vf.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=Qct(A,Sct);let f=new iI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Vf.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new wt(this._options.shiftX,this._options.shiftY),eyeOffset:new te(0,0,-1e3),horizontalOrigin:eA.CENTER,verticalOrigin:_n.CENTER,scale:.3,image:Ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new ht(1,1,1,1)});if(A){let y=function(v){C.enableRotate=v},x=function(){let v=0;for(let E=m._orderedBillboards.length;v<E&&m._orderedBillboards[v]!==f;++v);return v},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let v=this,E=new Vr(v._scene.canvas);setListener(f,"leftDown",function(I){function w(M){f.position=M;for(let B=0,T=v._orderedBillboards.length;B<T&&v._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(x(),M)}function Q(M){E.destroy(),y(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(x(),M)}E.setInputAction(function(M){let B=v._scene.camera.pickEllipsoid(M.endPosition,LTe);B?w(B):Q(B)},Ji.MOUSE_MOVE),E.setInputAction(function(M){Q(v._scene.camera.pickEllipsoid(M.position,LTe))},Ji.LEFT_UP),y(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(x(),v._scene.camera.pickEllipsoid(I,LTe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(v){A.onDoubleClick(x())}),A.onClick&&setListener(f,"leftClick",function(v){A.onClick(x())}),A.tooltip&&(setListener(f,"mouseMove",function(v){m._drawHelper._tooltip.showAt(v,A.tooltip())}),setListener(f,"mouseOut",function(v){m._drawHelper._tooltip.setVisible(!1)}))}return f};Vf.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Vf.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Vf.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Vf.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Vf.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Vf.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Vf.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Vf.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Vf.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Vf.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Vf.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,y=[],x=[],v;this._positions=x;let E=new Vr(f.canvas);this._mouseHandler=E;let I=new Vf.BillboardGroup(this,Sct);this._markers=I,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),E.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),T=$t.fromCartesian(B),D=je.toDegrees(T.longitude),F=je.toDegrees(T.latitude);if(B){if(y.length===0&&(y.push(D,F),x.push(B),v=B,I.addBillboard(v)),x.length>=4){let L=cl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(L!==void 0){let R=L.x-Q.position.x,k=L.y-Q.position.y;if(R*R+k*k<16){y.splice(y.length-2,2),x.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}y.push(D,F),x.push(B),I.addBillboard(B),x.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:te.fromDegreesArray(y),material:ht.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),Ji.LEFT_CLICK),E.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(x.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),T=f.globe.pick(B,f),D=$t.fromCartesian(T),F=je.toDegrees(D.longitude),L=je.toDegrees(D.latitude);if(T&&(y.splice(y.length-2,2),x.pop(),y.push(F,L),x.push(T),I.getBillboard(x.length-1).position=T,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4)){let R=cl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(R!==void 0){let k=R.x-M.x,U=R.y-M.y;k*k+U*U<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),Ji.MOUSE_MOVE),E.setInputAction(function(Q){x.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),Ji.LEFT_DOUBLE_CLICK);function w(){return te.fromDegreesArray(y)}};Vf.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:ht.RED.withAlpha(.5),outline:!0,outlineColor:ht.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Vf.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Vf.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Vf.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function LRi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=$t.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,y=0,x=0,v=0,E=0,I=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(y=A[0],x=f[0]):(y=A[Q+1],x=f[Q+1]),E=m*x-y*C,v+=E,I+=(m+y)*E,w+=(C+x)*E;return v*=.5,I/=6*v,w/=6*v,new $t(I,w)}function FRi(o,A,f){let m=te.distance(o,A),C=te.distance(A,f),y=te.distance(f,o),x=(m+C+y)/2;return Math.sqrt(x*(x-m)*(x-C)*(x-y))}Vf.prototype.computeCutVolume=function(){let o=15e3;for(let k=0;k<this._positions.length;k++){let U=$t.fromCartesian(this._positions[k]),V=this._scene.globe.getHeight(U);o>V&&(o=V)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new Yh.fromPositions({positions:this._positions,vertexFormat:Va.FLAT_VERTEX_FORMAT,granularity:A}),m=new Yh.createGeometry(f),C=0,y=0,x,v,E,I,w,Q,M,B,T,D,F,L;for(let k=0;k<m.indices.length;k+=3)x=m.indices[k],v=m.indices[k+1],E=m.indices[k+2],D=new te(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),F=$t.fromCartesian(D),I=this._scene.globe.getHeight(F),M=te.fromRadians(F.longitude,F.latitude,0),y<I&&(y=I),D=new te(m.attributes.position.values[v*3],m.attributes.position.values[v*3+1],m.attributes.position.values[v*3+2]),F=$t.fromCartesian(D),w=this._scene.globe.getHeight(F),B=te.fromRadians(F.longitude,F.latitude,0),y<w&&(y=w),D=new te(m.attributes.position.values[E*3],m.attributes.position.values[E*3+1],m.attributes.position.values[E*3+2]),F=$t.fromCartesian(D),Q=this._scene.globe.getHeight(F),T=te.fromRadians(F.longitude,F.latitude,0),y<Q&&(y=Q),L=FRi(M,B,T),C=C+L*(I-o+w-o+Q-o)/3;let R=LRi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:te.fromRadians(R.longitude,R.latitude,y+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:y,volume:C}};var cle=Vf;function Dct(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=Ae(A.color,new ht(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new Vi("invalid positions length!");this._duration=Ae(A.duration,4e3),this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,100),this._image=A.image,this._pps=null}function NRi(o,A){let f=$t.fromCartesian(o[0]),m=f.longitude,C=f.latitude,y=m,x=C,v=A;for(let E=1;E<o.length;E++){let I=$t.fromCartesian(o[E]);m>I.longitude?m=I.longitude:y<I.longitude&&(y=I.longitude),C>I.latitude?C=I.latitude:x<I.latitude&&(x=I.latitude)}return new te.fromRadians((m+y)/2,(C+x)/2,v)}function kRi(o){if(O(o._pps))return;let A=NRi(o._positions,o._minHeight),f=$t.fromCartesian(A),m=new ai(A.x,A.y,A.z,1),C=new $t(f.longitude,f.latitude,o.maxHeight+100),y=$t.toCartesian(C),x=new ai(y.x,y.y,y.z,1),v=new ai,E=new ai,I=new te,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new xa({fragmentShader:URi(Q),uniforms:{u_floodCenterEC:function(){return Xe.multiplyByVector(w._viewMatrix,m,v)},u_floodPlaneNormalEC:function(){let B=Xe.multiplyByVector(w._viewMatrix,m,v),T=Xe.multiplyByVector(w._viewMatrix,x,E);return I.x=T.x-B.x,I.y=T.y-B.y,I.z=T.z-B.z,te.normalize(I,I),I},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function ORi(o){O(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function URi(o){return`uniform sampler2D colorTexture;
            `})};kO.prototype.destroy=function(){this._tileset.customShader===this._customShader&&(this._customShader=void 0,this._tileset.customShader=void 0),this._scene.preUpdate.removeEventListener(this._preUpdate)};function eRi(){this.customShaders={},this.customShaders.lightLine=kO}var uct=eRi;function kH(o,A){this.options=Ae(A,{}),this.earthCtrl=o,this.viewer=o.coreMap,this.CSME=jie,this.Cust=new this.CSME.CustomShaderStage(this.options.primitive,A),this.stageArr=[],this.eventListener=null,this.eventListener=this.viewer.scene.preUpdate.addEventListener(()=>{this.Cust.update()}),this.create()}kH.prototype.create=function(o){let A=this,f=null;o?f=o:f=A.options,f.lineMaterialStage&&(A.LineMaterialStage=new A.CSME.LineMaterialStage(Ae(f.lineMaterialStage,{weight:.5})),A.Cust.addStage(A.LineMaterialStage),A.stageArr.push(A.LineMaterialStage)),f.gradientMaterialStage&&(A.GradientMaterialStage=new A.CSME.GradientMaterialStage(Ae(f.gradientMaterialStage,{weight:.5})),A.Cust.addStage(A.GradientMaterialStage),A.stageArr.push(A.GradientMaterialStage)),f.normalizeMaterialStage&&(A.NormalizeMaterialStage=new A.CSME.NormalizeMaterialStage(Ae(f.normalizeMaterialStage,{weight:.5})),A.Cust.addStage(A.NormalizeMaterialStage),A.stageArr.push(A.NormalizeMaterialStage)),f.dynamicColorMaterialStage&&(A.DynamicColorMaterialStage=new A.CSME.DynamicColorMaterialStage(Ae(f.dynamicColorMaterialStage,{weight:.5})),A.Cust.addStage(A.DynamicColorMaterialStage),A.stageArr.push(A.DynamicColorMaterialStage)),f.reflectMaterialStage&&(A.ReflectMaterialStage=new A.CSME.ReflectMaterialStage(Ae(f.reflectMaterialStage,{weight:.5})),A.Cust.addStage(A.ReflectMaterialStage),A.stageArr.push(A.ReflectMaterialStage)),f.textureMaterialStage&&(A.TextureMaterialStage=new A.CSME.TextureMaterialStage(Ae(f.textureMaterialStage,{weight:.5,url:`${globalThis.GEOWORLD_BASE_URL}Assets/Textures/window.png`})),A.Cust.addStage(A.TextureMaterialStage),A.stageArr.push(A.TextureMaterialStage))};kH.prototype.addStage=function(o){let A=this;A.Cust.addStage(o),A.stageArr.push(o)};kH.prototype.removeStage=function(o){this.Cust.removeStage(o.name)};kH.prototype.update=function(){let o=this;o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=o.viewer.scene.preUpdate.addEventListener(()=>{o.Cust.update()})};kH.prototype.removeFromMap=function(){let o=this;for(let A=0;A<o.stageArr.length;A++)o.removeStage(o.stageArr[A]);o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=null};var cct=kH;function nle(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._options.visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#101010")),this._options.outlineWidth=Ae(A.outlineWidth,1),this._options.thresholdAngle=Ae(A.thresholdAngle,12*Math.PI/180),this.add()}nle.prototype.add=function(){this._edgeStage=j6();let o=this._edgeStage;o.visibleEdgeColor=this._options.visibleEdgeColor,o.outlineWidth=this._options.outlineWidth,o.thresholdAngle=this._options.thresholdAngle,o.selected=[{},{}],o.enabled=!0,this._earthCtrl.Viewer.postProcessStages.add(o)};nle.prototype.removeFromMap=function(){this._edgeStage&&(this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage),this.__edgeStage=null)};Object.defineProperties(nle.prototype,{show:{get:function(){return this._edgeStage.show},set:function(o){this._edgeStage.show=o}},outlineWidth:{get:function(){return this._edgeStage.outlineWidth},set:function(o){this._edgeStage.outlineWidth=o}},thresholdAngle:{get:function(){return this._edgeStage.thresholdAngle},set:function(o){!o||(this._edgeStage.thresholdAngle=o)}},visibleEdgeColor:{get:function(){return this._edgeStage.visibleEdgeColor},set:function(o){!o||(this._edgeStage.visibleEdgeColor=o)}},hiddenEdgeColor:{get:function(){return this._edgeStage.hiddenEdgeColor},set:function(o){!o||(this._edgeStage.hiddenEdgeColor=o)}},showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Act=nle;function ole(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#ff0000")),this._hiddenEdgeColor=Ae(A.hiddenEdgeColor,ht.fromCssColorString("#4d4d4d")),this.handler=null,this.key=Ae(A.key,"id"),this.model=Ae(A.model,null),this.add()}ole.prototype.add=function(){let o=this,A="";this._edgeStage=j6(!0);let f=this._edgeStage;f.visibleEdgeColor=this._visibleEdgeColor,f.hiddenEdgeColor=this._hiddenEdgeColor,f.selected=[],f.enabled=!1,this._earthCtrl.Viewer.postProcessStages.add(f);function m(C,y){function x(E,I){let w=E.featuresLength;for(let Q=0;Q<w;++Q){let M=E.getFeature(Q);if(M.getProperty(o.key)===A){let T={pickId:M.pickId};y.selected=[T],y.enabled=!0}}}function v(E,I){let w=E.content,Q=w.innerContents;if(O(Q)){let M=Q.length;for(let B=0;B<M;++B)x(Q[B],I)}else x(w,I)}C.tileVisible.addEventListener(function(E){A!==""&&v(E,null)})}m(this.model,f),this.handler=new Vr(this._earthCtrl.coreMap.scene.canvas),this.handler.setInputAction(function(C){let y=o._earthCtrl.coreMap.scene.pick(C.position);if(f.selected=[],A="",!y||!y.primitive)return;let v=y.primitive._pickIds,I={pickId:y.pickId};f.selected=[I],f.enabled=!0,A=y.getProperty(o.key)},Ji.LEFT_CLICK)};ole.prototype.removeFromMap=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._edgeStage&&this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage)};Object.defineProperties(ole.prototype,{showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var hct=ole;function Hs(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Hx(){return((1+je.nextRandomNumber())*65536|0).toString(16).substring(1)}Hs.createUUID=function(){return`${Hx()+Hx()}-${Hx()}-${Hx()}-${Hx()}-${Hx()}${Hx()}${Hx()}`};Hs.createUUIDWithoutDash=function(){return Hx()+Hx()+Hx()+Hx()+Hx()+Hx()+Hx()+Hx()};Hs.prototype.createUUID=function(){return Hs.createUUID()};Hs.prototype.createGroup=function(o){let A=new LO;return A.id=o.id||Hs.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};Hs.prototype.createImageryLayer=function(o,A){let f=new zse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.IMAGERYPROVIDERS),f),f};Hs.prototype.createTerrainLayer=function(o,A){let f=new Yse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.TERRAINPROVIDERS),f),f};Hs.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new vP({})};Hs.prototype.createFeatureLayer=function(o,A){let f=new qse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.FEATURELAYERS),f),f};Hs.prototype.createModelLayer=function(o,A){let f=new Wse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.MODELLAYERS),f),f};Hs.prototype.createWfsModel=function(o,A){let f=new c6(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.MODELLAYERS),f),f};Hs.prototype.createModel=function(o,A){let f=new Ese(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.removeModel=function(o){O(o)&&o.removeFromMap()};Hs.prototype.createCZMLObject=function(o,A){let f=this,m=Ae(o.addToMap,!0),C=new fJ(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),C),C};Hs.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,O(o.name)&&(A.name=o.name),O(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};Hs.prototype.removeElement=function(o){O(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};Hs.prototype.createVideoProjection=function(o,A){o.addToMap=Ae(o.addToMap,!0);let f=Ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new sse(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),m)):f==="panorama"?(m=new Yut(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),m)):f==="fisheye"&&(m=new lse(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),m)),m};Hs.prototype.createTrack=function(o,A){let f=new Jut(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createSceneNode=function(o,A,f){let m=new LO(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};Hs.prototype.createFire=function(o,A){let f=new Ase(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createSmoke=function(o,A){let f=new dse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createExplosion=function(o,A){let f=new gse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createFireworks=function(o,A){let f=new mse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createRadarScan=function(o,A){let f=new Cse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createCircleScan=function(o,A){let f=new $ut(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createUpDownScan=function(o){let A=new tct(this._earthCtrl,o);return A.show=!0,A};Hs.prototype.createWaters=function(o,A){let f=new ele(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createHeatmap=function(o,A){let f=Wut.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createLabel=function(o,A){let f=new _se(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createBillboard=function(o,A){let f=new xse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPolyline=function(o,A){let f=new wse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPolygon=function(o,A){let f=new Qse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPoint=function(o,A){let f=new Dse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createBox=function(o,A){let f=new Mse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createEllipsoid=function(o,A){let f=new Fse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createCylinder=function(o,A){let f=new Rse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createRectangle=function(o,A){let f=new kse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createEllipse=function(o,A){let f=new Use(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPolylineVolume=function(o,A){let f=new Hse(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createEChartLayer=function(o,A){let f=new Zse(this._earthCtrl);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(rl.USERSCENE),f),f};Hs.prototype.createPointLight=function(o){return new rct(this._earthCtrl,o)};Hs.prototype.createHawkeye=function(o){let A=new tle(this._earthCtrl,o);A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&A.addToMap(o)};Hs.prototype.createSpotLight=function(o){let A=new rle(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderManager=function(o){let A=new uct;return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderStage=function(o){let A=new cct(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createModelOutline=function(o={}){let A=new Act(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.modelClick=function(o={}){let A=new hct(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};var w2=Hs;var ale=class extends l0{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new ase(A);let m=new LO(A);m.id=w2.createUUID(),m.name=Ae(f.ProjectName,"root"),m.version=Ae(f.version,null),m.desc=Ae(f.desc,null),m.createTime=Ae(f.createTime,new Date().toISOString()),m.lastUpdate=Ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new wN("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];O(f)&&this.removeChild(f)}removeChild(A){O(A)&&O(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){O(A)&&O(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);O(m)&&O(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let y=0;y<m.parentNode.childNodes.length;y++)m.parentNode.childNodes[y].id===m.id&&(C=y);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=je.clamp(f,0,A.length-1),m=je.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,y){let x={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},v=0,E=[];for(let I in x){let w=x[I],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let T=Q.childNodes[B].toJSON();M.push(T)}Promise.all(M).then(function(B){let T=[];if(B.length!==0){for(let L=0;L<B.length;L++)T.push(B[L]);let D=T[0].class;D!=="IMAGERY_LAYER"&&D!=="TERRAIN_LAYER"&&D!=="MODEL_LAYER"&&D!=="FEATURE_LAYER"&&(D="USER_SCENE");let F={item:D,objJson:T};E.push(F)}v++,v===5&&(C(E),v=0)})}}).then(function(C){let y={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(y.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(y.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(y.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(y.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(y.userScene=C[w].objJson);let x={class:"ENVIRONMENT",underGround:Ae(f._earthCtrl.camera.undergroundMode,null),shadow:Ae(f._earthCtrl.shadows,null),depthTest:Ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:Ae(f._earthCtrl.environment.rain.show,null),snow:Ae(f._earthCtrl.environment.snow.show,null),fog:Ae(f._earthCtrl.environment.fog.show,null),bwMode:Ae(f._earthCtrl.environment.bwMode.show,null),nightMode:Ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:Ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:Ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:Ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:Ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},v={class:"SKYBOX",positiveX:Ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:Ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:Ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:Ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:Ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:Ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},E={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};y.userScene.push(x),y.userScene.push(v),y.userScene.push(E);let I=JSON.stringify(y);A&&A(I)})}};Object.defineProperties(ale.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var sle=ale;function dct(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var wHi=new xs,bHi=new te,QHi=new te;dct.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="display:none; position: absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let y=document.createElement("div");y.style=f,o.appendChild(y);let x=A.scene.canvas,v=A.scene.globe.ellipsoid;new Vr(x).setInputAction(function(I){let w=A.camera.pickEllipsoid(I.endPosition,v);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=je.toDegrees(Q.latitude).toFixed(6),B=je.toDegrees(Q.longitude).toFixed(6),T=A.camera.positionCartographic.height.toFixed(1);y.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${T}\u7C73`}},Ji.MOUSE_MOVE)};var fct=dct;function uu(){}uu.parseBaseData=function(o,A){let f=[];if(O(A)&&O(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let y=A.imageryProviders[C];if(y.enable===!1||y.show===!1)continue;if(O(y.tilingScheme)){let v=y.tilingScheme;v.type==="GeographicTilingScheme"&&(y.tilingScheme=new kf(v))}let x=w2.createImageryLayer(y);f.push(x)}let m=[];if(O(A)&&O(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let y=A.terrainProviders[C];if(y.enable===!1||y.show===!1)continue;let x=w2.createTerrainLayer(y);m.push(x)}return{imageryProvider:f,terrainProvider:m}};uu.parse=function(o,A){if(!O(A))return;let f=[rl.IMAGERYPROVIDERS,rl.TERRAINPROVIDERS,rl.MODELLAYERS,rl.FEATURELAYERS,rl.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(w2.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}O(A[rl.IMAGERYPROVIDERS])&&OH(o,A[rl.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),O(A[rl.TERRAINPROVIDERS])&&OH(o,A[rl.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),O(A[rl.MODELLAYERS])&&OH(o,A[rl.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),O(A[rl.FEATURELAYERS])&&OH(o,A[rl.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),O(A[rl.USERSCENE])&&OH(o,A[rl.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function OH(o,A,f,m){for(let C=0;C<A.length;C++){let y=A[C],x=null;if(y.enable===!1)continue;O(y.class)?(y.class==="IMAGERY"&&(y.class=Eo.IMAGERY_LAYER),y.class==="TERRAIN"&&(y.class=Eo.TERRAIN_LAYER),x=y.class):(m===0?y.class=Eo.IMAGERY_LAYER:m===1&&(y.class=Eo.TERRAIN_LAYER),x=y.class);let v=uu.parserMap[x];v!==void 0&&v(o,y,f)}}function tRi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=Ae(A.show,!0),o.userScene.addChild(f,m),O(A.childNodes)&&OH(o,A.childNodes,m)}function iRi(o,A,f){let m=A;if(O(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new kf(C))}o.factory.createImageryLayer(m,f)}function rRi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function nRi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function oRi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function aRi(o,A,f){o.coreMap.scene.skyBox=new xN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function sRi(o,A,f){o.camera.undergroundMode=Ae(A.underGround,!1),o.shadows=Ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=Ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function lRi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function uRi(o,A,f){o.factory.createModel(A,f)}function cRi(o,A,f){o.factory.createWaters(A,f)}function ARi(o,A,f){o.factory.createExplosion(A,f)}function hRi(o,A,f){o.factory.createFireworks(A,f)}function dRi(o,A,f){o.factory.createSmoke(A,f)}function fRi(o,A,f){o.factory.createFire(A,f)}function gRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function pRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function mRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function CRi(o,A,f){A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function yRi(o,A,f){o.factory.createBillboard(A,f)}function xRi(o,A,f){A.positions&&(A.positions=uu.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new ht(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function vRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=uu.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function ERi(o,A,f){A.coordinates&&(A.coordinates=Si.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function IRi(o,A,f){o.factory.createEllipse(A,f)}function _Ri(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new te(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function BRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new te(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function wRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function bRi(o,A,f){o.factory.createPolylineVolume(A,f)}function QRi(o,A,f){o.factory.createVideoProjection(A,f)}function SRi(o,A,f){o.factory.createVideoProjection(A,f)}function DRi(o,A,f){o.factory.createTrack(A,f)}function TRi(o,A,f){o.factory.createHeatmap(A,f)}function MRi(o,A,f){o.factory.createEChartLayer(A,f)}function PRi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}uu.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=te.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};uu.parserMap={};uu.parserMap[Eo.NODE]=tRi;uu.parserMap[Eo.IMAGERY_LAYER]=iRi;uu.parserMap[Eo.TERRAIN_LAYER]=rRi;uu.parserMap[Eo.MODEL_LAYER]=nRi;uu.parserMap[Eo.FEATURE_LAYER]=oRi;uu.parserMap[Eo.SKYBOX]=aRi;uu.parserMap[Eo.ENVIRONMENT]=sRi;uu.parserMap[Eo.VIEWPOINT]=lRi;uu.parserMap[Eo.MODEL]=uRi;uu.parserMap[Eo.WATERS]=cRi;uu.parserMap[Eo.EXPLOSION]=ARi;uu.parserMap[Eo.FIREWORK]=hRi;uu.parserMap[Eo.SMOKE]=dRi;uu.parserMap[Eo.FIRE]=fRi;uu.parserMap[Eo.RADARSCAN]=gRi;uu.parserMap[Eo.CIRCLESCAN]=pRi;uu.parserMap[Eo.POINT]=mRi;uu.parserMap[Eo.LABEL]=CRi;uu.parserMap[Eo.BILLBOARD]=yRi;uu.parserMap[Eo.POLYLINE]=xRi;uu.parserMap[Eo.POLYGON]=vRi;uu.parserMap[Eo.RECTANGLE]=ERi;uu.parserMap[Eo.ELLIPSE]=IRi;uu.parserMap[Eo.BOX]=_Ri;uu.parserMap[Eo.ELLIPSOID]=BRi;uu.parserMap[Eo.CYLINDER]=wRi;uu.parserMap[Eo.POLYLINEVOLUME]=bRi;uu.parserMap[Eo.PERSPECTIVE_VIDEO_PROJECTION]=QRi;uu.parserMap[Eo.FISHEYE_VIDEO_PROJECTION]=SRi;uu.parserMap[Eo.TRACK]=DRi;uu.parserMap[Eo.HEATMAP]=TRi;uu.parserMap[Eo.ECHARTLAYER]=MRi;uu.parserMap.ELEMENT=PRi;var gct=uu;var ITe=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,O(this.editBillboard)&&O(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(O(A)&&O(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:O(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},pct=ITe;var _Te=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,O(this.editPoint)&&O(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(O(A)&&O(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:O(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},mct=_Te;var BTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,O(this.editBox)&&O(this.editBox.entity.box)){let y=this.editBox.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te;this.getNorthPointByDistance(v,E),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:v,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:E,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),O(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let y=Vn.eastNorthUpToFixedFrame(C),x=new te,v=this.editBox.entity.box.dimensions._value;v||(v=this.editBox.entity.box.dimensions.getValue(m)),te.divideByScalar(v,2,x),te.clone(x,A),te.clone(x,f),A.y*=-1,Xe.multiplyByPoint(y,A,A),f.y*=-1,f.z*=-1,Xe.multiplyByPoint(y,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=gi.fromDate(f);if(O(this.currentPoint)||O(this.pickEditHeightPoint)||O(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,y=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!y)return;let x=$t.fromCartesian(y),v=te.fromRadians(x.longitude,x.latitude,x.height+this.height);if(O(this.currentPoint))this.currentPoint.position=v,this.editBox.entity.position=new bn(function(){return v},!1);else if(O(this.dragPosition)){if(O(this.pickEditWHPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=te.normalize(w,new te);te.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=te.clone(M);B.x-=w.x,B.y+=w.y,te.abs(B,B),this.editBox.entity.box.dimensions=new bn(function(){return B},!1)}else if(O(this.pickEditHeightPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=te.clone(Q);M.z+=w.z,te.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=y;let E=new te,I=new te;this.getNorthPointByDistance(E,I,m),this.editHeightPoint.position=E,this.editWHPoint.position=I}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(O(A)&&O(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:O(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Cct=BTe;var wTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,O(this.editCylinder)&&O(this.editCylinder.entity.cylinder)){let y=this.editCylinder.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value,I=new te,w=new te,Q=new te;this.getNorthPointByDistance(I,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),v>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:I,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),E>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,y=Vn.eastNorthUpToFixedFrame(C),x=this.editCylinder.entity.cylinder.length._value,v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value;v>0&&(A.z+=x/2,A.x+=v,Xe.multiplyByPoint(y,A,A)),E>0&&(f.x+=E,f.z-=x/2,Xe.multiplyByPoint(y,f,f)),m.z+=x/2,Xe.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.heightPoint)||O(this.topRadiusPoint)||O(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editCylinder.entity.position=y;else if(O(this.dragPosition)){if(O(this.pickHeightPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(O(this.pickTopRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(O(this.pickBottomRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let x=this.editCylinder.entity.cylinder.topRadius._value,v=this.editCylinder.entity.cylinder.bottomRadius._value,E=new te,I=new te,w=new te;this.getNorthPointByDistance(E,I,w),x>0&&(this.topRadiusPoint.position=E),v>0&&(this.bottomRadiusPoint.position=I),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(O(A)&&O(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:O(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},yct=wTe;var bTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,O(this.editEllipse)&&O(this.editEllipse.entity.ellipse)){let y=je.PI_OVER_TWO,x=this.updatePoint(y);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:x,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new te,m=new te,C=new te,y=this.editEllipse.entity.ellipse;this.semiMinorAxis=y.semiMinorAxis._value,this.semiMajorAxis=y.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let x=Ae(y.rotation,0);this.center=this.editEllipse.entity.position._value;let v=this.semiMinorAxis*this.semiMinorAxis,E=this.semiMajorAxis*this.semiMajorAxis,I=this.semiMajorAxis*this.semiMinorAxis,w=te.magnitude(this.center),Q=te.normalize(this.center,f),M=te.cross(te.UNIT_Z,this.center,m);M=te.normalize(M,M);let B=te.cross(Q,M,C),T=new te;return nB.pointOnEllipsoid(A,x,B,M,v,I,E,w,Q,T)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickSemiMajorAxisPoint)||O(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(O(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(O(this.pickSemiMajorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let y=C*this.semiMinorAxis/this.semiMajorAxis;y>C&&(y=C),this.editEllipse.entity.ellipse.semiMinorAxis=y}else if(O(this.pickSemiMinorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(je.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(O(A)&&O(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:O(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},xct=bTe;var QTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,O(this.editEllipsoid)&&O(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let y=this.editEllipsoid.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te,I=new te;this.getNorthPointByDistance(v,E,I),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:E,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:I,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,y=Vn.eastNorthUpToFixedFrame(C),x=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=x.x,Xe.multiplyByPoint(y,A,A),f.y=-x.y,Xe.multiplyByPoint(y,f,f),m.z=x.z,Xe.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickRadiiXPoint)||O(this.pickRadiiYPoint)||O(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editEllipsoid.entity.position=y;else{if(O(this.dragPosition)){let I=te.subtract(m,this.dragPosition,new te),w=te.normalize(I,new te);te.dot(I,w,I);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=te.clone(Q);O(this.pickRadiiXPoint)?M.x-=I.x:O(this.pickRadiiYPoint)?M.y+=I.y:O(this.pickRadiiZPoint)&&(M.z+=I.z,this.editEllipsoid.entity.position=this.addHeight(I.z)),te.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let x=new te,v=new te,E=new te;this.getNorthPointByDistance(x,v,E),this.radiiXPoint.position=x,this.radiiYPoint.position=v,this.radiiZPoint.position=E}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(O(A)&&O(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:O(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},vct=QTe;var STe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,O(this.editPolygon)&&O(this.editPolygon.entity.polygon))for(let y=0;y<this.editPolygon.entity.polygon.hierarchy._value.positions.length;y++){let x=this.editPolygon.entity.polygon.hierarchy._value.positions[y],v=this.mEarthCtrl.entities.add({name:"polygon_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(O(A)&&O(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ect=STe;var DTe=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=ht.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,O(this.editModel)&&O(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=$t.clone(C);y.longitude=je.toDegrees(y.longitude),y.latitude=je.toDegrees(y.latitude),this.editModel.lon=y.longitude,this.editModel.lat=y.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(O(A)&&O(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(O(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Ict=DTe;var TTe=class extends ja{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,O(this.editLabel)&&O(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(O(A)&&O(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:O(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},_ct=TTe;var MTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,O(this.editPolyline)&&O(this.editPolyline.polyline))for(let y=0;y<this.editPolyline.polyline.positions._value.length;y++){let x=this.editPolyline.polyline.positions._value[y],v=this.mEarthCtrl.entities.add({name:"polyline_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(O(A)&&O(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Bct=MTe;var PTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,O(this.editPolylineVolume)&&O(this.editPolylineVolume.entity.polylineVolume))for(let y=0;y<this.editPolylineVolume.entity.polylineVolume.positions._value.length;y++){let x=this.editPolylineVolume.entity.polylineVolume.positions._value[y],v=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:x,point:{color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(O(A)&&O(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:O(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},wct=PTe;var RTe=class extends ja{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,O(this.editRectangle)&&O(this.editRectangle.entity.rectangle)){let y=this.editRectangle.entity.rectangle.coordinates._value,x=this.editRectangle.entity.rectangle.height._value,v=Si.northwest(y),E=te.fromRadians(v.longitude,v.latitude,x),I=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:E,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(I.id),v=Si.southeast(y);let w=te.fromRadians(v.longitude,v.latitude,x),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.leftTopPoint)||O(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=this.editRectangle.entity.rectangle.coordinates._value;O(this.leftTopPoint)?(this.leftTopPoint.position=m,y.west=C.longitude,y.north=C.latitude):O(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,y.south=C.latitude,y.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=y}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(O(A)&&O(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:O(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},bct=RTe;function bd(o){this._earthCtrl=o,this._coreMap=o.coreMap}bd.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new mct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};bd.prototype.updatePoint=function(o,A){o.updatePoint(A)};bd.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new Bct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};bd.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};bd.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ect(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};bd.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};bd.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new Cct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};bd.prototype.updateBox=function(o,A){o.updateBox(A)};bd.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new vct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};bd.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};bd.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new yct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};bd.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};bd.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ict(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};bd.prototype.updateModel=function(o,A){o.updateModel(A)};bd.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new pct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};bd.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};bd.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new _ct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};bd.prototype.updateLabel=function(o,A){o.updateLabel(A)};bd.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new bct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};bd.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};bd.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new xct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};bd.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};bd.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new wct(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};bd.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};bd.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var lle=bd;function xy(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}xy.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],y="",x=[],v,E=this.scene.globe.ellipsoid,I={spot:[],distance:[],label:[],polyline:[]},w={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(w.point=A.point),O(A.polyline)&&(w.polyline=A.polyline));let Q=new iI;this.scene.primitives.add(Q);let M=new NA,B=new Vr(f.scene.canvas),T=document.createElement("div");rA(".map-widget",T),rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let F=document.getElementById("toolTip");F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let L;m=!0;let R=function(V){let H=0,q=`${0}\u7C73`,ie,Z,oe,ne,se,ce;for(let j=0;j<V.length-1;j+=1)ie=E.cartesianToCartographic(V[j]),Z=M.project(ie),oe=Z.x,ne=Z.y,ie=E.cartesianToCartographic(V[j+1]),Z=M.project(ie),se=Z.x,ce=Z.y,H=H+Math.sqrt((oe-se)*(oe-se)+(ne-ce)*(ne-ce));return H>0&&(q=`${H.toFixed(2)}\u7C73`),H/1e3>=1&&(q=`${(H/1e3).toFixed(2)}\u5343\u7C73`),q},k=function(){function V(H){if(!O(H))throw new Vi("positions is required!");if(H.length<2)throw new Vi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let q=as.fromType(as.ColorType);q.uniforms.color=new ht(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=H,this._init()}return V.prototype._init=function(){let H=this,q=function(){return H.path};this.options.polyline.positions=new bn(q,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,I.polyline.push(this.lineEntity)},V}();B.setInputAction(function(V){let H,q;F.style.left=`${V.endPosition.x+10}px`,F.style.top=`${V.endPosition.y+20}px`,F.style.display="block",F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=!1,Z=f.camera.getPickRay(V.endPosition);Z&&(H=f.scene.globe.pick(Z,f.scene));let oe=f.scene.pick(V.endPosition);if(oe){console.log("feature",oe);let ne=f.scene.pickPosition(V.endPosition);ne&&(H=ne),ie=!0}if(!!H&&(q=Pi.WGS84.cartesianToCartographic(H),q)){let ne;ie?ne=f.scene.sampleHeight(q):ne=f.scene.globe.getHeight(q);let se=te.fromDegrees(q.longitude/Math.PI*180,q.latitude/Math.PI*180,ne);if(m){if(C.length<1)return;O(v)?(v.path.pop(),v.path.push(se)):(C.push(se),v=new k(C));let ce=R(v.path);f.entities.remove(L),L=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v.path[v.path.length-1],label:{text:`\u603B\u957F\uFF1A${ce}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},Ji.MOUSE_MOVE);let U=function(V){x.push(V);let H=[];if(x.length>1){let q=x[x.length-2],ie=x[x.length-1],Z=Math.abs(q.longitude-ie.longitude)*1e7,oe=Math.abs(q.latitude-ie.latitude)*1e7;Z>oe&&(oe=Z);let ne=parseInt(oe/10);ne>1e3&&(ne=1e3),ne<2&&(ne=2);for(let se=0;se<ne;++se)H.push(new $t(je.lerp(q.longitude,ie.longitude,se/(ne-1)),je.lerp(q.latitude,ie.latitude,se/(ne-1))));H.push(ie.clone())}else H=x;if(H.length>0)for(let q=0;q<H.length;q++){V=H[q];let ie=f.scene.globe.getHeight(V),Z=te.fromDegrees(V.longitude/Math.PI*180,V.latitude/Math.PI*180,ie);C.push(Z)}};return B.setInputAction(function(V){let H,q,ie=!1,Z=f.camera.getPickRay(V.position);if(Z&&(H=f.scene.globe.pick(Z,f.scene)),f.scene.pick(V.position)){let ne=f.scene.pickPosition(V.position);ne&&(H=ne),ie=!0}if(H&&(q=Pi.WGS84.cartesianToCartographic(H)),q){let ne;ie?ne=f.scene.sampleHeight(q):ne=f.scene.globe.getHeight(q);let se=te.fromDegrees(q.longitude/Math.PI*180,q.latitude/Math.PI*180,ne);if(m){v&&v.path.pop(),U(q);let ce="0\u7C73";v&&(ce=R(v.path)),y=ce,I.spot.push(se),I.distance.push(ce);let j=f.entities.add({position:se,point:{pixelSize:5,color:w.point,outlineColor:ht.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ce,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});I.label.push(j),f._points.push(j)}}},Ji.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(L),f._points[f._points.length-1].label.text=y,B.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(I),F.style.display="none"},Ji.RIGHT_CLICK),this};xy.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new Vr(f.scene.canvas),C=[],y=null,x="0\u7C73",v=null,E,I="",w,Q=document.createElement("div");rA(".map-widget",Q),rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T={name:"",spot:[],distance:[],label:[],ployline:[]},D={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(D.point=A.point),O(A.polyline)&&(D.polyline=A.polyline));let F=function(){function L(R){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:D.polyline,width:3,clampToGround:!1}},this.positions=R,this._init()}return L.prototype._init=function(){let R=this,k=function(){return R.positions};this.options.polyline.positions=new bn(k,!1);let U=f.entities.add(this.options);f.item=U,T.ployline.push(U);let V=f.getuid();T.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${V}`},L}();return m.setInputAction(function(L){if(f.scene.bim){let R=f.scene.bim.PickWorldPositionSync(L.endPosition.x,L.endPosition.y);R[0]===0?v=f.scene.pickPosition(L.endPosition):v=new te(R[0],R[1],R[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.endPosition);!v||(B.style.left=`${L.endPosition.x+10}px`,B.style.top=`${L.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(O(y)?(C.pop(),C.push(v)):y=new F(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',x=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${x}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},Ji.MOUSE_MOVE),m.setInputAction(function(L){if(f.scene.bim){let k=f.scene.bim.PickWorldPositionSync(L.position.x,L.position.y);k[0]===0?v=f.scene.pickPosition(L.position):v=new te(k[0],k[1],k[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.position);if(!v)return;C.length===0&&C.push(v.clone()),C.push(v);let R=x;I=`\u603B\u957F\uFF1A${x}`,E=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:D.point,outlineColor:ht.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:R,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-20),heightReference:yn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(E),T.spot.push(v),T.distance.push(x),T.label.push(E)},Ji.LEFT_CLICK),m.setInputAction(function(L){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=I),m.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(T)},Ji.RIGHT_CLICK),this};xy.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=$t.fromCartesian(o[m]),y=$t.fromCartesian(o[m+1]),x=new V0;x.setEndPoints(C,y);let v=x.surfaceDistance;v=Math.sqrt(Math.pow(v,2)+Math.pow(y.height-C.height,2)),A=A+v}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};xy.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new Vr(f.scene._imageryLayerCollection),y=document.getElementById("toolTip");y||(rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),y=document.getElementById("toolTip")),y.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let x=[],v={},E=[],I=[],w=null,Q=null,M,B={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(B.point=A.point),O(A.polyline)&&(B.polyline=A.polyline),O(A.polygon)&&(B.polygon=A.polygon));let T={mj:0,label:[],polygon:[]};y.style.display="block";let D=function(){function F(L){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=L,this._init()}return F.prototype._init=function(){let L=this,R=function(){return L.hierarchy};this.options.polygon.hierarchy=new bn(R,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,T.polygon=this.polygon},F}();return C.setInputAction(function(F){if(y.style.left=`${F.endPosition.x+10}px`,y.style.top=`${F.endPosition.y+20}px`,f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.endPosition.x,F.endPosition.y);V[0]===0?Q=f.scene.pickPosition(F.endPosition):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.endPosition);if(!Q)return;let L=$t.fromCartesian(Q),R=je.toDegrees(L.longitude),k=je.toDegrees(L.latitude),U=L.height;if(x.length>=2){O(w)?(x.pop(),x.push(Q),v=new Un(x),I.pop(),I.push({lon:R,lat:k,hei:U})):(v=new Un(x),w=new D(v));let V=f.getArea(I,x);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:V,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),T.label=M}},Ji.MOUSE_MOVE),C.setInputAction(function(F){if(f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.position.x,F.position.y);V[0]===0?Q=f.scene.pickPosition(F.position):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.position);if(!Q)return;let L=$t.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",L);let R=je.toDegrees(L.longitude),k=je.toDegrees(L.latitude),U=L.height;x.length===0&&(x.push(Q.clone()),v=new Un(x),I.push({lon:R,lat:k,hei:U}),x.push(Q.clone()),v=new Un(x),I.push({lon:R,lat:k,hei:U})),x.push(Q),v=new Un(x),E.push({lon:R,lat:k,hei:U}),I.push({lon:R,lat:k,hei:U})},Ji.LEFT_CLICK),C.setInputAction(function(F){y.style.display="none",f.entities.remove(M),C.destroy();let L=f.getArea(I,x);m=L;let R=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:L,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(R),f._lable=R,T.mj=m,T.label=R,O(o)&&typeof o=="function"&&o(T)},Ji.RIGHT_CLICK),this};xy.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,y=[],x={},v,E=f.scene,I=E.globe.ellipsoid,w=new iI;E.primitives.add(w);let Q,M,B=0,T={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(T.point=A.point),O(A.polyline)&&(T.polyline=A.polyline),O(A.polygon)&&(T.polygon=A.polygon));let D=document.createElement("div");rA(".map-widget",D),rA(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let L=document.getElementById("toolTip");L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R=new Vr(E.canvas),k=function(){function V(H){if(!O(H))throw new Vi("positions is required!");if(H.length<3)throw new Vi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:T.polygon,clampToGround:!1}},this.path=H,this._init()}return V.prototype._init=function(){let H=this,q=function(){return H.path};this.options.polygon.hierarchy=new bn(q,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},V}();R.setInputAction(function(V){let H=0;f.entities.remove(M);let q,ie,Z=f.scene.camera.getPickRay(V.endPosition);Z&&(q=f.scene.globe.pick(Z,f.scene));let oe=f.scene.pick(V.endPosition),ne=!1;if(oe){let ce=f.scene.pickPosition(V.endPosition);ce&&(q=ce),ne=!0}if(!q)return;let se=function(ce){let j=new Array(ce.length),he=function(_e){return _e.longitude=_e.longitude/Math.PI*180,_e.latitude=_e.latitude/Math.PI*180,_e},me=function(_e){let be=0;for(let Be=0;Be<_e.length;Be++){let ve=_e[Be],z;Be<_e.length-1?z=_e[Be+1]:z=_e[0],be+=ve.x*z.y-z.x*ve.y}return be/2};for(let _e=0;_e<ce.length;_e++)j[_e]=he(I.cartesianToCartographic(ce[_e]));let Ee=0;for(let _e=0;_e<j.length;_e++)Ee+=j[_e].longitude;Ee=Ee/j.length;for(let _e=0;_e<j.length;_e++)j[_e]=f.Gauss_to_XY(j[_e].longitude,j[_e].latitude,Ee);return Math.abs(me(j))};if(ie=Pi.WGS84.cartesianToCartographic(q),ie&&C){if(L.style.left=`${V.endPosition.x+10}px`,L.style.top=`${V.endPosition.y+20}px`,L.style.display="block",y.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:q,label:{text:`${H}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(O(v)?(v.path.positions.pop(),v.path.positions.push(q)):(y.push(q),x=new Un(y),v=new k(x)),y.length>=2){L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ce=String(se(v.path.positions));ce=ce.substr(0,ce.indexOf(".",0)),ce.length<6?H=`${ce}\u5E73\u65B9\u7C73`:(ce=String(ce/1e6),ce=ce.substr(0,ce.indexOf(".",0)+3),H=`${ce}\u5E73\u65B9\u5343\u7C73`),m.mj=H,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:q,label:{text:H,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:fA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:_n.BOTTOM,pixelOffset:new wt(20,-40),heightReference:yn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},Ji.MOUSE_MOVE),R.setInputAction(function(V){let H;B=1;let q=f.scene.camera.getPickRay(V.position);q&&(H=f.scene.globe.pick(q,f.scene));let ie=f.scene.pick(V.position),Z=!1;if(ie){let oe=f.scene.pickPosition(V.position);oe&&(H=oe),Z=!0}H&&C&&(y.push(H),x=new Un(y))},Ji.LEFT_CLICK),R.setInputAction(function(){R.removeInputAction(Ji.LEFT_CLICK),R.removeInputAction(Ji.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:y[y.length-1],pixelOffset:new wt(0,20),eyeOffset:new te(0,0,0),horizontalOrigin:eA.CENTER,verticalOrigin:_n.CENTER,scale:1,color:new ht(1,1,1,1)}),L.style.display="none",R.destroy(),O(o)&&typeof o=="function"&&o(m)},Ji.RIGHT_CLICK);let U=function(V){let H=0,q=0,ie=0;for(let oe=0;oe<V.length;oe++)H+=V[oe].x,q+=V[oe].y,ie+=V[oe].z;return new te(H/V.length,q/V.length,ie/V.length)};return this};xy.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};xy.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,y,x,v,E;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,y=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,x=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,v=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,E=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-y/2*Math.sin(2*o)+x/4*Math.sin(4*o)-v/6*Math.sin(6*o)+E/8*Math.sin(8*o))};xy.prototype.to_Radian=function(o){return o*Math.PI/180};xy.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,y=Math.sqrt(6378137*6378137-C*C)/C,x=0,v=0,E=0,I=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);I=this.to_N(A),E=I*Math.cos(A),x=Math.tan(A),v=y*M;let B=Math.pow(x,2),T=Math.pow(x,4),D=Math.pow(v,2),F=Math.pow(v,4),L=Math.pow(M,3),R=Math.pow(M,5),k=this.to_Sm(A)+Math.pow(Q,2)/2*E*M*x+Math.pow(Q,4)/24*x*E*L*(5-B+9*D+4*F)+Math.pow(Q,6)/720*x*E*R*(61-58*x*x+T+270*D-330*x*x*D),U=Q*I*M+Math.pow(Q,3)/6*I*L*(1-x*x+v*v)+Math.pow(Q,5)/120*I*R*(5-18*x*x+T+14*D-58*D*B);return new wt(U,k)};xy.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,y=(m+2)%o.length,x=this.Angle(o[m],o[C],o[y]),v=this.getdistance(A[m],A[C]),E=this.getdistance(A[C],A[y]);f+=v*E*Math.abs(Math.sin(x))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};xy.prototype.getdistance=function(o,A){let f=$t.fromCartesian(o),m=$t.fromCartesian(A),C=new V0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};xy.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,y=o.lon*f,x=A.lat*f,v=A.lon*f,E=-Math.atan2(Math.sin(y-v)*Math.cos(x),Math.cos(C)*Math.sin(x)-Math.sin(C)*Math.cos(x)*Math.cos(y-v));return E<0&&(E+=Math.PI*2),E=E*m,E};xy.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),y=m-C;return y<0&&(y+=360),y};xy.prototype.getuid=function(){return this.uuid(8,16)};xy.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|je.nextRandomNumber()*A];else{let y;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(y=0|je.nextRandomNumber()*16,m[C]=f[C===19?y&3|8:y])}return m.join("")};xy.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var SW=xy;function dw(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=Ae(A.show,!0),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._heading=Ae(A.heading,0),this._pitch=Ae(A.pitch,0),this._distance=Ae(A.distance,300),this._position=te.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=Ae(A.horizontalViewAngle,90),this._verticalViewAngle=Ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=Ae(A.visibleAreaColor,ht.GREEN.withAlpha(.4)),this._invisibleAreaColor=Ae(A.invisibleAreaColor,ht.RED.withAlpha(.4)),this._size=Ae(A.size,10240),this._softShadows=Ae(A.softShadows,!0),this._colorStyle=Ae(A.colorStyle,ht.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(dw.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});dw.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};dw.prototype.removeFromMap=function(){let o=this;O(o.viewShedMap)&&(o.viewShedMap.enabled=!1),O(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};dw.prototype.visualConeShow=function(o){let A=this;O(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};dw.prototype.addVisualPyramid=function(){let o=this,A=new i6({radii:new bn(function(){return new te(o._distance,o._distance,o._distance)},!1),minimumClock:new bn(function(){return je.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new bn(function(){return je.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new bn(function(){return je.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new bn(function(){return je.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new bn(function(){return o._colorStyle},!1)}),f=new kA({position:new bn(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};dw.prototype.createLightCamera=function(){O(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ml(this._coreMap.scene),this._lightCamera.position=this._position};dw.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!O(o)&&(O(o.lon)||O(o.lat)||O(o.height)||O(o.heading)||O(o.pitch)||O(o.roll)||O(o.far)||O(o.distance)||O(o.verticalViewAngle)||O(o.horizontalViewAngle))){let m=this._parameter;for(let v in o)o.hasOwnProperty(v)&&O(m[v])&&(m[v]=o[v]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=te.fromDegrees(m.lon,m.lat,m.height);let C=je.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let y=je.toRadians(A._horizontalViewAngle),x=je.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(y/2)/Math.tan(x/2),y>x?f.frustum.fov=y:f.frustum.fov=x}};dw.prototype.createShadowMap=function(){if(O(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new P6({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Vx=new te;dw.prototype.drawViewCentrum=function(){let o=this;function A(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=new cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let f=this._earthCtrl.entities.add({polyline:{positions:new bn(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=new cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let C=this._earthCtrl.entities.add({polyline:{positions:new bn(m,!1),material:this._colorStyle}});this._lineArray.push(C);function y(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=new cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let x=this._earthCtrl.entities.add({polyline:{positions:new bn(y,!1),material:this._colorStyle}});this._lineArray.push(x);function v(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Vx.x=Q.x*T*L,Vx.y=Q.y*T*F,Vx.z=Q.z*D;let R=cQ.changeCartesian3ByScalar(o._position,Vx);return[o._position,R]}let E=this._earthCtrl.entities.add({polyline:{positions:new bn(v,!1),material:this._colorStyle}});this._lineArray.push(E)};dw.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};dw.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=je.toRadians(this._horizontalViewAngle),A=je.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:je.toRadians(this._heading),pitch:je.toRadians(this._pitch),roll:0}})};var ule=dw;var LTe=Pi.WGS84;function Vf(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=RRi(this.coreMap.container)}function FTe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?FTe(o[f],null):A[f];return A}function Qct(o,A){let f=FTe(o),m;for(m in A)f[m]===void 0&&(f[m]=FTe(A[m]));return f}function RRi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let y=document.createElement("DIV");y.className="twipsy-inner",m.appendChild(y),this._div=m,this._title=y,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Vf.prototype.addToolbar=function(o,A){return A=Qct(A,{container:o}),new Vf.Toolbar(this,A)};var Sct={shiftX:0,shiftY:0};Vf.prototype.createBillboardGroup=function(o,A,f){let m=new Vf.BillboardGroup(this,A);return m.addBillboards(o,f),m};Vf.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=Qct(A,Sct);let f=new iI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Vf.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new wt(this._options.shiftX,this._options.shiftY),eyeOffset:new te(0,0,-1e3),horizontalOrigin:eA.CENTER,verticalOrigin:_n.CENTER,scale:.3,image:Ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new ht(1,1,1,1)});if(A){let y=function(v){C.enableRotate=v},x=function(){let v=0;for(let E=m._orderedBillboards.length;v<E&&m._orderedBillboards[v]!==f;++v);return v},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let v=this,E=new Vr(v._scene.canvas);setListener(f,"leftDown",function(I){function w(M){f.position=M;for(let B=0,T=v._orderedBillboards.length;B<T&&v._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(x(),M)}function Q(M){E.destroy(),y(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(x(),M)}E.setInputAction(function(M){let B=v._scene.camera.pickEllipsoid(M.endPosition,LTe);B?w(B):Q(B)},Ji.MOUSE_MOVE),E.setInputAction(function(M){Q(v._scene.camera.pickEllipsoid(M.position,LTe))},Ji.LEFT_UP),y(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(x(),v._scene.camera.pickEllipsoid(I,LTe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(v){A.onDoubleClick(x())}),A.onClick&&setListener(f,"leftClick",function(v){A.onClick(x())}),A.tooltip&&(setListener(f,"mouseMove",function(v){m._drawHelper._tooltip.showAt(v,A.tooltip())}),setListener(f,"mouseOut",function(v){m._drawHelper._tooltip.setVisible(!1)}))}return f};Vf.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Vf.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Vf.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Vf.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Vf.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Vf.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Vf.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Vf.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Vf.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Vf.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Vf.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,y=[],x=[],v;this._positions=x;let E=new Vr(f.canvas);this._mouseHandler=E;let I=new Vf.BillboardGroup(this,Sct);this._markers=I,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),E.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),T=$t.fromCartesian(B),D=je.toDegrees(T.longitude),F=je.toDegrees(T.latitude);if(B){if(y.length===0&&(y.push(D,F),x.push(B),v=B,I.addBillboard(v)),x.length>=4){let L=cl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(L!==void 0){let R=L.x-Q.position.x,k=L.y-Q.position.y;if(R*R+k*k<16){y.splice(y.length-2,2),x.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}y.push(D,F),x.push(B),I.addBillboard(B),x.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:te.fromDegreesArray(y),material:ht.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),Ji.LEFT_CLICK),E.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(x.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),T=f.globe.pick(B,f),D=$t.fromCartesian(T),F=je.toDegrees(D.longitude),L=je.toDegrees(D.latitude);if(T&&(y.splice(y.length-2,2),x.pop(),y.push(F,L),x.push(T),I.getBillboard(x.length-1).position=T,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4)){let R=cl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(R!==void 0){let k=R.x-M.x,U=R.y-M.y;k*k+U*U<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),Ji.MOUSE_MOVE),E.setInputAction(function(Q){x.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),Ji.LEFT_DOUBLE_CLICK);function w(){return te.fromDegreesArray(y)}};Vf.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:ht.RED.withAlpha(.5),outline:!0,outlineColor:ht.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Vf.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Vf.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Vf.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function LRi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=$t.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,y=0,x=0,v=0,E=0,I=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(y=A[0],x=f[0]):(y=A[Q+1],x=f[Q+1]),E=m*x-y*C,v+=E,I+=(m+y)*E,w+=(C+x)*E;return v*=.5,I/=6*v,w/=6*v,new $t(I,w)}function FRi(o,A,f){let m=te.distance(o,A),C=te.distance(A,f),y=te.distance(f,o),x=(m+C+y)/2;return Math.sqrt(x*(x-m)*(x-C)*(x-y))}Vf.prototype.computeCutVolume=function(){let o=15e3;for(let k=0;k<this._positions.length;k++){let U=$t.fromCartesian(this._positions[k]),V=this._scene.globe.getHeight(U);o>V&&(o=V)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new Yh.fromPositions({positions:this._positions,vertexFormat:Va.FLAT_VERTEX_FORMAT,granularity:A}),m=new Yh.createGeometry(f),C=0,y=0,x,v,E,I,w,Q,M,B,T,D,F,L;for(let k=0;k<m.indices.length;k+=3)x=m.indices[k],v=m.indices[k+1],E=m.indices[k+2],D=new te(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),F=$t.fromCartesian(D),I=this._scene.globe.getHeight(F),M=te.fromRadians(F.longitude,F.latitude,0),y<I&&(y=I),D=new te(m.attributes.position.values[v*3],m.attributes.position.values[v*3+1],m.attributes.position.values[v*3+2]),F=$t.fromCartesian(D),w=this._scene.globe.getHeight(F),B=te.fromRadians(F.longitude,F.latitude,0),y<w&&(y=w),D=new te(m.attributes.position.values[E*3],m.attributes.position.values[E*3+1],m.attributes.position.values[E*3+2]),F=$t.fromCartesian(D),Q=this._scene.globe.getHeight(F),T=te.fromRadians(F.longitude,F.latitude,0),y<Q&&(y=Q),L=FRi(M,B,T),C=C+L*(I-o+w-o+Q-o)/3;let R=LRi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:te.fromRadians(R.longitude,R.latitude,y+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:y,volume:C}};var cle=Vf;function Dct(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=Ae(A.color,new ht(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new Vi("invalid positions length!");this._duration=Ae(A.duration,4e3),this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,100),this._image=A.image,this._pps=null}function NRi(o,A){let f=$t.fromCartesian(o[0]),m=f.longitude,C=f.latitude,y=m,x=C,v=A;for(let E=1;E<o.length;E++){let I=$t.fromCartesian(o[E]);m>I.longitude?m=I.longitude:y<I.longitude&&(y=I.longitude),C>I.latitude?C=I.latitude:x<I.latitude&&(x=I.latitude)}return new te.fromRadians((m+y)/2,(C+x)/2,v)}function kRi(o){if(O(o._pps))return;let A=NRi(o._positions,o._minHeight),f=$t.fromCartesian(A),m=new ai(A.x,A.y,A.z,1),C=new $t(f.longitude,f.latitude,o.maxHeight+100),y=$t.toCartesian(C),x=new ai(y.x,y.y,y.z,1),v=new ai,E=new ai,I=new te,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new xa({fragmentShader:URi(Q),uniforms:{u_floodCenterEC:function(){return Xe.multiplyByVector(w._viewMatrix,m,v)},u_floodPlaneNormalEC:function(){let B=Xe.multiplyByVector(w._viewMatrix,m,v),T=Xe.multiplyByVector(w._viewMatrix,x,E);return I.x=T.x-B.x,I.y=T.y-B.y,I.z=T.z-B.z,te.normalize(I,I),I},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function ORi(o){O(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function URi(o){return`uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
varying vec2 v_textureCoordinates;
uniform vec4 u_floodCenterEC;
src/assets/img/ÐÎ×´ 9.png
src/components/MapView/moonMap.vue
@@ -1,8 +1,33 @@
 <template>
  <div class="body_box">
    <div id="cesiumContainer"></div>
    <!-- <button id="btn1" class="layui-btn" @click="cameraInfo()">相机参数</button> -->
  <div
    id="cesiumContainer"
    class="cesiumContainer"
  >
    <div class="mouseBox">
      <div
        class="earthImage"
        :class="{ active: gridIsshow }"
      ></div>
      <div class="earthLable">经度 :</div>
      <div class="earthLable">{{ longitude }}</div>
      <div class="earthLable">纬度 :</div>
      <div class="earthLable">{{ latitude }}</div>
      <div class="earthLable">地形高度 :</div>
      <div class="earthLable">{{ altHeight }} </div>
      <div class="earthLable">ç±³</div>
      <div class="earthLable">视角高度 :</div>
      <div class="earthLable">{{ alt }} </div>
      <div class="earthLable">千米</div>
      <div class="earthLable">分辨率 :</div>
      <div class="earthLable">{{ rate }}</div>
      <div class="earthLable">m/px</div>
    </div>
  </div>
  <!-- <button id="btn1" class="layui-btn" @click="cameraInfo()">相机参数</button> -->
</template>
<script>
@@ -13,85 +38,91 @@
    return {
      earthCtrl: null,
      Viewer: null,
      longitude: "0.00",
      latitude: "0.00",
      rate: "0.00",
      alt: "0.00",
      altHeight: '0.00',
      gridIsshow: false
    };
  },
  methods: {
     cameraInfo() {
            // èŽ·å–å½“å‰ç›¸æœºä½ç½®çš„xyz坐标
            var cameraPosition = Viewer.camera.position;
    cameraInfo() {
      // èŽ·å–å½“å‰ç›¸æœºä½ç½®çš„xyz坐标
      var cameraPosition = Viewer.camera.position;
            // èŽ·å–å½“å‰ç›¸æœºçš„å§¿æ€ï¼ˆheading、pitch、roll)
            var cameraHeading = Viewer.camera.heading;
            var cameraPitch = Viewer.camera.pitch;
            var cameraRoll = Viewer.camera.roll;
      // èŽ·å–å½“å‰ç›¸æœºçš„å§¿æ€ï¼ˆheading、pitch、roll)
      var cameraHeading = Viewer.camera.heading;
      var cameraPitch = Viewer.camera.pitch;
      var cameraRoll = Viewer.camera.roll;
            // æž„建警报框中的消息
            var message = 'Camera Position (x, y, z):\n' +
                            cameraPosition.x.toFixed(2) + ', ' +
                            cameraPosition.y.toFixed(2) + ', ' +
                            cameraPosition.z.toFixed(2) + '\n\n' +
                            'Camera Heading: ' + cameraHeading.toFixed(2) + '\n' +
                            'Camera Pitch: ' + cameraPitch.toFixed(2) + '\n' +
                            'Camera Roll: ' + cameraRoll.toFixed(2);
      // æž„建警报框中的消息
      var message = 'Camera Position (x, y, z):\n' +
        cameraPosition.x.toFixed(2) + ', ' +
        cameraPosition.y.toFixed(2) + ', ' +
        cameraPosition.z.toFixed(2) + '\n\n' +
        'Camera Heading: ' + cameraHeading.toFixed(2) + '\n' +
        'Camera Pitch: ' + cameraPitch.toFixed(2) + '\n' +
        'Camera Roll: ' + cameraRoll.toFixed(2);
            // å¼¹å‡ºè­¦æŠ¥æ¡†æ˜¾ç¤ºç›¸æœºä½ç½®å’Œå§¿æ€
            alert(message);
        },
      // å¼¹å‡ºè­¦æŠ¥æ¡†æ˜¾ç¤ºç›¸æœºä½ç½®å’Œå§¿æ€
      alert(message);
    },
    // wmts加载
    AddWmtesLayer(url, id) {
    var urlTemplateImageryProvider = earthCtrl.factory.createImageryLayer({
      sourceType: "wmts",
      url: url,
      layer: "",
      format: "image/png",
      tileMatrixSetID: "GoogleCRS84Quad01",
      tileMatrixLabels: [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9",
        "10",
        "11",
        "12",
        "13",
        "14",
        "15",
        "16",
        "17",
        "18",
      ],
      style: "",
      tilingScheme: new Cesium.GeographicTilingScheme({
        ellipsoid: Cesium.Ellipsoid.MOON,
      }),
    });
    console.log(urlTemplateImageryProvider);
    // this.layerList.push({
    //   id: id,
    //   layerData: urlTemplateImageryProvider._primitive,
    //   type: "wmts",
    // });
  },
  // åœ°å½¢åŠ è½½
      var urlTemplateImageryProvider = earthCtrl.factory.createImageryLayer({
        sourceType: "wmts",
        url: url,
        layer: "",
        format: "image/png",
        tileMatrixSetID: "GoogleCRS84Quad01",
        tileMatrixLabels: [
          "0",
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18",
        ],
        style: "",
        tilingScheme: new Cesium.GeographicTilingScheme({
          ellipsoid: Cesium.Ellipsoid.MOON,
        }),
      });
      console.log(urlTemplateImageryProvider);
      // this.layerList.push({
      //   id: id,
      //   layerData: urlTemplateImageryProvider._primitive,
      //   type: "wmts",
      // });
    },
    // åœ°å½¢åŠ è½½
    AddDemLayer(url, id) {
    var terrain = new Cesium.CesiumTerrainProvider({
      url: url,
      // url: url,
      tilingScheme: new Cesium.GeographicTilingScheme({
        ellipsoid: Cesium.Ellipsoid.MOON,
      }),
    });
    window.Viewer.terrainProvider = terrain;
      var terrain = new Cesium.CesiumTerrainProvider({
        url: url,
        // url: url,
        tilingScheme: new Cesium.GeographicTilingScheme({
          ellipsoid: Cesium.Ellipsoid.MOON,
        }),
      });
      window.Viewer.terrainProvider = terrain;
    // let img_layer = Viewer.imageryLayers.addImageryProvider(layer);
    // this.layerList.push({ id: id, type: "dem" });
  },
      // let img_layer = Viewer.imageryLayers.addImageryProvider(layer);
      // this.layerList.push({ id: id, type: "dem" });
    },
    //地图初始化
    init3DMap() {
      //设置月球坐标系
@@ -106,68 +137,144 @@
        ellipsoidCoordinates: "MOON",
      });
      this.earthCtrl.environment.disableAllEffect();
      this.Viewer = this.earthCtrl._Viewer;
      // this.Viewer.scene.skyAtmosphere.show = false;
      this.Viewer.imageryLayers.removeAll();
      this.Viewer.scene.globe.depthTestAgainstTerrain = false;
      this.Viewer.scene.skyAtmosphere.show = false;
      window.earthCtrl = this.earthCtrl;
      window.Viewer = this.earthCtrl._Viewer;
      window.Cesium = SmartEarth.Cesium;
      window.sgworld = earthCtrl;
      sgworld.Navigate.Stop(); //取消飞行状态
      sgworld.Creator.SimpleGraphic.edit(true, { editProp: true });
      sgworld.Navigate.setPosition(-1093596.38, 5729026.12, 4136590.41);
      this.getLonLat();
      var token = getToken();
      var demUrl = `${BASE_URL}/proxy/${token}/24`
      var wmtsUrl = `${BASE_URL}/proxy/${token}/17`
      var demUrl = `${BASE_URL}/proxy/${token}/25`
      var wmtsUrl = `${BASE_URL}/proxy/${token}/26`
      this.AddDemLayer(demUrl)
      this.AddWmtesLayer(wmtsUrl)
      //=======================
      // window.Viewer.imageryLayers.removeAll();
      //=======================
      // Viewer.scene.globe.showGroundAtmosphere = false;
    },
    getLonLat() {
      let handlerPoint = new SmartEarth.Cesium.ScreenSpaceEventHandler(
        window.Viewer.scene.canvas
      );
      var ellipsoid = window.Viewer.scene.globe.ellipsoid;
      var that = this;
      handlerPoint.setInputAction(function (movement) {
        //捕获椭球体,将笛卡尔二维平面坐标转为椭球体的笛卡尔三维坐标,返回球体表面的点
        var cartesian = window.Viewer.camera.pickEllipsoid(
          movement.endPosition,
          ellipsoid
        );
        if (cartesian) {
          //将笛卡尔三维坐标转为地图坐标(弧度)
          var cartographic =
            window.Viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
          //将地图坐标(弧度)转为十进制的度数
          that.longitude = SmartEarth.Cesium.Math.toDegrees(
            cartographic.longitude
          ).toFixed(6);
          that.latitude = SmartEarth.Cesium.Math.toDegrees(
            cartographic.latitude
          ).toFixed(6);
          that.altHeight = window.Viewer.scene.globe.getHeight(
            Cesium.Cartographic.fromDegrees(that.longitude, that.latitude, 0)
          )
          if (that.altHeight) {
            that.altHeight = that.altHeight.toFixed(6);
          }
        }
      }, SmartEarth.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
      // var terrain = new Cesium.CesiumTerrainProvider({
      //   url: config.moonTerrain,
      //   tilingScheme: new Cesium.GeographicTilingScheme({
      //     ellipsoid: Cesium.Ellipsoid.MOON,
      //   }),
      // });
      // window.Viewer.terrainProvider = terrain;
      Viewer.camera.changed.addEventListener(() => {
        // è§†é«˜ km
        let camera_alt = (Viewer.camera.positionCartographic.height / 1000).toFixed(
          2
        );
        that.alt = camera_alt;
        let scene = window.Viewer.scene;
        // èŽ·å–ç”»å¸ƒçš„å¤§å°
        var width = scene.canvas.clientWidth;
        var height = scene.canvas.clientHeight;
        //获取画布中心两个像素的坐标(默认地图渲染在画布中心位置)
        var left = scene.camera.getPickRay(
          new SmartEarth.Cesium.Cartesian2((width / 2) | 0, (height - 1) / 2)
        );
        var right = scene.camera.getPickRay(
          new SmartEarth.Cesium.Cartesian2((1 + width / 2) | 0, (height - 1) / 2)
        );
        var globe = scene.globe;
        var leftPosition = globe.pick(left, scene);
        var rightPosition = globe.pick(right, scene);
        if (!Cesium.defined(leftPosition) || !Cesium.defined(rightPosition)) {
          return;
        }
        var leftCartographic =
          globe.ellipsoid.cartesianToCartographic(leftPosition);
        var rightCartographic =
          globe.ellipsoid.cartesianToCartographic(rightPosition);
        var geodesic = new SmartEarth.Cesium.EllipsoidGeodesic();
        geodesic.setEndPoints(leftCartographic, rightCartographic);
        that.rate = geodesic.surfaceDistance.toFixed(6); //分辨率
      });
    },
  },
  mounted() {
    this.init3DMap();
  },
  created() {},
  created() { },
};
</script>
<style lang="less" scoped>
.body_box {
.cesiumContainer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  .cesiumContainer {
    width: 100%;
    height: 100%;
  .mouseBox {
    height: 30px;
    background: rgba(1, 0, 28, 0.3);
    z-index: 40;
    position: absolute;
    padding: 0px 10px;
    bottom: 30px;
    left: 20px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    .earthImage {
      width: 20px;
      height: 20px;
      background: url("../../assets/img/形状 9.png") no-repeat;
      background-size: 100% 100%;
      cursor: pointer;
    }
    .earthLable {
      font-size: 12px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #ffffff;
      line-height: 5px;
      margin-left: 10px;
    }
    .active {
      background-color: #171e2e;
      border: 1px solid;
      border-image: linear-gradient(47deg, #397bc9, #77a5cd, #397bc9) 1 1;
      box-shadow: 0px 0px 6px 0px #080c13,
        0px 7px 8px 0px rgba(38, 47, 71, 0.68);
    }
  }
}
</style>
<style>
.cesium-viewer-animationContainer{
.cesium-viewer-animationContainer {
  display: none !important;
}
</style>
src/components/js/server.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,323 @@
import { getToken } from '../../utils/auth.js';
const server = {
    addLayer(res) {
        switch (res.category) {
            case 0://其他
                this.setAddGisServerLayer(res);
                break;
            case 1://GisServer
                this.setAddGisServerLayer(res);
                break;
            case 2://GeoServer
                this.setAddGeoServerLayer(res);
                break;
            case 3://数简
                this.setAddGisServerLayer(res);
                break;
        }
    },
    //GisServer图层
    setAddGisServerLayer(res) {
        switch (res.data) {
            case 1://数字正射影像图
                this.setAddGisServerDomLayer(res);
                break;
            case 2://场景地形数据
                this.setAddGisServerTerrainLayer(res);
                break;
            case 3://数字高程模型(晕渲图)
                this.setAddGisServerDomLayer(res);
                break;
            case 4://单波段栅格数据
                this.setAddGisServerDomLayer(res);
                break;
            case 5://多光谱栅格数据
                this.setAddGisServerDomLayer(res);
                break;
            case 6://高光谱栅格数据
                this.setAddGisServerDomLayer(res);
                break;
            case 7://矢量图层
                this.setAddGisServerVectorLayer(res);
                break;
            case 8://三维模型
                this.setAddGisServerModelLayer(res);
                break;
        }
    },
    //GeoServer图层
    setAddGeoServerLayer(res) {
        switch (res.data) {
            case 1://数字正射影像图
                this.setAddGeoServerDomLayer(res);
                break;
            case 2://场景地形数据
                this.setAddGeoServerTerrainLayer(res);
                break;
            case 3://数字高程模型(晕渲图)
                this.setAddGeoServerDomLayer(res);
                break;
            case 4://单波段栅格数据
                this.setAddGeoServerDomLayer(res);
                break;
            case 5://多光谱栅格数据
                this.setAddGeoServerDomLayer(res);
                break;
            case 6://高光谱栅格数据
                this.setAddGeoServerDomLayer(res);
                break;
            case 7://矢量图层
                this.setAddGeoServerVectorLayer(res);
                break;
            case 8://三维模型
                this.setAddGeoServerModelLayer(res);
                break;
        }
    },
    setAddGeoServerDomLayer(res) {
        switch (res.type) {
            case 0://URL
                break;
            case 1://TMS
                this.setAddTmsLayer(res)
                break;
            case 2://WMTS
                this.setAddWmtsLayer(res)
                break;
            case 3://WMS
                this.setAddGeoWmsLayer(res)
                break;
        }
    },
    setAddGeoServerTerrainLayer(re) {
        switch (res.type) {
            case 0://URL
                this.setAddTearrinLayer(res)
                break;
            case 1://TMS
                this.setAddTearrinLayer(res)
                break;
        }
    },
    setAddGeoServerVectorLayer(res) {
        switch (res.type) {
            case 0://URL
                break;
            case 3://WMS
                this.setAddGeoWmsLayer(res)
                break;
            case 4://WFS
                break;
        }
    },
    setAddGeoServerModelLayer(res) {
        switch (res.type) {
            case 0://URL
                this.setAddModelLayer(res)
                break;
            case 5://Tileset
                this.setAddModelLayer(res)
                break;
        }
    },
    setAddGisServerDomLayer(res) {
        switch (res.type) {
            case 0://URL
                break;
            case 1://TMS
                this.setAddTmsLayer(res)
                break;
            case 2://WMTS
                this.setAddWmtsLayer(res)
                break;
            case 3://WMS
                this.setAddWmsLayer(res)
                break;
        }
    },
    setAddGisServerTerrainLayer(res) {
        switch (res.type) {
            case 0://URL
                this.setAddTearrinLayer(res)
                break;
            case 1://TMS
                this.setAddTearrinLayer(res)
                break;
        }
    },
    setAddGisServerVectorLayer(res) {
        switch (res.type) {
            case 0://URL
                break;
            case 3://WMS
                this.setAddWmsLayer(res)
                break;
            case 4://WFS
                break;
        }
    },
    setAddGisServerModelLayer(res) {
        switch (res.type) {
            case 0://URL
                this.setAddModelLayer(res)
                break;
            case 5://Tileset
                this.setAddModelLayer(res)
                break;
        }
    },
    //加载Geoserver WMS æœåŠ¡
    setAddGeoWmsLayer(res) {
        var url = this.getLayerUrl(res);
        let layer = new SmartEarth.Cesium.WebMapServiceImageryProvider({
            url: url,
            layers: res.tab,
            parameters: {
                transparent: true,
                format: "image/png",
                srs: "EPSG:104903",
                styles: "",
            },
            tileWidth: 512,
            tileHeight: 512,
        });
        layer.name = `Wms_Layer${res.id}`;
        window.Viewer.imageryLayers.addImageryProvider(layer);
    },
    //添加地形服务
    setAddTearrinLayer(res) {
        window.Viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider({});
        var url = this.getLayerUrl(res)
        window.terrainLayer = new Cesium.CesiumTerrainProvider({
            url: url
        });
        Viewer.terrainProvider = window.terrainLayer
    },
    //添加模型服务
    setAddModelLayer(res) {
        var url = this.getLayerUrl(res);
        let tileset = Viewer.scene.primitives.add(
            new Cesium.Cesium3DTileset({
                name: res.cnName,
                url: url,
                skipLevelOfDetail: true, // åœ¨éåŽ†æ—¶å€™è·³è¿‡è¯¦æƒ…ï¼šfalse
                baseScreenSpaceError: 1024,
                maximumScreenSpaceError: 64, // æœ€å¤§å±å¹•空间错误:16,数值加大能让最终成像变模糊
                skipScreenSpaceErrorFactor: 16,
                skipLevels: 1,
                immediatelyLoadDesiredLevelOfDetail: false,
                loadSiblings: true, // è‡ªåŠ¨ä»Žä¸­å¿ƒå¼€å§‹è¶…æ¸…åŒ–æ¨¡åž‹ï¼šfalse
                cullWithChildrenBounds: true, // ä½¿ç”¨å­é¡¹è¾¹ç•Œä½“积的并集来剔除图块:true
                cullRequestsWhileMoving: true,
                cullRequestsWhileMovingMultiplier: 10, // å€¼è¶Šå°èƒ½å¤Ÿæ›´å¿«çš„剔除:60
                preloadWhenHidden: true,
                preferLeaves: true, // é¢„装子节点:false
                maximumMemoryUsage: 768, // å†…存分配变小有利于内存回收,提升性能体验
                progressiveResolutionHeightFraction: 0.5, // æ•°å€¼åäºŽ0能够让初始加载变得模糊
                dynamicScreenSpaceErrorDensity: 0.5, // æ•°å€¼åŠ å¤§ï¼Œèƒ½è®©å‘¨è¾¹åŠ è½½å˜å¿«
                dynamicScreenSpaceErrorFactor: 2, // åŠ¨æ€å±å¹•ç©ºé—´è¯¯å·®çš„ç³»æ•°
                dynamicScreenSpaceError: true, // å‡å°‘离相机较远的屏幕空间错误:false,全屏加载完之后才清晰化房屋
            })
        );
        tileset.readyPromise.then((tileset) => {
            tileset.id = res.id;
        });
    },
    //添加WMTS服务
    setAddWmtsLayer(res) {
        var url = this.getLayerUrl(res)
        var urlTemplateImageryProvider = earthCtrl.factory.createImageryLayer({
            sourceType: "wmts",
            url: url,
            layer: "",
            format: "image/png",
            tileMatrixSetID: "GoogleCRS84Quad01",
            tileMatrixLabels: [
                "0",
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15",
                "16",
                "17",
                "18",
            ],
            style: "",
            tilingScheme: new Cesium.GeographicTilingScheme({
                ellipsoid: Cesium.Ellipsoid.MOON,
            }),
        });
    },
    //加载TMS服务
    setAddTmsLayer(res) {
        var url = this.getLayerUrl(res)
        let img_layer = earthCtrl.Creator.createUrlTemplateImageryProvider(
            "tms服务",
            {
                url: Cesium.buildModuleUrl(url + "/{z}/{x}/{y}.png"),
            },
            "0",
            undefined,
            true,
            ""
        );
        this.layerList.push({ id: res.id, layerData: img_layer, type: "tms" });
    },
    //加载WMS服务
    setAddWmsLayer(res) {
        var url = this.getLayerUrl(res)
        var img_layer = sgworld.Creator.createImageryProvider('giserver', "wms", {
            url: url,
            layers: '',
            parameters: {
                format: "image/png",
                transparent: true,
            }
        }, "0", undefined, true, "");
    },
    //获取
    getLayerUrl(res) {
        switch (res.status) {
            case 1://本地地址
                return res.url
                break;
            case 2://代理地址
                var token = getToken();
                if (res.proxy && res.proxy.indexOf('{token}') > -1) {
                    var val = res.proxy.replaceAll('{token}', token)
                    return BASE_URL + val
                }
                break;
        }
    },
};
export default server;
src/views/datamanage/resourceManagement.vue
@@ -190,7 +190,7 @@
          />
          <el-table-column
            :label="$t('common.operate')"
            width="150"
            width="200"
          >
            <template slot-scope="scope">
              <el-button
@@ -199,6 +199,12 @@
                type="warning"
                plain
              >{{ $t('common.update') }}</el-button>
              <el-button
                size="small"
                v-show="scope.row.status != 0"
                plain
                @click="setScopePreview(scope.row)"
              >{{ $t('common.preview') }}</el-button>
            </template>
          </el-table-column>
@@ -519,10 +525,37 @@
        </span>
      </div>
    </el-dialog>
    <!-- åœ°å€é¢„览 -->
    <el-dialog
      :title="$t('common.preview')"
      :class="isFullscreen ? '' : 'dialogClass_his'"
      custom-class="handleDialogClass"
      width="73.4%"
      :fullscreen="isFullscreen"
      v-if="prevDialog"
      :visible.sync="prevDialog"
      :show-close="false"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <dialog-header
        slot="title"
        :dialog-tittle="$t('common.preview')"
        :fullscreen="isFullscreen"
        @handle-closed="handleClose"
        @is-fullscreen="onFullscreen"
      ></dialog-header>
      <div :class="{'fullscreen1':isFullscreen}">
        <mapview v-if="showMapView"></mapview>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import MyBread from "../../components/MyBread.vue";
import dialogHeader from './dialogHeader.vue'
import server from '../../components/js/server.js'
import {
  getPerms,
  select_Res_ByPageAndCount,
@@ -536,11 +569,11 @@
import { serve_type, data_type, category_type } from './js/layerManage.js'
import { json } from "body-parser";
import { flatten } from '@turf/turf';
import mapview from '../../components/MapView/moonMap.vue'
export default {
  name: "catalogueManage",
  components: {
    MyBread,
    MyBread, mapview, 'dialog-header': dialogHeader,
  },
  data() {
@@ -580,6 +613,9 @@
      categoryType: [],
      insertDisabled: false,
      editDisabled: false,
      isFullscreen: false,
      prevDialog: false,
      showMapView: false,
    };
  },
  watch: {
@@ -590,6 +626,16 @@
    window.removeEventListener("resize", this.onResize);
  },
  methods: {
    //是否为全屏函数
    onFullscreen(fullscreen) {
      this.isFullscreen = fullscreen;
    },
    //预览弹窗关闭
    handleClose() {
      this.prevDialog = false
      this.showMapView = false;
    },
    async setEditConfirm() {
      const data = await res_update(this.editData);
      if (data.code == 200) {
@@ -764,6 +810,13 @@
        this.editData.data = parseInt(this.editData.data)
      }
      this.editDialog = true
    },
    setScopePreview(row) {
      this.prevDialog = true;
      this.showMapView = true;
      setTimeout(() => {
        server.addLayer(row)
      }, 1000);
    },
    formatProxy(row, column) {
      var token = getToken()
@@ -1024,6 +1077,10 @@
    }
  }
}
.fullscreen1 {
  width: 100%;
  height: 94vh;
}
/deep/ .el-input__suffix {
  top: 50%;
  transform: translateY(-50%);
@@ -1031,6 +1088,12 @@
.insertWidth {
  width: calc(100% - 200px);
}
/deep/.el-dialog__body {
  padding: 10px !important;
}
/deep/.el-dialog__header {
  padding: 10px !important;
}
</style>
<style >
.el-message-box {
src/views/datamanage/uploadmanage.vue
@@ -733,11 +733,9 @@
      loadDialogVisible: false,
      options: [],
      isFullscreen: false,
    }
  },
  methods: {
    setModelCanel() {
      this.insertModelVisible = false;
      this.modelOptions = [];
@@ -889,7 +887,7 @@
        return
      }
      if (this.formInline.type == "DOM" || this.formInline.type == "DEM") {
        this.insertLayer.name = this.multipleSelection[0].name.split('.')[0];
        this.insertLayer.number = this.multipleSelection.length
        this.insertLayer.noData = '0';