zywlgis 0.5.35 → 0.5.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ZYWLGIS.es.js +1 -1
- package/dist/ZYWLGIS.umd.js +1 -1
- package/package.json +4 -2
package/dist/ZYWLGIS.es.js
CHANGED
|
@@ -193993,7 +193993,7 @@ const zte = (n, A) => {
|
|
|
193993
193993
|
console.log(`资源已加载,跳过: ${i.url}`), r();
|
|
193994
193994
|
return;
|
|
193995
193995
|
}
|
|
193996
|
-
if (
|
|
193996
|
+
if (i.type === "css") {
|
|
193997
193997
|
const o = document.createElement("link");
|
|
193998
193998
|
o.rel = "stylesheet", o.href = i.url, o.onload = () => {
|
|
193999
193999
|
console.log(`CSS资源加载成功: ${i.url}`), r();
|
package/dist/ZYWLGIS.umd.js
CHANGED
|
@@ -16233,4 +16233,4 @@ void main() {
|
|
|
16233
16233
|
// material.alpha = colorImage.a * color.a*maskImage.r;
|
|
16234
16234
|
material.diffuse = colorImage.rgb*color.rgb;
|
|
16235
16235
|
return material;
|
|
16236
|
-
}`;let r=new Cesium.Material({fabric:{type:"customVideo",uniforms:{color:new Cesium.Color(1,1,1,1),image:""},source:i}});return r.uniforms.image=A,new Cesium.EllipsoidSurfaceAppearance({material:r,flat:!0,renderState:{cull:{enabled:!0},depthTest:{enabled:!0}}})};clear=()=>{this.clearGeometry(),this.clearZLMRTCClient()};clearGeometry=()=>{if(this.containerID_.includes("-cesium")){let A=k.getMapEngineInstance(this.containerID_);this.clampToGroundVideoInstance_&&A&&A?.scene&&A?.scene?.primitives&&A.scene.primitives.remove(this.clampToGroundVideoInstance_),this.clampToGroundVideoInstance_=void 0,this.ZYWLCesiumVideo_&&this.ZYWLCesiumVideo_.destroy(),this.ZYWLCesiumVideo_=void 0}};clearZLMRTCClient=()=>{if(this.containerID_.includes("-maptalks")){let A=k.getMapEngineInstance(this.containerID_);this.videoElement_&&this.videoBGElement_&&(this.videoBGElement_.removeChild(this.videoElement_),A.getContainer().removeChild(this.videoBGElement_))}this.videoBGElement_=void 0,this.videoElement_=void 0}}const yXA=(n,A)=>{const e=n.__vccOpts||n;for(const[t,i]of A)e[t]=i;return e},OXA={name:"ZYWLGIS",data(){return{version:"0.5.0",stats:void 0,isLoadInitMapTerrainHeight:!1,tileLoadProgress:0,activeKeys:new Set,rafId:0,timer:void 0,containerID:void 0,maptalksID:void 0,openlayersID:void 0,cesiumID:void 0,isGPUSupport:!0,force2D:!1,initializeMap:!0,isCanvasLeftClick:!1,isCanvasLeftDownMove:!1,isLeftClick:!1,isLeftDown:!1,isLeftDownMove:!1,leftDownMoveTimer:void 0,isShiftLeftDownMove:!1,isAltLeftDownMove:!1,startMousePosition:void 0,mousePosition:void 0,lookFactor:.002,rotateCenter:void 0,isWheelDown:!1,wheelCenter:void 0,isRightDown:!1,zoomCenter:void 0,ctrlRotateCenter:void 0,isKeyDown:!1,isDragging:!0,isLayerManagementOpen:!1,isVideoProjectionOpen:!1,isRangingToolDistance:!0,rangingToolHideTimer:void 0,isBeginRangingTool:!1,rangingToolType:1,currentMapState2D:!0,mouseCoordinate:[],MapEngine_Temp:void 0,MapTerrain_Temp:void 0,MapConfiguration_Temp:void 0,MapPlugins_Temp:void 0,MapLocation_Temp:void 0,MapLayers_Temp:[],MapLayers_Timer:void 0,MapLayers_LastUpdateTimer:void 0,MapLayers_IsUpdating:!1,MapLayers_UpdateInterval:1e3,Tilesets_Temp:[],Tilesets_Timer:void 0,Tilesets_LastUpdateTimer:void 0,Tilesets_IsUpdating:!1,Tilesets_UpdateInterval:1e3,Models_Temp:[],Models_Timer:void 0,Models_LastUpdateTimer:void 0,Models_IsUpdating:!1,Models_UpdateInterval:200,PointCloudRecognitions_Temp:[],PointCloudRecognitions_Timer:void 0,PointCloudRecognitions_LastUpdateTimer:void 0,PointCloudRecognitions_IsUpdating:!1,PointCloudRecognitions_UpdateInterval:1e3,NoFlys_Temp:[],NoFlys_Timer:void 0,NoFlys_LastUpdateTimer:void 0,NoFlys_IsUpdating:!1,NoFlys_UpdateInterval:1e3,Annotations_Temp:[],Annotations_Timer:void 0,Annotations_LastUpdateTimer:void 0,Annotations_IsUpdating:!1,Annotations_UpdateInterval:100,FlightPaths_Temp:[],FlightPaths_Timer:void 0,FlightPaths_LastUpdateTimer:void 0,FlightPaths_IsUpdating:!1,FlightPaths_UpdateInterval:100,PipeLines_Temp:[],PipeLines_Timer:void 0,PipeLines_LastUpdateTimer:void 0,PipeLines_IsUpdating:!1,PipeLines_UpdateInterval:100,Orthophotes_Temp:[],Orthophotes_Timer:void 0,Orthophotes_LastUpdateTimer:void 0,Orthophotes_IsUpdating:!1,Orthophotes_UpdateInterval:500,VideoProjections_Temp:[],VideoProjections_Timer:void 0,VideoProjections_LastUpdateTimer:void 0,VideoProjections_IsUpdating:!1,VideoProjections_UpdateInterval:100,AirRoutes_Temp:[],AirRoutes_Timer:void 0,AirRoutes_LastUpdateTimer:void 0,AirRoutes_IsUpdating:!1,AirRoutes_UpdateInterval:100,HeatMaps_Temp:[],HeatMaps_Timer:void 0,HeatMaps_LastUpdateTimer:void 0,HeatMaps_IsUpdating:!1,HeatMaps_UpdateInterval:1e3,heatMapUpdateTimer:void 0,VectorDatas_Temp:[],VectorDatas_Timer:void 0,VectorDatas_LastUpdateTimer:void 0,VectorDatas_IsUpdating:!1,VectorDatas_UpdateInterval:1e3,Radar_Temp:[],Radar_Timer:void 0,Radar_LastUpdateTimer:void 0,Radar_IsUpdating:!1,Radar_UpdateInterval:0,distanceToolDraw:void 0,distanceToolModify:void 0,distanceToolSource:void 0,distanceToolLayer:void 0,S3Ms_Temp:[],S3Ms_Timer:void 0,S3Ms_LastUpdateTimer:void 0,S3Ms_IsUpdating:!1,S3Ms_UpdateInterval:1e3,CustomNoFlyZones_Temp:[],CustomNoFlyZones_Timer:void 0,CustomNoFlyZones_LastUpdateTimer:void 0,CustomNoFlyZones_IsUpdating:!1,CustomNoFlyZones_UpdateInterval:100,UpdateInterval:1e3}},props:{ActiveContainerIDs:{type:Array,default:()=>[]},MapEngine:{type:Object,default:()=>({})},MapTerrain:{type:Object,default:()=>({})},MapConfiguration:{type:Object,default:()=>({})},MapPlugins:{type:Object,default:()=>({})},MapLayers:{type:Array,default:()=>[]},MapLocation:{type:Object,default:()=>({})},Tilesets:{type:Array,default:()=>[]},Models:{type:Array,default:()=>[]},PointCloudRecognitions:{type:Array,default:()=>[]},NoFlys:{type:Array,default:()=>[]},Annotations:{type:Array,default:()=>[]},FlightPaths:{type:Array,default:()=>[]},PipeLines:{type:Array,default:()=>[]},Orthophotes:{type:Array,default:()=>[]},VideoProjections:{type:Array,default:()=>[]},AirRoutes:{type:Array,default:()=>[]},HeatMaps:{type:Array,default:()=>[]},VectorDatas:{type:Array,default:()=>[]},S3Ms:{type:Array,default:()=>[]},Radar:{type:Array,default:()=>[]},CustomNoFlyZones:{type:Array,default:()=>[]}},watch:{ActiveContainerIDs:{handler(n){window.activeContainerIDs=n},deep:!0},MapEngine:{handler(n){window.DefaultMapEngine=cA.cloneDeep(n),(!cA.isEqual(n.camera,this.MapEngine_Temp.camera)||!cA.isEqual(n.zoom,this.MapEngine_Temp.zoom)||!cA.isEqual(n.center,this.MapEngine_Temp.center))&&(this.MapEngine_Temp.camera=cA.cloneDeep(n.camera),this.MapEngine_Temp.zoom=cA.cloneDeep(n.zoom),this.MapEngine_Temp.center=cA.cloneDeep(n.center),this.syncZoom(cA.cloneDeep(n.zoom)),window.isStartMapModeChange=!0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{this.refreshZoom(),setTimeout(()=>{window.isStartMapModeChange=!1},1e3)}))},deep:!0},MapTerrain:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(this.MapTerrain_Temp=cA.cloneDeep(n),this.setCesiumTerrain())},deep:!0},MapConfiguration:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(window.DefaultMapConfiguration=cA.cloneDeep(n),this.MapConfiguration_Temp=cA.cloneDeep(n),this.setMapEngineOperation())},deep:!0},MapPlugins:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(this.MapPlugins_Temp=cA.cloneDeep(n),this.setMapEnginePlugins(),this.setMapEngineStateBar())},deep:!0},MapLocation:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(this.MapLocation_Temp=cA.cloneDeep(n),this.setMapLocation())},deep:!0},MapLayers:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("MapLayers",n)},deep:!0},Tilesets:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Tilesets",n)},deep:!0},Models:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Models",n)},deep:!0},PointCloudRecognitions:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("PointCloudRecognitions",n)},deep:!0},NoFlys:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("NoFlys",n)},deep:!0},Annotations:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Annotations",n)},deep:!0},FlightPaths:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("FlightPaths",n)},deep:!0},PipeLines:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("PipeLines",n)},deep:!0},Orthophotes:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Orthophotes",n)},deep:!0},AirRoutes:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("AirRoutes",n)},deep:!0},VideoProjections:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("VideoProjections",n)},deep:!0},HeatMaps:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("HeatMaps",n)},deep:!0},VectorDatas:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("VectorDatas",n)},deep:!0},S3Ms:{handler(n){if(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID)){if(!k.isSupportWebGL2())return;this.strictUpdateScheduler("S3Ms",n)}},deep:!0},Radar:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Radar",n)},deep:!0},CustomNoFlyZones:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("CustomNoFlyZones",n)},deep:!0}},beforeUnmount(){},unmounted(){if(this.clearAllTimer(),k.clearAllMapDataMap(this.containerID),k.destroyMapEngine(this.containerID),window.defaultViewPosition=void 0,window.DefaultMapEngine=void 0,window.DefaultMapConfiguration=void 0,window.MaptalksPostRender&&(clearInterval(window.MaptalksPostRender),window.MaptalksPostRender=void 0),window.isStartMapModeChange=!0,window.isPointOfInterestOpen=!1,window.isRangingToolDistance=!0,window.terrainMaximumLevel=void 0,window.sceneIntegrator&&(window.sceneIntegrator.destroy(),window.sceneIntegrator=void 0),window.isStartBoxSelection=!1,window.originalFrustum=void 0,window.allowClickMapMode=!0,window.sliderHandler=void 0,window.rangingToolDiv=void 0,window.AxisInstance&&window.AxisInstance.clear(),window.EditElement=void 0,window.DragElement=void 0,window.DragElementIndex=void 0,window.HighlightElement=void 0,window.HighlightIndex=void 0,window.HighlightType=void 0,window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID)){const n=window.activeContainerIDs.indexOf(this.containerID);n>-1&&window.activeContainerIDs.splice(n,1)}console.log("需要刷新的地图视图》》》》》》》》》》",window.activeContainerIDs)},beforeMount(){console.log("组件挂载前")},mounted(){window.isStartMapModeChange=!0,window.isPointOfInterestOpen=!1,this.isBeginRangingTool=!1,window.isRangingToolDistance=!0,this.rangingToolType=1,this.MapEngine_Temp=cA.cloneDeep(this.MapEngine),window.DefaultMapEngine=cA.cloneDeep(this.MapEngine),this.MapTerrain_Temp=cA.cloneDeep(this.MapTerrain),this.MapConfiguration_Temp=cA.cloneDeep(this.MapConfiguration),window.DefaultMapConfiguration=cA.cloneDeep(this.MapConfiguration),this.MapPlugins_Temp=cA.cloneDeep(this.MapPlugins),this.containerID=this.MapEngine_Temp.containerID,k.setContainerID(this.containerID);let n=k.getMapEngineID(this.containerID);this.maptalksID=n.maptalksID,this.openlayersID=n.openlayersID,this.cesiumID=n.cesiumID,this.syncZoom(this.MapEngine_Temp?.zoom?.current??15),this.ActiveContainerIDs?.length?window.activeContainerIDs=this.ActiveContainerIDs:window.activeContainerIDs=[this.containerID],console.log("需要刷新的地图视图》》》》》》》》》》",window.activeContainerIDs),window.defaultViewPosition||(window.defaultViewPosition={containerID:cA.cloneDeep(this.MapEngine_Temp.containerID),force2D:cA.cloneDeep(this.MapEngine_Temp.force2D),center:cA.cloneDeep(this.MapEngine_Temp.center),zoom:cA.cloneDeep(this.MapEngine_Temp.zoom),camera:cA.cloneDeep(this.MapEngine_Temp.camera)}),k.addGraphClickHandlerHandler(this.GraphClickHandler),k.addGraphNodeClickHandlerHandler(this.GraphNodeClickHandler),k.addGraphChangingHandler(this.GraphChangingHandler),k.addGraphChangedHandler(this.GraphChangedHandler),k.addGraphRemovedHandler(this.GraphRemovedHandler),k.addGraphEditedHandler(this.GraphEditedHandler),k.addMapInitializationCompletedHandler(this.MapInitCompletedHandler),k.addMapRightClickHandler(this.MapRightClickHandler),k.addNoReturnNodeHandler(this.MapRightClickHandler),this.loadExternalResources(()=>{console.log(`版本号>>>>>>>>>>${this.version};CESIUM版本号>>>>>>>>>>${Cesium.VERSION}`,Cesium),this.initializeMapEngine()})},methods:{syncZoom(n){console.log("同步层级",this.containerID,n),window.MapCurrentZooms||(window.MapCurrentZooms=new Map),window.MapCurrentZooms.has(this.containerID)&&window.MapCurrentZooms.delete(this.containerID),window.MapCurrentZooms.set(this.containerID,cA.cloneDeep(n))},loadZoom(){return window.MapCurrentZooms&&window.MapCurrentZooms.has(this.containerID)?window.MapCurrentZooms.get(this.containerID):10},async loadExternalResources(n){console.log("开始动态加载外部资源...");const A=[{type:"css",url:"/libs/Cesium/Widgets/widgets.css"},{type:"js",url:"/libs/Cesium/Cesium.js"},{type:"js",url:"/libs/Cesium/Cesium-Version.js"},{type:"js",url:"/libs/SuperMap3D/SuperMap3D.js"},{type:"js",url:"/libs/cpRPA.js"},{type:"js",url:"/libs/egm96_mhl.js"}],e=i=>i.endsWith(".css")?Array.from(document.querySelectorAll('link[rel="stylesheet"]')).some(r=>r.href.includes(i)):i.endsWith(".js")?Array.from(document.querySelectorAll("script[src]")).some(r=>r.src.includes(i)):!1,t=i=>new Promise((r,s)=>{if(e(i.url)){console.log(`资源已加载,跳过: ${i.url}`),r();return}if(console.log(`正在加载资源: ${i.url}`),i.type==="css"){const o=document.createElement("link");o.rel="stylesheet",o.href=i.url,o.onload=()=>{console.log(`CSS资源加载成功: ${i.url}`),r()},o.onerror=()=>{console.error(`CSS资源加载失败: ${i.url}`),s(new Error(`Failed to load CSS: ${i.url}`))},document.head.appendChild(o)}else if(i.type==="js"){const o=document.createElement("script");i.url.includes("Cesium.js")&&(o.type="text/javascript"),o.src=i.url,o.onload=()=>{console.log(`JS资源加载成功: ${i.url}`),r()},o.onerror=()=>{console.error(`JS资源加载失败: ${i.url}`),s(new Error(`Failed to load JS: ${i.url}`))},document.head.appendChild(o)}});try{for(const i of A)await t(i),await new Promise(r=>setTimeout(r,0));console.log("所有外部资源加载完成"),n&&n()}catch(i){console.error("外部资源加载失败:",i),n&&n()}},getDifferences(n,A,e){const t=new Map(n.map(a=>[a[e],a])),i=new Map(A.map(a=>[a[e],a])),r=[],s=[],o=[];for(const[a,l]of i)if(!t.has(a))r.push(l);else{const D=t.get(a);cA.isEqual(D,l)||s.push(l)}for(const[a,l]of t)i.has(a)||o.push(l);return{added:r,changed:s,removed:o}},async handleCRUDData(n,A,e){this[`${n}_IsUpdating`]=!0,this[`${n}_Timer`]=setTimeout(()=>{this[`${n}_IsUpdating`]=!1,this[`${n}_Timer`]=void 0},this[`${n}_UpdateInterval`]),await new Promise(t=>{const{added:i,changed:r,removed:s}=this.getDifferences(this[`${n}_Temp`],A,"ID");this[`${n}_Temp`]=cA.cloneDeep(A),t({added:i,changed:r,removed:s})}).then(t=>{e&&e(t)})},strictUpdateScheduler(n,A){if(n==="MapLayers"&&(this[`${n}_Temp`]=cA.cloneDeep(A)??[]),this[`${n}_LastUpdateTimer`]&&(clearTimeout(this[`${n}_LastUpdateTimer`]),this[`${n}_LastUpdateTimer`]=void 0),this[`${n}_Timer`]){this[`${n}_LastUpdateTimer`]=setTimeout(()=>{this[`setZYWL${n}`](n,A),this[`${n}_LastUpdateTimer`]=void 0},this.UpdateInterval);return}this[`${n}_IsUpdating`]||this[`setZYWL${n}`](n,A)},clearAllTimer(){const n=["MapLayers","Tilesets","Models","PointCloudRecognitions","NoFlys","Annotations","FlightPaths","PipeLines","Orthophotes","AirRoutes","HeatMaps","VideoProjections","VectorDatas","Radar","S3Ms","CustomNoFlyZones"];for(const A of n)this[`${A}_LastUpdateTimer`]&&(clearTimeout(this[`${A}_LastUpdateTimer`]),this[`${A}_LastUpdateTimer`]=void 0),this[`${A}_Timer`]&&(clearTimeout(this[`${A}_Timer`]),this[`${A}_Timer`]=void 0),this[`${A}_IsUpdating`]=!1},async processArrayAsync(n,A,e=20){if(!(!Array.isArray(n)||n.length===0))return new Promise(t=>{let i=0;const r=()=>{const s=Math.min(i+e,n.length);for(;i<s;i++)A(n[i],i,n);i<n.length?setTimeout(r,0):t()};r()})},async initializeData(){console.log("初始化数据",this);const n=["MapLayers","Tilesets","Models","PointCloudRecognitions","NoFlys","Annotations","FlightPaths","PipeLines","Orthophotes","AirRoutes","HeatMaps","VideoProjections","VectorDatas","Radar","S3Ms","CustomNoFlyZones"];for(const A of n)if(A!=="MapLayers"){const e=cA.cloneDeep(this[A])||[];Array.isArray(e)&&e.length&&(await this[`setZYWL${A}`](A,e),await new Promise(t=>setTimeout(t,0)))}else{const e=`${A}_Temp`;this[e]=cA.cloneDeep(this[A])||[],Array.isArray(this[e])&&this[e].length&&(await this[`setZYWL${A}`](),await new Promise(t=>setTimeout(t,0)))}},initializeMapEngine(){let n=this.MapEngine_Temp?.limitMemory??1,A=this.MapEngine_Temp?.GPUWhiteLists??[];window.isGPUSupport=k.isGPUSupport(n,A),this.force2D=this.MapEngine_Temp?.force2D??!1;let e=document.getElementById(this.containerID);if(window.isGPUSupport&&!this.force2D){let t=this.createOL(e);k.setMapEngineInstance(this.openlayersID,t),this.createCesium(e)}else{let t=this.createMaptalks(e);k.setMapEngineInstance(this.maptalksID,t),this.setMapEngineStateBar();let i=document.getElementById(`${this.containerID}-MapEngineMapZoomDiv`);if(i){let r=parseInt(t.getZoom());i.textContent=`层级 ${r}`}this.initializeData(),this.setMapEngineAction(),this.setMapEnginePlugins(),this.setMapEngineOperation()}this.setWindowKey(),this.createStats()},createStats(){if((this.MapEngine_Temp?.trackStats??!1)&&window.sceneIntegrator&&window.sceneIntegrator.threeRenderer.isWebGLRenderer){const A=document.getElementById(this.containerID);this.stats=new nGA({trackHz:!0});const e=k.getMapEngineInstance(this.cesiumID);e&&this.stats.init(e.scene.context._gl),A.appendChild(this.stats.dom);let t=this.MapPlugins_Temp?.style??{right:0};this.stats.dom.style.left=`${A.offsetWidth+A.offsetLeft-240-t.right}px`,this.stats.dom.style.top="100px"}},createMaptalks(n){let A=document.getElementById(this.maptalksID);A||(A=document.createElement("div"),A.id=this.maptalksID,A.style.position="absolute",A.style.height="100%",A.style.width="100%",A.style.zIndex=1,A.style.backgroundColor="#232323",n&&n.appendChild(A)),window.isGPUSupport&&!this.force2D&&(A.style.display="none");let e=this.MapEngine_Temp?.center?.longitude??117.21833231944812,t=this.MapEngine_Temp?.center?.latitude??39.06565050593017,i=this.MapEngine_Temp?.zoom?.max??22,r=this.MapEngine_Temp?.zoom?.min??1;window.mapRenderer=this.MapEngine_Temp?.renderer??"canvas";const s=new Vi(this.maptalksID,{center:[e,t],zoom:this.MapEngine_Temp?.zoom?.current??15,minZoom:r,maxZoom:i,doubleClickZoom:!1,draggable:this.MapConfiguration_Temp?.isDrag??!0,dragRotate:!1,dragPitch:!1,touchRotate:!1,touchPitch:!1,hitDetect:!1,panAnimation:!0,zoomAnimation:!0,zoomInCenter:this.MapConfiguration_Temp?.isZoomInCenter??!1,centerCross:!1,seamlessZoom:!0,fog:!1,fpsOnInteracting:59,devicePixelRatio:1,maxExtent:new Bn({xmin:-180,ymin:-90,xmax:180,ymax:90}),attribution:!1});return k.emitMapInitializationCompleted(),this.mouseCoordinate=[Number(e.toFixed(9)),Number(t.toFixed(9))],s},createOL(n){let A=document.getElementById(this.openlayersID);A||(A=document.createElement("div"),A.id=this.openlayersID,A.style.position="absolute",A.style.height="100%",A.style.width="100%",A.style.zIndex=1,A.style.backgroundColor="#232323",n&&n.appendChild(A));let e=this.MapEngine_Temp?.center?.longitude??117.21833231944812,t=this.MapEngine_Temp?.center?.latitude??39.06565050593017,i=this.MapEngine_Temp?.zoom?.max??22,r=this.MapEngine_Temp?.zoom?.min??1,s=new JiA({useAnchor:this.MapConfiguration_Temp?.isZoomInCenter??!1});return new eGA({target:this.openlayersID,view:new jc({center:em([e,t]),zoom:this.MapEngine_Temp?.zoom?.current??15,minZoom:r,maxZoom:i}),controls:[],interactions:GiA({dragPan:this.MapConfiguration_Temp?.isDrag??!0,mouseWheelZoom:this.MapConfiguration_Temp?.isDrag??!0}).extend([s])})},createCesium(n){let A=this.MapConfiguration_Temp?.isAR??!1,e=document.getElementById(this.cesiumID);e||(e=document.createElement("div"),e.id=this.cesiumID,e.tabIndex="0",e.style.position="absolute",e.style.height="100%",e.style.width="100%",e.style.zIndex=2,e.style.backgroundColor="#232323",n&&n.appendChild(e));let t=this.MapEngine_Temp?.zoom?.max??21,i=this.MapEngine_Temp?.zoom?.min??1,r=this.MapEngine_Temp?.camera?.pitch??-90,s=k.isSupportWebGL2(),o=k.getMapEngineInstance(this.cesiumID);return o||(o=new Cesium.Viewer(this.cesiumID,{geocoder:!1,animation:!1,shouldAnimate:!0,showRenderLoopErrors:!1,timeline:!1,fullscreenButton:!1,homeButton:!1,sceneModePicker:!1,selectionIndicator:!1,navigationHelpButton:!1,infoBox:!1,contextOptions:{webgl:{alpha:A,depth:!0,stencil:!0,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,failIfMajorPerformanceCaveat:!1},requestWebgl1:!s},baseLayer:!1,blurActiveElementOnCanvasFocus:!1,baseLayerPicker:!1,mapProjection:new Cesium.WebMercatorProjection}),k.setMapEngineInstance(this.cesiumID,o),window.sceneIntegrator||(window.sceneIntegrator=lsA(o))),k.getPointPrimitiveCollection(this.cesiumID),k.getLabelCollection(this.cesiumID),k.getBillboardCollection(this.cesiumID),r===-90?o.scene.camera.switchToOrthographicFrustum():o.scene.camera.switchToPerspectiveFrustum(),o.scene.backgroundColor=Cesium.Color.fromCssColorString("#232323"),o.scene.globe.baseColor=Cesium.Color.fromCssColorString("#2A3034"),o.cesiumWidget.creditContainer.style.display="none",o.scene.screenSpaceCameraController.enableCollisionDetection=!0,o.scene.globe.tileLoadProgressEvent.addEventListener(a=>{this.createTileLoadProgressIcon(),this.tileLoadProgress<a?(this.tileLoadProgress=cA.cloneDeep(a),this.drawCircle(a)):(this.tileLoadProgress=100-a,this.drawCircle(this.tileLoadProgress))}),this.setCesiumState(e,o,A,t,i),k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!0,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,async()=>{setTimeout(()=>{window.isStartMapModeChange=!1,window.allowClickMapMode=!0,window.originalFrustum=cA.cloneDeep(o.scene.camera.frustum)},1e3),this.initializeData(),this.setMapEngineAction(),this.setMapEnginePlugins(),this.setMapEngineOperation(),this.setCesiumTerrain();let a=this.MapEngine_Temp?.center?.longitude??117.21833231944812,l=this.MapEngine_Temp?.center?.latitude??39.06565050593017;window.mousePosition=cA.cloneDeep(k.transformCartesian3({longitude:a,latitude:l}));const D=await k.getTerrainHeight(o,window.mousePosition);this.mouseCoordinate=[Number(D.coordinate.longitude.toFixed(9)),Number(D.coordinate.latitude.toFixed(9))],k.emitMapInitializationCompleted()}),o},setCesiumTerrain(){const n=k.getMapEngineInstance(this.cesiumID),A=this.MapTerrain_Temp?.isLoadTerrain??!1,e=this.MapTerrain_Temp?.terrainUrl,t=this.MapTerrain_Temp?.depthTestAgainstTerrain??!0;if(n.scene.globe.depthTestAgainstTerrain=t,!A||!e||e&&!e.length){window.terrainMaximumLevel=0,n.terrainProvider=new Cesium.EllipsoidTerrainProvider({});return}const i=new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(e,{requestVertexNormals:!0,requestWaterMask:!0}));i.readyEvent.addEventListener(r=>{i.ready&&(window.terrainMaximumLevel=r.availability._maximumLevel,n.terrainProvider=r)}),i.errorEvent.addEventListener(()=>{window.terrainMaximumLevel=0,n.terrainProvider=new Cesium.EllipsoidTerrainProvider({})})},setCesiumState(n,A,e,t,i){if(A.scene.sun.show=!1,A.scene.moon.show=!1,A.scene.skyBox.show=!1,A.scene.logarithmicDepthBuffer=!1,e)A.scene.skyAtmosphere.show=!1,A.scene.backgroundColor=Cesium.Color.TRANSPARENT,A.scene.globe.translucency.enabled=!0,A.scene.globe.translucency.backFaceAlpha=0,A.scene.globe.translucency.frontFaceAlpha=0;else{this.addMapSlider(A,n),A.imageryLayers.removeAll(),A.scene.postProcessStages.fxaa.enabled=!0,window.devicePixelRatio=1,A.resolutionScale=window.devicePixelRatio,A.targetFrameRate=120,A.trackedEntity=void 0,A.scene.globe.maximumScreenSpaceError=1,A.scene.globe.preloadAncestors=!0,A.scene.globe.preloadSiblings=!0,t>21&&(t=21);let r=k.getMapHeightByZoom(this.containerID,t,this.MapEngine_Temp?.center);r&&(r<30&&(r=30),A.scene.screenSpaceCameraController.minimumZoomDistance=r);let s=10241789645430042e-8;i>2&&(s=k.getMapHeightByZoom(this.containerID,i,this.MapEngine_Temp?.center)),s&&(A.scene.screenSpaceCameraController.maximumZoomDistance=s)}},setMapEngineAction(){this.initializeMap&&(this.initializeMap=!1);const n=k.getMapEngineInstance(this.cesiumID);if(n){const A=n.scene,e=A.camera;e.percentageChanged=1e-4,e.changed.addEventListener(this.cesiumCameraChanged),e.moveEnd.addEventListener(this.cesiumCameraMoveEnd),A.postRender.addEventListener(this.cesiumScenePostRender),A.canvas.addEventListener("click",i=>{if(this.isCanvasLeftDownMove||(this.isCanvasLeftClick=!0),this.isCanvasLeftClick){if(window.sceneIntegrator){const r=window.sceneIntegrator.threeScene.getObjectByName("pointCloud");if(r){const s=new TRA,o=new Or,a=n.scene.canvas.getBoundingClientRect();o.x=(i.clientX-a.left)/a.width*2-1,o.y=-((i.clientY-a.top)/a.height)*2+1,s.setFromCamera(o,window.sceneIntegrator.threeCamera);const l=s.intersectObject(r);if(l.length>0){const D=l[0].point,P=k.transformCoordinate(D),c=k.get3DTilesets();c&&[...c.values()].forEach(h=>{if(h.hasOwnProperty("pcdCenter_")&&h.pcdCenter_){const g=k.AbsolutePositionToRelativePosition(h.pcdCenter_,P);k.RelativePositionToAbsolutePosition(h.pcdCenter_,g)}})}}}this.isCanvasLeftClick=!1}});const t=n.cesiumWidget.screenSpaceEventHandler;t&&(t.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),t.setInputAction(this.cesiumLeftDown,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(this.cesiumLeftUp,Cesium.ScreenSpaceEventType.LEFT_UP),t.setInputAction(this.cesiumLeftClick,Cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(this.cesiumMouseMove,Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(this.cesiumWheel,Cesium.ScreenSpaceEventType.WHEEL),t.setInputAction(this.cesiumMiddleDown,Cesium.ScreenSpaceEventType.MIDDLE_DOWN),t.setInputAction(this.cesiumMiddleUp,Cesium.ScreenSpaceEventType.MIDDLE_UP),t.setInputAction(this.cesiumRightDown,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction(this.cesiumRightUp,Cesium.ScreenSpaceEventType.RIGHT_UP),t.setInputAction(this.cesiumRightClick,Cesium.ScreenSpaceEventType.RIGHT_CLICK),t.setInputAction(this.cesiumLeftDoubleClick,Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),t.setInputAction(this.cesiumAltAndLeftDown,Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT),t.setInputAction(this.cesiumAltAndLeftUp,Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT),t.setInputAction(this.cesiumAltAndLeftMouseMove,Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT),t.setInputAction(this.cesiumLeftDownAndCtrl,Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.CTRL),t.setInputAction(this.cesiumLeftUpAndCtrl,Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.CTRL),t.setInputAction(this.cesiumLeftAndCtrlMouseMove,Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.CTRL),t.setInputAction(this.cesiumLeftDownAndShift,Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.SHIFT),t.setInputAction(this.cesiumLeftUpAndShift,Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.SHIFT),t.setInputAction(this.cesiumMouseMoveAndShift,Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.SHIFT))}else{let A=k.getMapEngineInstance(this.maptalksID);A.on("click",e=>{if(this.isLeftDownMove)return;this.MapClickHandler({coordinate:{longitude:e.coordinate.x,latitude:e.coordinate.y}});let t=[k.getVectorLayer(this.maptalksID)];window.isGPUSupport&&t.push(k.getGLLayer(this.maptalksID)),A.identify({coordinate:e.coordinate,layers:t},i=>{let r=this.setEditElement();r&&r.hasOwnProperty("mouseClick")&&r.mouseClick(e,i)})}),A.on("dblclick",e=>{}),A.on("mousedown",()=>{this.isLeftDown=!0}),A.on("mouseup",()=>{this.isLeftDown=!1,this.isLeftDownMove=!1}),A.on("mousemove",e=>{this.isLeftDown&&(this.isLeftDownMove=!0),this.isLeftDown||(this.mouseCoordinate=[Number(e.coordinate.x.toFixed(9)),Number(e.coordinate.y.toFixed(9))])}),A.on("movestart zoomstart",()=>{k.removeMenu(this.containerID)}),A.on("zooming",e=>{}),A.on("zoomend",e=>{const t=parseInt(e.to);let i=k.getAnnotations();i&&[...i.values()].filter(D=>D?.data_?.type===5&&D?.isAutoZoom_).forEach(D=>{if(D.geometryInstance_){let P=1;const c=D?.data_?.symbol?.markerWidth??10,h=D?.data_?.symbol?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}});let r=k.getNoFlys();r&&[...r.values()].filter(D=>D?.data_?.type===5&&D?.isAutoZoom_).forEach(D=>{if(D.geometryInstance_){let P=1;const c=D?.data_?.symbol?.markerWidth??10,h=D?.data_?.symbol?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}});let s=k.getFlightPaths();s&&[...s.values()].filter(D=>D?.isAutoZoom_).forEach(D=>{if(D?.iconInstance_?.geometryInstance_){let P=cA.cloneDeep(D?.iconInstance_?.data_?.scale??1);const c=D?.iconInstance_?.data_?.icon?.markerWidth??10,h=D?.iconInstance_?.data_?.icon?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.iconInstance_.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}});let o=k.getModels();o&&[...o.values()].filter(D=>D?.isAutoZoom_).forEach(D=>{if(D.geometryInstance_){let P=cA.cloneDeep(D?.data_?.scale??1);const c=D?.data_?.icon?.markerWidth??10,h=D?.data_?.icon?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}}),this.syncZoom(Number(e.to.toFixed(0))),this.refreshZoom();const a=new Map([...k.getNoFlys(),...k.getAnnotations()]);for(const l of a.values())l.hasOwnProperty("douglasPeucker")&&l.douglasPeucker()}),A.on("viewchange",e=>{this.initializeMap&&(this.initializeMap=!1),this.MapEngine_Temp.center={longitude:e.new.center[0],latitude:e.new.center[1]},this.refreshZoom()}),A.on("addlayer",e=>{this.initializeMap&&(this.initializeMap=!1)}),A.on("contextmenu",e=>{let t=[k.getVectorLayer(this.maptalksID)];window.isGPUSupport&&t.push(k.getGLLayer(this.maptalksID)),A.identify({coordinate:e.coordinate,layers:t},i=>{i.length||k.emitMapRightClick({windowPosition:e.containerPoint,coordinate:{longitude:e.coordinate.x,latitude:e.coordinate.y,altitude:0}})})}),window.MaptalksPostRender&&(clearInterval(window.MaptalksPostRender),window.MaptalksPostRender=void 0),window.MaptalksPostRender||(window.MaptalksPostRender=setInterval(()=>{this.setMapEngineStateBar()},0))}},refreshZoom(){const n=document.getElementById(`${this.containerID}-MapEngineMapZoomDiv`);n&&(n.textContent=`层级 ${this.loadZoom()}`)},addMapSlider(n,A){let e=this.MapEngine_Temp?.isOpenSlider??!1,t="Cesium-SliderDiv",i=document.getElementById(t),r="Cesium-Slider",s=document.getElementById(r);if(e){if(i||(i=document.createElement("div"),i.id=t),A&&A.appendChild(i),s||(s=document.createElement("div"),s.id=r),i&&i.appendChild(s),n.scene.splitPosition=i.offsetLeft/i.parentElement.offsetWidth,!window.sliderHandler){let o=!1;window.sliderHandler=new Cesium.ScreenSpaceEventHandler(i),window.sliderHandler.setInputAction(()=>{o=!0},Cesium.ScreenSpaceEventType.LEFT_DOWN),window.sliderHandler.setInputAction(()=>{o=!1},Cesium.ScreenSpaceEventType.LEFT_UP),window.sliderHandler.setInputAction(a=>{if(!o)return;let l=a.endPosition.x,D=(i.offsetLeft+l)/i.parentElement.offsetWidth;i.style.left=`${100*D}%`,n.scene.splitPosition=D},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}else s&&i&&i.removeChild(s),i&&A&&A.removeChild(i),n.scene.splitPosition=0,window.sliderHandler&&(window.sliderHandler.getInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN)&&window.sliderHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),window.sliderHandler.getInputAction(Cesium.ScreenSpaceEventType.LEFT_UP)&&window.sliderHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),window.sliderHandler.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)&&window.sliderHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)),window.sliderHandler=void 0},setMapEngineStateBar(){if(window.isOpenSyncZoomLensCamera)return;let n,A;this.mouseCoordinate&&this.mouseCoordinate.length&&(n=this.mouseCoordinate[0],A=this.mouseCoordinate[1]),k.createMapEngineStateBar(this.containerID,this.MapPlugins_Temp,n,A,this.initializeMap)},setMapEnginePlugins(){let n=document.getElementById(this.containerID);if(n){let A=this.MapPlugins_Temp?.style??{right:0},e=`${15+A?.right}px`,t=this.MapPlugins_Temp?.scale??1,i=35*t,r=35*t,s=this.MapPlugins_Temp?.layerManagementVisible??!0,o=document.getElementById(`${this.containerID}-MapEngineLayerManagement`);s?(o||(o=document.createElement("img"),o.id=`${this.containerID}-MapEngineLayerManagement`,n.appendChild(o),o.addEventListener("click",()=>{this.setMapEngineRangingTool(!1),this.isLayerManagementOpen=!this.isLayerManagementOpen,this.$emit("onLayerManagementState",{state:this.isLayerManagementOpen})})),o.src=k.getLayerManagementIcon(),o.style.position="absolute",o.style.width=`${i}px`,o.style.height=`${r}px`,o.style.zIndex=3,o.style.right=e,o.style.top="100px"):(o&&(n.removeChild(o),o.removeEventListener("click",()=>{})),o=void 0);let a=this.MapPlugins_Temp?.pointOfInterestVisible??!0,l=document.getElementById(`${this.containerID}-MapEnginePointOfInterest`);if(a){l||(l=document.createElement("img"),l.id=`${this.containerID}-MapEnginePointOfInterest`,n.appendChild(l),l.addEventListener("click",()=>{this.setMapEngineRangingTool(!1),window.isPointOfInterestOpen=!window.isPointOfInterestOpen,window.isPointOfInterestOpen?l.src=bo.getIconBase64("PointOfInterestOpen.png"):l.src=bo.getIconBase64("PointOfInterestClose.png"),k.reDrawAirRoutePointOfInterest(this.containerID)})),l.src=bo.getIconBase64("PointOfInterestClose.png"),l.style.position="absolute",l.style.width=`${i}px`,l.style.height=`${r}px`,l.style.zIndex=3,l.style.right=e;let p=100;o&&(p=parseInt(o.style.top)+o.clientHeight+10),l.style.top=`${p}px`}else l&&(n.removeChild(l),l.removeEventListener("click",()=>{})),l=void 0;let D=this.MapPlugins_Temp?.videoProjectionVisible??!0,P=document.getElementById(`${this.containerID}-MapEngineVideoProjection`),c=k.getMapEngineInstance(this.cesiumID);if(D&&c){P||(P=document.createElement("img"),P.id=`${this.containerID}-MapEngineVideoProjection`,n.appendChild(P),P.addEventListener("click",()=>{this.setMapEngineRangingTool(!1),this.isVideoProjectionOpen=!this.isVideoProjectionOpen,P.src=k.getVideoProjectionIcon(this.isVideoProjectionOpen),this.$emit("onVideoProjectionState",{state:this.isVideoProjectionOpen})})),P.src=k.getVideoProjectionIcon(!1),P.style.position="absolute",P.style.width=`${i}px`,P.style.height=`${r}px`,P.style.zIndex=3,P.style.right=e;let p=100;l?p=parseInt(l.style.top)+l.clientHeight+10:o&&(p=parseInt(o.style.top)+o.clientHeight+10),P.style.top=`${p}px`}else P&&(n.removeChild(P),P.removeEventListener("click",()=>{})),P=void 0;let h=32*t+15,g=this.MapPlugins_Temp?.zoomOutVisible??!0,u=document.getElementById(`${this.containerID}-MapEngineZoomOut`);g?(u||(u=document.createElement("img"),u.id=`${this.containerID}-MapEngineZoomOut`,n.appendChild(u),u.addEventListener("click",()=>{this.setMapEngineRangingTool(!1);let p=this.loadZoom(),m=this.MapEngine_Temp?.zoom?.min??1;p>m&&(p--,this.syncZoom(p),window.isStartMapModeChange=!0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!0,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{this.refreshZoom(),setTimeout(()=>{window.isStartMapModeChange=!1},1e3)}))})),u.src=k.getZoomOutIcon(),u.style.position="absolute",u.style.width=`${i}px`,u.style.height=`${r}px`,u.style.zIndex=3,u.style.right=e,u.style.bottom=`${h}px`):(u&&(n.removeChild(u),u.removeEventListener("click",()=>{})),u=void 0);let Q=this.MapPlugins_Temp?.zoomInVisible??!0,w=document.getElementById(`${this.containerID}-MapEngineZoomIn`);if(Q){w||(w=document.createElement("img"),w.id=`${this.containerID}-MapEngineZoomIn`,n.appendChild(w),w.addEventListener("click",()=>{this.setMapEngineRangingTool(!1);let m=this.loadZoom(),T=this.MapEngine_Temp?.zoom?.max??21;T>21&&(T=21),m<T&&(m++,this.syncZoom(m),console.log(this.loadZoom()),window.isStartMapModeChange=!0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!0,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{this.refreshZoom(),setTimeout(()=>{window.isStartMapModeChange=!1},1e3)}))})),w.src=k.getZoomInIcon(),w.style.position="absolute",w.style.width=`${i}px`,w.style.height=`${r}px`,w.style.zIndex=3,w.style.right=e;let p;u?p=parseInt(u.style.bottom)+u.clientHeight+10:p=h,w.style.bottom=`${p}px`}else w&&(n.removeChild(w),w.removeEventListener("click",()=>{})),w=void 0;let C=document.getElementById(`${this.containerID}-MapEngineMapMode`);if(c)if(this.MapPlugins_Temp?.mapModeVisible??!0){C||(C=document.createElement("img"),C.id=`${this.containerID}-MapEngineMapMode`,n.appendChild(C),C.addEventListener("click",()=>{window.allowClickMapMode&&(window.allowClickMapMode=!1,window.isStartMapModeChange=!0,this.setMapEngineRangingTool(!1),C.src=k.getMapModeIcon(this.currentMapState2D),this.currentMapState2D?this.MapEngine_Temp.camera.pitch=-30:this.MapEngine_Temp.camera.pitch=-90,this.currentMapState2D=!this.currentMapState2D,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!0,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{setTimeout(()=>{window.isStartMapModeChange=!1},1e3),setTimeout(()=>{window.allowClickMapMode=!0},1e3),this.currentMapState2D?(C.src=k.getMapModeIcon(!0),c.scene.camera.switchToOrthographicFrustum()):(C.src=k.getMapModeIcon(!1),c.scene.camera.switchToPerspectiveFrustum())}))})),(this.MapEngine_Temp?.camera?.pitch??-90)===-90?(C.src=k.getMapModeIcon(!0),this.currentMapState2D=!0):(C.src=k.getMapModeIcon(!1),this.currentMapState2D=!1),C.style.position="absolute",C.style.width=`${i}px`,C.style.height=`${r}px`,C.style.zIndex=3,C.style.right=e;let T;w?T=parseInt(w.style.bottom)+w.clientHeight+10:u?T=parseInt(u.style.bottom)+u.clientHeight+10:T=h,C.style.bottom=`${T}px`}else C&&(n.removeChild(C),C.removeEventListener("click",()=>{})),C=void 0;else C&&(n.removeChild(C),C.removeEventListener("click",()=>{})),C=void 0;let E=this.MapPlugins_Temp?.rangingToolVisible??!0;if(window.rangingToolDiv=document.getElementById(`${this.containerID}-MapEngineRangingTool`),E){window.rangingToolDiv||(window.rangingToolDiv=document.createElement("img"),window.rangingToolDiv.id=`${this.containerID}-MapEngineRangingTool`,n.appendChild(window.rangingToolDiv),window.rangingToolDiv.addEventListener("click",m=>{this.isBeginRangingTool=!this.isBeginRangingTool,this.rangingToolClick()}),window.rangingToolDiv.addEventListener("mouseenter",()=>{this.rangingToolMouseenter(),this.setMapEngineRangingTool(!0)}),window.rangingToolDiv.addEventListener("mouseleave",this.rangingToolMouseleave)),window.rangingToolDiv.src=k.getRangingToolIconByType(this.rangingToolType,this.isBeginRangingTool),window.rangingToolDiv.style.position="absolute",window.rangingToolDiv.style.width=`${i}px`,window.rangingToolDiv.style.height=`${r}px`,window.rangingToolDiv.style.zIndex=3,window.rangingToolDiv.style.right=e;let p;C?p=parseInt(C.style.bottom)+C.clientHeight+10:w?p=parseInt(w.style.bottom)+w.clientHeight+10:u?p=parseInt(u.style.bottom)+u.clientHeight+10:p=h,window.rangingToolDiv.style.bottom=`${p}px`}else window.rangingToolDiv&&(n.removeChild(window.rangingToolDiv),window.rangingToolDiv.removeEventListener("click",()=>{})),window.rangingToolDiv=void 0;if(c){let p=document.getElementById(`${this.containerID}-MapEnginecompassNeedleBG`),m=document.getElementById(`${this.containerID}-MapEnginecompassNeedle`);if(this.MapPlugins_Temp?.compassNeedleVisible??!0){p||(p=document.createElement("img"),p.id=`${this.containerID}-MapEnginecompassNeedleBG`,n.appendChild(p),p.addEventListener("click",L=>{this.setMapEngineRangingTool(!1),k.resetMapCamera(this.containerID)})),p.src=k.getCompassNeedleIcon(!0),p.style.position="absolute",p.style.width=`${i}px`,p.style.height=`${r}px`,p.style.zIndex=3,p.style.right=e,m||(m=document.createElement("img"),m.id=`${this.containerID}-MapEnginecompassNeedle`,n.appendChild(m),m.addEventListener("click",L=>{this.setMapEngineRangingTool(!1),k.resetMapCamera(this.containerID)})),m.src=k.getCompassNeedleIcon(!1),m.style.position="absolute",m.style.width=`${i-6}px`,m.style.height=`${r-6}px`,m.style.zIndex=4,m.style.right=`${18+A.right}px`;let z;window.rangingToolDiv?z=parseInt(window.rangingToolDiv.style.bottom)+window.rangingToolDiv.clientHeight+10:C?z=parseInt(C.style.bottom)+C.clientHeight+10:w?z=parseInt(w.style.bottom)+w.clientHeight+10:u?z=parseInt(u.style.bottom)+u.clientHeight+10:z=h,p.style.bottom=`${z}px`,m.style.bottom=`${z+3}px`}else p&&(n.removeChild(p),p.removeEventListener("click",()=>{})),p=void 0,m&&(n.removeChild(m),m.removeEventListener("click",()=>{})),m=void 0}}},setMapEngineRangingTool(n){let A=document.getElementById(this.containerID),e=document.getElementById(`${this.containerID}-MapEngineRangingToolDistance`),t=document.getElementById(`${this.containerID}-MapEngineRangingToolSurface`),i=document.getElementById(`${this.containerID}-MapEngineRangingToolTriangles`),r=document.getElementById(`${this.containerID}-MapEngineRangingToolSectional`),s=document.getElementById(`${this.containerID}-MapEngineRangingToolVolume`);if(n&&window.rangingToolDiv){let o=this.MapPlugins_Temp?.scale??1,a=35*o,l=35*o;e||(e=document.createElement("img"),e.id=`${this.containerID}-MapEngineRangingToolDistance`,A.appendChild(e),e.addEventListener("click",()=>{this.rangingToolType=1,this.rangingToolClick()}),e.addEventListener("mouseenter",this.rangingToolMouseenter),e.addEventListener("mouseleave",this.rangingToolMouseleave)),e.src=k.getRangingToolIconList(1),e.style.position="absolute",e.style.width=`${a}px`,e.style.height=`${l}px`,e.style.zIndex=3,e.style.bottom=window.rangingToolDiv.style.bottom,e.style.right=`${parseInt(window.rangingToolDiv.style.right)+10+a}px`,t||(t=document.createElement("img"),t.id=`${this.containerID}-MapEngineRangingToolSurface`,A.appendChild(t),t.addEventListener("click",()=>{this.rangingToolType=2,this.rangingToolClick()}),t.addEventListener("mouseenter",this.rangingToolMouseenter),t.addEventListener("mouseleave",this.rangingToolMouseleave)),t.src=k.getRangingToolIconList(2),t.style.position="absolute",t.style.width=`${a}px`,t.style.height=`${l}px`,t.style.zIndex=3,t.style.bottom=window.rangingToolDiv.style.bottom,t.style.right=`${parseInt(e.style.right)+10+a}px`,window.isGPUSupport&&!this.force2D&&(i||(i=document.createElement("img"),i.id=`${this.containerID}-MapEngineRangingToolTriangles`,A.appendChild(i),i.addEventListener("click",()=>{this.rangingToolType=3,this.rangingToolClick()}),i.addEventListener("mouseenter",this.rangingToolMouseenter),i.addEventListener("mouseleave",this.rangingToolMouseleave)),i.src=k.getRangingToolIconList(3),i.style.position="absolute",i.style.width=`${a}px`,i.style.height=`${l}px`,i.style.zIndex=3,i.style.bottom=window.rangingToolDiv.style.bottom,i.style.right=`${parseInt(t.style.right)+10+a}px`,i.style.display="none",r||(r=document.createElement("img"),r.id=`${this.containerID}-MapEngineRangingToolSectional`,A.appendChild(r),r.addEventListener("click",()=>{this.rangingToolType=4,this.rangingToolClick()}),r.addEventListener("mouseenter",this.rangingToolMouseenter),r.addEventListener("mouseleave",this.rangingToolMouseleave)),r.src=k.getRangingToolIconList(4),r.style.position="absolute",r.style.width=`${a}px`,r.style.height=`${l}px`,r.style.zIndex=3,r.style.bottom=window.rangingToolDiv.style.bottom,r.style.right=`${parseInt(i.style.right)+10+a}px`,r.style.display="none")}else e&&(A.removeChild(e),e.removeEventListener("click",()=>{})),e=void 0,t&&(A.removeChild(t),t.removeEventListener("click",()=>{})),t=void 0,i&&(A.removeChild(i),i.removeEventListener("click",()=>{})),i=void 0,r&&(A.removeChild(r),r.removeEventListener("click",()=>{})),r=void 0,s&&(A.removeChild(s),s.removeEventListener("click",()=>{})),s=void 0},rangingToolClick(){k.clearMapTool(this.containerID),window.rangingToolDiv.src=k.getRangingToolIconByType(this.rangingToolType,this.isBeginRangingTool),this.isBeginRangingTool&&setTimeout(()=>{switch(this.rangingToolType){case 1:k.createDistanceTool(this.containerID);break;case 2:k.createAreaTool(this.containerID);break;case 3:k.createTrianglesTool(this.containerID);break;case 4:k.createSectionalTool(this.containerID);break}},70),this.setMapEngineRangingTool(!1)},rangingToolMouseenter(){this.rangingToolHideTimer&&(clearTimeout(this.rangingToolHideTimer),this.rangingToolHideTimer=void 0)},rangingToolMouseleave(){this.rangingToolHideTimer||(this.rangingToolHideTimer=setTimeout(()=>{this.setMapEngineRangingTool(!1)},300))},setMapEngineOperation(){this.isDragging=this.MapConfiguration_Temp?.isDrag??!0;let n=k.getMapEngineInstance(this.cesiumID);if(n){let e=n.scene.screenSpaceCameraController;this.isDragging?e.enableInputs=!0:e.enableInputs=!1}else{let A=k.getMapEngineInstance(this.maptalksID);A&&(this.isDragging?(A.config("draggable",!0),A.config("scrollWheelZoom",!0)):(A.config("draggable",!1),A.config("scrollWheelZoom",!1)))}},cesiumCameraChanged(){let e=k.getMapEngineInstance(this.cesiumID).scene.camera,t=document.getElementById(`${this.containerID}-MapEngineMapMode`);if(t){let r=parseInt(Cesium.Math.toDegrees(e.pitch));r<=-85&&r>=-95?(this.currentMapState2D=!0,e.switchToOrthographicFrustum()):(this.currentMapState2D=!1,e.switchToPerspectiveFrustum()),t.src=k.getMapModeIcon(this.currentMapState2D)}let i=document.getElementById(`${this.containerID}-MapEnginecompassNeedle`);if(i){let r=Cesium.Math.toDegrees(e.heading);i.style.transform=`rotate(${r}deg)`}if(!this.isKeyDown&&!window.isStartMapModeChange&&!this.initializeMap&&this.setMapEngineStateBar(),!this.heatMapUpdateTimer){let r=k.getHeatMaps();r&&[...r.values()].forEach(s=>{s.hasOwnProperty("updateRadius")&&s.updateRadius()}),this.heatMapUpdateTimer=setTimeout(()=>{this.heatMapUpdateTimer=void 0},500)}if(window.sceneIntegrator&&window.sceneIntegrator.update(),window.AxisInstance)window.AxisInstance.axisInstance_.updateAxis();else{let r=k.getAirRoutes();r&&[...r.values()].forEach(s=>{s.isEditable_&&s.hasOwnProperty("axisInstance_")&&s.axisInstance_&&s.axisInstance_.hasOwnProperty("updateAxis")&&(window.AxisInstance=s,window.AxisInstance.axisInstance_.updateAxis())})}},cesiumCameraMoveEnd(){window.AxisInstance&&window.AxisInstance.axisInstance_.updateAxis(),this.initializeMap&&(this.initializeMap=!1);const n=k.getMapEngineInstance(this.cesiumID),A=n.scene,e=A.camera;if(!window.isStartMapModeChange){const t=A.canvas,i=e.pickEllipsoid(new Cesium.Cartesian2(t.width/2,t.height/2)),r=k.transformCoordinate(i);r&&(this.MapEngine_Temp.center={longitude:r.longitude,latitude:r.latitude})}!this.isLoadInitMapTerrainHeight&&window.mousePosition&&k.getTerrainHeight(n,window.mousePosition).then(t=>{window.mousePosition=t.position,this.isLoadInitMapTerrainHeight=!0,this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}),this.MapEngine_Temp.camera={heading:parseInt(Cesium.Math.toDegrees(e.heading)),pitch:parseInt(Cesium.Math.toDegrees(e.pitch))},window.isOpenSyncZoomLensCamera||(this.syncZoom(k.getZoom(this.containerID)),this.setMapEngineStateBar(),this.refreshZoom())},cesiumScenePostRender(n){this.stats&&this.stats.update()},setEditElement(){const n=k.getAnnotations(),A=k.getPipeLines(),e=k.getAirRoutes(),t=k.getCustomNoFlyZones();return[...n.values(),...A.values(),...e.values(),...t.values()].find(i=>i.isEditable_)},async cesiumLeftDown(n){if(!(!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection)&&(this.isLeftDown=!0,n.position)){let A=k.getMapEngineInstance(this.cesiumID),e=A.scene,t=k.getCartesian(e,n.position);Cesium.defined(t)||(A.scene.screenSpaceCameraController.enableInputs=!1);const i=await k.pickFeature(A,n.position);let r=!1,s=!1;if(i&&i.primitive instanceof Cesium.Model&&typeof i.id=="string"&&i.id.includes("-&-ZYWL-&-Axis-")){let o=k.extractionID(i.id);window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-Axis-ArrowX"?window.DragElementIndex=9e3:i.id===o+"-&-ZYWL-&-Axis-ArrowY"?window.DragElementIndex=9001:i.id===o+"-&-ZYWL-&-Axis-ArrowYN"?window.DragElementIndex=90010:i.id===o+"-&-ZYWL-&-Axis-ArrowZ"?window.DragElementIndex=9002:i.id===o+"-&-ZYWL-&-Axis-SphereX"?window.DragElementIndex=9020:i.id===o+"-&-ZYWL-&-Axis-SphereY"?window.DragElementIndex=9021:i.id===o+"-&-ZYWL-&-Axis-SphereZ"&&(window.DragElementIndex=9022),window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&(r=!0,e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableInputs=!1,window.DragElement.mouseDown(n,window.DragElementIndex))}if(r||s)return;if(window.EditElement=this.setEditElement(),i){if(i.primitive instanceof Cesium.GroundPrimitive&&i.id instanceof Cesium.Entity)i.id.id&&i.id.id.includes("-&-ZYWL-&-HeatMap")||i.id.name&&i.id.name.includes("-&-ZYWL-&-VectorData-0");else if(!(i.primitive instanceof Cesium.Cesium3DTileset&&!i.id)){if(i.primitive instanceof Cesium.Model&&typeof i.id=="string"&&i.id.includes("-&-ZYWL-&-Axis-")){e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableInputs=!1;let o=k.extractionID(i.id);window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-Axis-ArrowX"?window.DragElementIndex=9e3:i.id===o+"-&-ZYWL-&-Axis-ArrowY"?window.DragElementIndex=9001:i.id===o+"-&-ZYWL-&-Axis-ArrowYN"?window.DragElementIndex=90010:i.id===o+"-&-ZYWL-&-Axis-ArrowZ"?window.DragElementIndex=9002:i.id===o+"-&-ZYWL-&-Axis-SphereX"?window.DragElementIndex=9020:i.id===o+"-&-ZYWL-&-Axis-SphereY"?window.DragElementIndex=9021:i.id===o+"-&-ZYWL-&-Axis-SphereZ"&&(window.DragElementIndex=9022),window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&window.DragElement.mouseDown(n,window.DragElementIndex)}else if(!(i.primitive instanceof Cesium.Primitive&&typeof i.id=="string"&&i.id.includes("-&-ZYWL-&-Axis-")))if(k.judgmentAllowDrag(i,e)){if(typeof i.id=="string"){let o=i.id,a=k.extractionID(o);o.includes("-&-ZYWL-&-GeometryEditingPolygonWall")?(window.DragElement=k.getAirRoute(a),o===a+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"?window.DragElementIndex=9990:o===a+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"?window.DragElementIndex=9991:o.includes("-&-ZYWL-&-GeometryEditingPolygonWall-BottomPoint-")?window.DragElementIndex=-k.extractionIndex(o):o.includes("-&-ZYWL-&-GeometryEditingPolygonWall-TopPoint-")&&(window.DragElementIndex=k.extractionIndex(o))):o.includes("-&-ZYWL-&-GeometryEditingCircleWall")?(window.DragElement=k.getAirRoute(a),o===a+"-&-ZYWL-&-GeometryEditingCircleWallMinCenter"?window.DragElementIndex=0:o===a+"-&-ZYWL-&-GeometryEditingCircleWallMaxCenter"?window.DragElementIndex=10:o===a+"-&-ZYWL-&-GeometryEditingCircleWallMinRadiusCenter"?window.DragElementIndex=1:o===a+"-&-ZYWL-&-GeometryEditingCircleWallMaxRadiusCenter"?window.DragElementIndex=11:o===a+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"?window.DragElementIndex=90:o===a+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline"&&(window.DragElementIndex=91)):o.includes("-&-ZYWL-&-GeometryEditingSlantPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAirRoute(a)):o===a+"-&-ZYWL-&-PointOfInterest"?(window.DragElementIndex=99999,window.DragElement=k.getAirRoute(a)):o===a+"-&-ZYWL-&-TakeOffBillboard"?(window.DragElementIndex=-99999,window.DragElement=k.getAirRoute(a)):o.includes("-&-ZYWL-&-GraphicEditingPoint")?(window.DragElementIndex=void 0,window.DragElement=k.getAnnotation(a),window.DragElement||(window.DragElement=k.getPipeLine(a))):o.includes("-&-ZYWL-&-GraphicEditingPolyline-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAnnotation(a),window.DragElement||(window.DragElement=k.getPipeLine(a))):o.includes("-&-ZYWL-&-GraphicEditingPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAnnotation(a)):o.includes("-&-ZYWL-&-CustomGraphicEditingPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getCustomNoFlyZone(a)):o.includes("-&-ZYWL-&-GraphicEditingCircleRadius-Point")?(window.DragElementIndex=1,window.DragElement=k.getAnnotation(a)):o.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadius-Point")?(window.DragElementIndex=1,window.DragElement=k.getCustomNoFlyZone(a)):o.includes("-&-ZYWL-&-GraphicEditingCircleCenter-Point")?(window.DragElementIndex=0,window.DragElement=k.getAnnotation(a)):o.includes("-&-ZYWL-&-CustomGraphicEditingCircleCenter-Point")?(window.DragElementIndex=0,window.DragElement=k.getCustomNoFlyZone(a)):o.includes("-&-ZYWL-&-GraphicEditingIcon")?window.DragElement=k.getAnnotation(a):o.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||o.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-")||o.includes("-&-ZYWL-&-GeometryEditingPolygon-Point-")||o.includes("-&-ZYWL-&-GeometryEditingGroundPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAirRoute(a)):o.includes("-&-ZYWL-&-GeometryEditingCircleRadius-Point")?(window.DragElementIndex=1,window.DragElement=k.getAirRoute(a)):o.includes("-&-ZYWL-&-GeometryEditingCircleCenter-Point")&&(window.DragElementIndex=0,window.DragElement=k.getAirRoute(a))}window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&window.DragElement.mouseDown(n,window.DragElementIndex)}else{if(i.primitive instanceof Cesium.Primitive&&typeof i.id=="string"){let o=k.extractionID(i.id);i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"||i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"?(window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"?window.DragElementIndex=9990:i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"&&(window.DragElementIndex=9991)):(i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"||i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline")&&(window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"?window.DragElementIndex=90:i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline"&&(window.DragElementIndex=91))}window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&window.DragElementIndex&&(e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableInputs=!1,window.DragElement.mouseDown(n,window.DragElementIndex))}}}}},async cesiumLeftUp(n){this.leftDownMoveTimer&&(clearTimeout(this.leftDownMoveTimer),this.leftDownMoveTimer=void 0);const A=k.getMapEngineInstance(this.cesiumID);if(A.container.style.cursor="",this.isAltLeftDownMove&&(this.isAltLeftDownMove=!1,A.scene.screenSpaceCameraController.enableInputs=!0),this.isShiftLeftDownMove&&(this.isShiftLeftDownMove=!1,A.scene.screenSpaceCameraController.enableInputs=!0),this.startMousePosition=void 0,this.ctrlRotateCenter=void 0,window.nodeDragPlane=void 0,!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection)return;this.isLeftDown=!1;let e=A.scene;if(this.timer&&(clearTimeout(this.timer),this.timer=void 0),this.timer=setTimeout(()=>{e.screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableInputs=!0,this.isCanvasLeftDownMove&&(this.isCanvasLeftDownMove=!1)},100),n.position){const t=await k.pickFeature(A,n.position);this.isLeftDownMove&&(this.isLeftDownMove=!1),window.DragElement&&(window.DragElement.hasOwnProperty("mouseUp")?window.DragElement.mouseUp(n,window.DragElementIndex):window.DragElement.hasOwnProperty("emitGraphChanged")&&t&&typeof t.id=="string"&&(window.DragElement.dataClass_==="AirRoutes"||window.DragElement.dataClass_==="Annotations"||window.DragElement.dataClass_==="PipeLines"||window.DragElement.dataClass_==="CustomNoFlyZones"?window.DragElement?.isStartDraw_||(console.log(123),window.DragElement.emitGraphChanged("update",k.extractionIndex(t.id))):(console.log(456),window.DragElement.emitGraphChanged("update"))),window.DragElement=void 0,window.DragElementIndex=void 0)}},async cesiumLeftClick(n){if(!(!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection)&&(this.isLeftDownMove||(this.isLeftClick=!0,this.leftDownMoveTimer&&(clearTimeout(this.leftDownMoveTimer),this.leftDownMoveTimer=void 0)),this.isLeftClick)){if(n.position){let A=k.getMapEngineInstance(this.cesiumID),e=k.getCartesian(A.scene,n.position);e&&this.MapClickHandler({coordinate:k.transformCoordinate(e)}),A.scene;const t=await k.pickFeature(A,n.position);if(t&&!window.EditElement){let i=t.id;if(typeof i=="string"){let r=k.extractionID(i);const s=new Map([...k.getNoFlys(),...k.getAnnotations(),...k.getCustomNoFlyZones(),...k.getPipeLines(),...k.getModels(),...k.getAirRoutes(),...k.getPointCloudRecognitions(),...k.getLargeDatas()]);let o;o||(o=s.get(r));let a=k.extractionIndex(i);o&&(a!==void 0&&i.includes("-&-ZYWL-&-")&&i.includes("-Point-")&&!o.isStartDraw_?(this.GraphNodeClickHandler({ID:o.data_.ID,data:o.data_,class:o.dataClass_,index:a}),window.EditElement=void 0):o.isEditable_?window.EditElement=cA.cloneDeep(o):this.GraphClickHandler({ID:o.data_.ID,data:o.data_,class:o.dataClass_,index:a}))}}window.EditElement&&window.EditElement.hasOwnProperty("mouseClick")&&window.EditElement.mouseClick(n)}this.isLeftClick=!1}},cesiumLeftDownAndCtrl(n){if(n.position){let e=k.getMapEngineInstance(this.cesiumID).scene,t=k.getCartesian(e,n.position);Cesium.defined(t)?this.ctrlRotateCenter=n.position:e.screenSpaceCameraController.enableInputs=!1}},async cesiumLeftUpAndCtrl(n){if(!this.isDragging||this.isBeginRangingTool)return;let A=k.getMapEngineInstance(this.cesiumID);if(A){let e=A.scene;e.screenSpaceCameraController.enableInputs=!0;let t=e.camera;this.refreshZoom(),n.position&&(await k.pickFeature(A,n.position)||(this.MapEngine_Temp.camera={heading:parseInt(Cesium.Math.toDegrees(t.heading)),pitch:parseInt(Cesium.Math.toDegrees(t.pitch))}))}this.ctrlRotateCenter=void 0},cesiumLeftAndCtrlMouseMove(){this.ctrlRotateCenter&&k.createMapFocusIcon(this.containerID,this.ctrlRotateCenter,!0)},async cesiumMouseMove(n){const A=k.getMapEngineInstance(this.cesiumID),e=A.scene;if(!(!this.isDragging||this.isBeginRangingTool)){if(this.isLeftDown)k.removeAll(this.containerID),this.leftDownMoveTimer||(this.leftDownMoveTimer=setTimeout(()=>{this.isLeftDownMove=!0,this.isCanvasLeftDownMove=!0},300)),window.DragElement?window.DragElement.hasOwnProperty("mouseMove")&&window.DragElement.mouseMove(n,window.DragElementIndex):A.container.style.cursor="grabbing";else if((this.isWheelDown||this.isRightDown)&&(A.container.style.cursor="grabbing",this.refreshZoom(),this.isWheelDown&&this.wheelCenter&&k.createMapFocusIcon(this.containerID,this.wheelCenter,!0),this.isRightDown&&this.zoomCenter&&k.createMapFocusIcon(this.containerID,this.zoomCenter,!0)),n.endPosition){if(!this.isRightDown&&!this.isWheelDown){const i=k.getCartesian(e,n.endPosition);i&&(window.mousePosition=cA.cloneDeep(i),k.getTerrainHeight(A,window.mousePosition).then(r=>{this.mouseCoordinate=[Number(r.coordinate.longitude.toFixed(9)),Number(r.coordinate.latitude.toFixed(9))],this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}))}window.HighlightElement&&window.HighlightElement.hasOwnProperty("primitivesHighlighted")&&window.HighlightElement.primitivesHighlighted(!1,window.HighlightType,window.HighlightIndex),window.HighlightElement=void 0,window.HighlightIndex=void 0,window.HighlightType=void 0;const t=await k.pickFeature(A,n.endPosition);if(t&&t.primitive){let r=t.id,s;if(typeof r=="string"){if(s=k.extractionID(r),r===s+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline")window.EditElement&&window.EditElement.hasOwnProperty("isStartDraw_")&&!window.EditElement.isStartDraw_&&window.EditElement.hasOwnProperty("isStartPullUP_")&&!window.EditElement.isStartPullUP_&&window.EditElement.hasOwnProperty("wallHeight_")&&window.EditElement.wallHeight_&&k.setCustomCursor(this.cesiumID,"n-resize");else{let l=!1;(r===s+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline")&&(l=!0),l?window.EditElement&&window.EditElement.hasOwnProperty("isStartDraw_")&&!window.EditElement.isStartDraw_&&window.EditElement.hasOwnProperty("isStartPullUP_")&&!window.EditElement.isStartPullUP_&&window.EditElement.hasOwnProperty("wallHeight_")&&window.EditElement.wallHeight_&&k.setCustomCursor(this.cesiumID,"n-resize"):k.recoverCursor(this.cesiumID,"n-resize")}window.HighlightIndex=k.extractionIndex(r);const a=new Map([...k.getModels(),...k.getFlightPaths(),...k.getNoFlys(),...k.getAnnotations(),...k.getCustomNoFlyZones(),...k.getPipeLines(),...k.getAirRoutes(),...k.getLargeDatas(),...k.getVectorDatas()]);window.HighlightElement||(window.HighlightElement=a.get(s))}else if(r instanceof Cesium.Entity&&(t.primitive instanceof Cesium.GroundPrimitive||t.primitive instanceof Cesium.GroundPolylinePrimitive)){let a=r.entityCollection;if(a){let l=a.owner;l&&l.name&&l.name.includes("-&-ZYWL-&-VectorData")&&(s=k.extractionID(l.name),window.HighlightElement||(window.HighlightElement=k.getVectorData(s),window.HighlightIndex=r.id),k.recoverCursor(this.cesiumID,"n-resize"))}}let o=!1;t.primitive instanceof Cesium.Model&&typeof r=="string"&&r.includes("-&-ZYWL-&-Axis-")&&(o=!0,window.HighlightType=r.split("-Axis-")[1],s=k.extractionID(r),window.HighlightElement=k.getAirRoute(s)),o&&(window.HighlightType=void 0,(r===s+"-&-ZYWL-&-Axis-ArrowX"||r===s+"-&-ZYWL-&-Axis-ArrowY"||r===s+"-&-ZYWL-&-Axis-ArrowYN"||r===s+"-&-ZYWL-&-Axis-ArrowZ"||r===s+"-&-ZYWL-&-Axis-SphereX"||r===s+"-&-ZYWL-&-Axis-SphereY"||r===s+"-&-ZYWL-&-Axis-SphereZ")&&(window.HighlightType=r.split("-Axis-")[1],s=k.extractionID(r),window.HighlightElement=k.getAirRoute(s))),window.HighlightElement&&window.HighlightElement.hasOwnProperty("primitivesHighlighted")&&window.HighlightElement.primitivesHighlighted(!0,window.HighlightType,window.HighlightIndex)}}}},cesiumWheel(){this.isDragging&&this.refreshZoom()},cesiumMiddleDown(n){if(this.isDragging&&(this.isWheelDown=!0,n.position)){const A=k.getMapEngineInstance(this.cesiumID);let e=k.getCartesian(A.scene,n.position);e&&(this.wheelCenter=A.scene.cartesianToCanvasCoordinates(e,new Cesium.Cartesian2))}},cesiumMiddleUp(){if(!this.isDragging)return;this.isWheelDown=!1;const n=k.getMapEngineInstance(this.cesiumID);n.container.style.cursor="",this.wheelCenter=void 0,k.createMapFocusIcon(this.containerID,this.wheelCenter,!1)},cesiumRightDown(n){this.isDragging&&(this.isRightDown=!0,this.zoomCenter=n.position)},cesiumRightUp(){if(!this.isDragging)return;this.isRightDown=!1;const n=k.getMapEngineInstance(this.cesiumID);n.container.style.cursor="",this.zoomCenter&&(this.zoomCenter=void 0,k.createMapFocusIcon(this.containerID,void 0,!1))},async cesiumRightClick(n){if(k.removeMenu(this.cesiumID),!this.isDragging)return;const A=k.getMapEngineInstance(this.cesiumID);if(A){const e=A.scene;if(n.position){const t=await k.pickFeature(A,n.position);if(t){if(typeof t.id=="string"){let i=t.id,r=k.extractionID(i),s=k.extractionIndex(i);s&&(s=Number(s));let o,a=!0,l="删除图形",D,P;if(t.primitive instanceof Cesium.Label)(i.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||i.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))&&(o||(o=k.getAirRoute(r)),D=o.isCopy_,P=!0,l="删除端点",o&&(a=o.isDelete_,o.data_.coordinates.length<2&&(a=!1)));else if(t.primitive instanceof Cesium.PointPrimitive){if(i.includes("-&-ZYWL-&-GeometryEditingPolygonWall-TopPoint-")||i.includes("-&-ZYWL-&-GeometryEditingPolygonWall-BottomPoint-"))o||(o=k.getAirRoute(r)),l="删除端点";else if(i.includes("-&-ZYWL-&-GraphicEditingPoint"))o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r));else if(i.includes("-&-ZYWL-&-GraphicEditingCircleCenter-Point"))o||(o=k.getAnnotation(r));else if(i.includes("-&-ZYWL-&-CustomGraphicEditingCircleCenter-Point"))o||(o=k.getCustomNoFlyZone(r));else if(i.includes("-&-ZYWL-&-GraphicEditingCircleRadius-Point"))o||(o=k.getAnnotation(r));else if(i.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadius-Point"))o||(o=k.getCustomNoFlyZone(r));else if(i.includes("-&-ZYWL-&-GraphicEditingPolyline-Point-")){if(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r)),o&&o.data_.coordinates.length<=2)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GraphicEditingPolygon-Point-")){if(o||(o=k.getAnnotation(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon-Point-")){if(o||(o=k.getCustomNoFlyZone(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||i.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))o||(o=k.getAirRoute(r)),D=o.isCopy_,l="删除端点",o&&(a=o.isDelete_,o.data_.coordinates.length<2&&(a=!1));else if(i.includes("-&-ZYWL-&-GeometryEditingPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingGroundPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingCircleCenter-Point"))o||(o=k.getAirRoute(r));else if(i.includes("-&-ZYWL-&-GeometryEditingCircleRadius-Point"))o||(o=k.getAirRoute(r));else if(i.includes("-&-ZYWL-&-GeometryEditingSlantPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点"}}else if(t.primitive instanceof Cesium.Billboard){if(i===r+"-&-ZYWL-&-PointOfInterest")o||(o=k.getAirRoute(r)),l="删除兴趣点",s=99999;else if(i.includes("-&-ZYWL-&-GraphicEditingPolyline-Point-")){if(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r)),o&&o.data_.coordinates.length<=2)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GraphicEditingPolygon-Point-")){if(o||(o=k.getAnnotation(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon-Point-")){if(o||(o=k.getCustomNoFlyZone(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GraphicEditingIcon"))o||(o=k.getAnnotation(r));else if(i.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||i.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))o||(o=k.getAirRoute(r)),D=o.isCopy_,l="删除端点",o&&(a=o.isDelete_,o.data_.coordinates.length<2&&(a=!1));else if(i.includes("-&-ZYWL-&-GeometryEditingPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingGroundPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}}else t.primitive instanceof Cesium.Primitive?i.includes("-&-ZYWL-&-GraphicEditingPolyline")?(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r))):i.includes("-&-ZYWL-&-GraphicEditingPolygon")||i.includes("-&-ZYWL-&-GraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircle")||i.includes("-&-ZYWL-&-GraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircleRadiusPolyline")?o||(o=k.getAnnotation(r)):i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon")||i.includes("-&-ZYWL-&-CustomGraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircle")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadiusPolyline")?o||(o=k.getCustomNoFlyZone(r)):i.includes("-&-ZYWL-&-GeometryEditingPolyline")||i.includes("-&-ZYWL-&-GeometryEditingPolygon")||i.includes("-&-ZYWL-&-GeometryEditingPolygonOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircle")||i.includes("-&-ZYWL-&-GeometryEditingCircleOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircleRadiusPolyline")?o||(o=k.getAirRoute(r)):i.includes("-&-ZYWL-&-GeometryEditingSlantPolygon")&&(o||(o=k.getAirRoute(r)),l="删除被测区"):t.primitive instanceof Cesium.GroundPolylinePrimitive?i.includes("-&-ZYWL-&-GraphicEditingPolyline")?(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r))):i.includes("-&-ZYWL-&-GraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircleRadiusPolyline")?o||(o=k.getAnnotation(r)):i.includes("-&-ZYWL-&-CustomGraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadiusPolyline")?o||(o=k.getCustomNoFlyZone(r)):(i.includes("-&-ZYWL-&-GeometryEditingPolyline")||i.includes("-&-ZYWL-&-GeometryEditingPolygonOutline")||i.includes("-&-ZYWL-&-GeometryEditingGroundPolygonOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircleOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircleRadiusPolyline")||i.includes("-&-ZYWL-&-GeometryEditingBandingPolyline"))&&(o||(o=k.getAirRoute(r))):t.primitive instanceof Cesium.GroundPrimitive&&(i.includes("-&-ZYWL-&-GraphicEditingPolygon")||i.includes("-&-ZYWL-&-GraphicEditingCircle")?o||(o=k.getAnnotation(r)):i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircle")?o||(o=k.getCustomNoFlyZone(r)):(i.includes("-&-ZYWL-&-GeometryEditingPolygon")||i.includes("-&-ZYWL-&-GeometryEditingGroundPolygon")||i.includes("-&-ZYWL-&-GeometryEditingCircle"))&&(o||(o=k.getAirRoute(r))));o&&k.getMenu(this.containerID,n.position,l,a&&o.isDelete_,()=>{if(k.removeMenu(this.containerID),s===99999){window.isPointOfInterestOpen=!1;let c=document.getElementById(`${this.containerID}-MapEnginePointOfInterest`);c&&(c.src=bo.getIconBase64("PointOfInterestClose.png"))}o.hasOwnProperty("mouseRightClick")&&o.mouseRightClick(s)},D,c=>{k.removeMenu(this.containerID),o.hasOwnProperty("copyPoint")&&o.copyPoint(s,c)},s,P,c=>{k.removeMenu(this.containerID),console.log("设置禁止返回点",c),k.emitNoReturnNode({index:c})})}}else{const i=k.getCartesian(e,n.position);i&&k.emitMapRightClick({windowPosition:n.position,coordinate:k.transformCoordinate(i)})}}}},cesiumLeftDoubleClick(n){},async cesiumAltAndLeftDown(n){const A=k.getMapEngineInstance(this.cesiumID),e=await k.pickFeature(A,n.position);if(Cesium.defined(e)&&((e?.primitive instanceof Cesium.PointPrimitive||e?.primitive instanceof Cesium.Billboard)&&e?.id.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||e?.primitive instanceof Cesium.Label&&e?.id.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))){const t=k.extractionID(e?.id),i=k.getAirRoute(t);if(i&&i.isEditable_)return}this.isAltLeftDownMove=!0,A.scene.screenSpaceCameraController.enableInputs=!1},cesiumAltAndLeftUp(){if(this.isAltLeftDownMove){this.isAltLeftDownMove=!1;let n=k.getMapEngineInstance(this.cesiumID);n.scene.screenSpaceCameraController.enableInputs=!0,this.startMousePosition=void 0}},cesiumAltAndLeftMouseMove(n){this.isAltLeftDownMove&&(this.mousePosition=n.endPosition,this.Looking())},Looking(){if(this.startMousePosition||(this.startMousePosition=this.mousePosition.clone()),this.startMousePosition.equals(this.mousePosition))return;const n=this.mousePosition.x-this.startMousePosition.x,A=this.mousePosition.y-this.startMousePosition.y,e=k.getMapEngineInstance(this.cesiumID),t=e.scene.camera,i=e.scene.ellipsoid.geodeticSurfaceNormal(t.position,new Cesium.Cartesian3);t.look(i,n*this.lookFactor),t.look(t.right,A*this.lookFactor),this.startMousePosition=this.mousePosition.clone()},cesiumLeftDownAndShift(n){let A=k.getMapEngineInstance(this.cesiumID);A.scene.screenSpaceCameraController.enableInputs=!1;let e=k.getCartesian(A.scene,n.position);Cesium.defined(e)&&(this.isShiftLeftDownMove=!0)},cesiumLeftUpAndShift(){this.isShiftLeftDownMove=!1;const n=k.getMapEngineInstance(this.cesiumID);n.container.style.cursor="",n.scene.screenSpaceCameraController.enableInputs=!0},cesiumMouseMoveAndShift(n){if(this.isShiftLeftDownMove){const A=k.getMapEngineInstance(this.cesiumID);A.container.style.cursor="grabbing";const e=n.startPosition.x-n.endPosition.x,t=n.startPosition.y-n.endPosition.y;this.ShiftLooking(e,t)}},ShiftLooking(n,A){let t=k.getMapEngineInstance(this.cesiumID).scene.camera;n>0?t.moveRight(Math.abs(n)+20):n<0&&t.moveLeft(Math.abs(n)+20),A>0?t.moveDown(Math.abs(A)+20):A<0&&t.moveUp(Math.abs(A)+20),this.adjustHeightForTerrain()},setMapLocation(){const n=this.MapLocation_Temp?.type??0,A=this.MapLocation_Temp?.radius??100,e=this.MapLocation_Temp?.duration??0,t=this.MapLocation_Temp?.maxZoom??16;let i=k.getMapEngineInstance(this.cesiumID);if(i)switch(n){case 0:{let r=k.computeMultipointCenter(this.MapLocation_Temp.positions),s=this.MapLocation_Temp.positions.map(l=>Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(l.longitude,l.latitude,l.altitude),r)),o=Math.max(...s),a=new Cesium.BoundingSphere(r,o);i.scene.camera.flyToBoundingSphere(a,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),a.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(a.center),k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}break;case 1:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.get3DTileset(r)),s){let o;if(s.data_.type===3||s.data_.type===5)if(s.pcdCenter_||s.plyCenter_)s.pcdCenter_&&(o=new Cesium.BoundingSphere(s.pcdCenter_,1e3)),s.plyCenter_&&(o=new Cesium.BoundingSphere(s.plyCenter_,1e3));else return;else o=s.tilesetInstance_.boundingSphere;console.log(o),o&&i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),o.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(o.center),this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break;case 2:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.getModel(r)),s){let o=s.modelInstance_.boundingSphere;i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),o.radius+A),complete:a=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(o.center),this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break;case 3:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.getVectorData(r)),s){let o=new Cesium.BoundingSphere(k.transformCartesian3(s.center_),s.radius_);i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),o.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=s.center_,this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break;case 4:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.getAirRoute(r)),s){let o=s.geometryInstance_._boundingSpheres[0],l=s.geometryInstance_.geometryInstances.geometry._polygonHierarchy.positions.map(h=>k.transformCoordinate(h)),D=k.computeNormalVector(l);D.y<0&&Cesium.Cartesian3.negate(D,D);let{heading:P,pitch:c}=k.computeHeadingAndPitch(o.center,D);i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(P),Cesium.Math.toRadians(c),o.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(o.center),this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break}else{let r=k.getMapEngineInstance(this.maptalksID);if(r)switch(n){case 0:{let s=this.MapLocation_Temp.positions.map(P=>[P.longitude,P.latitude]),o=d0(s),a=nw(ad(Fs(o)),A,{units:"meters"}),l=Fs(a),D=new Bn(l[0],l[1],l[2],l[3]);r.fitExtent(D,0,{duration:e},P=>{P.playState==="finished"&&(this.MapLocation_Temp=void 0,r.getZoom()>t&&r.setZoom(t))})}break;case 3:{let s=this.MapLocation_Temp.ID,o;if(s&&(o=k.getVectorData(s)),o&&Array.isArray(o.primitives_)){let a=[];for(const c of o.primitives_){let h=c.getExtent().toJSON(),g=[h.xmin,h.ymin,h.xmax,h.ymax];a.push(ad(g))}let l=xa(a),D=Fs(l),P=new Bn(D[0],D[1],D[2],D[3]);r.fitExtent(P,0,{duration:e},c=>{c.playState==="finished"&&(this.MapLocation_Temp=void 0,r.getZoom()>t&&r.setZoom(t))})}}break}}},async setZYWLMapLayers(){if(this.MapLayers_IsUpdating=!0,this.MapLayers_Timer=setTimeout(()=>{this.MapLayers_IsUpdating=!1,this.MapLayers_Timer=void 0},this.MapLayers_UpdateInterval),this.MapConfiguration_Temp?.isAR??!1)return;let A=this.MapEngine_Temp?.token?.appID,e=this.MapEngine_Temp?.token?.appSign,t=k.getMapEngineInstance(this.maptalksID),i=k.getMapEngineInstance(this.cesiumID),r=k.getMapEngineInstance(this.openlayersID),s,o,a=[],l=[],D,P=k.ArraySortByKey(cA.cloneDeep(this.MapLayers_Temp),"zIndex");if(i){let h=k.getMapLayers("cesium");h&&await this.processArrayAsync(h,([g,u])=>{console.log("使用异步方式处理数组",g,u);let Q;this.MapLayers_Temp.length&&this.MapLayers_Temp.find(C=>C.ID+"-cesium"===g)||(Q=JSON.parse(u.imageryProvider.credit.html)),Q&&Q.layerID&&(k.removeMapLayer(Q.layerID),i.imageryLayers.remove(u))})}else if(r){D=k.getOLLayerByID(r,"GroupTilesOL");let h=k.getMapLayers("openlayers");h&&await this.processArrayAsync(h,g=>{let u=g[1],Q;this.MapLayers_Temp.length&&this.MapLayers_Temp.find(C=>C.ID+"-openlayers"===g[0])||(Q=u.getProperties().id),Q&&(k.removeMapLayer(Q),D.pop(u))})}else{if(s=t.getLayer("group-tiles"),s){let h=s.getLayers();this.MapLayers_Temp?.length?await this.processArrayAsync(h,g=>{let u=g.getId();this.MapLayers_Temp.find(w=>w.ID+"-maptalks"===u)||(s.removeLayer([g]),k.removeMapLayer(u))}):await this.processArrayAsync(h,g=>{let u=g.getId();s.removeLayer([g]),k.removeMapLayer(u)})}if(o=t.getLayer("group-header-tiles"),o){let h=o.getLayers();this.MapLayers_Temp.length?await this.processArrayAsync(h,g=>{let u=g.getId();this.MapLayers_Temp.find(w=>w.ID+"-maptalks"===u)||(o.removeLayer([g]),k.removeMapLayer(u))}):await this.processArrayAsync(h,g=>{let u=g.getId();o.removeLayer([g]),k.removeMapLayer(u)})}}const c=this.MapEngine_Temp?.customStyle??void 0;if(await this.processArrayAsync(this.MapLayers_Temp,async h=>{let g=k.getMapLayerID(h.ID),u=h?.visible??!0,Q=h?.opacity??1,w=h?.zIndex??0;h.hasOwnProperty("appID")&&h.appID&&h.appID.length&&(A=h.appID),h.hasOwnProperty("appSign")&&h.appSign&&h.appSign.length&&(e=h.appSign);let C,E;i?(C=g.cesiumLayerID,E=h?.splitDirection,E?E==="left"?E=Cesium.SplitDirection.LEFT:E==="right"?E=Cesium.SplitDirection.RIGHT:E=Cesium.SplitDirection.NONE:E=Cesium.SplitDirection.NONE,window.sliderHandler||(E=Cesium.SplitDirection.NONE)):r?C=g.openlayersLayerID:C=g.maptalksLayerID;let p=!1,m;try{(await new Promise(z=>{if(i)if(m=k.getMapLayer(C),m){let L={layerID:C,zIndex:w};m.imageryProvider._credit._html=JSON.stringify(L),m.alpha=Q,m.show=u,m.splitDirection=E}else{p=!0;let L=k.getTileLayerCesium(h,A,e);if(L&&(m=new Cesium.ImageryLayer(L,{show:u,splitDirection:E}),i.imageryLayers.add(m),c)){let b=Cesium.Color.fromCssColorString(k.setMapColor(c));if(b){const U=new RGA({bgColor:b,alpha:.5,invert:!0,preMultiplyAlpha:!0});let Y=m._createTextureWebGL;m._createTextureWebGL=function(R,J){let F=Y.bind(this)(R,J);return U.processTexture(R,F)||F}}}}else r?(m=k.getMapLayer(C),m?(m.setVisible(u),m.setZIndex(w),m.setOpacity(Q)):(p=!0,m=k.getTileLayerOL(h,A,e),m&&D.push(m))):(m=k.getMapLayer(C),m?(u?m.show():m.hide(),m.setZIndex(w),m.setOpacity(Q)):(p=!0,m=k.getTileLayerMaptalks(h),m&&(A&&e&&o?l.push(m):a.push(m))));z({obj:m,isNew:p})})).isNew&&k.setMapLayer(C,m)}catch(T){console.error(`处理MapLayers>>>>> ${C} 时出错:`,T)}}),i)k.sortCesiumLayers(i,P);else{let h;c&&(h=k.setMapCssFilter(c)),l.length&&(o?o.addLayer(l):o=new t9("group-header-tiles",l,{renderer:window.mapRenderer,cssFilter:h}).addEventListener("renderercreate",function(g){g.renderer.loadTileImage=function(u,Q){const w=new XMLHttpRequest;w.withCredentials=!0,w.responseType="blob",w.open("GET",Q),w.setRequestHeader("Access-Control-Allow-Origin","*"),w.setRequestHeader("appid",A),w.setRequestHeader("sign",e),w.onload=function(){const C=URL.createObjectURL(w.response);u.addEventListener("load",function(){URL.revokeObjectURL(C)}),u.crossOrigin="Anonymous",u.src=C},w.send()}}),t.addLayer(o)),a.length&&(s?s.addLayer(a):s=new t9("group-tiles",a,{renderer:window.mapRenderer,cssFilter:h}).addEventListener("renderercreate",function(g){g.renderer.loadTileImage=function(u,Q){u.crossOrigin="Anonymous",u.src=Q}}),t.addLayer(s))}},async setZYWLTilesets(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,s=>{const o=s.ID.toString();let a=k.get3DTileset(o);a&&(k.remove3DTileset(o),a.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,s=>{const o=s.ID.toString();let a=k.get3DTileset(o);a&&a.DataProcessing(cA.cloneDeep(s))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=e.added??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,s=>{const o=s.ID.toString();let a=new ZJA(this.cesiumID,n);a&&(k.set3DTileset(o,a),a.DataProcessing(cA.cloneDeep(s)))}),console.log(`新增了${n}数据>>>>>>>>>>`,r))})},async setZYWLModels(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getModel(a);l&&(k.removeModel(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getModel(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new usA(this.cesiumID,n):l=new gsA(this.maptalksID,n),l&&(k.setModel(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLPointCloudRecognitions(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,s=>{const o=s.ID.toString();let a=k.getPointCloudRecognition(o);a&&(k.removePointCloudRecognition(o),a.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,s=>{const o=s.ID.toString();let a=k.getPointCloudRecognition(o);a&&a.DataProcessing(cA.cloneDeep(s))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=e.added??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,s=>{const o=s.ID.toString();let a=new sGA(this.cesiumID,n);a&&(k.setPointCloudRecognition(o,a),a.DataProcessing(cA.cloneDeep(s)))}),console.log(`新增了${n}数据>>>>>>>>>>`,r))})},async setZYWLNoFlys(n,A){await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getNoFly(l);D&&(k.removeNoFly(l),D.clear())},500),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getNoFly(l);D&&D.DataProcessing(cA.cloneDeep(a))},500),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,async a=>{const l=a.ID.toString();let D;switch(a.type){case 1:s?D=new uGA(this.cesiumID,n):D=new DGA(this.maptalksID,n);break;case 2:s?D=new _m(this.cesiumID,n):D=new QsA(this.maptalksID,n);break;case 3:s?D=new QGA(this.cesiumID,n):D=new PGA(this.maptalksID,n);break;case 4:s?D=new cGA(this.cesiumID,n):D=new oGA(this.maptalksID,n);break;case 5:s?D=new gGA(this.cesiumID,n):D=new lGA(this.maptalksID,n);break}D&&(k.setNoFly(l,D),D.DataProcessing(cA.cloneDeep(a)))},500).then(a=>{console.log("新增完成")}),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},async setZYWLAnnotations(n,A){await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getAnnotation(l);D&&(k.removeAnnotation(l),D.clear())},500),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getAnnotation(l);D&&D.DataProcessing(cA.cloneDeep(a))},500),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,a=>{const l=a.ID.toString();var D;switch(a.type){case 1:s?D=new vsA(this.cesiumID,n):D=new fsA(this.maptalksID,n);break;case 2:s?D=new CsA(this.cesiumID,n):D=new KS(this.maptalksID,n);break;case 3:s?D=new vGA(this.cesiumID,n):D=new dsA(this.maptalksID,n);break;case 4:s?D=new fGA(this.cesiumID,n):D=new wsA(this.maptalksID,n);break;case 5:s?D=new dGA(this.cesiumID,n):D=new wGA(this.maptalksID,n);break}D&&(k.setAnnotation(l,D),D.DataProcessing(cA.cloneDeep(a)))},500),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},async setZYWLFlightPaths(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getFlightPath(a);l&&(k.removeFlightPath(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getFlightPath(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new hGA(this.cesiumID,n):l=new aGA(this.maptalksID,n),l&&(k.setFlightPath(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLPipeLines(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getPipeLine(a);l&&(k.removePipeLine(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getPipeLine(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;switch(o.type){case 1:r?l=new vsA(this.cesiumID,n):l=new fsA(this.maptalksID,n);break;case 2:r?l=new CsA(this.cesiumID,n):l=new KS(this.maptalksID,n);break}l&&(k.setPipeLine(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLOrthophotes(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getOrthophote(a);l&&(k.removeOrthophote(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getOrthophote(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new jGA(this.cesiumID,n):l=new yGA(this.maptalksID,n),l&&(k.setOrthophote(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLAirRoutes(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getAirRoute(a);l&&(k.removeAirRoute(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getAirRoute(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;switch(o.type){case 2:r?l=new KR(this.cesiumID,n):l=new KS(this.maptalksID,n);break;case 3:r?l=new xGA(this.cesiumID,n):l=new dsA(this.maptalksID,n);break;case 4:r?l=new zGA(this.cesiumID,n):l=new wsA(this.maptalksID,n);break;case 5:r&&(l=new UGA(this.cesiumID,n));break;case 6:r&&(l=new LGA(this.cesiumID,n));break;case 7:r&&(l=new NGA(this.cesiumID,n));break;case 8:r&&(l=new bGA(this.cesiumID,n));break}l&&(k.setAirRoute(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLHeatMaps(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getHeatMap(a);l&&(k.removeHeatMap(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getHeatMap(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new msA(this.cesiumID,n):l=new msA(this.maptalksID,n),l&&(k.setHeatMap(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLVideoProjections(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getVideoProjection(a);l&&(k.removeVideoProjection(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getVideoProjection(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new joA(this.cesiumID,n):l=new joA(this.maptalksID,n),l&&(k.setVideoProjection(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLVectorDatas(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getVectorData(a);l&&(k.removeVectorData(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getVectorData(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new UoA(this.cesiumID,n):l=new UoA(this.maptalksID,n),l&&(k.setVectorData(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLS3Ms(n,A){k.isSupportWebGL2()&&await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getS3M(l);D&&(k.removeS3M(l),D.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getS3M(l);D&&D.DataProcessing(cA.cloneDeep(a))}),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,a=>{const l=a.ID.toString();let D;s&&(D=new FGA(this.cesiumID,n)),D&&(k.setS3M(l,D),D.DataProcessing(cA.cloneDeep(a)))}),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},async setZYWLRadar(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getRadar(a);l&&(k.removeRadar(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getRadar(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r&&(l=new SGA(this.cesiumID,n)),l&&(k.setRadar(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLCustomNoFlyZones(n,A){await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getCustomNoFlyZone(l);D&&(k.removeCustomNoFlyZone(l),D.clear())},500),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getCustomNoFlyZone(l);D&&D.DataProcessing(cA.cloneDeep(a))},500),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,a=>{const l=a.ID.toString();var D;switch(a.type){case 3:s?D=new kGA(this.cesiumID,n):D=new TGA(this.maptalksID,n);break;case 4:s?D=new OGA(this.cesiumID,n):D=new MGA(this.maptalksID,n);break}D&&(k.setCustomNoFlyZone(l,D),D.DataProcessing(cA.cloneDeep(a)))},500),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},MapClickHandler(n){this.$emit("onMapClick",n)},GraphClickHandler(n){const A=this.setEditElement(),e=A?.data_?.ID,t=n?.ID;!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection||A&&e!==t||this.$emit("onGraphClick",n)},GraphNodeClickHandler(n){!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection||this.$emit("onGraphNodeClick",n)},GraphChangingHandler(n){this.$emit("onGraphChanging",n)},GraphChangedHandler(n){this.$emit("onGraphChanged",n)},GraphRemovedHandler(n){this.$emit("onGraphRemoved",n)},GraphEditedHandler(n){this.$emit("onGraphEdited",n)},MapInitCompletedHandler(n){this.$emit("onMapInitCompleted",n)},MapRightClickHandler(n){this.$emit("onMapRightClick",n)},NoReturnNodeHandler(n){this.$emit("onNoReturnNode",n)},setWindowKey(){document.addEventListener("keydown",n=>{this.activeKeys.add(n.code),((this.activeKeys.has("ControlLeft")||this.activeKeys.has("ControlRight")||this.activeKeys.has("AltLeft")||this.activeKeys.has("AltRight")||this.activeKeys.has("ShiftLeft")||this.activeKeys.has("ShiftRight"))&&(this.activeKeys.has("ArrowUp")||this.activeKeys.has("ArrowDown")||this.activeKeys.has("ArrowLeft")||this.activeKeys.has("ArrowRight"))||this.activeKeys.has("ArrowUp")||this.activeKeys.has("ArrowDown")||this.activeKeys.has("ArrowLeft")||this.activeKeys.has("ArrowRight")||this.activeKeys.has("Equal")||this.activeKeys.has("Minus"))&&n.preventDefault(),this.rafId||this.onFrame()}),document.addEventListener("keyup",n=>{this.activeKeys.delete(n.code),this.activeKeys.size||(cancelAnimationFrame(this.rafId),this.rafId=0,this.cb())}),document.addEventListener("blur",()=>{this.activeKeys&&this.activeKeys.clear(),cancelAnimationFrame(this.afId),this.rafId=0,this.cb()})},onFrame(){this.activeKeys&&this.activeKeys.size&&this.cb(),this.rafId=requestAnimationFrame(this.onFrame)},adjustHeightForTerrain(){const A=k.getMapEngineInstance(this.cesiumID).scene.screenSpaceCameraController,e=!0,t=A._scene,i=t.mode;if(i===Cesium.SceneMode.SCENE2D||i===Cesium.SceneMode.MORPHING)return;const r=t.camera,s=t.ellipsoid??Cesium.Ellipsoid.WGS84,o=t.mapProjection;let a,l;Cesium.Matrix4.equals(r.transform,Cesium.Matrix4.IDENTITY)||(a=Cesium.Matrix4.clone(r.transform,new Cesium.Matrix4),l=Cesium.Cartesian3.magnitude(r.position),r._setTransform(Cesium.Matrix4.IDENTITY));const D=new Cesium.Cartographic;i===Cesium.SceneMode.SCENE3D?s.cartesianToCartographic(r.position,D):o.unproject(r.position,D);let P=!1;if(D.height<A._minimumCollisionTerrainHeight){const c=A._scene.globeHeight;if(Cesium.defined(c)){const h=c+A.minimumZoomDistance;(c-A._lastGlobeHeight)/A._lastGlobeHeight,D.height<h&&e&&(D.height=h,i===Cesium.SceneMode.SCENE3D?s.cartographicToCartesian(D,r.position):o.project(D,r.position),P=!0),A._lastGlobeHeight=c}}Cesium.defined(a)&&(r._setTransform(a),P&&(Cesium.Cartesian3.normalize(r.position,r.position),Cesium.Cartesian3.negate(r.position,r.direction),Cesium.Cartesian3.multiplyByScalar(r.position,Math.max(l,A.minimumZoomDistance),r.position),Cesium.Cartesian3.normalize(r.direction,r.direction),Cesium.Cartesian3.cross(r.direction,r.up,r.right),Cesium.Cartesian3.cross(r.right,r.direction,r.up)))},cb(){const n=k.getMapEngineInstance(this.cesiumID),A=k.getMapEngineInstance(this.maptalksID);if(this.activeKeys&&this.activeKeys.size){let i=!1,r=!1,s=!1,o=!1,a=!1,l=!1,D=!1,P=!1,c=!1;if(this.activeKeys.has("ArrowUp")&&(i=!0),this.activeKeys.has("ArrowDown")&&(r=!0),this.activeKeys.has("ArrowLeft")&&(s=!0),this.activeKeys.has("ArrowRight")&&(o=!0),(this.activeKeys.has("Equal")||this.activeKeys.has("NumpadAdd"))&&(a=!0),(this.activeKeys.has("Minus")||this.activeKeys.has("NumpadSubtract"))&&(l=!0),(this.activeKeys.has("ControlLeft")||this.activeKeys.has("ControlRight"))&&(D=!0),(this.activeKeys.has("AltLeft")||this.activeKeys.has("AltRight"))&&(P=!0),(this.activeKeys.has("ShiftLeft")||this.activeKeys.has("ShiftRight"))&&(c=!0),n){let h=n.scene,g=h.canvas,u=h.camera;const Q=25;if(i||r||s||o)if(c){k.createMapFocusIcon(this.containerID,void 0,!1),this.isKeyDown=!0,this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0;let w=0,C=0;s&&(w=-3),o&&(w=3),i&&(C=-3),r&&(C=3),this.ShiftLooking(w,C)}else if(D){if(this.isKeyDown=!0,!this.rotateCenter){const w=new Cesium.Cartesian2(g.width/2,g.height/2);this.rotateCenter=k.getCartesian(h,w),this.rotateCenter&&(u.lookAtTransform(Cesium.Matrix4.IDENTITY),u.lookAtTransform(Cesium.Transforms.eastNorthUpToFixedFrame(this.rotateCenter)),k.createMapFocusIcon(this.containerID,w,!0))}if(this.rotateCenter){const w=Cesium.Math.toRadians(.5);s&&u.rotateLeft(w),o&&u.rotateRight(w),i&&u.rotateDown(w),r&&u.rotateUp(w),this.adjustHeightForTerrain()}}else if(P){k.createMapFocusIcon(this.containerID,void 0,!1),this.isKeyDown=!0,this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0;const w=h.ellipsoid.geodeticSurfaceNormal(u.position,new Cesium.Cartesian3);let C=0,E=0;s&&(C=-.5),o&&(C=.5),i&&(E=-.5),r&&(E=.5),u.look(w,Cesium.Math.toRadians(C)),u.look(u.right,Cesium.Math.toRadians(E))}else k.createMapFocusIcon(this.containerID,void 0,!1),this.isKeyDown=!0,this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0,s&&u.moveLeft(Q),o&&u.moveRight(Q),i&&u.rotateDown(Cesium.Math.toRadians(3e-4)),r&&u.rotateUp(Cesium.Math.toRadians(3e-4));else if(a||l){if(!this.zoomCenter){const w=new Cesium.Ray(u.position,u.direction),C=Cesium.IntersectionTests.rayEllipsoid(w,h.globe.ellipsoid);if(C){const E=Cesium.Ray.getPoint(w,C.start);this.zoomCenter=h.cartesianToCanvasCoordinates(E,new Cesium.Cartesian2)}this.zoomCenter&&k.createMapFocusIcon(this.containerID,this.zoomCenter,!0)}a&&u.move(u.direction,50),l&&u.move(Cesium.Cartesian3.negate(u.direction,new Cesium.Cartesian3),50),this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}else this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0,this.zoomCenter=void 0,this.ctrlRotateCenter||k.createMapFocusIcon(this.containerID,void 0,!1)}else if(A){if(i||r||s||o){const h=A.getZoom(),g=A.getCenter();var e=0;i&&!r&&!s&&!o&&(e=0),i&&!r&&s&&!o&&(e=-45),i&&!r&&!s&&o&&(e=45),!i&&r&&!s&&!o&&(e=180),!i&&r&&s&&!o&&(e=225),!i&&r&&!s&&o&&(e=135),!i&&!r&&s&&!o&&(e=-90),!i&&!r&&!s&&o&&(e=90);var t=kr(Gt([g.x,g.y]),20,e,{units:"meters"});A.setCenterAndZoom(t.geometry.coordinates,h)}else if(a||l){const h=A.getCenter();let g=A.getZoom();a&&(g=g+.1,A.setCenterAndZoom(h,g)),l&&(g=g-.1,A.setCenterAndZoom(h,g))}}}else if(this.isKeyDown=!1,n){let r=n.scene.camera;this.rotateCenter&&r.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0,this.zoomCenter=void 0,k.createMapFocusIcon(this.containerID,void 0,!1),this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}},createTileLoadProgressIcon(){let n=document.getElementById(`${this.containerID}-MapEngineStateBarDiv`);if(n){let A=document.getElementById(`${this.containerID}-MapTileLoadProgressDiv`),e=document.getElementById(`${this.containerID}-MapTileLoadProgressTextDiv`);const t=this.MapPlugins_Temp?.scale??1,i=32*t,r=14*t;if(!A){A=document.createElement("canvas"),A.id=`${this.containerID}-MapTileLoadProgressDiv`,A.style.position="absolute",n.appendChild(A),A.width="24",A.height=i,A.style.zIndex=6,A.style.left="60px";const s=A.getContext("2d"),o=6;s.translate(o,o)}e||(e=document.createElement("div"),e.id=`${this.containerID}-MapTileLoadProgressTextDiv`,e.style.position="absolute",n.appendChild(e),e.style.color="#fff",e.style.width=`${120*t}px`,e.style.height=`${i}px`,e.style.fontSize=`${r}px`,e.style.zIndex=6,e.style.alignContent="center",e.style.left="84px",e.style.paddingLeft="5px")}},drawCircle(n){let A=document.getElementById(`${this.containerID}-MapTileLoadProgressDiv`),e=document.getElementById(`${this.containerID}-MapTileLoadProgressTextDiv`);if(A){const i=32*(this.MapPlugins_Temp?.scale??1),r=A.getContext("2d"),s=6;r.clearRect(-s,-s,A.width,A.height),r.beginPath(),r.arc((24-s*2)*.5,(i-s*2)*.5,s,1.5*Math.PI,2*Math.PI*n/100+1.5*Math.PI),r.strokeStyle="#fff",r.lineWidth=3,r.stroke()}n<0&&(n=0),n>100&&(n=100),e&&(e.textContent=`${n}%`)}}};function kXA(n,A,e,t,i,r){return null}const bXA=yXA(OXA,[["render",kXA]]);class rD{static calculateBeiDouGridCode=(A,e=2)=>{function t(w,C,E,p,m="N",T,z=2){let L,b;switch(p){case 1:L=6,b=4;break;case 2:L=30/60,b=30/60;break;case 3:L=15/60,b=10/60;break;case 4:L=1/60,b=1/60;break;case 5:L=4/60/60,b=4/60/60;break;case 6:L=2/60/60,b=2/60/60;break;case 7:L=1/4/60/60,b=1/4/60/60;break;case 8:L=1/32/60/60,b=1/32/60/60;break;case 9:L=1/256/60/60,b=1/256/60/60;break;case 10:L=1/2048/60/60,b=1/2048/60/60;break}let U,Y,R,J,F,X;if(p===1){switch(m){case"N":U={longitude:w.longitude+(E-1)*L,latitude:w.latitude+C*b},Y={longitude:w.longitude+E*L,latitude:w.latitude+C*b},R={longitude:w.longitude+E*L,latitude:w.latitude+(C-1)*b},J={longitude:w.longitude+(E-1)*L,latitude:w.latitude+(C-1)*b},F="West-North",X=R,E>30&&(F="East-North",X=J);break;case"S":U={longitude:w.longitude+(E-1)*L,latitude:w.latitude-(C-1)*b},Y={longitude:w.longitude+E*L,latitude:w.latitude-(C-1)*b},R={longitude:w.longitude+E*L,latitude:w.latitude-C*b},J={longitude:w.longitude+(E-1)*L,latitude:w.latitude-C*b},F="West-South",X=Y,E>30&&(F="East-South",X=U);break}let W=m,q=String(E).padStart(2,"0"),_=String.fromCharCode(64+C);return{level:p,code:`${W}${q}${_}`,row:C,col:E,hemisphere:F,startCoord:X,coordinates:[U,Y,R,J]}}else if(p===2||p===3||p===4||p===5||p===6||p===7||p===8||p===9||p===10){switch(m){case"West-North":U={longitude:w.longitude-(E+1)*L,latitude:w.latitude+(C+1)*b},Y={longitude:w.longitude-E*L,latitude:w.latitude+(C+1)*b},R={longitude:w.longitude-E*L,latitude:w.latitude+C*b},J={longitude:w.longitude-(E+1)*L,latitude:w.latitude+C*b},X=R;break;case"East-North":U={longitude:w.longitude+E*L,latitude:w.latitude+(C+1)*b},Y={longitude:w.longitude+(E+1)*L,latitude:w.latitude+(C+1)*b},R={longitude:w.longitude+(E+1)*L,latitude:w.latitude+C*b},J={longitude:w.longitude+E*L,latitude:w.latitude+C*b},X=J;break;case"West-South":U={longitude:w.longitude-(E+1)*L,latitude:w.latitude-C*b},Y={longitude:w.longitude-E*L,latitude:w.latitude-C*b},R={longitude:w.longitude-E*L,latitude:w.latitude-(C+1)*b},J={longitude:w.longitude-(E+1)*L,latitude:w.latitude-(C+1)*b},X=Y;break;case"East-South":U={longitude:w.longitude+E*L,latitude:w.latitude-C*b},Y={longitude:w.longitude+(E+1)*L,latitude:w.latitude-C*b},R={longitude:w.longitude+(E+1)*L,latitude:w.latitude-(C+1)*b},J={longitude:w.longitude+E*L,latitude:w.latitude-(C+1)*b},X=U;break}if(p===2){let W=E;return E>=10&&(W=String.fromCharCode(64+(E-9))),{level:p,code:`${T}${W}${C}`,row:C,col:E,hemisphere:m,startCoord:X,coordinates:[U,Y,R,J]}}if(p===3){let W=E*2+C;return{level:p,code:`${T}${W}`,row:C,col:E,hemisphere:m,startCoord:X,coordinates:[U,Y,R,J]}}if(p===4){let W=E;return E>=10&&(W=String.fromCharCode(64+(E-9))),{level:p,code:`${T}${W}${C}`,row:C,col:E,hemisphere:m,startCoord:X,coordinates:[U,Y,R,J]}}}}console.time("计算北斗网格");const i={longitude:-180,latitude:0};let r=22,s=60;const o=[];for(let w=1;w<=r;w++)for(let C=1;C<=s;C++)o.push(t(i,w,C,1,"N",e)),o.push(t(i,w,C,1,"S",e));const a=[],l=[],D=[],P=[],c=[],h=[],g=[],u=[],Q=[];for(let w=2;w<=A;w++){let C;w===2?(r=8,s=12,C=o):w===3?(r=3,s=2,C=a):w===4?(r=10,s=15,C=l):w===5?(r=15,s=15,C=D):w===6?(r=2,s=2,C=P):w===7?(r=8,s=8,C=c):w===8?(r=8,s=8,C=h):w===9?(r=8,s=8,C=g):w===10&&(r=8,s=8,C=u);for(const E of C)for(let p=0;p<r;p++)for(let m=0;m<s;m++){let T=t(E.startCoord,p,m,w,E.hemisphere,E.code,e);w===2?a.push(T):w===3?l.push(T):w===4?D.push(T):w===5?P.push(T):w===6?c.push(T):w===7?h.push(T):w===8?g.push(T):w===9?u.push(T):w===10&&Q.push(T)}}return console.log(o,a,l,D),console.timeEnd("计算北斗网格"),{firstGrids:o,secondGrids:a,thirdGrids:l,fourthGrids:D,fifthGrids:P,sixthGrids:c,seventhGrids:h,eighthGrids:g,ninthGrids:u,tenthGrids:Q}};static calculatePointToLineDistance=(A,e)=>{var t;Array.isArray(A)?t=Gt(A):t=Gt([A.longitude,A.latitude]);var i=yo(e.map(r=>Array.isArray(r)?r:[A.longitude,A.latitude]));return LDA(t,i,{units:"meters"})};static calculateBearing=(A,e,t,i)=>{const r=Math.PI/180,s=180/Math.PI,o=A*r,a=t*r,l=(i-e)*r,D=Math.sin(l)*Math.cos(a),P=Math.cos(o)*Math.sin(a)-Math.sin(o)*Math.cos(a)*Math.cos(l);return(Math.atan2(D,P)*s+360)%360};static calculatePixel=(A,e,t,i,r,s,o,a,l=0,D=-90)=>{let P,c,h;if(Array.isArray(A)?(P=A[0],c=A[1],h=A[2]):(P=A?.longitude,c=A?.latitude,h=A?.altitude??A?.height),D===-90)A={longitude:P,latitude:c};else{D=Math.abs(D);let m=Math.tan(k.degreesToRadians(90-D))*h;A=this.rhumbDestination(A,m,l)}let g=this.haversineDistance(e.latitude,e.longitude,t.latitude,t.longitude)*1e3,u=this.haversineDistance(e.latitude,e.longitude,i.latitude,i.longitude)*1e3,Q=this.haversineDistance(A.latitude,A.longitude,a.latitude,a.longitude)*1e3,w=this.calculateBearing(A.latitude,A.longitude,a.latitude,a.longitude),C=parseInt(w/90);w=w%90;let E=s*.5,p=o*.5;if(w===0)switch(C){case 0:case 4:p=o*.5-Q/(u*.5)*(o*.5);break;case 1:E=s*.5+Q/(g*.5)*(s*.5);break;case 2:p=o*.5+Q/(u*.5)*(o*.5);break;case 3:E=s*.5-Q/(g*.5)*(s*.5);break}else{w=k.degreesToRadians(w);let m,T;switch(C){case 0:m=Math.sin(w)*Q,E=s*.5+m/(g*.5)*(s*.5),T=Math.cos(w)*Q,p=o*.5-T/(u*.5)*(o*.5);break;case 1:m=Math.cos(w)*Q,E=s*.5+m/(g*.5)*(s*.5),T=Math.sin(w)*Q,p=o*.5+T/(u*.5)*(o*.5);break;case 2:m=Math.sin(w)*Q,E=s*.5-m/(g*.5)*(s*.5),T=Math.cos(w)*Q,p=o*.5+T/(u*.5)*(o*.5);break;case 3:m=Math.cos(w)*Q,E=s*.5-m/(g*.5)*(s*.5),T=Math.sin(w)*Q,p=o*.5-T/(u*.5)*(o*.5);break}}return{x:E,y:p}};static destination=(A,e,t)=>{const i=63710088e-1,r=Math.PI/180,s=180/Math.PI;let o,a;Array.isArray(A)?(o=A[0],a=A[1]):(o=A.longitude,a=A.latitude);const l=o*r,D=a*r,P=t*r,c=e/i,h=Math.asin(Math.sin(D)*Math.cos(c)+Math.cos(D)*Math.sin(c)*Math.cos(P));return{longitude:(l+Math.atan2(Math.sin(P)*Math.sin(c)*Math.cos(D),Math.cos(c)-Math.sin(D)*Math.sin(h)))*s,latitude:h*s}};static rhumbDestination=(A,e,t)=>{const i=63710088e-1,r=Math.PI/180,s=180/Math.PI;let o,a;Array.isArray(A)?(o=A[0],a=A[1]):(o=A.longitude,a=A.latitude);const l=o*r,D=a*r,P=t*r,c=e/i,h=c*Math.cos(P);let g=D+h;Math.abs(g)>Math.PI/2&&(g=g>0?Math.PI-g:-Math.PI-g);const u=Math.log(Math.tan(g/2+Math.PI/4)/Math.tan(D/2+Math.PI/4)),Q=Math.abs(u)>1e-11?h/u:Math.cos(D),w=c*Math.sin(P)/Q;let E=((l+w)*s+540)%360-180,p=g*s;return E+=E-o>180?-360:o-E>180?360:0,{longitude:E,latitude:p}};static calculateCoordinate=(A,e,t,i,r,s,o=0,a=-90)=>{const{chip_w:l,chip_h:D,focus_w:P,focus_h:c}=k.getCameraTypes(r);let[h,g]=k.zoom2fov(s,l,D,P,c);const u=h/e,Q=g/t;let w,C,E;Array.isArray(A)?(w=A[0],C=A[1],E=A[2]):(w=A?.longitude,C=A?.latitude,E=A?.altitude??A?.height);let p=e*.5,m=t*.5,T,z;Array.isArray(i)?(T=i[0],z=i[1]):(T=i.x,z=i.y);let L=Math.abs(e*.5-T),b=Math.abs(t*.5-z),U=L*u,Y=b*Q;var R;if(a===-90){let J=E*Math.tan(k.degreesToRadians(U)),F=E*Math.tan(k.degreesToRadians(Y));R={longitude:w,latitude:C},T>p?R=this.rhumbDestination(A,J,o+90):T<p&&(R=this.rhumbDestination(A,J,o+270)),z<m?R=this.rhumbDestination(R,F,o):z>m&&(R=this.rhumbDestination(R,F,o+180))}else{a=Math.abs(a);let J=Math.tan(k.degreesToRadians(90-a))*E;R=this.rhumbDestination(A,J,o),z<m?J=Math.tan(k.degreesToRadians(90-a+Y))*E:z>m&&(J=Math.tan(k.degreesToRadians(90-a-Y))*E);let F=L*u;T>p?R=this.rhumbDestination(A,J,o+F):T<p&&(R=this.rhumbDestination(A,J,o-F))}return R};static haversineDistance=(A,e,t,i)=>{const r=63710088e-1,s=P=>P*Math.PI/180,o=s(t-A),a=s(i-e),l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(s(A))*Math.cos(s(t))*Math.sin(a/2)*Math.sin(a/2),D=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return r*D/1e3};static ShortestPathHighSpeed=(A,e,t)=>{class i{constructor(){this.heap=new Array(5e4),this.positions=new Map,this.size=0}push(D,P){if(this.positions.has(D)){const c=this.positions.get(D);if(this.heap[c].fValue<=P)return;this.heap[c].fValue=P,this._bubbleUp(c)}else{const c=this.size;this.heap[c]={node:D,fValue:P},this.positions.set(D,c),this.size++,this._bubbleUp(c)}}pop(){if(this.size===0)return null;const D=this.heap[0];return this.positions.delete(D.node),this.size--,this.size>0&&(this.heap[0]=this.heap[this.size],this.positions.set(this.heap[0].node,0),this._bubbleDown(0)),D}_bubbleUp(D){for(;D>0;){const P=D-1>>1;if(this.heap[P].fValue<=this.heap[D].fValue)break;[this.heap[P],this.heap[D]]=[this.heap[D],this.heap[P]],this.positions.set(this.heap[P].node,P),this.positions.set(this.heap[D].node,D),D=P}}_bubbleDown(D){for(;;){const P=(D<<1)+1,c=(D<<1)+2;let h=D;if(P<this.size&&this.heap[P].fValue<this.heap[h].fValue&&(h=P),c<this.size&&this.heap[c].fValue<this.heap[h].fValue&&(h=c),h===D)break;[this.heap[D],this.heap[h]]=[this.heap[h],this.heap[D]],this.positions.set(this.heap[D].node,D),this.positions.set(this.heap[h].node,h),D=h}}isEmpty(){return this.size===0}}function r(l){const D={},P=new Map,c=(h,g,u)=>{if(D[h]||(D[h]={}),D[g]||(D[g]={}),(!D[h][g]||u<D[h][g])&&(D[h][g]=u,D[g][h]=u),!P.has(h)){const[Q,w]=h.split(",").map(Number);P.set(h,{lat:Q,lon:w})}if(!P.has(g)){const[Q,w]=g.split(",").map(Number);P.set(g,{lat:Q,lon:w})}};for(const h of l.features)if(h.geometry.type==="LineString"){const g=h.geometry.coordinates;for(let u=0;u<g.length-1;u++){const[Q,w]=g[u],[C,E]=g[u+1],p=rD.haversineDistance(w,Q,E,C),m=`${w},${Q}`,T=`${E},${C}`;c(m,T,p)}}return{graph:D,nodes:P}}function s(l,D){const[P,c]=D;let h=1/0,g=null;const u=.01,Q=.01;for(const[w,C]of l)if(Math.abs(C.lat-c)<=u&&Math.abs(C.lon-P)<=Q){const E=rD.haversineDistance(C.lat,C.lon,c,P);E<h&&(h=E,g=w)}if(!g)for(const[w,C]of l){const E=rD.haversineDistance(C.lat,C.lon,c,P);E<h&&(h=E,g=w)}if(!g)throw new Error("未找到路网中的最近节点");return g}function o(l,D,P){if(!l[D]||!l[P])throw new Error("起点或终点不在路网图中");if(D===P)return{path:[D],distance:0};const c=new Map,h=new Map,g=new i,u=new Map,Q=new Map,w=new i;c.set(D,0),u.set(P,0),g.push(D,0),w.push(P,0);let C=null,E=1/0,p=0,m=0;const T=Math.min(5e3,Math.floor(Object.keys(l).length/10));for(;!g.isEmpty()&&p<T;){if(!g.isEmpty()){const{node:z}=g.pop();if(p++,c.get(z)>E)continue;if(u.has(z)){const L=c.get(z)+u.get(z);L<E&&(E=L,C=z)}for(const L in l[z]||{}){const b=c.get(z)+l[z][L];(!c.has(L)||b<c.get(L))&&(c.set(L,b),h.set(L,z),g.push(L,b))}}if(!w.isEmpty()&&m<T){const{node:z}=w.pop();if(m++,u.get(z)>E)continue;if(c.has(z)){const L=c.get(z)+u.get(z);L<E&&(E=L,C=z)}for(const L in l[z]||{}){const b=u.get(z)+l[z][L];(!u.has(L)||b<u.get(L))&&(u.set(L,b),Q.set(L,z),w.push(L,b))}}if(C&&g.isEmpty()&&w.isEmpty()||C&&g.size>0&&w.size>0&&g.heap[0].fValue+w.heap[0].fValue>=E*1.1)break}if(C){const z=[];let L=C;for(;L;)z.unshift(L),L=h.get(L);for(L=Q.get(C);L;)z.push(L),L=Q.get(L);return{path:z,distance:E}}throw new Error(`无法到达终点 ${P}`)}function a(l,D,P){const{graph:c,nodes:h}=r(l),g=s(h,D),u=s(h,P);return o(c,g,u)}console.time("🚗 工业级路网算法");try{const l=a(A,e,t);console.log(`✅ 工业级路径长度: ${l.path.length} 节点`),console.log(`✅ 工业级总距离: ${l.distance.toFixed(4)} 公里`),console.log(`✅ 前向搜索步数: ${Math.floor(l.path.length/2)}`),console.log(`✅ 后向搜索步数: ${Math.floor(l.path.length/2)}`),console.timeEnd("🚗 工业级路网算法");const D=[];D.push({longitude:Number(e[0]),latitude:Number(e[1]),altitude:0});const P=l.path.map(c=>{const h=c.split(",");return{longitude:Number(h[1]),latitude:Number(h[0]),altitude:0}});return D.push(...P),D.push({longitude:Number(t[0]),latitude:Number(t[1]),altitude:0}),D}catch(l){console.error("❌ 错误:",l.message),console.timeEnd("🚗 工业级路网算法")}};static ShortestPathA=(A,e,t)=>{class i{constructor(){this.heap=[],this.nodeToIndex=new Map}push(D,P){if(this.nodeToIndex.has(D)){const c=this.nodeToIndex.get(D);this.heap[c].fValue>P&&(this.heap[c].fValue=P,this.bubbleUp(c))}else{const c=this.heap.length;this.heap.push({node:D,fValue:P}),this.nodeToIndex.set(D,c),this.bubbleUp(c)}}pop(){if(this.heap.length===0)return null;const D=this.heap[0];this.nodeToIndex.delete(D.node);const P=this.heap.pop();return this.heap.length>0&&(this.heap[0]=P,this.nodeToIndex.set(P.node,0),this.bubbleDown(0)),D}bubbleUp(D){for(;D>0;){const P=Math.floor((D-1)/2);if(this.heap[P].fValue<=this.heap[D].fValue)break;[this.heap[P],this.heap[D]]=[this.heap[D],this.heap[P]],this.nodeToIndex.set(this.heap[P].node,P),this.nodeToIndex.set(this.heap[D].node,D),D=P}}bubbleDown(D){for(;;){const P=2*D+1,c=2*D+2;let h=D;if(P<this.heap.length&&this.heap[P].fValue<this.heap[h].fValue&&(h=P),c<this.heap.length&&this.heap[c].fValue<this.heap[h].fValue&&(h=c),h===D)break;[this.heap[D],this.heap[h]]=[this.heap[h],this.heap[D]],this.nodeToIndex.set(this.heap[D].node,D),this.nodeToIndex.set(this.heap[h].node,h),D=h}}isEmpty(){return this.heap.length===0}size(){return this.heap.length}}function r(l){const D={},P=new Map,c=(g,u)=>`${g},${u}`,h=(g,u,Q,w,C)=>{const E=c(g,u),p=c(Q,w);D[E]||(D[E]={}),D[p]||(D[p]={}),(!D[E][p]||C<D[E][p])&&(D[E][p]=C,D[p][E]=C),P.has(E)||P.set(E,{lat:g,lon:u}),P.has(p)||P.set(p,{lat:Q,lon:w})};for(const g of l.features)if(g.geometry.type==="LineString"){const u=g.geometry.coordinates;for(let Q=0;Q<u.length-1;Q++){const[w,C]=u[Q],[E,p]=u[Q+1],m=rD.haversineDistance(C,w,p,E);h(C,w,p,E,m)}}return{graph:D,nodes:P}}function s(l,D){const[P,c]=D;let h=1/0,g=null;for(const[u,Q]of l){const w=rD.haversineDistance(Q.lat,Q.lon,c,P);w<h&&(h=w,g=u)}if(!g)throw new Error("未找到路网中的最近节点,检查坐标是否在路网范围内");return g}function o(l,D,P){if(!l[D])throw new Error(`起点 ${D} 不在路网图中`);if(!l[P])throw new Error(`终点 ${P} 不在路网图中`);const[c,h]=P.split(",").map(Number),g=new Map,u=new Map,Q=new Map,w=new i,C=new Set;g.set(D,0);const E=rD.haversineDistance(...D.split(",").map(Number),c,h);for(u.set(D,E),w.push(D,E);!w.isEmpty();){const{node:p,fValue:m}=w.pop();if(C.has(p))continue;if(C.add(p),p===P){const z=[];let L=P;for(;L;)z.unshift(L),L=Q.get(L);return{path:z,distance:g.get(P)}}const T=l[p]||{};for(const z in T){if(C.has(z))continue;const L=g.get(p)+T[z];if(!g.has(z)||L<g.get(z)){Q.set(z,p),g.set(z,L);const[b,U]=z.split(",").map(Number),Y=rD.haversineDistance(b,U,c,h),R=L+Y;u.set(z,R),w.push(z,R)}}}throw new Error(`无法到达终点 ${P}`)}function a(l,D,P){const{graph:c,nodes:h}=r(l),g=s(h,D),u=s(h,P);return o(c,g,u)}console.time("🚗 优化版A*算法");try{const l=a(A,e,t);console.log(`✅ 优化版路径长度: ${l.path.length} 节点`),console.log(`✅ 优化版总距离: ${l.distance.toFixed(4)} 公里`),console.log(`✅ 开放列表峰值大小: ${l.path.length*2||"N/A"}`),console.timeEnd("🚗 优化版A*算法");const D=[];D.push({longitude:Number(e[0]),latitude:Number(e[1]),altitude:0});const P=l.path.map(c=>{const h=c.split(",");return{longitude:Number(h[1]),latitude:Number(h[0]),altitude:0}});return D.push(...P),D.push({longitude:Number(t[0]),latitude:Number(t[1]),altitude:0}),D}catch(l){console.error("❌ 错误:",l.message),console.timeEnd("🚗 优化版A*算法")}};static ShortestPathDijkstra=(A,e,t)=>{class i{constructor(){this.heap=[]}push(D,P){this.heap.push({node:D,distance:P}),this.bubbleUp(this.heap.length-1)}pop(){if(this.heap.length===0)return null;const D=this.heap[0],P=this.heap.pop();return this.heap.length>0&&(this.heap[0]=P,this.bubbleDown(0)),D}bubbleUp(D){const{heap:P}=this;for(;D>0;){const c=Math.floor((D-1)/2);if(P[c].distance<=P[D].distance)break;[P[c],P[D]]=[P[D],P[c]],D=c}}bubbleDown(D){const{heap:P}=this,c=2*D+1,h=2*D+2;let g=D;c<P.length&&P[c].distance<P[g].distance&&(g=c),h<P.length&&P[h].distance<P[g].distance&&(g=h),g!==D&&([P[D],P[g]]=[P[g],P[D]],this.bubbleDown(g))}isEmpty(){return this.heap.length===0}}function r(l){const D={},P=new Set,c=(g,u)=>`${g},${u}`,h=(g,u,Q,w,C)=>{const E=c(g,u),p=c(Q,w);D[E]||(D[E]={}),D[p]||(D[p]={}),D[E][p]=C,D[p][E]=C,P.add(E),P.add(p)};for(const g of l.features)if(g.geometry.type==="LineString"){const u=g.geometry.coordinates;for(let Q=0;Q<u.length-1;Q++){const[w,C]=u[Q],[E,p]=u[Q+1],m=rD.haversineDistance(C,w,p,E);h(C,w,p,E,m)}}return{graph:D,nodes:P}}function s(l,D){let P=1/0,c=null;for(const h of l){const[g,u]=h.split(",").map(Number),Q=rD.haversineDistance(g,u,D[1],D[0]);Q<P&&(P=Q,c=h)}if(!c)throw new Error("未找到路网中的最近节点,检查坐标是否在路网范围内");return c}function o(l,D,P){if(!l[D])throw new Error(`起点 ${D} 不在路网图中`);if(!l[P])throw new Error(`终点 ${P} 不在路网图中`);const c={},h={},g=new i;for(const w of Object.keys(l))c[w]=1/0;c[D]=0;for(const w of Object.keys(l))g.push(w,c[w]);for(;!g.isEmpty();){const{node:w,distance:C}=g.pop();if(C===c[w]){if(w===P)break;for(const E in l[w]){const p=C+l[w][E];p<c[E]&&(c[E]=p,h[E]=w,g.push(E,p))}}}const u=[];let Q=P;if(!h[Q])throw new Error(`无法到达终点 ${P}`);for(;Q;)u.push(Q),Q=h[Q];return{path:u.reverse(),distance:c[P]}}function a(l,D,P){const{graph:c,nodes:h}=r(l),g=s(h,D),u=s(h,P);return o(c,g,u)}console.time("🚗 Dijkstra");try{const l=a(A,e,t);console.log(`✅ 路径长度: ${l.path.length} 节点`),console.log(`✅ 总距离: ${l.distance.toFixed(4)} 公里`),console.timeEnd("🚗 Dijkstra");const D=[];D.push({longitude:Number(e[0]),latitude:Number(e[1]),altitude:0});const P=l.path.map(c=>{const h=c.split(",");return{longitude:Number(h[1]),latitude:Number(h[0]),altitude:0}});return D.push(...P),D.push({longitude:Number(t[0]),latitude:Number(t[1]),altitude:0}),D}catch(l){console.error("❌ 错误:",l.message)}console.timeEnd("🚗 Dijkstra")};static pointInPolygon=(A,e)=>{const t=A.lon,i=A.lat;let r=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].longitude,l=e[s].latitude,D=e[o].longitude,P=e[o].latitude;l>i!=P>i&&t<(D-a)*(i-l)/(P-l)+a&&(r=!r)}return r};static pointInCircle=(A,e,t)=>this.haversineDistance(A.lat,A.lon,e.latitude,e.longitude)*1e3<=t;static AStar=class{constructor(A,e,t,i,r){this.grid=A,this.start=e,this.end=t,this.obstacles=i,this.openSet=[e],this.closedSet=[],this.cameFrom={},this.gScore={},this.fScore={};for(let s=0;s<A.length;s++)for(let o=0;o<A[s].length;o++){const a=`${o},${s}`;this.gScore[a]=1/0,this.fScore[a]=1/0}this.gScore[`${e.x},${e.y}`]=0,this.fScore[`${e.x},${e.y}`]=this.heuristic(e,t,r)}heuristic(A,e,t){const i=t[1]+A.y*.025,r=t[0]+A.x*.025,s=t[1]+e.y*.025,o=t[0]+e.x*.025;return rD.haversineDistance(i,r,s,o)}getNeighbors(A){const e=[],t=[{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1}];for(const i of t){const r=A.x+i.x,s=A.y+i.y;if(r>=0&&r<this.grid[0].length&&s>=0&&s<this.grid.length){let o=!1;for(const a of this.obstacles)if(a.x===r&&a.y===s){o=!0;break}o||e.push({x:r,y:s})}}return e}findPath(A){for(;this.openSet.length>0;){let e=0;for(let s=1;s<this.openSet.length;s++){const o=`${this.openSet[e].x},${this.openSet[e].y}`,a=`${this.openSet[s].x},${this.openSet[s].y}`;this.fScore[a]<this.fScore[o]&&(e=s)}const t=this.openSet[e],i=`${t.x},${t.y}`;if(t.x===this.end.x&&t.y===this.end.y)return this.reconstructPath(t);this.openSet.splice(e,1),this.closedSet.push(t);const r=this.getNeighbors(t);for(const s of r){const o=`${s.x},${s.y}`;if(this.closedSet.some(D=>D.x===s.x&&D.y===s.y))continue;const a=Math.abs(s.x-t.x)===1&&Math.abs(s.y-t.y)===1,l=this.gScore[i]+(a?1.414:1);l<this.gScore[o]&&(this.cameFrom[o]=t,this.gScore[o]=l,this.fScore[o]=this.gScore[o]+this.heuristic(s,this.end,A),this.openSet.some(D=>D.x===s.x&&D.y===s.y)||this.openSet.push(s))}}return null}reconstructPath(A){const e=[A];let t=`${A.x},${A.y}`;for(;this.cameFrom[t];)A=this.cameFrom[t],e.unshift(A),t=`${A.x},${A.y}`;return e}getExploredNodes(){return this.closedSet}};static initializeGrid=(A,e)=>{const t=[];for(let i=0;i<e;i++){const r=[];for(let s=0;s<A;s++)r.push(0);t.push(r)}return t};static latLonToGrid=(A,e,t,i,r,s,o,a)=>{const l=Math.floor((e-r)/(s-r)*o),D=Math.floor((i-A)/(i-t)*a);return{x:Math.max(0,Math.min(o-1,l)),y:Math.max(0,Math.min(a-1,D))}};static gridToLatLon=(A,e,t,i,r,s,o,a)=>{const l=r+A/o*(s-r);return{lat:i-e/a*(i-t),lon:l}};static calculatePathA=(A,e,t=[],i=5,r=5)=>{console.time("寻路A");function s(g,u,Q){const w=nw(g,50,{units:"meters",steps:2}),C=Fs(w),E=ad(C),p=[],m=[];for(const T of u)vlA(T,E)||dlA(T,E)?p.push(T):m.push(T);if(p.length){const T=xa([E,...p]);return s(T,m,[...p,...Q])}else return{crossesOrWithins:[...Q],bbox:C}}const o=yo([A,e]);let a=!1;const l=[],D=[];for(const g of t){const u=g.coordinates;let Q;switch(g.type){case 3:(u[0].longitude!==u[u.length-1].longitude||u[0].latitude!==u[u.length-1].latitude)&&u.push(u[0]),Q=lP([u.map(E=>[E.longitude,E.latitude])]);break;case 4:Q=bM([u[0].longitude,u[0].latitude],g?.symbol?.radius??100,{steps:50,units:"meters"});break}const w=nw(Q,r,{units:"meters"});D.push(w);const C=uF(w);l.push(C.map(E=>({longitude:E[0],latitude:E[1],altitude:0}))),IF(o,Q)&&(a=!0)}const P=[];if(P.push({latitude:A[1],longitude:A[0],altitude:0}),a){var{bbox:c,crossesOrWithins:h}=s(o,D,[]);const g=this.haversineDistance(c[1],c[0],c[1],c[2])*1e3,u=this.haversineDistance(c[1],c[0],c[3],c[0])*1e3,Q=1e3,w=Math.min(parseInt(g/i),Q),C=Math.min(parseInt(u/i),Q),E=c[0],p=c[1],m=c[2],T=c[3],z=this.latLonToGrid(A[1],A[0],p,T,E,m,w,C),L=this.latLonToGrid(e[1],e[0],p,T,E,m,w,C),b=this.initializeGrid(w,C),U=new Set;for(const J of h){const F=uF(J).map(QA=>({longitude:QA[0],latitude:QA[1],altitude:0})),X=Fs(J),W=X[0],q=X[1],_=X[2],eA=X[3],$=this.latLonToGrid(q,W,p,T,E,m,w,C),iA=this.latLonToGrid(eA,W,p,T,E,m,w,C),AA=this.latLonToGrid(eA,_,p,T,E,m,w,C),TA=this.latLonToGrid(q,_,p,T,E,m,w,C),kA=Math.min($.x,iA.x,AA.x,TA.x),pA=Math.max($.x,iA.x,AA.x,TA.x),IA=Math.min($.y,iA.y,AA.y,TA.y),MA=Math.max($.y,iA.y,AA.y,TA.y);for(let QA=IA;QA<MA;QA++)for(let $A=kA;$A<pA;$A++){const JA=this.gridToLatLon($A,QA,p,T,E,m,w,C);this.pointInPolygon(JA,F)&&U.add({x:$A,y:QA})}}const R=new rD.AStar(b,z,L,[...U],c).findPath(c);if(R?.length)for(let J=1;J<R.length;J++){const F=R[J-1],X=R[J],W=p+(T-p)*(1-F.y/C),q=E+(m-E)*(F.x/w),_=p+(T-p)*(1-X.y/C),eA=E+(m-E)*(X.x/w);J===1&&P.push({latitude:W,longitude:q,altitude:0}),P.push({latitude:_,longitude:eA,altitude:0})}}return P.push({latitude:e[1],longitude:e[0],altitude:0}),a&&this.removeRedundancy(P,h),console.timeEnd("寻路A"),P};static removeRedundancy=(A,e)=>{if(A.length>2){let t=!1;for(let i=0;i<A.length-2;i++){const r=A[i],s=A[i+2],o=yo([[r.longitude,r.latitude],[s.longitude,s.latitude]]);let a=!1;for(const l of e)if(IF(o,l)){a=!0;break}a||(A.splice(i+1,1),t=!0)}t&&this.removeRedundancy(A,e)}};static calculateDistance=A=>{if(A.length!==2)return{hDistance:0,distance:0,vDistance:0,gradient:0};function e(w,C){return Number(Cesium.Cartesian3.distance(w,C).toFixed(2))}function t(w,C){const E=Math.abs(C.height-w.height),p=e(k.transformCartesian3(w),k.transformCartesian3(w)),m=Math.atan(E/p),T=Number(Cesium.Math.toDegrees(m).toFixed(1)),z=E/p*100;let L="";return T<5?L="平缓":T<15?L="缓坡":T<25?L="中坡":T<35?L="陡坡":L="极陡",{distance:p,elevationDiff:E,slopeDegrees:T,slopePercent:z,slopeStatus:L}}const i=A.map(w=>Cesium.Cartographic.fromDegrees(w.longitude,w.latitude,w.altitude)),r=i[0],s=i[1];let o=cA.cloneDeep(s);o.height=cA.cloneDeep(r.height);let a=cA.cloneDeep(s),l=cA.cloneDeep(r);r.height>s.height&&(o=cA.cloneDeep(r.positionCa),o.height=cA.cloneDeep(s.height),a=cA.cloneDeep(r),l=cA.cloneDeep(s));const D=k.transformCartesian3(a),P=k.transformCartesian3(o),c=k.transformCartesian3(l),h=e(P,c),g=e(D,c),u=e(P,D),Q=t(a,l).slopeDegrees;return{hDistance:h,distance:g,vDistance:u,gradient:Q}};static calculateArea=A=>{if(A.length<3)return{pArea:"0平方米",fArea:"0平方米"};const e=A.map(a=>Cesium.Cartesian3.fromDegrees(a.longitude,a.latitude,a.altitude));function t(a,l,D){const P=Cesium.Cartesian3.fromRadians(a.longitude,a.latitude,a.height),c=Cesium.Cartesian3.fromRadians(l.longitude,l.latitude,l.height),h=Cesium.Cartesian3.fromRadians(D.longitude,D.latitude,D.height),g=Cesium.Ellipsoid.WGS84.maximumRadius,u=Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.normalize(c,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3)),Q=Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.normalize(P,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3)),w=Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.normalize(P,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(c,new Cesium.Cartesian3)),C=(u+Q+w)/2,E=Math.sqrt(Math.abs(Math.tan(C/2)*Math.tan((C-u)/2)*Math.tan((C-Q)/2)*Math.tan((C-w)/2)));return 4*Math.atan(E)*g*g}function i(a){if(a.length<3)return 0;const l=a.map(P=>k.transformCartographic(P));let D=0;for(let P=1;P<l.length-1;P++){const c=t(l[0],l[P],l[P+1]);D+=c}return D}function r(a){if(a.length<3)return 0;const l=a.map(P=>{const c=k.transformCartographic(P);return new Cesium.Cartographic(c.longitude,c.latitude,0)});let D=0;for(let P=1;P<l.length-1;P++){const c=[l[0],l[P],l[P+1]],h=Cesium.Cartesian3.fromRadians(c[0].longitude,c[0].latitude,0),g=Cesium.Cartesian3.fromRadians(c[1].longitude,c[1].latitude,0),u=Cesium.Cartesian3.fromRadians(c[2].longitude,c[2].latitude,0),Q=new Cesium.Cartesian3,w=new Cesium.Cartesian3;Cesium.Cartesian3.subtract(g,h,Q),Cesium.Cartesian3.subtract(u,h,w);const C=new Cesium.Cartesian3;Cesium.Cartesian3.cross(Q,w,C);const E=Cesium.Cartesian3.magnitude(C)/2;D+=E}return D}let s=i(e);s=s.toFixed(4)+"平方米";var o=r(e);return o=o.toFixed(4)+"平方米",{pArea:o,fArea:s}};static calculateVolume=(A,e)=>{const t=A?.tilesetUrl;t?Cesium.Cesium3DTileset.fromUrl(t).then(i=>{A.tileset=i,this.calculate(A).then(r=>{e&&e(r)})}):this.calculate(A).then(i=>{e&&e(i)})};static async calculate(A){const{containerID:e,coordinates:t,targetHeight:i,tileset:r,gridSize:s=10}=A;var o=t.map(z=>Cesium.Cartesian3.fromDegrees(z.longitude,z.latitude,z.altitude));const a=k.getMapEngineID(e).cesiumID,l=k.getMapEngineInstance(a),D=l.scene,P=l.terrainProvider;var c=new Map;async function h(z){try{const L=[15,14,13,12,11,10,9,8,7,6,5];for(const b of L){const Y=await Cesium.sampleTerrain(P,b,z);if(Y&&Y.length>0&&Y.filter(J=>J&&J.height!==void 0&&!isNaN(J.height)&&J.height!==Number.POSITIVE_INFINITY&&J.height!==Number.NEGATIVE_INFINITY).length>0)return Y}return Cesium.sampleTerrainMostDetailed(P,z)}catch(L){return console.warn("地形采样失败,使用默认值:",L),z.map(b=>{const U=k.transformCartographic(b);return{longitude:U.longitude,latitude:U.latitude,height:0}})}}async function g(z,L,b){try{const U=Cesium.Cartographic.fromDegrees(z,L);if(b){const R=await D.sampleHeight(U);if(R!=null)return R}const Y=[15,14,13,12,11,10,9,8,7,6,5];for(const R of Y){const F=await Cesium.sampleTerrain(P,R,[U]);if(F&&F.length>0&&F[0].height!==void 0)return F[0].height}}catch(U){console.warn("获取高度失败:",U)}return 0}async function u(z,L,b,U){let Y=[];if(L){new Cesium.Ray;const R=C(z),{minX:J,minY:F,maxX:X,maxY:W}=R;console.log(J,F,X,W);const q=[];for(let _=J;_<=X;_+=U/111e3)for(let eA=F;eA<=W;eA+=U/111e3)q.push(Cesium.Cartesian3.fromDegrees(_,eA,2e3));for(let _=0;_<q.length;_++){const eA=q[_],$=k.transformCoordinate(eA),iA=$.longitude,AA=$.latitude,TA=await g(iA,AA,L);TA!==null&&!isNaN(TA)&&TA!==Number.POSITIVE_INFINITY&&TA!==Number.NEGATIVE_INFINITY&&Y.push(TA)}}else{const R=C(z),{minX:J,minY:F,maxX:X,maxY:W}=R,q=[];for(let $=J;$<=X;$+=U/111e3)for(let iA=F;iA<=W;iA+=U/111e3)q.push(Cesium.Cartesian3.fromDegrees($,iA));Y=(await h(q.map($=>k.transformCartographic($)))).filter($=>$&&$.height!==void 0&&!isNaN($.height)&&$.height!==Number.POSITIVE_INFINITY&&$.height!==Number.NEGATIVE_INFINITY).map($=>$.height)}if(Y.length===0)throw new Error("无法获取地形数据");if(b==="min")return Math.min(...Y);if(b==="avg")return Y.reduce((J,F)=>J+F,0)/Y.length}async function Q(z,L,b){const U=C(z),{minX:Y,minY:R,maxX:J,maxY:F}=U,X=[];for(let iA=Y;iA<=J;iA+=b/111e3)for(let AA=R;AA<=F;AA+=b/111e3)X.push(Cesium.Cartesian3.fromDegrees(iA,AA));const W=await h(X.map(iA=>k.transformCartographic(iA)));if(!W||W.length===0)throw new Error("无法获取地形数据");let q=0,_=0;const eA=b*b,$=W.filter(iA=>iA&&iA.height!==void 0&&!isNaN(iA.height)&&iA.height!==Number.POSITIVE_INFINITY&&iA.height!==Number.NEGATIVE_INFINITY);if($.length===0)throw new Error("没有有效的地形数据");for(let iA=0;iA<$.length;iA++){const TA=$[iA].height-L;TA>0?q+=TA*eA:_+=Math.abs(TA)*eA}return{cut:parseFloat(q.toFixed(2)),fill:parseFloat(_.toFixed(2)),balance:parseFloat((q-_).toFixed(2)),unit:"m³",type:"terrain",targetHeight:L}}async function w(z,L,b,U){let Y=0,R=0;const J=U*U,F=C(L),{minX:X,minY:W,maxX:q,maxY:_}=F,eA=[];for(let $=X;$<=q;$+=U/111e3)for(let iA=W;iA<=_;iA+=U/111e3)eA.push(Cesium.Cartesian3.fromDegrees($,iA,2e3));console.log(eA);for(let $=0;$<eA.length;$++){const iA=eA[$],AA=k.transformCoordinate(iA),TA=AA.longitude,kA=AA.latitude,pA=await g(TA,kA,z);if(pA!==null&&!isNaN(pA)&&pA!==Number.POSITIVE_INFINITY&&pA!==Number.NEGATIVE_INFINITY){const IA=pA-b;IA>0?Y+=IA*J:R+=Math.abs(IA)*J}}return{cut:parseFloat(Y.toFixed(2)),fill:parseFloat(R.toFixed(2)),balance:parseFloat((Y-R).toFixed(2)),unit:"m³",type:"3dtileset",targetHeight:b}}function C(z){let L=1/0,b=1/0,U=-1/0,Y=-1/0;for(const R of z){const J=k.transformCoordinate(R),F=J.longitude,X=J.latitude;L=Math.min(L,F),b=Math.min(b,X),U=Math.max(U,F),Y=Math.max(Y,X)}return{minX:L,minY:b,maxX:U,maxY:Y}}function E(z,L,b){return`${z.map(Y=>{const R=k.transformCoordinate(Y);return`${R.longitude},${R.latitude}`}).join("|")}_${L}_${b}`}const p=E(o,i,!!r);if(c.has(p))return c.get(p);let m=i;(i==="min"||i==="avg")&&(m=await u(o,r,i,s));let T;return r?T=await w(r,o,m,s):T=await Q(o,m,s),T.baseType=i==="min"||i==="avg"?i:"custom",T.actualTargetHeight=m,c.set(p,T),T}}oP.GISAlgorithm=rD,oP.GISIcon=bo,oP.GISModel=vE,oP.GISTool=k,oP.default=bXA,Object.defineProperties(oP,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
16236
|
+
}`;let r=new Cesium.Material({fabric:{type:"customVideo",uniforms:{color:new Cesium.Color(1,1,1,1),image:""},source:i}});return r.uniforms.image=A,new Cesium.EllipsoidSurfaceAppearance({material:r,flat:!0,renderState:{cull:{enabled:!0},depthTest:{enabled:!0}}})};clear=()=>{this.clearGeometry(),this.clearZLMRTCClient()};clearGeometry=()=>{if(this.containerID_.includes("-cesium")){let A=k.getMapEngineInstance(this.containerID_);this.clampToGroundVideoInstance_&&A&&A?.scene&&A?.scene?.primitives&&A.scene.primitives.remove(this.clampToGroundVideoInstance_),this.clampToGroundVideoInstance_=void 0,this.ZYWLCesiumVideo_&&this.ZYWLCesiumVideo_.destroy(),this.ZYWLCesiumVideo_=void 0}};clearZLMRTCClient=()=>{if(this.containerID_.includes("-maptalks")){let A=k.getMapEngineInstance(this.containerID_);this.videoElement_&&this.videoBGElement_&&(this.videoBGElement_.removeChild(this.videoElement_),A.getContainer().removeChild(this.videoBGElement_))}this.videoBGElement_=void 0,this.videoElement_=void 0}}const yXA=(n,A)=>{const e=n.__vccOpts||n;for(const[t,i]of A)e[t]=i;return e},OXA={name:"ZYWLGIS",data(){return{version:"0.5.0",stats:void 0,isLoadInitMapTerrainHeight:!1,tileLoadProgress:0,activeKeys:new Set,rafId:0,timer:void 0,containerID:void 0,maptalksID:void 0,openlayersID:void 0,cesiumID:void 0,isGPUSupport:!0,force2D:!1,initializeMap:!0,isCanvasLeftClick:!1,isCanvasLeftDownMove:!1,isLeftClick:!1,isLeftDown:!1,isLeftDownMove:!1,leftDownMoveTimer:void 0,isShiftLeftDownMove:!1,isAltLeftDownMove:!1,startMousePosition:void 0,mousePosition:void 0,lookFactor:.002,rotateCenter:void 0,isWheelDown:!1,wheelCenter:void 0,isRightDown:!1,zoomCenter:void 0,ctrlRotateCenter:void 0,isKeyDown:!1,isDragging:!0,isLayerManagementOpen:!1,isVideoProjectionOpen:!1,isRangingToolDistance:!0,rangingToolHideTimer:void 0,isBeginRangingTool:!1,rangingToolType:1,currentMapState2D:!0,mouseCoordinate:[],MapEngine_Temp:void 0,MapTerrain_Temp:void 0,MapConfiguration_Temp:void 0,MapPlugins_Temp:void 0,MapLocation_Temp:void 0,MapLayers_Temp:[],MapLayers_Timer:void 0,MapLayers_LastUpdateTimer:void 0,MapLayers_IsUpdating:!1,MapLayers_UpdateInterval:1e3,Tilesets_Temp:[],Tilesets_Timer:void 0,Tilesets_LastUpdateTimer:void 0,Tilesets_IsUpdating:!1,Tilesets_UpdateInterval:1e3,Models_Temp:[],Models_Timer:void 0,Models_LastUpdateTimer:void 0,Models_IsUpdating:!1,Models_UpdateInterval:200,PointCloudRecognitions_Temp:[],PointCloudRecognitions_Timer:void 0,PointCloudRecognitions_LastUpdateTimer:void 0,PointCloudRecognitions_IsUpdating:!1,PointCloudRecognitions_UpdateInterval:1e3,NoFlys_Temp:[],NoFlys_Timer:void 0,NoFlys_LastUpdateTimer:void 0,NoFlys_IsUpdating:!1,NoFlys_UpdateInterval:1e3,Annotations_Temp:[],Annotations_Timer:void 0,Annotations_LastUpdateTimer:void 0,Annotations_IsUpdating:!1,Annotations_UpdateInterval:100,FlightPaths_Temp:[],FlightPaths_Timer:void 0,FlightPaths_LastUpdateTimer:void 0,FlightPaths_IsUpdating:!1,FlightPaths_UpdateInterval:100,PipeLines_Temp:[],PipeLines_Timer:void 0,PipeLines_LastUpdateTimer:void 0,PipeLines_IsUpdating:!1,PipeLines_UpdateInterval:100,Orthophotes_Temp:[],Orthophotes_Timer:void 0,Orthophotes_LastUpdateTimer:void 0,Orthophotes_IsUpdating:!1,Orthophotes_UpdateInterval:500,VideoProjections_Temp:[],VideoProjections_Timer:void 0,VideoProjections_LastUpdateTimer:void 0,VideoProjections_IsUpdating:!1,VideoProjections_UpdateInterval:100,AirRoutes_Temp:[],AirRoutes_Timer:void 0,AirRoutes_LastUpdateTimer:void 0,AirRoutes_IsUpdating:!1,AirRoutes_UpdateInterval:100,HeatMaps_Temp:[],HeatMaps_Timer:void 0,HeatMaps_LastUpdateTimer:void 0,HeatMaps_IsUpdating:!1,HeatMaps_UpdateInterval:1e3,heatMapUpdateTimer:void 0,VectorDatas_Temp:[],VectorDatas_Timer:void 0,VectorDatas_LastUpdateTimer:void 0,VectorDatas_IsUpdating:!1,VectorDatas_UpdateInterval:1e3,Radar_Temp:[],Radar_Timer:void 0,Radar_LastUpdateTimer:void 0,Radar_IsUpdating:!1,Radar_UpdateInterval:0,distanceToolDraw:void 0,distanceToolModify:void 0,distanceToolSource:void 0,distanceToolLayer:void 0,S3Ms_Temp:[],S3Ms_Timer:void 0,S3Ms_LastUpdateTimer:void 0,S3Ms_IsUpdating:!1,S3Ms_UpdateInterval:1e3,CustomNoFlyZones_Temp:[],CustomNoFlyZones_Timer:void 0,CustomNoFlyZones_LastUpdateTimer:void 0,CustomNoFlyZones_IsUpdating:!1,CustomNoFlyZones_UpdateInterval:100,UpdateInterval:1e3}},props:{ActiveContainerIDs:{type:Array,default:()=>[]},MapEngine:{type:Object,default:()=>({})},MapTerrain:{type:Object,default:()=>({})},MapConfiguration:{type:Object,default:()=>({})},MapPlugins:{type:Object,default:()=>({})},MapLayers:{type:Array,default:()=>[]},MapLocation:{type:Object,default:()=>({})},Tilesets:{type:Array,default:()=>[]},Models:{type:Array,default:()=>[]},PointCloudRecognitions:{type:Array,default:()=>[]},NoFlys:{type:Array,default:()=>[]},Annotations:{type:Array,default:()=>[]},FlightPaths:{type:Array,default:()=>[]},PipeLines:{type:Array,default:()=>[]},Orthophotes:{type:Array,default:()=>[]},VideoProjections:{type:Array,default:()=>[]},AirRoutes:{type:Array,default:()=>[]},HeatMaps:{type:Array,default:()=>[]},VectorDatas:{type:Array,default:()=>[]},S3Ms:{type:Array,default:()=>[]},Radar:{type:Array,default:()=>[]},CustomNoFlyZones:{type:Array,default:()=>[]}},watch:{ActiveContainerIDs:{handler(n){window.activeContainerIDs=n},deep:!0},MapEngine:{handler(n){window.DefaultMapEngine=cA.cloneDeep(n),(!cA.isEqual(n.camera,this.MapEngine_Temp.camera)||!cA.isEqual(n.zoom,this.MapEngine_Temp.zoom)||!cA.isEqual(n.center,this.MapEngine_Temp.center))&&(this.MapEngine_Temp.camera=cA.cloneDeep(n.camera),this.MapEngine_Temp.zoom=cA.cloneDeep(n.zoom),this.MapEngine_Temp.center=cA.cloneDeep(n.center),this.syncZoom(cA.cloneDeep(n.zoom)),window.isStartMapModeChange=!0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{this.refreshZoom(),setTimeout(()=>{window.isStartMapModeChange=!1},1e3)}))},deep:!0},MapTerrain:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(this.MapTerrain_Temp=cA.cloneDeep(n),this.setCesiumTerrain())},deep:!0},MapConfiguration:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(window.DefaultMapConfiguration=cA.cloneDeep(n),this.MapConfiguration_Temp=cA.cloneDeep(n),this.setMapEngineOperation())},deep:!0},MapPlugins:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(this.MapPlugins_Temp=cA.cloneDeep(n),this.setMapEnginePlugins(),this.setMapEngineStateBar())},deep:!0},MapLocation:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&(this.MapLocation_Temp=cA.cloneDeep(n),this.setMapLocation())},deep:!0},MapLayers:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("MapLayers",n)},deep:!0},Tilesets:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Tilesets",n)},deep:!0},Models:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Models",n)},deep:!0},PointCloudRecognitions:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("PointCloudRecognitions",n)},deep:!0},NoFlys:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("NoFlys",n)},deep:!0},Annotations:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Annotations",n)},deep:!0},FlightPaths:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("FlightPaths",n)},deep:!0},PipeLines:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("PipeLines",n)},deep:!0},Orthophotes:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Orthophotes",n)},deep:!0},AirRoutes:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("AirRoutes",n)},deep:!0},VideoProjections:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("VideoProjections",n)},deep:!0},HeatMaps:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("HeatMaps",n)},deep:!0},VectorDatas:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("VectorDatas",n)},deep:!0},S3Ms:{handler(n){if(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID)){if(!k.isSupportWebGL2())return;this.strictUpdateScheduler("S3Ms",n)}},deep:!0},Radar:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("Radar",n)},deep:!0},CustomNoFlyZones:{handler(n){(!window.activeContainerIDs||window.activeContainerIDs&&!window.activeContainerIDs.length||window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID))&&this.strictUpdateScheduler("CustomNoFlyZones",n)},deep:!0}},beforeUnmount(){},unmounted(){if(this.clearAllTimer(),k.clearAllMapDataMap(this.containerID),k.destroyMapEngine(this.containerID),window.defaultViewPosition=void 0,window.DefaultMapEngine=void 0,window.DefaultMapConfiguration=void 0,window.MaptalksPostRender&&(clearInterval(window.MaptalksPostRender),window.MaptalksPostRender=void 0),window.isStartMapModeChange=!0,window.isPointOfInterestOpen=!1,window.isRangingToolDistance=!0,window.terrainMaximumLevel=void 0,window.sceneIntegrator&&(window.sceneIntegrator.destroy(),window.sceneIntegrator=void 0),window.isStartBoxSelection=!1,window.originalFrustum=void 0,window.allowClickMapMode=!0,window.sliderHandler=void 0,window.rangingToolDiv=void 0,window.AxisInstance&&window.AxisInstance.clear(),window.EditElement=void 0,window.DragElement=void 0,window.DragElementIndex=void 0,window.HighlightElement=void 0,window.HighlightIndex=void 0,window.HighlightType=void 0,window.activeContainerIDs&&window.activeContainerIDs.length&&window.activeContainerIDs.includes(this.containerID)){const n=window.activeContainerIDs.indexOf(this.containerID);n>-1&&window.activeContainerIDs.splice(n,1)}console.log("需要刷新的地图视图》》》》》》》》》》",window.activeContainerIDs)},beforeMount(){console.log("组件挂载前")},mounted(){window.isStartMapModeChange=!0,window.isPointOfInterestOpen=!1,this.isBeginRangingTool=!1,window.isRangingToolDistance=!0,this.rangingToolType=1,this.MapEngine_Temp=cA.cloneDeep(this.MapEngine),window.DefaultMapEngine=cA.cloneDeep(this.MapEngine),this.MapTerrain_Temp=cA.cloneDeep(this.MapTerrain),this.MapConfiguration_Temp=cA.cloneDeep(this.MapConfiguration),window.DefaultMapConfiguration=cA.cloneDeep(this.MapConfiguration),this.MapPlugins_Temp=cA.cloneDeep(this.MapPlugins),this.containerID=this.MapEngine_Temp.containerID,k.setContainerID(this.containerID);let n=k.getMapEngineID(this.containerID);this.maptalksID=n.maptalksID,this.openlayersID=n.openlayersID,this.cesiumID=n.cesiumID,this.syncZoom(this.MapEngine_Temp?.zoom?.current??15),this.ActiveContainerIDs?.length?window.activeContainerIDs=this.ActiveContainerIDs:window.activeContainerIDs=[this.containerID],console.log("需要刷新的地图视图》》》》》》》》》》",window.activeContainerIDs),window.defaultViewPosition||(window.defaultViewPosition={containerID:cA.cloneDeep(this.MapEngine_Temp.containerID),force2D:cA.cloneDeep(this.MapEngine_Temp.force2D),center:cA.cloneDeep(this.MapEngine_Temp.center),zoom:cA.cloneDeep(this.MapEngine_Temp.zoom),camera:cA.cloneDeep(this.MapEngine_Temp.camera)}),k.addGraphClickHandlerHandler(this.GraphClickHandler),k.addGraphNodeClickHandlerHandler(this.GraphNodeClickHandler),k.addGraphChangingHandler(this.GraphChangingHandler),k.addGraphChangedHandler(this.GraphChangedHandler),k.addGraphRemovedHandler(this.GraphRemovedHandler),k.addGraphEditedHandler(this.GraphEditedHandler),k.addMapInitializationCompletedHandler(this.MapInitCompletedHandler),k.addMapRightClickHandler(this.MapRightClickHandler),k.addNoReturnNodeHandler(this.MapRightClickHandler),this.loadExternalResources(()=>{console.log(`版本号>>>>>>>>>>${this.version};CESIUM版本号>>>>>>>>>>${Cesium.VERSION}`,Cesium),this.initializeMapEngine()})},methods:{syncZoom(n){console.log("同步层级",this.containerID,n),window.MapCurrentZooms||(window.MapCurrentZooms=new Map),window.MapCurrentZooms.has(this.containerID)&&window.MapCurrentZooms.delete(this.containerID),window.MapCurrentZooms.set(this.containerID,cA.cloneDeep(n))},loadZoom(){return window.MapCurrentZooms&&window.MapCurrentZooms.has(this.containerID)?window.MapCurrentZooms.get(this.containerID):10},async loadExternalResources(n){console.log("开始动态加载外部资源...");const A=[{type:"css",url:"/libs/Cesium/Widgets/widgets.css"},{type:"js",url:"/libs/Cesium/Cesium.js"},{type:"js",url:"/libs/Cesium/Cesium-Version.js"},{type:"js",url:"/libs/SuperMap3D/SuperMap3D.js"},{type:"js",url:"/libs/cpRPA.js"},{type:"js",url:"/libs/egm96_mhl.js"}],e=i=>i.endsWith(".css")?Array.from(document.querySelectorAll('link[rel="stylesheet"]')).some(r=>r.href.includes(i)):i.endsWith(".js")?Array.from(document.querySelectorAll("script[src]")).some(r=>r.src.includes(i)):!1,t=i=>new Promise((r,s)=>{if(e(i.url)){console.log(`资源已加载,跳过: ${i.url}`),r();return}if(i.type==="css"){const o=document.createElement("link");o.rel="stylesheet",o.href=i.url,o.onload=()=>{console.log(`CSS资源加载成功: ${i.url}`),r()},o.onerror=()=>{console.error(`CSS资源加载失败: ${i.url}`),s(new Error(`Failed to load CSS: ${i.url}`))},document.head.appendChild(o)}else if(i.type==="js"){const o=document.createElement("script");i.url.includes("Cesium.js")&&(o.type="text/javascript"),o.src=i.url,o.onload=()=>{console.log(`JS资源加载成功: ${i.url}`),r()},o.onerror=()=>{console.error(`JS资源加载失败: ${i.url}`),s(new Error(`Failed to load JS: ${i.url}`))},document.head.appendChild(o)}});try{for(const i of A)await t(i),await new Promise(r=>setTimeout(r,0));console.log("所有外部资源加载完成"),n&&n()}catch(i){console.error("外部资源加载失败:",i),n&&n()}},getDifferences(n,A,e){const t=new Map(n.map(a=>[a[e],a])),i=new Map(A.map(a=>[a[e],a])),r=[],s=[],o=[];for(const[a,l]of i)if(!t.has(a))r.push(l);else{const D=t.get(a);cA.isEqual(D,l)||s.push(l)}for(const[a,l]of t)i.has(a)||o.push(l);return{added:r,changed:s,removed:o}},async handleCRUDData(n,A,e){this[`${n}_IsUpdating`]=!0,this[`${n}_Timer`]=setTimeout(()=>{this[`${n}_IsUpdating`]=!1,this[`${n}_Timer`]=void 0},this[`${n}_UpdateInterval`]),await new Promise(t=>{const{added:i,changed:r,removed:s}=this.getDifferences(this[`${n}_Temp`],A,"ID");this[`${n}_Temp`]=cA.cloneDeep(A),t({added:i,changed:r,removed:s})}).then(t=>{e&&e(t)})},strictUpdateScheduler(n,A){if(n==="MapLayers"&&(this[`${n}_Temp`]=cA.cloneDeep(A)??[]),this[`${n}_LastUpdateTimer`]&&(clearTimeout(this[`${n}_LastUpdateTimer`]),this[`${n}_LastUpdateTimer`]=void 0),this[`${n}_Timer`]){this[`${n}_LastUpdateTimer`]=setTimeout(()=>{this[`setZYWL${n}`](n,A),this[`${n}_LastUpdateTimer`]=void 0},this.UpdateInterval);return}this[`${n}_IsUpdating`]||this[`setZYWL${n}`](n,A)},clearAllTimer(){const n=["MapLayers","Tilesets","Models","PointCloudRecognitions","NoFlys","Annotations","FlightPaths","PipeLines","Orthophotes","AirRoutes","HeatMaps","VideoProjections","VectorDatas","Radar","S3Ms","CustomNoFlyZones"];for(const A of n)this[`${A}_LastUpdateTimer`]&&(clearTimeout(this[`${A}_LastUpdateTimer`]),this[`${A}_LastUpdateTimer`]=void 0),this[`${A}_Timer`]&&(clearTimeout(this[`${A}_Timer`]),this[`${A}_Timer`]=void 0),this[`${A}_IsUpdating`]=!1},async processArrayAsync(n,A,e=20){if(!(!Array.isArray(n)||n.length===0))return new Promise(t=>{let i=0;const r=()=>{const s=Math.min(i+e,n.length);for(;i<s;i++)A(n[i],i,n);i<n.length?setTimeout(r,0):t()};r()})},async initializeData(){console.log("初始化数据",this);const n=["MapLayers","Tilesets","Models","PointCloudRecognitions","NoFlys","Annotations","FlightPaths","PipeLines","Orthophotes","AirRoutes","HeatMaps","VideoProjections","VectorDatas","Radar","S3Ms","CustomNoFlyZones"];for(const A of n)if(A!=="MapLayers"){const e=cA.cloneDeep(this[A])||[];Array.isArray(e)&&e.length&&(await this[`setZYWL${A}`](A,e),await new Promise(t=>setTimeout(t,0)))}else{const e=`${A}_Temp`;this[e]=cA.cloneDeep(this[A])||[],Array.isArray(this[e])&&this[e].length&&(await this[`setZYWL${A}`](),await new Promise(t=>setTimeout(t,0)))}},initializeMapEngine(){let n=this.MapEngine_Temp?.limitMemory??1,A=this.MapEngine_Temp?.GPUWhiteLists??[];window.isGPUSupport=k.isGPUSupport(n,A),this.force2D=this.MapEngine_Temp?.force2D??!1;let e=document.getElementById(this.containerID);if(window.isGPUSupport&&!this.force2D){let t=this.createOL(e);k.setMapEngineInstance(this.openlayersID,t),this.createCesium(e)}else{let t=this.createMaptalks(e);k.setMapEngineInstance(this.maptalksID,t),this.setMapEngineStateBar();let i=document.getElementById(`${this.containerID}-MapEngineMapZoomDiv`);if(i){let r=parseInt(t.getZoom());i.textContent=`层级 ${r}`}this.initializeData(),this.setMapEngineAction(),this.setMapEnginePlugins(),this.setMapEngineOperation()}this.setWindowKey(),this.createStats()},createStats(){if((this.MapEngine_Temp?.trackStats??!1)&&window.sceneIntegrator&&window.sceneIntegrator.threeRenderer.isWebGLRenderer){const A=document.getElementById(this.containerID);this.stats=new nGA({trackHz:!0});const e=k.getMapEngineInstance(this.cesiumID);e&&this.stats.init(e.scene.context._gl),A.appendChild(this.stats.dom);let t=this.MapPlugins_Temp?.style??{right:0};this.stats.dom.style.left=`${A.offsetWidth+A.offsetLeft-240-t.right}px`,this.stats.dom.style.top="100px"}},createMaptalks(n){let A=document.getElementById(this.maptalksID);A||(A=document.createElement("div"),A.id=this.maptalksID,A.style.position="absolute",A.style.height="100%",A.style.width="100%",A.style.zIndex=1,A.style.backgroundColor="#232323",n&&n.appendChild(A)),window.isGPUSupport&&!this.force2D&&(A.style.display="none");let e=this.MapEngine_Temp?.center?.longitude??117.21833231944812,t=this.MapEngine_Temp?.center?.latitude??39.06565050593017,i=this.MapEngine_Temp?.zoom?.max??22,r=this.MapEngine_Temp?.zoom?.min??1;window.mapRenderer=this.MapEngine_Temp?.renderer??"canvas";const s=new Vi(this.maptalksID,{center:[e,t],zoom:this.MapEngine_Temp?.zoom?.current??15,minZoom:r,maxZoom:i,doubleClickZoom:!1,draggable:this.MapConfiguration_Temp?.isDrag??!0,dragRotate:!1,dragPitch:!1,touchRotate:!1,touchPitch:!1,hitDetect:!1,panAnimation:!0,zoomAnimation:!0,zoomInCenter:this.MapConfiguration_Temp?.isZoomInCenter??!1,centerCross:!1,seamlessZoom:!0,fog:!1,fpsOnInteracting:59,devicePixelRatio:1,maxExtent:new Bn({xmin:-180,ymin:-90,xmax:180,ymax:90}),attribution:!1});return k.emitMapInitializationCompleted(),this.mouseCoordinate=[Number(e.toFixed(9)),Number(t.toFixed(9))],s},createOL(n){let A=document.getElementById(this.openlayersID);A||(A=document.createElement("div"),A.id=this.openlayersID,A.style.position="absolute",A.style.height="100%",A.style.width="100%",A.style.zIndex=1,A.style.backgroundColor="#232323",n&&n.appendChild(A));let e=this.MapEngine_Temp?.center?.longitude??117.21833231944812,t=this.MapEngine_Temp?.center?.latitude??39.06565050593017,i=this.MapEngine_Temp?.zoom?.max??22,r=this.MapEngine_Temp?.zoom?.min??1,s=new JiA({useAnchor:this.MapConfiguration_Temp?.isZoomInCenter??!1});return new eGA({target:this.openlayersID,view:new jc({center:em([e,t]),zoom:this.MapEngine_Temp?.zoom?.current??15,minZoom:r,maxZoom:i}),controls:[],interactions:GiA({dragPan:this.MapConfiguration_Temp?.isDrag??!0,mouseWheelZoom:this.MapConfiguration_Temp?.isDrag??!0}).extend([s])})},createCesium(n){let A=this.MapConfiguration_Temp?.isAR??!1,e=document.getElementById(this.cesiumID);e||(e=document.createElement("div"),e.id=this.cesiumID,e.tabIndex="0",e.style.position="absolute",e.style.height="100%",e.style.width="100%",e.style.zIndex=2,e.style.backgroundColor="#232323",n&&n.appendChild(e));let t=this.MapEngine_Temp?.zoom?.max??21,i=this.MapEngine_Temp?.zoom?.min??1,r=this.MapEngine_Temp?.camera?.pitch??-90,s=k.isSupportWebGL2(),o=k.getMapEngineInstance(this.cesiumID);return o||(o=new Cesium.Viewer(this.cesiumID,{geocoder:!1,animation:!1,shouldAnimate:!0,showRenderLoopErrors:!1,timeline:!1,fullscreenButton:!1,homeButton:!1,sceneModePicker:!1,selectionIndicator:!1,navigationHelpButton:!1,infoBox:!1,contextOptions:{webgl:{alpha:A,depth:!0,stencil:!0,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,failIfMajorPerformanceCaveat:!1},requestWebgl1:!s},baseLayer:!1,blurActiveElementOnCanvasFocus:!1,baseLayerPicker:!1,mapProjection:new Cesium.WebMercatorProjection}),k.setMapEngineInstance(this.cesiumID,o),window.sceneIntegrator||(window.sceneIntegrator=lsA(o))),k.getPointPrimitiveCollection(this.cesiumID),k.getLabelCollection(this.cesiumID),k.getBillboardCollection(this.cesiumID),r===-90?o.scene.camera.switchToOrthographicFrustum():o.scene.camera.switchToPerspectiveFrustum(),o.scene.backgroundColor=Cesium.Color.fromCssColorString("#232323"),o.scene.globe.baseColor=Cesium.Color.fromCssColorString("#2A3034"),o.cesiumWidget.creditContainer.style.display="none",o.scene.screenSpaceCameraController.enableCollisionDetection=!0,o.scene.globe.tileLoadProgressEvent.addEventListener(a=>{this.createTileLoadProgressIcon(),this.tileLoadProgress<a?(this.tileLoadProgress=cA.cloneDeep(a),this.drawCircle(a)):(this.tileLoadProgress=100-a,this.drawCircle(this.tileLoadProgress))}),this.setCesiumState(e,o,A,t,i),k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!0,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,async()=>{setTimeout(()=>{window.isStartMapModeChange=!1,window.allowClickMapMode=!0,window.originalFrustum=cA.cloneDeep(o.scene.camera.frustum)},1e3),this.initializeData(),this.setMapEngineAction(),this.setMapEnginePlugins(),this.setMapEngineOperation(),this.setCesiumTerrain();let a=this.MapEngine_Temp?.center?.longitude??117.21833231944812,l=this.MapEngine_Temp?.center?.latitude??39.06565050593017;window.mousePosition=cA.cloneDeep(k.transformCartesian3({longitude:a,latitude:l}));const D=await k.getTerrainHeight(o,window.mousePosition);this.mouseCoordinate=[Number(D.coordinate.longitude.toFixed(9)),Number(D.coordinate.latitude.toFixed(9))],k.emitMapInitializationCompleted()}),o},setCesiumTerrain(){const n=k.getMapEngineInstance(this.cesiumID),A=this.MapTerrain_Temp?.isLoadTerrain??!1,e=this.MapTerrain_Temp?.terrainUrl,t=this.MapTerrain_Temp?.depthTestAgainstTerrain??!0;if(n.scene.globe.depthTestAgainstTerrain=t,!A||!e||e&&!e.length){window.terrainMaximumLevel=0,n.terrainProvider=new Cesium.EllipsoidTerrainProvider({});return}const i=new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(e,{requestVertexNormals:!0,requestWaterMask:!0}));i.readyEvent.addEventListener(r=>{i.ready&&(window.terrainMaximumLevel=r.availability._maximumLevel,n.terrainProvider=r)}),i.errorEvent.addEventListener(()=>{window.terrainMaximumLevel=0,n.terrainProvider=new Cesium.EllipsoidTerrainProvider({})})},setCesiumState(n,A,e,t,i){if(A.scene.sun.show=!1,A.scene.moon.show=!1,A.scene.skyBox.show=!1,A.scene.logarithmicDepthBuffer=!1,e)A.scene.skyAtmosphere.show=!1,A.scene.backgroundColor=Cesium.Color.TRANSPARENT,A.scene.globe.translucency.enabled=!0,A.scene.globe.translucency.backFaceAlpha=0,A.scene.globe.translucency.frontFaceAlpha=0;else{this.addMapSlider(A,n),A.imageryLayers.removeAll(),A.scene.postProcessStages.fxaa.enabled=!0,window.devicePixelRatio=1,A.resolutionScale=window.devicePixelRatio,A.targetFrameRate=120,A.trackedEntity=void 0,A.scene.globe.maximumScreenSpaceError=1,A.scene.globe.preloadAncestors=!0,A.scene.globe.preloadSiblings=!0,t>21&&(t=21);let r=k.getMapHeightByZoom(this.containerID,t,this.MapEngine_Temp?.center);r&&(r<30&&(r=30),A.scene.screenSpaceCameraController.minimumZoomDistance=r);let s=10241789645430042e-8;i>2&&(s=k.getMapHeightByZoom(this.containerID,i,this.MapEngine_Temp?.center)),s&&(A.scene.screenSpaceCameraController.maximumZoomDistance=s)}},setMapEngineAction(){this.initializeMap&&(this.initializeMap=!1);const n=k.getMapEngineInstance(this.cesiumID);if(n){const A=n.scene,e=A.camera;e.percentageChanged=1e-4,e.changed.addEventListener(this.cesiumCameraChanged),e.moveEnd.addEventListener(this.cesiumCameraMoveEnd),A.postRender.addEventListener(this.cesiumScenePostRender),A.canvas.addEventListener("click",i=>{if(this.isCanvasLeftDownMove||(this.isCanvasLeftClick=!0),this.isCanvasLeftClick){if(window.sceneIntegrator){const r=window.sceneIntegrator.threeScene.getObjectByName("pointCloud");if(r){const s=new TRA,o=new Or,a=n.scene.canvas.getBoundingClientRect();o.x=(i.clientX-a.left)/a.width*2-1,o.y=-((i.clientY-a.top)/a.height)*2+1,s.setFromCamera(o,window.sceneIntegrator.threeCamera);const l=s.intersectObject(r);if(l.length>0){const D=l[0].point,P=k.transformCoordinate(D),c=k.get3DTilesets();c&&[...c.values()].forEach(h=>{if(h.hasOwnProperty("pcdCenter_")&&h.pcdCenter_){const g=k.AbsolutePositionToRelativePosition(h.pcdCenter_,P);k.RelativePositionToAbsolutePosition(h.pcdCenter_,g)}})}}}this.isCanvasLeftClick=!1}});const t=n.cesiumWidget.screenSpaceEventHandler;t&&(t.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),t.setInputAction(this.cesiumLeftDown,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(this.cesiumLeftUp,Cesium.ScreenSpaceEventType.LEFT_UP),t.setInputAction(this.cesiumLeftClick,Cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(this.cesiumMouseMove,Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(this.cesiumWheel,Cesium.ScreenSpaceEventType.WHEEL),t.setInputAction(this.cesiumMiddleDown,Cesium.ScreenSpaceEventType.MIDDLE_DOWN),t.setInputAction(this.cesiumMiddleUp,Cesium.ScreenSpaceEventType.MIDDLE_UP),t.setInputAction(this.cesiumRightDown,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction(this.cesiumRightUp,Cesium.ScreenSpaceEventType.RIGHT_UP),t.setInputAction(this.cesiumRightClick,Cesium.ScreenSpaceEventType.RIGHT_CLICK),t.setInputAction(this.cesiumLeftDoubleClick,Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),t.setInputAction(this.cesiumAltAndLeftDown,Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT),t.setInputAction(this.cesiumAltAndLeftUp,Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT),t.setInputAction(this.cesiumAltAndLeftMouseMove,Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT),t.setInputAction(this.cesiumLeftDownAndCtrl,Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.CTRL),t.setInputAction(this.cesiumLeftUpAndCtrl,Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.CTRL),t.setInputAction(this.cesiumLeftAndCtrlMouseMove,Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.CTRL),t.setInputAction(this.cesiumLeftDownAndShift,Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.SHIFT),t.setInputAction(this.cesiumLeftUpAndShift,Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.SHIFT),t.setInputAction(this.cesiumMouseMoveAndShift,Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.SHIFT))}else{let A=k.getMapEngineInstance(this.maptalksID);A.on("click",e=>{if(this.isLeftDownMove)return;this.MapClickHandler({coordinate:{longitude:e.coordinate.x,latitude:e.coordinate.y}});let t=[k.getVectorLayer(this.maptalksID)];window.isGPUSupport&&t.push(k.getGLLayer(this.maptalksID)),A.identify({coordinate:e.coordinate,layers:t},i=>{let r=this.setEditElement();r&&r.hasOwnProperty("mouseClick")&&r.mouseClick(e,i)})}),A.on("dblclick",e=>{}),A.on("mousedown",()=>{this.isLeftDown=!0}),A.on("mouseup",()=>{this.isLeftDown=!1,this.isLeftDownMove=!1}),A.on("mousemove",e=>{this.isLeftDown&&(this.isLeftDownMove=!0),this.isLeftDown||(this.mouseCoordinate=[Number(e.coordinate.x.toFixed(9)),Number(e.coordinate.y.toFixed(9))])}),A.on("movestart zoomstart",()=>{k.removeMenu(this.containerID)}),A.on("zooming",e=>{}),A.on("zoomend",e=>{const t=parseInt(e.to);let i=k.getAnnotations();i&&[...i.values()].filter(D=>D?.data_?.type===5&&D?.isAutoZoom_).forEach(D=>{if(D.geometryInstance_){let P=1;const c=D?.data_?.symbol?.markerWidth??10,h=D?.data_?.symbol?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}});let r=k.getNoFlys();r&&[...r.values()].filter(D=>D?.data_?.type===5&&D?.isAutoZoom_).forEach(D=>{if(D.geometryInstance_){let P=1;const c=D?.data_?.symbol?.markerWidth??10,h=D?.data_?.symbol?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}});let s=k.getFlightPaths();s&&[...s.values()].filter(D=>D?.isAutoZoom_).forEach(D=>{if(D?.iconInstance_?.geometryInstance_){let P=cA.cloneDeep(D?.iconInstance_?.data_?.scale??1);const c=D?.iconInstance_?.data_?.icon?.markerWidth??10,h=D?.iconInstance_?.data_?.icon?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.iconInstance_.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}});let o=k.getModels();o&&[...o.values()].filter(D=>D?.isAutoZoom_).forEach(D=>{if(D.geometryInstance_){let P=cA.cloneDeep(D?.data_?.scale??1);const c=D?.data_?.icon?.markerWidth??10,h=D?.data_?.icon?.markerHeight??10;t<=0?P=0:t<10&&(P=t/10),D.geometryInstance_.updateSymbol({markerWidth:c*P,markerHeight:h*P})}}),this.syncZoom(Number(e.to.toFixed(0))),this.refreshZoom();const a=new Map([...k.getNoFlys(),...k.getAnnotations()]);for(const l of a.values())l.hasOwnProperty("douglasPeucker")&&l.douglasPeucker()}),A.on("viewchange",e=>{this.initializeMap&&(this.initializeMap=!1),this.MapEngine_Temp.center={longitude:e.new.center[0],latitude:e.new.center[1]},this.refreshZoom()}),A.on("addlayer",e=>{this.initializeMap&&(this.initializeMap=!1)}),A.on("contextmenu",e=>{let t=[k.getVectorLayer(this.maptalksID)];window.isGPUSupport&&t.push(k.getGLLayer(this.maptalksID)),A.identify({coordinate:e.coordinate,layers:t},i=>{i.length||k.emitMapRightClick({windowPosition:e.containerPoint,coordinate:{longitude:e.coordinate.x,latitude:e.coordinate.y,altitude:0}})})}),window.MaptalksPostRender&&(clearInterval(window.MaptalksPostRender),window.MaptalksPostRender=void 0),window.MaptalksPostRender||(window.MaptalksPostRender=setInterval(()=>{this.setMapEngineStateBar()},0))}},refreshZoom(){const n=document.getElementById(`${this.containerID}-MapEngineMapZoomDiv`);n&&(n.textContent=`层级 ${this.loadZoom()}`)},addMapSlider(n,A){let e=this.MapEngine_Temp?.isOpenSlider??!1,t="Cesium-SliderDiv",i=document.getElementById(t),r="Cesium-Slider",s=document.getElementById(r);if(e){if(i||(i=document.createElement("div"),i.id=t),A&&A.appendChild(i),s||(s=document.createElement("div"),s.id=r),i&&i.appendChild(s),n.scene.splitPosition=i.offsetLeft/i.parentElement.offsetWidth,!window.sliderHandler){let o=!1;window.sliderHandler=new Cesium.ScreenSpaceEventHandler(i),window.sliderHandler.setInputAction(()=>{o=!0},Cesium.ScreenSpaceEventType.LEFT_DOWN),window.sliderHandler.setInputAction(()=>{o=!1},Cesium.ScreenSpaceEventType.LEFT_UP),window.sliderHandler.setInputAction(a=>{if(!o)return;let l=a.endPosition.x,D=(i.offsetLeft+l)/i.parentElement.offsetWidth;i.style.left=`${100*D}%`,n.scene.splitPosition=D},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}else s&&i&&i.removeChild(s),i&&A&&A.removeChild(i),n.scene.splitPosition=0,window.sliderHandler&&(window.sliderHandler.getInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN)&&window.sliderHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),window.sliderHandler.getInputAction(Cesium.ScreenSpaceEventType.LEFT_UP)&&window.sliderHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),window.sliderHandler.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)&&window.sliderHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)),window.sliderHandler=void 0},setMapEngineStateBar(){if(window.isOpenSyncZoomLensCamera)return;let n,A;this.mouseCoordinate&&this.mouseCoordinate.length&&(n=this.mouseCoordinate[0],A=this.mouseCoordinate[1]),k.createMapEngineStateBar(this.containerID,this.MapPlugins_Temp,n,A,this.initializeMap)},setMapEnginePlugins(){let n=document.getElementById(this.containerID);if(n){let A=this.MapPlugins_Temp?.style??{right:0},e=`${15+A?.right}px`,t=this.MapPlugins_Temp?.scale??1,i=35*t,r=35*t,s=this.MapPlugins_Temp?.layerManagementVisible??!0,o=document.getElementById(`${this.containerID}-MapEngineLayerManagement`);s?(o||(o=document.createElement("img"),o.id=`${this.containerID}-MapEngineLayerManagement`,n.appendChild(o),o.addEventListener("click",()=>{this.setMapEngineRangingTool(!1),this.isLayerManagementOpen=!this.isLayerManagementOpen,this.$emit("onLayerManagementState",{state:this.isLayerManagementOpen})})),o.src=k.getLayerManagementIcon(),o.style.position="absolute",o.style.width=`${i}px`,o.style.height=`${r}px`,o.style.zIndex=3,o.style.right=e,o.style.top="100px"):(o&&(n.removeChild(o),o.removeEventListener("click",()=>{})),o=void 0);let a=this.MapPlugins_Temp?.pointOfInterestVisible??!0,l=document.getElementById(`${this.containerID}-MapEnginePointOfInterest`);if(a){l||(l=document.createElement("img"),l.id=`${this.containerID}-MapEnginePointOfInterest`,n.appendChild(l),l.addEventListener("click",()=>{this.setMapEngineRangingTool(!1),window.isPointOfInterestOpen=!window.isPointOfInterestOpen,window.isPointOfInterestOpen?l.src=bo.getIconBase64("PointOfInterestOpen.png"):l.src=bo.getIconBase64("PointOfInterestClose.png"),k.reDrawAirRoutePointOfInterest(this.containerID)})),l.src=bo.getIconBase64("PointOfInterestClose.png"),l.style.position="absolute",l.style.width=`${i}px`,l.style.height=`${r}px`,l.style.zIndex=3,l.style.right=e;let p=100;o&&(p=parseInt(o.style.top)+o.clientHeight+10),l.style.top=`${p}px`}else l&&(n.removeChild(l),l.removeEventListener("click",()=>{})),l=void 0;let D=this.MapPlugins_Temp?.videoProjectionVisible??!0,P=document.getElementById(`${this.containerID}-MapEngineVideoProjection`),c=k.getMapEngineInstance(this.cesiumID);if(D&&c){P||(P=document.createElement("img"),P.id=`${this.containerID}-MapEngineVideoProjection`,n.appendChild(P),P.addEventListener("click",()=>{this.setMapEngineRangingTool(!1),this.isVideoProjectionOpen=!this.isVideoProjectionOpen,P.src=k.getVideoProjectionIcon(this.isVideoProjectionOpen),this.$emit("onVideoProjectionState",{state:this.isVideoProjectionOpen})})),P.src=k.getVideoProjectionIcon(!1),P.style.position="absolute",P.style.width=`${i}px`,P.style.height=`${r}px`,P.style.zIndex=3,P.style.right=e;let p=100;l?p=parseInt(l.style.top)+l.clientHeight+10:o&&(p=parseInt(o.style.top)+o.clientHeight+10),P.style.top=`${p}px`}else P&&(n.removeChild(P),P.removeEventListener("click",()=>{})),P=void 0;let h=32*t+15,g=this.MapPlugins_Temp?.zoomOutVisible??!0,u=document.getElementById(`${this.containerID}-MapEngineZoomOut`);g?(u||(u=document.createElement("img"),u.id=`${this.containerID}-MapEngineZoomOut`,n.appendChild(u),u.addEventListener("click",()=>{this.setMapEngineRangingTool(!1);let p=this.loadZoom(),m=this.MapEngine_Temp?.zoom?.min??1;p>m&&(p--,this.syncZoom(p),window.isStartMapModeChange=!0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!0,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{this.refreshZoom(),setTimeout(()=>{window.isStartMapModeChange=!1},1e3)}))})),u.src=k.getZoomOutIcon(),u.style.position="absolute",u.style.width=`${i}px`,u.style.height=`${r}px`,u.style.zIndex=3,u.style.right=e,u.style.bottom=`${h}px`):(u&&(n.removeChild(u),u.removeEventListener("click",()=>{})),u=void 0);let Q=this.MapPlugins_Temp?.zoomInVisible??!0,w=document.getElementById(`${this.containerID}-MapEngineZoomIn`);if(Q){w||(w=document.createElement("img"),w.id=`${this.containerID}-MapEngineZoomIn`,n.appendChild(w),w.addEventListener("click",()=>{this.setMapEngineRangingTool(!1);let m=this.loadZoom(),T=this.MapEngine_Temp?.zoom?.max??21;T>21&&(T=21),m<T&&(m++,this.syncZoom(m),console.log(this.loadZoom()),window.isStartMapModeChange=!0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!0,!1,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{this.refreshZoom(),setTimeout(()=>{window.isStartMapModeChange=!1},1e3)}))})),w.src=k.getZoomInIcon(),w.style.position="absolute",w.style.width=`${i}px`,w.style.height=`${r}px`,w.style.zIndex=3,w.style.right=e;let p;u?p=parseInt(u.style.bottom)+u.clientHeight+10:p=h,w.style.bottom=`${p}px`}else w&&(n.removeChild(w),w.removeEventListener("click",()=>{})),w=void 0;let C=document.getElementById(`${this.containerID}-MapEngineMapMode`);if(c)if(this.MapPlugins_Temp?.mapModeVisible??!0){C||(C=document.createElement("img"),C.id=`${this.containerID}-MapEngineMapMode`,n.appendChild(C),C.addEventListener("click",()=>{window.allowClickMapMode&&(window.allowClickMapMode=!1,window.isStartMapModeChange=!0,this.setMapEngineRangingTool(!1),C.src=k.getMapModeIcon(this.currentMapState2D),this.currentMapState2D?this.MapEngine_Temp.camera.pitch=-30:this.MapEngine_Temp.camera.pitch=-90,this.currentMapState2D=!this.currentMapState2D,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!0,this.MapConfiguration_Temp.isCameraMoveAnimation??!1,()=>{setTimeout(()=>{window.isStartMapModeChange=!1},1e3),setTimeout(()=>{window.allowClickMapMode=!0},1e3),this.currentMapState2D?(C.src=k.getMapModeIcon(!0),c.scene.camera.switchToOrthographicFrustum()):(C.src=k.getMapModeIcon(!1),c.scene.camera.switchToPerspectiveFrustum())}))})),(this.MapEngine_Temp?.camera?.pitch??-90)===-90?(C.src=k.getMapModeIcon(!0),this.currentMapState2D=!0):(C.src=k.getMapModeIcon(!1),this.currentMapState2D=!1),C.style.position="absolute",C.style.width=`${i}px`,C.style.height=`${r}px`,C.style.zIndex=3,C.style.right=e;let T;w?T=parseInt(w.style.bottom)+w.clientHeight+10:u?T=parseInt(u.style.bottom)+u.clientHeight+10:T=h,C.style.bottom=`${T}px`}else C&&(n.removeChild(C),C.removeEventListener("click",()=>{})),C=void 0;else C&&(n.removeChild(C),C.removeEventListener("click",()=>{})),C=void 0;let E=this.MapPlugins_Temp?.rangingToolVisible??!0;if(window.rangingToolDiv=document.getElementById(`${this.containerID}-MapEngineRangingTool`),E){window.rangingToolDiv||(window.rangingToolDiv=document.createElement("img"),window.rangingToolDiv.id=`${this.containerID}-MapEngineRangingTool`,n.appendChild(window.rangingToolDiv),window.rangingToolDiv.addEventListener("click",m=>{this.isBeginRangingTool=!this.isBeginRangingTool,this.rangingToolClick()}),window.rangingToolDiv.addEventListener("mouseenter",()=>{this.rangingToolMouseenter(),this.setMapEngineRangingTool(!0)}),window.rangingToolDiv.addEventListener("mouseleave",this.rangingToolMouseleave)),window.rangingToolDiv.src=k.getRangingToolIconByType(this.rangingToolType,this.isBeginRangingTool),window.rangingToolDiv.style.position="absolute",window.rangingToolDiv.style.width=`${i}px`,window.rangingToolDiv.style.height=`${r}px`,window.rangingToolDiv.style.zIndex=3,window.rangingToolDiv.style.right=e;let p;C?p=parseInt(C.style.bottom)+C.clientHeight+10:w?p=parseInt(w.style.bottom)+w.clientHeight+10:u?p=parseInt(u.style.bottom)+u.clientHeight+10:p=h,window.rangingToolDiv.style.bottom=`${p}px`}else window.rangingToolDiv&&(n.removeChild(window.rangingToolDiv),window.rangingToolDiv.removeEventListener("click",()=>{})),window.rangingToolDiv=void 0;if(c){let p=document.getElementById(`${this.containerID}-MapEnginecompassNeedleBG`),m=document.getElementById(`${this.containerID}-MapEnginecompassNeedle`);if(this.MapPlugins_Temp?.compassNeedleVisible??!0){p||(p=document.createElement("img"),p.id=`${this.containerID}-MapEnginecompassNeedleBG`,n.appendChild(p),p.addEventListener("click",L=>{this.setMapEngineRangingTool(!1),k.resetMapCamera(this.containerID)})),p.src=k.getCompassNeedleIcon(!0),p.style.position="absolute",p.style.width=`${i}px`,p.style.height=`${r}px`,p.style.zIndex=3,p.style.right=e,m||(m=document.createElement("img"),m.id=`${this.containerID}-MapEnginecompassNeedle`,n.appendChild(m),m.addEventListener("click",L=>{this.setMapEngineRangingTool(!1),k.resetMapCamera(this.containerID)})),m.src=k.getCompassNeedleIcon(!1),m.style.position="absolute",m.style.width=`${i-6}px`,m.style.height=`${r-6}px`,m.style.zIndex=4,m.style.right=`${18+A.right}px`;let z;window.rangingToolDiv?z=parseInt(window.rangingToolDiv.style.bottom)+window.rangingToolDiv.clientHeight+10:C?z=parseInt(C.style.bottom)+C.clientHeight+10:w?z=parseInt(w.style.bottom)+w.clientHeight+10:u?z=parseInt(u.style.bottom)+u.clientHeight+10:z=h,p.style.bottom=`${z}px`,m.style.bottom=`${z+3}px`}else p&&(n.removeChild(p),p.removeEventListener("click",()=>{})),p=void 0,m&&(n.removeChild(m),m.removeEventListener("click",()=>{})),m=void 0}}},setMapEngineRangingTool(n){let A=document.getElementById(this.containerID),e=document.getElementById(`${this.containerID}-MapEngineRangingToolDistance`),t=document.getElementById(`${this.containerID}-MapEngineRangingToolSurface`),i=document.getElementById(`${this.containerID}-MapEngineRangingToolTriangles`),r=document.getElementById(`${this.containerID}-MapEngineRangingToolSectional`),s=document.getElementById(`${this.containerID}-MapEngineRangingToolVolume`);if(n&&window.rangingToolDiv){let o=this.MapPlugins_Temp?.scale??1,a=35*o,l=35*o;e||(e=document.createElement("img"),e.id=`${this.containerID}-MapEngineRangingToolDistance`,A.appendChild(e),e.addEventListener("click",()=>{this.rangingToolType=1,this.rangingToolClick()}),e.addEventListener("mouseenter",this.rangingToolMouseenter),e.addEventListener("mouseleave",this.rangingToolMouseleave)),e.src=k.getRangingToolIconList(1),e.style.position="absolute",e.style.width=`${a}px`,e.style.height=`${l}px`,e.style.zIndex=3,e.style.bottom=window.rangingToolDiv.style.bottom,e.style.right=`${parseInt(window.rangingToolDiv.style.right)+10+a}px`,t||(t=document.createElement("img"),t.id=`${this.containerID}-MapEngineRangingToolSurface`,A.appendChild(t),t.addEventListener("click",()=>{this.rangingToolType=2,this.rangingToolClick()}),t.addEventListener("mouseenter",this.rangingToolMouseenter),t.addEventListener("mouseleave",this.rangingToolMouseleave)),t.src=k.getRangingToolIconList(2),t.style.position="absolute",t.style.width=`${a}px`,t.style.height=`${l}px`,t.style.zIndex=3,t.style.bottom=window.rangingToolDiv.style.bottom,t.style.right=`${parseInt(e.style.right)+10+a}px`,window.isGPUSupport&&!this.force2D&&(i||(i=document.createElement("img"),i.id=`${this.containerID}-MapEngineRangingToolTriangles`,A.appendChild(i),i.addEventListener("click",()=>{this.rangingToolType=3,this.rangingToolClick()}),i.addEventListener("mouseenter",this.rangingToolMouseenter),i.addEventListener("mouseleave",this.rangingToolMouseleave)),i.src=k.getRangingToolIconList(3),i.style.position="absolute",i.style.width=`${a}px`,i.style.height=`${l}px`,i.style.zIndex=3,i.style.bottom=window.rangingToolDiv.style.bottom,i.style.right=`${parseInt(t.style.right)+10+a}px`,i.style.display="none",r||(r=document.createElement("img"),r.id=`${this.containerID}-MapEngineRangingToolSectional`,A.appendChild(r),r.addEventListener("click",()=>{this.rangingToolType=4,this.rangingToolClick()}),r.addEventListener("mouseenter",this.rangingToolMouseenter),r.addEventListener("mouseleave",this.rangingToolMouseleave)),r.src=k.getRangingToolIconList(4),r.style.position="absolute",r.style.width=`${a}px`,r.style.height=`${l}px`,r.style.zIndex=3,r.style.bottom=window.rangingToolDiv.style.bottom,r.style.right=`${parseInt(i.style.right)+10+a}px`,r.style.display="none")}else e&&(A.removeChild(e),e.removeEventListener("click",()=>{})),e=void 0,t&&(A.removeChild(t),t.removeEventListener("click",()=>{})),t=void 0,i&&(A.removeChild(i),i.removeEventListener("click",()=>{})),i=void 0,r&&(A.removeChild(r),r.removeEventListener("click",()=>{})),r=void 0,s&&(A.removeChild(s),s.removeEventListener("click",()=>{})),s=void 0},rangingToolClick(){k.clearMapTool(this.containerID),window.rangingToolDiv.src=k.getRangingToolIconByType(this.rangingToolType,this.isBeginRangingTool),this.isBeginRangingTool&&setTimeout(()=>{switch(this.rangingToolType){case 1:k.createDistanceTool(this.containerID);break;case 2:k.createAreaTool(this.containerID);break;case 3:k.createTrianglesTool(this.containerID);break;case 4:k.createSectionalTool(this.containerID);break}},70),this.setMapEngineRangingTool(!1)},rangingToolMouseenter(){this.rangingToolHideTimer&&(clearTimeout(this.rangingToolHideTimer),this.rangingToolHideTimer=void 0)},rangingToolMouseleave(){this.rangingToolHideTimer||(this.rangingToolHideTimer=setTimeout(()=>{this.setMapEngineRangingTool(!1)},300))},setMapEngineOperation(){this.isDragging=this.MapConfiguration_Temp?.isDrag??!0;let n=k.getMapEngineInstance(this.cesiumID);if(n){let e=n.scene.screenSpaceCameraController;this.isDragging?e.enableInputs=!0:e.enableInputs=!1}else{let A=k.getMapEngineInstance(this.maptalksID);A&&(this.isDragging?(A.config("draggable",!0),A.config("scrollWheelZoom",!0)):(A.config("draggable",!1),A.config("scrollWheelZoom",!1)))}},cesiumCameraChanged(){let e=k.getMapEngineInstance(this.cesiumID).scene.camera,t=document.getElementById(`${this.containerID}-MapEngineMapMode`);if(t){let r=parseInt(Cesium.Math.toDegrees(e.pitch));r<=-85&&r>=-95?(this.currentMapState2D=!0,e.switchToOrthographicFrustum()):(this.currentMapState2D=!1,e.switchToPerspectiveFrustum()),t.src=k.getMapModeIcon(this.currentMapState2D)}let i=document.getElementById(`${this.containerID}-MapEnginecompassNeedle`);if(i){let r=Cesium.Math.toDegrees(e.heading);i.style.transform=`rotate(${r}deg)`}if(!this.isKeyDown&&!window.isStartMapModeChange&&!this.initializeMap&&this.setMapEngineStateBar(),!this.heatMapUpdateTimer){let r=k.getHeatMaps();r&&[...r.values()].forEach(s=>{s.hasOwnProperty("updateRadius")&&s.updateRadius()}),this.heatMapUpdateTimer=setTimeout(()=>{this.heatMapUpdateTimer=void 0},500)}if(window.sceneIntegrator&&window.sceneIntegrator.update(),window.AxisInstance)window.AxisInstance.axisInstance_.updateAxis();else{let r=k.getAirRoutes();r&&[...r.values()].forEach(s=>{s.isEditable_&&s.hasOwnProperty("axisInstance_")&&s.axisInstance_&&s.axisInstance_.hasOwnProperty("updateAxis")&&(window.AxisInstance=s,window.AxisInstance.axisInstance_.updateAxis())})}},cesiumCameraMoveEnd(){window.AxisInstance&&window.AxisInstance.axisInstance_.updateAxis(),this.initializeMap&&(this.initializeMap=!1);const n=k.getMapEngineInstance(this.cesiumID),A=n.scene,e=A.camera;if(!window.isStartMapModeChange){const t=A.canvas,i=e.pickEllipsoid(new Cesium.Cartesian2(t.width/2,t.height/2)),r=k.transformCoordinate(i);r&&(this.MapEngine_Temp.center={longitude:r.longitude,latitude:r.latitude})}!this.isLoadInitMapTerrainHeight&&window.mousePosition&&k.getTerrainHeight(n,window.mousePosition).then(t=>{window.mousePosition=t.position,this.isLoadInitMapTerrainHeight=!0,this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}),this.MapEngine_Temp.camera={heading:parseInt(Cesium.Math.toDegrees(e.heading)),pitch:parseInt(Cesium.Math.toDegrees(e.pitch))},window.isOpenSyncZoomLensCamera||(this.syncZoom(k.getZoom(this.containerID)),this.setMapEngineStateBar(),this.refreshZoom())},cesiumScenePostRender(n){this.stats&&this.stats.update()},setEditElement(){const n=k.getAnnotations(),A=k.getPipeLines(),e=k.getAirRoutes(),t=k.getCustomNoFlyZones();return[...n.values(),...A.values(),...e.values(),...t.values()].find(i=>i.isEditable_)},async cesiumLeftDown(n){if(!(!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection)&&(this.isLeftDown=!0,n.position)){let A=k.getMapEngineInstance(this.cesiumID),e=A.scene,t=k.getCartesian(e,n.position);Cesium.defined(t)||(A.scene.screenSpaceCameraController.enableInputs=!1);const i=await k.pickFeature(A,n.position);let r=!1,s=!1;if(i&&i.primitive instanceof Cesium.Model&&typeof i.id=="string"&&i.id.includes("-&-ZYWL-&-Axis-")){let o=k.extractionID(i.id);window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-Axis-ArrowX"?window.DragElementIndex=9e3:i.id===o+"-&-ZYWL-&-Axis-ArrowY"?window.DragElementIndex=9001:i.id===o+"-&-ZYWL-&-Axis-ArrowYN"?window.DragElementIndex=90010:i.id===o+"-&-ZYWL-&-Axis-ArrowZ"?window.DragElementIndex=9002:i.id===o+"-&-ZYWL-&-Axis-SphereX"?window.DragElementIndex=9020:i.id===o+"-&-ZYWL-&-Axis-SphereY"?window.DragElementIndex=9021:i.id===o+"-&-ZYWL-&-Axis-SphereZ"&&(window.DragElementIndex=9022),window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&(r=!0,e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableInputs=!1,window.DragElement.mouseDown(n,window.DragElementIndex))}if(r||s)return;if(window.EditElement=this.setEditElement(),i){if(i.primitive instanceof Cesium.GroundPrimitive&&i.id instanceof Cesium.Entity)i.id.id&&i.id.id.includes("-&-ZYWL-&-HeatMap")||i.id.name&&i.id.name.includes("-&-ZYWL-&-VectorData-0");else if(!(i.primitive instanceof Cesium.Cesium3DTileset&&!i.id)){if(i.primitive instanceof Cesium.Model&&typeof i.id=="string"&&i.id.includes("-&-ZYWL-&-Axis-")){e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableInputs=!1;let o=k.extractionID(i.id);window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-Axis-ArrowX"?window.DragElementIndex=9e3:i.id===o+"-&-ZYWL-&-Axis-ArrowY"?window.DragElementIndex=9001:i.id===o+"-&-ZYWL-&-Axis-ArrowYN"?window.DragElementIndex=90010:i.id===o+"-&-ZYWL-&-Axis-ArrowZ"?window.DragElementIndex=9002:i.id===o+"-&-ZYWL-&-Axis-SphereX"?window.DragElementIndex=9020:i.id===o+"-&-ZYWL-&-Axis-SphereY"?window.DragElementIndex=9021:i.id===o+"-&-ZYWL-&-Axis-SphereZ"&&(window.DragElementIndex=9022),window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&window.DragElement.mouseDown(n,window.DragElementIndex)}else if(!(i.primitive instanceof Cesium.Primitive&&typeof i.id=="string"&&i.id.includes("-&-ZYWL-&-Axis-")))if(k.judgmentAllowDrag(i,e)){if(typeof i.id=="string"){let o=i.id,a=k.extractionID(o);o.includes("-&-ZYWL-&-GeometryEditingPolygonWall")?(window.DragElement=k.getAirRoute(a),o===a+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"?window.DragElementIndex=9990:o===a+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"?window.DragElementIndex=9991:o.includes("-&-ZYWL-&-GeometryEditingPolygonWall-BottomPoint-")?window.DragElementIndex=-k.extractionIndex(o):o.includes("-&-ZYWL-&-GeometryEditingPolygonWall-TopPoint-")&&(window.DragElementIndex=k.extractionIndex(o))):o.includes("-&-ZYWL-&-GeometryEditingCircleWall")?(window.DragElement=k.getAirRoute(a),o===a+"-&-ZYWL-&-GeometryEditingCircleWallMinCenter"?window.DragElementIndex=0:o===a+"-&-ZYWL-&-GeometryEditingCircleWallMaxCenter"?window.DragElementIndex=10:o===a+"-&-ZYWL-&-GeometryEditingCircleWallMinRadiusCenter"?window.DragElementIndex=1:o===a+"-&-ZYWL-&-GeometryEditingCircleWallMaxRadiusCenter"?window.DragElementIndex=11:o===a+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"?window.DragElementIndex=90:o===a+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline"&&(window.DragElementIndex=91)):o.includes("-&-ZYWL-&-GeometryEditingSlantPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAirRoute(a)):o===a+"-&-ZYWL-&-PointOfInterest"?(window.DragElementIndex=99999,window.DragElement=k.getAirRoute(a)):o===a+"-&-ZYWL-&-TakeOffBillboard"?(window.DragElementIndex=-99999,window.DragElement=k.getAirRoute(a)):o.includes("-&-ZYWL-&-GraphicEditingPoint")?(window.DragElementIndex=void 0,window.DragElement=k.getAnnotation(a),window.DragElement||(window.DragElement=k.getPipeLine(a))):o.includes("-&-ZYWL-&-GraphicEditingPolyline-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAnnotation(a),window.DragElement||(window.DragElement=k.getPipeLine(a))):o.includes("-&-ZYWL-&-GraphicEditingPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAnnotation(a)):o.includes("-&-ZYWL-&-CustomGraphicEditingPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getCustomNoFlyZone(a)):o.includes("-&-ZYWL-&-GraphicEditingCircleRadius-Point")?(window.DragElementIndex=1,window.DragElement=k.getAnnotation(a)):o.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadius-Point")?(window.DragElementIndex=1,window.DragElement=k.getCustomNoFlyZone(a)):o.includes("-&-ZYWL-&-GraphicEditingCircleCenter-Point")?(window.DragElementIndex=0,window.DragElement=k.getAnnotation(a)):o.includes("-&-ZYWL-&-CustomGraphicEditingCircleCenter-Point")?(window.DragElementIndex=0,window.DragElement=k.getCustomNoFlyZone(a)):o.includes("-&-ZYWL-&-GraphicEditingIcon")?window.DragElement=k.getAnnotation(a):o.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||o.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-")||o.includes("-&-ZYWL-&-GeometryEditingPolygon-Point-")||o.includes("-&-ZYWL-&-GeometryEditingGroundPolygon-Point-")?(window.DragElementIndex=k.extractionIndex(o),window.DragElement=k.getAirRoute(a)):o.includes("-&-ZYWL-&-GeometryEditingCircleRadius-Point")?(window.DragElementIndex=1,window.DragElement=k.getAirRoute(a)):o.includes("-&-ZYWL-&-GeometryEditingCircleCenter-Point")&&(window.DragElementIndex=0,window.DragElement=k.getAirRoute(a))}window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&window.DragElement.mouseDown(n,window.DragElementIndex)}else{if(i.primitive instanceof Cesium.Primitive&&typeof i.id=="string"){let o=k.extractionID(i.id);i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"||i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"?(window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"?window.DragElementIndex=9990:i.id===o+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"&&(window.DragElementIndex=9991)):(i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"||i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline")&&(window.DragElement=k.getAirRoute(o),i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"?window.DragElementIndex=90:i.id===o+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline"&&(window.DragElementIndex=91))}window.DragElement&&window.DragElement.hasOwnProperty("mouseDown")&&window.DragElementIndex&&(e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableInputs=!1,window.DragElement.mouseDown(n,window.DragElementIndex))}}}}},async cesiumLeftUp(n){this.leftDownMoveTimer&&(clearTimeout(this.leftDownMoveTimer),this.leftDownMoveTimer=void 0);const A=k.getMapEngineInstance(this.cesiumID);if(A.container.style.cursor="",this.isAltLeftDownMove&&(this.isAltLeftDownMove=!1,A.scene.screenSpaceCameraController.enableInputs=!0),this.isShiftLeftDownMove&&(this.isShiftLeftDownMove=!1,A.scene.screenSpaceCameraController.enableInputs=!0),this.startMousePosition=void 0,this.ctrlRotateCenter=void 0,window.nodeDragPlane=void 0,!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection)return;this.isLeftDown=!1;let e=A.scene;if(this.timer&&(clearTimeout(this.timer),this.timer=void 0),this.timer=setTimeout(()=>{e.screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableInputs=!0,this.isCanvasLeftDownMove&&(this.isCanvasLeftDownMove=!1)},100),n.position){const t=await k.pickFeature(A,n.position);this.isLeftDownMove&&(this.isLeftDownMove=!1),window.DragElement&&(window.DragElement.hasOwnProperty("mouseUp")?window.DragElement.mouseUp(n,window.DragElementIndex):window.DragElement.hasOwnProperty("emitGraphChanged")&&t&&typeof t.id=="string"&&(window.DragElement.dataClass_==="AirRoutes"||window.DragElement.dataClass_==="Annotations"||window.DragElement.dataClass_==="PipeLines"||window.DragElement.dataClass_==="CustomNoFlyZones"?window.DragElement?.isStartDraw_||(console.log(123),window.DragElement.emitGraphChanged("update",k.extractionIndex(t.id))):(console.log(456),window.DragElement.emitGraphChanged("update"))),window.DragElement=void 0,window.DragElementIndex=void 0)}},async cesiumLeftClick(n){if(!(!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection)&&(this.isLeftDownMove||(this.isLeftClick=!0,this.leftDownMoveTimer&&(clearTimeout(this.leftDownMoveTimer),this.leftDownMoveTimer=void 0)),this.isLeftClick)){if(n.position){let A=k.getMapEngineInstance(this.cesiumID),e=k.getCartesian(A.scene,n.position);e&&this.MapClickHandler({coordinate:k.transformCoordinate(e)}),A.scene;const t=await k.pickFeature(A,n.position);if(t&&!window.EditElement){let i=t.id;if(typeof i=="string"){let r=k.extractionID(i);const s=new Map([...k.getNoFlys(),...k.getAnnotations(),...k.getCustomNoFlyZones(),...k.getPipeLines(),...k.getModels(),...k.getAirRoutes(),...k.getPointCloudRecognitions(),...k.getLargeDatas()]);let o;o||(o=s.get(r));let a=k.extractionIndex(i);o&&(a!==void 0&&i.includes("-&-ZYWL-&-")&&i.includes("-Point-")&&!o.isStartDraw_?(this.GraphNodeClickHandler({ID:o.data_.ID,data:o.data_,class:o.dataClass_,index:a}),window.EditElement=void 0):o.isEditable_?window.EditElement=cA.cloneDeep(o):this.GraphClickHandler({ID:o.data_.ID,data:o.data_,class:o.dataClass_,index:a}))}}window.EditElement&&window.EditElement.hasOwnProperty("mouseClick")&&window.EditElement.mouseClick(n)}this.isLeftClick=!1}},cesiumLeftDownAndCtrl(n){if(n.position){let e=k.getMapEngineInstance(this.cesiumID).scene,t=k.getCartesian(e,n.position);Cesium.defined(t)?this.ctrlRotateCenter=n.position:e.screenSpaceCameraController.enableInputs=!1}},async cesiumLeftUpAndCtrl(n){if(!this.isDragging||this.isBeginRangingTool)return;let A=k.getMapEngineInstance(this.cesiumID);if(A){let e=A.scene;e.screenSpaceCameraController.enableInputs=!0;let t=e.camera;this.refreshZoom(),n.position&&(await k.pickFeature(A,n.position)||(this.MapEngine_Temp.camera={heading:parseInt(Cesium.Math.toDegrees(t.heading)),pitch:parseInt(Cesium.Math.toDegrees(t.pitch))}))}this.ctrlRotateCenter=void 0},cesiumLeftAndCtrlMouseMove(){this.ctrlRotateCenter&&k.createMapFocusIcon(this.containerID,this.ctrlRotateCenter,!0)},async cesiumMouseMove(n){const A=k.getMapEngineInstance(this.cesiumID),e=A.scene;if(!(!this.isDragging||this.isBeginRangingTool)){if(this.isLeftDown)k.removeAll(this.containerID),this.leftDownMoveTimer||(this.leftDownMoveTimer=setTimeout(()=>{this.isLeftDownMove=!0,this.isCanvasLeftDownMove=!0},300)),window.DragElement?window.DragElement.hasOwnProperty("mouseMove")&&window.DragElement.mouseMove(n,window.DragElementIndex):A.container.style.cursor="grabbing";else if((this.isWheelDown||this.isRightDown)&&(A.container.style.cursor="grabbing",this.refreshZoom(),this.isWheelDown&&this.wheelCenter&&k.createMapFocusIcon(this.containerID,this.wheelCenter,!0),this.isRightDown&&this.zoomCenter&&k.createMapFocusIcon(this.containerID,this.zoomCenter,!0)),n.endPosition){if(!this.isRightDown&&!this.isWheelDown){const i=k.getCartesian(e,n.endPosition);i&&(window.mousePosition=cA.cloneDeep(i),k.getTerrainHeight(A,window.mousePosition).then(r=>{this.mouseCoordinate=[Number(r.coordinate.longitude.toFixed(9)),Number(r.coordinate.latitude.toFixed(9))],this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}))}window.HighlightElement&&window.HighlightElement.hasOwnProperty("primitivesHighlighted")&&window.HighlightElement.primitivesHighlighted(!1,window.HighlightType,window.HighlightIndex),window.HighlightElement=void 0,window.HighlightIndex=void 0,window.HighlightType=void 0;const t=await k.pickFeature(A,n.endPosition);if(t&&t.primitive){let r=t.id,s;if(typeof r=="string"){if(s=k.extractionID(r),r===s+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline")window.EditElement&&window.EditElement.hasOwnProperty("isStartDraw_")&&!window.EditElement.isStartDraw_&&window.EditElement.hasOwnProperty("isStartPullUP_")&&!window.EditElement.isStartPullUP_&&window.EditElement.hasOwnProperty("wallHeight_")&&window.EditElement.wallHeight_&&k.setCustomCursor(this.cesiumID,"n-resize");else{let l=!1;(r===s+"-&-ZYWL-&-GeometryEditingPolygonWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingPolygonWallTopOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallBottomOutline"||r===s+"-&-ZYWL-&-GeometryEditingCircleWallTopOutline")&&(l=!0),l?window.EditElement&&window.EditElement.hasOwnProperty("isStartDraw_")&&!window.EditElement.isStartDraw_&&window.EditElement.hasOwnProperty("isStartPullUP_")&&!window.EditElement.isStartPullUP_&&window.EditElement.hasOwnProperty("wallHeight_")&&window.EditElement.wallHeight_&&k.setCustomCursor(this.cesiumID,"n-resize"):k.recoverCursor(this.cesiumID,"n-resize")}window.HighlightIndex=k.extractionIndex(r);const a=new Map([...k.getModels(),...k.getFlightPaths(),...k.getNoFlys(),...k.getAnnotations(),...k.getCustomNoFlyZones(),...k.getPipeLines(),...k.getAirRoutes(),...k.getLargeDatas(),...k.getVectorDatas()]);window.HighlightElement||(window.HighlightElement=a.get(s))}else if(r instanceof Cesium.Entity&&(t.primitive instanceof Cesium.GroundPrimitive||t.primitive instanceof Cesium.GroundPolylinePrimitive)){let a=r.entityCollection;if(a){let l=a.owner;l&&l.name&&l.name.includes("-&-ZYWL-&-VectorData")&&(s=k.extractionID(l.name),window.HighlightElement||(window.HighlightElement=k.getVectorData(s),window.HighlightIndex=r.id),k.recoverCursor(this.cesiumID,"n-resize"))}}let o=!1;t.primitive instanceof Cesium.Model&&typeof r=="string"&&r.includes("-&-ZYWL-&-Axis-")&&(o=!0,window.HighlightType=r.split("-Axis-")[1],s=k.extractionID(r),window.HighlightElement=k.getAirRoute(s)),o&&(window.HighlightType=void 0,(r===s+"-&-ZYWL-&-Axis-ArrowX"||r===s+"-&-ZYWL-&-Axis-ArrowY"||r===s+"-&-ZYWL-&-Axis-ArrowYN"||r===s+"-&-ZYWL-&-Axis-ArrowZ"||r===s+"-&-ZYWL-&-Axis-SphereX"||r===s+"-&-ZYWL-&-Axis-SphereY"||r===s+"-&-ZYWL-&-Axis-SphereZ")&&(window.HighlightType=r.split("-Axis-")[1],s=k.extractionID(r),window.HighlightElement=k.getAirRoute(s))),window.HighlightElement&&window.HighlightElement.hasOwnProperty("primitivesHighlighted")&&window.HighlightElement.primitivesHighlighted(!0,window.HighlightType,window.HighlightIndex)}}}},cesiumWheel(){this.isDragging&&this.refreshZoom()},cesiumMiddleDown(n){if(this.isDragging&&(this.isWheelDown=!0,n.position)){const A=k.getMapEngineInstance(this.cesiumID);let e=k.getCartesian(A.scene,n.position);e&&(this.wheelCenter=A.scene.cartesianToCanvasCoordinates(e,new Cesium.Cartesian2))}},cesiumMiddleUp(){if(!this.isDragging)return;this.isWheelDown=!1;const n=k.getMapEngineInstance(this.cesiumID);n.container.style.cursor="",this.wheelCenter=void 0,k.createMapFocusIcon(this.containerID,this.wheelCenter,!1)},cesiumRightDown(n){this.isDragging&&(this.isRightDown=!0,this.zoomCenter=n.position)},cesiumRightUp(){if(!this.isDragging)return;this.isRightDown=!1;const n=k.getMapEngineInstance(this.cesiumID);n.container.style.cursor="",this.zoomCenter&&(this.zoomCenter=void 0,k.createMapFocusIcon(this.containerID,void 0,!1))},async cesiumRightClick(n){if(k.removeMenu(this.cesiumID),!this.isDragging)return;const A=k.getMapEngineInstance(this.cesiumID);if(A){const e=A.scene;if(n.position){const t=await k.pickFeature(A,n.position);if(t){if(typeof t.id=="string"){let i=t.id,r=k.extractionID(i),s=k.extractionIndex(i);s&&(s=Number(s));let o,a=!0,l="删除图形",D,P;if(t.primitive instanceof Cesium.Label)(i.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||i.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))&&(o||(o=k.getAirRoute(r)),D=o.isCopy_,P=!0,l="删除端点",o&&(a=o.isDelete_,o.data_.coordinates.length<2&&(a=!1)));else if(t.primitive instanceof Cesium.PointPrimitive){if(i.includes("-&-ZYWL-&-GeometryEditingPolygonWall-TopPoint-")||i.includes("-&-ZYWL-&-GeometryEditingPolygonWall-BottomPoint-"))o||(o=k.getAirRoute(r)),l="删除端点";else if(i.includes("-&-ZYWL-&-GraphicEditingPoint"))o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r));else if(i.includes("-&-ZYWL-&-GraphicEditingCircleCenter-Point"))o||(o=k.getAnnotation(r));else if(i.includes("-&-ZYWL-&-CustomGraphicEditingCircleCenter-Point"))o||(o=k.getCustomNoFlyZone(r));else if(i.includes("-&-ZYWL-&-GraphicEditingCircleRadius-Point"))o||(o=k.getAnnotation(r));else if(i.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadius-Point"))o||(o=k.getCustomNoFlyZone(r));else if(i.includes("-&-ZYWL-&-GraphicEditingPolyline-Point-")){if(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r)),o&&o.data_.coordinates.length<=2)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GraphicEditingPolygon-Point-")){if(o||(o=k.getAnnotation(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon-Point-")){if(o||(o=k.getCustomNoFlyZone(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||i.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))o||(o=k.getAirRoute(r)),D=o.isCopy_,l="删除端点",o&&(a=o.isDelete_,o.data_.coordinates.length<2&&(a=!1));else if(i.includes("-&-ZYWL-&-GeometryEditingPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingGroundPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingCircleCenter-Point"))o||(o=k.getAirRoute(r));else if(i.includes("-&-ZYWL-&-GeometryEditingCircleRadius-Point"))o||(o=k.getAirRoute(r));else if(i.includes("-&-ZYWL-&-GeometryEditingSlantPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点"}}else if(t.primitive instanceof Cesium.Billboard){if(i===r+"-&-ZYWL-&-PointOfInterest")o||(o=k.getAirRoute(r)),l="删除兴趣点",s=99999;else if(i.includes("-&-ZYWL-&-GraphicEditingPolyline-Point-")){if(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r)),o&&o.data_.coordinates.length<=2)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GraphicEditingPolygon-Point-")){if(o||(o=k.getAnnotation(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon-Point-")){if(o||(o=k.getCustomNoFlyZone(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GraphicEditingIcon"))o||(o=k.getAnnotation(r));else if(i.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||i.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))o||(o=k.getAirRoute(r)),D=o.isCopy_,l="删除端点",o&&(a=o.isDelete_,o.data_.coordinates.length<2&&(a=!1));else if(i.includes("-&-ZYWL-&-GeometryEditingPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}else if(i.includes("-&-ZYWL-&-GeometryEditingGroundPolygon-Point-")){if(o||(o=k.getAirRoute(r)),o&&o.data_.coordinates.length<=3)return;l="删除端点",D=o.isCopy_}}else t.primitive instanceof Cesium.Primitive?i.includes("-&-ZYWL-&-GraphicEditingPolyline")?(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r))):i.includes("-&-ZYWL-&-GraphicEditingPolygon")||i.includes("-&-ZYWL-&-GraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircle")||i.includes("-&-ZYWL-&-GraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircleRadiusPolyline")?o||(o=k.getAnnotation(r)):i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon")||i.includes("-&-ZYWL-&-CustomGraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircle")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadiusPolyline")?o||(o=k.getCustomNoFlyZone(r)):i.includes("-&-ZYWL-&-GeometryEditingPolyline")||i.includes("-&-ZYWL-&-GeometryEditingPolygon")||i.includes("-&-ZYWL-&-GeometryEditingPolygonOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircle")||i.includes("-&-ZYWL-&-GeometryEditingCircleOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircleRadiusPolyline")?o||(o=k.getAirRoute(r)):i.includes("-&-ZYWL-&-GeometryEditingSlantPolygon")&&(o||(o=k.getAirRoute(r)),l="删除被测区"):t.primitive instanceof Cesium.GroundPolylinePrimitive?i.includes("-&-ZYWL-&-GraphicEditingPolyline")?(o||(o=k.getAnnotation(r)),o||(o=k.getPipeLine(r))):i.includes("-&-ZYWL-&-GraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-GraphicEditingCircleRadiusPolyline")?o||(o=k.getAnnotation(r)):i.includes("-&-ZYWL-&-CustomGraphicEditingPolygonOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleOutline")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircleRadiusPolyline")?o||(o=k.getCustomNoFlyZone(r)):(i.includes("-&-ZYWL-&-GeometryEditingPolyline")||i.includes("-&-ZYWL-&-GeometryEditingPolygonOutline")||i.includes("-&-ZYWL-&-GeometryEditingGroundPolygonOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircleOutline")||i.includes("-&-ZYWL-&-GeometryEditingCircleRadiusPolyline")||i.includes("-&-ZYWL-&-GeometryEditingBandingPolyline"))&&(o||(o=k.getAirRoute(r))):t.primitive instanceof Cesium.GroundPrimitive&&(i.includes("-&-ZYWL-&-GraphicEditingPolygon")||i.includes("-&-ZYWL-&-GraphicEditingCircle")?o||(o=k.getAnnotation(r)):i.includes("-&-ZYWL-&-CustomGraphicEditingPolygon")||i.includes("-&-ZYWL-&-CustomGraphicEditingCircle")?o||(o=k.getCustomNoFlyZone(r)):(i.includes("-&-ZYWL-&-GeometryEditingPolygon")||i.includes("-&-ZYWL-&-GeometryEditingGroundPolygon")||i.includes("-&-ZYWL-&-GeometryEditingCircle"))&&(o||(o=k.getAirRoute(r))));o&&k.getMenu(this.containerID,n.position,l,a&&o.isDelete_,()=>{if(k.removeMenu(this.containerID),s===99999){window.isPointOfInterestOpen=!1;let c=document.getElementById(`${this.containerID}-MapEnginePointOfInterest`);c&&(c.src=bo.getIconBase64("PointOfInterestClose.png"))}o.hasOwnProperty("mouseRightClick")&&o.mouseRightClick(s)},D,c=>{k.removeMenu(this.containerID),o.hasOwnProperty("copyPoint")&&o.copyPoint(s,c)},s,P,c=>{k.removeMenu(this.containerID),console.log("设置禁止返回点",c),k.emitNoReturnNode({index:c})})}}else{const i=k.getCartesian(e,n.position);i&&k.emitMapRightClick({windowPosition:n.position,coordinate:k.transformCoordinate(i)})}}}},cesiumLeftDoubleClick(n){},async cesiumAltAndLeftDown(n){const A=k.getMapEngineInstance(this.cesiumID),e=await k.pickFeature(A,n.position);if(Cesium.defined(e)&&((e?.primitive instanceof Cesium.PointPrimitive||e?.primitive instanceof Cesium.Billboard)&&e?.id.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||e?.primitive instanceof Cesium.Label&&e?.id.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"))){const t=k.extractionID(e?.id),i=k.getAirRoute(t);if(i&&i.isEditable_)return}this.isAltLeftDownMove=!0,A.scene.screenSpaceCameraController.enableInputs=!1},cesiumAltAndLeftUp(){if(this.isAltLeftDownMove){this.isAltLeftDownMove=!1;let n=k.getMapEngineInstance(this.cesiumID);n.scene.screenSpaceCameraController.enableInputs=!0,this.startMousePosition=void 0}},cesiumAltAndLeftMouseMove(n){this.isAltLeftDownMove&&(this.mousePosition=n.endPosition,this.Looking())},Looking(){if(this.startMousePosition||(this.startMousePosition=this.mousePosition.clone()),this.startMousePosition.equals(this.mousePosition))return;const n=this.mousePosition.x-this.startMousePosition.x,A=this.mousePosition.y-this.startMousePosition.y,e=k.getMapEngineInstance(this.cesiumID),t=e.scene.camera,i=e.scene.ellipsoid.geodeticSurfaceNormal(t.position,new Cesium.Cartesian3);t.look(i,n*this.lookFactor),t.look(t.right,A*this.lookFactor),this.startMousePosition=this.mousePosition.clone()},cesiumLeftDownAndShift(n){let A=k.getMapEngineInstance(this.cesiumID);A.scene.screenSpaceCameraController.enableInputs=!1;let e=k.getCartesian(A.scene,n.position);Cesium.defined(e)&&(this.isShiftLeftDownMove=!0)},cesiumLeftUpAndShift(){this.isShiftLeftDownMove=!1;const n=k.getMapEngineInstance(this.cesiumID);n.container.style.cursor="",n.scene.screenSpaceCameraController.enableInputs=!0},cesiumMouseMoveAndShift(n){if(this.isShiftLeftDownMove){const A=k.getMapEngineInstance(this.cesiumID);A.container.style.cursor="grabbing";const e=n.startPosition.x-n.endPosition.x,t=n.startPosition.y-n.endPosition.y;this.ShiftLooking(e,t)}},ShiftLooking(n,A){let t=k.getMapEngineInstance(this.cesiumID).scene.camera;n>0?t.moveRight(Math.abs(n)+20):n<0&&t.moveLeft(Math.abs(n)+20),A>0?t.moveDown(Math.abs(A)+20):A<0&&t.moveUp(Math.abs(A)+20),this.adjustHeightForTerrain()},setMapLocation(){const n=this.MapLocation_Temp?.type??0,A=this.MapLocation_Temp?.radius??100,e=this.MapLocation_Temp?.duration??0,t=this.MapLocation_Temp?.maxZoom??16;let i=k.getMapEngineInstance(this.cesiumID);if(i)switch(n){case 0:{let r=k.computeMultipointCenter(this.MapLocation_Temp.positions),s=this.MapLocation_Temp.positions.map(l=>Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(l.longitude,l.latitude,l.altitude),r)),o=Math.max(...s),a=new Cesium.BoundingSphere(r,o);i.scene.camera.flyToBoundingSphere(a,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),a.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(a.center),k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}break;case 1:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.get3DTileset(r)),s){let o;if(s.data_.type===3||s.data_.type===5)if(s.pcdCenter_||s.plyCenter_)s.pcdCenter_&&(o=new Cesium.BoundingSphere(s.pcdCenter_,1e3)),s.plyCenter_&&(o=new Cesium.BoundingSphere(s.plyCenter_,1e3));else return;else o=s.tilesetInstance_.boundingSphere;console.log(o),o&&i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),o.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(o.center),this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break;case 2:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.getModel(r)),s){let o=s.modelInstance_.boundingSphere;i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),o.radius+A),complete:a=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(o.center),this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break;case 3:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.getVectorData(r)),s){let o=new Cesium.BoundingSphere(k.transformCartesian3(s.center_),s.radius_);i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),o.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=s.center_,this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break;case 4:{let r=this.MapLocation_Temp.ID,s;if(r&&(s=k.getAirRoute(r)),s){let o=s.geometryInstance_._boundingSpheres[0],l=s.geometryInstance_.geometryInstances.geometry._polygonHierarchy.positions.map(h=>k.transformCoordinate(h)),D=k.computeNormalVector(l);D.y<0&&Cesium.Cartesian3.negate(D,D);let{heading:P,pitch:c}=k.computeHeadingAndPitch(o.center,D);i.scene.camera.flyToBoundingSphere(o,{duration:e,offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(P),Cesium.Math.toRadians(c),o.radius+A),complete:()=>{this.refreshZoom(),this.MapLocation_Temp=void 0,this.loadZoom()>t&&(this.syncZoom(t),this.MapEngine_Temp.center=k.transformCoordinate(o.center),this.MapEngine_Temp.camera.heading=0,k.setMapEnginePosition(this.MapEngine_Temp,this.loadZoom(),this.MapConfiguration_Temp,!1,!1,!1,()=>{this.refreshZoom()}))}})}}break}else{let r=k.getMapEngineInstance(this.maptalksID);if(r)switch(n){case 0:{let s=this.MapLocation_Temp.positions.map(P=>[P.longitude,P.latitude]),o=d0(s),a=nw(ad(Fs(o)),A,{units:"meters"}),l=Fs(a),D=new Bn(l[0],l[1],l[2],l[3]);r.fitExtent(D,0,{duration:e},P=>{P.playState==="finished"&&(this.MapLocation_Temp=void 0,r.getZoom()>t&&r.setZoom(t))})}break;case 3:{let s=this.MapLocation_Temp.ID,o;if(s&&(o=k.getVectorData(s)),o&&Array.isArray(o.primitives_)){let a=[];for(const c of o.primitives_){let h=c.getExtent().toJSON(),g=[h.xmin,h.ymin,h.xmax,h.ymax];a.push(ad(g))}let l=xa(a),D=Fs(l),P=new Bn(D[0],D[1],D[2],D[3]);r.fitExtent(P,0,{duration:e},c=>{c.playState==="finished"&&(this.MapLocation_Temp=void 0,r.getZoom()>t&&r.setZoom(t))})}}break}}},async setZYWLMapLayers(){if(this.MapLayers_IsUpdating=!0,this.MapLayers_Timer=setTimeout(()=>{this.MapLayers_IsUpdating=!1,this.MapLayers_Timer=void 0},this.MapLayers_UpdateInterval),this.MapConfiguration_Temp?.isAR??!1)return;let A=this.MapEngine_Temp?.token?.appID,e=this.MapEngine_Temp?.token?.appSign,t=k.getMapEngineInstance(this.maptalksID),i=k.getMapEngineInstance(this.cesiumID),r=k.getMapEngineInstance(this.openlayersID),s,o,a=[],l=[],D,P=k.ArraySortByKey(cA.cloneDeep(this.MapLayers_Temp),"zIndex");if(i){let h=k.getMapLayers("cesium");h&&await this.processArrayAsync(h,([g,u])=>{console.log("使用异步方式处理数组",g,u);let Q;this.MapLayers_Temp.length&&this.MapLayers_Temp.find(C=>C.ID+"-cesium"===g)||(Q=JSON.parse(u.imageryProvider.credit.html)),Q&&Q.layerID&&(k.removeMapLayer(Q.layerID),i.imageryLayers.remove(u))})}else if(r){D=k.getOLLayerByID(r,"GroupTilesOL");let h=k.getMapLayers("openlayers");h&&await this.processArrayAsync(h,g=>{let u=g[1],Q;this.MapLayers_Temp.length&&this.MapLayers_Temp.find(C=>C.ID+"-openlayers"===g[0])||(Q=u.getProperties().id),Q&&(k.removeMapLayer(Q),D.pop(u))})}else{if(s=t.getLayer("group-tiles"),s){let h=s.getLayers();this.MapLayers_Temp?.length?await this.processArrayAsync(h,g=>{let u=g.getId();this.MapLayers_Temp.find(w=>w.ID+"-maptalks"===u)||(s.removeLayer([g]),k.removeMapLayer(u))}):await this.processArrayAsync(h,g=>{let u=g.getId();s.removeLayer([g]),k.removeMapLayer(u)})}if(o=t.getLayer("group-header-tiles"),o){let h=o.getLayers();this.MapLayers_Temp.length?await this.processArrayAsync(h,g=>{let u=g.getId();this.MapLayers_Temp.find(w=>w.ID+"-maptalks"===u)||(o.removeLayer([g]),k.removeMapLayer(u))}):await this.processArrayAsync(h,g=>{let u=g.getId();o.removeLayer([g]),k.removeMapLayer(u)})}}const c=this.MapEngine_Temp?.customStyle??void 0;if(await this.processArrayAsync(this.MapLayers_Temp,async h=>{let g=k.getMapLayerID(h.ID),u=h?.visible??!0,Q=h?.opacity??1,w=h?.zIndex??0;h.hasOwnProperty("appID")&&h.appID&&h.appID.length&&(A=h.appID),h.hasOwnProperty("appSign")&&h.appSign&&h.appSign.length&&(e=h.appSign);let C,E;i?(C=g.cesiumLayerID,E=h?.splitDirection,E?E==="left"?E=Cesium.SplitDirection.LEFT:E==="right"?E=Cesium.SplitDirection.RIGHT:E=Cesium.SplitDirection.NONE:E=Cesium.SplitDirection.NONE,window.sliderHandler||(E=Cesium.SplitDirection.NONE)):r?C=g.openlayersLayerID:C=g.maptalksLayerID;let p=!1,m;try{(await new Promise(z=>{if(i)if(m=k.getMapLayer(C),m){let L={layerID:C,zIndex:w};m.imageryProvider._credit._html=JSON.stringify(L),m.alpha=Q,m.show=u,m.splitDirection=E}else{p=!0;let L=k.getTileLayerCesium(h,A,e);if(L&&(m=new Cesium.ImageryLayer(L,{show:u,splitDirection:E}),i.imageryLayers.add(m),c)){let b=Cesium.Color.fromCssColorString(k.setMapColor(c));if(b){const U=new RGA({bgColor:b,alpha:.5,invert:!0,preMultiplyAlpha:!0});let Y=m._createTextureWebGL;m._createTextureWebGL=function(R,J){let F=Y.bind(this)(R,J);return U.processTexture(R,F)||F}}}}else r?(m=k.getMapLayer(C),m?(m.setVisible(u),m.setZIndex(w),m.setOpacity(Q)):(p=!0,m=k.getTileLayerOL(h,A,e),m&&D.push(m))):(m=k.getMapLayer(C),m?(u?m.show():m.hide(),m.setZIndex(w),m.setOpacity(Q)):(p=!0,m=k.getTileLayerMaptalks(h),m&&(A&&e&&o?l.push(m):a.push(m))));z({obj:m,isNew:p})})).isNew&&k.setMapLayer(C,m)}catch(T){console.error(`处理MapLayers>>>>> ${C} 时出错:`,T)}}),i)k.sortCesiumLayers(i,P);else{let h;c&&(h=k.setMapCssFilter(c)),l.length&&(o?o.addLayer(l):o=new t9("group-header-tiles",l,{renderer:window.mapRenderer,cssFilter:h}).addEventListener("renderercreate",function(g){g.renderer.loadTileImage=function(u,Q){const w=new XMLHttpRequest;w.withCredentials=!0,w.responseType="blob",w.open("GET",Q),w.setRequestHeader("Access-Control-Allow-Origin","*"),w.setRequestHeader("appid",A),w.setRequestHeader("sign",e),w.onload=function(){const C=URL.createObjectURL(w.response);u.addEventListener("load",function(){URL.revokeObjectURL(C)}),u.crossOrigin="Anonymous",u.src=C},w.send()}}),t.addLayer(o)),a.length&&(s?s.addLayer(a):s=new t9("group-tiles",a,{renderer:window.mapRenderer,cssFilter:h}).addEventListener("renderercreate",function(g){g.renderer.loadTileImage=function(u,Q){u.crossOrigin="Anonymous",u.src=Q}}),t.addLayer(s))}},async setZYWLTilesets(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,s=>{const o=s.ID.toString();let a=k.get3DTileset(o);a&&(k.remove3DTileset(o),a.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,s=>{const o=s.ID.toString();let a=k.get3DTileset(o);a&&a.DataProcessing(cA.cloneDeep(s))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=e.added??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,s=>{const o=s.ID.toString();let a=new ZJA(this.cesiumID,n);a&&(k.set3DTileset(o,a),a.DataProcessing(cA.cloneDeep(s)))}),console.log(`新增了${n}数据>>>>>>>>>>`,r))})},async setZYWLModels(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getModel(a);l&&(k.removeModel(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getModel(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new usA(this.cesiumID,n):l=new gsA(this.maptalksID,n),l&&(k.setModel(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLPointCloudRecognitions(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,s=>{const o=s.ID.toString();let a=k.getPointCloudRecognition(o);a&&(k.removePointCloudRecognition(o),a.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,s=>{const o=s.ID.toString();let a=k.getPointCloudRecognition(o);a&&a.DataProcessing(cA.cloneDeep(s))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=e.added??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,s=>{const o=s.ID.toString();let a=new sGA(this.cesiumID,n);a&&(k.setPointCloudRecognition(o,a),a.DataProcessing(cA.cloneDeep(s)))}),console.log(`新增了${n}数据>>>>>>>>>>`,r))})},async setZYWLNoFlys(n,A){await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getNoFly(l);D&&(k.removeNoFly(l),D.clear())},500),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getNoFly(l);D&&D.DataProcessing(cA.cloneDeep(a))},500),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,async a=>{const l=a.ID.toString();let D;switch(a.type){case 1:s?D=new uGA(this.cesiumID,n):D=new DGA(this.maptalksID,n);break;case 2:s?D=new _m(this.cesiumID,n):D=new QsA(this.maptalksID,n);break;case 3:s?D=new QGA(this.cesiumID,n):D=new PGA(this.maptalksID,n);break;case 4:s?D=new cGA(this.cesiumID,n):D=new oGA(this.maptalksID,n);break;case 5:s?D=new gGA(this.cesiumID,n):D=new lGA(this.maptalksID,n);break}D&&(k.setNoFly(l,D),D.DataProcessing(cA.cloneDeep(a)))},500).then(a=>{console.log("新增完成")}),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},async setZYWLAnnotations(n,A){await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getAnnotation(l);D&&(k.removeAnnotation(l),D.clear())},500),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getAnnotation(l);D&&D.DataProcessing(cA.cloneDeep(a))},500),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,a=>{const l=a.ID.toString();var D;switch(a.type){case 1:s?D=new vsA(this.cesiumID,n):D=new fsA(this.maptalksID,n);break;case 2:s?D=new CsA(this.cesiumID,n):D=new KS(this.maptalksID,n);break;case 3:s?D=new vGA(this.cesiumID,n):D=new dsA(this.maptalksID,n);break;case 4:s?D=new fGA(this.cesiumID,n):D=new wsA(this.maptalksID,n);break;case 5:s?D=new dGA(this.cesiumID,n):D=new wGA(this.maptalksID,n);break}D&&(k.setAnnotation(l,D),D.DataProcessing(cA.cloneDeep(a)))},500),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},async setZYWLFlightPaths(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getFlightPath(a);l&&(k.removeFlightPath(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getFlightPath(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new hGA(this.cesiumID,n):l=new aGA(this.maptalksID,n),l&&(k.setFlightPath(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLPipeLines(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getPipeLine(a);l&&(k.removePipeLine(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getPipeLine(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;switch(o.type){case 1:r?l=new vsA(this.cesiumID,n):l=new fsA(this.maptalksID,n);break;case 2:r?l=new CsA(this.cesiumID,n):l=new KS(this.maptalksID,n);break}l&&(k.setPipeLine(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLOrthophotes(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getOrthophote(a);l&&(k.removeOrthophote(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getOrthophote(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new jGA(this.cesiumID,n):l=new yGA(this.maptalksID,n),l&&(k.setOrthophote(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLAirRoutes(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getAirRoute(a);l&&(k.removeAirRoute(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getAirRoute(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;switch(o.type){case 2:r?l=new KR(this.cesiumID,n):l=new KS(this.maptalksID,n);break;case 3:r?l=new xGA(this.cesiumID,n):l=new dsA(this.maptalksID,n);break;case 4:r?l=new zGA(this.cesiumID,n):l=new wsA(this.maptalksID,n);break;case 5:r&&(l=new UGA(this.cesiumID,n));break;case 6:r&&(l=new LGA(this.cesiumID,n));break;case 7:r&&(l=new NGA(this.cesiumID,n));break;case 8:r&&(l=new bGA(this.cesiumID,n));break}l&&(k.setAirRoute(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLHeatMaps(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getHeatMap(a);l&&(k.removeHeatMap(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getHeatMap(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new msA(this.cesiumID,n):l=new msA(this.maptalksID,n),l&&(k.setHeatMap(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLVideoProjections(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getVideoProjection(a);l&&(k.removeVideoProjection(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getVideoProjection(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new joA(this.cesiumID,n):l=new joA(this.maptalksID,n),l&&(k.setVideoProjection(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLVectorDatas(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getVectorData(a);l&&(k.removeVectorData(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getVectorData(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r?l=new UoA(this.cesiumID,n):l=new UoA(this.maptalksID,n),l&&(k.setVectorData(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLS3Ms(n,A){k.isSupportWebGL2()&&await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getS3M(l);D&&(k.removeS3M(l),D.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getS3M(l);D&&D.DataProcessing(cA.cloneDeep(a))}),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,a=>{const l=a.ID.toString();let D;s&&(D=new FGA(this.cesiumID,n)),D&&(k.setS3M(l,D),D.DataProcessing(cA.cloneDeep(a)))}),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},async setZYWLRadar(n,A){await this.handleCRUDData(n,A,async e=>{const t=e.removed??[];Array.isArray(t)&&t.length&&(await this.processArrayAsync(t,o=>{const a=o.ID.toString();let l=k.getRadar(a);l&&(k.removeRadar(a),l.clear())}),console.log(`删除了${n}数据>>>>>>>>>>`,t));const i=e.changed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,o=>{const a=o.ID.toString();let l=k.getRadar(a);l&&l.DataProcessing(cA.cloneDeep(o))}),console.log(`更新了${n}数据>>>>>>>>>>`,i));const r=k.getMapEngineInstance(this.cesiumID),s=e.added??[];Array.isArray(s)&&s.length&&(await this.processArrayAsync(s,o=>{const a=o.ID.toString();let l;r&&(l=new SGA(this.cesiumID,n)),l&&(k.setRadar(a,l),l.DataProcessing(cA.cloneDeep(o)))}),console.log(`新增了${n}数据>>>>>>>>>>`,s))})},async setZYWLCustomNoFlyZones(n,A){await this.handleCRUDData(n,A,async t=>{const i=t.removed??[];Array.isArray(i)&&i.length&&(await this.processArrayAsync(i,a=>{const l=a.ID.toString();let D=k.getCustomNoFlyZone(l);D&&(k.removeCustomNoFlyZone(l),D.clear())},500),console.log(`删除了${n}数据>>>>>>>>>>`,i));const r=t.changed??[];Array.isArray(r)&&r.length&&(await this.processArrayAsync(r,a=>{const l=a.ID.toString();let D=k.getCustomNoFlyZone(l);D&&D.DataProcessing(cA.cloneDeep(a))},500),console.log(`更新了${n}数据>>>>>>>>>>`,r));const s=k.getMapEngineInstance(this.cesiumID),o=t.added??[];Array.isArray(o)&&o.length&&(await this.processArrayAsync(o,a=>{const l=a.ID.toString();var D;switch(a.type){case 3:s?D=new kGA(this.cesiumID,n):D=new TGA(this.maptalksID,n);break;case 4:s?D=new OGA(this.cesiumID,n):D=new MGA(this.maptalksID,n);break}D&&(k.setCustomNoFlyZone(l,D),D.DataProcessing(cA.cloneDeep(a)))},500),console.log(`新增了${n}数据>>>>>>>>>>`,o))})},MapClickHandler(n){this.$emit("onMapClick",n)},GraphClickHandler(n){const A=this.setEditElement(),e=A?.data_?.ID,t=n?.ID;!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection||A&&e!==t||this.$emit("onGraphClick",n)},GraphNodeClickHandler(n){!this.isDragging||this.isBeginRangingTool||window.isStartBoxSelection||this.$emit("onGraphNodeClick",n)},GraphChangingHandler(n){this.$emit("onGraphChanging",n)},GraphChangedHandler(n){this.$emit("onGraphChanged",n)},GraphRemovedHandler(n){this.$emit("onGraphRemoved",n)},GraphEditedHandler(n){this.$emit("onGraphEdited",n)},MapInitCompletedHandler(n){this.$emit("onMapInitCompleted",n)},MapRightClickHandler(n){this.$emit("onMapRightClick",n)},NoReturnNodeHandler(n){this.$emit("onNoReturnNode",n)},setWindowKey(){document.addEventListener("keydown",n=>{this.activeKeys.add(n.code),((this.activeKeys.has("ControlLeft")||this.activeKeys.has("ControlRight")||this.activeKeys.has("AltLeft")||this.activeKeys.has("AltRight")||this.activeKeys.has("ShiftLeft")||this.activeKeys.has("ShiftRight"))&&(this.activeKeys.has("ArrowUp")||this.activeKeys.has("ArrowDown")||this.activeKeys.has("ArrowLeft")||this.activeKeys.has("ArrowRight"))||this.activeKeys.has("ArrowUp")||this.activeKeys.has("ArrowDown")||this.activeKeys.has("ArrowLeft")||this.activeKeys.has("ArrowRight")||this.activeKeys.has("Equal")||this.activeKeys.has("Minus"))&&n.preventDefault(),this.rafId||this.onFrame()}),document.addEventListener("keyup",n=>{this.activeKeys.delete(n.code),this.activeKeys.size||(cancelAnimationFrame(this.rafId),this.rafId=0,this.cb())}),document.addEventListener("blur",()=>{this.activeKeys&&this.activeKeys.clear(),cancelAnimationFrame(this.afId),this.rafId=0,this.cb()})},onFrame(){this.activeKeys&&this.activeKeys.size&&this.cb(),this.rafId=requestAnimationFrame(this.onFrame)},adjustHeightForTerrain(){const A=k.getMapEngineInstance(this.cesiumID).scene.screenSpaceCameraController,e=!0,t=A._scene,i=t.mode;if(i===Cesium.SceneMode.SCENE2D||i===Cesium.SceneMode.MORPHING)return;const r=t.camera,s=t.ellipsoid??Cesium.Ellipsoid.WGS84,o=t.mapProjection;let a,l;Cesium.Matrix4.equals(r.transform,Cesium.Matrix4.IDENTITY)||(a=Cesium.Matrix4.clone(r.transform,new Cesium.Matrix4),l=Cesium.Cartesian3.magnitude(r.position),r._setTransform(Cesium.Matrix4.IDENTITY));const D=new Cesium.Cartographic;i===Cesium.SceneMode.SCENE3D?s.cartesianToCartographic(r.position,D):o.unproject(r.position,D);let P=!1;if(D.height<A._minimumCollisionTerrainHeight){const c=A._scene.globeHeight;if(Cesium.defined(c)){const h=c+A.minimumZoomDistance;(c-A._lastGlobeHeight)/A._lastGlobeHeight,D.height<h&&e&&(D.height=h,i===Cesium.SceneMode.SCENE3D?s.cartographicToCartesian(D,r.position):o.project(D,r.position),P=!0),A._lastGlobeHeight=c}}Cesium.defined(a)&&(r._setTransform(a),P&&(Cesium.Cartesian3.normalize(r.position,r.position),Cesium.Cartesian3.negate(r.position,r.direction),Cesium.Cartesian3.multiplyByScalar(r.position,Math.max(l,A.minimumZoomDistance),r.position),Cesium.Cartesian3.normalize(r.direction,r.direction),Cesium.Cartesian3.cross(r.direction,r.up,r.right),Cesium.Cartesian3.cross(r.right,r.direction,r.up)))},cb(){const n=k.getMapEngineInstance(this.cesiumID),A=k.getMapEngineInstance(this.maptalksID);if(this.activeKeys&&this.activeKeys.size){let i=!1,r=!1,s=!1,o=!1,a=!1,l=!1,D=!1,P=!1,c=!1;if(this.activeKeys.has("ArrowUp")&&(i=!0),this.activeKeys.has("ArrowDown")&&(r=!0),this.activeKeys.has("ArrowLeft")&&(s=!0),this.activeKeys.has("ArrowRight")&&(o=!0),(this.activeKeys.has("Equal")||this.activeKeys.has("NumpadAdd"))&&(a=!0),(this.activeKeys.has("Minus")||this.activeKeys.has("NumpadSubtract"))&&(l=!0),(this.activeKeys.has("ControlLeft")||this.activeKeys.has("ControlRight"))&&(D=!0),(this.activeKeys.has("AltLeft")||this.activeKeys.has("AltRight"))&&(P=!0),(this.activeKeys.has("ShiftLeft")||this.activeKeys.has("ShiftRight"))&&(c=!0),n){let h=n.scene,g=h.canvas,u=h.camera;const Q=25;if(i||r||s||o)if(c){k.createMapFocusIcon(this.containerID,void 0,!1),this.isKeyDown=!0,this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0;let w=0,C=0;s&&(w=-3),o&&(w=3),i&&(C=-3),r&&(C=3),this.ShiftLooking(w,C)}else if(D){if(this.isKeyDown=!0,!this.rotateCenter){const w=new Cesium.Cartesian2(g.width/2,g.height/2);this.rotateCenter=k.getCartesian(h,w),this.rotateCenter&&(u.lookAtTransform(Cesium.Matrix4.IDENTITY),u.lookAtTransform(Cesium.Transforms.eastNorthUpToFixedFrame(this.rotateCenter)),k.createMapFocusIcon(this.containerID,w,!0))}if(this.rotateCenter){const w=Cesium.Math.toRadians(.5);s&&u.rotateLeft(w),o&&u.rotateRight(w),i&&u.rotateDown(w),r&&u.rotateUp(w),this.adjustHeightForTerrain()}}else if(P){k.createMapFocusIcon(this.containerID,void 0,!1),this.isKeyDown=!0,this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0;const w=h.ellipsoid.geodeticSurfaceNormal(u.position,new Cesium.Cartesian3);let C=0,E=0;s&&(C=-.5),o&&(C=.5),i&&(E=-.5),r&&(E=.5),u.look(w,Cesium.Math.toRadians(C)),u.look(u.right,Cesium.Math.toRadians(E))}else k.createMapFocusIcon(this.containerID,void 0,!1),this.isKeyDown=!0,this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0,s&&u.moveLeft(Q),o&&u.moveRight(Q),i&&u.rotateDown(Cesium.Math.toRadians(3e-4)),r&&u.rotateUp(Cesium.Math.toRadians(3e-4));else if(a||l){if(!this.zoomCenter){const w=new Cesium.Ray(u.position,u.direction),C=Cesium.IntersectionTests.rayEllipsoid(w,h.globe.ellipsoid);if(C){const E=Cesium.Ray.getPoint(w,C.start);this.zoomCenter=h.cartesianToCanvasCoordinates(E,new Cesium.Cartesian2)}this.zoomCenter&&k.createMapFocusIcon(this.containerID,this.zoomCenter,!0)}a&&u.move(u.direction,50),l&&u.move(Cesium.Cartesian3.negate(u.direction,new Cesium.Cartesian3),50),this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}else this.rotateCenter&&u.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0,this.zoomCenter=void 0,this.ctrlRotateCenter||k.createMapFocusIcon(this.containerID,void 0,!1)}else if(A){if(i||r||s||o){const h=A.getZoom(),g=A.getCenter();var e=0;i&&!r&&!s&&!o&&(e=0),i&&!r&&s&&!o&&(e=-45),i&&!r&&!s&&o&&(e=45),!i&&r&&!s&&!o&&(e=180),!i&&r&&s&&!o&&(e=225),!i&&r&&!s&&o&&(e=135),!i&&!r&&s&&!o&&(e=-90),!i&&!r&&!s&&o&&(e=90);var t=kr(Gt([g.x,g.y]),20,e,{units:"meters"});A.setCenterAndZoom(t.geometry.coordinates,h)}else if(a||l){const h=A.getCenter();let g=A.getZoom();a&&(g=g+.1,A.setCenterAndZoom(h,g)),l&&(g=g-.1,A.setCenterAndZoom(h,g))}}}else if(this.isKeyDown=!1,n){let r=n.scene.camera;this.rotateCenter&&r.lookAtTransform(Cesium.Matrix4.IDENTITY),this.rotateCenter=void 0,this.zoomCenter=void 0,k.createMapFocusIcon(this.containerID,void 0,!1),this.initializeMap||(this.setMapEngineStateBar(),this.refreshZoom())}},createTileLoadProgressIcon(){let n=document.getElementById(`${this.containerID}-MapEngineStateBarDiv`);if(n){let A=document.getElementById(`${this.containerID}-MapTileLoadProgressDiv`),e=document.getElementById(`${this.containerID}-MapTileLoadProgressTextDiv`);const t=this.MapPlugins_Temp?.scale??1,i=32*t,r=14*t;if(!A){A=document.createElement("canvas"),A.id=`${this.containerID}-MapTileLoadProgressDiv`,A.style.position="absolute",n.appendChild(A),A.width="24",A.height=i,A.style.zIndex=6,A.style.left="60px";const s=A.getContext("2d"),o=6;s.translate(o,o)}e||(e=document.createElement("div"),e.id=`${this.containerID}-MapTileLoadProgressTextDiv`,e.style.position="absolute",n.appendChild(e),e.style.color="#fff",e.style.width=`${120*t}px`,e.style.height=`${i}px`,e.style.fontSize=`${r}px`,e.style.zIndex=6,e.style.alignContent="center",e.style.left="84px",e.style.paddingLeft="5px")}},drawCircle(n){let A=document.getElementById(`${this.containerID}-MapTileLoadProgressDiv`),e=document.getElementById(`${this.containerID}-MapTileLoadProgressTextDiv`);if(A){const i=32*(this.MapPlugins_Temp?.scale??1),r=A.getContext("2d"),s=6;r.clearRect(-s,-s,A.width,A.height),r.beginPath(),r.arc((24-s*2)*.5,(i-s*2)*.5,s,1.5*Math.PI,2*Math.PI*n/100+1.5*Math.PI),r.strokeStyle="#fff",r.lineWidth=3,r.stroke()}n<0&&(n=0),n>100&&(n=100),e&&(e.textContent=`${n}%`)}}};function kXA(n,A,e,t,i,r){return null}const bXA=yXA(OXA,[["render",kXA]]);class rD{static calculateBeiDouGridCode=(A,e=2)=>{function t(w,C,E,p,m="N",T,z=2){let L,b;switch(p){case 1:L=6,b=4;break;case 2:L=30/60,b=30/60;break;case 3:L=15/60,b=10/60;break;case 4:L=1/60,b=1/60;break;case 5:L=4/60/60,b=4/60/60;break;case 6:L=2/60/60,b=2/60/60;break;case 7:L=1/4/60/60,b=1/4/60/60;break;case 8:L=1/32/60/60,b=1/32/60/60;break;case 9:L=1/256/60/60,b=1/256/60/60;break;case 10:L=1/2048/60/60,b=1/2048/60/60;break}let U,Y,R,J,F,X;if(p===1){switch(m){case"N":U={longitude:w.longitude+(E-1)*L,latitude:w.latitude+C*b},Y={longitude:w.longitude+E*L,latitude:w.latitude+C*b},R={longitude:w.longitude+E*L,latitude:w.latitude+(C-1)*b},J={longitude:w.longitude+(E-1)*L,latitude:w.latitude+(C-1)*b},F="West-North",X=R,E>30&&(F="East-North",X=J);break;case"S":U={longitude:w.longitude+(E-1)*L,latitude:w.latitude-(C-1)*b},Y={longitude:w.longitude+E*L,latitude:w.latitude-(C-1)*b},R={longitude:w.longitude+E*L,latitude:w.latitude-C*b},J={longitude:w.longitude+(E-1)*L,latitude:w.latitude-C*b},F="West-South",X=Y,E>30&&(F="East-South",X=U);break}let W=m,q=String(E).padStart(2,"0"),_=String.fromCharCode(64+C);return{level:p,code:`${W}${q}${_}`,row:C,col:E,hemisphere:F,startCoord:X,coordinates:[U,Y,R,J]}}else if(p===2||p===3||p===4||p===5||p===6||p===7||p===8||p===9||p===10){switch(m){case"West-North":U={longitude:w.longitude-(E+1)*L,latitude:w.latitude+(C+1)*b},Y={longitude:w.longitude-E*L,latitude:w.latitude+(C+1)*b},R={longitude:w.longitude-E*L,latitude:w.latitude+C*b},J={longitude:w.longitude-(E+1)*L,latitude:w.latitude+C*b},X=R;break;case"East-North":U={longitude:w.longitude+E*L,latitude:w.latitude+(C+1)*b},Y={longitude:w.longitude+(E+1)*L,latitude:w.latitude+(C+1)*b},R={longitude:w.longitude+(E+1)*L,latitude:w.latitude+C*b},J={longitude:w.longitude+E*L,latitude:w.latitude+C*b},X=J;break;case"West-South":U={longitude:w.longitude-(E+1)*L,latitude:w.latitude-C*b},Y={longitude:w.longitude-E*L,latitude:w.latitude-C*b},R={longitude:w.longitude-E*L,latitude:w.latitude-(C+1)*b},J={longitude:w.longitude-(E+1)*L,latitude:w.latitude-(C+1)*b},X=Y;break;case"East-South":U={longitude:w.longitude+E*L,latitude:w.latitude-C*b},Y={longitude:w.longitude+(E+1)*L,latitude:w.latitude-C*b},R={longitude:w.longitude+(E+1)*L,latitude:w.latitude-(C+1)*b},J={longitude:w.longitude+E*L,latitude:w.latitude-(C+1)*b},X=U;break}if(p===2){let W=E;return E>=10&&(W=String.fromCharCode(64+(E-9))),{level:p,code:`${T}${W}${C}`,row:C,col:E,hemisphere:m,startCoord:X,coordinates:[U,Y,R,J]}}if(p===3){let W=E*2+C;return{level:p,code:`${T}${W}`,row:C,col:E,hemisphere:m,startCoord:X,coordinates:[U,Y,R,J]}}if(p===4){let W=E;return E>=10&&(W=String.fromCharCode(64+(E-9))),{level:p,code:`${T}${W}${C}`,row:C,col:E,hemisphere:m,startCoord:X,coordinates:[U,Y,R,J]}}}}console.time("计算北斗网格");const i={longitude:-180,latitude:0};let r=22,s=60;const o=[];for(let w=1;w<=r;w++)for(let C=1;C<=s;C++)o.push(t(i,w,C,1,"N",e)),o.push(t(i,w,C,1,"S",e));const a=[],l=[],D=[],P=[],c=[],h=[],g=[],u=[],Q=[];for(let w=2;w<=A;w++){let C;w===2?(r=8,s=12,C=o):w===3?(r=3,s=2,C=a):w===4?(r=10,s=15,C=l):w===5?(r=15,s=15,C=D):w===6?(r=2,s=2,C=P):w===7?(r=8,s=8,C=c):w===8?(r=8,s=8,C=h):w===9?(r=8,s=8,C=g):w===10&&(r=8,s=8,C=u);for(const E of C)for(let p=0;p<r;p++)for(let m=0;m<s;m++){let T=t(E.startCoord,p,m,w,E.hemisphere,E.code,e);w===2?a.push(T):w===3?l.push(T):w===4?D.push(T):w===5?P.push(T):w===6?c.push(T):w===7?h.push(T):w===8?g.push(T):w===9?u.push(T):w===10&&Q.push(T)}}return console.log(o,a,l,D),console.timeEnd("计算北斗网格"),{firstGrids:o,secondGrids:a,thirdGrids:l,fourthGrids:D,fifthGrids:P,sixthGrids:c,seventhGrids:h,eighthGrids:g,ninthGrids:u,tenthGrids:Q}};static calculatePointToLineDistance=(A,e)=>{var t;Array.isArray(A)?t=Gt(A):t=Gt([A.longitude,A.latitude]);var i=yo(e.map(r=>Array.isArray(r)?r:[A.longitude,A.latitude]));return LDA(t,i,{units:"meters"})};static calculateBearing=(A,e,t,i)=>{const r=Math.PI/180,s=180/Math.PI,o=A*r,a=t*r,l=(i-e)*r,D=Math.sin(l)*Math.cos(a),P=Math.cos(o)*Math.sin(a)-Math.sin(o)*Math.cos(a)*Math.cos(l);return(Math.atan2(D,P)*s+360)%360};static calculatePixel=(A,e,t,i,r,s,o,a,l=0,D=-90)=>{let P,c,h;if(Array.isArray(A)?(P=A[0],c=A[1],h=A[2]):(P=A?.longitude,c=A?.latitude,h=A?.altitude??A?.height),D===-90)A={longitude:P,latitude:c};else{D=Math.abs(D);let m=Math.tan(k.degreesToRadians(90-D))*h;A=this.rhumbDestination(A,m,l)}let g=this.haversineDistance(e.latitude,e.longitude,t.latitude,t.longitude)*1e3,u=this.haversineDistance(e.latitude,e.longitude,i.latitude,i.longitude)*1e3,Q=this.haversineDistance(A.latitude,A.longitude,a.latitude,a.longitude)*1e3,w=this.calculateBearing(A.latitude,A.longitude,a.latitude,a.longitude),C=parseInt(w/90);w=w%90;let E=s*.5,p=o*.5;if(w===0)switch(C){case 0:case 4:p=o*.5-Q/(u*.5)*(o*.5);break;case 1:E=s*.5+Q/(g*.5)*(s*.5);break;case 2:p=o*.5+Q/(u*.5)*(o*.5);break;case 3:E=s*.5-Q/(g*.5)*(s*.5);break}else{w=k.degreesToRadians(w);let m,T;switch(C){case 0:m=Math.sin(w)*Q,E=s*.5+m/(g*.5)*(s*.5),T=Math.cos(w)*Q,p=o*.5-T/(u*.5)*(o*.5);break;case 1:m=Math.cos(w)*Q,E=s*.5+m/(g*.5)*(s*.5),T=Math.sin(w)*Q,p=o*.5+T/(u*.5)*(o*.5);break;case 2:m=Math.sin(w)*Q,E=s*.5-m/(g*.5)*(s*.5),T=Math.cos(w)*Q,p=o*.5+T/(u*.5)*(o*.5);break;case 3:m=Math.cos(w)*Q,E=s*.5-m/(g*.5)*(s*.5),T=Math.sin(w)*Q,p=o*.5-T/(u*.5)*(o*.5);break}}return{x:E,y:p}};static destination=(A,e,t)=>{const i=63710088e-1,r=Math.PI/180,s=180/Math.PI;let o,a;Array.isArray(A)?(o=A[0],a=A[1]):(o=A.longitude,a=A.latitude);const l=o*r,D=a*r,P=t*r,c=e/i,h=Math.asin(Math.sin(D)*Math.cos(c)+Math.cos(D)*Math.sin(c)*Math.cos(P));return{longitude:(l+Math.atan2(Math.sin(P)*Math.sin(c)*Math.cos(D),Math.cos(c)-Math.sin(D)*Math.sin(h)))*s,latitude:h*s}};static rhumbDestination=(A,e,t)=>{const i=63710088e-1,r=Math.PI/180,s=180/Math.PI;let o,a;Array.isArray(A)?(o=A[0],a=A[1]):(o=A.longitude,a=A.latitude);const l=o*r,D=a*r,P=t*r,c=e/i,h=c*Math.cos(P);let g=D+h;Math.abs(g)>Math.PI/2&&(g=g>0?Math.PI-g:-Math.PI-g);const u=Math.log(Math.tan(g/2+Math.PI/4)/Math.tan(D/2+Math.PI/4)),Q=Math.abs(u)>1e-11?h/u:Math.cos(D),w=c*Math.sin(P)/Q;let E=((l+w)*s+540)%360-180,p=g*s;return E+=E-o>180?-360:o-E>180?360:0,{longitude:E,latitude:p}};static calculateCoordinate=(A,e,t,i,r,s,o=0,a=-90)=>{const{chip_w:l,chip_h:D,focus_w:P,focus_h:c}=k.getCameraTypes(r);let[h,g]=k.zoom2fov(s,l,D,P,c);const u=h/e,Q=g/t;let w,C,E;Array.isArray(A)?(w=A[0],C=A[1],E=A[2]):(w=A?.longitude,C=A?.latitude,E=A?.altitude??A?.height);let p=e*.5,m=t*.5,T,z;Array.isArray(i)?(T=i[0],z=i[1]):(T=i.x,z=i.y);let L=Math.abs(e*.5-T),b=Math.abs(t*.5-z),U=L*u,Y=b*Q;var R;if(a===-90){let J=E*Math.tan(k.degreesToRadians(U)),F=E*Math.tan(k.degreesToRadians(Y));R={longitude:w,latitude:C},T>p?R=this.rhumbDestination(A,J,o+90):T<p&&(R=this.rhumbDestination(A,J,o+270)),z<m?R=this.rhumbDestination(R,F,o):z>m&&(R=this.rhumbDestination(R,F,o+180))}else{a=Math.abs(a);let J=Math.tan(k.degreesToRadians(90-a))*E;R=this.rhumbDestination(A,J,o),z<m?J=Math.tan(k.degreesToRadians(90-a+Y))*E:z>m&&(J=Math.tan(k.degreesToRadians(90-a-Y))*E);let F=L*u;T>p?R=this.rhumbDestination(A,J,o+F):T<p&&(R=this.rhumbDestination(A,J,o-F))}return R};static haversineDistance=(A,e,t,i)=>{const r=63710088e-1,s=P=>P*Math.PI/180,o=s(t-A),a=s(i-e),l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(s(A))*Math.cos(s(t))*Math.sin(a/2)*Math.sin(a/2),D=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return r*D/1e3};static ShortestPathHighSpeed=(A,e,t)=>{class i{constructor(){this.heap=new Array(5e4),this.positions=new Map,this.size=0}push(D,P){if(this.positions.has(D)){const c=this.positions.get(D);if(this.heap[c].fValue<=P)return;this.heap[c].fValue=P,this._bubbleUp(c)}else{const c=this.size;this.heap[c]={node:D,fValue:P},this.positions.set(D,c),this.size++,this._bubbleUp(c)}}pop(){if(this.size===0)return null;const D=this.heap[0];return this.positions.delete(D.node),this.size--,this.size>0&&(this.heap[0]=this.heap[this.size],this.positions.set(this.heap[0].node,0),this._bubbleDown(0)),D}_bubbleUp(D){for(;D>0;){const P=D-1>>1;if(this.heap[P].fValue<=this.heap[D].fValue)break;[this.heap[P],this.heap[D]]=[this.heap[D],this.heap[P]],this.positions.set(this.heap[P].node,P),this.positions.set(this.heap[D].node,D),D=P}}_bubbleDown(D){for(;;){const P=(D<<1)+1,c=(D<<1)+2;let h=D;if(P<this.size&&this.heap[P].fValue<this.heap[h].fValue&&(h=P),c<this.size&&this.heap[c].fValue<this.heap[h].fValue&&(h=c),h===D)break;[this.heap[D],this.heap[h]]=[this.heap[h],this.heap[D]],this.positions.set(this.heap[D].node,D),this.positions.set(this.heap[h].node,h),D=h}}isEmpty(){return this.size===0}}function r(l){const D={},P=new Map,c=(h,g,u)=>{if(D[h]||(D[h]={}),D[g]||(D[g]={}),(!D[h][g]||u<D[h][g])&&(D[h][g]=u,D[g][h]=u),!P.has(h)){const[Q,w]=h.split(",").map(Number);P.set(h,{lat:Q,lon:w})}if(!P.has(g)){const[Q,w]=g.split(",").map(Number);P.set(g,{lat:Q,lon:w})}};for(const h of l.features)if(h.geometry.type==="LineString"){const g=h.geometry.coordinates;for(let u=0;u<g.length-1;u++){const[Q,w]=g[u],[C,E]=g[u+1],p=rD.haversineDistance(w,Q,E,C),m=`${w},${Q}`,T=`${E},${C}`;c(m,T,p)}}return{graph:D,nodes:P}}function s(l,D){const[P,c]=D;let h=1/0,g=null;const u=.01,Q=.01;for(const[w,C]of l)if(Math.abs(C.lat-c)<=u&&Math.abs(C.lon-P)<=Q){const E=rD.haversineDistance(C.lat,C.lon,c,P);E<h&&(h=E,g=w)}if(!g)for(const[w,C]of l){const E=rD.haversineDistance(C.lat,C.lon,c,P);E<h&&(h=E,g=w)}if(!g)throw new Error("未找到路网中的最近节点");return g}function o(l,D,P){if(!l[D]||!l[P])throw new Error("起点或终点不在路网图中");if(D===P)return{path:[D],distance:0};const c=new Map,h=new Map,g=new i,u=new Map,Q=new Map,w=new i;c.set(D,0),u.set(P,0),g.push(D,0),w.push(P,0);let C=null,E=1/0,p=0,m=0;const T=Math.min(5e3,Math.floor(Object.keys(l).length/10));for(;!g.isEmpty()&&p<T;){if(!g.isEmpty()){const{node:z}=g.pop();if(p++,c.get(z)>E)continue;if(u.has(z)){const L=c.get(z)+u.get(z);L<E&&(E=L,C=z)}for(const L in l[z]||{}){const b=c.get(z)+l[z][L];(!c.has(L)||b<c.get(L))&&(c.set(L,b),h.set(L,z),g.push(L,b))}}if(!w.isEmpty()&&m<T){const{node:z}=w.pop();if(m++,u.get(z)>E)continue;if(c.has(z)){const L=c.get(z)+u.get(z);L<E&&(E=L,C=z)}for(const L in l[z]||{}){const b=u.get(z)+l[z][L];(!u.has(L)||b<u.get(L))&&(u.set(L,b),Q.set(L,z),w.push(L,b))}}if(C&&g.isEmpty()&&w.isEmpty()||C&&g.size>0&&w.size>0&&g.heap[0].fValue+w.heap[0].fValue>=E*1.1)break}if(C){const z=[];let L=C;for(;L;)z.unshift(L),L=h.get(L);for(L=Q.get(C);L;)z.push(L),L=Q.get(L);return{path:z,distance:E}}throw new Error(`无法到达终点 ${P}`)}function a(l,D,P){const{graph:c,nodes:h}=r(l),g=s(h,D),u=s(h,P);return o(c,g,u)}console.time("🚗 工业级路网算法");try{const l=a(A,e,t);console.log(`✅ 工业级路径长度: ${l.path.length} 节点`),console.log(`✅ 工业级总距离: ${l.distance.toFixed(4)} 公里`),console.log(`✅ 前向搜索步数: ${Math.floor(l.path.length/2)}`),console.log(`✅ 后向搜索步数: ${Math.floor(l.path.length/2)}`),console.timeEnd("🚗 工业级路网算法");const D=[];D.push({longitude:Number(e[0]),latitude:Number(e[1]),altitude:0});const P=l.path.map(c=>{const h=c.split(",");return{longitude:Number(h[1]),latitude:Number(h[0]),altitude:0}});return D.push(...P),D.push({longitude:Number(t[0]),latitude:Number(t[1]),altitude:0}),D}catch(l){console.error("❌ 错误:",l.message),console.timeEnd("🚗 工业级路网算法")}};static ShortestPathA=(A,e,t)=>{class i{constructor(){this.heap=[],this.nodeToIndex=new Map}push(D,P){if(this.nodeToIndex.has(D)){const c=this.nodeToIndex.get(D);this.heap[c].fValue>P&&(this.heap[c].fValue=P,this.bubbleUp(c))}else{const c=this.heap.length;this.heap.push({node:D,fValue:P}),this.nodeToIndex.set(D,c),this.bubbleUp(c)}}pop(){if(this.heap.length===0)return null;const D=this.heap[0];this.nodeToIndex.delete(D.node);const P=this.heap.pop();return this.heap.length>0&&(this.heap[0]=P,this.nodeToIndex.set(P.node,0),this.bubbleDown(0)),D}bubbleUp(D){for(;D>0;){const P=Math.floor((D-1)/2);if(this.heap[P].fValue<=this.heap[D].fValue)break;[this.heap[P],this.heap[D]]=[this.heap[D],this.heap[P]],this.nodeToIndex.set(this.heap[P].node,P),this.nodeToIndex.set(this.heap[D].node,D),D=P}}bubbleDown(D){for(;;){const P=2*D+1,c=2*D+2;let h=D;if(P<this.heap.length&&this.heap[P].fValue<this.heap[h].fValue&&(h=P),c<this.heap.length&&this.heap[c].fValue<this.heap[h].fValue&&(h=c),h===D)break;[this.heap[D],this.heap[h]]=[this.heap[h],this.heap[D]],this.nodeToIndex.set(this.heap[D].node,D),this.nodeToIndex.set(this.heap[h].node,h),D=h}}isEmpty(){return this.heap.length===0}size(){return this.heap.length}}function r(l){const D={},P=new Map,c=(g,u)=>`${g},${u}`,h=(g,u,Q,w,C)=>{const E=c(g,u),p=c(Q,w);D[E]||(D[E]={}),D[p]||(D[p]={}),(!D[E][p]||C<D[E][p])&&(D[E][p]=C,D[p][E]=C),P.has(E)||P.set(E,{lat:g,lon:u}),P.has(p)||P.set(p,{lat:Q,lon:w})};for(const g of l.features)if(g.geometry.type==="LineString"){const u=g.geometry.coordinates;for(let Q=0;Q<u.length-1;Q++){const[w,C]=u[Q],[E,p]=u[Q+1],m=rD.haversineDistance(C,w,p,E);h(C,w,p,E,m)}}return{graph:D,nodes:P}}function s(l,D){const[P,c]=D;let h=1/0,g=null;for(const[u,Q]of l){const w=rD.haversineDistance(Q.lat,Q.lon,c,P);w<h&&(h=w,g=u)}if(!g)throw new Error("未找到路网中的最近节点,检查坐标是否在路网范围内");return g}function o(l,D,P){if(!l[D])throw new Error(`起点 ${D} 不在路网图中`);if(!l[P])throw new Error(`终点 ${P} 不在路网图中`);const[c,h]=P.split(",").map(Number),g=new Map,u=new Map,Q=new Map,w=new i,C=new Set;g.set(D,0);const E=rD.haversineDistance(...D.split(",").map(Number),c,h);for(u.set(D,E),w.push(D,E);!w.isEmpty();){const{node:p,fValue:m}=w.pop();if(C.has(p))continue;if(C.add(p),p===P){const z=[];let L=P;for(;L;)z.unshift(L),L=Q.get(L);return{path:z,distance:g.get(P)}}const T=l[p]||{};for(const z in T){if(C.has(z))continue;const L=g.get(p)+T[z];if(!g.has(z)||L<g.get(z)){Q.set(z,p),g.set(z,L);const[b,U]=z.split(",").map(Number),Y=rD.haversineDistance(b,U,c,h),R=L+Y;u.set(z,R),w.push(z,R)}}}throw new Error(`无法到达终点 ${P}`)}function a(l,D,P){const{graph:c,nodes:h}=r(l),g=s(h,D),u=s(h,P);return o(c,g,u)}console.time("🚗 优化版A*算法");try{const l=a(A,e,t);console.log(`✅ 优化版路径长度: ${l.path.length} 节点`),console.log(`✅ 优化版总距离: ${l.distance.toFixed(4)} 公里`),console.log(`✅ 开放列表峰值大小: ${l.path.length*2||"N/A"}`),console.timeEnd("🚗 优化版A*算法");const D=[];D.push({longitude:Number(e[0]),latitude:Number(e[1]),altitude:0});const P=l.path.map(c=>{const h=c.split(",");return{longitude:Number(h[1]),latitude:Number(h[0]),altitude:0}});return D.push(...P),D.push({longitude:Number(t[0]),latitude:Number(t[1]),altitude:0}),D}catch(l){console.error("❌ 错误:",l.message),console.timeEnd("🚗 优化版A*算法")}};static ShortestPathDijkstra=(A,e,t)=>{class i{constructor(){this.heap=[]}push(D,P){this.heap.push({node:D,distance:P}),this.bubbleUp(this.heap.length-1)}pop(){if(this.heap.length===0)return null;const D=this.heap[0],P=this.heap.pop();return this.heap.length>0&&(this.heap[0]=P,this.bubbleDown(0)),D}bubbleUp(D){const{heap:P}=this;for(;D>0;){const c=Math.floor((D-1)/2);if(P[c].distance<=P[D].distance)break;[P[c],P[D]]=[P[D],P[c]],D=c}}bubbleDown(D){const{heap:P}=this,c=2*D+1,h=2*D+2;let g=D;c<P.length&&P[c].distance<P[g].distance&&(g=c),h<P.length&&P[h].distance<P[g].distance&&(g=h),g!==D&&([P[D],P[g]]=[P[g],P[D]],this.bubbleDown(g))}isEmpty(){return this.heap.length===0}}function r(l){const D={},P=new Set,c=(g,u)=>`${g},${u}`,h=(g,u,Q,w,C)=>{const E=c(g,u),p=c(Q,w);D[E]||(D[E]={}),D[p]||(D[p]={}),D[E][p]=C,D[p][E]=C,P.add(E),P.add(p)};for(const g of l.features)if(g.geometry.type==="LineString"){const u=g.geometry.coordinates;for(let Q=0;Q<u.length-1;Q++){const[w,C]=u[Q],[E,p]=u[Q+1],m=rD.haversineDistance(C,w,p,E);h(C,w,p,E,m)}}return{graph:D,nodes:P}}function s(l,D){let P=1/0,c=null;for(const h of l){const[g,u]=h.split(",").map(Number),Q=rD.haversineDistance(g,u,D[1],D[0]);Q<P&&(P=Q,c=h)}if(!c)throw new Error("未找到路网中的最近节点,检查坐标是否在路网范围内");return c}function o(l,D,P){if(!l[D])throw new Error(`起点 ${D} 不在路网图中`);if(!l[P])throw new Error(`终点 ${P} 不在路网图中`);const c={},h={},g=new i;for(const w of Object.keys(l))c[w]=1/0;c[D]=0;for(const w of Object.keys(l))g.push(w,c[w]);for(;!g.isEmpty();){const{node:w,distance:C}=g.pop();if(C===c[w]){if(w===P)break;for(const E in l[w]){const p=C+l[w][E];p<c[E]&&(c[E]=p,h[E]=w,g.push(E,p))}}}const u=[];let Q=P;if(!h[Q])throw new Error(`无法到达终点 ${P}`);for(;Q;)u.push(Q),Q=h[Q];return{path:u.reverse(),distance:c[P]}}function a(l,D,P){const{graph:c,nodes:h}=r(l),g=s(h,D),u=s(h,P);return o(c,g,u)}console.time("🚗 Dijkstra");try{const l=a(A,e,t);console.log(`✅ 路径长度: ${l.path.length} 节点`),console.log(`✅ 总距离: ${l.distance.toFixed(4)} 公里`),console.timeEnd("🚗 Dijkstra");const D=[];D.push({longitude:Number(e[0]),latitude:Number(e[1]),altitude:0});const P=l.path.map(c=>{const h=c.split(",");return{longitude:Number(h[1]),latitude:Number(h[0]),altitude:0}});return D.push(...P),D.push({longitude:Number(t[0]),latitude:Number(t[1]),altitude:0}),D}catch(l){console.error("❌ 错误:",l.message)}console.timeEnd("🚗 Dijkstra")};static pointInPolygon=(A,e)=>{const t=A.lon,i=A.lat;let r=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].longitude,l=e[s].latitude,D=e[o].longitude,P=e[o].latitude;l>i!=P>i&&t<(D-a)*(i-l)/(P-l)+a&&(r=!r)}return r};static pointInCircle=(A,e,t)=>this.haversineDistance(A.lat,A.lon,e.latitude,e.longitude)*1e3<=t;static AStar=class{constructor(A,e,t,i,r){this.grid=A,this.start=e,this.end=t,this.obstacles=i,this.openSet=[e],this.closedSet=[],this.cameFrom={},this.gScore={},this.fScore={};for(let s=0;s<A.length;s++)for(let o=0;o<A[s].length;o++){const a=`${o},${s}`;this.gScore[a]=1/0,this.fScore[a]=1/0}this.gScore[`${e.x},${e.y}`]=0,this.fScore[`${e.x},${e.y}`]=this.heuristic(e,t,r)}heuristic(A,e,t){const i=t[1]+A.y*.025,r=t[0]+A.x*.025,s=t[1]+e.y*.025,o=t[0]+e.x*.025;return rD.haversineDistance(i,r,s,o)}getNeighbors(A){const e=[],t=[{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1}];for(const i of t){const r=A.x+i.x,s=A.y+i.y;if(r>=0&&r<this.grid[0].length&&s>=0&&s<this.grid.length){let o=!1;for(const a of this.obstacles)if(a.x===r&&a.y===s){o=!0;break}o||e.push({x:r,y:s})}}return e}findPath(A){for(;this.openSet.length>0;){let e=0;for(let s=1;s<this.openSet.length;s++){const o=`${this.openSet[e].x},${this.openSet[e].y}`,a=`${this.openSet[s].x},${this.openSet[s].y}`;this.fScore[a]<this.fScore[o]&&(e=s)}const t=this.openSet[e],i=`${t.x},${t.y}`;if(t.x===this.end.x&&t.y===this.end.y)return this.reconstructPath(t);this.openSet.splice(e,1),this.closedSet.push(t);const r=this.getNeighbors(t);for(const s of r){const o=`${s.x},${s.y}`;if(this.closedSet.some(D=>D.x===s.x&&D.y===s.y))continue;const a=Math.abs(s.x-t.x)===1&&Math.abs(s.y-t.y)===1,l=this.gScore[i]+(a?1.414:1);l<this.gScore[o]&&(this.cameFrom[o]=t,this.gScore[o]=l,this.fScore[o]=this.gScore[o]+this.heuristic(s,this.end,A),this.openSet.some(D=>D.x===s.x&&D.y===s.y)||this.openSet.push(s))}}return null}reconstructPath(A){const e=[A];let t=`${A.x},${A.y}`;for(;this.cameFrom[t];)A=this.cameFrom[t],e.unshift(A),t=`${A.x},${A.y}`;return e}getExploredNodes(){return this.closedSet}};static initializeGrid=(A,e)=>{const t=[];for(let i=0;i<e;i++){const r=[];for(let s=0;s<A;s++)r.push(0);t.push(r)}return t};static latLonToGrid=(A,e,t,i,r,s,o,a)=>{const l=Math.floor((e-r)/(s-r)*o),D=Math.floor((i-A)/(i-t)*a);return{x:Math.max(0,Math.min(o-1,l)),y:Math.max(0,Math.min(a-1,D))}};static gridToLatLon=(A,e,t,i,r,s,o,a)=>{const l=r+A/o*(s-r);return{lat:i-e/a*(i-t),lon:l}};static calculatePathA=(A,e,t=[],i=5,r=5)=>{console.time("寻路A");function s(g,u,Q){const w=nw(g,50,{units:"meters",steps:2}),C=Fs(w),E=ad(C),p=[],m=[];for(const T of u)vlA(T,E)||dlA(T,E)?p.push(T):m.push(T);if(p.length){const T=xa([E,...p]);return s(T,m,[...p,...Q])}else return{crossesOrWithins:[...Q],bbox:C}}const o=yo([A,e]);let a=!1;const l=[],D=[];for(const g of t){const u=g.coordinates;let Q;switch(g.type){case 3:(u[0].longitude!==u[u.length-1].longitude||u[0].latitude!==u[u.length-1].latitude)&&u.push(u[0]),Q=lP([u.map(E=>[E.longitude,E.latitude])]);break;case 4:Q=bM([u[0].longitude,u[0].latitude],g?.symbol?.radius??100,{steps:50,units:"meters"});break}const w=nw(Q,r,{units:"meters"});D.push(w);const C=uF(w);l.push(C.map(E=>({longitude:E[0],latitude:E[1],altitude:0}))),IF(o,Q)&&(a=!0)}const P=[];if(P.push({latitude:A[1],longitude:A[0],altitude:0}),a){var{bbox:c,crossesOrWithins:h}=s(o,D,[]);const g=this.haversineDistance(c[1],c[0],c[1],c[2])*1e3,u=this.haversineDistance(c[1],c[0],c[3],c[0])*1e3,Q=1e3,w=Math.min(parseInt(g/i),Q),C=Math.min(parseInt(u/i),Q),E=c[0],p=c[1],m=c[2],T=c[3],z=this.latLonToGrid(A[1],A[0],p,T,E,m,w,C),L=this.latLonToGrid(e[1],e[0],p,T,E,m,w,C),b=this.initializeGrid(w,C),U=new Set;for(const J of h){const F=uF(J).map(QA=>({longitude:QA[0],latitude:QA[1],altitude:0})),X=Fs(J),W=X[0],q=X[1],_=X[2],eA=X[3],$=this.latLonToGrid(q,W,p,T,E,m,w,C),iA=this.latLonToGrid(eA,W,p,T,E,m,w,C),AA=this.latLonToGrid(eA,_,p,T,E,m,w,C),TA=this.latLonToGrid(q,_,p,T,E,m,w,C),kA=Math.min($.x,iA.x,AA.x,TA.x),pA=Math.max($.x,iA.x,AA.x,TA.x),IA=Math.min($.y,iA.y,AA.y,TA.y),MA=Math.max($.y,iA.y,AA.y,TA.y);for(let QA=IA;QA<MA;QA++)for(let $A=kA;$A<pA;$A++){const JA=this.gridToLatLon($A,QA,p,T,E,m,w,C);this.pointInPolygon(JA,F)&&U.add({x:$A,y:QA})}}const R=new rD.AStar(b,z,L,[...U],c).findPath(c);if(R?.length)for(let J=1;J<R.length;J++){const F=R[J-1],X=R[J],W=p+(T-p)*(1-F.y/C),q=E+(m-E)*(F.x/w),_=p+(T-p)*(1-X.y/C),eA=E+(m-E)*(X.x/w);J===1&&P.push({latitude:W,longitude:q,altitude:0}),P.push({latitude:_,longitude:eA,altitude:0})}}return P.push({latitude:e[1],longitude:e[0],altitude:0}),a&&this.removeRedundancy(P,h),console.timeEnd("寻路A"),P};static removeRedundancy=(A,e)=>{if(A.length>2){let t=!1;for(let i=0;i<A.length-2;i++){const r=A[i],s=A[i+2],o=yo([[r.longitude,r.latitude],[s.longitude,s.latitude]]);let a=!1;for(const l of e)if(IF(o,l)){a=!0;break}a||(A.splice(i+1,1),t=!0)}t&&this.removeRedundancy(A,e)}};static calculateDistance=A=>{if(A.length!==2)return{hDistance:0,distance:0,vDistance:0,gradient:0};function e(w,C){return Number(Cesium.Cartesian3.distance(w,C).toFixed(2))}function t(w,C){const E=Math.abs(C.height-w.height),p=e(k.transformCartesian3(w),k.transformCartesian3(w)),m=Math.atan(E/p),T=Number(Cesium.Math.toDegrees(m).toFixed(1)),z=E/p*100;let L="";return T<5?L="平缓":T<15?L="缓坡":T<25?L="中坡":T<35?L="陡坡":L="极陡",{distance:p,elevationDiff:E,slopeDegrees:T,slopePercent:z,slopeStatus:L}}const i=A.map(w=>Cesium.Cartographic.fromDegrees(w.longitude,w.latitude,w.altitude)),r=i[0],s=i[1];let o=cA.cloneDeep(s);o.height=cA.cloneDeep(r.height);let a=cA.cloneDeep(s),l=cA.cloneDeep(r);r.height>s.height&&(o=cA.cloneDeep(r.positionCa),o.height=cA.cloneDeep(s.height),a=cA.cloneDeep(r),l=cA.cloneDeep(s));const D=k.transformCartesian3(a),P=k.transformCartesian3(o),c=k.transformCartesian3(l),h=e(P,c),g=e(D,c),u=e(P,D),Q=t(a,l).slopeDegrees;return{hDistance:h,distance:g,vDistance:u,gradient:Q}};static calculateArea=A=>{if(A.length<3)return{pArea:"0平方米",fArea:"0平方米"};const e=A.map(a=>Cesium.Cartesian3.fromDegrees(a.longitude,a.latitude,a.altitude));function t(a,l,D){const P=Cesium.Cartesian3.fromRadians(a.longitude,a.latitude,a.height),c=Cesium.Cartesian3.fromRadians(l.longitude,l.latitude,l.height),h=Cesium.Cartesian3.fromRadians(D.longitude,D.latitude,D.height),g=Cesium.Ellipsoid.WGS84.maximumRadius,u=Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.normalize(c,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3)),Q=Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.normalize(P,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3)),w=Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.normalize(P,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(c,new Cesium.Cartesian3)),C=(u+Q+w)/2,E=Math.sqrt(Math.abs(Math.tan(C/2)*Math.tan((C-u)/2)*Math.tan((C-Q)/2)*Math.tan((C-w)/2)));return 4*Math.atan(E)*g*g}function i(a){if(a.length<3)return 0;const l=a.map(P=>k.transformCartographic(P));let D=0;for(let P=1;P<l.length-1;P++){const c=t(l[0],l[P],l[P+1]);D+=c}return D}function r(a){if(a.length<3)return 0;const l=a.map(P=>{const c=k.transformCartographic(P);return new Cesium.Cartographic(c.longitude,c.latitude,0)});let D=0;for(let P=1;P<l.length-1;P++){const c=[l[0],l[P],l[P+1]],h=Cesium.Cartesian3.fromRadians(c[0].longitude,c[0].latitude,0),g=Cesium.Cartesian3.fromRadians(c[1].longitude,c[1].latitude,0),u=Cesium.Cartesian3.fromRadians(c[2].longitude,c[2].latitude,0),Q=new Cesium.Cartesian3,w=new Cesium.Cartesian3;Cesium.Cartesian3.subtract(g,h,Q),Cesium.Cartesian3.subtract(u,h,w);const C=new Cesium.Cartesian3;Cesium.Cartesian3.cross(Q,w,C);const E=Cesium.Cartesian3.magnitude(C)/2;D+=E}return D}let s=i(e);s=s.toFixed(4)+"平方米";var o=r(e);return o=o.toFixed(4)+"平方米",{pArea:o,fArea:s}};static calculateVolume=(A,e)=>{const t=A?.tilesetUrl;t?Cesium.Cesium3DTileset.fromUrl(t).then(i=>{A.tileset=i,this.calculate(A).then(r=>{e&&e(r)})}):this.calculate(A).then(i=>{e&&e(i)})};static async calculate(A){const{containerID:e,coordinates:t,targetHeight:i,tileset:r,gridSize:s=10}=A;var o=t.map(z=>Cesium.Cartesian3.fromDegrees(z.longitude,z.latitude,z.altitude));const a=k.getMapEngineID(e).cesiumID,l=k.getMapEngineInstance(a),D=l.scene,P=l.terrainProvider;var c=new Map;async function h(z){try{const L=[15,14,13,12,11,10,9,8,7,6,5];for(const b of L){const Y=await Cesium.sampleTerrain(P,b,z);if(Y&&Y.length>0&&Y.filter(J=>J&&J.height!==void 0&&!isNaN(J.height)&&J.height!==Number.POSITIVE_INFINITY&&J.height!==Number.NEGATIVE_INFINITY).length>0)return Y}return Cesium.sampleTerrainMostDetailed(P,z)}catch(L){return console.warn("地形采样失败,使用默认值:",L),z.map(b=>{const U=k.transformCartographic(b);return{longitude:U.longitude,latitude:U.latitude,height:0}})}}async function g(z,L,b){try{const U=Cesium.Cartographic.fromDegrees(z,L);if(b){const R=await D.sampleHeight(U);if(R!=null)return R}const Y=[15,14,13,12,11,10,9,8,7,6,5];for(const R of Y){const F=await Cesium.sampleTerrain(P,R,[U]);if(F&&F.length>0&&F[0].height!==void 0)return F[0].height}}catch(U){console.warn("获取高度失败:",U)}return 0}async function u(z,L,b,U){let Y=[];if(L){new Cesium.Ray;const R=C(z),{minX:J,minY:F,maxX:X,maxY:W}=R;console.log(J,F,X,W);const q=[];for(let _=J;_<=X;_+=U/111e3)for(let eA=F;eA<=W;eA+=U/111e3)q.push(Cesium.Cartesian3.fromDegrees(_,eA,2e3));for(let _=0;_<q.length;_++){const eA=q[_],$=k.transformCoordinate(eA),iA=$.longitude,AA=$.latitude,TA=await g(iA,AA,L);TA!==null&&!isNaN(TA)&&TA!==Number.POSITIVE_INFINITY&&TA!==Number.NEGATIVE_INFINITY&&Y.push(TA)}}else{const R=C(z),{minX:J,minY:F,maxX:X,maxY:W}=R,q=[];for(let $=J;$<=X;$+=U/111e3)for(let iA=F;iA<=W;iA+=U/111e3)q.push(Cesium.Cartesian3.fromDegrees($,iA));Y=(await h(q.map($=>k.transformCartographic($)))).filter($=>$&&$.height!==void 0&&!isNaN($.height)&&$.height!==Number.POSITIVE_INFINITY&&$.height!==Number.NEGATIVE_INFINITY).map($=>$.height)}if(Y.length===0)throw new Error("无法获取地形数据");if(b==="min")return Math.min(...Y);if(b==="avg")return Y.reduce((J,F)=>J+F,0)/Y.length}async function Q(z,L,b){const U=C(z),{minX:Y,minY:R,maxX:J,maxY:F}=U,X=[];for(let iA=Y;iA<=J;iA+=b/111e3)for(let AA=R;AA<=F;AA+=b/111e3)X.push(Cesium.Cartesian3.fromDegrees(iA,AA));const W=await h(X.map(iA=>k.transformCartographic(iA)));if(!W||W.length===0)throw new Error("无法获取地形数据");let q=0,_=0;const eA=b*b,$=W.filter(iA=>iA&&iA.height!==void 0&&!isNaN(iA.height)&&iA.height!==Number.POSITIVE_INFINITY&&iA.height!==Number.NEGATIVE_INFINITY);if($.length===0)throw new Error("没有有效的地形数据");for(let iA=0;iA<$.length;iA++){const TA=$[iA].height-L;TA>0?q+=TA*eA:_+=Math.abs(TA)*eA}return{cut:parseFloat(q.toFixed(2)),fill:parseFloat(_.toFixed(2)),balance:parseFloat((q-_).toFixed(2)),unit:"m³",type:"terrain",targetHeight:L}}async function w(z,L,b,U){let Y=0,R=0;const J=U*U,F=C(L),{minX:X,minY:W,maxX:q,maxY:_}=F,eA=[];for(let $=X;$<=q;$+=U/111e3)for(let iA=W;iA<=_;iA+=U/111e3)eA.push(Cesium.Cartesian3.fromDegrees($,iA,2e3));console.log(eA);for(let $=0;$<eA.length;$++){const iA=eA[$],AA=k.transformCoordinate(iA),TA=AA.longitude,kA=AA.latitude,pA=await g(TA,kA,z);if(pA!==null&&!isNaN(pA)&&pA!==Number.POSITIVE_INFINITY&&pA!==Number.NEGATIVE_INFINITY){const IA=pA-b;IA>0?Y+=IA*J:R+=Math.abs(IA)*J}}return{cut:parseFloat(Y.toFixed(2)),fill:parseFloat(R.toFixed(2)),balance:parseFloat((Y-R).toFixed(2)),unit:"m³",type:"3dtileset",targetHeight:b}}function C(z){let L=1/0,b=1/0,U=-1/0,Y=-1/0;for(const R of z){const J=k.transformCoordinate(R),F=J.longitude,X=J.latitude;L=Math.min(L,F),b=Math.min(b,X),U=Math.max(U,F),Y=Math.max(Y,X)}return{minX:L,minY:b,maxX:U,maxY:Y}}function E(z,L,b){return`${z.map(Y=>{const R=k.transformCoordinate(Y);return`${R.longitude},${R.latitude}`}).join("|")}_${L}_${b}`}const p=E(o,i,!!r);if(c.has(p))return c.get(p);let m=i;(i==="min"||i==="avg")&&(m=await u(o,r,i,s));let T;return r?T=await w(r,o,m,s):T=await Q(o,m,s),T.baseType=i==="min"||i==="avg"?i:"custom",T.actualTargetHeight=m,c.set(p,T),T}}oP.GISAlgorithm=rD,oP.GISIcon=bo,oP.GISModel=vE,oP.GISTool=k,oP.default=bXA,Object.defineProperties(oP,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zywlgis",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.36",
|
|
4
4
|
"description": "",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/ZYWLGIS.umd.js",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"dev": "vite",
|
|
21
|
-
"build": "vite build"
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"pre": "npm run build && npm run dev",
|
|
23
|
+
"release": "npm version patch && npm run build && npm publish"
|
|
22
24
|
},
|
|
23
25
|
"dependencies": {
|
|
24
26
|
"@element-plus/icons-vue": "^2.3.1",
|