| | |
| | | } |
| | | material.alpha = u_alpha; |
| | | } |
| | | `})};Sk.prototype.destroy=function(){this._tileset.customShader===this._customShader&&(this._customShader=void 0,this._tileset.customShader=void 0),this._scene.preUpdate.removeEventListener(this._preUpdate)};function dSi(){this.customShaders={},this.customShaders.lightLine=Sk}var rnt=dSi;function WG(o,A){this.options=Ae(A,{}),this.earthCtrl=o,this.viewer=o.coreMap,this.CSME=Gge,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()}WG.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))};WG.prototype.addStage=function(o){let A=this;A.Cust.addStage(o),A.stageArr.push(o)};WG.prototype.removeStage=function(o){this.Cust.removeStage(o.name)};WG.prototype.update=function(){let o=this;o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=o.viewer.scene.preUpdate.addEventListener(()=>{o.Cust.update()})};WG.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 nnt=WG;function Zie(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._options.visibleEdgeColor=Ae(A.visibleEdgeColor,ct.WHITE),this._options.outlineWidth=Ae(A.outlineWidth,1),this._options.thresholdAngle=Ae(A.thresholdAngle,12*Math.PI/180),this.add()}Zie.prototype.add=function(){this._edgeStage=Mye();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)};Zie.prototype.removeFromMap=function(){this._edgeStage&&(this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage),this.__edgeStage=null)};Object.defineProperties(Zie.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)}}});var ont=Zie;function Bs(o){this._earthCtrl=o,this._coreMap=o.coreMap}function My(){return((1+je.nextRandomNumber())*65536|0).toString(16).substring(1)}Bs.createUUID=function(){return`${My()+My()}-${My()}-${My()}-${My()}-${My()}${My()}${My()}`};Bs.createUUIDWithoutDash=function(){return My()+My()+My()+My()+My()+My()+My()+My()};Bs.prototype.createUUID=function(){return Bs.createUUID()};Bs.prototype.createGroup=function(o){let A=new bk;return A.id=o.id||Bs.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};Bs.prototype.createImageryLayer=function(o,A){let f=new kie(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(_s.IMAGERYPROVIDERS),f),f};Bs.prototype.createTerrainLayer=function(o,A){let f=new Uie(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(_s.TERRAINPROVIDERS),f),f};Bs.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new gL({})};Bs.prototype.createFeatureLayer=function(o,A){let f=new zie(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(_s.FEATURELAYERS),f),f};Bs.prototype.createModelLayer=function(o,A){let f=new Hie(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(_s.MODELLAYERS),f),f};Bs.prototype.createWfsModel=function(o,A){let f=new vz(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(_s.MODELLAYERS),f),f};Bs.prototype.createModel=function(o,A){let f=new pie(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(_s.USERSCENE),f),f};Bs.prototype.removeModel=function(o){N(o)&&o.removeFromMap()};Bs.prototype.createCZMLObject=function(o,A){let f=this,m=Ae(o.addToMap,!0),C=new yee(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(_s.USERSCENE),C),C};Bs.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,N(o.name)&&(A.name=o.name),N(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};Bs.prototype.removeElement=function(o){N(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};Bs.prototype.createVideoProjection=function(o,A){o.addToMap=Ae(o.addToMap,!0);let f=Ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new tie(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(_s.USERSCENE),m)):f==="panorama"?(m=new Urt(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(_s.USERSCENE),m)):f==="fisheye"&&(m=new iie(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(_s.USERSCENE),m)),m};Bs.prototype.createTrack=function(o,A){let f=new Grt(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(_s.USERSCENE),f),f};Bs.prototype.createSceneNode=function(o,A,f){let m=new bk(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};Bs.prototype.createFire=function(o,A){let f=new oie(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(_s.USERSCENE),f),f};Bs.prototype.createSmoke=function(o,A){let f=new sie(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(_s.USERSCENE),f),f};Bs.prototype.createExplosion=function(o,A){let f=new uie(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(_s.USERSCENE),f),f};Bs.prototype.createFireworks=function(o,A){let f=new cie(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(_s.USERSCENE),f),f};Bs.prototype.createRadarScan=function(o,A){let f=new hie(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(_s.USERSCENE),f),f};Bs.prototype.createCircleScan=function(o,A){let f=new Jrt(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(_s.USERSCENE),f),f};Bs.prototype.createUpDownScan=function(o){let A=new qrt(this._earthCtrl,o);return A.show=!0,A};Bs.prototype.createWaters=function(o,A){let f=new Wie(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(_s.USERSCENE),f),f};Bs.prototype.createHeatmap=function(o,A){let f=Hrt.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(_s.USERSCENE),f),f};Bs.prototype.createLabel=function(o,A){let f=new Cie(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(_s.USERSCENE),f),f};Bs.prototype.createBillboard=function(o,A){let f=new die(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(_s.USERSCENE),f),f};Bs.prototype.createPolyline=function(o,A){let f=new xie(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(_s.USERSCENE),f),f};Bs.prototype.createPolygon=function(o,A){let f=new Iie(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(_s.USERSCENE),f),f};Bs.prototype.createPoint=function(o,A){let f=new _ie(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(_s.USERSCENE),f),f};Bs.prototype.createBox=function(o,A){let f=new bie(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(_s.USERSCENE),f),f};Bs.prototype.createEllipsoid=function(o,A){let f=new Die(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(_s.USERSCENE),f),f};Bs.prototype.createCylinder=function(o,A){let f=new Qie(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(_s.USERSCENE),f),f};Bs.prototype.createRectangle=function(o,A){let f=new Mie(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(_s.USERSCENE),f),f};Bs.prototype.createEllipse=function(o,A){let f=new Rie(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(_s.USERSCENE),f),f};Bs.prototype.createPolylineVolume=function(o,A){let f=new Fie(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(_s.USERSCENE),f),f};Bs.prototype.createEChartLayer=function(o,A){let f=new Yie(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(_s.USERSCENE),f),f};Bs.prototype.createPointLight=function(o){return new Xrt(this._earthCtrl,o)};Bs.prototype.createHawkeye=function(o){let A=new qie(this._earthCtrl,o);A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&A.addToMap(o)};Bs.prototype.createSpotLight=function(o){let A=new Xie(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Bs.prototype.createCustomShaderManager=function(o){let A=new rnt;return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Bs.prototype.createCustomShaderStage=function(o){let A=new nnt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Bs.prototype.createModelOutline=function(o={}){let A=new ont(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};var GS=Bs;var $ie=class extends vg{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new eie(A);let m=new bk(A);m.id=GS.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 vL("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];N(f)&&this.removeChild(f)}removeChild(A){N(A)&&N(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){N(A)&&N(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);N(m)&&N(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,I=[];for(let E in x){let B=x[E],w=f.rootNode.getChildByName(B);if(!w)continue;let T=[];if(w.childNodes.length===0)T=[];else for(let b=0;b<w.childNodes.length;b++){let D=w.childNodes[b].toJSON();T.push(D)}Promise.all(T).then(function(b){let D=[];if(b.length!==0){for(let R=0;R<b.length;R++)D.push(b[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let L={item:S,objJson:D};I.push(L)}v++,v===5&&(C(I),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 B=0;B<C.length;B++)C[B].item==="IMAGERY_LAYER"&&(y.imageryProviders=C[B].objJson),C[B].item==="TERRAIN_LAYER"&&(y.terrainProviders=C[B].objJson),C[B].item==="MODEL_LAYER"&&(y.modelLayers=C[B].objJson),C[B].item==="FEATURE_LAYER"&&(y.featureLayers=C[B].objJson),C[B].item==="USER_SCENE"&&(y.userScene=C[B].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)},I={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(I);let E=JSON.stringify(y);A&&A(E)})}};Object.defineProperties($ie.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 ere=$ie;function ant(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var Uki=new Za,Gki=new ee,Hki=new ee;ant.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 zr(x).setInputAction(function(E){let B=A.camera.pickEllipsoid(E.endPosition,v);if(B){let w=A.scene.globe.ellipsoid.cartesianToCartographic(B),T=je.toDegrees(w.latitude).toFixed(6),b=je.toDegrees(w.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);y.innerHTML=`\u7ECF\u5EA6\uFF1A${b}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${T}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},qi.MOUSE_MOVE)};var snt=ant;function Nl(){}Nl.parseBaseData=function(o,A){let f=[];if(N(A)&&N(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(N(y.tilingScheme)){let v=y.tilingScheme;v.type==="GeographicTilingScheme"&&(y.tilingScheme=new Ld(v))}let x=GS.createImageryLayer(y);f.push(x)}let m=[];if(N(A)&&N(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=GS.createTerrainLayer(y);m.push(x)}return{imageryProvider:f,terrainProvider:m}};Nl.parse=function(o,A){if(!N(A))return;let f=[_s.IMAGERYPROVIDERS,_s.TERRAINPROVIDERS,_s.MODELLAYERS,_s.FEATURELAYERS,_s.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(GS.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}N(A[_s.IMAGERYPROVIDERS])&&qG(o,A[_s.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),N(A[_s.TERRAINPROVIDERS])&&qG(o,A[_s.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),N(A[_s.MODELLAYERS])&&qG(o,A[_s.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),N(A[_s.FEATURELAYERS])&&qG(o,A[_s.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),N(A[_s.USERSCENE])&&qG(o,A[_s.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function qG(o,A,f,m){for(let C=0;C<A.length;C++){let y=A[C],x=null;if(y.enable===!1)continue;N(y.class)?(y.class==="IMAGERY"&&(y.class=no.IMAGERY_LAYER),y.class==="TERRAIN"&&(y.class=no.TERRAIN_LAYER),x=y.class):(m===0?y.class=no.IMAGERY_LAYER:m===1&&(y.class=no.TERRAIN_LAYER),x=y.class);let v=Nl.parserMap[x];v!==void 0&&v(o,y,f)}}function gSi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=Ae(A.show,!0),o.userScene.addChild(f,m),N(A.childNodes)&&qG(o,A.childNodes,m)}function pSi(o,A,f){let m=A;if(N(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new Ld(C))}o.factory.createImageryLayer(m,f)}function mSi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function CSi(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 ySi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function xSi(o,A,f){o.coreMap.scene.skyBox=new mk({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function vSi(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 ISi(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 ESi(o,A,f){o.factory.createModel(A,f)}function _Si(o,A,f){o.factory.createWaters(A,f)}function BSi(o,A,f){o.factory.createExplosion(A,f)}function bSi(o,A,f){o.factory.createFireworks(A,f)}function wSi(o,A,f){o.factory.createSmoke(A,f)}function QSi(o,A,f){o.factory.createFire(A,f)}function SSi(o,A,f){A.color&&(A.color=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function DSi(o,A,f){A.color&&(A.color=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function TSi(o,A,f){A.color&&(A.color=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function MSi(o,A,f){A.fillColor&&(A.fillColor=new ct(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function PSi(o,A,f){o.factory.createBillboard(A,f)}function RSi(o,A,f){A.positions&&(A.positions=Nl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new ct(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function LSi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=Nl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function FSi(o,A,f){A.coordinates&&(A.coordinates=bi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new ct(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function NSi(o,A,f){o.factory.createEllipse(A,f)}function kSi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=ee.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new ee(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function OSi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=ee.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new ee(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function USi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=ee.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function GSi(o,A,f){o.factory.createPolylineVolume(A,f)}function HSi(o,A,f){o.factory.createVideoProjection(A,f)}function VSi(o,A,f){o.factory.createVideoProjection(A,f)}function zSi(o,A,f){o.factory.createTrack(A,f)}function KSi(o,A,f){o.factory.createHeatmap(A,f)}function YSi(o,A,f){o.factory.createEChartLayer(A,f)}function JSi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}Nl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=ee.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};Nl.parserMap={};Nl.parserMap[no.NODE]=gSi;Nl.parserMap[no.IMAGERY_LAYER]=pSi;Nl.parserMap[no.TERRAIN_LAYER]=mSi;Nl.parserMap[no.MODEL_LAYER]=CSi;Nl.parserMap[no.FEATURE_LAYER]=ySi;Nl.parserMap[no.SKYBOX]=xSi;Nl.parserMap[no.ENVIRONMENT]=vSi;Nl.parserMap[no.VIEWPOINT]=ISi;Nl.parserMap[no.MODEL]=ESi;Nl.parserMap[no.WATERS]=_Si;Nl.parserMap[no.EXPLOSION]=BSi;Nl.parserMap[no.FIREWORK]=bSi;Nl.parserMap[no.SMOKE]=wSi;Nl.parserMap[no.FIRE]=QSi;Nl.parserMap[no.RADARSCAN]=SSi;Nl.parserMap[no.CIRCLESCAN]=DSi;Nl.parserMap[no.POINT]=TSi;Nl.parserMap[no.LABEL]=MSi;Nl.parserMap[no.BILLBOARD]=PSi;Nl.parserMap[no.POLYLINE]=RSi;Nl.parserMap[no.POLYGON]=LSi;Nl.parserMap[no.RECTANGLE]=FSi;Nl.parserMap[no.ELLIPSE]=NSi;Nl.parserMap[no.BOX]=kSi;Nl.parserMap[no.ELLIPSOID]=OSi;Nl.parserMap[no.CYLINDER]=USi;Nl.parserMap[no.POLYLINEVOLUME]=GSi;Nl.parserMap[no.PERSPECTIVE_VIDEO_PROJECTION]=HSi;Nl.parserMap[no.FISHEYE_VIDEO_PROJECTION]=VSi;Nl.parserMap[no.TRACK]=zSi;Nl.parserMap[no.HEATMAP]=KSi;Nl.parserMap[no.ECHARTLAYER]=YSi;Nl.parserMap.ELEMENT=JSi;var lnt=Nl;var fxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,N(this.editBillboard)&&N(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:((N(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(N(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(N(A)&&N(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]:N(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},unt=fxe;var dxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,N(this.editPoint)&&N(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:((N(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(N(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(N(A)&&N(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]:N(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},Ant=dxe;var gxe=class extends wa{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,N(this.editBox)&&N(this.editBox.entity.box)){let y=this.editBox.entity.position._value,x=Xt.fromCartesian(y);this.height=x.height;let v=new ee,I=new ee;this.getNorthPointByDistance(v,I),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:v,point:{heightReference:this.editBox.entity.box.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:I,point:{heightReference:this.editBox.entity.box.heightReference,color:ct.RED,pixelSize:12,outlineColor:ct.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=Xt.fromCartesian(f);return this.height=m.height+A,ee.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),N(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let y=Tn.eastNorthUpToFixedFrame(C),x=new ee,v=this.editBox.entity.box.dimensions._value;v||(v=this.editBox.entity.box.dimensions.getValue(m)),ee.divideByScalar(v,2,x),ee.clone(x,A),ee.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:((N(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=ui.fromDate(f);if(N(this.currentPoint)||N(this.pickEditHeightPoint)||N(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,y=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!y)return;let x=Xt.fromCartesian(y),v=ee.fromRadians(x.longitude,x.latitude,x.height+this.height);if(N(this.currentPoint))this.currentPoint.position=v,this.editBox.entity.position=new wn(function(){return v},!1);else if(N(this.dragPosition)){if(N(this.pickEditWHPoint)){let B=ee.subtract(y,this.dragPosition,new ee),w=ee.normalize(B,new ee);ee.dot(B,w,B);let T=this.editBox.entity.box.dimensions._value;T||(T=this.editBox.entity.box.dimensions.getValue(m));let b=ee.clone(T);b.x-=B.x,b.y+=B.y,ee.abs(b,b),this.editBox.entity.box.dimensions=new wn(function(){return b},!1)}else if(N(this.pickEditHeightPoint)){let B=ee.subtract(y,this.dragPosition,new ee),w=this.editBox.entity.box.dimensions._value;w||(w=this.editBox.entity.box.dimensions.getValue(m));let T=ee.clone(w);T.z+=B.z,ee.abs(T,T),this.editBox.entity.box.dimensions=T,this.editBox.entity.position=this.addHeight(B.z/2)}}this.dragPosition=y;let I=new ee,E=new ee;this.getNorthPointByDistance(I,E,m),this.editHeightPoint.position=I,this.editWHPoint.position=E}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(N(A)&&N(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]:N(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=[]}},cnt=gxe;var pxe=class extends wa{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,N(this.editCylinder)&&N(this.editCylinder.entity.cylinder)){let y=this.editCylinder.entity.position._value,x=Xt.fromCartesian(y);this.height=x.height;let v=this.editCylinder.entity.cylinder.topRadius._value,I=this.editCylinder.entity.cylinder.bottomRadius._value,E=new ee,B=new ee,w=new ee;this.getNorthPointByDistance(E,B,w),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),v>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:E,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ct.RED,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),I>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:B,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ct.RED,pixelSize:12,outlineColor:ct.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=Xt.fromCartesian(f);return this.height=m.height+A,ee.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,y=Tn.eastNorthUpToFixedFrame(C),x=this.editCylinder.entity.cylinder.length._value,v=this.editCylinder.entity.cylinder.topRadius._value,I=this.editCylinder.entity.cylinder.bottomRadius._value;v>0&&(A.z+=x/2,A.x+=v,Xe.multiplyByPoint(y,A,A)),I>0&&(f.x+=I,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:((N(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(N(this.currentPoint)||N(this.heightPoint)||N(this.topRadiusPoint)||N(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=ee.fromRadians(C.longitude,C.latitude,C.height+this.height);if(N(this.currentPoint))this.currentPoint.position=y,this.editCylinder.entity.position=y;else if(N(this.dragPosition)){if(N(this.pickHeightPoint)){let w=ee.subtract(m,this.dragPosition,new ee),T=this.editCylinder.entity.cylinder.length._value;T+=w.z,T=Math.abs(T),this.editCylinder.entity.position=this.addHeight(w.z/2),this.editCylinder.entity.cylinder.length=T}else if(N(this.pickTopRadiusPoint)){let w=ee.subtract(m,this.dragPosition,new ee),T=this.editCylinder.entity.cylinder.topRadius._value;T-=w.x,T=Math.abs(T),this.editCylinder.entity.cylinder.topRadius=T}else if(N(this.pickBottomRadiusPoint)){let w=ee.subtract(m,this.dragPosition,new ee),T=this.editCylinder.entity.cylinder.bottomRadius._value;T-=w.x,T=Math.abs(T),this.editCylinder.entity.cylinder.bottomRadius=T}}this.dragPosition=m;let x=this.editCylinder.entity.cylinder.topRadius._value,v=this.editCylinder.entity.cylinder.bottomRadius._value,I=new ee,E=new ee,B=new ee;this.getNorthPointByDistance(I,E,B),x>0&&(this.topRadiusPoint.position=I),v>0&&(this.bottomRadiusPoint.position=E),this.heightPoint.position=B}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(N(A)&&N(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]:N(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=[]}},hnt=pxe;var mxe=class extends wa{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,N(this.editEllipse)&&N(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:ct.WHITE,pixelSize:12,outlineColor:ct.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 ee,m=new ee,C=new ee,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,I=this.semiMajorAxis*this.semiMajorAxis,E=this.semiMajorAxis*this.semiMinorAxis,B=ee.magnitude(this.center),w=ee.normalize(this.center,f),T=ee.cross(ee.UNIT_Z,this.center,m);T=ee.normalize(T,T);let b=ee.cross(w,T,C),D=new ee;return GB.pointOnEllipsoid(A,x,b,T,v,E,I,B,w,D)}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:((N(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(N(this.currentPoint)||N(this.pickSemiMajorAxisPoint)||N(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(N(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(N(this.pickSemiMajorAxisPoint)){let C=ee.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(N(this.pickSemiMinorAxisPoint)){let C=ee.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(N(A)&&N(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]:N(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=[]}},fnt=mxe;var Cxe=class extends wa{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,N(this.editEllipsoid)&&N(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let y=this.editEllipsoid.entity.position._value,x=Xt.fromCartesian(y);this.height=x.height;let v=new ee,I=new ee,E=new ee;this.getNorthPointByDistance(v,I,E),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:I,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:E,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.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=Xt.fromCartesian(f);return this.height=m.height+A,ee.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,y=Tn.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:((N(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(N(this.currentPoint)||N(this.pickRadiiXPoint)||N(this.pickRadiiYPoint)||N(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=ee.fromRadians(C.longitude,C.latitude,C.height+this.height);if(N(this.currentPoint))this.currentPoint.position=y,this.editEllipsoid.entity.position=y;else{if(N(this.dragPosition)){let E=ee.subtract(m,this.dragPosition,new ee),B=ee.normalize(E,new ee);ee.dot(E,B,E);let w=this.editEllipsoid.entity.ellipsoid.radii._value,T=ee.clone(w);N(this.pickRadiiXPoint)?T.x-=E.x:N(this.pickRadiiYPoint)?T.y+=E.y:N(this.pickRadiiZPoint)&&(T.z+=E.z,this.editEllipsoid.entity.position=this.addHeight(E.z)),ee.abs(T,T),this.editEllipsoid.entity.ellipsoid.radii=T}this.dragPosition=m}let x=new ee,v=new ee,I=new ee;this.getNorthPointByDistance(x,v,I),this.radiiXPoint.position=x,this.radiiYPoint.position=v,this.radiiZPoint.position=I}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(N(A)&&N(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]:N(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=[]}},dnt=Cxe;var yxe=class extends wa{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,N(this.editPolygon)&&N(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:ct.WHITE,pixelSize:8,outlineColor:ct.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:((N(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(N(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(N(A)&&N(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];N(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=[]}},gnt=yxe;var xxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=ct.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,N(this.editModel)&&N(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:((N(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(N(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=Xt.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(N(A)&&N(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(N(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}},pnt=xxe;var vxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,N(this.editLabel)&&N(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:((N(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(N(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(N(A)&&N(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]:N(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},mnt=vxe;var Ixe=class extends wa{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,N(this.editPolyline)&&N(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:ct.WHITE,pixelSize:8,outlineColor:ct.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:((N(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(N(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(N(A)&&N(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];N(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=[]}},Cnt=Ixe;var Exe=class extends wa{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,N(this.editPolylineVolume)&&N(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:ct.WHITE,pixelSize:12,outlineColor:ct.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:((N(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(N(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(N(A)&&N(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]:N(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=[]}},ynt=Exe;var _xe=class extends wa{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,N(this.editRectangle)&&N(this.editRectangle.entity.rectangle)){let y=this.editRectangle.entity.rectangle.coordinates._value,x=this.editRectangle.entity.rectangle.height._value,v=bi.northwest(y),I=ee.fromRadians(v.longitude,v.latitude,x),E=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:I,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ct.WHITE,pixelSize:8,outlineColor:ct.BLACK,outlineWidth:1}});this.pointsId.push(E.id),v=bi.southeast(y);let B=ee.fromRadians(v.longitude,v.latitude,x),w=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:B,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ct.WHITE,pixelSize:8,outlineColor:ct.BLACK,outlineWidth:1}});this.pointsId.push(w.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:((N(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(N(this.leftTopPoint)||N(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=this.editRectangle.entity.rectangle.coordinates._value;N(this.leftTopPoint)?(this.leftTopPoint.position=m,y.west=C.longitude,y.north=C.latitude):N(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(N(A)&&N(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]:N(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=[]}},xnt=_xe;function Jh(o){this._earthCtrl=o,this._coreMap=o.coreMap}Jh.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ant(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Jh.prototype.updatePoint=function(o,A){o.updatePoint(A)};Jh.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new Cnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Jh.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Jh.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new gnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Jh.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Jh.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new cnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Jh.prototype.updateBox=function(o,A){o.updateBox(A)};Jh.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new dnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Jh.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Jh.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new hnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Jh.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Jh.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new pnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Jh.prototype.updateModel=function(o,A){o.updateModel(A)};Jh.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new unt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Jh.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Jh.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new mnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Jh.prototype.updateLabel=function(o,A){o.updateLabel(A)};Jh.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new xnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Jh.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Jh.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new fnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Jh.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Jh.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new ynt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Jh.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Jh.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 tre=Jh;function IC(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}IC.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],y="",x=[],v,I=this.scene.globe.ellipsoid,E={spot:[],distance:[],label:[],polyline:[]},B={point:ct.RED,polyline:ct.fromRgba(4286644096)};N(A)&&(N(A.point)&&(B.point=A.point),N(A.polyline)&&(B.polyline=A.polyline));let w=new GE;this.scene.primitives.add(w);let T=new mc,b=new zr(f.scene.canvas),D=document.createElement("div");BA(".map-widget",D),BA(".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;m=!0;let P=function(V){let G=0,W=`${0}\u7C73`,te,Z,ne,re,ae,ue;for(let Y=0;Y<V.length-1;Y+=1)te=I.cartesianToCartographic(V[Y]),Z=T.project(te),ne=Z.x,re=Z.y,te=I.cartesianToCartographic(V[Y+1]),Z=T.project(te),ae=Z.x,ue=Z.y,G=G+Math.sqrt((ne-ae)*(ne-ae)+(re-ue)*(re-ue));return G>0&&(W=`${G.toFixed(2)}\u7C73`),G/1e3>=1&&(W=`${(G/1e3).toFixed(2)}\u5343\u7C73`),W},k=function(){function V(G){if(!N(G))throw new Li("positions is required!");if(G.length<2)throw new Li("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let W=Jo.fromType(Jo.ColorType);W.uniforms.color=new ct(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:B.polyline,width:3,clampToGround:!1}},this.path=G,this._init()}return V.prototype._init=function(){let G=this,W=function(){return G.path};this.options.polyline.positions=new wn(W,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,E.polyline.push(this.lineEntity)},V}();b.setInputAction(function(V){let G,W;L.style.left=`${V.endPosition.x+10}px`,L.style.top=`${V.endPosition.y+20}px`,L.style.display="block",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 te=!1,Z=f.camera.getPickRay(V.endPosition);Z&&(G=f.scene.globe.pick(Z,f.scene));let ne=f.scene.pick(V.endPosition);if(ne){console.log("feature",ne);let re=f.scene.pickPosition(V.endPosition);re&&(G=re),te=!0}if(!!G&&(W=Ti.WGS84.cartesianToCartographic(G),W)){let re;te?re=f.scene.sampleHeight(W):re=f.scene.globe.getHeight(W);let ae=ee.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,re);if(m){if(C.length<1)return;N(v)?(v.path.pop(),v.path.push(ae)):(C.push(ae),v=new k(C));let ue=P(v.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v.path[v.path.length-1],label:{text:`\u603B\u957F\uFF1A${ue}`,show:!0,font:"26px \u6977\u4F53",fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},qi.MOUSE_MOVE);let U=function(V){x.push(V);let G=[];if(x.length>1){let W=x[x.length-2],te=x[x.length-1],Z=Math.abs(W.longitude-te.longitude)*1e7,ne=Math.abs(W.latitude-te.latitude)*1e7;Z>ne&&(ne=Z);let re=parseInt(ne/10);re>1e3&&(re=1e3),re<2&&(re=2);for(let ae=0;ae<re;++ae)G.push(new Xt(je.lerp(W.longitude,te.longitude,ae/(re-1)),je.lerp(W.latitude,te.latitude,ae/(re-1))));G.push(te.clone())}else G=x;if(G.length>0)for(let W=0;W<G.length;W++){V=G[W];let te=f.scene.globe.getHeight(V),Z=ee.fromDegrees(V.longitude/Math.PI*180,V.latitude/Math.PI*180,te);C.push(Z)}};return b.setInputAction(function(V){let G,W,te=!1,Z=f.camera.getPickRay(V.position);if(Z&&(G=f.scene.globe.pick(Z,f.scene)),f.scene.pick(V.position)){let re=f.scene.pickPosition(V.position);re&&(G=re),te=!0}if(G&&(W=Ti.WGS84.cartesianToCartographic(G)),W){let re;te?re=f.scene.sampleHeight(W):re=f.scene.globe.getHeight(W);let ae=ee.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,re);if(m){v&&v.path.pop(),U(W);let ue="0\u7C73";v&&(ue=P(v.path),ae=v.path[v.path.length-1]),y=ue,E.spot.push(ae),E.distance.push(ue);let Y=f.entities.add({position:ae,point:{pixelSize:5,color:B.point,outlineColor:ct.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ue,show:!0,font:"26px \u6977\u4F53",fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});E.label.push(Y),f._points.push(Y)}}},qi.LEFT_CLICK),b.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=y,b.destroy(),C.pop(),N(o)&&typeof o=="function"&&o(E),L.style.display="none"},qi.RIGHT_CLICK),this};IC.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new zr(f.scene.canvas),C=[],y=null,x="0\u7C73",v=null,I,E="",B,w=document.createElement("div");BA(".map-widget",w),BA(".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 D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:ct.RED,polyline:ct.fromRgba(4286644096)};N(A)&&(N(A.point)&&(S.point=A.point),N(A.polyline)&&(S.polyline=A.polyline));let L=function(){function R(P){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=P,this._init()}return R.prototype._init=function(){let P=this,k=function(){return P.positions};this.options.polyline.positions=new wn(k,!1);let U=f.entities.add(this.options);f.item=U,D.ployline.push(U);let V=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${V}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let P=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);P[0]===0?v=f.scene.pickPosition(R.endPosition):v=new ee(P[0],P[1],P[2]),console.log("????????",v)}else v=f.scene.pickPosition(R.endPosition);!v||(b.style.left=`${R.endPosition.x+10}px`,b.style.top=`${R.endPosition.y+20}px`,b.style.display="block",C.length>=2&&(N(y)?(C.pop(),C.push(v)):y=new L(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(B),B=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:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},qi.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let k=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);k[0]===0?v=f.scene.pickPosition(R.position):v=new ee(k[0],k[1],k[2]),console.log("????????",v)}else v=f.scene.pickPosition(R.position);if(!v)return;C.length===0&&C.push(v.clone()),C.push(v);let P=x;E=`\u603B\u957F\uFF1A${x}`,I=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:ct.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:P,show:!0,font:"26px \u6977\u4F53",fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),heightReference:hn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(I),D.spot.push(v),D.distance.push(x),D.label.push(I)},qi.LEFT_CLICK),m.setInputAction(function(R){b.style.display="none",f.entities.remove(B),f._points.length>0&&(f._points[f._points.length-1].label.text=E),m.destroy(),C.pop(),N(o)&&typeof o=="function"&&o(D)},qi.RIGHT_CLICK),this};IC.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Xt.fromCartesian(o[m]),y=Xt.fromCartesian(o[m+1]),x=new N0;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};IC.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new zr(f.scene._imageryLayerCollection),y=document.getElementById("toolTip");y||(BA(".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={},I=[],E=[],B=null,w=null,T,b={point:ct.RED,polyline:ct.fromRgba(4286644096),polygon:ct.fromRgba(4286644096).withAlpha(.5)};N(A)&&(N(A.point)&&(b.point=A.point),N(A.polyline)&&(b.polyline=A.polyline),N(A.polygon)&&(b.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};y.style.display="block";let S=function(){function L(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:b.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return L.prototype._init=function(){let R=this,P=function(){return R.hierarchy};this.options.polygon.hierarchy=new wn(P,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},L}();return C.setInputAction(function(L){if(y.style.left=`${L.endPosition.x+10}px`,y.style.top=`${L.endPosition.y+20}px`,f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(L.endPosition.x,L.endPosition.y);V[0]===0?w=f.scene.pickPosition(L.endPosition):w=new ee(V[0],V[1],V[2])}else w=f.scene.pickPosition(L.endPosition);if(!w)return;let R=Xt.fromCartesian(w),P=je.toDegrees(R.longitude),k=je.toDegrees(R.latitude),U=R.height;if(x.length>=2){N(B)?(x.pop(),x.push(w),v=new zn(x),E.pop(),E.push({lon:P,lat:k,hei:U})):(v=new zn(x),B=new S(v));let V=f.getArea(E,x);f.entities.remove(T),T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:V,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=T}},qi.MOUSE_MOVE),C.setInputAction(function(L){if(f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(L.position.x,L.position.y);V[0]===0?w=f.scene.pickPosition(L.position):w=new ee(V[0],V[1],V[2])}else w=f.scene.pickPosition(L.position);if(!w)return;let R=Xt.fromCartesian(w);console.log("\u5DE6\u952E\u70B9",R);let P=je.toDegrees(R.longitude),k=je.toDegrees(R.latitude),U=R.height;x.length===0&&(x.push(w.clone()),v=new zn(x),E.push({lon:P,lat:k,hei:U}),x.push(w.clone()),v=new zn(x),E.push({lon:P,lat:k,hei:U})),x.push(w),v=new zn(x),I.push({lon:P,lat:k,hei:U}),E.push({lon:P,lat:k,hei:U})},qi.LEFT_CLICK),C.setInputAction(function(L){y.style.display="none",f.entities.remove(T),C.destroy();let R=f.getArea(E,x);m=R;let P=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(P),f._lable=P,D.mj=m,D.label=P,N(o)&&typeof o=="function"&&o(D)},qi.RIGHT_CLICK),this};IC.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,y=[],x={},v,I=f.scene,E=I.globe.ellipsoid,B=new GE;I.primitives.add(B);let w,T,b=0,D={point:ct.RED,polyline:ct.fromRgba(4286644096),polygon:ct.fromRgba(4286644096).withAlpha(.5)};N(A)&&(N(A.point)&&(D.point=A.point),N(A.polyline)&&(D.polyline=A.polyline),N(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");BA(".map-widget",S),BA(".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 R=document.getElementById("toolTip");R.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 P=new zr(I.canvas),k=function(){function V(G){if(!N(G))throw new Li("positions is required!");if(G.length<3)throw new Li("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=G,this._init()}return V.prototype._init=function(){let G=this,W=function(){return G.path};this.options.polygon.hierarchy=new wn(W,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},V}();P.setInputAction(function(V){let G=0;f.entities.remove(T);let W,te,Z=f.scene.camera.getPickRay(V.endPosition);Z&&(W=f.scene.globe.pick(Z,f.scene));let ne=f.scene.pick(V.endPosition),re=!1;if(ne){let ue=f.scene.pickPosition(V.endPosition);ue&&(W=ue),re=!0}if(!W)return;let ae=function(ue){let Y=new Array(ue.length),ce=function(ve){return ve.longitude=ve.longitude/Math.PI*180,ve.latitude=ve.latitude/Math.PI*180,ve},me=function(ve){let be=0;for(let _e=0;_e<ve.length;_e++){let pe=ve[_e],H;_e<ve.length-1?H=ve[_e+1]:H=ve[0],be+=pe.x*H.y-H.x*pe.y}return be/2};for(let ve=0;ve<ue.length;ve++)Y[ve]=ce(E.cartesianToCartographic(ue[ve]));let Ie=0;for(let ve=0;ve<Y.length;ve++)Ie+=Y[ve].longitude;Ie=Ie/Y.length;for(let ve=0;ve<Y.length;ve++)Y[ve]=f.Gauss_to_XY(Y[ve].longitude,Y[ve].latitude,Ie);return Math.abs(me(Y))};if(te=Ti.WGS84.cartesianToCartographic(W),te&&C){if(R.style.left=`${V.endPosition.x+10}px`,R.style.top=`${V.endPosition.y+20}px`,R.style.display="block",y.length<2){b===1&&(T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:`${G}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(T),m.label=T);return}if(N(v)?(v.path.positions.pop(),v.path.positions.push(W)):(y.push(W),x=new zn(y),v=new k(x)),y.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ue=String(ae(v.path.positions));ue=ue.substr(0,ue.indexOf(".",0)),ue.length<6?G=`${ue}\u5E73\u65B9\u7C73`:(ue=String(ue/1e6),ue=ue.substr(0,ue.indexOf(".",0)+3),G=`${ue}\u5E73\u65B9\u5343\u7C73`),m.mj=G,T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:G,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(T),m.label=T}}},qi.MOUSE_MOVE),P.setInputAction(function(V){let G;b=1;let W=f.scene.camera.getPickRay(V.position);W&&(G=f.scene.globe.pick(W,f.scene));let te=f.scene.pick(V.position),Z=!1;if(te){let ne=f.scene.pickPosition(V.position);ne&&(G=ne),Z=!0}G&&C&&(y.push(G),x=new zn(y))},qi.LEFT_CLICK),P.setInputAction(function(){P.removeInputAction(qi.LEFT_CLICK),P.removeInputAction(qi.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,w=B.add({show:!0,id:"measureTool",position:y[y.length-1],pixelOffset:new wt(0,20),eyeOffset:new ee(0,0,0),horizontalOrigin:NA.CENTER,verticalOrigin:fn.CENTER,scale:1,color:new ct(1,1,1,1)}),R.style.display="none",P.destroy(),N(o)&&typeof o=="function"&&o(m)},qi.RIGHT_CLICK);let U=function(V){let G=0,W=0,te=0;for(let ne=0;ne<V.length;ne++)G+=V[ne].x,W+=V[ne].y,te+=V[ne].z;return new ee(G/V.length,W/V.length,te/V.length)};return this};IC.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))};IC.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,y,x,v,I;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,I=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)+I/8*Math.sin(8*o))};IC.prototype.to_Radian=function(o){return o*Math.PI/180};IC.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,y=Math.sqrt(6378137*6378137-C*C)/C,x=0,v=0,I=0,E=0,B=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let w=o-B,T=Math.cos(A);E=this.to_N(A),I=E*Math.cos(A),x=Math.tan(A),v=y*T;let b=Math.pow(x,2),D=Math.pow(x,4),S=Math.pow(v,2),L=Math.pow(v,4),R=Math.pow(T,3),P=Math.pow(T,5),k=this.to_Sm(A)+Math.pow(w,2)/2*I*T*x+Math.pow(w,4)/24*x*I*R*(5-b+9*S+4*L)+Math.pow(w,6)/720*x*I*P*(61-58*x*x+D+270*S-330*x*x*S),U=w*E*T+Math.pow(w,3)/6*E*R*(1-x*x+v*v)+Math.pow(w,5)/120*E*P*(5-18*x*x+D+14*S-58*S*b);return new wt(U,k)};IC.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]),I=this.getdistance(A[C],A[y]);f+=v*I*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};IC.prototype.getdistance=function(o,A){let f=Xt.fromCartesian(o),m=Xt.fromCartesian(A),C=new N0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};IC.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,I=-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 I<0&&(I+=Math.PI*2),I=I*m,I};IC.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};IC.prototype.getuid=function(){return this.uuid(8,16)};IC.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("")};IC.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 $7=IC;function n1(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=ee.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,ct.GREEN.withAlpha(.4)),this._invisibleAreaColor=Ae(A.invisibleAreaColor,ct.RED.withAlpha(.4)),this._size=Ae(A.size,10240),this._softShadows=Ae(A.softShadows,!0),this._colorStyle=Ae(A.colorStyle,ct.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(n1.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)}}});n1.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};n1.prototype.removeFromMap=function(){let o=this;N(o.viewShedMap)&&(o.viewShedMap.enabled=!1),N(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=[]};n1.prototype.visualConeShow=function(o){let A=this;N(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};n1.prototype.addVisualPyramid=function(){let o=this,A=new fz({radii:new wn(function(){return new ee(o._distance,o._distance,o._distance)},!1),minimumClock:new wn(function(){return je.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new wn(function(){return je.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new wn(function(){return je.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new wn(function(){return je.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new wn(function(){return o._colorStyle},!1)}),f=new ch({position:new wn(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};n1.prototype.createLightCamera=function(){N(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new cl(this._coreMap.scene),this._lightCamera.position=this._position};n1.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!N(o)&&(N(o.lon)||N(o.lat)||N(o.height)||N(o.heading)||N(o.pitch)||N(o.roll)||N(o.far)||N(o.distance)||N(o.verticalViewAngle)||N(o.horizontalViewAngle))){let m=this._parameter;for(let v in o)o.hasOwnProperty(v)&&N(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=ee.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}};n1.prototype.createShadowMap=function(){if(N(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new qz({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 Py=new ee;n1.prototype.drawViewCentrum=function(){let o=this;function A(){let E=o.pyramid._ellipsoid._minimumClock.getValue(),B=o.pyramid._ellipsoid._minimumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=new CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let f=this._earthCtrl.entities.add({polyline:{positions:new wn(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let E=o.pyramid._ellipsoid._maximumClock.getValue(),B=o.pyramid._ellipsoid._minimumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=new CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let C=this._earthCtrl.entities.add({polyline:{positions:new wn(m,!1),material:this._colorStyle}});this._lineArray.push(C);function y(){let E=o.pyramid._ellipsoid._minimumClock.getValue(),B=o.pyramid._ellipsoid._maximumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=new CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let x=this._earthCtrl.entities.add({polyline:{positions:new wn(y,!1),material:this._colorStyle}});this._lineArray.push(x);function v(){let E=o.pyramid._ellipsoid._maximumClock.getValue(),B=o.pyramid._ellipsoid._maximumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let I=this._earthCtrl.entities.add({polyline:{positions:new wn(v,!1),material:this._colorStyle}});this._lineArray.push(I)};n1.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};n1.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 ire=n1;var Bxe=Ti.WGS84;function nd(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=WSi(this.coreMap.container)}function bxe(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"?bxe(o[f],null):A[f];return A}function vnt(o,A){let f=bxe(o),m;for(m in A)f[m]===void 0&&(f[m]=bxe(A[m]));return f}function WSi(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)}nd.prototype.addToolbar=function(o,A){return A=vnt(A,{container:o}),new nd.Toolbar(this,A)};var Int={shiftX:0,shiftY:0};nd.prototype.createBillboardGroup=function(o,A,f){let m=new nd.BillboardGroup(this,A);return m.addBillboards(o,f),m};nd.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=vnt(A,Int);let f=new GE;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};nd.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 ee(0,0,-1e3),horizontalOrigin:NA.CENTER,verticalOrigin:fn.CENTER,scale:.3,image:Ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new ct(1,1,1,1)});if(A){let y=function(v){C.enableRotate=v},x=function(){let v=0;for(let I=m._orderedBillboards.length;v<I&&m._orderedBillboards[v]!==f;++v);return v},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let v=this,I=new zr(v._scene.canvas);setListener(f,"leftDown",function(E){function B(T){f.position=T;for(let b=0,D=v._orderedBillboards.length;b<D&&v._orderedBillboards[b]!==f;++b);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(x(),T)}function w(T){I.destroy(),y(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(x(),T)}I.setInputAction(function(T){let b=v._scene.camera.pickEllipsoid(T.endPosition,Bxe);b?B(b):w(b)},qi.MOUSE_MOVE),I.setInputAction(function(T){w(v._scene.camera.pickEllipsoid(T.position,Bxe))},qi.LEFT_UP),y(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(x(),v._scene.camera.pickEllipsoid(E,Bxe))})}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};nd.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};nd.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};nd.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};nd.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};nd.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};nd.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};nd.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};nd.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};nd.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};nd.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)};nd.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 I=new zr(f.canvas);this._mouseHandler=I;let E=new nd.BillboardGroup(this,Int);this._markers=E,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),I.setInputAction(function(w){if(w.position!==null){let T=f.camera.getPickRay(w.position),b=f.globe.pick(T,f),D=Xt.fromCartesian(b),S=je.toDegrees(D.longitude),L=je.toDegrees(D.latitude);if(b){if(y.length===0&&(y.push(S,L),x.push(b),v=b,E.addBillboard(v)),x.length>=4){let R=Hl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(R!==void 0){let P=R.x-w.position.x,k=R.y-w.position.y;if(P*P+k*k<16){y.splice(y.length-2,2),x.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}y.push(S,L),x.push(b),E.addBillboard(b),x.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:ee.fromDegreesArray(y),material:ct.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=B())}}}.bind(this),qi.LEFT_CLICK),I.setInputAction(function(w){let T=w.endPosition;if(T!==null)if(x.length===0)m.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let b=f.camera.getPickRay(T),D=f.globe.pick(b,f),S=Xt.fromCartesian(D),L=je.toDegrees(S.longitude),R=je.toDegrees(S.latitude);if(D&&(y.splice(y.length-2,2),x.pop(),y.push(L,R),x.push(D),E.getBillboard(x.length-1).position=D,m.showAt(T,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4)){let P=Hl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(P!==void 0){let k=P.x-T.x,U=P.y-T.y;k*k+U*U<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),qi.MOUSE_MOVE),I.setInputAction(function(w){x.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),qi.LEFT_DOUBLE_CLICK);function B(){return ee.fromDegreesArray(y)}};nd.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:ct.RED.withAlpha(.5),outline:!0,outlineColor:ct.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};nd.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)};nd.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};nd.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function qSi(o){let A=[],f=[];for(let w=0;w<o.length;w++){let T=Xt.fromCartesian(o[w]);A.push(T.longitude),f.push(T.latitude)}let m=0,C=0,y=0,x=0,v=0,I=0,E=0,B=0;for(let w=0;w<o.length;w++)m=A[w],C=f[w],w===o.length-1?(y=A[0],x=f[0]):(y=A[w+1],x=f[w+1]),I=m*x-y*C,v+=I,E+=(m+y)*I,B+=(C+x)*I;return v*=.5,E/=6*v,B/=6*v,new Xt(E,B)}function jSi(o,A,f){let m=ee.distance(o,A),C=ee.distance(A,f),y=ee.distance(f,o),x=(m+C+y)/2;return Math.sqrt(x*(x-m)*(x-C)*(x-y))}nd.prototype.computeCutVolume=function(){let o=15e3;for(let k=0;k<this._positions.length;k++){let U=Xt.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 td.fromPositions({positions:this._positions,vertexFormat:ba.FLAT_VERTEX_FORMAT,granularity:A}),m=new td.createGeometry(f),C=0,y=0,x,v,I,E,B,w,T,b,D,S,L,R;for(let k=0;k<m.indices.length;k+=3)x=m.indices[k],v=m.indices[k+1],I=m.indices[k+2],S=new ee(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),L=Xt.fromCartesian(S),E=this._scene.globe.getHeight(L),T=ee.fromRadians(L.longitude,L.latitude,0),y<E&&(y=E),S=new ee(m.attributes.position.values[v*3],m.attributes.position.values[v*3+1],m.attributes.position.values[v*3+2]),L=Xt.fromCartesian(S),B=this._scene.globe.getHeight(L),b=ee.fromRadians(L.longitude,L.latitude,0),y<B&&(y=B),S=new ee(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),L=Xt.fromCartesian(S),w=this._scene.globe.getHeight(L),D=ee.fromRadians(L.longitude,L.latitude,0),y<w&&(y=w),R=jSi(T,b,D),C=C+R*(E-o+B-o+w-o)/3;let P=qSi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:ee.fromRadians(P.longitude,P.latitude,y+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:y,volume:C}};var rre=nd;function Ent(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=Ae(A.color,new ct(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new Li("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 XSi(o,A){let f=Xt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,y=m,x=C,v=A;for(let I=1;I<o.length;I++){let E=Xt.fromCartesian(o[I]);m>E.longitude?m=E.longitude:y<E.longitude&&(y=E.longitude),C>E.latitude?C=E.latitude:x<E.latitude&&(x=E.latitude)}return new ee.fromRadians((m+y)/2,(C+x)/2,v)}function ZSi(o){if(N(o._pps))return;let A=XSi(o._positions,o._minHeight),f=Xt.fromCartesian(A),m=new ti(A.x,A.y,A.z,1),C=new Xt(f.longitude,f.latitude,o.maxHeight+100),y=Xt.toCartesian(C),x=new ti(y.x,y.y,y.z,1),v=new ti,I=new ti,E=new ee,B=o.mEarthCtrl.coreMap.scene.camera,w=o._positions.length;o._pps=new Aa({fragmentShader:eDi(w),uniforms:{u_floodCenterEC:function(){return Xe.multiplyByVector(B._viewMatrix,m,v)},u_floodPlaneNormalEC:function(){let b=Xe.multiplyByVector(B._viewMatrix,m,v),D=Xe.multiplyByVector(B._viewMatrix,x,I);return E.x=D.x-b.x,E.y=D.y-b.y,E.z=D.z-b.z,ee.normalize(E,E),E},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 $Si(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function eDi(o){return`uniform sampler2D colorTexture; |
| | | `})};Sk.prototype.destroy=function(){this._tileset.customShader===this._customShader&&(this._customShader=void 0,this._tileset.customShader=void 0),this._scene.preUpdate.removeEventListener(this._preUpdate)};function dSi(){this.customShaders={},this.customShaders.lightLine=Sk}var rnt=dSi;function WG(o,A){this.options=Ae(A,{}),this.earthCtrl=o,this.viewer=o.coreMap,this.CSME=Gge,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()}WG.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))};WG.prototype.addStage=function(o){let A=this;A.Cust.addStage(o),A.stageArr.push(o)};WG.prototype.removeStage=function(o){this.Cust.removeStage(o.name)};WG.prototype.update=function(){let o=this;o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=o.viewer.scene.preUpdate.addEventListener(()=>{o.Cust.update()})};WG.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 nnt=WG;function Zie(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._options.visibleEdgeColor=Ae(A.visibleEdgeColor,ct.WHITE),this._options.outlineWidth=Ae(A.outlineWidth,1),this._options.thresholdAngle=Ae(A.thresholdAngle,12*Math.PI/180),this.add()}Zie.prototype.add=function(){this._edgeStage=Mye();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)};Zie.prototype.removeFromMap=function(){this._edgeStage&&(this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage),this.__edgeStage=null)};Object.defineProperties(Zie.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)}}});var ont=Zie;function Bs(o){this._earthCtrl=o,this._coreMap=o.coreMap}function My(){return((1+je.nextRandomNumber())*65536|0).toString(16).substring(1)}Bs.createUUID=function(){return`${My()+My()}-${My()}-${My()}-${My()}-${My()}${My()}${My()}`};Bs.createUUIDWithoutDash=function(){return My()+My()+My()+My()+My()+My()+My()+My()};Bs.prototype.createUUID=function(){return Bs.createUUID()};Bs.prototype.createGroup=function(o){let A=new bk;return A.id=o.id||Bs.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};Bs.prototype.createImageryLayer=function(o,A){let f=new kie(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(_s.IMAGERYPROVIDERS),f),f};Bs.prototype.createTerrainLayer=function(o,A){let f=new Uie(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(_s.TERRAINPROVIDERS),f),f};Bs.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new gL({})};Bs.prototype.createFeatureLayer=function(o,A){let f=new zie(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(_s.FEATURELAYERS),f),f};Bs.prototype.createModelLayer=function(o,A){let f=new Hie(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(_s.MODELLAYERS),f),f};Bs.prototype.createWfsModel=function(o,A){let f=new vz(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(_s.MODELLAYERS),f),f};Bs.prototype.createModel=function(o,A){let f=new pie(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(_s.USERSCENE),f),f};Bs.prototype.removeModel=function(o){N(o)&&o.removeFromMap()};Bs.prototype.createCZMLObject=function(o,A){let f=this,m=Ae(o.addToMap,!0),C=new yee(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(_s.USERSCENE),C),C};Bs.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,N(o.name)&&(A.name=o.name),N(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};Bs.prototype.removeElement=function(o){N(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};Bs.prototype.createVideoProjection=function(o,A){o.addToMap=Ae(o.addToMap,!0);let f=Ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new tie(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(_s.USERSCENE),m)):f==="panorama"?(m=new Urt(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(_s.USERSCENE),m)):f==="fisheye"&&(m=new iie(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(_s.USERSCENE),m)),m};Bs.prototype.createTrack=function(o,A){let f=new Grt(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(_s.USERSCENE),f),f};Bs.prototype.createSceneNode=function(o,A,f){let m=new bk(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};Bs.prototype.createFire=function(o,A){let f=new oie(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(_s.USERSCENE),f),f};Bs.prototype.createSmoke=function(o,A){let f=new sie(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(_s.USERSCENE),f),f};Bs.prototype.createExplosion=function(o,A){let f=new uie(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(_s.USERSCENE),f),f};Bs.prototype.createFireworks=function(o,A){let f=new cie(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(_s.USERSCENE),f),f};Bs.prototype.createRadarScan=function(o,A){let f=new hie(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(_s.USERSCENE),f),f};Bs.prototype.createCircleScan=function(o,A){let f=new Jrt(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(_s.USERSCENE),f),f};Bs.prototype.createUpDownScan=function(o){let A=new qrt(this._earthCtrl,o);return A.show=!0,A};Bs.prototype.createWaters=function(o,A){let f=new Wie(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(_s.USERSCENE),f),f};Bs.prototype.createHeatmap=function(o,A){let f=Hrt.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(_s.USERSCENE),f),f};Bs.prototype.createLabel=function(o,A){let f=new Cie(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(_s.USERSCENE),f),f};Bs.prototype.createBillboard=function(o,A){let f=new die(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(_s.USERSCENE),f),f};Bs.prototype.createPolyline=function(o,A){let f=new xie(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(_s.USERSCENE),f),f};Bs.prototype.createPolygon=function(o,A){let f=new Iie(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(_s.USERSCENE),f),f};Bs.prototype.createPoint=function(o,A){let f=new _ie(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(_s.USERSCENE),f),f};Bs.prototype.createBox=function(o,A){let f=new bie(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(_s.USERSCENE),f),f};Bs.prototype.createEllipsoid=function(o,A){let f=new Die(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(_s.USERSCENE),f),f};Bs.prototype.createCylinder=function(o,A){let f=new Qie(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(_s.USERSCENE),f),f};Bs.prototype.createRectangle=function(o,A){let f=new Mie(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(_s.USERSCENE),f),f};Bs.prototype.createEllipse=function(o,A){let f=new Rie(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(_s.USERSCENE),f),f};Bs.prototype.createPolylineVolume=function(o,A){let f=new Fie(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(_s.USERSCENE),f),f};Bs.prototype.createEChartLayer=function(o,A){let f=new Yie(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(_s.USERSCENE),f),f};Bs.prototype.createPointLight=function(o){return new Xrt(this._earthCtrl,o)};Bs.prototype.createHawkeye=function(o){let A=new qie(this._earthCtrl,o);A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&A.addToMap(o)};Bs.prototype.createSpotLight=function(o){let A=new Xie(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Bs.prototype.createCustomShaderManager=function(o){let A=new rnt;return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Bs.prototype.createCustomShaderStage=function(o){let A=new nnt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Bs.prototype.createModelOutline=function(o={}){let A=new ont(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};var GS=Bs;var $ie=class extends vg{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new eie(A);let m=new bk(A);m.id=GS.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 vL("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];N(f)&&this.removeChild(f)}removeChild(A){N(A)&&N(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){N(A)&&N(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);N(m)&&N(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,I=[];for(let E in x){let B=x[E],w=f.rootNode.getChildByName(B);if(!w)continue;let T=[];if(w.childNodes.length===0)T=[];else for(let b=0;b<w.childNodes.length;b++){let D=w.childNodes[b].toJSON();T.push(D)}Promise.all(T).then(function(b){let D=[];if(b.length!==0){for(let R=0;R<b.length;R++)D.push(b[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let L={item:S,objJson:D};I.push(L)}v++,v===5&&(C(I),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 B=0;B<C.length;B++)C[B].item==="IMAGERY_LAYER"&&(y.imageryProviders=C[B].objJson),C[B].item==="TERRAIN_LAYER"&&(y.terrainProviders=C[B].objJson),C[B].item==="MODEL_LAYER"&&(y.modelLayers=C[B].objJson),C[B].item==="FEATURE_LAYER"&&(y.featureLayers=C[B].objJson),C[B].item==="USER_SCENE"&&(y.userScene=C[B].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)},I={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(I);let E=JSON.stringify(y);A&&A(E)})}};Object.defineProperties($ie.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 ere=$ie;function ant(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var Uki=new Za,Gki=new ee,Hki=new ee;ant.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 zr(x).setInputAction(function(E){let B=A.camera.pickEllipsoid(E.endPosition,v);if(B){let w=A.scene.globe.ellipsoid.cartesianToCartographic(B),T=je.toDegrees(w.latitude).toFixed(6),b=je.toDegrees(w.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);y.innerHTML=`\u7ECF\u5EA6\uFF1A${b}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${T}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},qi.MOUSE_MOVE)};var snt=ant;function Nl(){}Nl.parseBaseData=function(o,A){let f=[];if(N(A)&&N(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(N(y.tilingScheme)){let v=y.tilingScheme;v.type==="GeographicTilingScheme"&&(y.tilingScheme=new Ld(v))}let x=GS.createImageryLayer(y);f.push(x)}let m=[];if(N(A)&&N(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=GS.createTerrainLayer(y);m.push(x)}return{imageryProvider:f,terrainProvider:m}};Nl.parse=function(o,A){if(!N(A))return;let f=[_s.IMAGERYPROVIDERS,_s.TERRAINPROVIDERS,_s.MODELLAYERS,_s.FEATURELAYERS,_s.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(GS.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}N(A[_s.IMAGERYPROVIDERS])&&qG(o,A[_s.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),N(A[_s.TERRAINPROVIDERS])&&qG(o,A[_s.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),N(A[_s.MODELLAYERS])&&qG(o,A[_s.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),N(A[_s.FEATURELAYERS])&&qG(o,A[_s.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),N(A[_s.USERSCENE])&&qG(o,A[_s.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function qG(o,A,f,m){for(let C=0;C<A.length;C++){let y=A[C],x=null;if(y.enable===!1)continue;N(y.class)?(y.class==="IMAGERY"&&(y.class=no.IMAGERY_LAYER),y.class==="TERRAIN"&&(y.class=no.TERRAIN_LAYER),x=y.class):(m===0?y.class=no.IMAGERY_LAYER:m===1&&(y.class=no.TERRAIN_LAYER),x=y.class);let v=Nl.parserMap[x];v!==void 0&&v(o,y,f)}}function gSi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=Ae(A.show,!0),o.userScene.addChild(f,m),N(A.childNodes)&&qG(o,A.childNodes,m)}function pSi(o,A,f){let m=A;if(N(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new Ld(C))}o.factory.createImageryLayer(m,f)}function mSi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function CSi(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 ySi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function xSi(o,A,f){o.coreMap.scene.skyBox=new mk({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function vSi(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 ISi(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 ESi(o,A,f){o.factory.createModel(A,f)}function _Si(o,A,f){o.factory.createWaters(A,f)}function BSi(o,A,f){o.factory.createExplosion(A,f)}function bSi(o,A,f){o.factory.createFireworks(A,f)}function wSi(o,A,f){o.factory.createSmoke(A,f)}function QSi(o,A,f){o.factory.createFire(A,f)}function SSi(o,A,f){A.color&&(A.color=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function DSi(o,A,f){A.color&&(A.color=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function TSi(o,A,f){A.color&&(A.color=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function MSi(o,A,f){A.fillColor&&(A.fillColor=new ct(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function PSi(o,A,f){o.factory.createBillboard(A,f)}function RSi(o,A,f){A.positions&&(A.positions=Nl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new ct(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function LSi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=Nl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function FSi(o,A,f){A.coordinates&&(A.coordinates=bi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new ct(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function NSi(o,A,f){o.factory.createEllipse(A,f)}function kSi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=ee.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new ee(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function OSi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=ee.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new ee(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function USi(o,A,f){A.material&&(A.material=new ct(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ct(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=ee.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function GSi(o,A,f){o.factory.createPolylineVolume(A,f)}function HSi(o,A,f){o.factory.createVideoProjection(A,f)}function VSi(o,A,f){o.factory.createVideoProjection(A,f)}function zSi(o,A,f){o.factory.createTrack(A,f)}function KSi(o,A,f){o.factory.createHeatmap(A,f)}function YSi(o,A,f){o.factory.createEChartLayer(A,f)}function JSi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}Nl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=ee.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};Nl.parserMap={};Nl.parserMap[no.NODE]=gSi;Nl.parserMap[no.IMAGERY_LAYER]=pSi;Nl.parserMap[no.TERRAIN_LAYER]=mSi;Nl.parserMap[no.MODEL_LAYER]=CSi;Nl.parserMap[no.FEATURE_LAYER]=ySi;Nl.parserMap[no.SKYBOX]=xSi;Nl.parserMap[no.ENVIRONMENT]=vSi;Nl.parserMap[no.VIEWPOINT]=ISi;Nl.parserMap[no.MODEL]=ESi;Nl.parserMap[no.WATERS]=_Si;Nl.parserMap[no.EXPLOSION]=BSi;Nl.parserMap[no.FIREWORK]=bSi;Nl.parserMap[no.SMOKE]=wSi;Nl.parserMap[no.FIRE]=QSi;Nl.parserMap[no.RADARSCAN]=SSi;Nl.parserMap[no.CIRCLESCAN]=DSi;Nl.parserMap[no.POINT]=TSi;Nl.parserMap[no.LABEL]=MSi;Nl.parserMap[no.BILLBOARD]=PSi;Nl.parserMap[no.POLYLINE]=RSi;Nl.parserMap[no.POLYGON]=LSi;Nl.parserMap[no.RECTANGLE]=FSi;Nl.parserMap[no.ELLIPSE]=NSi;Nl.parserMap[no.BOX]=kSi;Nl.parserMap[no.ELLIPSOID]=OSi;Nl.parserMap[no.CYLINDER]=USi;Nl.parserMap[no.POLYLINEVOLUME]=GSi;Nl.parserMap[no.PERSPECTIVE_VIDEO_PROJECTION]=HSi;Nl.parserMap[no.FISHEYE_VIDEO_PROJECTION]=VSi;Nl.parserMap[no.TRACK]=zSi;Nl.parserMap[no.HEATMAP]=KSi;Nl.parserMap[no.ECHARTLAYER]=YSi;Nl.parserMap.ELEMENT=JSi;var lnt=Nl;var fxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,N(this.editBillboard)&&N(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:((N(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(N(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(N(A)&&N(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]:N(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},unt=fxe;var dxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,N(this.editPoint)&&N(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:((N(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(N(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(N(A)&&N(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]:N(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},Ant=dxe;var gxe=class extends wa{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,N(this.editBox)&&N(this.editBox.entity.box)){let y=this.editBox.entity.position._value,x=Xt.fromCartesian(y);this.height=x.height;let v=new ee,I=new ee;this.getNorthPointByDistance(v,I),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:v,point:{heightReference:this.editBox.entity.box.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:I,point:{heightReference:this.editBox.entity.box.heightReference,color:ct.RED,pixelSize:12,outlineColor:ct.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=Xt.fromCartesian(f);return this.height=m.height+A,ee.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),N(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let y=Tn.eastNorthUpToFixedFrame(C),x=new ee,v=this.editBox.entity.box.dimensions._value;v||(v=this.editBox.entity.box.dimensions.getValue(m)),ee.divideByScalar(v,2,x),ee.clone(x,A),ee.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:((N(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=ui.fromDate(f);if(N(this.currentPoint)||N(this.pickEditHeightPoint)||N(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,y=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!y)return;let x=Xt.fromCartesian(y),v=ee.fromRadians(x.longitude,x.latitude,x.height+this.height);if(N(this.currentPoint))this.currentPoint.position=v,this.editBox.entity.position=new wn(function(){return v},!1);else if(N(this.dragPosition)){if(N(this.pickEditWHPoint)){let B=ee.subtract(y,this.dragPosition,new ee),w=ee.normalize(B,new ee);ee.dot(B,w,B);let T=this.editBox.entity.box.dimensions._value;T||(T=this.editBox.entity.box.dimensions.getValue(m));let b=ee.clone(T);b.x-=B.x,b.y+=B.y,ee.abs(b,b),this.editBox.entity.box.dimensions=new wn(function(){return b},!1)}else if(N(this.pickEditHeightPoint)){let B=ee.subtract(y,this.dragPosition,new ee),w=this.editBox.entity.box.dimensions._value;w||(w=this.editBox.entity.box.dimensions.getValue(m));let T=ee.clone(w);T.z+=B.z,ee.abs(T,T),this.editBox.entity.box.dimensions=T,this.editBox.entity.position=this.addHeight(B.z/2)}}this.dragPosition=y;let I=new ee,E=new ee;this.getNorthPointByDistance(I,E,m),this.editHeightPoint.position=I,this.editWHPoint.position=E}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(N(A)&&N(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]:N(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=[]}},cnt=gxe;var pxe=class extends wa{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,N(this.editCylinder)&&N(this.editCylinder.entity.cylinder)){let y=this.editCylinder.entity.position._value,x=Xt.fromCartesian(y);this.height=x.height;let v=this.editCylinder.entity.cylinder.topRadius._value,I=this.editCylinder.entity.cylinder.bottomRadius._value,E=new ee,B=new ee,w=new ee;this.getNorthPointByDistance(E,B,w),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),v>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:E,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ct.RED,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),I>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:B,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ct.RED,pixelSize:12,outlineColor:ct.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=Xt.fromCartesian(f);return this.height=m.height+A,ee.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,y=Tn.eastNorthUpToFixedFrame(C),x=this.editCylinder.entity.cylinder.length._value,v=this.editCylinder.entity.cylinder.topRadius._value,I=this.editCylinder.entity.cylinder.bottomRadius._value;v>0&&(A.z+=x/2,A.x+=v,Xe.multiplyByPoint(y,A,A)),I>0&&(f.x+=I,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:((N(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(N(this.currentPoint)||N(this.heightPoint)||N(this.topRadiusPoint)||N(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=ee.fromRadians(C.longitude,C.latitude,C.height+this.height);if(N(this.currentPoint))this.currentPoint.position=y,this.editCylinder.entity.position=y;else if(N(this.dragPosition)){if(N(this.pickHeightPoint)){let w=ee.subtract(m,this.dragPosition,new ee),T=this.editCylinder.entity.cylinder.length._value;T+=w.z,T=Math.abs(T),this.editCylinder.entity.position=this.addHeight(w.z/2),this.editCylinder.entity.cylinder.length=T}else if(N(this.pickTopRadiusPoint)){let w=ee.subtract(m,this.dragPosition,new ee),T=this.editCylinder.entity.cylinder.topRadius._value;T-=w.x,T=Math.abs(T),this.editCylinder.entity.cylinder.topRadius=T}else if(N(this.pickBottomRadiusPoint)){let w=ee.subtract(m,this.dragPosition,new ee),T=this.editCylinder.entity.cylinder.bottomRadius._value;T-=w.x,T=Math.abs(T),this.editCylinder.entity.cylinder.bottomRadius=T}}this.dragPosition=m;let x=this.editCylinder.entity.cylinder.topRadius._value,v=this.editCylinder.entity.cylinder.bottomRadius._value,I=new ee,E=new ee,B=new ee;this.getNorthPointByDistance(I,E,B),x>0&&(this.topRadiusPoint.position=I),v>0&&(this.bottomRadiusPoint.position=E),this.heightPoint.position=B}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(N(A)&&N(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]:N(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=[]}},hnt=pxe;var mxe=class extends wa{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,N(this.editEllipse)&&N(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:ct.WHITE,pixelSize:12,outlineColor:ct.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 ee,m=new ee,C=new ee,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,I=this.semiMajorAxis*this.semiMajorAxis,E=this.semiMajorAxis*this.semiMinorAxis,B=ee.magnitude(this.center),w=ee.normalize(this.center,f),T=ee.cross(ee.UNIT_Z,this.center,m);T=ee.normalize(T,T);let b=ee.cross(w,T,C),D=new ee;return GB.pointOnEllipsoid(A,x,b,T,v,E,I,B,w,D)}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:((N(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(N(this.currentPoint)||N(this.pickSemiMajorAxisPoint)||N(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(N(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(N(this.pickSemiMajorAxisPoint)){let C=ee.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(N(this.pickSemiMinorAxisPoint)){let C=ee.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(N(A)&&N(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]:N(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=[]}},fnt=mxe;var Cxe=class extends wa{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,N(this.editEllipsoid)&&N(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let y=this.editEllipsoid.entity.position._value,x=Xt.fromCartesian(y);this.height=x.height;let v=new ee,I=new ee,E=new ee;this.getNorthPointByDistance(v,I,E),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:I,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:E,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ct.WHITE,pixelSize:12,outlineColor:ct.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=Xt.fromCartesian(f);return this.height=m.height+A,ee.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,y=Tn.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:((N(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(N(this.currentPoint)||N(this.pickRadiiXPoint)||N(this.pickRadiiYPoint)||N(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=ee.fromRadians(C.longitude,C.latitude,C.height+this.height);if(N(this.currentPoint))this.currentPoint.position=y,this.editEllipsoid.entity.position=y;else{if(N(this.dragPosition)){let E=ee.subtract(m,this.dragPosition,new ee),B=ee.normalize(E,new ee);ee.dot(E,B,E);let w=this.editEllipsoid.entity.ellipsoid.radii._value,T=ee.clone(w);N(this.pickRadiiXPoint)?T.x-=E.x:N(this.pickRadiiYPoint)?T.y+=E.y:N(this.pickRadiiZPoint)&&(T.z+=E.z,this.editEllipsoid.entity.position=this.addHeight(E.z)),ee.abs(T,T),this.editEllipsoid.entity.ellipsoid.radii=T}this.dragPosition=m}let x=new ee,v=new ee,I=new ee;this.getNorthPointByDistance(x,v,I),this.radiiXPoint.position=x,this.radiiYPoint.position=v,this.radiiZPoint.position=I}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(N(A)&&N(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]:N(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=[]}},dnt=Cxe;var yxe=class extends wa{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,N(this.editPolygon)&&N(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:ct.WHITE,pixelSize:8,outlineColor:ct.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:((N(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(N(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(N(A)&&N(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];N(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=[]}},gnt=yxe;var xxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=ct.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,N(this.editModel)&&N(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:((N(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(N(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=Xt.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(N(A)&&N(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(N(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}},pnt=xxe;var vxe=class extends wa{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,N(this.editLabel)&&N(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:((N(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(N(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(N(A)&&N(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]:N(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},mnt=vxe;var Ixe=class extends wa{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,N(this.editPolyline)&&N(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:ct.WHITE,pixelSize:8,outlineColor:ct.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:((N(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(N(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(N(A)&&N(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];N(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=[]}},Cnt=Ixe;var Exe=class extends wa{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,N(this.editPolylineVolume)&&N(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:ct.WHITE,pixelSize:12,outlineColor:ct.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:((N(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(N(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(N(A)&&N(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]:N(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=[]}},ynt=Exe;var _xe=class extends wa{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,N(this.editRectangle)&&N(this.editRectangle.entity.rectangle)){let y=this.editRectangle.entity.rectangle.coordinates._value,x=this.editRectangle.entity.rectangle.height._value,v=bi.northwest(y),I=ee.fromRadians(v.longitude,v.latitude,x),E=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:I,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ct.WHITE,pixelSize:8,outlineColor:ct.BLACK,outlineWidth:1}});this.pointsId.push(E.id),v=bi.southeast(y);let B=ee.fromRadians(v.longitude,v.latitude,x),w=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:B,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ct.WHITE,pixelSize:8,outlineColor:ct.BLACK,outlineWidth:1}});this.pointsId.push(w.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:((N(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(N(this.leftTopPoint)||N(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Xt.fromCartesian(m),y=this.editRectangle.entity.rectangle.coordinates._value;N(this.leftTopPoint)?(this.leftTopPoint.position=m,y.west=C.longitude,y.north=C.latitude):N(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(N(A)&&N(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]:N(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=[]}},xnt=_xe;function Jh(o){this._earthCtrl=o,this._coreMap=o.coreMap}Jh.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ant(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Jh.prototype.updatePoint=function(o,A){o.updatePoint(A)};Jh.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new Cnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Jh.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Jh.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new gnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Jh.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Jh.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new cnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Jh.prototype.updateBox=function(o,A){o.updateBox(A)};Jh.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new dnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Jh.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Jh.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new hnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Jh.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Jh.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new pnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Jh.prototype.updateModel=function(o,A){o.updateModel(A)};Jh.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new unt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Jh.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Jh.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new mnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Jh.prototype.updateLabel=function(o,A){o.updateLabel(A)};Jh.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new xnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Jh.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Jh.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new fnt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Jh.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Jh.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new ynt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Jh.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Jh.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 tre=Jh;function IC(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}IC.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],y="",x=[],v,I=this.scene.globe.ellipsoid,E={spot:[],distance:[],label:[],polyline:[]},B={point:ct.RED,polyline:ct.fromRgba(4286644096)};N(A)&&(N(A.point)&&(B.point=A.point),N(A.polyline)&&(B.polyline=A.polyline));let w=new GE;this.scene.primitives.add(w);let T=new mc,b=new zr(f.scene.canvas),D=document.createElement("div");BA(".map-widget",D),BA(".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;m=!0;let P=function(V){let G=0,W=`${0}\u7C73`,te,Z,ne,re,ae,ue;for(let Y=0;Y<V.length-1;Y+=1)te=I.cartesianToCartographic(V[Y]),Z=T.project(te),ne=Z.x,re=Z.y,te=I.cartesianToCartographic(V[Y+1]),Z=T.project(te),ae=Z.x,ue=Z.y,G=G+Math.sqrt((ne-ae)*(ne-ae)+(re-ue)*(re-ue));return G>0&&(W=`${G.toFixed(2)}\u7C73`),G/1e3>=1&&(W=`${(G/1e3).toFixed(2)}\u5343\u7C73`),W},k=function(){function V(G){if(!N(G))throw new Li("positions is required!");if(G.length<2)throw new Li("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let W=Jo.fromType(Jo.ColorType);W.uniforms.color=new ct(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:B.polyline,width:3,clampToGround:!1}},this.path=G,this._init()}return V.prototype._init=function(){let G=this,W=function(){return G.path};this.options.polyline.positions=new wn(W,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,E.polyline.push(this.lineEntity)},V}();b.setInputAction(function(V){let G,W;L.style.left=`${V.endPosition.x+10}px`,L.style.top=`${V.endPosition.y+20}px`,L.style.display="block",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 te=!1,Z=f.camera.getPickRay(V.endPosition);Z&&(G=f.scene.globe.pick(Z,f.scene));let ne=f.scene.pick(V.endPosition);if(ne){console.log("feature",ne);let re=f.scene.pickPosition(V.endPosition);re&&(G=re),te=!0}if(!!G&&(W=Ti.WGS84.cartesianToCartographic(G),W)){let re;te?re=f.scene.sampleHeight(W):re=f.scene.globe.getHeight(W);let ae=ee.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,re);if(m){if(C.length<1)return;N(v)?(v.path.pop(),v.path.push(ae)):(C.push(ae),v=new k(C));let ue=P(v.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v.path[v.path.length-1],label:{text:`\u603B\u957F\uFF1A${ue}`,show:!0,font:"26px \u6977\u4F53",fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},qi.MOUSE_MOVE);let U=function(V){x.push(V);let G=[];if(x.length>1){let W=x[x.length-2],te=x[x.length-1],Z=Math.abs(W.longitude-te.longitude)*1e7,ne=Math.abs(W.latitude-te.latitude)*1e7;Z>ne&&(ne=Z);let re=parseInt(ne/10);re>1e3&&(re=1e3),re<2&&(re=2);for(let ae=0;ae<re;++ae)G.push(new Xt(je.lerp(W.longitude,te.longitude,ae/(re-1)),je.lerp(W.latitude,te.latitude,ae/(re-1))));G.push(te.clone())}else G=x;if(G.length>0)for(let W=0;W<G.length;W++){V=G[W];let te=f.scene.globe.getHeight(V),Z=ee.fromDegrees(V.longitude/Math.PI*180,V.latitude/Math.PI*180,te);C.push(Z)}};return b.setInputAction(function(V){let G,W,te=!1,Z=f.camera.getPickRay(V.position);if(Z&&(G=f.scene.globe.pick(Z,f.scene)),f.scene.pick(V.position)){let re=f.scene.pickPosition(V.position);re&&(G=re),te=!0}if(G&&(W=Ti.WGS84.cartesianToCartographic(G)),W){let re;te?re=f.scene.sampleHeight(W):re=f.scene.globe.getHeight(W);let ae=ee.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,re);if(m){v&&v.path.pop(),U(W);let ue="0\u7C73";v&&(ue=P(v.path),ae=v.path[v.path.length-1]),y=ue,E.spot.push(ae),E.distance.push(ue);let Y=f.entities.add({position:ae,point:{pixelSize:5,color:B.point,outlineColor:ct.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ue,show:!0,font:"26px \u6977\u4F53",fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});E.label.push(Y),f._points.push(Y)}}},qi.LEFT_CLICK),b.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=y,b.destroy(),C.pop(),N(o)&&typeof o=="function"&&o(E),L.style.display="none"},qi.RIGHT_CLICK),this};IC.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new zr(f.scene.canvas),C=[],y=null,x="0\u7C73",v=null,I,E="",B,w=document.createElement("div");BA(".map-widget",w),BA(".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 D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:ct.RED,polyline:ct.fromRgba(4286644096)};N(A)&&(N(A.point)&&(S.point=A.point),N(A.polyline)&&(S.polyline=A.polyline));let L=function(){function R(P){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=P,this._init()}return R.prototype._init=function(){let P=this,k=function(){return P.positions};this.options.polyline.positions=new wn(k,!1);let U=f.entities.add(this.options);f.item=U,D.ployline.push(U);let V=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${V}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let P=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);P[0]===0?v=f.scene.pickPosition(R.endPosition):v=new ee(P[0],P[1],P[2]),console.log("????????",v)}else v=f.scene.pickPosition(R.endPosition);!v||(b.style.left=`${R.endPosition.x+10}px`,b.style.top=`${R.endPosition.y+20}px`,b.style.display="block",C.length>=2&&(N(y)?(C.pop(),C.push(v)):y=new L(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(B),B=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:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},qi.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let k=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);k[0]===0?v=f.scene.pickPosition(R.position):v=new ee(k[0],k[1],k[2]),console.log("????????",v)}else v=f.scene.pickPosition(R.position);if(!v)return;C.length===0&&C.push(v.clone()),C.push(v);let P=x;E=`\u603B\u957F\uFF1A${x}`,I=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:ct.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:P,show:!0,font:"26px \u6977\u4F53",fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-20),heightReference:hn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(I),D.spot.push(v),D.distance.push(x),D.label.push(I)},qi.LEFT_CLICK),m.setInputAction(function(R){b.style.display="none",f.entities.remove(B),f._points.length>0&&(f._points[f._points.length-1].label.text=E),m.destroy(),C.pop(),N(o)&&typeof o=="function"&&o(D)},qi.RIGHT_CLICK),this};IC.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Xt.fromCartesian(o[m]),y=Xt.fromCartesian(o[m+1]),x=new N0;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};IC.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new zr(f.scene._imageryLayerCollection),y=document.getElementById("toolTip");y||(BA(".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={},I=[],E=[],B=null,w=null,T,b={point:ct.RED,polyline:ct.fromRgba(4286644096),polygon:ct.fromRgba(4286644096).withAlpha(.5)};N(A)&&(N(A.point)&&(b.point=A.point),N(A.polyline)&&(b.polyline=A.polyline),N(A.polygon)&&(b.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};y.style.display="block";let S=function(){function L(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:b.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return L.prototype._init=function(){let R=this,P=function(){return R.hierarchy};this.options.polygon.hierarchy=new wn(P,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},L}();return C.setInputAction(function(L){if(y.style.left=`${L.endPosition.x+10}px`,y.style.top=`${L.endPosition.y+20}px`,f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(L.endPosition.x,L.endPosition.y);V[0]===0?w=f.scene.pickPosition(L.endPosition):w=new ee(V[0],V[1],V[2])}else w=f.scene.pickPosition(L.endPosition);if(!w)return;let R=Xt.fromCartesian(w),P=je.toDegrees(R.longitude),k=je.toDegrees(R.latitude),U=R.height;if(x.length>=2){N(B)?(x.pop(),x.push(w),v=new zn(x),E.pop(),E.push({lon:P,lat:k,hei:U})):(v=new zn(x),B=new S(v));let V=f.getArea(E,x);f.entities.remove(T),T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:V,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=T}},qi.MOUSE_MOVE),C.setInputAction(function(L){if(f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(L.position.x,L.position.y);V[0]===0?w=f.scene.pickPosition(L.position):w=new ee(V[0],V[1],V[2])}else w=f.scene.pickPosition(L.position);if(!w)return;let R=Xt.fromCartesian(w);console.log("\u5DE6\u952E\u70B9",R);let P=je.toDegrees(R.longitude),k=je.toDegrees(R.latitude),U=R.height;x.length===0&&(x.push(w.clone()),v=new zn(x),E.push({lon:P,lat:k,hei:U}),x.push(w.clone()),v=new zn(x),E.push({lon:P,lat:k,hei:U})),x.push(w),v=new zn(x),I.push({lon:P,lat:k,hei:U}),E.push({lon:P,lat:k,hei:U})},qi.LEFT_CLICK),C.setInputAction(function(L){y.style.display="none",f.entities.remove(T),C.destroy();let R=f.getArea(E,x);m=R;let P=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(P),f._lable=P,D.mj=m,D.label=P,N(o)&&typeof o=="function"&&o(D)},qi.RIGHT_CLICK),this};IC.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,y=[],x={},v,I=f.scene,E=I.globe.ellipsoid,B=new GE;I.primitives.add(B);let w,T,b=0,D={point:ct.RED,polyline:ct.fromRgba(4286644096),polygon:ct.fromRgba(4286644096).withAlpha(.5)};N(A)&&(N(A.point)&&(D.point=A.point),N(A.polyline)&&(D.polyline=A.polyline),N(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");BA(".map-widget",S),BA(".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 R=document.getElementById("toolTip");R.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 P=new zr(I.canvas),k=function(){function V(G){if(!N(G))throw new Li("positions is required!");if(G.length<3)throw new Li("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=G,this._init()}return V.prototype._init=function(){let G=this,W=function(){return G.path};this.options.polygon.hierarchy=new wn(W,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},V}();P.setInputAction(function(V){let G=0;f.entities.remove(T);let W,te,Z=f.scene.camera.getPickRay(V.endPosition);Z&&(W=f.scene.globe.pick(Z,f.scene));let ne=f.scene.pick(V.endPosition),re=!1;if(ne){let ue=f.scene.pickPosition(V.endPosition);ue&&(W=ue),re=!0}if(!W)return;let ae=function(ue){let Y=new Array(ue.length),ce=function(ve){return ve.longitude=ve.longitude/Math.PI*180,ve.latitude=ve.latitude/Math.PI*180,ve},me=function(ve){let be=0;for(let _e=0;_e<ve.length;_e++){let pe=ve[_e],H;_e<ve.length-1?H=ve[_e+1]:H=ve[0],be+=pe.x*H.y-H.x*pe.y}return be/2};for(let ve=0;ve<ue.length;ve++)Y[ve]=ce(E.cartesianToCartographic(ue[ve]));let Ie=0;for(let ve=0;ve<Y.length;ve++)Ie+=Y[ve].longitude;Ie=Ie/Y.length;for(let ve=0;ve<Y.length;ve++)Y[ve]=f.Gauss_to_XY(Y[ve].longitude,Y[ve].latitude,Ie);return Math.abs(me(Y))};if(te=Ti.WGS84.cartesianToCartographic(W),te&&C){if(R.style.left=`${V.endPosition.x+10}px`,R.style.top=`${V.endPosition.y+20}px`,R.style.display="block",y.length<2){b===1&&(T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:`${G}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(T),m.label=T);return}if(N(v)?(v.path.positions.pop(),v.path.positions.push(W)):(y.push(W),x=new zn(y),v=new k(x)),y.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ue=String(ae(v.path.positions));ue=ue.substr(0,ue.indexOf(".",0)),ue.length<6?G=`${ue}\u5E73\u65B9\u7C73`:(ue=String(ue/1e6),ue=ue.substr(0,ue.indexOf(".",0)+3),G=`${ue}\u5E73\u65B9\u5343\u7C73`),m.mj=G,T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:G,font:"26px \u6977\u4F53",show:!0,fillColor:ct.WHITE,style:$A.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:fn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:hn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(T),m.label=T}}},qi.MOUSE_MOVE),P.setInputAction(function(V){let G;b=1;let W=f.scene.camera.getPickRay(V.position);W&&(G=f.scene.globe.pick(W,f.scene));let te=f.scene.pick(V.position),Z=!1;if(te){let ne=f.scene.pickPosition(V.position);ne&&(G=ne),Z=!0}G&&C&&(y.push(G),x=new zn(y))},qi.LEFT_CLICK),P.setInputAction(function(){P.removeInputAction(qi.LEFT_CLICK),P.removeInputAction(qi.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,w=B.add({show:!0,id:"measureTool",position:y[y.length-1],pixelOffset:new wt(0,20),eyeOffset:new ee(0,0,0),horizontalOrigin:NA.CENTER,verticalOrigin:fn.CENTER,scale:1,color:new ct(1,1,1,1)}),R.style.display="none",P.destroy(),N(o)&&typeof o=="function"&&o(m)},qi.RIGHT_CLICK);let U=function(V){let G=0,W=0,te=0;for(let ne=0;ne<V.length;ne++)G+=V[ne].x,W+=V[ne].y,te+=V[ne].z;return new ee(G/V.length,W/V.length,te/V.length)};return this};IC.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))};IC.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,y,x,v,I;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,I=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)+I/8*Math.sin(8*o))};IC.prototype.to_Radian=function(o){return o*Math.PI/180};IC.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,y=Math.sqrt(6378137*6378137-C*C)/C,x=0,v=0,I=0,E=0,B=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let w=o-B,T=Math.cos(A);E=this.to_N(A),I=E*Math.cos(A),x=Math.tan(A),v=y*T;let b=Math.pow(x,2),D=Math.pow(x,4),S=Math.pow(v,2),L=Math.pow(v,4),R=Math.pow(T,3),P=Math.pow(T,5),k=this.to_Sm(A)+Math.pow(w,2)/2*I*T*x+Math.pow(w,4)/24*x*I*R*(5-b+9*S+4*L)+Math.pow(w,6)/720*x*I*P*(61-58*x*x+D+270*S-330*x*x*S),U=w*E*T+Math.pow(w,3)/6*E*R*(1-x*x+v*v)+Math.pow(w,5)/120*E*P*(5-18*x*x+D+14*S-58*S*b);return new wt(U,k)};IC.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]),I=this.getdistance(A[C],A[y]);f+=v*I*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};IC.prototype.getdistance=function(o,A){let f=Xt.fromCartesian(o),m=Xt.fromCartesian(A),C=new N0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};IC.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,I=-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 I<0&&(I+=Math.PI*2),I=I*m,I};IC.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};IC.prototype.getuid=function(){return this.uuid(8,16)};IC.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("")};IC.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 $7=IC;function n1(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=ee.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,ct.GREEN.withAlpha(.4)),this._invisibleAreaColor=Ae(A.invisibleAreaColor,ct.RED.withAlpha(.4)),this._size=Ae(A.size,10240),this._softShadows=Ae(A.softShadows,!0),this._colorStyle=Ae(A.colorStyle,ct.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(n1.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)}}});n1.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};n1.prototype.removeFromMap=function(){let o=this;N(o.viewShedMap)&&(o.viewShedMap.enabled=!1),N(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=[]};n1.prototype.visualConeShow=function(o){let A=this;N(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};n1.prototype.addVisualPyramid=function(){let o=this,A=new fz({radii:new wn(function(){return new ee(o._distance,o._distance,o._distance)},!1),minimumClock:new wn(function(){return je.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new wn(function(){return je.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new wn(function(){return je.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new wn(function(){return je.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new wn(function(){return o._colorStyle},!1)}),f=new ch({position:new wn(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};n1.prototype.createLightCamera=function(){N(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new cl(this._coreMap.scene),this._lightCamera.position=this._position};n1.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!N(o)&&(N(o.lon)||N(o.lat)||N(o.height)||N(o.heading)||N(o.pitch)||N(o.roll)||N(o.far)||N(o.distance)||N(o.verticalViewAngle)||N(o.horizontalViewAngle))){let m=this._parameter;for(let v in o)o.hasOwnProperty(v)&&N(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=ee.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}};n1.prototype.createShadowMap=function(){if(N(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new qz({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 Py=new ee;n1.prototype.drawViewCentrum=function(){let o=this;function A(){let E=o.pyramid._ellipsoid._minimumClock.getValue(),B=o.pyramid._ellipsoid._minimumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=new CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let f=this._earthCtrl.entities.add({polyline:{positions:new wn(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let E=o.pyramid._ellipsoid._maximumClock.getValue(),B=o.pyramid._ellipsoid._minimumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=new CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let C=this._earthCtrl.entities.add({polyline:{positions:new wn(m,!1),material:this._colorStyle}});this._lineArray.push(C);function y(){let E=o.pyramid._ellipsoid._minimumClock.getValue(),B=o.pyramid._ellipsoid._maximumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=new CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let x=this._earthCtrl.entities.add({polyline:{positions:new wn(y,!1),material:this._colorStyle}});this._lineArray.push(x);function v(){let E=o.pyramid._ellipsoid._maximumClock.getValue(),B=o.pyramid._ellipsoid._maximumCone.getValue(),w=o.pyramid._ellipsoid.radii.getValue(),T=Math.sin,b=Math.cos,D=T(B),S=b(B),L=T(E),R=b(E);Py.x=w.x*D*R,Py.y=w.y*D*L,Py.z=w.z*S;let P=CS.changeCartesian3ByScalar(o._position,Py);return[o._position,P]}let I=this._earthCtrl.entities.add({polyline:{positions:new wn(v,!1),material:this._colorStyle}});this._lineArray.push(I)};n1.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};n1.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 ire=n1;var Bxe=Ti.WGS84;function nd(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=WSi(this.coreMap.container)}function bxe(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"?bxe(o[f],null):A[f];return A}function vnt(o,A){let f=bxe(o),m;for(m in A)f[m]===void 0&&(f[m]=bxe(A[m]));return f}function WSi(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)}nd.prototype.addToolbar=function(o,A){return A=vnt(A,{container:o}),new nd.Toolbar(this,A)};var Int={shiftX:0,shiftY:0};nd.prototype.createBillboardGroup=function(o,A,f){let m=new nd.BillboardGroup(this,A);return m.addBillboards(o,f),m};nd.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=vnt(A,Int);let f=new GE;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};nd.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 ee(0,0,-1e3),horizontalOrigin:NA.CENTER,verticalOrigin:fn.CENTER,scale:.3,image:Ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new ct(1,1,1,1)});if(A){let y=function(v){C.enableRotate=v},x=function(){let v=0;for(let I=m._orderedBillboards.length;v<I&&m._orderedBillboards[v]!==f;++v);return v},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let v=this,I=new zr(v._scene.canvas);setListener(f,"leftDown",function(E){function B(T){f.position=T;for(let b=0,D=v._orderedBillboards.length;b<D&&v._orderedBillboards[b]!==f;++b);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(x(),T)}function w(T){I.destroy(),y(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(x(),T)}I.setInputAction(function(T){let b=v._scene.camera.pickEllipsoid(T.endPosition,Bxe);b?B(b):w(b)},qi.MOUSE_MOVE),I.setInputAction(function(T){w(v._scene.camera.pickEllipsoid(T.position,Bxe))},qi.LEFT_UP),y(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(x(),v._scene.camera.pickEllipsoid(E,Bxe))})}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};nd.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};nd.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};nd.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};nd.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};nd.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};nd.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};nd.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};nd.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};nd.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};nd.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)};nd.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 I=new zr(f.canvas);this._mouseHandler=I;let E=new nd.BillboardGroup(this,Int);this._markers=E,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),I.setInputAction(function(w){if(w.position!==null){let T=f.camera.getPickRay(w.position),b=f.globe.pick(T,f),D=Xt.fromCartesian(b),S=je.toDegrees(D.longitude),L=je.toDegrees(D.latitude);if(b){if(y.length===0&&(y.push(S,L),x.push(b),v=b,E.addBillboard(v)),x.length>=4){let R=Hl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(R!==void 0){let P=R.x-w.position.x,k=R.y-w.position.y;if(P*P+k*k<16){y.splice(y.length-2,2),x.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}y.push(S,L),x.push(b),E.addBillboard(b),x.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:ee.fromDegreesArray(y),material:ct.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=B())}}}.bind(this),qi.LEFT_CLICK),I.setInputAction(function(w){let T=w.endPosition;if(T!==null)if(x.length===0)m.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let b=f.camera.getPickRay(T),D=f.globe.pick(b,f),S=Xt.fromCartesian(D),L=je.toDegrees(S.longitude),R=je.toDegrees(S.latitude);if(D&&(y.splice(y.length-2,2),x.pop(),y.push(L,R),x.push(D),E.getBillboard(x.length-1).position=D,m.showAt(T,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4)){let P=Hl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(P!==void 0){let k=P.x-T.x,U=P.y-T.y;k*k+U*U<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),qi.MOUSE_MOVE),I.setInputAction(function(w){x.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),qi.LEFT_DOUBLE_CLICK);function B(){return ee.fromDegreesArray(y)}};nd.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:ct.RED.withAlpha(.5),outline:!0,outlineColor:ct.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};nd.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)};nd.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};nd.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function qSi(o){let A=[],f=[];for(let w=0;w<o.length;w++){let T=Xt.fromCartesian(o[w]);A.push(T.longitude),f.push(T.latitude)}let m=0,C=0,y=0,x=0,v=0,I=0,E=0,B=0;for(let w=0;w<o.length;w++)m=A[w],C=f[w],w===o.length-1?(y=A[0],x=f[0]):(y=A[w+1],x=f[w+1]),I=m*x-y*C,v+=I,E+=(m+y)*I,B+=(C+x)*I;return v*=.5,E/=6*v,B/=6*v,new Xt(E,B)}function jSi(o,A,f){let m=ee.distance(o,A),C=ee.distance(A,f),y=ee.distance(f,o),x=(m+C+y)/2;return Math.sqrt(x*(x-m)*(x-C)*(x-y))}nd.prototype.computeCutVolume=function(){let o=15e3;for(let k=0;k<this._positions.length;k++){let U=Xt.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 td.fromPositions({positions:this._positions,vertexFormat:ba.FLAT_VERTEX_FORMAT,granularity:A}),m=new td.createGeometry(f),C=0,y=0,x,v,I,E,B,w,T,b,D,S,L,R;for(let k=0;k<m.indices.length;k+=3)x=m.indices[k],v=m.indices[k+1],I=m.indices[k+2],S=new ee(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),L=Xt.fromCartesian(S),E=this._scene.globe.getHeight(L),T=ee.fromRadians(L.longitude,L.latitude,0),y<E&&(y=E),S=new ee(m.attributes.position.values[v*3],m.attributes.position.values[v*3+1],m.attributes.position.values[v*3+2]),L=Xt.fromCartesian(S),B=this._scene.globe.getHeight(L),b=ee.fromRadians(L.longitude,L.latitude,0),y<B&&(y=B),S=new ee(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),L=Xt.fromCartesian(S),w=this._scene.globe.getHeight(L),D=ee.fromRadians(L.longitude,L.latitude,0),y<w&&(y=w),R=jSi(T,b,D),C=C+R*(E-o+B-o+w-o)/3;let P=qSi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:ee.fromRadians(P.longitude,P.latitude,y+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:y,volume:C}};var rre=nd;function Ent(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=Ae(A.color,new ct(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new Li("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 XSi(o,A){let f=Xt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,y=m,x=C,v=A;for(let I=1;I<o.length;I++){let E=Xt.fromCartesian(o[I]);m>E.longitude?m=E.longitude:y<E.longitude&&(y=E.longitude),C>E.latitude?C=E.latitude:x<E.latitude&&(x=E.latitude)}return new ee.fromRadians((m+y)/2,(C+x)/2,v)}function ZSi(o){if(N(o._pps))return;let A=XSi(o._positions,o._minHeight),f=Xt.fromCartesian(A),m=new ti(A.x,A.y,A.z,1),C=new Xt(f.longitude,f.latitude,o.maxHeight+100),y=Xt.toCartesian(C),x=new ti(y.x,y.y,y.z,1),v=new ti,I=new ti,E=new ee,B=o.mEarthCtrl.coreMap.scene.camera,w=o._positions.length;o._pps=new Aa({fragmentShader:eDi(w),uniforms:{u_floodCenterEC:function(){return Xe.multiplyByVector(B._viewMatrix,m,v)},u_floodPlaneNormalEC:function(){let b=Xe.multiplyByVector(B._viewMatrix,m,v),D=Xe.multiplyByVector(B._viewMatrix,x,I);return E.x=D.x-b.x,E.y=D.y-b.y,E.z=D.z-b.z,ee.normalize(E,E),E},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 $Si(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function eDi(o){return`uniform sampler2D colorTexture; |
| | | uniform sampler2D depthTexture; |
| | | varying vec2 v_textureCoordinates; |
| | | uniform vec4 u_floodCenterEC; |