bigmap-plugin 1.0.3 → 1.0.4

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.
@@ -1,4 +1,4 @@
1
- (function(g,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(g=typeof globalThis<"u"?globalThis:g||self,o(g.BigmapPlugin={},g.Vue))})(this,(function(g,o){"use strict";const dt={debug:10,info:20,warn:30,error:40,silent:Number.POSITIVE_INFINITY},ve="[sems-map]";function Yn(){try{const e=typeof process<"u"?process.env:void 0;if(e&&e.NODE_ENV==="production")return"warn"}catch{}return"debug"}let Pe=Yn();function qn(e){Pe=e}function Kn(){return Pe}function Ce(e){return dt[e]>=dt[Pe]}const w={debug(...e){Ce("debug")&&console.debug(ve,...e)},info(...e){Ce("info")&&console.info(ve,...e)},warn(...e){Ce("warn")&&console.warn(ve,...e)},error(...e){Ce("error")&&console.error(ve,...e)}},ft=Symbol("originalHandler");class Be{constructor(){this.events=new Map}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),()=>this.off(t,n)}once(t,n){const r=i=>{n(i),this.off(t,r)};return r[ft]=n,this.on(t,r)}off(t,n){if(!n){this.events.delete(t);return}const r=this.events.get(t);if(!r)return;const i=r.findIndex(a=>a===n||a[ft]===n);i>-1&&r.splice(i,1),r.length===0&&this.events.delete(t)}async emit(t,n){const r=this.events.get(t);if(!r||r.length===0)return;const i=r.slice(),a=[];for(const l of i)try{const s=l(n);s&&typeof s.then=="function"&&a.push(s.catch(u=>{w.error(`[EventBus] Error in async handler for event "${String(t)}":`,u)}))}catch(s){w.error(`[EventBus] Error in handler for event "${String(t)}":`,s)}a.length>0&&await Promise.all(a)}clear(){this.events.clear()}getStats(){return Array.from(this.events.entries()).map(([t,n])=>({event:String(t),handlerCount:n.length}))}}const Xn=new Be,oe=new Map;function q(e){oe.set(e.type,e)}q({type:"area",name:"测面积",defaultSize:15,icon:"area",toolbarOrder:4,buildConfig:({shared:e})=>({material:e.fill,labelOptions:e.label})}),q({type:"polygon",name:"绘制多边形",defaultSize:14,icon:"polygon",toolbarOrder:1,buildConfig:({bmgl:e,shared:t})=>({classificationType:e.ClassificationType.BOTH,width:t.width,material:t.fill})}),q({type:"circle",name:"绘制圆形",defaultSize:17,icon:"circle",toolbarOrder:2,buildConfig:({bmgl:e,config:t,shared:n})=>({material:n.fill,width:n.width,controlLine:{permanent:!0,lineStyle:{width:n.width,clampToGround:!0,material:n.border},textStyle:{font:t.labelFont,disableDepthTestDistance:1/0,verticalOrigin:e.VerticalOrigin.BOTTOM}}})}),q({type:"azimuth",name:"测方位",defaultSize:15,icon:"azimuth",toolbarOrder:6,buildConfig:({bmgl:e,config:t})=>({clampToGround:!0,material:new e.PolylineArrowMaterialProperty(e.Color.fromCssColorString(t.fillColor)),width:t.arrowWidth,labelOptions:{fillColor:e.Color.YELLOW}})}),q({type:"ruler",name:"测距离",defaultSize:15,icon:"ruler",toolbarOrder:5,buildConfig:({config:e,shared:t})=>({width:e.lineWidth+3,clampToGround:!0,material:t.fill,labelOptions:t.label})}),q({type:"polyline",name:"绘制线",defaultSize:16,icon:"polyline",toolbarOrder:3,buildConfig:({config:e,shared:t})=>({width:e.lineWidth+3,clampToGround:!0,material:t.fill})}),q({type:"triangle",name:"绘制三角形",defaultSize:16,icon:"triangle",inDefaultToolbar:!1,buildConfig:({bmgl:e,shared:t})=>({classificationType:e.ClassificationType.BOTH,width:4,material:t.fill})}),q({type:"rectangle",name:"绘制矩形",defaultSize:16,icon:"rectangle",toolbarOrder:0,buildConfig:({bmgl:e,shared:t})=>({classificationType:e.ClassificationType.BOTH,width:t.width,material:t.fill})});function Zn(e){oe.set(e.type,e)}function ht(e){return oe.get(e)}function gt(){return[...oe.values()]}function pt(){return[...oe.values()].filter(e=>e.inDefaultToolbar!==!1).sort((e,t)=>(e.toolbarOrder??Number.MAX_SAFE_INTEGER)-(t.toolbarOrder??Number.MAX_SAFE_INTEGER))}function mt(){return pt().map(e=>({icon:e.type,name:e.name,size:e.defaultSize}))}const be="/libs",te={lng:104.03770513,lat:30.48187111,height:2e4},Ee={heading:6.267876539812834,pitch:-1.3962634015954636,roll:.00016118230151462853},Te={FLY_TO:2,MORPH:.8,WAVE:3e3},ne={BATCH_SIZE:200,YIELD_BUDGET_MS:8,DEBOUNCE_DELAY:300,GRID_SIZE:.1},Re=mt(),wt={spacing:150,width:2},yt={autoPlay:!1,speed:1,loop:!1,follow:!1,followHeight:2e3,trailTime:10,duration:0,interval:1,markerColor:"#ff3b30",markerSize:12,markerIcon:"",lineColor:"#0a84ff",lineWidth:4,maxPoints:2e4},vt={fillColor:"#000000",fillAlpha:.8,outlineColor:"#44d5ff",outlineAlpha:1,outlineWidth:4,showOutline:!0},ze={containerId:"bigmap-container",libsUrl:be,mapType:"3d",position:te,mapId:"bigemap.cebjohn0",terrainId:"bigemap.dc-terrain",showSearch:!1,showControls:!0,showStatus:!1,showDeleteControls:!0,tools:Re,searchDebounceTime:ne.DEBOUNCE_DELAY},H={METERS_PER_DEGREE_LAT:111320,METERS_PER_DEGREE_LAT_APPROX:111e3,CAMERA_FOV_DEGREES:60,MIN_CAMERA_HEIGHT:1e3},Ct=500,bt=800,Jn=200,Qn=900,Et=1e4,er=100,tr=1e3,Tt={NEAR:3e3,NEAR_VALUE:1,FAR:1e5,FAR_VALUE:.1},nr=6,rr=1001,R={1:{color:"#9E9E9E",text:"未发布"},2:{color:"#2196F3",text:"已发布"},3:{color:"#FF9800",text:"未完成"},4:{color:"#4CAF50",text:"已完成"},5:{color:"#FF5722",text:"整改"},6:{color:"#E91E63",text:"整改中"},7:{color:"#8BC34A",text:"整改完成"},8:{color:"#009688",text:"合格"},9:{color:"#00BCD4",text:"整改合格"},10:{color:"#F44336",text:"不合格"},11:{color:"#9C27B0",text:"变观中"},12:{color:"#673AB7",text:"已变观"},13:{color:"#607D8B",text:"任务终止"},default:{color:"#2196F3",text:"未知状态"}},ir=e=>R[e]||R.default;function ar(e){if(!e)return{};const t={};for(const n of Object.keys(e)){const r=e[n];r!==void 0&&(t[n]=r)}return t}function Fe(...e){const t={...ze};for(const n of e){const r=ar(n);Object.assign(t,r),r.geoserver&&(t.geoserver={...t.geoserver||{},...r.geoserver})}return t}function or(e,t){return Fe(e,t)}class St{constructor(t){this.config=Fe(t)}get(t){return this.config[t]}set(t,n){this.config[t]=n}getAll(){return{...this.config}}update(t){this.config=Fe(this.config,t)}reset(){this.config={...ze}}}class Dt{constructor(){this.resources=new Set}register(t){this.resources.add(t)}unregister(t){this.resources.delete(t)}async cleanup(){const t=Array.from(this.resources);this.resources.clear(),await Promise.allSettled(t.map(async n=>{try{await n()}catch(r){w.error("[ResourceManager] Error during cleanup:",r)}}))}getResourceCount(){return this.resources.size}}function lr(e){return{isReady:!1,isLoading:!1,mapType:e==="2d"?"2d":"3d",cameraPosition:{lng:0,lat:0,height:0,altitude:0,heading:0,pitch:0,roll:0},bounds:null,error:null}}function sr(e){return{configManager:new St(e),eventBus:new Be,resourceManager:new Dt,map:o.shallowRef(null),state:o.ref(lr(e.mapType||"3d")),cancelled:{value:!1},destroyed:{value:!1},initializing:{value:!1}}}const Mt=be,Oe={"bigemap-2d":{name:"BigMap 2D",path:"/libs/bigemap/bigemap.js",dependencies:["bigemap-2d-css"]},"bigemap-2d-css":{name:"BigMap 2D CSS",path:"/libs/bigemap/bigemap.css",isCss:!0},"bigemap-3d":{name:"BigMap 3D",path:"/libs/bigemap/bigemap-gl.js",dependencies:["bigemap-3d-css"]},"bigemap-3d-css":{name:"BigMap 3D CSS",path:"/libs/bigemap/widgets.css",isCss:!0},"bmgl-plot":{name:"BigMap Plot",path:"/libs/bigemap/bmgl-plot.min.js",dependencies:["bigemap-3d"]},"circle-wave":{name:"Circle Wave",path:"/libs/bigemap/circleWave.js",dependencies:["bmgl-plot"]},"bm-geometry-util":{name:"BigMap Geometry Util",path:"/libs/bigemap/bm.geometryutil.js",dependencies:["bigemap-3d"]},"move-marker":{name:"BigMap Move Marker",path:"/libs/bigemap/moveMarker.js",dependencies:["bigemap-3d","bm-geometry-util"]},"bmgl-header":{name:"BMGL Sandcastle Header",path:"/libs/bigemap/bmgl-header.js",dependencies:["bigemap-3d"]}};function Ge(e,t,n){if(e.path.startsWith("/libs/"))return n+e.path.slice(5);if(e.path.startsWith("/")){if(!t)throw new Error(`未配置 serverUrl,无法解析地图资源路径: ${e.path}`);return t.replace(/\/$/,"")+e.path}return e.path}const Se=3e4;class It{constructor(){this.loaded=new Set,this.pending=new Map}loadJs(t){return new Promise((n,r)=>{if(document.querySelector(`script[src="${t}"]`)){n();return}const i=document.createElement("script");i.src=t,i.async=!0;let a=!1;const l=setTimeout(()=>{a||(a=!0,i.remove(),r(new Error(`脚本加载超时(${Se/1e3}s): ${t}`)))},Se);i.onload=()=>{a||(a=!0,clearTimeout(l),n())},i.onerror=()=>{a||(a=!0,clearTimeout(l),i.remove(),r(new Error(`脚本加载失败: ${t}`)))},document.head.appendChild(i)})}loadCss(t){return new Promise((n,r)=>{if(document.querySelector(`link[href="${t}"]`)){n();return}const i=document.createElement("link");i.rel="stylesheet",i.href=t;let a=!1;const l=setTimeout(()=>{a||(a=!0,i.remove(),r(new Error(`样式加载超时(${Se/1e3}s): ${t}`)))},Se);i.onload=()=>{a||(a=!0,clearTimeout(l),n())},i.onerror=()=>{a||(a=!0,clearTimeout(l),i.remove(),r(new Error(`样式加载失败: ${t}`)))},document.head.appendChild(i)})}loadResource(t,n,r){const i=Ge(t,n,r);if(this.loaded.has(i))return Promise.resolve();if(this.pending.has(i))return this.pending.get(i);const a=t.isCss?this.loadCss(i):this.loadJs(i);return this.pending.set(i,a),a.then(()=>{this.loaded.add(i)}).finally(()=>{this.pending.delete(i)}),a}async loadWithDependencies(t,n,r,i){const l={...Oe,...i}[t];if(!l)throw new Error(`库配置未找到: ${t}`);for(const s of l.dependencies||[])await this.loadWithDependencies(s,n,r,i);await this.loadResource(l,n,r)}async loadScripts(t,n,r=Mt,i){await Promise.all(t.map(a=>this.loadWithDependencies(a,n,r,i)))}isLoaded(t,n,r){const i=Oe[t];if(!i||i.path.startsWith("/")&&!i.path.startsWith("/libs/")&&!n)return!1;const a=Ge(i,n||"",r||Mt);return this.loaded.has(a)}clearLoaded(){this.loaded.clear(),this.pending.clear()}}const Ue=new It;let le=null;function At(e){le=e}function D(){return le||(typeof window<"u"&&window.bmgl?(le=window.bmgl,le):null)}function N(){const e=D();if(!e)throw new Error("bmgl 库未就绪:请确保地图初始化完成后再调用该能力");return e}async function xt(e=3e3){const t=D();return t||new Promise((n,r)=>{const i=Date.now(),a=setInterval(()=>{const l=D();l?(clearInterval(a),n(l)):Date.now()-i>e&&(clearInterval(a),r(new Error("bmgl 加载超时")))},50)})}class Z{constructor(){this.entries=new Map}static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}register(t,n,r,i){this.entries.set(t,{map:n,eventBus:r,resourceManager:i})}get(t){return this.entries.get(t)?.map}has(t){return this.entries.has(t)}getEventBus(t){return this.entries.get(t)?.eventBus}getResourceManager(t){return this.entries.get(t)?.resourceManager}async unregister(t){const n=this.entries.get(t);if(n&&(this.entries.delete(t),await n.resourceManager.cleanup(),n.eventBus.clear(),!n.map.isDestroyed?.()))try{n.map.destroy()}catch(r){w.error("[MapManager] Error destroying map:",r)}}getAllMapIds(){return Array.from(this.entries.keys())}async cleanupAll(){const t=this.getAllMapIds();await Promise.all(t.map(n=>this.unregister(n)))}}const se=Z.getInstance();function cr(e,t=3e3){return new Promise((n,r)=>{const i=Date.now(),a=setInterval(()=>{document.getElementById(e)?(clearInterval(a),n()):Date.now()-i>t&&(clearInterval(a),r(new Error(`容器未找到: ${e}`)))},16)})}async function ur(e){const t=e.configManager.get("containerId");if(!t)throw new Error("容器ID未定义");return await cr(t),t}async function dr(e){const t=e.configManager.get("serverUrl"),n=e.configManager.get("libsUrl"),r=e.configManager.get("extraLibs");try{await Ue.loadScripts(["bigemap-3d","bmgl-plot","circle-wave"],t,n,r)}catch(a){throw w.error("[loadBmglScripts] 地图服务连接失败,请确认 serverUrl 可达且服务已启动:",a),new Error("地图服务连接失败,请确认服务器地址正确且服务已启动")}const i=D();if(!i)throw new Error("BMGL 库加载失败");At(i),i.Config.HTTP_URL=t,fr(i)}function fr(e){e.RequestScheduler&&(e.RequestScheduler.maximumRequests=120,e.RequestScheduler.maximumRequestsPerServer=18)}function hr(e){const t=D(),n=e.configManager.get("containerId");if(!t||!n)throw new Error("地图实例创建失败:BMGL 库或容器 ID 未就绪");const r=new t.Viewer(n,{mapId:e.configManager.get("mapId"),terrainId:e.configManager.get("terrainId"),requestRenderMode:!1,selectionIndicator:!1,infoBox:!1});return gr(r,e.state.value.mapType),r}function gr(e,t){t==="3d"&&(e.scene.globe.depthTestAgainstTerrain=!0);const n=e.scene,r=e.scene.globe;n.preloadFlightDestinations=!0,r.tileCacheSize=1e3,r.preloadAncestors=!0,r.preloadSiblings=!0,r.maximumScreenSpaceError=1.5}async function pr(e,t,n){if(se.has(n))try{await se.unregister(n)}catch(r){w.warn(`[registerMap] 清理残留地图实例失败 (${n}):`,r)}se.register(n,t,e.eventBus,e.resourceManager)}function Lt(e){return typeof e=="number"&&!Number.isNaN(e)?e:1e4}function Nt(e,t,n){const r=D();if(!r)throw new Error("BMGL 库未加载,无法构造相机目标位置");return r.Cartesian3.fromDegrees(e,t,n)}function _t(){return{heading:Ee.heading,pitch:Ee.pitch,roll:Ee.roll}}function mr(e){const t=e.configManager.get("position");t&&e.map.value?.camera.flyTo({destination:Nt(t.lng,t.lat,Lt(t.height)),orientation:_t(),duration:Te.FLY_TO})}function wr(e,t,n,r){e.map.value&&e.map.value.camera.flyTo({destination:Nt(t,n,Lt(r)),orientation:_t(),duration:Te.FLY_TO})}function yr(e){const t=D();if(!e.map.value||!t)return null;const n=e.map.value.camera.computeViewRectangle();return n?{minx:t.Math.toDegrees(n.west),maxx:t.Math.toDegrees(n.east),miny:t.Math.toDegrees(n.south),maxy:t.Math.toDegrees(n.north)}:vr(e)}function vr(e){const t=D();if(!t)return null;const n=e.map.value,r=n.scene.globe.ellipsoid;try{const i=n.camera.pickEllipsoid(new t.Cartesian2(0,0),r),a=n.camera.pickEllipsoid(new t.Cartesian2(n.scene.canvas.clientWidth,n.scene.canvas.clientHeight),r);if(!i||!a)return null;const l=r.cartesianToCartographic(i),s=r.cartesianToCartographic(a);return{minx:t.Math.toDegrees(l.longitude),maxx:t.Math.toDegrees(s.longitude),miny:t.Math.toDegrees(s.latitude),maxy:t.Math.toDegrees(l.latitude)}}catch{return null}}function Cr(e){return e.initializing.value||!!e.map.value||e.destroyed.value}async function br(e){if(!Cr(e)){e.cancelled.value=!1,e.initializing.value=!0,e.state.value.isLoading=!0,e.state.value.error=null;try{await Er(e)}catch(t){throw e.state.value.error=t instanceof Error?t:new Error(String(t)),await e.eventBus.emit("map:error",t),t}finally{e.initializing.value=!1,e.state.value.isLoading=!1}}}async function Er(e){const t=await ur(e);if(await dr(e),e.cancelled.value)return;const n=hr(e);if(e.cancelled.value){Tr(n);return}e.map.value=n,await pr(e,n,t),await mr(e),!e.cancelled.value&&(e.state.value.isReady=!0,await e.eventBus.emit("map:ready"))}function Tr(e){try{e.destroy()}catch(t){w.error("[useMap] 销毁未注册的地图实例失败:",t)}}async function kt(e){if(e.cancelled.value=!0,e.destroyed.value=!0,!e.map.value)return;const t=e.configManager.get("containerId");if(e.map.value=null,e.state.value.isReady=!1,t)try{await se.unregister(t)}catch(n){w.error("[useMap] 销毁地图失败:",n)}}function Vt(e,t,n){const r=D();if(!r)throw new Error("BMGL 库未加载,无法构造目标视角");return{destination:r.Cartesian3.fromDegrees(e,t,n),orientation:{heading:0,pitch:r.Math.toRadians(-90),roll:0}}}function Sr(e){const t=e.map.value;if(!(!t||!e.state.value.isReady||e.state.value.mapType==="2d"))try{const n=D();if(!n)throw new Error("BMGL 库未加载,无法切换 2D 模式");const r=n.Cartographic.fromCartesian(t.camera.position);t.scene.morphTo2D?.(0),e.state.value.mapType="2d",e.eventBus.emit("map:mode-changed","2d"),t.camera.setView(Vt(n.Math.toDegrees(r.longitude),n.Math.toDegrees(r.latitude),r.height))}catch(n){w.error("切换到2D模式失败:",n)}}function Dr(e){const t=D();if(!t)throw new Error("BMGL 库未加载,无法计算 3D 目标视图");const n=t.Cartographic.fromCartesian(e.map.value.camera.position),r={lng:t.Math.toDegrees(n.longitude),lat:t.Math.toDegrees(n.latitude),height:Math.max(n.height,1e4)},i=yr(e);if(!i)return r;const a=(i.minx+i.maxx)/2,l=(i.miny+i.maxy)/2,s=(i.maxx-i.minx)*Math.cos(l*Math.PI/180)*H.METERS_PER_DEGREE_LAT_APPROX,u=(i.maxy-i.miny)*H.METERS_PER_DEGREE_LAT_APPROX,d=Math.max(s,u),c=t.Math.toRadians(H.CAMERA_FOV_DEGREES),f=Math.max(d/(2*Math.tan(c/2)),H.MIN_CAMERA_HEIGHT);return{lng:a,lat:l,height:f}}function Mr(e){const t=e.map.value;if(!(!t||!e.state.value.isReady||e.state.value.mapType==="3d"))try{const n=Dr(e);t.scene.morphTo3D?.(0),e.state.value.mapType="3d",e.eventBus.emit("map:mode-changed","3d"),setTimeout(()=>{e.map.value&&e.map.value.camera.setView(Vt(n.lng,n.lat,n.height))},bt)}catch(n){w.error("切换到3D模式失败:",n)}}function Ir(e){e.state.value.mapType==="2d"?Mr(e):Sr(e)}function Pt(e){const t=sr(e),n=(i,a,l)=>wr(t,i,a,l),r=()=>Ir(t);return o.onBeforeUnmount(()=>{kt(t)}),{map:t.map,state:t.state,initMap:()=>br(t),setView:n,toggleMapType:r,destroy:()=>kt(t),on:t.eventBus.on.bind(t.eventBus),once:t.eventBus.once.bind(t.eventBus),off:t.eventBus.off.bind(t.eventBus),emit:t.eventBus.emit.bind(t.eventBus)}}function Ar(e){return{billboardCollection:null,billboardMap:new Map,pointDataCache:[],cacheIdIndex:new Map,gridIndex:null,gridSize:e,scaleByDistance:null}}function Bt(e,t,n){const r=Math.floor(t/e),i=Math.floor(n/e);return`${r},${i}`}function Rt(e,t){const n=Bt(e.gridSize,t.lng,t.lat),r=e.gridIndex?.get(n);r?r.push(t):e.gridIndex?.set(n,[t])}function zt(e,t){if(!e.gridIndex)return;const n=Bt(e.gridSize,t.lng,t.lat),r=e.gridIndex.get(n);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1),r.length===0&&e.gridIndex.delete(n)}const xr=1e5;function Lr(e,t){const n=[];if(!e.gridIndex)return n;const r=Math.floor(t.west/e.gridSize),i=Math.floor(t.south/e.gridSize),a=Math.floor(t.east/e.gridSize),l=Math.floor(t.north/e.gridSize),s=(a-r+1)*(l-i+1),u=d=>d.lng>=t.west&&d.lng<=t.east&&d.lat>=t.south&&d.lat<=t.north;if(s>xr){for(const d of e.pointDataCache)u(d)&&n.push(d);return n}for(let d=r;d<=a;d++)for(let c=i;c<=l;c++){const f=e.gridIndex.get(`${d},${c}`)||[];for(const h of f)u(h)&&n.push(h)}return n}function Nr(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const[a,l]of e)a<t&&(t=a),l<n&&(n=l),a>r&&(r=a),l>i&&(i=l);return{west:t,south:n,east:r,north:i}}function _r(e){const[t,n]=e.center,r=e.radius/(H.METERS_PER_DEGREE_LAT*Math.cos(n*Math.PI/180)),i=e.radius/H.METERS_PER_DEGREE_LAT;return{west:t-r,east:t+r,south:n-i,north:n+i}}function kr(e){return e.type==="circle"?_r(e):Nr(e.coordinates)}function Vr(e,t){const[n,r]=e;let i=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const[s,u]=t[a],[d,c]=t[l];u>r!=c>r&&n<(d-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function Pr(e,t){const[n,r]=t.center,i=t.radius*t.radius,a=(e.lng-n)*H.METERS_PER_DEGREE_LAT*Math.cos(r*Math.PI/180),l=(e.lat-r)*H.METERS_PER_DEGREE_LAT;return a*a+l*l<=i}function Br(e,t){return t.type==="circle"?e.filter(n=>Pr(n,t)):t.type==="polygon"||t.type==="triangle"?e.filter(n=>Vr([n.lng,n.lat],t.coordinates)):e}function Rr(e,t){if(!e.gridIndex||e.pointDataCache.length===0)return[];const n=kr(t);let r=Lr(e,n);return t.type!=="rectangle"&&(r=Br(r,t)),r}function zr(e,t){const{field:n,keyword:r,limit:i=10,caseSensitive:a=!1}=t,l=a?r.trim():r.trim().toLowerCase(),s=Array.isArray(n)?n:[n],u=[];for(const d of e.pointDataCache)if(s.some(f=>{const h=d[f];return h==null?!1:(a?String(h):String(h).toLowerCase()).includes(l)})&&(u.push(d),u.length>=i))break;return u}const Fr={lng:"lng",lat:"lat",altitude:"altitude",id:"id"};let Ft=0,Ot=!1,Gt=!1;function Or(){return Ot||(Ot=!0,w.warn("[useMapPoint] 检测到未提供 id 的点位,已启用自增 id 自动生成;建议通过 fieldMapping.id 提供稳定 id 以支持 updatePoints 精确定位")),Ft+=1,`__auto_${Ft}`}function Gr(){return typeof MessageChannel<"u"?new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(0)}):new Promise(e=>setTimeout(e,0))}function Ur(e,t){if(!t.scaleByDistance){const n=Tt;t.scaleByDistance=new e.NearFarScalar(n.NEAR,n.NEAR_VALUE,n.FAR,n.FAR_VALUE)}return t.scaleByDistance}function Ut(e){const t=Ar(ne.GRID_SIZE),n=async()=>{if(!t.billboardCollection&&e.value){const d=D();d&&(t.billboardCollection=e.value.scene.primitives.add(new d.BillboardCollection))}return t.billboardCollection},r=()=>{if(t.billboardCollection)try{t.billboardCollection.removeAll()}catch(d){w.warn("[useMapPoint] removeAll billboard 失败:",d)}t.billboardMap.clear(),t.pointDataCache=[],t.cacheIdIndex.clear(),t.gridIndex=null},i=d=>{const c=t.cacheIdIndex.get(d);if(c===void 0)return;const f=t.pointDataCache[c],h=t.billboardMap.get(d);if(h&&t.billboardCollection)try{t.billboardCollection.remove(h)}catch(p){w.warn("[useMapPoint] 移除旧 billboard 失败:",p)}return t.billboardMap.delete(d),zt(t,f),c},a=(d,c,f,h)=>{const p=parseFloat(c[f.fieldMapping.lng])||0,b=parseFloat(c[f.fieldMapping.lat])||0,v=parseFloat(c[f.fieldMapping.altitude])||0,m=d.Cartesian3.fromDegrees(p,b,v),C=t.billboardCollection.add({position:m,image:c.icon,width:c.width||f.width,height:c.height||f.height,scaleByDistance:Ur(d,t),id:h,disableDepthTestDistance:Tt.NEAR,verticalOrigin:d.VerticalOrigin.BOTTOM});return C.pointData=c,{billboard:C,position:m,lng:p,lat:b,altitude:v}},l=async(d,c,f,h="append")=>{try{if(h==="replace"&&r(),!await n())return;const b=D();if(!b)return;const v={width:c?.width||20,height:c?.height||20,fieldMapping:{...Fr,...c?.fieldMapping||{}}},m=performance.now();t.gridIndex||(t.gridIndex=new Map);const C=Array.isArray(d)?d:[],y=C.length,E=ne.BATCH_SIZE,k=ne.YIELD_BUDGET_MS;let S=performance.now(),A=0;for(let V=0;V<y;V+=E){const U=C.slice(V,V+E);for(const z of U){if(!z.icon){A+=1,Gt||(Gt=!0,w.warn("[useMapPoint] 检测到缺失 icon 的点位,已跳过渲染;请在数据层通过 iconManager 预生成 icon 后传入"));continue}const M=z[v.fieldMapping.id],I=M!=null&&M!==""?String(M):Or(),F=i(I),{billboard:_,position:Y,lng:K,lat:pe,altitude:me}=a(b,z,v,I);t.billboardMap.set(I,_);const X={...z,id:I,lng:K,lat:pe,altitude:me,icon:z.icon};F!==void 0?t.pointDataCache[F]=X:(t.cacheIdIndex.set(I,t.pointDataCache.length),t.pointDataCache.push(X)),Rt(t,X)}V+E<y&&performance.now()-S>=k&&(await Gr(),S=performance.now())}A>0&&w.warn(`[useMapPoint] 本次加载跳过 ${A} 个缺失 icon 的点位`),console.log(`[useMapPoint] ${h} ${C.length} 个点位 billboard 渲染耗时:${(performance.now()-m).toFixed(0)}ms`)}catch(p){throw w.error("加载点位失败:",p),p}},s=async d=>{const c=D();for(const f of d){const h=String(f.id),p=t.billboardMap.get(h);if(p){if(f.icon&&(p.image=f.icon),f.width!==void 0&&(p.width=f.width),f.height!==void 0&&(p.height=f.height),c&&f.lng!==void 0&&f.lat!==void 0){const b=c.Cartesian3.fromDegrees(Number(f.lng),Number(f.lat),Number(f.altitude??0));p.position=b;const v=t.cacheIdIndex.get(h);if(v!==void 0){const m=t.pointDataCache[v];zt(t,m),m.lng=Number(f.lng),m.lat=Number(f.lat),f.altitude!==void 0&&(m.altitude=Number(f.altitude)),Rt(t,m)}}if(f.name!==void 0){const b=t.cacheIdIndex.get(h);b!==void 0&&(t.pointDataCache[b].name=String(f.name))}}}},u=async()=>{r()};return o.onUnmounted(()=>{try{const d=e.value?.scene;if(d?.primitives&&t.billboardCollection)try{d.primitives.remove(t.billboardCollection)}catch(c){w.warn("[useMapPoint] remove billboardCollection error:",c)}t.billboardMap.clear(),t.pointDataCache=[],t.cacheIdIndex.clear(),t.gridIndex=null,t.billboardCollection=null}catch(d){w.warn("[useMapPoint] onUnmounted cleanup error:",d)}}),{loadPoints:l,searchByShape:d=>Rr(t,d),searchByText:d=>zr(t,d),updatePoints:s,clearPoints:u}}function $t(e){return e?.rectangle?"rectangle":e?.polygon?"polygon":e?.polyline?"polyline":e?.ellipse||e?.position&&e?.billboard?"circle":"polygon"}function $e(e){if(e.length===0)return e;const t=e[0],n=e[e.length-1];return(Array.isArray(t)?t[0]===n[0]&&t[1]===n[1]:t.lng===n.lng&&t.lat===n.lat)?[...e]:[...e,t]}function $r(e,t=0){const n=D();return n?n.Cartesian3.fromDegrees(e.lng,e.lat,t):null}function Wt(e){const t=D();return t?{lng:t.Math.toDegrees(e.longitude),lat:t.Math.toDegrees(e.latitude)}:null}function De(e){const t=D();if(!t)return null;const n=t.Cartographic.fromCartesian(e);return Wt(n)}function We(e,t){return[[e.lng,e.lat],[t.lng,e.lat],[t.lng,t.lat],[e.lng,t.lat],[e.lng,e.lat]]}const ce={fillColor:"#ff0000",strokeColor:"#00ff00",lineColor:"#3366ff",strokeWidth:3,fillAlpha:.1,strokeAlpha:1,pointColor:"#ff0000",pixelSize:10,radius:1e3};function B(e,t){return N().Color.fromCssColorString(e).withAlpha(t)}function Ht(e){const t=N();return e.map(n=>Array.isArray(n)?t.Cartesian3.fromDegrees(n[0],n[1]):t.Cartesian3.fromDegrees(n.lng,n.lat))}function Wr(e,t=!0){const n=N(),r=ce;if(!e.coordinates||e.coordinates.length<3)throw new Error("多边形需要至少3个坐标点");const i=$e(e.coordinates),a=Ht(i),l=new n.Entity({polygon:{hierarchy:new n.PolygonHierarchy(a),material:B(e.fillColor??r.fillColor,e.fillAlpha??r.fillAlpha)}}),s=new n.Entity({polyline:{positions:a,width:e.strokeWidth??r.strokeWidth,material:B(e.strokeColor??r.strokeColor,e.strokeAlpha??r.strokeAlpha),clampToGround:t}});return{fillEntity:l,strokeEntity:s,positions:a,closedCoordinates:i}}function Hr(e,t=!0){const n=N(),r=ce;if(!e.lineCoordinates||e.lineCoordinates.length<4)throw new Error("线段需要至少2个点");return{entity:new n.Entity({polyline:{positions:n.Cartesian3.fromDegreesArray(e.lineCoordinates),width:e.strokeWidth??r.strokeWidth,material:B(e.strokeColor??r.lineColor,e.strokeAlpha??r.strokeAlpha),clampToGround:t}})}}function jr(e){const t=N(),n=ce;if(!e.center)throw new Error("圆形需要中心点坐标");const r=e.radius??n.radius;return{entity:new t.Entity({position:t.Cartesian3.fromDegrees(e.center.lng,e.center.lat),ellipse:{semiMinorAxis:r,semiMajorAxis:r,height:0,material:B(e.fillColor??n.fillColor,e.fillAlpha??n.fillAlpha),outline:!0,outlineColor:B(e.strokeColor??n.strokeColor,e.strokeAlpha??n.strokeAlpha),outlineWidth:e.strokeWidth??n.strokeWidth}}),center:e.center,radius:r}}function Yr(e,t=!0){const n=N(),r=ce;if(!e.coordinates||e.coordinates.length<2)throw new Error("矩形需要两个对角点坐标");const[i,a]=e.coordinates,l=n.Rectangle.fromDegrees(Math.min(i.lng,a.lng),Math.min(i.lat,a.lat),Math.max(i.lng,a.lng),Math.max(i.lat,a.lat)),s=new n.Entity({rectangle:{coordinates:l,material:B(e.fillColor??r.fillColor,e.fillAlpha??r.fillAlpha)}}),u=We(i,a),d=new n.Entity({polyline:{positions:Ht(u),width:e.strokeWidth??r.strokeWidth,material:B(e.strokeColor??r.strokeColor,e.strokeAlpha??r.strokeAlpha),clampToGround:t}});return{fillEntity:s,strokeEntity:d,coordinates:u}}function qr(e){const t=N(),n=ce;if(!e.point)throw new Error("点需要坐标");return{entity:new t.Entity({position:t.Cartesian3.fromDegrees(e.point.lng,e.point.lat),point:{pixelSize:e.pixelSize??n.pixelSize,color:B(e.pointColor??n.pointColor,1),heightReference:t.HeightReference.CLAMP_TO_GROUND}}),point:[e.point.lng,e.point.lat]}}function Kr(e){const t=N();return!!(t.SceneMode&&e.scene.mode===t.SceneMode.SCENE2D)}const Xr={polygon:(e,t,n)=>{const r=Wr(e,t),i=n.entities.add(r.fillEntity),a=n.entities.add(r.strokeEntity);return{nativeEntity:{fill:i,stroke:a},coordinates:r.closedCoordinates}},line:(e,t,n)=>{const r=Hr(e,t);return{nativeEntity:n.entities.add(r.entity),coordinates:e.lineCoordinates??[]}},circle:(e,t,n)=>{const r=jr(e);return{nativeEntity:n.entities.add(r.entity),coordinates:{center:r.center,radius:r.radius}}},rectangle:(e,t,n)=>{const r=Yr(e,t),i=n.entities.add(r.fillEntity),a=n.entities.add(r.strokeEntity);return{nativeEntity:{fill:i,stroke:a},coordinates:r.coordinates}},point:(e,t,n)=>{const r=qr(e);return{nativeEntity:n.entities.add(r.entity),coordinates:r.point}}};function jt(e,t,n){const r=Xr[e];if(!r)throw new Error(`不支持的实体类型: ${e}`);return r(t,!Kr(n),n)}function Me(e,t){try{e.type==="polygon"||e.type==="rectangle"?(e.nativeEntity?.fill&&t.entities.remove(e.nativeEntity.fill),e.nativeEntity?.stroke&&t.entities.remove(e.nativeEntity.stroke)):e.nativeEntity&&t.entities.remove(e.nativeEntity)}catch(n){w.warn(`移除原生实体失败 (${e.id}):`,n)}}function He(e,t,n,r){return{color:e.fillColor||t.options.fillColor||n,alpha:e.fillAlpha!==void 0?e.fillAlpha:t.options.fillAlpha??r}}function Ie(e,t,n,r){return{color:e.strokeColor||t.options.strokeColor||n,alpha:e.strokeAlpha!==void 0?e.strokeAlpha:r}}function Zr(e,t){const n=N(),{fill:r,stroke:i}=e.nativeEntity,a=$e(t.coordinates),l=a.map(s=>n.Cartesian3.fromDegrees(s.lng,s.lat));r.polygon.hierarchy=new n.PolygonHierarchy(l),i.polyline.positions=l,e.coordinates=a}function Jr(e,t){const{fill:n,stroke:r}=e.nativeEntity;if(t.fillColor!==void 0||t.fillAlpha!==void 0){const{color:i,alpha:a}=He(t,e,"#ff0000",.1);n.polygon.material=B(i,a)}if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:i,alpha:a}=Ie(t,e,"#00ff00",1);r.polyline.material=B(i,a)}t.strokeWidth!==void 0&&(r.polyline.width=t.strokeWidth),t.coordinates&&t.coordinates.length>=3&&Zr(e,t)}function Qr(e,t){const n=N(),{fill:r,stroke:i}=e.nativeEntity,[a,l]=t.coordinates;r.rectangle.coordinates=n.Rectangle.fromDegrees(Math.min(a.lng,l.lng),Math.min(a.lat,l.lat),Math.max(a.lng,l.lng),Math.max(a.lat,l.lat));const s=We(a,l);i.polyline.positions=s.map(u=>n.Cartesian3.fromDegrees(u[0],u[1])),e.coordinates=s}function ei(e,t){const{fill:n,stroke:r}=e.nativeEntity;if(t.fillColor!==void 0||t.fillAlpha!==void 0){const{color:i,alpha:a}=He(t,e,"#ff0000",.1);n.rectangle.material=B(i,a)}if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:i,alpha:a}=Ie(t,e,"#00ff00",1);r.polyline.material=B(i,a)}t.strokeWidth!==void 0&&(r.polyline.width=t.strokeWidth),t.coordinates&&t.coordinates.length>=2&&Qr(e,t)}function ti(e,t){const n=N(),i=e.nativeEntity.polyline;if(i){if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:a,alpha:l}=Ie(t,e,"#3366ff",1);i.material=B(a,l)}t.strokeWidth!==void 0&&(i.width=t.strokeWidth),t.lineCoordinates&&t.lineCoordinates.length>=4&&(i.positions=n.Cartesian3.fromDegreesArray(t.lineCoordinates),e.coordinates=t.lineCoordinates)}}function ni(e,t){const n=N(),r=e.nativeEntity;if(t.fillColor!==void 0||t.fillAlpha!==void 0){const{color:i,alpha:a}=He(t,e,"#ff0000",.1);r.ellipse.material=B(i,a)}if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:i,alpha:a}=Ie(t,e,"#00ff00",1);r.ellipse.outlineColor=B(i,a)}if(t.strokeWidth!==void 0&&(r.ellipse.outlineWidth=t.strokeWidth),t.radius!==void 0&&(r.ellipse.semiMinorAxis=t.radius,r.ellipse.semiMajorAxis=t.radius),t.center){r.position=n.Cartesian3.fromDegrees(t.center.lng,t.center.lat);const i=e.coordinates,a=i&&!Array.isArray(i)?i.radius:void 0;e.coordinates={center:t.center,radius:t.radius||a||1e3}}}function ri(e,t){const n=N(),r=e.nativeEntity,i=r.point;i&&(t.pointColor!==void 0&&(i.color=B(t.pointColor,1)),t.pixelSize!==void 0&&(i.pixelSize=t.pixelSize),t.point&&(r.position=n.Cartesian3.fromDegrees(t.point.lng,t.point.lat),e.coordinates=[t.point.lng,t.point.lat]))}function ii(e,t){const n=e.nativeEntity;e.type==="polygon"||e.type==="rectangle"?(n.fill.show=t,n.stroke.show=t):n.show=t}function ai(e,t,n){e==="polygon"?Jr(t,n):e==="rectangle"?ei(t,n):e==="line"?ti(t,n):e==="circle"?ni(t,n):e==="point"&&ri(t,n)}function oi(e,t){const n=t.coordinates;n&&((e.type==="polygon"||e.type==="rectangle")&&!e.coordinates&&Array.isArray(n)&&(e.coordinates=n),e.type==="line"&&!e.lineCoordinates&&t.type==="line"&&Array.isArray(n)&&(e.lineCoordinates=n),e.type==="circle"&&!e.center&&t.type==="circle"&&!Array.isArray(n)&&(e.center=n.center,e.radius=n.radius||1e3),e.type==="point"&&!e.point&&t.type==="point"&&Array.isArray(n)&&(e.point=n))}async function li(e,t,n,r,i){Me(t,r);const a={...t.options,...n,id:e,type:n.type};return oi(a,t),await i(a)!==null}function Yt(e){const t=new Map;let n="";const r=()=>!e.value||!e.value.entities?(w.warn("地图实例未就绪"),!1):!0,i=async()=>{if(r())return!0;try{return await xt(),r()}catch{return!1}},a=async c=>{try{if(!await i())return null;const f=e.value;if(!f)return null;const h=c.id||`${c.type}-${Date.now()}`,{nativeEntity:p,coordinates:b}=jt(c.type,c,f),v={id:h,type:c.type,options:{...c,id:h,type:c.type,visible:c.visible!==!1},nativeEntity:p,coordinates:b};return t.set(h,v),n=h,h}catch(f){return w.error("绘制实体失败:",f),null}},l=c=>{try{if(!r())return!1;const f=e.value;if(!f)return!1;if(!c)return t.forEach(p=>Me(p,f)),t.clear(),n="",!0;const h=t.get(c);return h?(Me(h,f),t.delete(c),n===c&&(n=""),!0):(w.warn(`实体未找到: ${c}`),!1)}catch(f){return w.error("删除实体失败:",f),!1}},s=()=>n,u=async(c,f)=>{try{const h=t.get(c);if(!h)return w.warn(`实体未找到:${c}`),!1;if(!await i())return!1;const p=e.value;return p?f.type&&f.type!==h.type?await li(c,h,f,p,a):(ai(h.type,h,f),f.name!==void 0&&(h.options.name=f.name),f.visible!==void 0&&ii(h,f.visible),h.options={...h.options,...f},t.set(c,h),!0):!1}catch(h){return w.error(`修改实体失败 (${c}):`,h),!1}},d=()=>{if(!r())return;const c=e.value;if(c)for(const[f,h]of t)try{Me(h,c),h.nativeEntity=jt(h.type,h.options,c).nativeEntity}catch(p){w.warn(`重绘实体失败 (${f}):`,p)}};return o.onUnmounted(()=>{try{t.clear(),n=""}catch(c){w.warn("[useMapEntity] onUnmounted cleanup error:",c)}}),{drawEntity:a,updateEntity:u,deleteEntity:l,redrawAllEntities:d,getCurrentEntityId:s}}function si(){return{drawInstance:null,editInstance:null,currentDrawId:"",currentDrawType:null,isDrawing:!1,isEditing:!1,drawCallback:null,mapInstance:null,mapHandler:null,eventListeners:[],lastEditedEntity:null,drawEntityIds:new Set}}const ue={fillColor:"#369",fillAlpha:.6,borderColor:"#fff",borderAlpha:.8,lineWidth:2,labelFont:"14px arial",arrowWidth:20};function Ae(e,t,n,r){return typeof e!="number"||Number.isNaN(e)?r:Math.min(n,Math.max(t,e))}class ci{constructor(t){this.config={...ue,...t},this.config.fillAlpha=Ae(this.config.fillAlpha,0,1,ue.fillAlpha),this.config.borderAlpha=Ae(this.config.borderAlpha,0,1,ue.borderAlpha),this.config.lineWidth=Ae(this.config.lineWidth,1,50,ue.lineWidth),this.config.arrowWidth=Ae(this.config.arrowWidth,1,100,ue.arrowWidth)}materials(t){const{fillColor:n,fillAlpha:r,borderColor:i,borderAlpha:a}=this.config;return{fill:t.Color.fromCssColorString(n).withAlpha(r),border:t.Color.fromCssColorString(i).withAlpha(a)}}label(t){const{labelFont:n}=this.config;return{fillColor:t.Color.WHITE,font:n,verticalOrigin:t.VerticalOrigin.BOTTOM,pixelOffset:new t.Cartesian2(0,-20),disableDepthTestDistance:5e3}}getDrawConfig(){const t=N(),{fill:n,border:r}=this.materials(t),i=this.label(t),a=this.config.lineWidth,l={bmgl:t,config:this.config,shared:{fill:n,border:r,label:i,width:a}},s={repeat:!0};for(const u of gt())u.buildConfig&&(s[u.type]=u.buildConfig(l));return s}getEditConfig(){const t=N();return{axis:{scale:1},control:{tolerance:4,marker:{eyeOffset:new t.Cartesian3(0,0,-20),verticalOrigin:t.VerticalOrigin.BOTTOM,disableDepthTestDistance:5e3}}}}}function qt(e){return e.map(t=>De(t)).filter(t=>t!==null)}function ui(e){try{const t=e.polygon.hierarchy.getValue().positions||[],n=qt(t);return{type:"polygon",path:n.map(r=>[r.lng,r.lat]),rawPath:n,radius:void 0}}catch(t){return w.error("提取多边形数据失败:",t),null}}function di(e){const t=N();try{const n=e.rectangle.coordinates.getValue(),r=t.Math.toDegrees(n.west),i=t.Math.toDegrees(n.south),a=t.Math.toDegrees(n.east),l=t.Math.toDegrees(n.north);return{type:"rectangle",path:[[r,l],[a,l],[a,i],[r,i],[r,l]],rawPath:[{lng:r,lat:l},{lng:a,lat:l},{lng:a,lat:i},{lng:r,lat:i}],radius:void 0}}catch(n){return w.error("提取矩形数据失败:",n),null}}function fi(e){try{const t=e.polyline.positions.getValue(),n=qt(t);return{type:"polyline",path:n.map(r=>[r.lng,r.lat]),rawPath:n,radius:void 0}}catch(t){return w.error("提取折线数据失败:",t),null}}function hi(e){try{const t=De(e.position.getValue());if(!t)return null;const n=e.ellipse.semiMajorAxis?.getValue()||0,r=e.ellipse.semiMinorAxis?.getValue()||0;return{type:"circle",center:[t.lng,t.lat],radius:Math.max(n,r),rawPath:[t]}}catch(t){return w.error("提取圆形数据失败:",t),null}}function gi(e){try{const t=De(e.position.getValue());return t?{type:"circle",center:[t.lng,t.lat],radius:e.radius||0,rawPath:[t]}:null}catch{return null}}function Kt(e){return e?e.polygon?ui(e):e.rectangle?di(e):e.polyline?fi(e):e.position&&e.ellipse?hi(e):e.billboard&&e.position?gi(e):null:null}function pi(e){return $t(e)}function mi(e){return e.editInstance&&(e.editInstance.isEditing||e.editInstance._isEditing||e.editInstance.editing)||!1}function wi(e){typeof e.finish=="function"?e.finish():typeof e.stop=="function"?e.stop():typeof e.disable=="function"?e.disable():typeof e.end=="function"?e.end():e.isEditing=!1}function de(e,t=!1){if(e.editInstance){t&&e.currentDrawId&&(e.lastEditedEntity=e.mapInstance?.entities.getById(e.currentDrawId)??null);try{wi(e.editInstance)}catch(n){w.error("结束编辑状态失败:",n)}finally{e.isEditing=!1}t&&e.lastEditedEntity&&yi(e)}}function J(e,t){if(e.drawCallback)try{e.drawCallback(t)}catch(n){w.error("绘图回调执行失败:",n)}else w.warn("绘图回调函数未设置")}function yi(e){if(!(!e.lastEditedEntity||!e.currentDrawId))try{const t=Kt(e.lastEditedEntity);if(!t)return;const n={type:t.type,layer:{_id:e.currentDrawId},path:t.rawPath||[]};t.type==="circle"&&t.radius!==void 0&&(n.radius=t.radius),J(e,{type:t.type,operation:"edit",id:e.currentDrawId,data:t,rawData:n}),e.lastEditedEntity=null}catch(t){w.error("手动触发编辑完成事件失败:",t)}}function vi(e,t,n){try{if(e.drawInstance||n(),!e.drawInstance)throw new Error("绘图实例初始化失败");if(e.isEditing&&de(e,!1),e.isDrawing=!0,e.currentDrawType=t,typeof e.drawInstance.enable=="function")e.drawInstance.enable(t);else if(typeof e.drawInstance.start=="function")e.drawInstance.start(t);else throw new Error("绘图实例没有可用的启用方法")}catch(r){throw w.error(`开始绘制 ${t} 失败:`,r),e.isDrawing=!1,e.currentDrawType=null,r}}function Ci(e){const t=(n,...r)=>{if(n){for(const i of r)if(typeof n[i]=="function"){n[i]();return}}};t(e.drawInstance,"disable","stop"),t(e.editInstance,"disable","stop")}function bi(e){e.currentDrawId="",e.currentDrawType=null,e.isDrawing=!1,e.isEditing=!1,e.lastEditedEntity=null}function Q(e){e.isEditing&&de(e,!1),Ci(e),bi(e)}function Ei(e,t=""){if(!e.mapInstance)return;const n=t||e.currentDrawId;if(e.isEditing&&de(e,!1),!n){Q(e);return}const r=e.mapInstance.entities.getById(n);if(r){const i=Kt(r);if(e.mapInstance.entities.remove(r),e.drawEntityIds.delete(n),e.currentDrawId===n&&(e.currentDrawId=""),i){const a={type:i.type,layer:{_id:n},path:i.rawPath||[]};i.type==="circle"&&i.radius!==void 0&&(a.radius=i.radius),J(e,{type:i.type,operation:"delete",id:n,data:i,rawData:a})}}Q(e)}function Ti(e){if(!e.mapInstance)return;e.isEditing&&de(e,!1);let t=0;if(e.drawEntityIds.size>0){for(const r of e.drawEntityIds){const i=e.mapInstance.entities.getById(r);i&&(e.mapInstance.entities.remove(i),t++)}e.drawEntityIds.clear()}else{const r=e.mapInstance.entities?.values||[];r.some(a=>!e.drawEntityIds.has(a?._id))||(e.mapInstance.entities.removeAll(),t=r.length)}const n=e.currentDrawType||"polygon";J(e,{type:n,operation:"clear",data:null,rawData:null,count:t}),Q(e)}class j{static process(t){if(!t?.type)return null;try{const n=j.getProcessor(t.type);if(!n)return null;const r=n(t);return r?{...r,id:t.layer?._id||""}:null}catch(n){return w.error("数据处理失败:",n),null}}static getProcessor(t){return{rectangle:j.processRectangle,polygon:j.processPolygon,circle:j.processCircle,triangle:j.processTriangle,polyline:j.processPolyline}[t]}static processRectangle(t){const[n,r]=t.path||[];return!n||!r?null:{type:"rectangle",path:[[n.lng,n.lat],[r.lng,n.lat],[r.lng,r.lat],[n.lng,r.lat],[n.lng,n.lat]]}}static processPolygon(t){const n=(t.path||[]).map(r=>[r.lng,r.lat]);return n.length===0?null:{type:"polygon",path:[...n,n[0]]}}static processCircle(t){const n=t.path;return!n||n.lng===void 0?null:{type:"circle",center:[n.lng,n.lat],radius:t.radius||0}}static processTriangle(t){const n=(t.path||[]).map(r=>[r.lng,r.lat]);return n.length===0?null:{type:"triangle",path:[...n,n[0]]}}static processPolyline(t){const n=(t.path||[]).map(r=>[r.lng,r.lat]);return n.length===0?null:{type:"polyline",path:n}}}function Si(e,t,n){J(e,{type:pi(n),operation:"select",id:t,data:{id:t},rawData:n})}function Di(e){if(mi(e)){de(e,!0);return}e.isDrawing&&e.currentDrawType&&J(e,{type:e.currentDrawType,operation:"cancel",id:e.currentDrawId,data:null,rawData:null}),Q(e)}function Mi(e,t){if(!e.mapInstance)return;const n=N(),r=e.mapInstance.scene.pick(t.position);if(!n.defined(r))return;const i=r?.id?._id;if(typeof i!="string"||!i)return;const a=e.mapInstance.entities.getById(i);if(!a||!e.editInstance)return;e.currentDrawId=i,e.lastEditedEntity=a;const l=e.editInstance;typeof l.edit=="function"?l.edit(a):typeof l.start=="function"?l.start(a):typeof l.enable=="function"&&l.enable(a),e.isEditing=!0}function Ii(e,t){if(!e.mapInstance||e.isDrawing)return;const n=N(),r=e.mapInstance.scene.pick(t.position);if(!n.defined(r))return;const i=r?.id?._id;if(typeof i!="string"||!i)return;const a=e.mapInstance.entities.getById(i);a&&(e.currentDrawId=i,Si(e,i,a))}function Ai(e,t){const n=j.process(t.detail);if(!n)return;n.id&&e.drawEntityIds.add(n.id);const r={type:n.type,operation:"draw",id:n.id,data:n,rawData:t.detail};J(e,r),Q(e)}function xi(e,t){e.isEditing=!1;const n=j.process(t.detail);if(!n){e.lastEditedEntity=null;return}const r={type:n.type,operation:"edit",id:n.id,data:n,rawData:t.detail};J(e,r),e.lastEditedEntity=null}function Xt(e){e.eventListeners.forEach(({type:t})=>{try{e.mapHandler?.removeInputAction(t)}catch(n){w.warn(`移除 ${t} 事件监听器失败:`,n)}}),e.eventListeners=[]}function Li(e){Xt(e);const t=e.mapHandler;if(!t)return;const n=N(),r=[n.ScreenSpaceEventType.RIGHT_CLICK,n.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,n.ScreenSpaceEventType.LEFT_CLICK],i=[()=>Di(e),a=>Mi(e,a),a=>Ii(e,a)];r.forEach((a,l)=>{t.setInputAction(i[l],a),e.eventListeners.push({type:a})})}function Ni(e){e.drawInstance&&(e.drawInstance.on("bm_draw_end",t=>Ai(e,t)),e.editInstance&&e.editInstance.on("bm_edit_end",t=>xi(e,t)))}function _i(e,t,n){try{if(e.mapInstance=o.isRef(t)?t.value:t,!e.mapInstance)throw new Error("地图实例不可用");if(!D())throw new Error("BMGL 库未加载");if(e.mapHandler=e.mapInstance.screenSpaceEventHandler,!e.mapHandler)throw new Error("地图事件处理器不可用");const r=N(),i=new ci(n);e.drawInstance=new r.Plot.Draw(e.mapInstance,i.getDrawConfig()),e.editInstance=new r.Plot.Edit(e.mapInstance,i.getEditConfig()),Li(e),Ni(e)}catch(r){throw w.error("绘图工具初始化失败:",r),r}}function Zt(e){try{Q(e),Xt(e),e.drawInstance&&typeof e.drawInstance.destroy=="function"&&e.drawInstance.destroy(),e.editInstance&&typeof e.editInstance.destroy=="function"&&e.editInstance.destroy(),e.drawInstance=null,e.editInstance=null,e.drawCallback=null,e.mapHandler=null,e.lastEditedEntity=null}catch(t){w.error("清理绘图工具资源失败:",t)}}function Jt(e,t){const n=si(),r=()=>_i(n,e,t),i=s=>{n.drawCallback=s},a=()=>({isDrawing:n.isDrawing,isEditing:n.isEditing,currentDrawId:n.currentDrawId,currentDrawType:n.currentDrawType,drawInstance:!!n.drawInstance,editInstance:!!n.editInstance}),l=()=>n.isDrawing;if(e&&typeof e=="object"&&"value"in e)o.watch(e,s=>{if(s&&!n.drawInstance)try{r()}catch(u){w.warn("自动初始化失败,将在绘图时重试:",u)}},{immediate:!0});else if(e)try{r()}catch(s){w.warn("自动初始化失败,将在绘图时重试:",s)}return o.onUnmounted(()=>{Zt(n)}),{startDrawing:s=>vi(n,s,r),cancelDrawing:()=>Q(n),removeDrawing:(s="")=>Ei(n,s),clearAllDrawings:()=>Ti(n),setCallback:i,getDrawingStatus:a,getIsDrawing:l,initialize:r,cleanup:()=>Zt(n)}}function ki(){return{popupLayer:null,divLayerManager:null,mapInstance:null,currentPopupData:null,displayConfig:null,popupSeq:0}}function fe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Vi(e){return e&&/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)?e:""}function re(e,t){return typeof e=="number"&&!Number.isNaN(e)?e.toFixed(t):"-"}function Pi(e){return R[e||"default"]||R.default}function Bi(e){return[`--status-color: ${e.color}`,`--status-bg: ${e.color}10`,`--status-border: ${e.color}30`,`--status-shadow: ${e.color}30`].join(";")}function Ri(e,t){const n=[e.lineCode,e.lineNo,e.pointNo].filter(i=>i!=null&&i!==""),r=n.length?`<div class="map-point-popup-subtitle"><span>${n.map(i=>fe(i)).join('<span class="map-point-popup-divider">|</span>')}</span></div>`:"";return`
1
+ (function(g,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(g=typeof globalThis<"u"?globalThis:g||self,o(g.BigmapPlugin={},g.Vue))})(this,(function(g,o){"use strict";const dt={debug:10,info:20,warn:30,error:40,silent:Number.POSITIVE_INFINITY},ve="[sems-map]";function Yn(){try{const e=typeof process<"u"?process.env:void 0;if(e&&e.NODE_ENV==="production")return"warn"}catch{}return"debug"}let Pe=Yn();function qn(e){Pe=e}function Kn(){return Pe}function Ce(e){return dt[e]>=dt[Pe]}const w={debug(...e){Ce("debug")&&console.debug(ve,...e)},info(...e){Ce("info")&&console.info(ve,...e)},warn(...e){Ce("warn")&&console.warn(ve,...e)},error(...e){Ce("error")&&console.error(ve,...e)}},ft=Symbol("originalHandler");class Be{constructor(){this.events=new Map}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),()=>this.off(t,n)}once(t,n){const r=i=>{n(i),this.off(t,r)};return r[ft]=n,this.on(t,r)}off(t,n){if(!n){this.events.delete(t);return}const r=this.events.get(t);if(!r)return;const i=r.findIndex(a=>a===n||a[ft]===n);i>-1&&r.splice(i,1),r.length===0&&this.events.delete(t)}async emit(t,n){const r=this.events.get(t);if(!r||r.length===0)return;const i=r.slice(),a=[];for(const l of i)try{const s=l(n);s&&typeof s.then=="function"&&a.push(s.catch(u=>{w.error(`[EventBus] Error in async handler for event "${String(t)}":`,u)}))}catch(s){w.error(`[EventBus] Error in handler for event "${String(t)}":`,s)}a.length>0&&await Promise.all(a)}clear(){this.events.clear()}getStats(){return Array.from(this.events.entries()).map(([t,n])=>({event:String(t),handlerCount:n.length}))}}const Xn=new Be,oe=new Map;function q(e){oe.set(e.type,e)}q({type:"area",name:"测面积",defaultSize:15,icon:"area",toolbarOrder:4,buildConfig:({shared:e})=>({material:e.fill,labelOptions:e.label})}),q({type:"polygon",name:"绘制多边形",defaultSize:14,icon:"polygon",toolbarOrder:1,buildConfig:({bmgl:e,shared:t})=>({classificationType:e.ClassificationType.BOTH,width:t.width,material:t.fill})}),q({type:"circle",name:"绘制圆形",defaultSize:17,icon:"circle",toolbarOrder:2,buildConfig:({bmgl:e,config:t,shared:n})=>({material:n.fill,width:n.width,controlLine:{permanent:!0,lineStyle:{width:n.width,clampToGround:!0,material:n.border},textStyle:{font:t.labelFont,disableDepthTestDistance:1/0,verticalOrigin:e.VerticalOrigin.BOTTOM}}})}),q({type:"azimuth",name:"测方位",defaultSize:15,icon:"azimuth",toolbarOrder:6,buildConfig:({bmgl:e,config:t})=>({clampToGround:!0,material:new e.PolylineArrowMaterialProperty(e.Color.fromCssColorString(t.fillColor)),width:t.arrowWidth,labelOptions:{fillColor:e.Color.YELLOW}})}),q({type:"ruler",name:"测距离",defaultSize:15,icon:"ruler",toolbarOrder:5,buildConfig:({config:e,shared:t})=>({width:e.lineWidth+3,clampToGround:!0,material:t.fill,labelOptions:t.label})}),q({type:"polyline",name:"绘制线",defaultSize:16,icon:"polyline",toolbarOrder:3,buildConfig:({config:e,shared:t})=>({width:e.lineWidth+3,clampToGround:!0,material:t.fill})}),q({type:"triangle",name:"绘制三角形",defaultSize:16,icon:"triangle",inDefaultToolbar:!1,buildConfig:({bmgl:e,shared:t})=>({classificationType:e.ClassificationType.BOTH,width:4,material:t.fill})}),q({type:"rectangle",name:"绘制矩形",defaultSize:16,icon:"rectangle",toolbarOrder:0,buildConfig:({bmgl:e,shared:t})=>({classificationType:e.ClassificationType.BOTH,width:t.width,material:t.fill})});function Zn(e){oe.set(e.type,e)}function ht(e){return oe.get(e)}function gt(){return[...oe.values()]}function pt(){return[...oe.values()].filter(e=>e.inDefaultToolbar!==!1).sort((e,t)=>(e.toolbarOrder??Number.MAX_SAFE_INTEGER)-(t.toolbarOrder??Number.MAX_SAFE_INTEGER))}function mt(){return pt().map(e=>({icon:e.type,name:e.name,size:e.defaultSize}))}const be="/libs",te={lng:104.03770513,lat:30.48187111,height:2e4},Ee={heading:6.267876539812834,pitch:-1.3962634015954636,roll:.00016118230151462853},Te={FLY_TO:2,MORPH:.8,WAVE:3e3},ne={BATCH_SIZE:200,YIELD_BUDGET_MS:8,DEBOUNCE_DELAY:300,GRID_SIZE:.1},Re=mt(),wt={spacing:150,width:2},yt={autoPlay:!1,speed:1,loop:!1,follow:!1,followHeight:2e3,trailTime:10,duration:0,interval:1,markerColor:"#ff3b30",markerSize:12,markerIcon:"",lineColor:"#0a84ff",lineWidth:4,maxPoints:2e4},vt={fillColor:"#000000",fillAlpha:.8,outlineColor:"#44d5ff",outlineAlpha:1,outlineWidth:4,showOutline:!0},ze={containerId:"bigmap-container",libsUrl:be,mapType:"3d",position:te,mapId:"bigemap.cebjohn0",terrainId:"bigemap.dc-terrain",showSearch:!1,showControls:!0,showStatus:!1,showDeleteControls:!0,tools:Re,searchDebounceTime:ne.DEBOUNCE_DELAY},H={METERS_PER_DEGREE_LAT:111320,METERS_PER_DEGREE_LAT_APPROX:111e3,CAMERA_FOV_DEGREES:60,MIN_CAMERA_HEIGHT:1e3},Ct=500,bt=800,Jn=200,Qn=900,Et=1e4,er=100,tr=1e3,Tt={NEAR:3e3,NEAR_VALUE:1,FAR:1e5,FAR_VALUE:.1},nr=6,rr=1001,R={1:{color:"#9E9E9E",text:"未发布"},2:{color:"#2196F3",text:"已发布"},3:{color:"#FF9800",text:"未完成"},4:{color:"#4CAF50",text:"已完成"},5:{color:"#FF5722",text:"整改"},6:{color:"#E91E63",text:"整改中"},7:{color:"#8BC34A",text:"整改完成"},8:{color:"#009688",text:"合格"},9:{color:"#00BCD4",text:"整改合格"},10:{color:"#F44336",text:"不合格"},11:{color:"#9C27B0",text:"变观中"},12:{color:"#673AB7",text:"已变观"},13:{color:"#607D8B",text:"任务终止"},default:{color:"#2196F3",text:"未知状态"}},ir=e=>R[e]||R.default;function ar(e){if(!e)return{};const t={};for(const n of Object.keys(e)){const r=e[n];r!==void 0&&(t[n]=r)}return t}function Fe(...e){const t={...ze};for(const n of e){const r=ar(n);Object.assign(t,r),r.geoserver&&(t.geoserver={...t.geoserver||{},...r.geoserver})}return t}function or(e,t){return Fe(e,t)}class St{constructor(t){this.config=Fe(t)}get(t){return this.config[t]}set(t,n){this.config[t]=n}getAll(){return{...this.config}}update(t){this.config=Fe(this.config,t)}reset(){this.config={...ze}}}class Dt{constructor(){this.resources=new Set}register(t){this.resources.add(t)}unregister(t){this.resources.delete(t)}async cleanup(){const t=Array.from(this.resources);this.resources.clear(),await Promise.allSettled(t.map(async n=>{try{await n()}catch(r){w.error("[ResourceManager] Error during cleanup:",r)}}))}getResourceCount(){return this.resources.size}}function lr(e){return{isReady:!1,isLoading:!1,mapType:e==="2d"?"2d":"3d",cameraPosition:{lng:0,lat:0,height:0,altitude:0,heading:0,pitch:0,roll:0},bounds:null,error:null}}function sr(e){return{configManager:new St(e),eventBus:new Be,resourceManager:new Dt,map:o.shallowRef(null),state:o.ref(lr(e.mapType||"3d")),cancelled:{value:!1},destroyed:{value:!1},initializing:{value:!1}}}const Mt=be,Oe={"bigemap-2d":{name:"BigMap 2D",path:"/libs/bigemap/bigemap.js",dependencies:["bigemap-2d-css"]},"bigemap-2d-css":{name:"BigMap 2D CSS",path:"/libs/bigemap/bigemap.css",isCss:!0},"bigemap-3d":{name:"BigMap 3D",path:"/bigemap-gl.js/v1.1.0/bigemap-gl.js",dependencies:["bigemap-3d-css"]},"bigemap-3d-css":{name:"BigMap 3D CSS",path:"/libs/bigemap/widgets.css",isCss:!0},"bmgl-plot":{name:"BigMap Plot",path:"/libs/bigemap/bmgl-plot.min.js",dependencies:["bigemap-3d"]},"circle-wave":{name:"Circle Wave",path:"/libs/bigemap/circleWave.js",dependencies:["bmgl-plot"]},"bm-geometry-util":{name:"BigMap Geometry Util",path:"/libs/bigemap/bm.geometryutil.js",dependencies:["bigemap-3d"]},"move-marker":{name:"BigMap Move Marker",path:"/libs/bigemap/moveMarker.js",dependencies:["bigemap-3d","bm-geometry-util"]},"bmgl-header":{name:"BMGL Sandcastle Header",path:"/libs/bigemap/bmgl-header.js",dependencies:["bigemap-3d"]}};function Ge(e,t,n){if(e.path.startsWith("/libs/"))return n+e.path.slice(5);if(e.path.startsWith("/")){if(!t)throw new Error(`未配置 serverUrl,无法解析地图资源路径: ${e.path}`);return t.replace(/\/$/,"")+e.path}return e.path}const Se=3e4;class It{constructor(){this.loaded=new Set,this.pending=new Map}loadJs(t){return new Promise((n,r)=>{if(document.querySelector(`script[src="${t}"]`)){n();return}const i=document.createElement("script");i.src=t,i.async=!0;let a=!1;const l=setTimeout(()=>{a||(a=!0,i.remove(),r(new Error(`脚本加载超时(${Se/1e3}s): ${t}`)))},Se);i.onload=()=>{a||(a=!0,clearTimeout(l),n())},i.onerror=()=>{a||(a=!0,clearTimeout(l),i.remove(),r(new Error(`脚本加载失败: ${t}`)))},document.head.appendChild(i)})}loadCss(t){return new Promise((n,r)=>{if(document.querySelector(`link[href="${t}"]`)){n();return}const i=document.createElement("link");i.rel="stylesheet",i.href=t;let a=!1;const l=setTimeout(()=>{a||(a=!0,i.remove(),r(new Error(`样式加载超时(${Se/1e3}s): ${t}`)))},Se);i.onload=()=>{a||(a=!0,clearTimeout(l),n())},i.onerror=()=>{a||(a=!0,clearTimeout(l),i.remove(),r(new Error(`样式加载失败: ${t}`)))},document.head.appendChild(i)})}loadResource(t,n,r){const i=Ge(t,n,r);if(this.loaded.has(i))return Promise.resolve();if(this.pending.has(i))return this.pending.get(i);const a=t.isCss?this.loadCss(i):this.loadJs(i);return this.pending.set(i,a),a.then(()=>{this.loaded.add(i)}).finally(()=>{this.pending.delete(i)}),a}async loadWithDependencies(t,n,r,i){const l={...Oe,...i}[t];if(!l)throw new Error(`库配置未找到: ${t}`);for(const s of l.dependencies||[])await this.loadWithDependencies(s,n,r,i);await this.loadResource(l,n,r)}async loadScripts(t,n,r=Mt,i){await Promise.all(t.map(a=>this.loadWithDependencies(a,n,r,i)))}isLoaded(t,n,r){const i=Oe[t];if(!i||i.path.startsWith("/")&&!i.path.startsWith("/libs/")&&!n)return!1;const a=Ge(i,n||"",r||Mt);return this.loaded.has(a)}clearLoaded(){this.loaded.clear(),this.pending.clear()}}const Ue=new It;let le=null;function At(e){le=e}function D(){return le||(typeof window<"u"&&window.bmgl?(le=window.bmgl,le):null)}function N(){const e=D();if(!e)throw new Error("bmgl 库未就绪:请确保地图初始化完成后再调用该能力");return e}async function xt(e=3e3){const t=D();return t||new Promise((n,r)=>{const i=Date.now(),a=setInterval(()=>{const l=D();l?(clearInterval(a),n(l)):Date.now()-i>e&&(clearInterval(a),r(new Error("bmgl 加载超时")))},50)})}class Z{constructor(){this.entries=new Map}static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}register(t,n,r,i){this.entries.set(t,{map:n,eventBus:r,resourceManager:i})}get(t){return this.entries.get(t)?.map}has(t){return this.entries.has(t)}getEventBus(t){return this.entries.get(t)?.eventBus}getResourceManager(t){return this.entries.get(t)?.resourceManager}async unregister(t){const n=this.entries.get(t);if(n&&(this.entries.delete(t),await n.resourceManager.cleanup(),n.eventBus.clear(),!n.map.isDestroyed?.()))try{n.map.destroy()}catch(r){w.error("[MapManager] Error destroying map:",r)}}getAllMapIds(){return Array.from(this.entries.keys())}async cleanupAll(){const t=this.getAllMapIds();await Promise.all(t.map(n=>this.unregister(n)))}}const se=Z.getInstance();function cr(e,t=3e3){return new Promise((n,r)=>{const i=Date.now(),a=setInterval(()=>{document.getElementById(e)?(clearInterval(a),n()):Date.now()-i>t&&(clearInterval(a),r(new Error(`容器未找到: ${e}`)))},16)})}async function ur(e){const t=e.configManager.get("containerId");if(!t)throw new Error("容器ID未定义");return await cr(t),t}async function dr(e){const t=e.configManager.get("serverUrl"),n=e.configManager.get("accessToken"),r=e.configManager.get("libsUrl"),i=e.configManager.get("extraLibs");try{await Ue.loadScripts(["bigemap-3d","bmgl-plot","circle-wave"],t,r,i)}catch(l){throw w.error("[loadBmglScripts] 地图服务连接失败,请确认 serverUrl 可达且服务已启动:",l),new Error("地图服务连接失败,请确认服务器地址正确且服务已启动")}const a=D();if(!a)throw new Error("BMGL 库加载失败");At(a),a.Config.HTTP_URL=t,n&&(console.log("accessToken",n),a.Config.accessToken=n),fr(a)}function fr(e){e.RequestScheduler&&(e.RequestScheduler.maximumRequests=120,e.RequestScheduler.maximumRequestsPerServer=18)}function hr(e){const t=D(),n=e.configManager.get("containerId");if(!t||!n)throw new Error("地图实例创建失败:BMGL 库或容器 ID 未就绪");const r=new t.Viewer(n,{mapId:e.configManager.get("mapId"),terrainId:e.configManager.get("terrainId"),requestRenderMode:!1,selectionIndicator:!1,infoBox:!1});return gr(r,e.state.value.mapType),r}function gr(e,t){t==="3d"&&(e.scene.globe.depthTestAgainstTerrain=!0);const n=e.scene,r=e.scene.globe;n.preloadFlightDestinations=!0,r.tileCacheSize=1e3,r.preloadAncestors=!0,r.preloadSiblings=!0,r.maximumScreenSpaceError=1.5}async function pr(e,t,n){if(se.has(n))try{await se.unregister(n)}catch(r){w.warn(`[registerMap] 清理残留地图实例失败 (${n}):`,r)}se.register(n,t,e.eventBus,e.resourceManager)}function Lt(e){return typeof e=="number"&&!Number.isNaN(e)?e:1e4}function Nt(e,t,n){const r=D();if(!r)throw new Error("BMGL 库未加载,无法构造相机目标位置");return r.Cartesian3.fromDegrees(e,t,n)}function kt(){return{heading:Ee.heading,pitch:Ee.pitch,roll:Ee.roll}}function mr(e){const t=e.configManager.get("position");t&&e.map.value?.camera.flyTo({destination:Nt(t.lng,t.lat,Lt(t.height)),orientation:kt(),duration:Te.FLY_TO})}function wr(e,t,n,r){e.map.value&&e.map.value.camera.flyTo({destination:Nt(t,n,Lt(r)),orientation:kt(),duration:Te.FLY_TO})}function yr(e){const t=D();if(!e.map.value||!t)return null;const n=e.map.value.camera.computeViewRectangle();return n?{minx:t.Math.toDegrees(n.west),maxx:t.Math.toDegrees(n.east),miny:t.Math.toDegrees(n.south),maxy:t.Math.toDegrees(n.north)}:vr(e)}function vr(e){const t=D();if(!t)return null;const n=e.map.value,r=n.scene.globe.ellipsoid;try{const i=n.camera.pickEllipsoid(new t.Cartesian2(0,0),r),a=n.camera.pickEllipsoid(new t.Cartesian2(n.scene.canvas.clientWidth,n.scene.canvas.clientHeight),r);if(!i||!a)return null;const l=r.cartesianToCartographic(i),s=r.cartesianToCartographic(a);return{minx:t.Math.toDegrees(l.longitude),maxx:t.Math.toDegrees(s.longitude),miny:t.Math.toDegrees(s.latitude),maxy:t.Math.toDegrees(l.latitude)}}catch{return null}}function Cr(e){return e.initializing.value||!!e.map.value||e.destroyed.value}async function br(e){if(!Cr(e)){e.cancelled.value=!1,e.initializing.value=!0,e.state.value.isLoading=!0,e.state.value.error=null;try{await Er(e)}catch(t){throw e.state.value.error=t instanceof Error?t:new Error(String(t)),await e.eventBus.emit("map:error",t),t}finally{e.initializing.value=!1,e.state.value.isLoading=!1}}}async function Er(e){const t=await ur(e);if(await dr(e),e.cancelled.value)return;const n=hr(e);if(e.cancelled.value){Tr(n);return}e.map.value=n,await pr(e,n,t),await mr(e),!e.cancelled.value&&(e.state.value.isReady=!0,await e.eventBus.emit("map:ready"))}function Tr(e){try{e.destroy()}catch(t){w.error("[useMap] 销毁未注册的地图实例失败:",t)}}async function _t(e){if(e.cancelled.value=!0,e.destroyed.value=!0,!e.map.value)return;const t=e.configManager.get("containerId");if(e.map.value=null,e.state.value.isReady=!1,t)try{await se.unregister(t)}catch(n){w.error("[useMap] 销毁地图失败:",n)}}function Vt(e,t,n){const r=D();if(!r)throw new Error("BMGL 库未加载,无法构造目标视角");return{destination:r.Cartesian3.fromDegrees(e,t,n),orientation:{heading:0,pitch:r.Math.toRadians(-90),roll:0}}}function Sr(e){const t=e.map.value;if(!(!t||!e.state.value.isReady||e.state.value.mapType==="2d"))try{const n=D();if(!n)throw new Error("BMGL 库未加载,无法切换 2D 模式");const r=n.Cartographic.fromCartesian(t.camera.position);t.scene.morphTo2D?.(0),e.state.value.mapType="2d",e.eventBus.emit("map:mode-changed","2d"),t.camera.setView(Vt(n.Math.toDegrees(r.longitude),n.Math.toDegrees(r.latitude),r.height))}catch(n){w.error("切换到2D模式失败:",n)}}function Dr(e){const t=D();if(!t)throw new Error("BMGL 库未加载,无法计算 3D 目标视图");const n=t.Cartographic.fromCartesian(e.map.value.camera.position),r={lng:t.Math.toDegrees(n.longitude),lat:t.Math.toDegrees(n.latitude),height:Math.max(n.height,1e4)},i=yr(e);if(!i)return r;const a=(i.minx+i.maxx)/2,l=(i.miny+i.maxy)/2,s=(i.maxx-i.minx)*Math.cos(l*Math.PI/180)*H.METERS_PER_DEGREE_LAT_APPROX,u=(i.maxy-i.miny)*H.METERS_PER_DEGREE_LAT_APPROX,d=Math.max(s,u),c=t.Math.toRadians(H.CAMERA_FOV_DEGREES),f=Math.max(d/(2*Math.tan(c/2)),H.MIN_CAMERA_HEIGHT);return{lng:a,lat:l,height:f}}function Mr(e){const t=e.map.value;if(!(!t||!e.state.value.isReady||e.state.value.mapType==="3d"))try{const n=Dr(e);t.scene.morphTo3D?.(0),e.state.value.mapType="3d",e.eventBus.emit("map:mode-changed","3d"),setTimeout(()=>{e.map.value&&e.map.value.camera.setView(Vt(n.lng,n.lat,n.height))},bt)}catch(n){w.error("切换到3D模式失败:",n)}}function Ir(e){e.state.value.mapType==="2d"?Mr(e):Sr(e)}function Pt(e){const t=sr(e),n=(i,a,l)=>wr(t,i,a,l),r=()=>Ir(t);return o.onBeforeUnmount(()=>{_t(t)}),{map:t.map,state:t.state,initMap:()=>br(t),setView:n,toggleMapType:r,destroy:()=>_t(t),on:t.eventBus.on.bind(t.eventBus),once:t.eventBus.once.bind(t.eventBus),off:t.eventBus.off.bind(t.eventBus),emit:t.eventBus.emit.bind(t.eventBus)}}function Ar(e){return{billboardCollection:null,billboardMap:new Map,pointDataCache:[],cacheIdIndex:new Map,gridIndex:null,gridSize:e,scaleByDistance:null}}function Bt(e,t,n){const r=Math.floor(t/e),i=Math.floor(n/e);return`${r},${i}`}function Rt(e,t){const n=Bt(e.gridSize,t.lng,t.lat),r=e.gridIndex?.get(n);r?r.push(t):e.gridIndex?.set(n,[t])}function zt(e,t){if(!e.gridIndex)return;const n=Bt(e.gridSize,t.lng,t.lat),r=e.gridIndex.get(n);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1),r.length===0&&e.gridIndex.delete(n)}const xr=1e5;function Lr(e,t){const n=[];if(!e.gridIndex)return n;const r=Math.floor(t.west/e.gridSize),i=Math.floor(t.south/e.gridSize),a=Math.floor(t.east/e.gridSize),l=Math.floor(t.north/e.gridSize),s=(a-r+1)*(l-i+1),u=d=>d.lng>=t.west&&d.lng<=t.east&&d.lat>=t.south&&d.lat<=t.north;if(s>xr){for(const d of e.pointDataCache)u(d)&&n.push(d);return n}for(let d=r;d<=a;d++)for(let c=i;c<=l;c++){const f=e.gridIndex.get(`${d},${c}`)||[];for(const h of f)u(h)&&n.push(h)}return n}function Nr(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const[a,l]of e)a<t&&(t=a),l<n&&(n=l),a>r&&(r=a),l>i&&(i=l);return{west:t,south:n,east:r,north:i}}function kr(e){const[t,n]=e.center,r=e.radius/(H.METERS_PER_DEGREE_LAT*Math.cos(n*Math.PI/180)),i=e.radius/H.METERS_PER_DEGREE_LAT;return{west:t-r,east:t+r,south:n-i,north:n+i}}function _r(e){return e.type==="circle"?kr(e):Nr(e.coordinates)}function Vr(e,t){const[n,r]=e;let i=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const[s,u]=t[a],[d,c]=t[l];u>r!=c>r&&n<(d-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function Pr(e,t){const[n,r]=t.center,i=t.radius*t.radius,a=(e.lng-n)*H.METERS_PER_DEGREE_LAT*Math.cos(r*Math.PI/180),l=(e.lat-r)*H.METERS_PER_DEGREE_LAT;return a*a+l*l<=i}function Br(e,t){return t.type==="circle"?e.filter(n=>Pr(n,t)):t.type==="polygon"||t.type==="triangle"?e.filter(n=>Vr([n.lng,n.lat],t.coordinates)):e}function Rr(e,t){if(!e.gridIndex||e.pointDataCache.length===0)return[];const n=_r(t);let r=Lr(e,n);return t.type!=="rectangle"&&(r=Br(r,t)),r}function zr(e,t){const{field:n,keyword:r,limit:i=10,caseSensitive:a=!1}=t,l=a?r.trim():r.trim().toLowerCase(),s=Array.isArray(n)?n:[n],u=[];for(const d of e.pointDataCache)if(s.some(f=>{const h=d[f];return h==null?!1:(a?String(h):String(h).toLowerCase()).includes(l)})&&(u.push(d),u.length>=i))break;return u}const Fr={lng:"lng",lat:"lat",altitude:"altitude",id:"id"};let Ft=0,Ot=!1,Gt=!1;function Or(){return Ot||(Ot=!0,w.warn("[useMapPoint] 检测到未提供 id 的点位,已启用自增 id 自动生成;建议通过 fieldMapping.id 提供稳定 id 以支持 updatePoints 精确定位")),Ft+=1,`__auto_${Ft}`}function Gr(){return typeof MessageChannel<"u"?new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(0)}):new Promise(e=>setTimeout(e,0))}function Ur(e,t){if(!t.scaleByDistance){const n=Tt;t.scaleByDistance=new e.NearFarScalar(n.NEAR,n.NEAR_VALUE,n.FAR,n.FAR_VALUE)}return t.scaleByDistance}function Ut(e){const t=Ar(ne.GRID_SIZE),n=async()=>{if(!t.billboardCollection&&e.value){const d=D();d&&(t.billboardCollection=e.value.scene.primitives.add(new d.BillboardCollection))}return t.billboardCollection},r=()=>{if(t.billboardCollection)try{t.billboardCollection.removeAll()}catch(d){w.warn("[useMapPoint] removeAll billboard 失败:",d)}t.billboardMap.clear(),t.pointDataCache=[],t.cacheIdIndex.clear(),t.gridIndex=null},i=d=>{const c=t.cacheIdIndex.get(d);if(c===void 0)return;const f=t.pointDataCache[c],h=t.billboardMap.get(d);if(h&&t.billboardCollection)try{t.billboardCollection.remove(h)}catch(p){w.warn("[useMapPoint] 移除旧 billboard 失败:",p)}return t.billboardMap.delete(d),zt(t,f),c},a=(d,c,f,h)=>{const p=parseFloat(c[f.fieldMapping.lng])||0,b=parseFloat(c[f.fieldMapping.lat])||0,v=parseFloat(c[f.fieldMapping.altitude])||0,m=d.Cartesian3.fromDegrees(p,b,v),C=t.billboardCollection.add({position:m,image:c.icon,width:c.width||f.width,height:c.height||f.height,scaleByDistance:Ur(d,t),id:h,disableDepthTestDistance:Tt.NEAR,verticalOrigin:d.VerticalOrigin.BOTTOM});return C.pointData=c,{billboard:C,position:m,lng:p,lat:b,altitude:v}},l=async(d,c,f,h="append")=>{try{if(h==="replace"&&r(),!await n())return;const b=D();if(!b)return;const v={width:c?.width||20,height:c?.height||20,fieldMapping:{...Fr,...c?.fieldMapping||{}}},m=performance.now();t.gridIndex||(t.gridIndex=new Map);const C=Array.isArray(d)?d:[],y=C.length,E=ne.BATCH_SIZE,_=ne.YIELD_BUDGET_MS;let S=performance.now(),A=0;for(let V=0;V<y;V+=E){const U=C.slice(V,V+E);for(const z of U){if(!z.icon){A+=1,Gt||(Gt=!0,w.warn("[useMapPoint] 检测到缺失 icon 的点位,已跳过渲染;请在数据层通过 iconManager 预生成 icon 后传入"));continue}const M=z[v.fieldMapping.id],I=M!=null&&M!==""?String(M):Or(),F=i(I),{billboard:k,position:Y,lng:K,lat:pe,altitude:me}=a(b,z,v,I);t.billboardMap.set(I,k);const X={...z,id:I,lng:K,lat:pe,altitude:me,icon:z.icon};F!==void 0?t.pointDataCache[F]=X:(t.cacheIdIndex.set(I,t.pointDataCache.length),t.pointDataCache.push(X)),Rt(t,X)}V+E<y&&performance.now()-S>=_&&(await Gr(),S=performance.now())}A>0&&w.warn(`[useMapPoint] 本次加载跳过 ${A} 个缺失 icon 的点位`),console.log(`[useMapPoint] ${h} ${C.length} 个点位 billboard 渲染耗时:${(performance.now()-m).toFixed(0)}ms`)}catch(p){throw w.error("加载点位失败:",p),p}},s=async d=>{const c=D();for(const f of d){const h=String(f.id),p=t.billboardMap.get(h);if(p){if(f.icon&&(p.image=f.icon),f.width!==void 0&&(p.width=f.width),f.height!==void 0&&(p.height=f.height),c&&f.lng!==void 0&&f.lat!==void 0){const b=c.Cartesian3.fromDegrees(Number(f.lng),Number(f.lat),Number(f.altitude??0));p.position=b;const v=t.cacheIdIndex.get(h);if(v!==void 0){const m=t.pointDataCache[v];zt(t,m),m.lng=Number(f.lng),m.lat=Number(f.lat),f.altitude!==void 0&&(m.altitude=Number(f.altitude)),Rt(t,m)}}if(f.name!==void 0){const b=t.cacheIdIndex.get(h);b!==void 0&&(t.pointDataCache[b].name=String(f.name))}}}},u=async()=>{r()};return o.onUnmounted(()=>{try{const d=e.value?.scene;if(d?.primitives&&t.billboardCollection)try{d.primitives.remove(t.billboardCollection)}catch(c){w.warn("[useMapPoint] remove billboardCollection error:",c)}t.billboardMap.clear(),t.pointDataCache=[],t.cacheIdIndex.clear(),t.gridIndex=null,t.billboardCollection=null}catch(d){w.warn("[useMapPoint] onUnmounted cleanup error:",d)}}),{loadPoints:l,searchByShape:d=>Rr(t,d),searchByText:d=>zr(t,d),updatePoints:s,clearPoints:u}}function $t(e){return e?.rectangle?"rectangle":e?.polygon?"polygon":e?.polyline?"polyline":e?.ellipse||e?.position&&e?.billboard?"circle":"polygon"}function $e(e){if(e.length===0)return e;const t=e[0],n=e[e.length-1];return(Array.isArray(t)?t[0]===n[0]&&t[1]===n[1]:t.lng===n.lng&&t.lat===n.lat)?[...e]:[...e,t]}function $r(e,t=0){const n=D();return n?n.Cartesian3.fromDegrees(e.lng,e.lat,t):null}function Wt(e){const t=D();return t?{lng:t.Math.toDegrees(e.longitude),lat:t.Math.toDegrees(e.latitude)}:null}function De(e){const t=D();if(!t)return null;const n=t.Cartographic.fromCartesian(e);return Wt(n)}function We(e,t){return[[e.lng,e.lat],[t.lng,e.lat],[t.lng,t.lat],[e.lng,t.lat],[e.lng,e.lat]]}const ce={fillColor:"#ff0000",strokeColor:"#00ff00",lineColor:"#3366ff",strokeWidth:3,fillAlpha:.1,strokeAlpha:1,pointColor:"#ff0000",pixelSize:10,radius:1e3};function B(e,t){return N().Color.fromCssColorString(e).withAlpha(t)}function Ht(e){const t=N();return e.map(n=>Array.isArray(n)?t.Cartesian3.fromDegrees(n[0],n[1]):t.Cartesian3.fromDegrees(n.lng,n.lat))}function Wr(e,t=!0){const n=N(),r=ce;if(!e.coordinates||e.coordinates.length<3)throw new Error("多边形需要至少3个坐标点");const i=$e(e.coordinates),a=Ht(i),l=new n.Entity({polygon:{hierarchy:new n.PolygonHierarchy(a),material:B(e.fillColor??r.fillColor,e.fillAlpha??r.fillAlpha)}}),s=new n.Entity({polyline:{positions:a,width:e.strokeWidth??r.strokeWidth,material:B(e.strokeColor??r.strokeColor,e.strokeAlpha??r.strokeAlpha),clampToGround:t}});return{fillEntity:l,strokeEntity:s,positions:a,closedCoordinates:i}}function Hr(e,t=!0){const n=N(),r=ce;if(!e.lineCoordinates||e.lineCoordinates.length<4)throw new Error("线段需要至少2个点");return{entity:new n.Entity({polyline:{positions:n.Cartesian3.fromDegreesArray(e.lineCoordinates),width:e.strokeWidth??r.strokeWidth,material:B(e.strokeColor??r.lineColor,e.strokeAlpha??r.strokeAlpha),clampToGround:t}})}}function jr(e){const t=N(),n=ce;if(!e.center)throw new Error("圆形需要中心点坐标");const r=e.radius??n.radius;return{entity:new t.Entity({position:t.Cartesian3.fromDegrees(e.center.lng,e.center.lat),ellipse:{semiMinorAxis:r,semiMajorAxis:r,height:0,material:B(e.fillColor??n.fillColor,e.fillAlpha??n.fillAlpha),outline:!0,outlineColor:B(e.strokeColor??n.strokeColor,e.strokeAlpha??n.strokeAlpha),outlineWidth:e.strokeWidth??n.strokeWidth}}),center:e.center,radius:r}}function Yr(e,t=!0){const n=N(),r=ce;if(!e.coordinates||e.coordinates.length<2)throw new Error("矩形需要两个对角点坐标");const[i,a]=e.coordinates,l=n.Rectangle.fromDegrees(Math.min(i.lng,a.lng),Math.min(i.lat,a.lat),Math.max(i.lng,a.lng),Math.max(i.lat,a.lat)),s=new n.Entity({rectangle:{coordinates:l,material:B(e.fillColor??r.fillColor,e.fillAlpha??r.fillAlpha)}}),u=We(i,a),d=new n.Entity({polyline:{positions:Ht(u),width:e.strokeWidth??r.strokeWidth,material:B(e.strokeColor??r.strokeColor,e.strokeAlpha??r.strokeAlpha),clampToGround:t}});return{fillEntity:s,strokeEntity:d,coordinates:u}}function qr(e){const t=N(),n=ce;if(!e.point)throw new Error("点需要坐标");return{entity:new t.Entity({position:t.Cartesian3.fromDegrees(e.point.lng,e.point.lat),point:{pixelSize:e.pixelSize??n.pixelSize,color:B(e.pointColor??n.pointColor,1),heightReference:t.HeightReference.CLAMP_TO_GROUND}}),point:[e.point.lng,e.point.lat]}}function Kr(e){const t=N();return!!(t.SceneMode&&e.scene.mode===t.SceneMode.SCENE2D)}const Xr={polygon:(e,t,n)=>{const r=Wr(e,t),i=n.entities.add(r.fillEntity),a=n.entities.add(r.strokeEntity);return{nativeEntity:{fill:i,stroke:a},coordinates:r.closedCoordinates}},line:(e,t,n)=>{const r=Hr(e,t);return{nativeEntity:n.entities.add(r.entity),coordinates:e.lineCoordinates??[]}},circle:(e,t,n)=>{const r=jr(e);return{nativeEntity:n.entities.add(r.entity),coordinates:{center:r.center,radius:r.radius}}},rectangle:(e,t,n)=>{const r=Yr(e,t),i=n.entities.add(r.fillEntity),a=n.entities.add(r.strokeEntity);return{nativeEntity:{fill:i,stroke:a},coordinates:r.coordinates}},point:(e,t,n)=>{const r=qr(e);return{nativeEntity:n.entities.add(r.entity),coordinates:r.point}}};function jt(e,t,n){const r=Xr[e];if(!r)throw new Error(`不支持的实体类型: ${e}`);return r(t,!Kr(n),n)}function Me(e,t){try{e.type==="polygon"||e.type==="rectangle"?(e.nativeEntity?.fill&&t.entities.remove(e.nativeEntity.fill),e.nativeEntity?.stroke&&t.entities.remove(e.nativeEntity.stroke)):e.nativeEntity&&t.entities.remove(e.nativeEntity)}catch(n){w.warn(`移除原生实体失败 (${e.id}):`,n)}}function He(e,t,n,r){return{color:e.fillColor||t.options.fillColor||n,alpha:e.fillAlpha!==void 0?e.fillAlpha:t.options.fillAlpha??r}}function Ie(e,t,n,r){return{color:e.strokeColor||t.options.strokeColor||n,alpha:e.strokeAlpha!==void 0?e.strokeAlpha:r}}function Zr(e,t){const n=N(),{fill:r,stroke:i}=e.nativeEntity,a=$e(t.coordinates),l=a.map(s=>n.Cartesian3.fromDegrees(s.lng,s.lat));r.polygon.hierarchy=new n.PolygonHierarchy(l),i.polyline.positions=l,e.coordinates=a}function Jr(e,t){const{fill:n,stroke:r}=e.nativeEntity;if(t.fillColor!==void 0||t.fillAlpha!==void 0){const{color:i,alpha:a}=He(t,e,"#ff0000",.1);n.polygon.material=B(i,a)}if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:i,alpha:a}=Ie(t,e,"#00ff00",1);r.polyline.material=B(i,a)}t.strokeWidth!==void 0&&(r.polyline.width=t.strokeWidth),t.coordinates&&t.coordinates.length>=3&&Zr(e,t)}function Qr(e,t){const n=N(),{fill:r,stroke:i}=e.nativeEntity,[a,l]=t.coordinates;r.rectangle.coordinates=n.Rectangle.fromDegrees(Math.min(a.lng,l.lng),Math.min(a.lat,l.lat),Math.max(a.lng,l.lng),Math.max(a.lat,l.lat));const s=We(a,l);i.polyline.positions=s.map(u=>n.Cartesian3.fromDegrees(u[0],u[1])),e.coordinates=s}function ei(e,t){const{fill:n,stroke:r}=e.nativeEntity;if(t.fillColor!==void 0||t.fillAlpha!==void 0){const{color:i,alpha:a}=He(t,e,"#ff0000",.1);n.rectangle.material=B(i,a)}if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:i,alpha:a}=Ie(t,e,"#00ff00",1);r.polyline.material=B(i,a)}t.strokeWidth!==void 0&&(r.polyline.width=t.strokeWidth),t.coordinates&&t.coordinates.length>=2&&Qr(e,t)}function ti(e,t){const n=N(),i=e.nativeEntity.polyline;if(i){if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:a,alpha:l}=Ie(t,e,"#3366ff",1);i.material=B(a,l)}t.strokeWidth!==void 0&&(i.width=t.strokeWidth),t.lineCoordinates&&t.lineCoordinates.length>=4&&(i.positions=n.Cartesian3.fromDegreesArray(t.lineCoordinates),e.coordinates=t.lineCoordinates)}}function ni(e,t){const n=N(),r=e.nativeEntity;if(t.fillColor!==void 0||t.fillAlpha!==void 0){const{color:i,alpha:a}=He(t,e,"#ff0000",.1);r.ellipse.material=B(i,a)}if(t.strokeColor!==void 0||t.strokeAlpha!==void 0){const{color:i,alpha:a}=Ie(t,e,"#00ff00",1);r.ellipse.outlineColor=B(i,a)}if(t.strokeWidth!==void 0&&(r.ellipse.outlineWidth=t.strokeWidth),t.radius!==void 0&&(r.ellipse.semiMinorAxis=t.radius,r.ellipse.semiMajorAxis=t.radius),t.center){r.position=n.Cartesian3.fromDegrees(t.center.lng,t.center.lat);const i=e.coordinates,a=i&&!Array.isArray(i)?i.radius:void 0;e.coordinates={center:t.center,radius:t.radius||a||1e3}}}function ri(e,t){const n=N(),r=e.nativeEntity,i=r.point;i&&(t.pointColor!==void 0&&(i.color=B(t.pointColor,1)),t.pixelSize!==void 0&&(i.pixelSize=t.pixelSize),t.point&&(r.position=n.Cartesian3.fromDegrees(t.point.lng,t.point.lat),e.coordinates=[t.point.lng,t.point.lat]))}function ii(e,t){const n=e.nativeEntity;e.type==="polygon"||e.type==="rectangle"?(n.fill.show=t,n.stroke.show=t):n.show=t}function ai(e,t,n){e==="polygon"?Jr(t,n):e==="rectangle"?ei(t,n):e==="line"?ti(t,n):e==="circle"?ni(t,n):e==="point"&&ri(t,n)}function oi(e,t){const n=t.coordinates;n&&((e.type==="polygon"||e.type==="rectangle")&&!e.coordinates&&Array.isArray(n)&&(e.coordinates=n),e.type==="line"&&!e.lineCoordinates&&t.type==="line"&&Array.isArray(n)&&(e.lineCoordinates=n),e.type==="circle"&&!e.center&&t.type==="circle"&&!Array.isArray(n)&&(e.center=n.center,e.radius=n.radius||1e3),e.type==="point"&&!e.point&&t.type==="point"&&Array.isArray(n)&&(e.point=n))}async function li(e,t,n,r,i){Me(t,r);const a={...t.options,...n,id:e,type:n.type};return oi(a,t),await i(a)!==null}function Yt(e){const t=new Map;let n="";const r=()=>!e.value||!e.value.entities?(w.warn("地图实例未就绪"),!1):!0,i=async()=>{if(r())return!0;try{return await xt(),r()}catch{return!1}},a=async c=>{try{if(!await i())return null;const f=e.value;if(!f)return null;const h=c.id||`${c.type}-${Date.now()}`,{nativeEntity:p,coordinates:b}=jt(c.type,c,f),v={id:h,type:c.type,options:{...c,id:h,type:c.type,visible:c.visible!==!1},nativeEntity:p,coordinates:b};return t.set(h,v),n=h,h}catch(f){return w.error("绘制实体失败:",f),null}},l=c=>{try{if(!r())return!1;const f=e.value;if(!f)return!1;if(!c)return t.forEach(p=>Me(p,f)),t.clear(),n="",!0;const h=t.get(c);return h?(Me(h,f),t.delete(c),n===c&&(n=""),!0):(w.warn(`实体未找到: ${c}`),!1)}catch(f){return w.error("删除实体失败:",f),!1}},s=()=>n,u=async(c,f)=>{try{const h=t.get(c);if(!h)return w.warn(`实体未找到:${c}`),!1;if(!await i())return!1;const p=e.value;return p?f.type&&f.type!==h.type?await li(c,h,f,p,a):(ai(h.type,h,f),f.name!==void 0&&(h.options.name=f.name),f.visible!==void 0&&ii(h,f.visible),h.options={...h.options,...f},t.set(c,h),!0):!1}catch(h){return w.error(`修改实体失败 (${c}):`,h),!1}},d=()=>{if(!r())return;const c=e.value;if(c)for(const[f,h]of t)try{Me(h,c),h.nativeEntity=jt(h.type,h.options,c).nativeEntity}catch(p){w.warn(`重绘实体失败 (${f}):`,p)}};return o.onUnmounted(()=>{try{t.clear(),n=""}catch(c){w.warn("[useMapEntity] onUnmounted cleanup error:",c)}}),{drawEntity:a,updateEntity:u,deleteEntity:l,redrawAllEntities:d,getCurrentEntityId:s}}function si(){return{drawInstance:null,editInstance:null,currentDrawId:"",currentDrawType:null,isDrawing:!1,isEditing:!1,drawCallback:null,mapInstance:null,mapHandler:null,eventListeners:[],lastEditedEntity:null,drawEntityIds:new Set}}const ue={fillColor:"#369",fillAlpha:.6,borderColor:"#fff",borderAlpha:.8,lineWidth:2,labelFont:"14px arial",arrowWidth:20};function Ae(e,t,n,r){return typeof e!="number"||Number.isNaN(e)?r:Math.min(n,Math.max(t,e))}class ci{constructor(t){this.config={...ue,...t},this.config.fillAlpha=Ae(this.config.fillAlpha,0,1,ue.fillAlpha),this.config.borderAlpha=Ae(this.config.borderAlpha,0,1,ue.borderAlpha),this.config.lineWidth=Ae(this.config.lineWidth,1,50,ue.lineWidth),this.config.arrowWidth=Ae(this.config.arrowWidth,1,100,ue.arrowWidth)}materials(t){const{fillColor:n,fillAlpha:r,borderColor:i,borderAlpha:a}=this.config;return{fill:t.Color.fromCssColorString(n).withAlpha(r),border:t.Color.fromCssColorString(i).withAlpha(a)}}label(t){const{labelFont:n}=this.config;return{fillColor:t.Color.WHITE,font:n,verticalOrigin:t.VerticalOrigin.BOTTOM,pixelOffset:new t.Cartesian2(0,-20),disableDepthTestDistance:5e3}}getDrawConfig(){const t=N(),{fill:n,border:r}=this.materials(t),i=this.label(t),a=this.config.lineWidth,l={bmgl:t,config:this.config,shared:{fill:n,border:r,label:i,width:a}},s={repeat:!0};for(const u of gt())u.buildConfig&&(s[u.type]=u.buildConfig(l));return s}getEditConfig(){const t=N();return{axis:{scale:1},control:{tolerance:4,marker:{eyeOffset:new t.Cartesian3(0,0,-20),verticalOrigin:t.VerticalOrigin.BOTTOM,disableDepthTestDistance:5e3}}}}}function qt(e){return e.map(t=>De(t)).filter(t=>t!==null)}function ui(e){try{const t=e.polygon.hierarchy.getValue().positions||[],n=qt(t);return{type:"polygon",path:n.map(r=>[r.lng,r.lat]),rawPath:n,radius:void 0}}catch(t){return w.error("提取多边形数据失败:",t),null}}function di(e){const t=N();try{const n=e.rectangle.coordinates.getValue(),r=t.Math.toDegrees(n.west),i=t.Math.toDegrees(n.south),a=t.Math.toDegrees(n.east),l=t.Math.toDegrees(n.north);return{type:"rectangle",path:[[r,l],[a,l],[a,i],[r,i],[r,l]],rawPath:[{lng:r,lat:l},{lng:a,lat:l},{lng:a,lat:i},{lng:r,lat:i}],radius:void 0}}catch(n){return w.error("提取矩形数据失败:",n),null}}function fi(e){try{const t=e.polyline.positions.getValue(),n=qt(t);return{type:"polyline",path:n.map(r=>[r.lng,r.lat]),rawPath:n,radius:void 0}}catch(t){return w.error("提取折线数据失败:",t),null}}function hi(e){try{const t=De(e.position.getValue());if(!t)return null;const n=e.ellipse.semiMajorAxis?.getValue()||0,r=e.ellipse.semiMinorAxis?.getValue()||0;return{type:"circle",center:[t.lng,t.lat],radius:Math.max(n,r),rawPath:[t]}}catch(t){return w.error("提取圆形数据失败:",t),null}}function gi(e){try{const t=De(e.position.getValue());return t?{type:"circle",center:[t.lng,t.lat],radius:e.radius||0,rawPath:[t]}:null}catch{return null}}function Kt(e){return e?e.polygon?ui(e):e.rectangle?di(e):e.polyline?fi(e):e.position&&e.ellipse?hi(e):e.billboard&&e.position?gi(e):null:null}function pi(e){return $t(e)}function mi(e){return e.editInstance&&(e.editInstance.isEditing||e.editInstance._isEditing||e.editInstance.editing)||!1}function wi(e){typeof e.finish=="function"?e.finish():typeof e.stop=="function"?e.stop():typeof e.disable=="function"?e.disable():typeof e.end=="function"?e.end():e.isEditing=!1}function de(e,t=!1){if(e.editInstance){t&&e.currentDrawId&&(e.lastEditedEntity=e.mapInstance?.entities.getById(e.currentDrawId)??null);try{wi(e.editInstance)}catch(n){w.error("结束编辑状态失败:",n)}finally{e.isEditing=!1}t&&e.lastEditedEntity&&yi(e)}}function J(e,t){if(e.drawCallback)try{e.drawCallback(t)}catch(n){w.error("绘图回调执行失败:",n)}else w.warn("绘图回调函数未设置")}function yi(e){if(!(!e.lastEditedEntity||!e.currentDrawId))try{const t=Kt(e.lastEditedEntity);if(!t)return;const n={type:t.type,layer:{_id:e.currentDrawId},path:t.rawPath||[]};t.type==="circle"&&t.radius!==void 0&&(n.radius=t.radius),J(e,{type:t.type,operation:"edit",id:e.currentDrawId,data:t,rawData:n}),e.lastEditedEntity=null}catch(t){w.error("手动触发编辑完成事件失败:",t)}}function vi(e,t,n){try{if(e.drawInstance||n(),!e.drawInstance)throw new Error("绘图实例初始化失败");if(e.isEditing&&de(e,!1),e.isDrawing=!0,e.currentDrawType=t,typeof e.drawInstance.enable=="function")e.drawInstance.enable(t);else if(typeof e.drawInstance.start=="function")e.drawInstance.start(t);else throw new Error("绘图实例没有可用的启用方法")}catch(r){throw w.error(`开始绘制 ${t} 失败:`,r),e.isDrawing=!1,e.currentDrawType=null,r}}function Ci(e){const t=(n,...r)=>{if(n){for(const i of r)if(typeof n[i]=="function"){n[i]();return}}};t(e.drawInstance,"disable","stop"),t(e.editInstance,"disable","stop")}function bi(e){e.currentDrawId="",e.currentDrawType=null,e.isDrawing=!1,e.isEditing=!1,e.lastEditedEntity=null}function Q(e){e.isEditing&&de(e,!1),Ci(e),bi(e)}function Ei(e,t=""){if(!e.mapInstance)return;const n=t||e.currentDrawId;if(e.isEditing&&de(e,!1),!n){Q(e);return}const r=e.mapInstance.entities.getById(n);if(r){const i=Kt(r);if(e.mapInstance.entities.remove(r),e.drawEntityIds.delete(n),e.currentDrawId===n&&(e.currentDrawId=""),i){const a={type:i.type,layer:{_id:n},path:i.rawPath||[]};i.type==="circle"&&i.radius!==void 0&&(a.radius=i.radius),J(e,{type:i.type,operation:"delete",id:n,data:i,rawData:a})}}Q(e)}function Ti(e){if(!e.mapInstance)return;e.isEditing&&de(e,!1);let t=0;if(e.drawEntityIds.size>0){for(const r of e.drawEntityIds){const i=e.mapInstance.entities.getById(r);i&&(e.mapInstance.entities.remove(i),t++)}e.drawEntityIds.clear()}else{const r=e.mapInstance.entities?.values||[];r.some(a=>!e.drawEntityIds.has(a?._id))||(e.mapInstance.entities.removeAll(),t=r.length)}const n=e.currentDrawType||"polygon";J(e,{type:n,operation:"clear",data:null,rawData:null,count:t}),Q(e)}class j{static process(t){if(!t?.type)return null;try{const n=j.getProcessor(t.type);if(!n)return null;const r=n(t);return r?{...r,id:t.layer?._id||""}:null}catch(n){return w.error("数据处理失败:",n),null}}static getProcessor(t){return{rectangle:j.processRectangle,polygon:j.processPolygon,circle:j.processCircle,triangle:j.processTriangle,polyline:j.processPolyline}[t]}static processRectangle(t){const[n,r]=t.path||[];return!n||!r?null:{type:"rectangle",path:[[n.lng,n.lat],[r.lng,n.lat],[r.lng,r.lat],[n.lng,r.lat],[n.lng,n.lat]]}}static processPolygon(t){const n=(t.path||[]).map(r=>[r.lng,r.lat]);return n.length===0?null:{type:"polygon",path:[...n,n[0]]}}static processCircle(t){const n=t.path;return!n||n.lng===void 0?null:{type:"circle",center:[n.lng,n.lat],radius:t.radius||0}}static processTriangle(t){const n=(t.path||[]).map(r=>[r.lng,r.lat]);return n.length===0?null:{type:"triangle",path:[...n,n[0]]}}static processPolyline(t){const n=(t.path||[]).map(r=>[r.lng,r.lat]);return n.length===0?null:{type:"polyline",path:n}}}function Si(e,t,n){J(e,{type:pi(n),operation:"select",id:t,data:{id:t},rawData:n})}function Di(e){if(mi(e)){de(e,!0);return}e.isDrawing&&e.currentDrawType&&J(e,{type:e.currentDrawType,operation:"cancel",id:e.currentDrawId,data:null,rawData:null}),Q(e)}function Mi(e,t){if(!e.mapInstance)return;const n=N(),r=e.mapInstance.scene.pick(t.position);if(!n.defined(r))return;const i=r?.id?._id;if(typeof i!="string"||!i)return;const a=e.mapInstance.entities.getById(i);if(!a||!e.editInstance)return;e.currentDrawId=i,e.lastEditedEntity=a;const l=e.editInstance;typeof l.edit=="function"?l.edit(a):typeof l.start=="function"?l.start(a):typeof l.enable=="function"&&l.enable(a),e.isEditing=!0}function Ii(e,t){if(!e.mapInstance||e.isDrawing)return;const n=N(),r=e.mapInstance.scene.pick(t.position);if(!n.defined(r))return;const i=r?.id?._id;if(typeof i!="string"||!i)return;const a=e.mapInstance.entities.getById(i);a&&(e.currentDrawId=i,Si(e,i,a))}function Ai(e,t){const n=j.process(t.detail);if(!n)return;n.id&&e.drawEntityIds.add(n.id);const r={type:n.type,operation:"draw",id:n.id,data:n,rawData:t.detail};J(e,r),Q(e)}function xi(e,t){e.isEditing=!1;const n=j.process(t.detail);if(!n){e.lastEditedEntity=null;return}const r={type:n.type,operation:"edit",id:n.id,data:n,rawData:t.detail};J(e,r),e.lastEditedEntity=null}function Xt(e){e.eventListeners.forEach(({type:t})=>{try{e.mapHandler?.removeInputAction(t)}catch(n){w.warn(`移除 ${t} 事件监听器失败:`,n)}}),e.eventListeners=[]}function Li(e){Xt(e);const t=e.mapHandler;if(!t)return;const n=N(),r=[n.ScreenSpaceEventType.RIGHT_CLICK,n.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,n.ScreenSpaceEventType.LEFT_CLICK],i=[()=>Di(e),a=>Mi(e,a),a=>Ii(e,a)];r.forEach((a,l)=>{t.setInputAction(i[l],a),e.eventListeners.push({type:a})})}function Ni(e){e.drawInstance&&(e.drawInstance.on("bm_draw_end",t=>Ai(e,t)),e.editInstance&&e.editInstance.on("bm_edit_end",t=>xi(e,t)))}function ki(e,t,n){try{if(e.mapInstance=o.isRef(t)?t.value:t,!e.mapInstance)throw new Error("地图实例不可用");if(!D())throw new Error("BMGL 库未加载");if(e.mapHandler=e.mapInstance.screenSpaceEventHandler,!e.mapHandler)throw new Error("地图事件处理器不可用");const r=N(),i=new ci(n);e.drawInstance=new r.Plot.Draw(e.mapInstance,i.getDrawConfig()),e.editInstance=new r.Plot.Edit(e.mapInstance,i.getEditConfig()),Li(e),Ni(e)}catch(r){throw w.error("绘图工具初始化失败:",r),r}}function Zt(e){try{Q(e),Xt(e),e.drawInstance&&typeof e.drawInstance.destroy=="function"&&e.drawInstance.destroy(),e.editInstance&&typeof e.editInstance.destroy=="function"&&e.editInstance.destroy(),e.drawInstance=null,e.editInstance=null,e.drawCallback=null,e.mapHandler=null,e.lastEditedEntity=null}catch(t){w.error("清理绘图工具资源失败:",t)}}function Jt(e,t){const n=si(),r=()=>ki(n,e,t),i=s=>{n.drawCallback=s},a=()=>({isDrawing:n.isDrawing,isEditing:n.isEditing,currentDrawId:n.currentDrawId,currentDrawType:n.currentDrawType,drawInstance:!!n.drawInstance,editInstance:!!n.editInstance}),l=()=>n.isDrawing;if(e&&typeof e=="object"&&"value"in e)o.watch(e,s=>{if(s&&!n.drawInstance)try{r()}catch(u){w.warn("自动初始化失败,将在绘图时重试:",u)}},{immediate:!0});else if(e)try{r()}catch(s){w.warn("自动初始化失败,将在绘图时重试:",s)}return o.onUnmounted(()=>{Zt(n)}),{startDrawing:s=>vi(n,s,r),cancelDrawing:()=>Q(n),removeDrawing:(s="")=>Ei(n,s),clearAllDrawings:()=>Ti(n),setCallback:i,getDrawingStatus:a,getIsDrawing:l,initialize:r,cleanup:()=>Zt(n)}}function _i(){return{popupLayer:null,divLayerManager:null,mapInstance:null,currentPopupData:null,displayConfig:null,popupSeq:0}}function fe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Vi(e){return e&&/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)?e:""}function re(e,t){return typeof e=="number"&&!Number.isNaN(e)?e.toFixed(t):"-"}function Pi(e){return R[e||"default"]||R.default}function Bi(e){return[`--status-color: ${e.color}`,`--status-bg: ${e.color}10`,`--status-border: ${e.color}30`,`--status-shadow: ${e.color}30`].join(";")}function Ri(e,t){const n=[e.lineCode,e.lineNo,e.pointNo].filter(i=>i!=null&&i!==""),r=n.length?`<div class="map-point-popup-subtitle"><span>${n.map(i=>fe(i)).join('<span class="map-point-popup-divider">|</span>')}</span></div>`:"";return`
2
2
  <div class="map-point-popup-title">
3
3
  <div class="map-point-popup-header">
4
4
  <h3>${fe(e.name||"点位信息")}</h3>
@@ -15,7 +15,7 @@
15
15
  <div class="map-point-popup-content">
16
16
  ${l}
17
17
  </div>
18
- </div>`}function je(e){return typeof e=="number"&&!Number.isNaN(e)}function $i(e,t){return t&&(e.mapInstance=o.isRef(t)?t.value:t),!!e.mapInstance}async function Wi(e,t,n){if($i(e,t),!e.divLayerManager&&e.mapInstance){const r=D();if(!r)return null;e.divLayerManager=new r.div.DivLayerManager(e.mapInstance,{click:(i,a)=>{n&&n({position:a,detail:i})}})}return e.divLayerManager}function Hi(e){const t=D();if(!t)throw new Error("BMGL 库未加载,无法转换弹窗坐标");return t.Cartesian3.fromDegrees(e.lng,e.lat,e.altitude||0)}function en(e,t,n){const r=ki();r.displayConfig=n?.displayConfig||null;const i=()=>{if(r.popupLayer&&r.divLayerManager){try{r.divLayerManager.removeLayer(r.popupLayer)}catch(d){w.warn("移除弹窗时发生错误:",d)}r.popupLayer=null}r.currentPopupData=null},a=async(d,c={})=>{try{if(!d)throw new Error("点位数据不能为空");const f=++r.popupSeq,h={lng:je(d.lng)?d.lng:te.lng,lat:je(d.lat)?d.lat:te.lat,altitude:je(d.altitude)?d.altitude:0};i();const p=await Wi(r,e,t);if(!p)throw new Error("DivLayerManager 初始化失败");if(f!==r.popupSeq)return;r.currentPopupData={...d};const b={offsetX:0,offsetY:-20,className:"map-point-popup",...c},v=D();if(!v)throw new Error("BMGL 库未加载,无法创建弹窗");const m=new v.div.DivLayer(Ui(d,r.displayConfig||void 0),Hi(h),{offset:{x:b.offsetX,y:b.offsetY}});r.popupLayer=m,p.addLayer(m)}catch(f){w.error("显示点位弹窗失败:",f),i()}},l=()=>{i()},s=()=>r.popupLayer!==null,u=()=>r.currentPopupData;return o.onUnmounted(()=>{try{l()}catch(c){w.warn("[useMapPopup] onUnmounted removePopup error:",c)}const d=r.divLayerManager;if(d&&typeof d.destroy=="function")try{d.destroy()}catch(c){w.warn("[useMapPopup] onUnmounted destroy manager error:",c)}r.divLayerManager=null,r.mapInstance=null,r.currentPopupData=null}),{showPointPopup:a,removePopup:l,isPopupVisible:s,getCurrentPopupData:u}}function tn(e){let t=null;const n=()=>o.isRef(e)?e.value:e,r=new Set,i=new Map,a=s=>{try{if(t=n(),!t)throw new Error("地图实例不可用");const{position:u,config:d={}}=s,c=`circleWave_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,f=new CircleWave(t,c),{color:h="#0a84ff",radius:p=100,duration:b=3e3,ttl:v=0}=d;return f.add(u,h,p,b),r.add(c),v>0&&i.set(c,setTimeout(()=>{i.delete(c),l(c)},v)),c}catch(u){throw w.error("添加波动效果失败:",u),u}},l=s=>{try{if(t||(t=n()),!t||!t.entities)return w.warn("地图实例或 entities 不可用"),r.delete(s),!1;const u=t.entities.getById(s);if(!u)return w.warn(`未找到要删除的波动实体, ID: ${s}`),r.delete(s),!1;t.entities.remove(u),r.delete(s);const d=i.get(s);return d&&(clearTimeout(d),i.delete(s)),!0}catch(u){return w.error(`删除波动效果失败, ID: ${s}:`,u),r.delete(s),!1}};return o.onUnmounted(()=>{i.forEach(s=>clearTimeout(s)),i.clear();for(const s of Array.from(r))try{l(s)}catch(u){w.warn(`[useMapCircleWave] onUnmounted removeWave error (${s}):`,u)}r.clear()}),{addWave:a,removeWave:l}}function ji(){return{layers:new Map}}function nn(e){return e.value?e.value:(w.warn("[useMapLayers] 地图未初始化"),null)}function rn(e,t,n){const r=e.layers.get(n);if(r){try{t.value&&t.value.imageryLayers.remove(r,!1)}catch(i){w.warn(`移除同名旧图层失败 (${n}):`,i)}e.layers.delete(n)}}function Yi(e,t,n){const r=nn(t);if(!r)throw new Error("地图未初始化,无法添加影像图层");const i=N();rn(e,t,n);const a=new i.ImageryLayer(new i.BMImageryProvider({mapId:n}));return r.imageryLayers.add(a),e.layers.set(n,a),a}function qi(e,t,n,r="wmts-layer"){const i=nn(t);if(!i)throw new Error("地图未初始化,无法添加 WMTS 图层");const a=N();rn(e,t,r);const l=new a.WebMapTileServiceImageryProvider({url:n,layer:r,style:"default",format:"image/png",tileMatrixSetID:"EPSG:3857"}),s=i.imageryLayers.add(new a.ImageryLayer(l,{maximumTerrainLevel:21}));return e.layers.set(r,s),s}function Ki(e,t){if(typeof t=="string"){const n=e.layers.get(t);return n?{layer:n,key:t}:(w.warn(`图层未找到: ${t}`),{layer:null,key:null})}return{layer:t,key:null}}function Xi(e,t,n){try{const{layer:r,key:i}=Ki(e,n);if(!r)return!1;if(t.value&&t.value.imageryLayers.remove(r,!1),i!==null)e.layers.delete(i);else for(const[a,l]of e.layers.entries())if(l===r){e.layers.delete(a);break}return!0}catch(r){return w.error("移除图层失败:",r),!1}}function Zi(e,t){const n=t.value;if(n)try{e.layers.forEach(r=>{n.imageryLayers.remove(r,!1)}),e.layers.clear()}catch(r){w.error("移除所有图层失败:",r)}}function an(e,t){if(typeof t=="string"){const n=e.layers.get(t);return n||(w.warn(`图层未找到: ${t}`),null)}return t}function Ji(e,t,n){try{const r=an(e,t);return r?(r.show=n,!0):!1}catch(r){return w.error("设置图层可见性失败:",r),!1}}function Qi(e,t,n){try{if(typeof n!="number"||Number.isNaN(n)||n<0||n>1)return w.warn("透明度必须在 0-1 之间"),!1;const r=an(e,t);return r?(r.alpha=n,!0):!1}catch(r){return w.error("设置图层透明度失败:",r),!1}}function ea(e){const t=[];return e.layers.forEach((n,r)=>{t.push({name:r,layer:n})}),t}function on(e){const t=ji();return o.onUnmounted(()=>{try{t.layers.clear()}catch(n){w.warn("[useMapLayers] onUnmounted cleanup error:",n)}}),{addImageryLayer:n=>Yi(t,e,n),addWmtsLayer:(n,r)=>qi(t,e,n,r),removeLayer:n=>Xi(t,e,n),removeAllLayers:()=>Zi(t,e),setLayerVisible:(n,r)=>Ji(t,n,r),setLayerOpacity:(n,r)=>Qi(t,n,r),getAllLayers:()=>ea(t)}}function ta(e){return{...wt,...e}}function na(e,t){const n=e.Material.fromType("ElevationContour"),r=n.uniforms;return r.width=t.width,r.spacing=t.spacing,r.color=e.Color.RED.clone(),n}function ln(e,t){const n=o.ref(!1),r=s=>{const u=e.value;if(u?.scene?.globe)if(s){const d=D();if(!d)return;u.scene.globe.material=na(d,ta(t))}else u.scene.globe.material=void 0};return{contourVisible:n,setContourVisible:s=>{n.value=!!s,r(n.value)},reapply:()=>{n.value&&r(!0)},remove:()=>{r(!1)}}}const ra=2e4;function ia(e,t={}){if(!Array.isArray(e)||e.length<2)throw new Error("轨迹至少需要2个点");const n=t.interval&&t.interval>0?t.interval:1;e.some(h=>typeof h.time=="number"&&Number.isFinite(h.time));const r=e.map((h,p)=>({...h,time:typeof h.time=="number"&&Number.isFinite(h.time)?h.time:p*n}));r.sort((h,p)=>h.time-p.time);const i=[];let a=-1/0;for(const h of r)h.time>a&&(i.push(h),a=h.time);if(i.length<2)throw new Error("轨迹时间戳无效,无法构成回放时间表");const l=i.map(h=>h.time),s=l[0],u=l[l.length-1]-s,d=t.duration&&t.duration>0?t.duration:u,c=t.maxPoints&&t.maxPoints>=2?Math.floor(t.maxPoints):ra;let f=i;if(i.length>c){const h=Math.ceil(i.length/c);f=i.filter((b,v)=>v%h===0);const p=i[i.length-1];f[f.length-1]!==p&&f.push(p)}return{points:i,times:l,displayPoints:f,duration:d,minTime:s}}function he(e,t){const{points:n,times:r,duration:i,minTime:a}=e,l=n.length;if(t<=r[0]){const m=n[0];return{lng:m.lng,lat:m.lat,altitude:m.altitude??0,index:0,progress:0}}if(t>=r[l-1]){const m=n[l-1];return{lng:m.lng,lat:m.lat,altitude:m.altitude??0,index:l-1,progress:1}}let s=0,u=l-1;for(;s<u;){const m=s+u+1>>1;r[m]<=t?s=m:u=m-1}const d=s,c=r[d+1]-r[d],f=c>0?(t-r[d])/c:0,h=n[d],p=n[d+1],b=h.altitude??0,v=p.altitude??0;return{lng:h.lng+(p.lng-h.lng)*f,lat:h.lat+(p.lat-h.lat)*f,altitude:b+(v-b)*f,index:d,progress:i>0?(t-a)/i:0}}function aa(e,t={}){const n=e.duration,r=!!t.loop;let i=0,a=Math.max(0,t.speed??1),l=t.autoPlay?"playing":"idle";const s={status:l,currentTime:0,duration:n,progress:0,pointCount:e.points.length},u=m=>Math.max(0,Math.min(n,m)),d=()=>{s.status=l,s.currentTime=u(i),s.duration=n,s.progress=n>0?s.currentTime/n:0,s.pointCount=e.points.length},c=()=>{n<=0||(l==="ended"&&(i=0),l="playing",d())},f=()=>{l==="playing"&&(l="paused"),d()},h=()=>{i=0,l="idle",d()},p=m=>{a=Math.max(0,m),d()},b=m=>{i=u(m),l==="ended"&&(l="paused"),d()},v=m=>{l!=="playing"||n<=0||(i+=m*a,i>=n&&(r?i=i%n:(i=n,l="ended")),d())};return d(),{state:s,play:c,pause:f,stop:h,setSpeed:p,jumpTo:b,tick:v}}function oa(e){const t=D();return!!(t&&t.SceneMode&&e?.scene?.mode===t.SceneMode.SCENE2D)}function Ye(e,t,n=1){return e.Color.fromCssColorString(t).withAlpha(n)}function la(e,t,n,r){const i=t.map(a=>e.Cartesian3.fromDegrees(a.lng,a.lat,a.altitude??0));return new e.Entity({polyline:{positions:i,width:n.lineWidth,material:Ye(e,n.lineColor,.9),clampToGround:r}})}function sa(e,t,n){return new e.Entity({polyline:{positions:[],width:t.lineWidth,material:Ye(e,t.markerColor,.9),clampToGround:n}})}function ca(e,t){if(!e?.billboard||!t.markerIcon||typeof Image>"u")return;const n=t.markerSize*2,r=new Image;r.onload=()=>{!e.billboard||!r.naturalWidth||!r.naturalHeight||(e.billboard.width=n,e.billboard.height=r.naturalHeight/r.naturalWidth*n)},r.src=t.markerIcon}function ua(e,t,n=!0){const r=new e.ConstantPositionProperty(e.Cartesian3.fromDegrees(0,0,0)),i=new e.Entity({position:r}),a=n?e.HeightReference.CLAMP_TO_GROUND:e.HeightReference.NONE;return t.markerIcon?i.billboard={image:t.markerIcon,width:t.markerSize*2,heightReference:a,verticalOrigin:e.VerticalOrigin.BOTTOM}:i.point={pixelSize:t.markerSize,color:Ye(e,t.markerColor,1),heightReference:a},ca(i,t),i}function da(e,t){return t.map(n=>e.Cartesian3.fromDegrees(n.lng,n.lat,n.altitude??0))}function qe(e){return{...yt,...e}}const fa=100,ha=.25;function sn(e,t,n){const r=o.ref({status:"idle",currentTime:0,duration:0,progress:0,pointCount:0}),i=qe(t);let a=null,l=null,s=i,u=null,d=null,c=null,f=null,h=null,p=0,b=0;const v=()=>{const T=e.value;return T&&T.entities?T:null},m=()=>{h!==null&&(cancelAnimationFrame(h),h=null)},C=()=>{const T=v();T&&(u&&T.entities.remove(u),d&&T.entities.remove(d),c&&T.entities.remove(c)),u=null,d=null,c=null,f=null},y=()=>{l&&(r.value={...l.state})},E=T=>{if(!f)return;const L=D();L&&f.setValue(L.Cartesian3.fromDegrees(T.lng,T.lat,T.altitude))},k=T=>{if(!d||!a||!l)return;const L=D();if(!L)return;const P=l.state.currentTime,W=s.trailTime>0?Math.max(0,P-s.trailTime):0,ie=he(a,a.minTime+W),ee=a.points.slice(ie.index,T.index+1),O=da(L,ee);O.push(L.Cartesian3.fromDegrees(T.lng,T.lat,T.altitude)),d.polyline&&(d.polyline.positions=O)},S=T=>{const L=e.value;if(!L?.camera)return;const P=D();P&&L.camera.setView({destination:P.Cartesian3.fromDegrees(T.lng,T.lat,s.followHeight),orientation:{heading:0,pitch:P.Math.toRadians(-90),roll:0}})},A=T=>{if(!l||!a||l.state.status!=="playing"){m();return}h=requestAnimationFrame(A);const L=Math.min(Math.max((T-p)/1e3,0),ha);p=T,l.tick(L);const P=he(a,a.minTime+l.state.currentTime);E(P),T-b>=fa&&(k(P),b=T),s.follow&&S(P),y()},V=()=>{h===null&&(p=performance.now(),b=0,h=requestAnimationFrame(A))},U=(T,L)=>{if(!a)return;const P=!oa(T);u=la(L,a.displayPoints,s,P),d=sa(L,s,P),c=ua(L,s,P),f=c.position??null,T.entities.add(u),T.entities.add(d),T.entities.add(c);const W=he(a,a.minTime+(l?l.state.currentTime:0));E(W),k(W)},z=(T,L)=>{const P=v(),W=D();if(!P||!W)return;Ue.loadScripts(["move-marker","bmgl-header"],n?.serverUrl,n?.libsUrl||be).catch(ee=>w.warn("[useMapTrajectory] 轨迹辅助库加载失败:",ee)),s=qe({...i,...L});let ie;try{ie=ia(T,s)}catch(ee){w.warn("[useMapTrajectory] 轨迹数据无效:",ee);return}m(),C(),a=ie,l=aa(a,s),U(P,W),y(),s.autoPlay&&M()},M=()=>{l&&(l.play(),y(),l.state.status==="playing"&&V())},I=()=>{l&&(l.pause(),m(),y())},F=()=>{if(m(),!l||!a)return;l.stop();const T=he(a,a.minTime);E(T),k(T),y()},_=T=>{l&&(l.setSpeed(T),y())},Y=T=>{if(!l||!a)return;l.jumpTo(T);const L=he(a,a.minTime+l.state.currentTime);E(L),k(L),y()},K=()=>{m(),C(),a=null,l=null,r.value={status:"idle",currentTime:0,duration:0,progress:0,pointCount:0}},pe=()=>{const T=v(),L=D();!T||!L||!a||!l||(C(),U(T,L))},me=()=>{m(),C()},X=()=>{m(),C(),a=null,l=null,r.value={status:"idle",currentTime:0,duration:0,progress:0,pointCount:0}};return o.onUnmounted(()=>{X()}),{state:r,load:z,play:M,pause:I,stop:F,setSpeed:_,jumpTo:Y,clear:K,reapply:pe,remove:me,destroy:X}}function ga(e){const t=D();return!!(t&&t.SceneMode&&e?.scene?.mode===t.SceneMode.SCENE2D)}function pa(e,t=30){let n=1/0,r=-1/0,i=1/0,a=-1/0;for(const u of e)u.lng<n&&(n=u.lng),u.lng>r&&(r=u.lng),u.lat<i&&(i=u.lat),u.lat>a&&(a=u.lat);const l=Math.max(r-n,a-i)||1,s=Math.max(t,l*4);return[{lng:Math.max(-180,n-s),lat:Math.max(-85,i-s)},{lng:Math.min(180,r+s),lat:Math.max(-85,i-s)},{lng:Math.min(180,r+s),lat:Math.min(85,a+s)},{lng:Math.max(-180,n-s),lat:Math.min(85,a+s)}]}function cn(e,t,n=1){return e.Color.fromCssColorString(t).withAlpha(n)}function Ke(e,t){return t.map(n=>e.Cartesian3.fromDegrees(n.lng,n.lat,n.altitude??0))}function ma(e,t,n,r,i){const a={hierarchy:{positions:Ke(e,t),holes:[{positions:Ke(e,n)}]},material:cn(e,r.fillColor,r.fillAlpha)};return i||(a.height=0),new e.Entity({polygon:a})}function wa(e,t,n,r){return new e.Entity({polyline:{positions:Ke(e,t),width:n.outlineWidth,material:new e.PolylineGlowMaterialProperty({glowPower:.4,color:cn(e,n.outlineColor,n.outlineAlpha)}),clampToGround:r}})}function xe(e){return{...vt,...e}}function un(e,t){const n=o.ref({visible:!1,hasMask:!1,boundaryCount:0});let r=xe(t),i=null,a=null,l=null,s=null;const u=()=>{const y=e.value;return y&&y.entities?y:null},d=()=>{const y=u();y&&(a&&y.entities.remove(a),l&&y.entities.remove(l)),a=null,l=null},c=(y,E)=>{if(!i)return;const k=!ga(y),S=r.outerRing??pa(i);a=ma(E,S,i,r,k),l=r.showOutline?wa(E,i,r,k):null,y.entities.add(a),l&&y.entities.add(l)},f=()=>{const y=u(),E=D();!y||!E||!i||(d(),c(y,E))},h=()=>{const y=e.value?.scene;if(s||!y?.morphComplete)return;const E=()=>f();y.morphComplete.addEventListener(E),s=()=>y.morphComplete.removeEventListener(E)},p=(y,E)=>{const k=u(),S=D();!k||!S||!y||!y.length||(r=xe({...t,...E}),i=y,d(),c(k,S),n.value={visible:!0,hasMask:!0,boundaryCount:y.length},h())},b=y=>{a&&(a.show=!!y),l&&(l.show=!!y),n.value={...n.value,visible:!!y}},v=()=>{d()},m=()=>{s&&(s(),s=null),d(),i=null,r=xe(t),n.value={visible:!1,hasMask:!1,boundaryCount:0}},C=()=>{m()};return o.onUnmounted(()=>{C()}),{state:n,setMask:p,setVisible:b,clear:m,reapply:f,remove:v,destroy:C}}function ya(e=.5){return`
18
+ </div>`}function je(e){return typeof e=="number"&&!Number.isNaN(e)}function $i(e,t){return t&&(e.mapInstance=o.isRef(t)?t.value:t),!!e.mapInstance}async function Wi(e,t,n){if($i(e,t),!e.divLayerManager&&e.mapInstance){const r=D();if(!r)return null;e.divLayerManager=new r.div.DivLayerManager(e.mapInstance,{click:(i,a)=>{n&&n({position:a,detail:i})}})}return e.divLayerManager}function Hi(e){const t=D();if(!t)throw new Error("BMGL 库未加载,无法转换弹窗坐标");return t.Cartesian3.fromDegrees(e.lng,e.lat,e.altitude||0)}function en(e,t,n){const r=_i();r.displayConfig=n?.displayConfig||null;const i=()=>{if(r.popupLayer&&r.divLayerManager){try{r.divLayerManager.removeLayer(r.popupLayer)}catch(d){w.warn("移除弹窗时发生错误:",d)}r.popupLayer=null}r.currentPopupData=null},a=async(d,c={})=>{try{if(!d)throw new Error("点位数据不能为空");const f=++r.popupSeq,h={lng:je(d.lng)?d.lng:te.lng,lat:je(d.lat)?d.lat:te.lat,altitude:je(d.altitude)?d.altitude:0};i();const p=await Wi(r,e,t);if(!p)throw new Error("DivLayerManager 初始化失败");if(f!==r.popupSeq)return;r.currentPopupData={...d};const b={offsetX:0,offsetY:-20,className:"map-point-popup",...c},v=D();if(!v)throw new Error("BMGL 库未加载,无法创建弹窗");const m=new v.div.DivLayer(Ui(d,r.displayConfig||void 0),Hi(h),{offset:{x:b.offsetX,y:b.offsetY}});r.popupLayer=m,p.addLayer(m)}catch(f){w.error("显示点位弹窗失败:",f),i()}},l=()=>{i()},s=()=>r.popupLayer!==null,u=()=>r.currentPopupData;return o.onUnmounted(()=>{try{l()}catch(c){w.warn("[useMapPopup] onUnmounted removePopup error:",c)}const d=r.divLayerManager;if(d&&typeof d.destroy=="function")try{d.destroy()}catch(c){w.warn("[useMapPopup] onUnmounted destroy manager error:",c)}r.divLayerManager=null,r.mapInstance=null,r.currentPopupData=null}),{showPointPopup:a,removePopup:l,isPopupVisible:s,getCurrentPopupData:u}}function tn(e){let t=null;const n=()=>o.isRef(e)?e.value:e,r=new Set,i=new Map,a=s=>{try{if(t=n(),!t)throw new Error("地图实例不可用");const{position:u,config:d={}}=s,c=`circleWave_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,f=new CircleWave(t,c),{color:h="#0a84ff",radius:p=100,duration:b=3e3,ttl:v=0}=d;return f.add(u,h,p,b),r.add(c),v>0&&i.set(c,setTimeout(()=>{i.delete(c),l(c)},v)),c}catch(u){throw w.error("添加波动效果失败:",u),u}},l=s=>{try{if(t||(t=n()),!t||!t.entities)return w.warn("地图实例或 entities 不可用"),r.delete(s),!1;const u=t.entities.getById(s);if(!u)return w.warn(`未找到要删除的波动实体, ID: ${s}`),r.delete(s),!1;t.entities.remove(u),r.delete(s);const d=i.get(s);return d&&(clearTimeout(d),i.delete(s)),!0}catch(u){return w.error(`删除波动效果失败, ID: ${s}:`,u),r.delete(s),!1}};return o.onUnmounted(()=>{i.forEach(s=>clearTimeout(s)),i.clear();for(const s of Array.from(r))try{l(s)}catch(u){w.warn(`[useMapCircleWave] onUnmounted removeWave error (${s}):`,u)}r.clear()}),{addWave:a,removeWave:l}}function ji(){return{layers:new Map}}function nn(e){return e.value?e.value:(w.warn("[useMapLayers] 地图未初始化"),null)}function rn(e,t,n){const r=e.layers.get(n);if(r){try{t.value&&t.value.imageryLayers.remove(r,!1)}catch(i){w.warn(`移除同名旧图层失败 (${n}):`,i)}e.layers.delete(n)}}function Yi(e,t,n){const r=nn(t);if(!r)throw new Error("地图未初始化,无法添加影像图层");const i=N();rn(e,t,n);const a=new i.ImageryLayer(new i.BMImageryProvider({mapId:n}));return r.imageryLayers.add(a),e.layers.set(n,a),a}function qi(e,t,n,r="wmts-layer"){const i=nn(t);if(!i)throw new Error("地图未初始化,无法添加 WMTS 图层");const a=N();rn(e,t,r);const l=new a.WebMapTileServiceImageryProvider({url:n,layer:r,style:"default",format:"image/png",tileMatrixSetID:"EPSG:3857"}),s=i.imageryLayers.add(new a.ImageryLayer(l,{maximumTerrainLevel:21}));return e.layers.set(r,s),s}function Ki(e,t){if(typeof t=="string"){const n=e.layers.get(t);return n?{layer:n,key:t}:(w.warn(`图层未找到: ${t}`),{layer:null,key:null})}return{layer:t,key:null}}function Xi(e,t,n){try{const{layer:r,key:i}=Ki(e,n);if(!r)return!1;if(t.value&&t.value.imageryLayers.remove(r,!1),i!==null)e.layers.delete(i);else for(const[a,l]of e.layers.entries())if(l===r){e.layers.delete(a);break}return!0}catch(r){return w.error("移除图层失败:",r),!1}}function Zi(e,t){const n=t.value;if(n)try{e.layers.forEach(r=>{n.imageryLayers.remove(r,!1)}),e.layers.clear()}catch(r){w.error("移除所有图层失败:",r)}}function an(e,t){if(typeof t=="string"){const n=e.layers.get(t);return n||(w.warn(`图层未找到: ${t}`),null)}return t}function Ji(e,t,n){try{const r=an(e,t);return r?(r.show=n,!0):!1}catch(r){return w.error("设置图层可见性失败:",r),!1}}function Qi(e,t,n){try{if(typeof n!="number"||Number.isNaN(n)||n<0||n>1)return w.warn("透明度必须在 0-1 之间"),!1;const r=an(e,t);return r?(r.alpha=n,!0):!1}catch(r){return w.error("设置图层透明度失败:",r),!1}}function ea(e){const t=[];return e.layers.forEach((n,r)=>{t.push({name:r,layer:n})}),t}function on(e){const t=ji();return o.onUnmounted(()=>{try{t.layers.clear()}catch(n){w.warn("[useMapLayers] onUnmounted cleanup error:",n)}}),{addImageryLayer:n=>Yi(t,e,n),addWmtsLayer:(n,r)=>qi(t,e,n,r),removeLayer:n=>Xi(t,e,n),removeAllLayers:()=>Zi(t,e),setLayerVisible:(n,r)=>Ji(t,n,r),setLayerOpacity:(n,r)=>Qi(t,n,r),getAllLayers:()=>ea(t)}}function ta(e){return{...wt,...e}}function na(e,t){const n=e.Material.fromType("ElevationContour"),r=n.uniforms;return r.width=t.width,r.spacing=t.spacing,r.color=e.Color.RED.clone(),n}function ln(e,t){const n=o.ref(!1),r=s=>{const u=e.value;if(u?.scene?.globe)if(s){const d=D();if(!d)return;u.scene.globe.material=na(d,ta(t))}else u.scene.globe.material=void 0};return{contourVisible:n,setContourVisible:s=>{n.value=!!s,r(n.value)},reapply:()=>{n.value&&r(!0)},remove:()=>{r(!1)}}}const ra=2e4;function ia(e,t={}){if(!Array.isArray(e)||e.length<2)throw new Error("轨迹至少需要2个点");const n=t.interval&&t.interval>0?t.interval:1;e.some(h=>typeof h.time=="number"&&Number.isFinite(h.time));const r=e.map((h,p)=>({...h,time:typeof h.time=="number"&&Number.isFinite(h.time)?h.time:p*n}));r.sort((h,p)=>h.time-p.time);const i=[];let a=-1/0;for(const h of r)h.time>a&&(i.push(h),a=h.time);if(i.length<2)throw new Error("轨迹时间戳无效,无法构成回放时间表");const l=i.map(h=>h.time),s=l[0],u=l[l.length-1]-s,d=t.duration&&t.duration>0?t.duration:u,c=t.maxPoints&&t.maxPoints>=2?Math.floor(t.maxPoints):ra;let f=i;if(i.length>c){const h=Math.ceil(i.length/c);f=i.filter((b,v)=>v%h===0);const p=i[i.length-1];f[f.length-1]!==p&&f.push(p)}return{points:i,times:l,displayPoints:f,duration:d,minTime:s}}function he(e,t){const{points:n,times:r,duration:i,minTime:a}=e,l=n.length;if(t<=r[0]){const m=n[0];return{lng:m.lng,lat:m.lat,altitude:m.altitude??0,index:0,progress:0}}if(t>=r[l-1]){const m=n[l-1];return{lng:m.lng,lat:m.lat,altitude:m.altitude??0,index:l-1,progress:1}}let s=0,u=l-1;for(;s<u;){const m=s+u+1>>1;r[m]<=t?s=m:u=m-1}const d=s,c=r[d+1]-r[d],f=c>0?(t-r[d])/c:0,h=n[d],p=n[d+1],b=h.altitude??0,v=p.altitude??0;return{lng:h.lng+(p.lng-h.lng)*f,lat:h.lat+(p.lat-h.lat)*f,altitude:b+(v-b)*f,index:d,progress:i>0?(t-a)/i:0}}function aa(e,t={}){const n=e.duration,r=!!t.loop;let i=0,a=Math.max(0,t.speed??1),l=t.autoPlay?"playing":"idle";const s={status:l,currentTime:0,duration:n,progress:0,pointCount:e.points.length},u=m=>Math.max(0,Math.min(n,m)),d=()=>{s.status=l,s.currentTime=u(i),s.duration=n,s.progress=n>0?s.currentTime/n:0,s.pointCount=e.points.length},c=()=>{n<=0||(l==="ended"&&(i=0),l="playing",d())},f=()=>{l==="playing"&&(l="paused"),d()},h=()=>{i=0,l="idle",d()},p=m=>{a=Math.max(0,m),d()},b=m=>{i=u(m),l==="ended"&&(l="paused"),d()},v=m=>{l!=="playing"||n<=0||(i+=m*a,i>=n&&(r?i=i%n:(i=n,l="ended")),d())};return d(),{state:s,play:c,pause:f,stop:h,setSpeed:p,jumpTo:b,tick:v}}function oa(e){const t=D();return!!(t&&t.SceneMode&&e?.scene?.mode===t.SceneMode.SCENE2D)}function Ye(e,t,n=1){return e.Color.fromCssColorString(t).withAlpha(n)}function la(e,t,n,r){const i=t.map(a=>e.Cartesian3.fromDegrees(a.lng,a.lat,a.altitude??0));return new e.Entity({polyline:{positions:i,width:n.lineWidth,material:Ye(e,n.lineColor,.9),clampToGround:r}})}function sa(e,t,n){return new e.Entity({polyline:{positions:[],width:t.lineWidth,material:Ye(e,t.markerColor,.9),clampToGround:n}})}function ca(e,t){if(!e?.billboard||!t.markerIcon||typeof Image>"u")return;const n=t.markerSize*2,r=new Image;r.onload=()=>{!e.billboard||!r.naturalWidth||!r.naturalHeight||(e.billboard.width=n,e.billboard.height=r.naturalHeight/r.naturalWidth*n)},r.src=t.markerIcon}function ua(e,t,n=!0){const r=new e.ConstantPositionProperty(e.Cartesian3.fromDegrees(0,0,0)),i=new e.Entity({position:r}),a=n?e.HeightReference.CLAMP_TO_GROUND:e.HeightReference.NONE;return t.markerIcon?i.billboard={image:t.markerIcon,width:t.markerSize*2,heightReference:a,verticalOrigin:e.VerticalOrigin.BOTTOM}:i.point={pixelSize:t.markerSize,color:Ye(e,t.markerColor,1),heightReference:a},ca(i,t),i}function da(e,t){return t.map(n=>e.Cartesian3.fromDegrees(n.lng,n.lat,n.altitude??0))}function qe(e){return{...yt,...e}}const fa=100,ha=.25;function sn(e,t,n){const r=o.ref({status:"idle",currentTime:0,duration:0,progress:0,pointCount:0}),i=qe(t);let a=null,l=null,s=i,u=null,d=null,c=null,f=null,h=null,p=0,b=0;const v=()=>{const T=e.value;return T&&T.entities?T:null},m=()=>{h!==null&&(cancelAnimationFrame(h),h=null)},C=()=>{const T=v();T&&(u&&T.entities.remove(u),d&&T.entities.remove(d),c&&T.entities.remove(c)),u=null,d=null,c=null,f=null},y=()=>{l&&(r.value={...l.state})},E=T=>{if(!f)return;const L=D();L&&f.setValue(L.Cartesian3.fromDegrees(T.lng,T.lat,T.altitude))},_=T=>{if(!d||!a||!l)return;const L=D();if(!L)return;const P=l.state.currentTime,W=s.trailTime>0?Math.max(0,P-s.trailTime):0,ie=he(a,a.minTime+W),ee=a.points.slice(ie.index,T.index+1),O=da(L,ee);O.push(L.Cartesian3.fromDegrees(T.lng,T.lat,T.altitude)),d.polyline&&(d.polyline.positions=O)},S=T=>{const L=e.value;if(!L?.camera)return;const P=D();P&&L.camera.setView({destination:P.Cartesian3.fromDegrees(T.lng,T.lat,s.followHeight),orientation:{heading:0,pitch:P.Math.toRadians(-90),roll:0}})},A=T=>{if(!l||!a||l.state.status!=="playing"){m();return}h=requestAnimationFrame(A);const L=Math.min(Math.max((T-p)/1e3,0),ha);p=T,l.tick(L);const P=he(a,a.minTime+l.state.currentTime);E(P),T-b>=fa&&(_(P),b=T),s.follow&&S(P),y()},V=()=>{h===null&&(p=performance.now(),b=0,h=requestAnimationFrame(A))},U=(T,L)=>{if(!a)return;const P=!oa(T);u=la(L,a.displayPoints,s,P),d=sa(L,s,P),c=ua(L,s,P),f=c.position??null,T.entities.add(u),T.entities.add(d),T.entities.add(c);const W=he(a,a.minTime+(l?l.state.currentTime:0));E(W),_(W)},z=(T,L)=>{const P=v(),W=D();if(!P||!W)return;Ue.loadScripts(["move-marker","bmgl-header"],n?.serverUrl,n?.libsUrl||be).catch(ee=>w.warn("[useMapTrajectory] 轨迹辅助库加载失败:",ee)),s=qe({...i,...L});let ie;try{ie=ia(T,s)}catch(ee){w.warn("[useMapTrajectory] 轨迹数据无效:",ee);return}m(),C(),a=ie,l=aa(a,s),U(P,W),y(),s.autoPlay&&M()},M=()=>{l&&(l.play(),y(),l.state.status==="playing"&&V())},I=()=>{l&&(l.pause(),m(),y())},F=()=>{if(m(),!l||!a)return;l.stop();const T=he(a,a.minTime);E(T),_(T),y()},k=T=>{l&&(l.setSpeed(T),y())},Y=T=>{if(!l||!a)return;l.jumpTo(T);const L=he(a,a.minTime+l.state.currentTime);E(L),_(L),y()},K=()=>{m(),C(),a=null,l=null,r.value={status:"idle",currentTime:0,duration:0,progress:0,pointCount:0}},pe=()=>{const T=v(),L=D();!T||!L||!a||!l||(C(),U(T,L))},me=()=>{m(),C()},X=()=>{m(),C(),a=null,l=null,r.value={status:"idle",currentTime:0,duration:0,progress:0,pointCount:0}};return o.onUnmounted(()=>{X()}),{state:r,load:z,play:M,pause:I,stop:F,setSpeed:k,jumpTo:Y,clear:K,reapply:pe,remove:me,destroy:X}}function ga(e){const t=D();return!!(t&&t.SceneMode&&e?.scene?.mode===t.SceneMode.SCENE2D)}function pa(e,t=30){let n=1/0,r=-1/0,i=1/0,a=-1/0;for(const u of e)u.lng<n&&(n=u.lng),u.lng>r&&(r=u.lng),u.lat<i&&(i=u.lat),u.lat>a&&(a=u.lat);const l=Math.max(r-n,a-i)||1,s=Math.max(t,l*4);return[{lng:Math.max(-180,n-s),lat:Math.max(-85,i-s)},{lng:Math.min(180,r+s),lat:Math.max(-85,i-s)},{lng:Math.min(180,r+s),lat:Math.min(85,a+s)},{lng:Math.max(-180,n-s),lat:Math.min(85,a+s)}]}function cn(e,t,n=1){return e.Color.fromCssColorString(t).withAlpha(n)}function Ke(e,t){return t.map(n=>e.Cartesian3.fromDegrees(n.lng,n.lat,n.altitude??0))}function ma(e,t,n,r,i){const a={hierarchy:{positions:Ke(e,t),holes:[{positions:Ke(e,n)}]},material:cn(e,r.fillColor,r.fillAlpha)};return i||(a.height=0),new e.Entity({polygon:a})}function wa(e,t,n,r){return new e.Entity({polyline:{positions:Ke(e,t),width:n.outlineWidth,material:new e.PolylineGlowMaterialProperty({glowPower:.4,color:cn(e,n.outlineColor,n.outlineAlpha)}),clampToGround:r}})}function xe(e){return{...vt,...e}}function un(e,t){const n=o.ref({visible:!1,hasMask:!1,boundaryCount:0});let r=xe(t),i=null,a=null,l=null,s=null;const u=()=>{const y=e.value;return y&&y.entities?y:null},d=()=>{const y=u();y&&(a&&y.entities.remove(a),l&&y.entities.remove(l)),a=null,l=null},c=(y,E)=>{if(!i)return;const _=!ga(y),S=r.outerRing??pa(i);a=ma(E,S,i,r,_),l=r.showOutline?wa(E,i,r,_):null,y.entities.add(a),l&&y.entities.add(l)},f=()=>{const y=u(),E=D();!y||!E||!i||(d(),c(y,E))},h=()=>{const y=e.value?.scene;if(s||!y?.morphComplete)return;const E=()=>f();y.morphComplete.addEventListener(E),s=()=>y.morphComplete.removeEventListener(E)},p=(y,E)=>{const _=u(),S=D();!_||!S||!y||!y.length||(r=xe({...t,...E}),i=y,d(),c(_,S),n.value={visible:!0,hasMask:!0,boundaryCount:y.length},h())},b=y=>{a&&(a.show=!!y),l&&(l.show=!!y),n.value={...n.value,visible:!!y}},v=()=>{d()},m=()=>{s&&(s(),s=null),d(),i=null,r=xe(t),n.value={visible:!1,hasMask:!1,boundaryCount:0}},C=()=>{m()};return o.onUnmounted(()=>{C()}),{state:n,setMask:p,setVisible:b,clear:m,reapply:f,remove:v,destroy:C}}function ya(e=.5){return`
19
19
  uniform sampler2D colorTexture;
20
20
  varying vec2 v_textureCoordinates;
21
21
 
@@ -73,35 +73,35 @@ void main(void){
73
73
 
74
74
  gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), ${e});
75
75
  }
76
- `}const dn={rain:.5,snow:.3};function fn(e,t){const n=o.ref({type:"clear",active:!1});let r=null;const i=()=>{const u=e.value;r&&u?.scene?.postProcessStages&&(u.scene.postProcessStages.remove(r),r=null)},a=(u,d)=>{const c=e.value,f=D();if(!c?.scene?.postProcessStages||!f)return;if(i(),u==="clear"||!dn[u]){n.value={type:"clear",active:!1};return}const h=d?.opacity??t?.opacity??dn[u],p=u==="rain"?ya(h):va(h);r=new f.PostProcessStage({name:`weather_${u}`,fragmentShader:p}),c.scene.postProcessStages.add(r),n.value={type:u,active:!0}},l=()=>{i(),r=null,n.value={type:"clear",active:!1}},s=()=>{l()};return o.onUnmounted(()=>{s()}),{state:n,setWeather:a,clear:l,destroy:s}}const Ca=6,ba=18,Ea=20;function Ta(e){return{day:e?.dayStartHour??Ca,dusk:e?.duskStartHour??ba,night:e?.nightStartHour??Ea}}function Sa(e,t){const{day:n,dusk:r,night:i}=Ta(t);return e>=n&&e<r?"day":e>=r&&e<i?"dusk":"night"}const Xe={x:.5781,y:-.5781,z:.5758};function Da(e,t){if(e==="day")return new t.SunLight;const n=e==="night";return new t.DirectionalLight({direction:new t.Cartesian3(Xe.x,Xe.y,Xe.z),color:n?new t.Color(.9,.925,1):t.Color.fromCssColorString("#deca7c"),intensity:n?.5:1})}function hn(e,t,n){const r=n?.is3D??o.ref(!0),i=o.ref(null),a=o.ref({enabled:!!t?.enabled,mode:"auto",period:"night",hour:0});let l,s,u;const d=()=>{const m=t?.now?.()??new Date;a.value.hour=m.getHours(),a.value.mode=i.value?"manual":"auto",a.value.period=i.value??Sa(a.value.hour,t)},c=()=>{const m=e.value;if(!m?.scene){u=void 0;return}const C=m.scene;(u!==void 0||l!==void 0)&&(C.light=l,s!==void 0&&(C.globe.enableLighting=s)),u=void 0},f=()=>{const m=e.value,C=D();if(!m?.scene||!C)return;const y=m.scene;s===void 0&&(l=y.light,s=!!y.globe.enableLighting),y.globe.enableLighting=!0;const E=Da(a.value.period,C);y.light=E,u=E},h=()=>{d(),a.value.enabled&&r.value?f():c()},p=m=>{a.value.enabled=!!m,h()},b=m=>{i.value=m==="auto"?null:m,h()},v=()=>{a.value.enabled=!1,c()};return o.onUnmounted(()=>v()),d(),{state:a,setEnabled:p,setPeriod:b,apply:h,destroy:v}}function gn(e,t){const n=e.layer||"PostGIS:dommap";return`${e.baseUrl.replace(/\/$/,"")}?layer=${n}&geo-token=${t}&style=&tilematrixset=EPSG%3A3857&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fvnd.jpeg-png&TileMatrix=EPSG%3A3857%3A{TileMatrix}&TileCol={TileCol}&TileRow={TileRow}`}function pn(e){return async()=>{const t=e.token;if(!t)throw new Error("未提供 GeoServer 令牌(geoserver.token),无法拼接 WMTS 地址");return gn(e,t)}}function Ma(){return{mapType:o.ref("3d"),mapBase:o.ref("bigemap"),currentDrawType:o.ref(null),loadingTitle:o.ref("地图加载中"),loadingSubtitle:o.ref("正在初始化地理数据..."),theme:o.ref("dark"),mapNameVisible:o.ref(!1)}}function Le(e){return typeof e=="number"&&!Number.isNaN(e)}function Ia(e){const t=o.ref(""),n=o.ref([]),r=o.ref(!1),i=o.ref(!1),a=o.ref(!1),l=o.ref(-1),s=o.ref(-1);let u,d,c=0;const f=o.computed(()=>t.value.trim()?n.value:[]),h=async S=>{const A=++c;try{const V=await e.searchByText({field:["name"],keyword:S,limit:10,caseSensitive:!1});if(A!==c)return;n.value=V||[],a.value=!1}catch(V){if(A!==c)return;w.error("搜索查询失败:",V),n.value=[],a.value=!0}finally{A===c&&(i.value=!1)}},p=S=>{if(t.value=S,u&&clearTimeout(u),!S.trim()){n.value=[],r.value=!1,a.value=!1;return}i.value=!0,r.value=!0,u=setTimeout(()=>{h(S.trim())},e.debounceTime)},b=S=>Le(S.altitude)?S.altitude+tr:e.position?.height??te.height,v=S=>{if(!Le(S.lng)||!Le(S.lat))return;e.setView(S.lng,S.lat,b(S));const A=e.addWave({position:[S.lng,S.lat,Le(S.altitude)?S.altitude:0],config:{color:"#0a84ff",radius:er,duration:Te.WAVE}});d&&clearTimeout(d),d=setTimeout(()=>e.removeWave(A),Et)},m=(S,A)=>{s.value=A,v(S),r.value=!1},C=S=>{const A=f.value.length;A!==0&&(l.value=(l.value+S+A)%A)},y=()=>{const S=l.value,A=f.value[S];A&&m(A,S)},E=()=>{r.value=!1},k=()=>{t.value="",n.value=[],r.value=!1,a.value=!1,s.value=-1,l.value=-1};return o.onUnmounted(()=>{u&&clearTimeout(u),d&&clearTimeout(d)}),{searchInput:t,searchList:n,showResults:r,isSearching:i,searchError:a,highlightIndex:l,selectedIndex:s,filteredList:f,handleInputSearch:p,handleResultClick:m,moveHighlight:C,selectHighlighted:y,closeResults:E,clearSearch:k}}function Aa(e){e.toggleMapTypeCore();const n=(e.mapType.value==="3d"?"2d":"3d")==="3d"?Qn:Jn;setTimeout(()=>e.redrawAllEntities(),n)}function xa(e){e.position&&e.setView(e.position.lng,e.position.lat,e.position.height)}async function Ze(e){e.loadingSubtitle.value="正在添加卫星影像图层...",await e.addImageryLayer("bigemap.dc-satellite"),e.loadingSubtitle.value="正在添加街道地名图层...",await e.addImageryLayer("bigemap.dc-street")}async function mn(e){if(!e.wmtsUrlProvider)throw new Error("未配置 wmtsUrlProvider,无法切换到生产底图");const t=await e.wmtsUrlProvider();if(!t)throw new Error("wmtsUrlProvider 未返回有效地址,无法切换到生产底图");await e.addWmtsLayer(t,"geoserver")}async function La(e){if(!e.map.value)return;const t=e.mapBase.value,n=t==="bigemap"?"geoserver":"bigemap";e.loadingSubtitle.value="正在切换地图底图...";try{await e.removeAllLayers(),n==="bigemap"?await Ze(e):await mn(e),e.mapBase.value=n}catch(r){w.error("切换地图底图失败:",r);try{await e.removeAllLayers(),t==="bigemap"?await Ze(e):await mn(e)}catch(i){w.error("恢复原底图失败:",i)}}finally{e.loadingSubtitle.value="正在初始化地理数据..."}}async function Na(e){if(e.map.value)try{await Ze(e)}catch(t){w.error("加载默认图层失败:",t)}}function _a(e){return t=>{if(e.getIsDrawing()||!e.map.value||!t.position)return;e.removePopup();const n=e.map.value.scene.pick(t.position);if(n&&n.primitive&&n.primitive.pointData){const r=n.primitive.pointData;e.onPointClick(r),e.showPointPopup(wn(r),{offsetX:0,offsetY:-25})}}}function ka(e,t){const n=document.querySelector(".map-point-popup");if(!n)return!1;const r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,l=r.top+e.y;return a>=i.left-8&&a<=i.right+8&&l>=i.top-8&&l<=i.bottom+8}function Va(e){let t=null;const n=r=>r?.id??r?.pointNo??r?.name??"";return r=>{if(e.getIsDrawing()||!e.map.value||!r.endPosition)return;const i=e.map.value.scene.canvas,a=e.map.value.scene.pick(r.endPosition);if(a&&a.primitive&&a.primitive.pointData){const l=a.primitive.pointData,s=n(l);s!==t&&(t=s,e.showPointPopup(wn(l),{offsetX:0,offsetY:-25}))}else ka(r.endPosition,i)||(t=null,e.removePopup())}}function wn(e){return{...e}}function Pa(e){if(!e.map.value)return null;const t=N(),n=new t.ScreenSpaceEventHandler(e.map.value.scene.canvas);return n.setInputAction(_a(e),t.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(Va(e),t.ScreenSpaceEventType.MOUSE_MOVE),n}function yn(e){if(e&&typeof e.destroy=="function")try{e.destroy()}catch(t){w.warn("[useMapView] destroy click listener error:",t)}}const vn=["containerId","position","serverUrl","libsUrl","showSearch","showControls","showDeleteControls","showStatus","tools","searchDebounceTime","wmtsUrlProvider","geoserver","contourConfig","lightingConfig"],Ba={containerId:String,position:Object,serverUrl:String,libsUrl:String,showSearch:Boolean,showControls:Boolean,showDeleteControls:Boolean,showStatus:Boolean,tools:Array,searchDebounceTime:Number,wmtsUrlProvider:Function,geoserver:Object,contourConfig:Object,lightingConfig:Boolean};function Ra(e,t){const n=e??{},r={};for(const i of vn)r[i]=n[i];return{...r,theme:t.theme,popupConfig:t.popupConfig}}function Cn(e,t){const n=Ma(),r=o.computed(()=>!!e.showSearch),i=o.computed(()=>e.showControls!==!1),a=o.computed(()=>e.showDeleteControls!==!1),l=o.computed(()=>!!e.showStatus),s=e.wmtsUrlProvider??(e.geoserver?pn(e.geoserver):void 0),u=o.computed(()=>!!s),d=o.computed(()=>({containerId:e.containerId,position:e.position||te,serverUrl:e.serverUrl,libsUrl:e.libsUrl})),{map:c,state:f,initMap:h,setView:p,toggleMapType:b}=Pt(d.value),{loadPoints:v,searchByText:m,updatePoints:C,clearPoints:y,searchByShape:E}=Ut(c),{drawEntity:k,deleteEntity:S,redrawAllEntities:A}=Yt(c),{startDrawing:V,cancelDrawing:U,clearAllDrawings:z,removeDrawing:M,setCallback:I,getIsDrawing:F}=Jt(c),{showPointPopup:_,removePopup:Y}=en(c,void 0,{displayConfig:e.popupConfig}),{addWave:K,removeWave:pe}=tn(c),{addWmtsLayer:me,addImageryLayer:X,removeAllLayers:T,setLayerVisible:L}=on(c),{contourVisible:P,setContourVisible:W,reapply:ie,remove:ee}=ln(c,e.contourConfig),O=sn(c,void 0,{serverUrl:e.serverUrl,libsUrl:e.libsUrl}),we=un(c),_e=fn(c),ae=hn(c,{enabled:e.lightingConfig===!0},{is3D:o.computed(()=>f.value.mapType==="3d")});n.theme.value=e.theme||"dark";const uo=Ia({searchByText:m,setView:p,addWave:K,removeWave:pe,position:e.position,debounceTime:e.searchDebounceTime??ne.DEBOUNCE_DELAY});let ot=0;const lt=(x,ut)=>{ot+=1,n.loadingTitle.value=x,n.loadingSubtitle.value=ut,f.value.isLoading=!0},Wn=()=>{f.value.isLoading=!1},fo=(x,ut,Eo)=>{lt(x,ut);const To=ot;setTimeout(()=>{To===ot&&Wn()},Eo)},ho="bigemap.dc-street",st=()=>{L(ho,n.mapNameVisible.value)},Hn=x=>{n.mapNameVisible.value=!!x,st()},jn=x=>{n.theme.value=x},ke={map:c,mapType:n.mapType,mapBase:n.mapBase,loadingSubtitle:n.loadingSubtitle,position:e.position,wmtsUrlProvider:s,toggleMapTypeCore:b,redrawAllEntities:A,setView:p,removeAllLayers:T,addImageryLayer:X,addWmtsLayer:me},go={map:c,getIsDrawing:F,removePopup:Y,showPointPopup:_,onPointClick:t.onPointClick},po=()=>{z(),t.emit("clear-button-click"),t.emit("clear-draw")},mo=x=>{n.currentDrawType.value=x,V(x)},wo=()=>{n.currentDrawType.value=null},yo=()=>{I(x=>{wo(),x.operation==="draw"||x.operation==="edit"?t.emit("draw-end",x):x.operation==="delete"?t.emit("draw-delete",x):x.operation==="clear"&&t.emit("draw-clear",x)})};let ye;const vo=()=>{ye&&clearTimeout(ye),ye=setTimeout(()=>{f.value.isLoading=!1,t.emit("ready"),t.emit("init")},Ct)},Co=()=>{const x={map:c,state:f,setView:p,loadPoints:v,searchByText:m,searchByShape:E,updatePoints:C,clearPoints:y,startDrawing:V,stopDrawing:U,clearDrawings:z,removeDrawing:M,drawEntity:k,deleteEntity:S,setMapNameVisible:Hn,setContourVisible:W,trajectoryState:O.state,loadTrajectory:O.load,playTrajectory:O.play,pauseTrajectory:O.pause,stopTrajectory:O.stop,setTrajectorySpeed:O.setSpeed,jumpTrajectoryTo:O.jumpTo,clearTrajectory:O.clear,maskState:we.state,setMask:we.setMask,setMaskVisible:we.setVisible,clearMask:we.clear,weatherState:_e.state,setWeather:_e.setWeather,clearWeather:_e.clear,lightingState:ae.state,setLightingEnabled:ae.setEnabled,setLightingPeriod:ae.setPeriod,setTheme:jn};t.expose(x),t.emit("expose",x)};let Ve=null,ct=!1;o.onUnmounted(()=>{yn(Ve),Ve=null,ye&&clearTimeout(ye)});const bo=async()=>{try{lt("地图加载中","正在初始化地理数据..."),await h(),f.value.isLoading=!0,await Na(ke),st(),yn(Ve),Ve=Pa(go),yo(),ae.apply(),n.mapType.value=f.value.mapType,e.position&&await p(e.position.lng,e.position.lat,e.position.height),vo(),Co()}catch(x){throw f.value.isLoading=!1,f.value.error=x instanceof Error?x:new Error(String(x)),t.emit("error",x),x}};return{...n,state:f,map:c,showSearch:r,showControls:i,showDeleteControls:a,showStatus:l,wmtsEnabled:u,search:uo,onDelete:po,handleStartDrawing:mo,setMapNameVisible:Hn,setContourVisible:W,contourVisible:P,trajectoryState:O.state,maskState:we.state,weatherState:_e.state,lightingState:ae.state,setTheme:jn,toggleMapType:()=>{fo("视图切换中","正在切换 2D/3D 视图...",800),Aa(ke),n.mapType.value=f.value.mapType,f.value.mapType==="2d"?ee():ie(),O.reapply(),ae.apply()},resetView:()=>xa(ke),toggleMapBaseLayer:async()=>{if(!ct){ct=!0,lt("底图切换中","正在切换地图底图...");try{await La(ke),st()}finally{ct=!1,Wn()}}},init:bo}}const Je=o.defineComponent({name:"GameLoading",props:{visible:{type:Boolean,default:!1},title:{type:String,default:"地图加载中"},subtitle:{type:String,default:"正在初始化地理数据..."}},setup(e){return()=>e.visible?o.createVNode("div",{class:"apple-loading-overlay"},[o.createVNode("div",{class:"apple-loading-content"},[o.createVNode("div",{class:"apple-spinner",role:"status","aria-label":"加载中"},null),o.createVNode("h2",{class:"apple-loading-title"},[e.title]),o.createVNode("p",{class:"apple-loading-subtitle"},[e.subtitle])])]):null}}),Qe={"2d":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><!-- 2D 平面地图:2x2 坐标网格瓦片,表达俯视平面视角 -->
77
- <path fill="#000000" d="M4 3.5h6.7a.5.5 0 0 1 .5.5v6.7a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5zm9.3 0H20a.5.5 0 0 1 .5.5v6.7a.5.5 0 0 1-.5.5h-6.7a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5zM4 12.8h6.7a.5.5 0 0 1 .5.5V20a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5v-6.7a.5.5 0 0 1 .5-.5zm9.3 0H20a.5.5 0 0 1 .5.5V20a.5.5 0 0 1-.5.5h-6.7a.5.5 0 0 1-.5-.5v-6.7a.5.5 0 0 1 .5-.5z"/></svg>
78
- `,"3d":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><!-- 3D 立体:等轴测立方体(顶面 + 左右侧面),表达三维视角 -->
79
- <path fill="#000000" d="M12 2.6 20.6 7.1 12 11.6 3.4 7.1 12 2.6z"/>
80
- <path fill="#000000" d="M3.4 7.1v9.6L12 21.4v-9.8L3.4 7.1z"/>
81
- <path fill="#000000" d="M20.6 7.1v9.6L12 21.4v-9.8l8.6-4.5z"/></svg>
82
- `,area:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438544903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19690" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M921.6 905.6H64V118.4h300.8v-64H0v915.2h985.6v-288h-64v224z m-640-467.2v-44.8h-64v364.8h64v-156.8c0-48 0-83.2 9.6-102.4 9.6-19.2 25.6-35.2 38.4-48 19.2-9.6 38.4-12.8 57.6-12.8 19.2 0 35.2 3.2 48 12.8s19.2 25.6 25.6 38.4c3.2 12.8 3.2 41.6 3.2 83.2v188.8h57.6v-144c0-48 3.2-83.2 9.6-102.4 3.2-25.6 19.2-38.4 38.4-54.4 19.2-12.8 38.4-19.2 57.6-19.2 19.2 0 38.4 3.2 48 12.8 12.8 9.6 19.2 25.6 25.6 38.4 3.2 19.2 3.2 41.6 3.2 76.8v201.6h64v-201.6c0-67.2-12.8-115.2-38.4-140.8-25.6-25.6-54.4-38.4-86.4-38.4s-57.6 9.6-83.2 25.6-38.4 32-48 51.2c-3.2-19.2-19.2-35.2-38.4-48-25.6-12.8-48-25.6-76.8-25.6-57.6 0-92.8 6.4-115.2 44.8z m739.2-51.2v51.2h-214.4v-35.2c22.4-41.6 57.6-80 102.4-112 44.8-32 60.8-60.8 60.8-86.4 0-32-16-44.8-51.2-44.8-28.8 0-44.8 19.2-54.4 54.4L809.6 192c19.2-51.2 57.6-80 112-80 64 3.2 96 32 102.4 89.6 6.4 41.6-22.4 80-80 115.2-35.2 25.6-54.4 48-70.4 67.2 0 3.2 147.2 3.2 147.2 3.2z" p-id="19691" fill="#515151"></path></svg>',aim:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
83
- <circle cx="12" cy="12" r="9"></circle>
84
- <circle cx="12" cy="12" r="4.5"></circle>
85
- <circle cx="12" cy="12" r="0.6" fill="currentColor"></circle>
86
- </svg>
87
- `,azimuth:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438589408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24787" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M456 697.6c17.6-11.2 33.6-20.8 52.8-32l-38.4-52.8c-17.6 14.4-32 25.6-48 38.4 11.2 16 22.4 30.4 33.6 46.4z" fill="#515151" p-id="24788"></path><path d="M73.6 940.8C54.4 934.4 43.2 915.2 48 896L300.8 76.8c6.4-17.6 25.6-28.8 43.2-24 17.6 6.4 28.8 25.6 24 43.2L116.8 915.2c-4.8 20.8-24 32-43.2 25.6z" fill="#515151" p-id="24789"></path><path d="M48 908.8c0-19.2 16-36.8 35.2-36.8h856c19.2 0 35.2 16 35.2 35.2 0 19.2-16 35.2-35.2 35.2H83.2C64 944 48 928 48 908.8z" fill="#515151" p-id="24790"></path><path d="M292.8 550.4c-25.6-16-51.2-30.4-78.4-41.6l28.8-65.6c32 12.8 62.4 28.8 89.6 48l-40 59.2zM470.4 747.2c-30.4-60.8-72-113.6-123.2-156.8l46.4-54.4c59.2 49.6 105.6 110.4 140.8 179.2l-64 32zM518.4 896c-4.8-28.8-11.2-59.2-22.4-86.4l68.8-24c11.2 32 19.2 65.6 25.6 99.2l-72 11.2z" fill="#515151" p-id="24791"></path><path d="M688 456c40 0 72 32 72 72s-32 72-72 72-72-32-72-72 32-72 72-72m0-72c-80 0-144 64-144 144s64 144 144 144 144-64 144-144-64-144-144-144z" fill="#515151" p-id="24792"></path></svg>',base:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><!-- 底图图层:三层堆叠图例,表达地图图层切换 -->
88
- <path fill="#000000" d="M12 14.5 2.8 9.7 12 4.9l9.2 4.8L12 14.5z"/>
89
- <path fill="#000000" d="M2.8 11.2 12 16l9.2-4.8-1.6-.9L12 14.2 4.4 10.3l-1.6.9z"/>
90
- <path fill="#000000" d="M2.8 14.7 12 19.5l9.2-4.8-1.6-.9L12 17.7 4.4 13.8l-1.6.9z"/></svg>
91
- `,circle:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439464662" class="icon" viewBox="0 0 1152 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="33927" xmlns:xlink="http://www.w3.org/1999/xlink" width="225" height="200"><path d="M1056.810667 606.890667c-45.781333 172.373333-204.544 305.237333-402.176 334.592v59.264h-165.418667v-59.264c-197.632-29.354667-356.394667-162.261333-402.133333-334.592H16.554667v-165.418667h62.08c30.592-191.274667 198.101333-342.4 410.538666-374.016V8.277333h165.418667v59.221334c212.437333 31.573333 379.946667 182.741333 410.538667 374.016h62.08v165.418666h-70.442667v-0.042666z m-61.568 0h-33.450667v-165.418667h43.349333c-29.866667-158.037333-170.410667-284.202667-350.549333-314.24v46.464h-165.418667V127.146667c-180.053333 30.037333-320.554667 156.202667-350.506666 314.24h43.349333v165.418666h-33.408c44.074667 139.264 175.786667 247.338667 340.565333 274.773334v-46.293334h165.418667v46.378667c164.864-27.434667 296.576-135.509333 340.650667-274.816zM528.64 134.272h86.613333V47.616h-86.613333v86.613333z m0 827.050667h86.613333v-86.613334h-86.613333v86.613334z m-472.618667-393.813334h86.613334V480.853333h-86.613334v86.613334z m945.194667 0h86.656V480.853333h-86.613333v86.613334z" p-id="33928" fill="#515151"></path></svg>',clear:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766223878706" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7643" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M921.6 512 880.64 512 972.8 972.8C972.8 1001.088 949.888 1024 921.6 1024L102.4 1024C74.112 1024 51.2 1001.088 51.2 972.8L143.36 512 102.4 512C74.112 512 51.2 489.088 51.2 460.8L51.2 409.6C51.2 381.312 74.112 358.4 102.4 358.4L409.6 358.4 409.6 102.4C409.6 45.8496 455.4496 0 512 0 568.5504 0 614.4 45.8496 614.4 102.4L614.4 358.4 921.6 358.4C949.888 358.4 972.8 381.312 972.8 409.6L972.8 460.8C972.8 489.088 949.888 512 921.6 512ZM102.4 972.8 257.6384 972.8C254.1056 967.5008 252.4416 960.9472 253.6192 954.1888L284.7488 726.5024C287.2064 712.6016 300.4672 703.2832 314.3936 705.7408 328.32 708.1984 337.6128 721.4848 335.1808 735.4112L304.0512 963.072C303.4112 966.6816 302.0032 969.9328 300.1088 972.8L921.6 972.8 819.2 512 204.8 512 102.4 972.8ZM563.2 102.4C563.2 74.112 540.288 51.2 512 51.2 483.712 51.2 460.8 74.112 460.8 102.4L460.8 358.4 563.2 358.4 563.2 102.4ZM921.6 409.6 102.4 409.6 102.4 460.8 921.6 460.8 921.6 409.6Z" fill="#272636" p-id="7644"></path></svg>',contour:`<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#515151" stroke-width="72" stroke-linecap="round" stroke-linejoin="round"><path d="M180 292c56-72 128 88 186 14s128 88 186 14 128 88 186 14"/><path d="M104 500c74-96 148 132 222 36s148 132 222 36 148 132 222 36 148 132 222 36"/><path d="M40 720c112-128 224 176 336 48s224 176 336 48 224 176 336 48"/></g></svg>
92
- `,delete:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766223494940" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7307" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M635.712 78.72A127.808 127.808 0 0 0 569.472 54.72a633.792 633.792 0 0 0-52.224-1.408h-10.56a542.08 542.08 0 0 0-50.56 1.408 127.744 127.744 0 0 0-67.52 25.024 127.232 127.232 0 0 0-32.896 39.552c-7.808 13.696-15.552 30.72-24.32 50.048l-15.232 33.28H128A42.688 42.688 0 1 0 128 288h32V832A160 160 0 0 0 320 992h384a160 160 0 0 0 160-160V288h32a42.688 42.688 0 0 0 0-85.312h-184.256l-18.176-37.568a650.176 650.176 0 0 0-24.96-48.32 127.232 127.232 0 0 0-32.896-38.08zM616.96 202.688H409.92a556.16 556.16 0 0 1 19.84-41.088 39.232 39.232 0 0 1 34.048-21.888c11.392-1.024 26.176-1.024 49.664-1.024 22.912 0 37.376 0 48.384 1.024a39.296 39.296 0 0 1 33.6 21.056c5.632 9.28 11.84 21.952 21.504 41.92z m-211.648 563.712a32 32 0 0 1-32-32v-256a32 32 0 0 1 64 0v256a32 32 0 0 1-32 32z m245.376-288v256a32 32 0 1 1-64 0v-256a32 32 0 0 1 64 0z" fill="#333333" p-id="7308"></path></svg>',location:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
93
- <path d="M12 21s-6-5.686-6-10a6 6 0 0 1 12 0c0 4.314-6 10-6 10z"></path>
94
- <circle cx="12" cy="11" r="2.5"></circle>
95
- </svg>
96
- `,polygon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439429384" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="30246" xmlns:xlink="http://www.w3.org/1999/xlink" width="200.1953125" height="200"><path d="M358.5 1021.5c-52.93 0-96-43.07-96-96 0-13.12 2.6-25.84 7.74-37.81l0.12-0.27-141.99-184.66-0.34 0.11a95.806 95.806 0 0 1-29.53 4.64c-52.93 0-96-43.07-96-96s43.07-96 96-96c7.56 0 15.09 0.89 22.41 2.64l0.36 0.09 213.67-370.08-0.16-0.25c-9.34-15.12-14.28-32.54-14.28-50.39 0-52.93 43.07-96 96-96 40.36 0 76.66 25.5 90.34 63.46l0.09 0.26 300.27 61.72 0.19-0.26c18.01-25.16 47.21-40.18 78.11-40.18 52.93 0 96 43.07 96 96 0 36.49-20.26 69.36-52.88 85.79l-0.31 0.16 41.76 393.5 0.25 0.12a96.184 96.184 0 0 1 39.11 34.79c9.85 15.41 15.06 33.27 15.06 51.65 0 52.93-43.07 96-96 96-31.18 0-60.53-15.24-78.52-40.76l-0.22-0.31-396.7 138.78-0.05 0.29c-8.2 45.76-47.94 78.97-94.5 78.97z m0-192c34.03 0 64.82 17.44 82.36 46.66l0.21 0.35L832.93 739.4l0.03-0.32c3.81-39.11 31.82-72.49 69.7-83.05l0.41-0.11-40.34-380.14-0.34-0.08c-39.73-9.82-68.86-43.81-72.49-84.56l-0.03-0.37-283.9-58.36-0.15 0.39c-7 17.7-19.01 32.81-34.72 43.69-16.08 11.13-34.96 17.02-54.59 17.02-9.75 0-19.37-1.46-28.59-4.33l-0.38-0.12L176.19 555.1l0.19 0.26c11.86 16.42 18.12 35.83 18.12 56.14 0 17.74-4.88 35.06-14.11 50.11l-0.18 0.29 136.28 177.25 0.37-0.18c13.04-6.28 27.05-9.47 41.64-9.47z" p-id="30247" fill="#515151"></path><path d="M416.5 2c40.15 0 76.26 25.37 89.87 63.13l0.19 0.53 0.55 0.11 299.68 61.6 0.64 0.13 0.38-0.53c8.66-12.1 20.19-22.15 33.34-29.06C854.71 90.77 870.06 87 885.5 87c52.66 0 95.5 42.84 95.5 95.5 0 18.03-5.05 35.58-14.6 50.77a95.81 95.81 0 0 1-38 34.57l-0.62 0.31 0.07 0.69 41.7 392.88 0.06 0.55 0.5 0.24c15.91 7.71 29.36 19.68 38.91 34.61 9.8 15.33 14.98 33.09 14.98 51.38 0 52.66-42.84 95.5-95.5 95.5-31.02 0-60.22-15.16-78.11-40.55l-0.43-0.62-0.71 0.25-396.09 138.59-0.55 0.19-0.1 0.57c-3.9 21.77-15.4 41.67-32.39 56.03-17.2 14.54-39.08 22.54-61.62 22.54-52.66 0-95.5-42.84-95.5-95.5 0-13.05 2.59-25.71 7.7-37.61l0.23-0.54-0.36-0.46-141.59-184.16-0.43-0.56-0.67 0.22A95.43 95.43 0 0 1 98.5 707C45.84 707 3 664.16 3 611.5S45.84 516 98.5 516c7.52 0 15.01 0.88 22.29 2.62l0.73 0.17 0.37-0.65 213.33-369.5 0.3-0.52-0.31-0.51c-9.29-15.04-14.2-32.37-14.2-50.12C321 44.84 363.84 2 416.5 2m0 191c-9.7 0-19.27-1.45-28.44-4.31l-0.76-0.24-0.4 0.69-210.98 365.43-0.32 0.56 0.38 0.52C187.77 571.99 194 591.3 194 611.5c0 17.64-4.85 34.88-14.03 49.85l-0.36 0.59 0.42 0.55 135.82 176.65 0.5 0.64 0.73-0.35c12.97-6.26 26.91-9.43 41.42-9.43 16.79 0 33.3 4.42 47.75 12.78a96.095 96.095 0 0 1 34.18 33.63l0.42 0.7 0.77-0.27 391.17-136.87 0.6-0.21 0.06-0.64c1.88-19.33 9.53-37.41 22.11-52.28 12.44-14.71 28.77-25.2 47.22-30.35l0.82-0.23-0.09-0.84-40.26-379.37-0.07-0.7-0.68-0.17c-39.52-9.77-68.5-43.58-72.11-84.12l-0.07-0.74-0.73-0.15-283.12-58.2-0.82-0.17-0.31 0.78c-6.96 17.61-18.91 32.64-34.54 43.46-15.99 11.11-34.77 16.96-54.3 16.96m0-192C363.2 1 320 44.2 320 97.5c0 18.58 5.26 35.93 14.35 50.65l-213.33 369.5A96.669 96.669 0 0 0 98.5 515C45.2 515 2 558.2 2 611.5S45.2 708 98.5 708a96.5 96.5 0 0 0 29.69-4.66l141.59 184.15c-5 11.66-7.78 24.51-7.78 38.01 0 53.3 43.2 96.5 96.5 96.5 47.46 0 86.91-34.25 94.99-79.39l396.08-138.59C867.04 828.81 895.88 845 928.5 845c53.3 0 96.5-43.2 96.5-96.5 0-38.22-22.23-71.26-54.46-86.88l-41.7-392.88C960.37 252.86 982 220.21 982 182.5c0-53.3-43.2-96.5-96.5-96.5-32.37 0-61.01 15.94-78.51 40.39l-299.68-61.6C493.91 27.59 458.31 1 416.5 1z m0 193c40.77 0 75.63-25.28 89.77-61.03l283.12 58.2c3.69 41.4 33.52 75.27 72.87 85l40.26 379.37c-37.74 10.53-66.15 43.41-70.06 83.49L441.29 875.9c-16.87-28.1-47.63-46.9-82.79-46.9-15 0-29.2 3.42-41.86 9.53L180.82 661.88c8.99-14.66 14.18-31.91 14.18-50.38 0-21.07-6.76-40.56-18.22-56.43l210.98-365.42c9.08 2.83 18.73 4.35 28.74 4.35z" p-id="30248" fill="#515151"></path></svg>',polyline:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438516107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18607" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M672 925.5c-52.11 0-94.5-42.39-94.5-94.5 0-27.32 11.82-53.29 32.43-71.26l0.3-0.26-254.6-473.05-0.31 0.01c-1.1 0.04-2.21 0.06-3.32 0.06-18.73 0-36.83-5.47-52.35-15.82l-0.34-0.23-114.89 114.89 0.1 0.29c3.31 9.75 4.99 19.97 4.99 30.37 0 52.11-42.39 94.5-94.5 94.5S0.5 468.11 0.5 416s42.39-94.5 94.5-94.5c17.2 0 34.04 4.67 48.7 13.5l0.34 0.2 117.11-117.1-0.08-0.28a94.646 94.646 0 0 1-3.57-25.81c0-52.11 42.39-94.5 94.5-94.5s94.5 42.39 94.5 94.5c0 26.56-11.28 52.05-30.94 69.93l-0.29 0.26 255.29 474.32s1.19-0.02 1.44-0.02c20.26 0 39.58 6.32 55.86 18.28l0.35 0.25 112-112-0.12-0.3c-4.37-11.06-6.59-22.74-6.59-34.73 0-52.11 42.39-94.5 94.5-94.5s94.5 42.39 94.5 94.5-42.39 94.5-94.5 94.5c-15.68 0-31.21-3.92-44.91-11.33l-0.33-0.18-118.68 118.68 0.06 0.27A95.354 95.354 0 0 1 766.5 831c0 52.11-42.39 94.5-94.5 94.5z" p-id="18608" fill="#515151"></path><path d="M352 98c51.83 0 94 42.17 94 94 0 26.42-11.22 51.78-30.78 69.56l-0.58 0.53 0.37 0.69 254.96 473.71 0.29 0.53 0.61-0.01 0.42-0.01c0.24 0 0.48-0.01 0.72-0.01 20.15 0 39.37 6.29 55.57 18.18l0.69 0.51 0.61-0.61 111.46-111.46 0.46-0.46-0.24-0.61c-4.35-11-6.55-22.62-6.55-34.55 0-51.83 42.17-94 94-94s94 42.17 94 94-42.17 94-94 94c-15.59 0-31.04-3.9-44.67-11.27l-0.66-0.35-0.53 0.53-118.23 118.23-0.39 0.39 0.12 0.54a94.365 94.365 0 0 1 2.35 20.95c0 51.83-42.17 94-94 94s-94-42.17-94-94c0-27.17 11.76-53.01 32.26-70.88l0.6-0.52-0.38-0.7-254.26-472.45-0.29-0.55-0.62 0.02c-1.27 0.04-2.32 0.06-3.3 0.06-18.63 0-36.64-5.44-52.08-15.74l-0.68-0.45-0.58 0.58-114.39 114.39-0.44 0.44 0.2 0.59c3.29 9.7 4.96 19.87 4.96 30.21 0 51.83-42.17 94-94 94S1 467.83 1 416s42.17-94 94-94c17.11 0 33.86 4.65 48.45 13.43l0.67 0.4 0.55-0.55L261.3 218.66l0.42-0.41-0.16-0.56a94.028 94.028 0 0 1-3.55-25.68C258 140.17 300.17 98 352 98m0-1c-52.47 0-95 42.53-95 95 0 9 1.25 17.7 3.59 25.95L143.96 334.58C129.66 325.96 112.91 321 95 321c-52.47 0-95 42.53-95 95s42.53 95 95 95 95-42.53 95-95c0-10.68-1.76-20.95-5.01-30.53l114.38-114.38C314.44 281.14 332.53 287 352 287c1.12 0 2.23-0.03 3.34-0.06l254.27 472.43C589.63 776.78 577 802.41 577 831c0 52.47 42.53 95 95 95s95-42.53 95-95c0-7.28-0.82-14.36-2.37-21.17L882.86 691.6c13.42 7.27 28.8 11.4 45.14 11.4 52.47 0 95-42.53 95-95s-42.53-95-95-95-95 42.53-95 95c0 12.33 2.35 24.11 6.62 34.92L728.16 754.38C712.43 742.83 693.01 736 672 736c-0.38 0-0.76 0.01-1.14 0.01L415.9 262.3C435 244.92 447 219.86 447 192c0-52.47-42.53-95-95-95z" p-id="18609" fill="#515151"></path></svg>',rectangle:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439410852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28392" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M273.9 168.3H739v37.1H273.9zM273.9 819.6H739v37.1H273.9zM165.812 740.898v-465.1h37.1v465.1zM821.11 740.896v-465.1h37.1v465.1z" fill="#515151" p-id="28393"></path><path d="M184.7 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7zM184.7 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7z" fill="#515151" p-id="28394"></path></svg>',ruler:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438563645" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20701" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M996.2 679L340 22.8c-12.5-12.5-32.8-12.5-45.3 0L23.2 294.3c-12.5 12.5-12.5 32.8 0 45.3l656.2 656.2c12.5 12.5 32.8 12.5 45.3 0l271.5-271.5c12.5-12.5 12.5-32.8 0-45.3zM262.6 234.9l119.2-119.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7L307.9 280.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.5-1.6-1.5-4.1 0-5.7z m112.9 45l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.5-1.6-1.5-4.1 0-5.7z m79 79l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7z m45.7 113.6l119.2-119.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7L545.5 517.8c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.5-1.6-1.5-4.1 0-5.7z m152.5 90.3l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0z m39.4 33.7l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7z m85.3 158.9l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7L857 590.9c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7L783.1 755.4c-1.6 1.5-4.1 1.5-5.7 0z" p-id="20702" fill="#515151"></path></svg>',search:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#86868b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
97
- <circle cx="11" cy="11" r="7"></circle>
98
- <line x1="16.5" y1="16.5" x2="21" y2="21"></line>
99
- </svg>
100
- `,track:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
101
- <path d="M4 5c4-2 5 4 8 2s4 3 8 1"></path>
102
- <path d="M4 19c4-2 5 2 8 0s4 1 8-1"></path>
103
- <circle cx="4" cy="5" r="1.6"></circle>
104
- <circle cx="20" cy="8" r="1.6"></circle>
105
- <circle cx="12" cy="19" r="1.6"></circle>
106
- </svg>
107
- `,triangle:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439485778" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="35763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M185.8 63.9c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.2-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7-37 82.7-82.7 82.7zM838.2 716.7c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.2-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7-37 82.7-82.7 82.7zM186.2 715.6c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.2-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7-37 82.7-82.7 82.7z" fill="#515151" p-id="35764"></path><path d="M287.2 818.1h447.6v37H287.2zM167.3 282h37v451h-37zM235.682 261.34l26.163-26.162L776.897 750.23l-26.163 26.162z" fill="#515151" p-id="35765"></path></svg>',view:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1767681773788" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6706" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M234.666667 224a10.666667 10.666667 0 0 0-10.666667 10.666667v149.333333a32 32 0 0 1-64 0v-149.333333A74.666667 74.666667 0 0 1 234.666667 160h149.333333a32 32 0 0 1 0 64h-149.333333zM597.333333 405.333333a21.333333 21.333333 0 0 1 21.333334 21.333334v170.666666a21.333333 21.333333 0 0 1-21.333334 21.333334h-170.666666a21.333333 21.333333 0 0 1-21.333334-21.333334v-170.666666a21.333333 21.333333 0 0 1 21.333334-21.333334h170.666666z m-170.666666-64a85.333333 85.333333 0 0 0-85.333334 85.333334v170.666666a85.333333 85.333333 0 0 0 85.333334 85.333334h170.666666a85.333333 85.333333 0 0 0 85.333334-85.333334v-170.666666a85.333333 85.333333 0 0 0-85.333334-85.333334h-170.666666z m-202.666667 448a10.666667 10.666667 0 0 0 10.666667 10.666667h149.333333a32 32 0 0 1 0 64h-149.333333A74.666667 74.666667 0 0 1 160 789.333333v-149.333333a32 32 0 0 1 64 0v149.333333z m565.333333 10.666667a10.666667 10.666667 0 0 0 10.666667-10.666667v-149.333333a32 32 0 0 1 64 0v149.333333a74.666667 74.666667 0 0 1-74.666667 74.666667h-149.333333a32 32 0 0 1 0-64h149.333333z m10.666667-565.333333a10.666667 10.666667 0 0 0-10.666667-10.666667h-149.333333a32 32 0 0 1 0-64h149.333333a74.666667 74.666667 0 0 1 74.666667 74.666667v149.333333a32 32 0 0 1-64 0v-149.333333z" fill="#000000" p-id="6707"></path></svg>',weather:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766264800000" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8601" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><rect x="248" y="512" width="544" height="150" rx="72" fill="#272636" p-id="8602" /><circle cx="372" cy="504" r="120" fill="#272636" p-id="8603" /><circle cx="544" cy="452" r="150" fill="#272636" p-id="8604" /><circle cx="700" cy="504" r="118" fill="#272636" p-id="8605" /><path d="M366 716l-26 82h40l26-82h-40z" fill="#272636" p-id="8606" /><path d="M492 716l-26 82h40l26-82h-40z" fill="#272636" p-id="8607" /><path d="M618 716l-26 82h40l26-82h-40z" fill="#272636" p-id="8608" /></svg>'};function bn(e){return Object.prototype.hasOwnProperty.call(Qe,e)}function za(e,t){return e.replace(/#[0-9a-fA-F]{6}/g,t).replace(/#[0-9a-fA-F]{3}/g,t).replace(/fill="(?!none")[^"]*"/g,`fill="${t}"`).replace(/stroke="(?!none")[^"]*"/g,`stroke="${t}"`)}function En(e,t){const n=Qe[e];return za(n,t||"currentColor")}const G=o.defineComponent({name:"AppIcon",inheritAttrs:!1,props:{name:{type:String,required:!0},size:{type:[Number,String],default:16},color:{type:String,default:""}},setup(e){const t=o.computed(()=>bn(e.name)?En(e.name,e.color||void 0):""),n=o.computed(()=>({width:`${e.size}px`,height:`${e.size}px`,...e.color?{color:e.color}:{}}));return()=>o.createVNode("span",{class:"app-icon iconfont-icon",style:n.value,role:"img","aria-hidden":"true"},[o.createVNode("span",{innerHTML:t.value},null)])}}),Tn=o.defineComponent({name:"MapError",props:{visible:{type:Boolean,default:!1},title:{type:String,default:"地图加载失败"},message:{type:String,default:""}},emits:["retry"],setup(e,{emit:t}){return()=>e.visible?o.createVNode("div",{class:"map-error",role:"alert"},[o.createVNode("div",{class:"map-error__card"},[o.createVNode("div",{class:"map-error__icon"},[o.createVNode(G,{name:"view",size:28},null)]),o.createVNode("div",{class:"map-error__title"},[e.title]),o.createVNode("div",{class:"map-error__message"},[e.message||"初始化地理数据时出现异常,请检查网络连接后重试"]),o.createVNode("div",{class:"map-error__actions"},[o.createVNode("button",{type:"button",class:"map-error__retry",onClick:()=>t("retry")},[o.createTextVNode("重新加载")]),o.createVNode("span",{class:"map-error__hint"},[o.createTextVNode("若持续失败,请刷新页面")])])])]):null}}),Sn=o.defineComponent({name:"AppInput",inheritAttrs:!1,props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},prefixIcon:{type:String,default:""},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},emits:["update:modelValue","input","clear","focus","blur","keydown"],setup(e,{emit:t,attrs:n}){const r=o.useSlots(),i=o.computed({get:()=>e.modelValue,set:d=>t("update:modelValue",d)}),a=o.computed(()=>e.clearable&&!e.disabled&&e.modelValue.length>0),l=d=>{const c=d.target.value;i.value=c,t("input",c)},s=()=>{i.value="",t("clear")},u=o.computed(()=>["app-input",{"app-input--disabled":e.disabled}]);return()=>{const d={},c={};for(const f of Object.keys(n))f.startsWith("on")&&f.length>2?c[f]=n[f]:d[f]=n[f];return o.createVNode("div",o.mergeProps({class:u.value},d),[e.prefixIcon?o.createVNode("span",{class:"app-input__prefix"},[o.createVNode(G,{name:e.prefixIcon,size:15},null)]):null,o.createVNode("input",o.mergeProps({class:"app-input__inner",type:"text",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,autofocus:e.autofocus,"aria-label":e.ariaLabel||void 0,onInput:l,onFocus:f=>t("focus",f),onBlur:f=>t("blur",f),onKeydown:f=>t("keydown",f)},c),null),r.suffix?o.createVNode("span",{class:"app-input__suffix"},[r.suffix()]):null,a.value?o.createVNode("button",{type:"button",class:"app-input__clear","aria-label":"清除",onClick:s},[o.createVNode("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"currentColor"},[o.createVNode("path",{d:"M12 2a10 10 0 100 20 10 10 0 000-20zm4.24 12.83l-1.41 1.41L12 13.41l-2.83 2.83-1.41-1.41L10.59 12 7.76 9.17l1.41-1.41L12 10.59l2.83-2.83 1.41 1.41L13.41 12l2.83 2.83z"},null)])]):null])}}}),et=o.defineComponent({name:"AppSpinner",props:{size:{type:[Number,String],default:24},color:{type:String,default:""}},setup(e){const t=o.computed(()=>({width:`${e.size}px`,height:`${e.size}px`,color:e.color||"currentColor"}));return()=>o.createVNode("span",{class:"app-spinner",style:t.value,role:"status","aria-label":"加载中"},[o.createVNode("span",{class:"app-spinner__circle"},null)])}}),Dn=o.defineComponent({name:"SearchResultsPanel",props:{list:{type:Array,default:()=>[]},highlightIndex:{type:Number,default:-1},selectedIndex:{type:Number,default:-1}},emits:["result-click","result-hover","result-leave"],setup(e,{emit:t}){return()=>o.createVNode("div",{class:"search-results-panel"},[o.createVNode("div",{class:"results-header"},[o.createVNode("span",{class:"header-text"},[o.createTextVNode("搜索结果")])]),o.createVNode("div",{class:"results-content",role:"listbox","aria-label":"桩号搜索结果"},[e.list.map((n,r)=>o.createVNode("div",{key:n.id??r,class:["result-item",{highlight:e.highlightIndex===r,selected:e.selectedIndex===r}],role:"option","aria-selected":e.highlightIndex===r,onClick:()=>t("result-click",n,r),onMouseenter:()=>t("result-hover",r),onMouseleave:()=>t("result-leave")},[o.createVNode("div",{class:"result-icon"},[o.createVNode(G,{name:"location",size:16},null)]),o.createVNode("div",{class:"result-info"},[o.createVNode("div",{class:"result-name"},[n.name]),n.lng!==void 0&&n.lat!==void 0?o.createVNode("div",{class:"result-coordinates"},[n.lng.toFixed(6),o.createTextVNode(", "),n.lat.toFixed(6)]):null,n.altitude?o.createVNode("div",{class:"result-altitude"},[o.createTextVNode("海拔: "),n.altitude,o.createTextVNode("m")]):null]),o.createVNode("div",{class:"result-action"},[o.createVNode(G,{name:"aim",size:16},null)])]))]),o.createVNode("div",{class:"results-footer"},[o.createVNode("span",null,[o.createTextVNode("点击结果进行定位")])])])}}),tt=o.defineComponent({name:"NoResultsPanel",props:{keyword:{type:String,default:""},error:{type:Boolean,default:!1}},emits:["clear"],setup(e,{emit:t}){return()=>o.createVNode("div",{class:["no-results",{"no-results--error":e.error}]},[o.createVNode("div",{class:"no-results-content"},[o.createVNode(G,{name:e.error?"view":"search",size:32},null),o.createVNode("div",{class:"no-results-text"},[e.error?o.createVNode("p",null,[o.createTextVNode("查询失败,请检查网络后重试")]):o.createVNode("p",null,[o.createTextVNode('未找到"'),e.keyword,o.createTextVNode('"相关桩号'),o.createVNode("span",{class:"no-results-hint"},[o.createTextVNode(",请检查桩号格式后重新输入")])])]),e.error?o.createVNode("button",{type:"button",class:"no-results-retry",onClick:()=>t("clear")},[o.createTextVNode("清空重试")]):null])])}});function Fa(e){return{position:"fixed",top:`${e.bottom+nr}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:rr}}const Mn=o.defineComponent({name:"MapTools",inheritAttrs:!1,props:{showSearch:{type:Boolean,default:!1},theme:{type:String,default:"dark"},filteredList:{type:Array,default:()=>[]},showResults:{type:Boolean,default:!1},input:{type:String,default:""},isSearching:{type:Boolean,default:!1},searchError:{type:Boolean,default:!1},highlightIndex:{type:Number,default:-1},selectedIndex:{type:Number,default:-1}},emits:["search-input","search-focus","search-clear","search-close","search-navigate","search-select","result-click","result-hover","result-leave"],setup(e,{emit:t,slots:n}){const r=o.ref(e.input),i=o.shallowRef(null),a=o.shallowRef(null),l=o.ref({}),s=o.computed(()=>e.showSearch);o.watch(()=>e.input,C=>{r.value=C});const u=()=>{i.value&&(l.value=Fa(i.value.getBoundingClientRect()))},d=C=>{r.value=C,t("search-input",C)},c=()=>{r.value="",t("search-clear","")},f=()=>{t("search-focus",r.value)},h=C=>{if(C.key==="Escape"){C.preventDefault(),t("search-close");return}if(C.key==="ArrowDown"){C.preventDefault(),t("search-navigate",1);return}if(C.key==="ArrowUp"){C.preventDefault(),t("search-navigate",-1);return}C.key==="Enter"&&(C.preventDefault(),t("search-select"))},p=C=>{if(!e.showResults)return;const y=C.target;a.value?.contains(y)||document.querySelector(".search-results-panel")?.contains(y)||document.querySelector(".no-results")?.contains(y)||t("search-close")};o.watch(()=>[e.showResults,e.filteredList.length],()=>{e.showResults&&u()}),o.onMounted(()=>{window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),document.addEventListener("mousedown",p)}),o.onUnmounted(()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),document.removeEventListener("mousedown",p)});const b=o.computed(()=>e.showResults&&e.filteredList.length>0),v=o.computed(()=>e.showResults&&r.value!==""&&e.filteredList.length===0&&!e.isSearching&&!e.searchError),m=o.computed(()=>e.showResults&&r.value!==""&&e.filteredList.length===0&&!e.isSearching&&e.searchError);return()=>o.createVNode("div",{class:"eapc-utils",ref:a},[s.value?o.createVNode("div",{class:"eapc-search"},[o.createVNode("div",{class:"search-container",ref:i},[o.createVNode(Sn,{class:"search-input",modelValue:r.value,placeholder:"请输入桩号进行搜索...",clearable:!0,prefixIcon:"search",ariaLabel:"桩号搜索","onUpdate:modelValue":d,onClear:c,onFocus:f,onKeydown:h},{suffix:()=>e.isSearching?o.createVNode(et,{size:14},null):r.value&&!e.searchError?o.createVNode("div",{class:"results-count"},[e.filteredList.length,o.createTextVNode("个结果")]):null})])]):null,o.createVNode(o.Teleport,{to:"body"},{default:()=>[b.value?o.createVNode(Dn,{class:"teleported","data-theme":e.theme,style:l.value,list:e.filteredList,highlightIndex:e.highlightIndex,selectedIndex:e.selectedIndex,"onResult-click":(C,y)=>t("result-click",C,y),"onResult-hover":C=>t("result-hover",C),"onResult-leave":()=>t("result-leave")},null):null,v.value?o.createVNode(tt,{class:"teleported","data-theme":e.theme,style:l.value,keyword:r.value},null):null,m.value?o.createVNode(tt,{class:"teleported","data-theme":e.theme,style:l.value,keyword:r.value,error:!0},null):null]}),o.createVNode("div",{class:"utils-right"},[n["utils-right"]?n["utils-right"]():null])])}}),In=o.defineComponent({name:"MapControls",inheritAttrs:!1,props:{showDeleteControls:{type:Boolean,default:!0},mapType:{type:String,default:"3d"},mapBase:{type:String,default:"bigemap"},currentDrawType:{type:String,default:null},mapNameVisible:{type:Boolean,default:!1},contourVisible:{type:Boolean,default:!1},tools:{type:Array,default:()=>Re},showBaseSwitch:{type:Boolean,default:!0}},emits:["delete","toggle-map-type","toggle-map-base","start-drawing","toggle-map-view","toggle-map-name","toggle-contour"],setup(e,{emit:t}){const n=o.computed(()=>e.currentDrawType!=null),r=l=>{n.value||t(l)},i=l=>{n.value&&e.currentDrawType!==l||t("start-drawing",l)},a=l=>{const s=ht(l);return s?s.icon:l};return()=>o.createVNode("div",{class:"eapc-control"},[e.showDeleteControls?o.createVNode("button",{type:"button",class:["item","delete-item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":"清除绘制图形",onClick:()=>r("delete")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("清除绘制图形")]),o.createVNode(G,{name:"clear",size:18},null)]):null,o.createVNode("button",{type:"button",class:["item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":`切换${e.mapType==="3d"?"2D":"3D"}地图`,onClick:()=>r("toggle-map-type")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("切换"),e.mapType==="3d"?"2D":"3D",o.createTextVNode("地图")]),o.createVNode(G,{name:e.mapType,size:e.mapType==="3d"?24:22},null)]),o.createVNode("button",{type:"button",class:["item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":"恢复视图",onClick:()=>r("toggle-map-view")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("恢复视图")]),o.createVNode(G,{name:"view",size:20},null)]),e.showBaseSwitch?o.createVNode("button",{type:"button",class:["item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":`切换${e.mapBase==="bigemap"?"物探地图":"生产地图"}底图`,onClick:()=>r("toggle-map-base")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("切换"),e.mapBase==="bigemap"?"物探地图":"生产地图"]),o.createVNode(G,{name:"base",size:20},null)]):null,o.createVNode("button",{type:"button",class:["item","label-switch-item","is-button",{"is-on":e.mapNameVisible}],role:"switch","aria-checked":e.mapNameVisible,"aria-label":e.mapNameVisible?"关闭地图名称注记":"加载地图名称注记",onClick:()=>t("toggle-map-name",!e.mapNameVisible)},[o.createVNode("span",{class:"txt"},[e.mapNameVisible?"关闭地图名称":"加载地图名称"]),o.createVNode("span",{class:"label-switch","aria-hidden":"true"},[o.createVNode("span",{class:"label-switch__track"},[o.createVNode("span",{class:"label-switch__thumb"},null)])])]),e.mapType==="3d"?o.createVNode("button",{type:"button",class:["item","is-button",{active:e.contourVisible}],"aria-pressed":e.contourVisible,"aria-label":e.contourVisible?"关闭等高线":"开启等高线",onClick:()=>t("toggle-contour")},[o.createVNode("span",{class:"txt"},[e.contourVisible?"关闭等高线":"开启等高线"]),o.createVNode(G,{name:"contour",size:18},null)]):null,o.createVNode("div",{class:"eapc-control__divider"},null),e.tools.map(l=>o.createVNode("button",{type:"button",key:l.icon,class:["item","tool-item","is-button",{active:e.currentDrawType===l.icon,"is-disabled":n.value&&e.currentDrawType!==l.icon}],disabled:n.value&&e.currentDrawType!==l.icon,"aria-pressed":e.currentDrawType===l.icon,"aria-label":l.name,onClick:()=>i(l.icon)},[o.createVNode("span",{class:"txt"},[l.name]),o.createVNode(G,{name:a(l.icon),size:l.size},null)]))])}}),Oa=500,An=1e3,Ga={bigemap:"生产地图",geoserver:"物探地图"};function Ne(e){return e&&typeof e.value=="object"?e.value:e}function Ua(e){return e>=1e3?`${(e/1e3).toFixed(2)} km`:`${Math.round(e)} m`}function xn(e){return e>=1024*1024*1024?`${(e/1024/1024/1024).toFixed(2)} GB`:`${(e/1024/1024).toFixed(1)} MB`}const Ln=o.defineComponent({name:"MapStatus",inheritAttrs:!1,props:{map:{type:Object,default:null},mapBase:{type:String,default:"bigemap"},visible:{type:Boolean,default:!1}},setup(e){const t=o.ref(!1),n=o.ref(0),r=o.ref("--"),i=o.ref({text:"--",detail:""}),a=o.ref("--"),l=o.ref("--"),s=o.shallowRef(null),u=o.shallowRef(null),d=o.ref(!1);let c=0,f=0,h=0,p=[],b=null,v=null,m=0;const C=()=>{f=0,h=performance.now();const M=()=>{f+=1;const I=performance.now();I-h>=Oa&&(n.value=Math.round(f*1e3/(I-h)),f=0,h=I),c=requestAnimationFrame(M)};c=requestAnimationFrame(M)},y=()=>{try{const M=performance.memory;if(!M){r.value="--";return}const I=M.usedJSHeapSize,F=M.jsHeapSizeLimit;r.value=`${xn(I)} / ${xn(F)}`}catch{r.value="--"}},E=()=>{const M=Ne(e.map);if(!M)return;const I=D();if(!I)return;if(!!(I.SceneMode&&M.scene.mode===I.SceneMode.SCENE2D)){i.value={text:"2D 视图",detail:Ga[e.mapBase]||e.mapBase};return}try{const _=I.Cartographic.fromCartesian(M.camera.position);i.value={text:"3D 视图",detail:`视距 ${Ua(_.height)}`}}catch{i.value={text:"3D 视图",detail:"--"}}},k=M=>{v=M,m===0&&(m=requestAnimationFrame(()=>{m=0;const I=v;if(v=null,!I)return;const F=Ne(e.map);if(!F)return;const _=D();if(!_)return;const Y=F.camera.pickEllipsoid(new _.Cartesian2(I.offsetX,I.offsetY),F.scene.globe.ellipsoid);if(!Y)return;const K=_.Cartographic.fromCartesian(Y);a.value=_.Math.toDegrees(K.longitude).toFixed(6),l.value=_.Math.toDegrees(K.latitude).toFixed(6)}))},S=()=>{!s.value||!u.value||(d.value=u.value.scrollWidth>s.value.clientWidth+1)},A=()=>{t.value=!t.value},V=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),A())};o.onMounted(()=>{C(),y(),E(),S(),p.push(window.setInterval(y,An)),p.push(window.setInterval(E,An)),Ne(e.map)?.scene.canvas.addEventListener("mousemove",k),typeof ResizeObserver<"u"&&(b=new ResizeObserver(S),u.value&&b.observe(u.value),s.value&&b.observe(s.value))}),o.onUnmounted(()=>{cancelAnimationFrame(c),m!==0&&cancelAnimationFrame(m),v=null,b?.disconnect(),p.forEach(I=>window.clearInterval(I)),Ne(e.map)?.scene.canvas.removeEventListener("mousemove",k)});const U=()=>[o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("FPS")]),o.createVNode("b",{class:"map-status__value map-status__value--fps"},[n.value])]),o.createVNode("span",{class:"map-status__dot","aria-hidden":"true"},[o.createTextVNode("·")]),o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("内存")]),o.createVNode("span",{class:"map-status__value"},[r.value])]),o.createVNode("span",{class:"map-status__dot","aria-hidden":"true"},[o.createTextVNode("·")]),o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("层级")]),o.createVNode("span",{class:"map-status__value"},[i.value.text,i.value.detail?o.createVNode("em",{class:"map-status__detail"},[o.createTextVNode(" · "),i.value.detail]):null])]),o.createVNode("span",{class:"map-status__dot","aria-hidden":"true"},[o.createTextVNode("·")]),o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("坐标")]),o.createVNode("span",{class:"map-status__value map-status__value--coords"},[a.value,o.createTextVNode(", "),l.value])])],z=o.computed(()=>t.value&&d.value);return()=>e.visible?o.createVNode("div",{class:["map-status",t.value?"is-expanded":"is-collapsed"],role:"button",tabindex:0,title:t.value?"收起状态信息":"展开状态信息",onClick:A,onKeydown:V},[o.createVNode("span",{class:"map-status__badge","aria-hidden":t.value},[o.createVNode("b",{class:"map-status__badge-value"},[n.value])]),o.createVNode("span",{class:"map-status__expanded","aria-hidden":!t.value},[o.createVNode("span",{class:"map-status__row",ref:s},[o.createVNode("span",{class:["map-status__track",{"is-marquee":z.value}]},[o.createVNode("span",{class:"map-status__track-inner",ref:u},[U()]),z.value?o.createVNode("span",{class:"map-status__track-inner","aria-hidden":"true"},[U()]):null])])])]):null}}),Nn=o.defineComponent({name:"MapView",props:{config:{type:Object,default:void 0},theme:{type:String,default:"dark"},popupConfig:{type:Object,default:()=>{}}},emits:["init","draw-end","draw-delete","draw-clear","point-click","clear-button-click","clear-draw","ready","error","error-retry","expose"],async setup(e,{emit:t,expose:n,slots:r}){const i=Ra(e.config,{theme:e.theme,popupConfig:e.popupConfig}),a=Cn(i,{emit:(_,...Y)=>t(_,...Y),expose:n,onPointClick:_=>t("point-click",_)});await a.init().catch(()=>{});const{mapType:l,mapBase:s,currentDrawType:u,loadingTitle:d,loadingSubtitle:c,theme:f,mapNameVisible:h,showControls:p,showDeleteControls:b,showStatus:v,wmtsEnabled:m}=a,{state:C,showSearch:y,search:E,onDelete:k,handleStartDrawing:S,toggleMapType:A,resetView:V,toggleMapBaseLayer:U,setMapNameVisible:z,setContourVisible:M,contourVisible:I,map:F}=a;return()=>o.createVNode(o.Fragment,null,[o.createVNode(Je,{visible:C.value.isLoading&&!C.value.error,title:d.value,subtitle:c.value},null),o.createVNode(Tn,{visible:!!C.value.error,message:C.value.error?.message,onRetry:()=>t("error-retry")},null),o.createVNode(Ln,{map:F,mapBase:s.value,visible:v.value},null),y.value?o.createVNode(Mn,{showSearch:!0,theme:f.value,filteredList:E.filteredList.value,showResults:E.showResults.value,input:E.searchInput.value,isSearching:E.isSearching.value,searchError:E.searchError.value,highlightIndex:E.highlightIndex.value,selectedIndex:E.selectedIndex.value,"onSearch-input":E.handleInputSearch,"onSearch-focus":()=>{E.showResults.value=!0},"onSearch-clear":E.clearSearch,"onSearch-close":()=>{E.showResults.value=!1},"onSearch-navigate":_=>E.moveHighlight(_),"onSearch-select":()=>E.selectHighlighted(),"onResult-click":E.handleResultClick,"onResult-hover":_=>{E.highlightIndex.value=_},"onResult-leave":()=>{E.highlightIndex.value=-1}},{"utils-right":()=>r["utils-right"]?r["utils-right"]():null}):null,p.value?o.createVNode(In,{showDeleteControls:b.value,mapType:l.value,mapBase:s.value,currentDrawType:u.value??void 0,mapNameVisible:h.value,contourVisible:I.value,tools:i.tools,showBaseSwitch:m.value,onDelete:k,"onToggle-map-type":A,"onToggle-map-base":U,"onToggle-map-view":V,"onToggle-map-name":_=>z(_),"onToggle-contour":()=>M(!I.value),"onStart-drawing":S},null):null,r.default?r.default():null])}}),$a=Object.fromEntries(vn.map(e=>[e,{type:Ba[e],default:void 0}])),Wa=o.defineComponent({name:"MapContainer",inheritAttrs:!1,props:{config:{type:Object,default:void 0},...$a,hideSearch:{type:Boolean,default:void 0},theme:{type:String,default:"dark"},popupConfig:{type:Object,default:()=>{}}},emits:["init","draw-end","draw-delete","draw-clear","point-click","clear-button-click","clear-draw","ready","error","expose"],setup(e,{emit:t,slots:n,expose:r}){const i=o.ref(e.theme||"dark"),a=or(e.config,{containerId:e.containerId,position:e.position,serverUrl:e.serverUrl,libsUrl:e.libsUrl,showSearch:e.showSearch??e.hideSearch,showControls:e.showControls,showDeleteControls:e.showDeleteControls,showStatus:e.showStatus,tools:e.tools,searchDebounceTime:e.searchDebounceTime,wmtsUrlProvider:e.wmtsUrlProvider,geoserver:e.geoserver,contourConfig:e.contourConfig,lightingConfig:e.lightingConfig}),l=u=>{if(u&&typeof u.setTheme=="function"){const d=u.setTheme;u.setTheme=c=>{i.value=c,d(c)}}r(u),t("expose",u)},s=u=>(...d)=>{t(u,...d)};return()=>o.createVNode("div",{class:"map-container-wrapper","data-theme":i.value},[o.createVNode("div",{id:a.containerId,class:"map-container"},null),o.createVNode(o.Suspense,null,{default:()=>o.createVNode(Nn,{config:a,theme:i.value,popupConfig:e.popupConfig,onInit:s("init"),"onDraw-end":s("draw-end"),"onDraw-delete":s("draw-delete"),"onDraw-clear":s("draw-clear"),"onPoint-click":s("point-click"),"onClear-button-click":s("clear-button-click"),"onClear-draw":s("clear-draw"),onReady:s("ready"),onError:s("error"),onExpose:l},{default:u=>_n(n,"default",u),"utils-right":()=>_n(n,"utils-right",{})}),fallback:()=>o.createVNode(Je,{visible:!0},null)})])}});function _n(e,t,n){const r=e[t];return r?r(n):null}const Ha=o.defineComponent({name:"AppButton",inheritAttrs:!1,props:{type:{type:String,default:"primary"},size:{type:String,default:"medium"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(e,{slots:t,attrs:n,emit:r}){const i=o.computed(()=>["app-button",`app-button--${e.type}`,`app-button--${e.size}`,{"app-button--block":e.block},{"app-button--disabled":e.disabled||e.loading}]),a=l=>{e.disabled||e.loading||r("click",l)};return()=>o.createVNode("button",o.mergeProps({type:"button",class:i.value,disabled:e.disabled},n,{onClick:a}),[e.loading?o.createVNode(et,{size:14,class:"app-button__spinner"},null):null,t.default?o.createVNode("span",{class:"app-button__content"},[t.default()]):null])}});function kn(e,t){return/<svg\b[^>]*\sdata-keep-color\b/i.test(e)?e:e.replace(/#[0-9a-fA-F]{6}/g,t).replace(/#[0-9a-fA-F]{3}/g,t).replace(/fill="[^"]*"/g,`fill="${t}"`).replace(/stroke="[^"]*"/g,`stroke="${t}"`)}function Vn(e,t){const n=t/2;return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}"><circle cx="${n}" cy="${n}" r="${n}" fill="${e}"/></svg>`}function Pn(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return`data:image/svg+xml;base64,${btoa(n)}`}const ja={fontSize:12,textColor:"#FFFFFF",textBgColor:"rgba(0, 0, 0, 0.6)",padding:4,rounded:!0,borderRadius:4};function Bn(e){return{...ja,...e}}let nt=null;function Rn(e,t){nt||(nt=document.createElement("canvas"));const n=nt.getContext("2d");return n.font=`${t}px Microsoft YaHei, sans-serif`,Math.ceil(n.measureText(e).width)}const Ya=3e3,ge=new Map,qa=100;function Ka(e){const t=ge.get(e);return t?Promise.resolve(t):new Promise(n=>{const r=new Image;let i=!1;const a=()=>{i||(i=!0,clearTimeout(l),n(r))};r.src=e,r.onload=()=>{if(r.naturalWidth>0&&r.naturalHeight>0)for(ge.set(e,r);ge.size>qa;){const s=ge.keys().next().value;if(s===void 0)break;ge.delete(s)}a()},r.onerror=a;const l=setTimeout(a,Ya)})}function Xa(e,t,n,r,i){e.fillStyle=t.textBgColor,t.rounded?(e.beginPath(),e.roundRect(n,0,r,i,t.borderRadius),e.fill()):e.fillRect(n,0,r,i)}function zn(e,t,n,r,i){e.font=`${t.fontSize}px Microsoft YaHei, sans-serif`,e.fillStyle=t.textColor,e.textAlign="center",e.textBaseline="middle",e.fillText(n,r/2,i/2)}async function Za(e,t,n,r,i){const a=await Ka(t.icon);return a.naturalWidth>0&&a.naturalHeight>0?(e.drawImage(a,r,i,n,n),!0):(e.fillStyle=t.color,e.fillRect(r,i,n,n),!1)}async function Fn(e,t,n,r){const i=n.iconSize||32,a=Bn(n.textConfig),l=Rn(t,a.fontSize)+a.padding*2,s=a.fontSize+a.padding*2,u=Math.max(i,l),d=s+i,c=document.createElement("canvas");c.width=u*r,c.height=d*r;const f=c.getContext("2d");f.scale(r,r);const h=(u-l)/2;Xa(f,a,h,l,s),zn(f,a,t,u,s);const p=await Za(f,e,i,(u-i)/2,s);return{icon:c,width:u,height:d,type:"text",text:t,status:e.status,color:e.color,degraded:!p}}function Ja(e,t,n){const r=n.iconSize||32,i=Bn(n.textConfig),a=Rn(t,i.fontSize)+i.padding*2,l=i.fontSize+i.padding*2,s=Math.max(r,a),u=l+r,d=document.createElement("canvas");d.width=s,d.height=u;const c=d.getContext("2d");return c.fillStyle=i.textBgColor,c.fillRect(0,0,s,l),zn(c,i,t,s,l),c.fillStyle=e.color,c.fillRect((s-r)/2,l,r,r),{icon:d,width:s,height:u,type:"text",text:t,status:e.status,color:e.color}}const Qa="color_svg";function On(e,t){return t===void 0?`${e}_no_text`:t===""?`${e}_empty_text`:`${e}_text_${t}`}function Gn(e){return`${Qa}_${e}`}function rt(e){return R[e]?.color||R.default.color}const it=25,eo=8;function to(){return typeof MessageChannel<"u"?new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(0)}):new Promise(e=>setTimeout(e,0))}async function at(e){return performance.now()-e>=eo?(await to(),performance.now()):e}async function no(e,t){const n=new Map,r=new Map;t.forEach(i=>{const a=r.get(i.status)||[];a.push(i),r.set(i.status,a)});for(const[,i]of r){let a=performance.now();for(let l=0;l<i.length;l+=it){const s=i.slice(l,l+it);await Promise.all(s.map(async u=>{const d=u.id?.toString()??String(u.text??"");try{n.set(d,await e(u.status,u.text))}catch{n.set(d,await e(u.status))}})),l+it<i.length&&(a=await at(a))}}return n}async function ro(e,t){const n=Array.isArray(e)?e:[];if(n.length===0)return[];const r=new Array(n.length),i=new Map,a=new Map;for(let c=0;c<n.length;c++){const f=n[c],h=t.resolveColor(f),p=t.resolveBaseSvg(f),b=f.showName&&f.name?String(f.name).trim():"",v=`${p}${h}${b}`;r[c]=v,b?a.has(v)||a.set(v,{key:v,color:h,text:b,svg:p}):i.has(v)||i.set(v,{key:v,color:h,svg:p})}const l=new Map;let s=performance.now();for(const c of i.values()){const f=await t.createBaseIconBySvg(c.svg,c.color);f&&l.set(c.key,{icon:f.icon,width:f.width,height:f.height,type:f.type,text:f.text}),s=await at(s)}let u=0;const d=[];for(const c of a.values()){const f=t.peekTextIconBySvg(c.svg,c.color,c.text);f?(u++,l.set(c.key,f)):d.push(c)}t.onBatchStats?.({uniqueText:a.size,textHits:u,textGenerated:d.length}),s=performance.now();for(const c of d)l.set(c.key,await t.createTextIconBySvg(c.svg,c.color,c.text)),s=await at(s);for(let c=0;c<n.length;c++){const f=l.get(r[c]);if(!f)continue;const h=n[c];h.icon=f.icon,h.width=f.width,h.height=f.height}return n}function io(e,t){const n=JSON.stringify(R);for(const[r,i]of Object.entries(e))R[r]={color:i,text:R[r]?.text||R.default.text};n!==JSON.stringify(R)&&t()}function ao(){const e={default:R.default.color};for(const[t,n]of Object.entries(R))t!=="default"&&(e[t]=n.color);return e}const oo="color:";function Un(e){return`${oo}${e}`}class ${constructor(){this.maxIconCache=$.DEFAULT_MAX_ICON_CACHE,this.activeTasks=0,this.iconCache=new Map,this.colorCache=new Map,this.baseSvgCache=new Map,this.svgKeys=new Map,this.svgCount=0,this.compositeCache=new Map,this.runtimeStats={textHits:0,textGenerated:0,uniqueText:0},this.dpr=typeof window<"u"&&window.devicePixelRatio||1,this.rawSvg="",this.defaultConfig={iconSize:32}}static{this.DEFAULT_MAX_ICON_CACHE=8e3}static{this.TASK_MAX_ICON_CACHE=5e4}static{this.COMPOSITE_CACHE_CAP=2e4}get effectiveCacheLimit(){return this.activeTasks>0?$.TASK_MAX_ICON_CACHE:this.maxIconCache}touchCache(t){const n=this.iconCache.get(t);n&&(this.iconCache.delete(t),this.iconCache.set(t,n))}evictCacheIfNeeded(){for(;this.iconCache.size>this.effectiveCacheLimit;){const t=this.iconCache.keys().next().value;if(t===void 0)break;this.iconCache.delete(t)}}static getInstance(){return $.instance||($.instance=new $),$.instance}beginIconTask(){this.activeTasks++}endIconTask(){this.activeTasks>0&&this.activeTasks--,this.activeTasks===0&&(this.evictCacheIfNeeded(),this.evictCompositeCacheIfNeeded())}resolveSvgKey(t){const n=this.svgKeys.get(t);if(n)return n;const r=`svg#${this.svgCount++}`;return this.svgKeys.set(t,r),r}initialize(t,n){this.rawSvg=t,n&&(this.defaultConfig=n),n?.maxIconCache&&n.maxIconCache>0&&(this.maxIconCache=n.maxIconCache),this.preGenerateBaseColors()}preGenerateBaseColors(){if(this.colorCache.size>0||!this.rawSvg)return;new Set([...Object.keys(R),"default"]).forEach(n=>this.ensureColoredSvg(n,rt(n)))}ensureColoredSvg(t,n){const r=Gn(t);return this.colorCache.has(r)||this.colorCache.set(r,this.buildColoredSvg(n)),this.colorCache.get(r)}buildColoredSvg(t){const n=this.defaultConfig.iconSize||32;try{return kn(this.rawSvg,t)}catch{return Vn(t,n)}}normalizeText(t){const n=t?.trim();return n===""?"":n}buildBaseIcon(t,n){const i=`${this.resolveSvgKey(t||this.rawSvg)}${n}`,a=this.baseSvgCache.get(i);if(a)return a;const l=this.defaultConfig.iconSize||32,s=t||this.rawSvg;let u;try{u=Pn(kn(s,n))}catch{u=Pn(Vn(n,l))}const d={icon:u,width:l,height:l,type:"base",status:Un(n),color:n};return this.baseSvgCache.set(i,d),d}createBaseIconCore(t,n){return this.buildBaseIcon(this.rawSvg,n)}createBaseIconBySvg(t,n){return this.buildBaseIcon(t,n)}compositeKey(t,n,r){return`${this.resolveSvgKey(t||this.rawSvg)}${n}${r}`}peekTextIconBySvg(t,n,r){const i=this.compositeCache.get(this.compositeKey(t,n,r));if(i)return{icon:i.icon,width:i.width,height:i.height,type:i.type,text:i.text}}async createTextIconBySvg(t,n,r){const i=this.compositeKey(t,n,r),a=this.compositeCache.get(i);if(a)return{icon:a.icon,width:a.width,height:a.height,type:a.type,text:a.text};const l=this.buildBaseIcon(t,n),s=this.normalizeText(r)??"",u=await Fn(l,s,this.defaultConfig,this.dpr),d={icon:u.icon,width:u.width,height:u.height,type:u.type,text:u.text};return u.degraded||(this.compositeCache.set(i,{...u,text:s,status:l.status}),this.activeTasks===0&&this.evictCompositeCacheIfNeeded()),d}evictCompositeCacheIfNeeded(){for(;this.compositeCache.size>$.COMPOSITE_CACHE_CAP;){const t=this.compositeCache.keys().next().value;if(t===void 0)break;this.compositeCache.delete(t)}}matchCache(t,n,r){return t.status===n&&t.text===r}async createIcon(t,n){return this.createIconCore(t,rt(t),n)}async createIconByColor(t,n){return this.createIconCore(Un(t),t,n)}async createIconCore(t,n,r){const i=this.normalizeText(r),a=On(t,i),l=this.iconCache.get(a);if(l&&this.matchCache(l,t,i))return this.touchCache(a),{icon:l.icon,width:l.width,height:l.height,type:l.type,text:l.text};const s=await this.createBaseIconCore(t,n),u=i?await Fn(s,i,this.defaultConfig,this.dpr):s;return u.degraded||(this.iconCache.set(a,{...u,text:i,status:t}),this.evictCacheIfNeeded()),{icon:u.icon,width:u.width,height:u.height,type:u.type,text:u.text}}batchCreateIcons(t){return no(this.createIcon.bind(this),t)}batchCreatePointIcons(t){const n={resolveColor:r=>r.color||rt(r.status??"default"),resolveBaseSvg:r=>r.svg||this.rawSvg,createBaseIconBySvg:(r,i)=>Promise.resolve(this.buildBaseIcon(r,i)),createTextIconBySvg:(r,i,a)=>this.createTextIconBySvg(r,i,a),peekTextIconBySvg:(r,i,a)=>this.peekTextIconBySvg(r,i,a),iconSize:this.defaultConfig.iconSize||32,textConfig:this.defaultConfig.textConfig,dpr:this.dpr,onBatchStats:r=>{this.runtimeStats.textHits+=r.textHits,this.runtimeStats.textGenerated+=r.textGenerated,this.runtimeStats.uniqueText+=r.uniqueText}};return ro(t,n)}async createConditionalIcon(t,n){const r=n();return this.createIcon(t,r||void 0)}getIconHeightInfo(){const t=this.defaultConfig.iconSize||32,n=this.defaultConfig.textConfig||{},r=(n.fontSize??12)+(n.padding??0)*2;return{iconHeight:t,textHeight:r,totalHeight:t+r}}clearCache(){this.iconCache.clear(),this.colorCache.clear(),this.baseSvgCache.clear(),this.compositeCache.clear(),this.svgKeys.clear(),this.svgCount=0,this.runtimeStats={textHits:0,textGenerated:0,uniqueText:0},this.dpr=typeof window<"u"&&window.devicePixelRatio||1,this.preGenerateBaseColors()}clearCacheByStatus(t){for(const n of[...this.iconCache.keys()])n.startsWith(`${t}_`)&&this.iconCache.delete(n);this.colorCache.delete(Gn(t))}clearTextIconCache(t,n){this.iconCache.delete(On(t,n))}getCacheStats(){return{iconCache:this.iconCache.size,colorCache:this.colorCache.size,baseSvg:this.baseSvgCache.size,composite:this.compositeCache.size,total:this.iconCache.size+this.colorCache.size+this.baseSvgCache.size+this.compositeCache.size}}getRuntimeStats(){return{...this.runtimeStats}}getConfig(){return{...this.defaultConfig}}updateStatusColorMap(t){io(t,()=>this.clearCache())}getStatusColorMap(){return ao()}buildFallbackTextIcon(t,n){return Ja(t,n,this.defaultConfig)}}const lo=$.getInstance();function so(e){const t=e?.type,n=e?.data;if(t==="circle"&&Array.isArray(n?.center)&&n.center.length>=2)return{type:"circle",center:[n.center[0],n.center[1]],radius:Math.abs(Number(n.radius)||0)};if((t==="polygon"||t==="rectangle"||t==="triangle")&&Array.isArray(n?.path)&&n.path.length>=3){const r=n.path.map(i=>Array.isArray(i)&&i.length>=2?[Number(i[0]),Number(i[1])]:i&&typeof i.lng=="number"&&typeof i.lat=="number"?[i.lng,i.lat]:null).filter(i=>i!==null);if(r.length>=3)return{type:t,coordinates:r}}return null}var $n=(e=>(e.INIT_FAILED="INIT_FAILED",e.LOAD_SCRIPT_FAILED="LOAD_SCRIPT_FAILED",e.INVALID_PARAMS="INVALID_PARAMS",e.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",e.OPERATION_FAILED="OPERATION_FAILED",e))($n||{});class co extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="MapError"}}g.ANIMATION_DURATION=Te,g.AppButton=Ha,g.AppIcon=G,g.AppInput=Sn,g.AppSpinner=et,g.CAMERA_CONFIG=Ee,g.ConfigManager=St,g.DEFAULT_CONTOUR_CONFIG=wt,g.DEFAULT_LIBS_URL=be,g.DEFAULT_MAP_CONFIG=ze,g.DEFAULT_MASK_CONFIG=vt,g.DEFAULT_POSITION=te,g.DEFAULT_TOOLS=Re,g.DEFAULT_TRAJECTORY_CONFIG=yt,g.ErrorCode=$n,g.EventBus=Be,g.GEOMETRY_CONFIG=H,g.GameLoading=Je,g.ICON_MAP=Qe,g.IconManager=$,g.LIBRARIES=Oe,g.MORPH_3D_DELAY=bt,g.MapContainer=Wa,g.MapControls=In,g.MapError=Tn,g.MapErrorClass=co,g.MapManager=Z,g.MapStatus=Ln,g.MapTools=Mn,g.MapView=Nn,g.NoResultsPanel=tt,g.PERFORMANCE_CONFIG=ne,g.READY_DELAY=Ct,g.ResourceManager=Dt,g.STATUS_COLOR_MAP=R,g.ScriptLoader=It,g.SearchResultsPanel=Dn,g.WAVE_REMOVE_DELAY=Et,g.buildGeoServerWmtsUrl=gn,g.cartesianFromCoord=$r,g.cartesianToDegrees=De,g.cartographicToDegrees=Wt,g.closeCoordinates=$e,g.createGeoServerWmtsProvider=pn,g.createSearchShapeFromDrawEvent=so,g.eventBus=Xn,g.getBmgl=D,g.getDefaultToolbarEntries=pt,g.getDefaultTools=mt,g.getDrawToolEntries=gt,g.getDrawToolEntry=ht,g.getEntityType=$t,g.getLogLevel=Kn,g.getStatusInfo=ir,g.getSvg=En,g.iconManager=lo,g.isIconName=bn,g.logger=w,g.mapManager=se,g.normalizeMaskConfig=xe,g.normalizeTrajectoryConfig=qe,g.rectangleToPath=We,g.registerDrawTool=Zn,g.resolveUrl=Ge,g.scriptLoader=Ue,g.setBmgl=At,g.setLogLevel=qn,g.useMap=Pt,g.useMapCircleWave=tn,g.useMapContour=ln,g.useMapDraw=Jt,g.useMapEntity=Yt,g.useMapLayers=on,g.useMapLighting=hn,g.useMapMask=un,g.useMapPoint=Ut,g.useMapPopup=en,g.useMapTrajectory=sn,g.useMapView=Cn,g.useMapWeather=fn,g.waitForBmgl=xt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
76
+ `}const dn={rain:.5,snow:.3};function fn(e,t){const n=o.ref({type:"clear",active:!1});let r=null;const i=()=>{const u=e.value;r&&u?.scene?.postProcessStages&&(u.scene.postProcessStages.remove(r),r=null)},a=(u,d)=>{const c=e.value,f=D();if(!c?.scene?.postProcessStages||!f)return;if(i(),u==="clear"||!dn[u]){n.value={type:"clear",active:!1};return}const h=d?.opacity??t?.opacity??dn[u],p=u==="rain"?ya(h):va(h);r=new f.PostProcessStage({name:`weather_${u}`,fragmentShader:p}),c.scene.postProcessStages.add(r),n.value={type:u,active:!0}},l=()=>{i(),r=null,n.value={type:"clear",active:!1}},s=()=>{l()};return o.onUnmounted(()=>{s()}),{state:n,setWeather:a,clear:l,destroy:s}}const Ca=6,ba=18,Ea=20;function Ta(e){return{day:e?.dayStartHour??Ca,dusk:e?.duskStartHour??ba,night:e?.nightStartHour??Ea}}function Sa(e,t){const{day:n,dusk:r,night:i}=Ta(t);return e>=n&&e<r?"day":e>=r&&e<i?"dusk":"night"}const Xe={x:.5781,y:-.5781,z:.5758};function Da(e,t){if(e==="day")return new t.SunLight;const n=e==="night";return new t.DirectionalLight({direction:new t.Cartesian3(Xe.x,Xe.y,Xe.z),color:n?new t.Color(.9,.925,1):t.Color.fromCssColorString("#deca7c"),intensity:n?.5:1})}function hn(e,t,n){const r=n?.is3D??o.ref(!0),i=o.ref(null),a=o.ref({enabled:!!t?.enabled,mode:"auto",period:"night",hour:0});let l,s,u;const d=()=>{const m=t?.now?.()??new Date;a.value.hour=m.getHours(),a.value.mode=i.value?"manual":"auto",a.value.period=i.value??Sa(a.value.hour,t)},c=()=>{const m=e.value;if(!m?.scene){u=void 0;return}const C=m.scene;(u!==void 0||l!==void 0)&&(C.light=l,s!==void 0&&(C.globe.enableLighting=s)),u=void 0},f=()=>{const m=e.value,C=D();if(!m?.scene||!C)return;const y=m.scene;s===void 0&&(l=y.light,s=!!y.globe.enableLighting),y.globe.enableLighting=!0;const E=Da(a.value.period,C);y.light=E,u=E},h=()=>{d(),a.value.enabled&&r.value?f():c()},p=m=>{a.value.enabled=!!m,h()},b=m=>{i.value=m==="auto"?null:m,h()},v=()=>{a.value.enabled=!1,c()};return o.onUnmounted(()=>v()),d(),{state:a,setEnabled:p,setPeriod:b,apply:h,destroy:v}}function gn(e,t){const n=e.layer||"PostGIS:dommap";return`${e.baseUrl.replace(/\/$/,"")}?layer=${n}&geo-token=${t}&style=&tilematrixset=EPSG%3A3857&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fvnd.jpeg-png&TileMatrix=EPSG%3A3857%3A{TileMatrix}&TileCol={TileCol}&TileRow={TileRow}`}function pn(e){return async()=>{const t=e.token;if(!t)throw new Error("未提供 GeoServer 令牌(geoserver.token),无法拼接 WMTS 地址");return gn(e,t)}}function Ma(){return{mapType:o.ref("3d"),mapBase:o.ref("bigemap"),currentDrawType:o.ref(null),loadingTitle:o.ref("地图加载中"),loadingSubtitle:o.ref("正在初始化地理数据..."),theme:o.ref("dark"),mapNameVisible:o.ref(!1)}}function Le(e){return typeof e=="number"&&!Number.isNaN(e)}function Ia(e){const t=o.ref(""),n=o.ref([]),r=o.ref(!1),i=o.ref(!1),a=o.ref(!1),l=o.ref(-1),s=o.ref(-1);let u,d,c=0;const f=o.computed(()=>t.value.trim()?n.value:[]),h=async S=>{const A=++c;try{const V=await e.searchByText({field:["name"],keyword:S,limit:10,caseSensitive:!1});if(A!==c)return;n.value=V||[],a.value=!1}catch(V){if(A!==c)return;w.error("搜索查询失败:",V),n.value=[],a.value=!0}finally{A===c&&(i.value=!1)}},p=S=>{if(t.value=S,u&&clearTimeout(u),!S.trim()){n.value=[],r.value=!1,a.value=!1;return}i.value=!0,r.value=!0,u=setTimeout(()=>{h(S.trim())},e.debounceTime)},b=S=>Le(S.altitude)?S.altitude+tr:e.position?.height??te.height,v=S=>{if(!Le(S.lng)||!Le(S.lat))return;e.setView(S.lng,S.lat,b(S));const A=e.addWave({position:[S.lng,S.lat,Le(S.altitude)?S.altitude:0],config:{color:"#0a84ff",radius:er,duration:Te.WAVE}});d&&clearTimeout(d),d=setTimeout(()=>e.removeWave(A),Et)},m=(S,A)=>{s.value=A,v(S),r.value=!1},C=S=>{const A=f.value.length;A!==0&&(l.value=(l.value+S+A)%A)},y=()=>{const S=l.value,A=f.value[S];A&&m(A,S)},E=()=>{r.value=!1},_=()=>{t.value="",n.value=[],r.value=!1,a.value=!1,s.value=-1,l.value=-1};return o.onUnmounted(()=>{u&&clearTimeout(u),d&&clearTimeout(d)}),{searchInput:t,searchList:n,showResults:r,isSearching:i,searchError:a,highlightIndex:l,selectedIndex:s,filteredList:f,handleInputSearch:p,handleResultClick:m,moveHighlight:C,selectHighlighted:y,closeResults:E,clearSearch:_}}function Aa(e){e.toggleMapTypeCore();const n=(e.mapType.value==="3d"?"2d":"3d")==="3d"?Qn:Jn;setTimeout(()=>e.redrawAllEntities(),n)}function xa(e){e.position&&e.setView(e.position.lng,e.position.lat,e.position.height)}async function Ze(e){e.loadingSubtitle.value="正在添加卫星影像图层...",await e.addImageryLayer("bigemap.dc-satellite"),e.loadingSubtitle.value="正在添加街道地名图层...",await e.addImageryLayer("bigemap.dc-street")}async function mn(e){if(!e.wmtsUrlProvider)throw new Error("未配置 wmtsUrlProvider,无法切换到生产底图");const t=await e.wmtsUrlProvider();if(!t)throw new Error("wmtsUrlProvider 未返回有效地址,无法切换到生产底图");await e.addWmtsLayer(t,"geoserver")}async function La(e){if(!e.map.value)return;const t=e.mapBase.value,n=t==="bigemap"?"geoserver":"bigemap";e.loadingSubtitle.value="正在切换地图底图...";try{await e.removeAllLayers(),n==="bigemap"?await Ze(e):await mn(e),e.mapBase.value=n}catch(r){w.error("切换地图底图失败:",r);try{await e.removeAllLayers(),t==="bigemap"?await Ze(e):await mn(e)}catch(i){w.error("恢复原底图失败:",i)}}finally{e.loadingSubtitle.value="正在初始化地理数据..."}}async function Na(e){if(e.map.value)try{await Ze(e)}catch(t){w.error("加载默认图层失败:",t)}}function ka(e){return t=>{if(e.getIsDrawing()||!e.map.value||!t.position)return;e.removePopup();const n=e.map.value.scene.pick(t.position);if(n&&n.primitive&&n.primitive.pointData){const r=n.primitive.pointData;e.onPointClick(r),e.showPointPopup(wn(r),{offsetX:0,offsetY:-25})}}}function _a(e,t){const n=document.querySelector(".map-point-popup");if(!n)return!1;const r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,l=r.top+e.y;return a>=i.left-8&&a<=i.right+8&&l>=i.top-8&&l<=i.bottom+8}function Va(e){let t=null;const n=r=>r?.id??r?.pointNo??r?.name??"";return r=>{if(e.getIsDrawing()||!e.map.value||!r.endPosition)return;const i=e.map.value.scene.canvas,a=e.map.value.scene.pick(r.endPosition);if(a&&a.primitive&&a.primitive.pointData){const l=a.primitive.pointData,s=n(l);s!==t&&(t=s,e.showPointPopup(wn(l),{offsetX:0,offsetY:-25}))}else _a(r.endPosition,i)||(t=null,e.removePopup())}}function wn(e){return{...e}}function Pa(e){if(!e.map.value)return null;const t=N(),n=new t.ScreenSpaceEventHandler(e.map.value.scene.canvas);return n.setInputAction(ka(e),t.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(Va(e),t.ScreenSpaceEventType.MOUSE_MOVE),n}function yn(e){if(e&&typeof e.destroy=="function")try{e.destroy()}catch(t){w.warn("[useMapView] destroy click listener error:",t)}}const vn=["containerId","position","serverUrl","accessToken","libsUrl","showSearch","showControls","showDeleteControls","showStatus","tools","searchDebounceTime","wmtsUrlProvider","geoserver","contourConfig","lightingConfig"],Ba={containerId:String,position:Object,serverUrl:String,accessToken:String,libsUrl:String,showSearch:Boolean,showControls:Boolean,showDeleteControls:Boolean,showStatus:Boolean,tools:Array,searchDebounceTime:Number,wmtsUrlProvider:Function,geoserver:Object,contourConfig:Object,lightingConfig:Boolean};function Ra(e,t){const n=e??{},r={};for(const i of vn)r[i]=n[i];return{...r,theme:t.theme,popupConfig:t.popupConfig}}function Cn(e,t){const n=Ma(),r=o.computed(()=>!!e.showSearch),i=o.computed(()=>e.showControls!==!1),a=o.computed(()=>e.showDeleteControls!==!1),l=o.computed(()=>!!e.showStatus),s=e.wmtsUrlProvider??(e.geoserver?pn(e.geoserver):void 0),u=o.computed(()=>!!s),d=o.computed(()=>({containerId:e.containerId,position:e.position||te,serverUrl:e.serverUrl,accessToken:e.accessToken,libsUrl:e.libsUrl})),{map:c,state:f,initMap:h,setView:p,toggleMapType:b}=Pt(d.value),{loadPoints:v,searchByText:m,updatePoints:C,clearPoints:y,searchByShape:E}=Ut(c),{drawEntity:_,deleteEntity:S,redrawAllEntities:A}=Yt(c),{startDrawing:V,cancelDrawing:U,clearAllDrawings:z,removeDrawing:M,setCallback:I,getIsDrawing:F}=Jt(c),{showPointPopup:k,removePopup:Y}=en(c,void 0,{displayConfig:e.popupConfig}),{addWave:K,removeWave:pe}=tn(c),{addWmtsLayer:me,addImageryLayer:X,removeAllLayers:T,setLayerVisible:L}=on(c),{contourVisible:P,setContourVisible:W,reapply:ie,remove:ee}=ln(c,e.contourConfig),O=sn(c,void 0,{serverUrl:e.serverUrl,libsUrl:e.libsUrl}),we=un(c),ke=fn(c),ae=hn(c,{enabled:e.lightingConfig===!0},{is3D:o.computed(()=>f.value.mapType==="3d")});n.theme.value=e.theme||"dark";const uo=Ia({searchByText:m,setView:p,addWave:K,removeWave:pe,position:e.position,debounceTime:e.searchDebounceTime??ne.DEBOUNCE_DELAY});let ot=0;const lt=(x,ut)=>{ot+=1,n.loadingTitle.value=x,n.loadingSubtitle.value=ut,f.value.isLoading=!0},Wn=()=>{f.value.isLoading=!1},fo=(x,ut,Eo)=>{lt(x,ut);const To=ot;setTimeout(()=>{To===ot&&Wn()},Eo)},ho="bigemap.dc-street",st=()=>{L(ho,n.mapNameVisible.value)},Hn=x=>{n.mapNameVisible.value=!!x,st()},jn=x=>{n.theme.value=x},_e={map:c,mapType:n.mapType,mapBase:n.mapBase,loadingSubtitle:n.loadingSubtitle,position:e.position,wmtsUrlProvider:s,toggleMapTypeCore:b,redrawAllEntities:A,setView:p,removeAllLayers:T,addImageryLayer:X,addWmtsLayer:me},go={map:c,getIsDrawing:F,removePopup:Y,showPointPopup:k,onPointClick:t.onPointClick},po=()=>{z(),t.emit("clear-button-click"),t.emit("clear-draw")},mo=x=>{n.currentDrawType.value=x,V(x)},wo=()=>{n.currentDrawType.value=null},yo=()=>{I(x=>{wo(),x.operation==="draw"||x.operation==="edit"?t.emit("draw-end",x):x.operation==="delete"?t.emit("draw-delete",x):x.operation==="clear"&&t.emit("draw-clear",x)})};let ye;const vo=()=>{ye&&clearTimeout(ye),ye=setTimeout(()=>{f.value.isLoading=!1,t.emit("ready"),t.emit("init")},Ct)},Co=()=>{const x={map:c,state:f,setView:p,loadPoints:v,searchByText:m,searchByShape:E,updatePoints:C,clearPoints:y,startDrawing:V,stopDrawing:U,clearDrawings:z,removeDrawing:M,drawEntity:_,deleteEntity:S,setMapNameVisible:Hn,setContourVisible:W,trajectoryState:O.state,loadTrajectory:O.load,playTrajectory:O.play,pauseTrajectory:O.pause,stopTrajectory:O.stop,setTrajectorySpeed:O.setSpeed,jumpTrajectoryTo:O.jumpTo,clearTrajectory:O.clear,maskState:we.state,setMask:we.setMask,setMaskVisible:we.setVisible,clearMask:we.clear,weatherState:ke.state,setWeather:ke.setWeather,clearWeather:ke.clear,lightingState:ae.state,setLightingEnabled:ae.setEnabled,setLightingPeriod:ae.setPeriod,setTheme:jn};t.expose(x),t.emit("expose",x)};let Ve=null,ct=!1;o.onUnmounted(()=>{yn(Ve),Ve=null,ye&&clearTimeout(ye)});const bo=async()=>{try{lt("地图加载中","正在初始化地理数据..."),await h(),f.value.isLoading=!0,await Na(_e),st(),yn(Ve),Ve=Pa(go),yo(),ae.apply(),n.mapType.value=f.value.mapType,e.position&&await p(e.position.lng,e.position.lat,e.position.height),vo(),Co()}catch(x){throw f.value.isLoading=!1,f.value.error=x instanceof Error?x:new Error(String(x)),t.emit("error",x),x}};return{...n,state:f,map:c,showSearch:r,showControls:i,showDeleteControls:a,showStatus:l,wmtsEnabled:u,search:uo,onDelete:po,handleStartDrawing:mo,setMapNameVisible:Hn,setContourVisible:W,contourVisible:P,trajectoryState:O.state,maskState:we.state,weatherState:ke.state,lightingState:ae.state,setTheme:jn,toggleMapType:()=>{fo("视图切换中","正在切换 2D/3D 视图...",800),Aa(_e),n.mapType.value=f.value.mapType,f.value.mapType==="2d"?ee():ie(),O.reapply(),ae.apply()},resetView:()=>xa(_e),toggleMapBaseLayer:async()=>{if(!ct){ct=!0,lt("底图切换中","正在切换地图底图...");try{await La(_e),st()}finally{ct=!1,Wn()}}},init:bo}}const Je=o.defineComponent({name:"GameLoading",props:{visible:{type:Boolean,default:!1},title:{type:String,default:"地图加载中"},subtitle:{type:String,default:"正在初始化地理数据..."}},setup(e){return()=>e.visible?o.createVNode("div",{class:"apple-loading-overlay"},[o.createVNode("div",{class:"apple-loading-content"},[o.createVNode("div",{class:"apple-spinner",role:"status","aria-label":"加载中"},null),o.createVNode("h2",{class:"apple-loading-title"},[e.title]),o.createVNode("p",{class:"apple-loading-subtitle"},[e.subtitle])])]):null}}),Qe={"2d":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><!-- 2D 平面地图:2x2 坐标网格瓦片,表达俯视平面视角 -->\r
77
+ <path fill="#000000" d="M4 3.5h6.7a.5.5 0 0 1 .5.5v6.7a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5zm9.3 0H20a.5.5 0 0 1 .5.5v6.7a.5.5 0 0 1-.5.5h-6.7a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5zM4 12.8h6.7a.5.5 0 0 1 .5.5V20a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5v-6.7a.5.5 0 0 1 .5-.5zm9.3 0H20a.5.5 0 0 1 .5.5V20a.5.5 0 0 1-.5.5h-6.7a.5.5 0 0 1-.5-.5v-6.7a.5.5 0 0 1 .5-.5z"/></svg>\r
78
+ `,"3d":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><!-- 3D 立体:等轴测立方体(顶面 + 左右侧面),表达三维视角 -->\r
79
+ <path fill="#000000" d="M12 2.6 20.6 7.1 12 11.6 3.4 7.1 12 2.6z"/>\r
80
+ <path fill="#000000" d="M3.4 7.1v9.6L12 21.4v-9.8L3.4 7.1z"/>\r
81
+ <path fill="#000000" d="M20.6 7.1v9.6L12 21.4v-9.8l8.6-4.5z"/></svg>\r
82
+ `,area:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438544903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19690" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M921.6 905.6H64V118.4h300.8v-64H0v915.2h985.6v-288h-64v224z m-640-467.2v-44.8h-64v364.8h64v-156.8c0-48 0-83.2 9.6-102.4 9.6-19.2 25.6-35.2 38.4-48 19.2-9.6 38.4-12.8 57.6-12.8 19.2 0 35.2 3.2 48 12.8s19.2 25.6 25.6 38.4c3.2 12.8 3.2 41.6 3.2 83.2v188.8h57.6v-144c0-48 3.2-83.2 9.6-102.4 3.2-25.6 19.2-38.4 38.4-54.4 19.2-12.8 38.4-19.2 57.6-19.2 19.2 0 38.4 3.2 48 12.8 12.8 9.6 19.2 25.6 25.6 38.4 3.2 19.2 3.2 41.6 3.2 76.8v201.6h64v-201.6c0-67.2-12.8-115.2-38.4-140.8-25.6-25.6-54.4-38.4-86.4-38.4s-57.6 9.6-83.2 25.6-38.4 32-48 51.2c-3.2-19.2-19.2-35.2-38.4-48-25.6-12.8-48-25.6-76.8-25.6-57.6 0-92.8 6.4-115.2 44.8z m739.2-51.2v51.2h-214.4v-35.2c22.4-41.6 57.6-80 102.4-112 44.8-32 60.8-60.8 60.8-86.4 0-32-16-44.8-51.2-44.8-28.8 0-44.8 19.2-54.4 54.4L809.6 192c19.2-51.2 57.6-80 112-80 64 3.2 96 32 102.4 89.6 6.4 41.6-22.4 80-80 115.2-35.2 25.6-54.4 48-70.4 67.2 0 3.2 147.2 3.2 147.2 3.2z" p-id="19691" fill="#515151"></path></svg>',aim:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\r
83
+ <circle cx="12" cy="12" r="9"></circle>\r
84
+ <circle cx="12" cy="12" r="4.5"></circle>\r
85
+ <circle cx="12" cy="12" r="0.6" fill="currentColor"></circle>\r
86
+ </svg>\r
87
+ `,azimuth:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438589408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24787" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M456 697.6c17.6-11.2 33.6-20.8 52.8-32l-38.4-52.8c-17.6 14.4-32 25.6-48 38.4 11.2 16 22.4 30.4 33.6 46.4z" fill="#515151" p-id="24788"></path><path d="M73.6 940.8C54.4 934.4 43.2 915.2 48 896L300.8 76.8c6.4-17.6 25.6-28.8 43.2-24 17.6 6.4 28.8 25.6 24 43.2L116.8 915.2c-4.8 20.8-24 32-43.2 25.6z" fill="#515151" p-id="24789"></path><path d="M48 908.8c0-19.2 16-36.8 35.2-36.8h856c19.2 0 35.2 16 35.2 35.2 0 19.2-16 35.2-35.2 35.2H83.2C64 944 48 928 48 908.8z" fill="#515151" p-id="24790"></path><path d="M292.8 550.4c-25.6-16-51.2-30.4-78.4-41.6l28.8-65.6c32 12.8 62.4 28.8 89.6 48l-40 59.2zM470.4 747.2c-30.4-60.8-72-113.6-123.2-156.8l46.4-54.4c59.2 49.6 105.6 110.4 140.8 179.2l-64 32zM518.4 896c-4.8-28.8-11.2-59.2-22.4-86.4l68.8-24c11.2 32 19.2 65.6 25.6 99.2l-72 11.2z" fill="#515151" p-id="24791"></path><path d="M688 456c40 0 72 32 72 72s-32 72-72 72-72-32-72-72 32-72 72-72m0-72c-80 0-144 64-144 144s64 144 144 144 144-64 144-144-64-144-144-144z" fill="#515151" p-id="24792"></path></svg>',base:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><!-- 底图图层:三层堆叠图例,表达地图图层切换 -->\r
88
+ <path fill="#000000" d="M12 14.5 2.8 9.7 12 4.9l9.2 4.8L12 14.5z"/>\r
89
+ <path fill="#000000" d="M2.8 11.2 12 16l9.2-4.8-1.6-.9L12 14.2 4.4 10.3l-1.6.9z"/>\r
90
+ <path fill="#000000" d="M2.8 14.7 12 19.5l9.2-4.8-1.6-.9L12 17.7 4.4 13.8l-1.6.9z"/></svg>\r
91
+ `,circle:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439464662" class="icon" viewBox="0 0 1152 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="33927" xmlns:xlink="http://www.w3.org/1999/xlink" width="225" height="200"><path d="M1056.810667 606.890667c-45.781333 172.373333-204.544 305.237333-402.176 334.592v59.264h-165.418667v-59.264c-197.632-29.354667-356.394667-162.261333-402.133333-334.592H16.554667v-165.418667h62.08c30.592-191.274667 198.101333-342.4 410.538666-374.016V8.277333h165.418667v59.221334c212.437333 31.573333 379.946667 182.741333 410.538667 374.016h62.08v165.418666h-70.442667v-0.042666z m-61.568 0h-33.450667v-165.418667h43.349333c-29.866667-158.037333-170.410667-284.202667-350.549333-314.24v46.464h-165.418667V127.146667c-180.053333 30.037333-320.554667 156.202667-350.506666 314.24h43.349333v165.418666h-33.408c44.074667 139.264 175.786667 247.338667 340.565333 274.773334v-46.293334h165.418667v46.378667c164.864-27.434667 296.576-135.509333 340.650667-274.816zM528.64 134.272h86.613333V47.616h-86.613333v86.613333z m0 827.050667h86.613333v-86.613334h-86.613333v86.613334z m-472.618667-393.813334h86.613334V480.853333h-86.613334v86.613334z m945.194667 0h86.656V480.853333h-86.613333v86.613334z" p-id="33928" fill="#515151"></path></svg>',clear:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766223878706" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7643" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M921.6 512 880.64 512 972.8 972.8C972.8 1001.088 949.888 1024 921.6 1024L102.4 1024C74.112 1024 51.2 1001.088 51.2 972.8L143.36 512 102.4 512C74.112 512 51.2 489.088 51.2 460.8L51.2 409.6C51.2 381.312 74.112 358.4 102.4 358.4L409.6 358.4 409.6 102.4C409.6 45.8496 455.4496 0 512 0 568.5504 0 614.4 45.8496 614.4 102.4L614.4 358.4 921.6 358.4C949.888 358.4 972.8 381.312 972.8 409.6L972.8 460.8C972.8 489.088 949.888 512 921.6 512ZM102.4 972.8 257.6384 972.8C254.1056 967.5008 252.4416 960.9472 253.6192 954.1888L284.7488 726.5024C287.2064 712.6016 300.4672 703.2832 314.3936 705.7408 328.32 708.1984 337.6128 721.4848 335.1808 735.4112L304.0512 963.072C303.4112 966.6816 302.0032 969.9328 300.1088 972.8L921.6 972.8 819.2 512 204.8 512 102.4 972.8ZM563.2 102.4C563.2 74.112 540.288 51.2 512 51.2 483.712 51.2 460.8 74.112 460.8 102.4L460.8 358.4 563.2 358.4 563.2 102.4ZM921.6 409.6 102.4 409.6 102.4 460.8 921.6 460.8 921.6 409.6Z" fill="#272636" p-id="7644"></path></svg>',contour:`<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#515151" stroke-width="72" stroke-linecap="round" stroke-linejoin="round"><path d="M180 292c56-72 128 88 186 14s128 88 186 14 128 88 186 14"/><path d="M104 500c74-96 148 132 222 36s148 132 222 36 148 132 222 36 148 132 222 36"/><path d="M40 720c112-128 224 176 336 48s224 176 336 48 224 176 336 48"/></g></svg>\r
92
+ `,delete:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766223494940" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7307" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M635.712 78.72A127.808 127.808 0 0 0 569.472 54.72a633.792 633.792 0 0 0-52.224-1.408h-10.56a542.08 542.08 0 0 0-50.56 1.408 127.744 127.744 0 0 0-67.52 25.024 127.232 127.232 0 0 0-32.896 39.552c-7.808 13.696-15.552 30.72-24.32 50.048l-15.232 33.28H128A42.688 42.688 0 1 0 128 288h32V832A160 160 0 0 0 320 992h384a160 160 0 0 0 160-160V288h32a42.688 42.688 0 0 0 0-85.312h-184.256l-18.176-37.568a650.176 650.176 0 0 0-24.96-48.32 127.232 127.232 0 0 0-32.896-38.08zM616.96 202.688H409.92a556.16 556.16 0 0 1 19.84-41.088 39.232 39.232 0 0 1 34.048-21.888c11.392-1.024 26.176-1.024 49.664-1.024 22.912 0 37.376 0 48.384 1.024a39.296 39.296 0 0 1 33.6 21.056c5.632 9.28 11.84 21.952 21.504 41.92z m-211.648 563.712a32 32 0 0 1-32-32v-256a32 32 0 0 1 64 0v256a32 32 0 0 1-32 32z m245.376-288v256a32 32 0 1 1-64 0v-256a32 32 0 0 1 64 0z" fill="#333333" p-id="7308"></path></svg>',location:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\r
93
+ <path d="M12 21s-6-5.686-6-10a6 6 0 0 1 12 0c0 4.314-6 10-6 10z"></path>\r
94
+ <circle cx="12" cy="11" r="2.5"></circle>\r
95
+ </svg>\r
96
+ `,polygon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439429384" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="30246" xmlns:xlink="http://www.w3.org/1999/xlink" width="200.1953125" height="200"><path d="M358.5 1021.5c-52.93 0-96-43.07-96-96 0-13.12 2.6-25.84 7.74-37.81l0.12-0.27-141.99-184.66-0.34 0.11a95.806 95.806 0 0 1-29.53 4.64c-52.93 0-96-43.07-96-96s43.07-96 96-96c7.56 0 15.09 0.89 22.41 2.64l0.36 0.09 213.67-370.08-0.16-0.25c-9.34-15.12-14.28-32.54-14.28-50.39 0-52.93 43.07-96 96-96 40.36 0 76.66 25.5 90.34 63.46l0.09 0.26 300.27 61.72 0.19-0.26c18.01-25.16 47.21-40.18 78.11-40.18 52.93 0 96 43.07 96 96 0 36.49-20.26 69.36-52.88 85.79l-0.31 0.16 41.76 393.5 0.25 0.12a96.184 96.184 0 0 1 39.11 34.79c9.85 15.41 15.06 33.27 15.06 51.65 0 52.93-43.07 96-96 96-31.18 0-60.53-15.24-78.52-40.76l-0.22-0.31-396.7 138.78-0.05 0.29c-8.2 45.76-47.94 78.97-94.5 78.97z m0-192c34.03 0 64.82 17.44 82.36 46.66l0.21 0.35L832.93 739.4l0.03-0.32c3.81-39.11 31.82-72.49 69.7-83.05l0.41-0.11-40.34-380.14-0.34-0.08c-39.73-9.82-68.86-43.81-72.49-84.56l-0.03-0.37-283.9-58.36-0.15 0.39c-7 17.7-19.01 32.81-34.72 43.69-16.08 11.13-34.96 17.02-54.59 17.02-9.75 0-19.37-1.46-28.59-4.33l-0.38-0.12L176.19 555.1l0.19 0.26c11.86 16.42 18.12 35.83 18.12 56.14 0 17.74-4.88 35.06-14.11 50.11l-0.18 0.29 136.28 177.25 0.37-0.18c13.04-6.28 27.05-9.47 41.64-9.47z" p-id="30247" fill="#515151"></path><path d="M416.5 2c40.15 0 76.26 25.37 89.87 63.13l0.19 0.53 0.55 0.11 299.68 61.6 0.64 0.13 0.38-0.53c8.66-12.1 20.19-22.15 33.34-29.06C854.71 90.77 870.06 87 885.5 87c52.66 0 95.5 42.84 95.5 95.5 0 18.03-5.05 35.58-14.6 50.77a95.81 95.81 0 0 1-38 34.57l-0.62 0.31 0.07 0.69 41.7 392.88 0.06 0.55 0.5 0.24c15.91 7.71 29.36 19.68 38.91 34.61 9.8 15.33 14.98 33.09 14.98 51.38 0 52.66-42.84 95.5-95.5 95.5-31.02 0-60.22-15.16-78.11-40.55l-0.43-0.62-0.71 0.25-396.09 138.59-0.55 0.19-0.1 0.57c-3.9 21.77-15.4 41.67-32.39 56.03-17.2 14.54-39.08 22.54-61.62 22.54-52.66 0-95.5-42.84-95.5-95.5 0-13.05 2.59-25.71 7.7-37.61l0.23-0.54-0.36-0.46-141.59-184.16-0.43-0.56-0.67 0.22A95.43 95.43 0 0 1 98.5 707C45.84 707 3 664.16 3 611.5S45.84 516 98.5 516c7.52 0 15.01 0.88 22.29 2.62l0.73 0.17 0.37-0.65 213.33-369.5 0.3-0.52-0.31-0.51c-9.29-15.04-14.2-32.37-14.2-50.12C321 44.84 363.84 2 416.5 2m0 191c-9.7 0-19.27-1.45-28.44-4.31l-0.76-0.24-0.4 0.69-210.98 365.43-0.32 0.56 0.38 0.52C187.77 571.99 194 591.3 194 611.5c0 17.64-4.85 34.88-14.03 49.85l-0.36 0.59 0.42 0.55 135.82 176.65 0.5 0.64 0.73-0.35c12.97-6.26 26.91-9.43 41.42-9.43 16.79 0 33.3 4.42 47.75 12.78a96.095 96.095 0 0 1 34.18 33.63l0.42 0.7 0.77-0.27 391.17-136.87 0.6-0.21 0.06-0.64c1.88-19.33 9.53-37.41 22.11-52.28 12.44-14.71 28.77-25.2 47.22-30.35l0.82-0.23-0.09-0.84-40.26-379.37-0.07-0.7-0.68-0.17c-39.52-9.77-68.5-43.58-72.11-84.12l-0.07-0.74-0.73-0.15-283.12-58.2-0.82-0.17-0.31 0.78c-6.96 17.61-18.91 32.64-34.54 43.46-15.99 11.11-34.77 16.96-54.3 16.96m0-192C363.2 1 320 44.2 320 97.5c0 18.58 5.26 35.93 14.35 50.65l-213.33 369.5A96.669 96.669 0 0 0 98.5 515C45.2 515 2 558.2 2 611.5S45.2 708 98.5 708a96.5 96.5 0 0 0 29.69-4.66l141.59 184.15c-5 11.66-7.78 24.51-7.78 38.01 0 53.3 43.2 96.5 96.5 96.5 47.46 0 86.91-34.25 94.99-79.39l396.08-138.59C867.04 828.81 895.88 845 928.5 845c53.3 0 96.5-43.2 96.5-96.5 0-38.22-22.23-71.26-54.46-86.88l-41.7-392.88C960.37 252.86 982 220.21 982 182.5c0-53.3-43.2-96.5-96.5-96.5-32.37 0-61.01 15.94-78.51 40.39l-299.68-61.6C493.91 27.59 458.31 1 416.5 1z m0 193c40.77 0 75.63-25.28 89.77-61.03l283.12 58.2c3.69 41.4 33.52 75.27 72.87 85l40.26 379.37c-37.74 10.53-66.15 43.41-70.06 83.49L441.29 875.9c-16.87-28.1-47.63-46.9-82.79-46.9-15 0-29.2 3.42-41.86 9.53L180.82 661.88c8.99-14.66 14.18-31.91 14.18-50.38 0-21.07-6.76-40.56-18.22-56.43l210.98-365.42c9.08 2.83 18.73 4.35 28.74 4.35z" p-id="30248" fill="#515151"></path></svg>',polyline:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438516107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18607" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M672 925.5c-52.11 0-94.5-42.39-94.5-94.5 0-27.32 11.82-53.29 32.43-71.26l0.3-0.26-254.6-473.05-0.31 0.01c-1.1 0.04-2.21 0.06-3.32 0.06-18.73 0-36.83-5.47-52.35-15.82l-0.34-0.23-114.89 114.89 0.1 0.29c3.31 9.75 4.99 19.97 4.99 30.37 0 52.11-42.39 94.5-94.5 94.5S0.5 468.11 0.5 416s42.39-94.5 94.5-94.5c17.2 0 34.04 4.67 48.7 13.5l0.34 0.2 117.11-117.1-0.08-0.28a94.646 94.646 0 0 1-3.57-25.81c0-52.11 42.39-94.5 94.5-94.5s94.5 42.39 94.5 94.5c0 26.56-11.28 52.05-30.94 69.93l-0.29 0.26 255.29 474.32s1.19-0.02 1.44-0.02c20.26 0 39.58 6.32 55.86 18.28l0.35 0.25 112-112-0.12-0.3c-4.37-11.06-6.59-22.74-6.59-34.73 0-52.11 42.39-94.5 94.5-94.5s94.5 42.39 94.5 94.5-42.39 94.5-94.5 94.5c-15.68 0-31.21-3.92-44.91-11.33l-0.33-0.18-118.68 118.68 0.06 0.27A95.354 95.354 0 0 1 766.5 831c0 52.11-42.39 94.5-94.5 94.5z" p-id="18608" fill="#515151"></path><path d="M352 98c51.83 0 94 42.17 94 94 0 26.42-11.22 51.78-30.78 69.56l-0.58 0.53 0.37 0.69 254.96 473.71 0.29 0.53 0.61-0.01 0.42-0.01c0.24 0 0.48-0.01 0.72-0.01 20.15 0 39.37 6.29 55.57 18.18l0.69 0.51 0.61-0.61 111.46-111.46 0.46-0.46-0.24-0.61c-4.35-11-6.55-22.62-6.55-34.55 0-51.83 42.17-94 94-94s94 42.17 94 94-42.17 94-94 94c-15.59 0-31.04-3.9-44.67-11.27l-0.66-0.35-0.53 0.53-118.23 118.23-0.39 0.39 0.12 0.54a94.365 94.365 0 0 1 2.35 20.95c0 51.83-42.17 94-94 94s-94-42.17-94-94c0-27.17 11.76-53.01 32.26-70.88l0.6-0.52-0.38-0.7-254.26-472.45-0.29-0.55-0.62 0.02c-1.27 0.04-2.32 0.06-3.3 0.06-18.63 0-36.64-5.44-52.08-15.74l-0.68-0.45-0.58 0.58-114.39 114.39-0.44 0.44 0.2 0.59c3.29 9.7 4.96 19.87 4.96 30.21 0 51.83-42.17 94-94 94S1 467.83 1 416s42.17-94 94-94c17.11 0 33.86 4.65 48.45 13.43l0.67 0.4 0.55-0.55L261.3 218.66l0.42-0.41-0.16-0.56a94.028 94.028 0 0 1-3.55-25.68C258 140.17 300.17 98 352 98m0-1c-52.47 0-95 42.53-95 95 0 9 1.25 17.7 3.59 25.95L143.96 334.58C129.66 325.96 112.91 321 95 321c-52.47 0-95 42.53-95 95s42.53 95 95 95 95-42.53 95-95c0-10.68-1.76-20.95-5.01-30.53l114.38-114.38C314.44 281.14 332.53 287 352 287c1.12 0 2.23-0.03 3.34-0.06l254.27 472.43C589.63 776.78 577 802.41 577 831c0 52.47 42.53 95 95 95s95-42.53 95-95c0-7.28-0.82-14.36-2.37-21.17L882.86 691.6c13.42 7.27 28.8 11.4 45.14 11.4 52.47 0 95-42.53 95-95s-42.53-95-95-95-95 42.53-95 95c0 12.33 2.35 24.11 6.62 34.92L728.16 754.38C712.43 742.83 693.01 736 672 736c-0.38 0-0.76 0.01-1.14 0.01L415.9 262.3C435 244.92 447 219.86 447 192c0-52.47-42.53-95-95-95z" p-id="18609" fill="#515151"></path></svg>',rectangle:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439410852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28392" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M273.9 168.3H739v37.1H273.9zM273.9 819.6H739v37.1H273.9zM165.812 740.898v-465.1h37.1v465.1zM821.11 740.896v-465.1h37.1v465.1z" fill="#515151" p-id="28393"></path><path d="M184.7 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7zM184.7 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7z" fill="#515151" p-id="28394"></path></svg>',ruler:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755438563645" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20701" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M996.2 679L340 22.8c-12.5-12.5-32.8-12.5-45.3 0L23.2 294.3c-12.5 12.5-12.5 32.8 0 45.3l656.2 656.2c12.5 12.5 32.8 12.5 45.3 0l271.5-271.5c12.5-12.5 12.5-32.8 0-45.3zM262.6 234.9l119.2-119.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7L307.9 280.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.5-1.6-1.5-4.1 0-5.7z m112.9 45l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.5-1.6-1.5-4.1 0-5.7z m79 79l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7z m45.7 113.6l119.2-119.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7L545.5 517.8c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.5-1.6-1.5-4.1 0-5.7z m152.5 90.3l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0z m39.4 33.7l85.2-85.2c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7l-85.2 85.2c-1.6 1.6-4.1 1.6-5.7 0l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7z m85.3 158.9l-39.6-39.6c-1.6-1.6-1.6-4.1 0-5.7L857 590.9c1.6-1.6 4.1-1.6 5.7 0l39.6 39.6c1.6 1.6 1.6 4.1 0 5.7L783.1 755.4c-1.6 1.5-4.1 1.5-5.7 0z" p-id="20702" fill="#515151"></path></svg>',search:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#86868b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\r
97
+ <circle cx="11" cy="11" r="7"></circle>\r
98
+ <line x1="16.5" y1="16.5" x2="21" y2="21"></line>\r
99
+ </svg>\r
100
+ `,track:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\r
101
+ <path d="M4 5c4-2 5 4 8 2s4 3 8 1"></path>\r
102
+ <path d="M4 19c4-2 5 2 8 0s4 1 8-1"></path>\r
103
+ <circle cx="4" cy="5" r="1.6"></circle>\r
104
+ <circle cx="20" cy="8" r="1.6"></circle>\r
105
+ <circle cx="12" cy="19" r="1.6"></circle>\r
106
+ </svg>\r
107
+ `,triangle:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755439485778" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="35763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M185.8 63.9c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.2-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7-37 82.7-82.7 82.7zM838.2 716.7c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.2-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7-37 82.7-82.7 82.7zM186.2 715.6c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.2-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7-37 82.7-82.7 82.7z" fill="#515151" p-id="35764"></path><path d="M287.2 818.1h447.6v37H287.2zM167.3 282h37v451h-37zM235.682 261.34l26.163-26.162L776.897 750.23l-26.163 26.162z" fill="#515151" p-id="35765"></path></svg>',view:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1767681773788" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6706" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M234.666667 224a10.666667 10.666667 0 0 0-10.666667 10.666667v149.333333a32 32 0 0 1-64 0v-149.333333A74.666667 74.666667 0 0 1 234.666667 160h149.333333a32 32 0 0 1 0 64h-149.333333zM597.333333 405.333333a21.333333 21.333333 0 0 1 21.333334 21.333334v170.666666a21.333333 21.333333 0 0 1-21.333334 21.333334h-170.666666a21.333333 21.333333 0 0 1-21.333334-21.333334v-170.666666a21.333333 21.333333 0 0 1 21.333334-21.333334h170.666666z m-170.666666-64a85.333333 85.333333 0 0 0-85.333334 85.333334v170.666666a85.333333 85.333333 0 0 0 85.333334 85.333334h170.666666a85.333333 85.333333 0 0 0 85.333334-85.333334v-170.666666a85.333333 85.333333 0 0 0-85.333334-85.333334h-170.666666z m-202.666667 448a10.666667 10.666667 0 0 0 10.666667 10.666667h149.333333a32 32 0 0 1 0 64h-149.333333A74.666667 74.666667 0 0 1 160 789.333333v-149.333333a32 32 0 0 1 64 0v149.333333z m565.333333 10.666667a10.666667 10.666667 0 0 0 10.666667-10.666667v-149.333333a32 32 0 0 1 64 0v149.333333a74.666667 74.666667 0 0 1-74.666667 74.666667h-149.333333a32 32 0 0 1 0-64h149.333333z m10.666667-565.333333a10.666667 10.666667 0 0 0-10.666667-10.666667h-149.333333a32 32 0 0 1 0-64h149.333333a74.666667 74.666667 0 0 1 74.666667 74.666667v149.333333a32 32 0 0 1-64 0v-149.333333z" fill="#000000" p-id="6707"></path></svg>',weather:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766264800000" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8601" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><rect x="248" y="512" width="544" height="150" rx="72" fill="#272636" p-id="8602" /><circle cx="372" cy="504" r="120" fill="#272636" p-id="8603" /><circle cx="544" cy="452" r="150" fill="#272636" p-id="8604" /><circle cx="700" cy="504" r="118" fill="#272636" p-id="8605" /><path d="M366 716l-26 82h40l26-82h-40z" fill="#272636" p-id="8606" /><path d="M492 716l-26 82h40l26-82h-40z" fill="#272636" p-id="8607" /><path d="M618 716l-26 82h40l26-82h-40z" fill="#272636" p-id="8608" /></svg>'};function bn(e){return Object.prototype.hasOwnProperty.call(Qe,e)}function za(e,t){return e.replace(/#[0-9a-fA-F]{6}/g,t).replace(/#[0-9a-fA-F]{3}/g,t).replace(/fill="(?!none")[^"]*"/g,`fill="${t}"`).replace(/stroke="(?!none")[^"]*"/g,`stroke="${t}"`)}function En(e,t){const n=Qe[e];return za(n,t||"currentColor")}const G=o.defineComponent({name:"AppIcon",inheritAttrs:!1,props:{name:{type:String,required:!0},size:{type:[Number,String],default:16},color:{type:String,default:""}},setup(e){const t=o.computed(()=>bn(e.name)?En(e.name,e.color||void 0):""),n=o.computed(()=>({width:`${e.size}px`,height:`${e.size}px`,...e.color?{color:e.color}:{}}));return()=>o.createVNode("span",{class:"app-icon iconfont-icon",style:n.value,role:"img","aria-hidden":"true"},[o.createVNode("span",{innerHTML:t.value},null)])}}),Tn=o.defineComponent({name:"MapError",props:{visible:{type:Boolean,default:!1},title:{type:String,default:"地图加载失败"},message:{type:String,default:""}},emits:["retry"],setup(e,{emit:t}){return()=>e.visible?o.createVNode("div",{class:"map-error",role:"alert"},[o.createVNode("div",{class:"map-error__card"},[o.createVNode("div",{class:"map-error__icon"},[o.createVNode(G,{name:"view",size:28},null)]),o.createVNode("div",{class:"map-error__title"},[e.title]),o.createVNode("div",{class:"map-error__message"},[e.message||"初始化地理数据时出现异常,请检查网络连接后重试"]),o.createVNode("div",{class:"map-error__actions"},[o.createVNode("button",{type:"button",class:"map-error__retry",onClick:()=>t("retry")},[o.createTextVNode("重新加载")]),o.createVNode("span",{class:"map-error__hint"},[o.createTextVNode("若持续失败,请刷新页面")])])])]):null}}),Sn=o.defineComponent({name:"AppInput",inheritAttrs:!1,props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},prefixIcon:{type:String,default:""},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},emits:["update:modelValue","input","clear","focus","blur","keydown"],setup(e,{emit:t,attrs:n}){const r=o.useSlots(),i=o.computed({get:()=>e.modelValue,set:d=>t("update:modelValue",d)}),a=o.computed(()=>e.clearable&&!e.disabled&&e.modelValue.length>0),l=d=>{const c=d.target.value;i.value=c,t("input",c)},s=()=>{i.value="",t("clear")},u=o.computed(()=>["app-input",{"app-input--disabled":e.disabled}]);return()=>{const d={},c={};for(const f of Object.keys(n))f.startsWith("on")&&f.length>2?c[f]=n[f]:d[f]=n[f];return o.createVNode("div",o.mergeProps({class:u.value},d),[e.prefixIcon?o.createVNode("span",{class:"app-input__prefix"},[o.createVNode(G,{name:e.prefixIcon,size:15},null)]):null,o.createVNode("input",o.mergeProps({class:"app-input__inner",type:"text",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,autofocus:e.autofocus,"aria-label":e.ariaLabel||void 0,onInput:l,onFocus:f=>t("focus",f),onBlur:f=>t("blur",f),onKeydown:f=>t("keydown",f)},c),null),r.suffix?o.createVNode("span",{class:"app-input__suffix"},[r.suffix()]):null,a.value?o.createVNode("button",{type:"button",class:"app-input__clear","aria-label":"清除",onClick:s},[o.createVNode("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"currentColor"},[o.createVNode("path",{d:"M12 2a10 10 0 100 20 10 10 0 000-20zm4.24 12.83l-1.41 1.41L12 13.41l-2.83 2.83-1.41-1.41L10.59 12 7.76 9.17l1.41-1.41L12 10.59l2.83-2.83 1.41 1.41L13.41 12l2.83 2.83z"},null)])]):null])}}}),et=o.defineComponent({name:"AppSpinner",props:{size:{type:[Number,String],default:24},color:{type:String,default:""}},setup(e){const t=o.computed(()=>({width:`${e.size}px`,height:`${e.size}px`,color:e.color||"currentColor"}));return()=>o.createVNode("span",{class:"app-spinner",style:t.value,role:"status","aria-label":"加载中"},[o.createVNode("span",{class:"app-spinner__circle"},null)])}}),Dn=o.defineComponent({name:"SearchResultsPanel",props:{list:{type:Array,default:()=>[]},highlightIndex:{type:Number,default:-1},selectedIndex:{type:Number,default:-1}},emits:["result-click","result-hover","result-leave"],setup(e,{emit:t}){return()=>o.createVNode("div",{class:"search-results-panel"},[o.createVNode("div",{class:"results-header"},[o.createVNode("span",{class:"header-text"},[o.createTextVNode("搜索结果")])]),o.createVNode("div",{class:"results-content",role:"listbox","aria-label":"桩号搜索结果"},[e.list.map((n,r)=>o.createVNode("div",{key:n.id??r,class:["result-item",{highlight:e.highlightIndex===r,selected:e.selectedIndex===r}],role:"option","aria-selected":e.highlightIndex===r,onClick:()=>t("result-click",n,r),onMouseenter:()=>t("result-hover",r),onMouseleave:()=>t("result-leave")},[o.createVNode("div",{class:"result-icon"},[o.createVNode(G,{name:"location",size:16},null)]),o.createVNode("div",{class:"result-info"},[o.createVNode("div",{class:"result-name"},[n.name]),n.lng!==void 0&&n.lat!==void 0?o.createVNode("div",{class:"result-coordinates"},[n.lng.toFixed(6),o.createTextVNode(", "),n.lat.toFixed(6)]):null,n.altitude?o.createVNode("div",{class:"result-altitude"},[o.createTextVNode("海拔: "),n.altitude,o.createTextVNode("m")]):null]),o.createVNode("div",{class:"result-action"},[o.createVNode(G,{name:"aim",size:16},null)])]))]),o.createVNode("div",{class:"results-footer"},[o.createVNode("span",null,[o.createTextVNode("点击结果进行定位")])])])}}),tt=o.defineComponent({name:"NoResultsPanel",props:{keyword:{type:String,default:""},error:{type:Boolean,default:!1}},emits:["clear"],setup(e,{emit:t}){return()=>o.createVNode("div",{class:["no-results",{"no-results--error":e.error}]},[o.createVNode("div",{class:"no-results-content"},[o.createVNode(G,{name:e.error?"view":"search",size:32},null),o.createVNode("div",{class:"no-results-text"},[e.error?o.createVNode("p",null,[o.createTextVNode("查询失败,请检查网络后重试")]):o.createVNode("p",null,[o.createTextVNode('未找到"'),e.keyword,o.createTextVNode('"相关桩号'),o.createVNode("span",{class:"no-results-hint"},[o.createTextVNode(",请检查桩号格式后重新输入")])])]),e.error?o.createVNode("button",{type:"button",class:"no-results-retry",onClick:()=>t("clear")},[o.createTextVNode("清空重试")]):null])])}});function Fa(e){return{position:"fixed",top:`${e.bottom+nr}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:rr}}const Mn=o.defineComponent({name:"MapTools",inheritAttrs:!1,props:{showSearch:{type:Boolean,default:!1},theme:{type:String,default:"dark"},filteredList:{type:Array,default:()=>[]},showResults:{type:Boolean,default:!1},input:{type:String,default:""},isSearching:{type:Boolean,default:!1},searchError:{type:Boolean,default:!1},highlightIndex:{type:Number,default:-1},selectedIndex:{type:Number,default:-1}},emits:["search-input","search-focus","search-clear","search-close","search-navigate","search-select","result-click","result-hover","result-leave"],setup(e,{emit:t,slots:n}){const r=o.ref(e.input),i=o.shallowRef(null),a=o.shallowRef(null),l=o.ref({}),s=o.computed(()=>e.showSearch);o.watch(()=>e.input,C=>{r.value=C});const u=()=>{i.value&&(l.value=Fa(i.value.getBoundingClientRect()))},d=C=>{r.value=C,t("search-input",C)},c=()=>{r.value="",t("search-clear","")},f=()=>{t("search-focus",r.value)},h=C=>{if(C.key==="Escape"){C.preventDefault(),t("search-close");return}if(C.key==="ArrowDown"){C.preventDefault(),t("search-navigate",1);return}if(C.key==="ArrowUp"){C.preventDefault(),t("search-navigate",-1);return}C.key==="Enter"&&(C.preventDefault(),t("search-select"))},p=C=>{if(!e.showResults)return;const y=C.target;a.value?.contains(y)||document.querySelector(".search-results-panel")?.contains(y)||document.querySelector(".no-results")?.contains(y)||t("search-close")};o.watch(()=>[e.showResults,e.filteredList.length],()=>{e.showResults&&u()}),o.onMounted(()=>{window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),document.addEventListener("mousedown",p)}),o.onUnmounted(()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),document.removeEventListener("mousedown",p)});const b=o.computed(()=>e.showResults&&e.filteredList.length>0),v=o.computed(()=>e.showResults&&r.value!==""&&e.filteredList.length===0&&!e.isSearching&&!e.searchError),m=o.computed(()=>e.showResults&&r.value!==""&&e.filteredList.length===0&&!e.isSearching&&e.searchError);return()=>o.createVNode("div",{class:"eapc-utils",ref:a},[s.value?o.createVNode("div",{class:"eapc-search"},[o.createVNode("div",{class:"search-container",ref:i},[o.createVNode(Sn,{class:"search-input",modelValue:r.value,placeholder:"请输入桩号进行搜索...",clearable:!0,prefixIcon:"search",ariaLabel:"桩号搜索","onUpdate:modelValue":d,onClear:c,onFocus:f,onKeydown:h},{suffix:()=>e.isSearching?o.createVNode(et,{size:14},null):r.value&&!e.searchError?o.createVNode("div",{class:"results-count"},[e.filteredList.length,o.createTextVNode("个结果")]):null})])]):null,o.createVNode(o.Teleport,{to:"body"},{default:()=>[b.value?o.createVNode(Dn,{class:"teleported","data-theme":e.theme,style:l.value,list:e.filteredList,highlightIndex:e.highlightIndex,selectedIndex:e.selectedIndex,"onResult-click":(C,y)=>t("result-click",C,y),"onResult-hover":C=>t("result-hover",C),"onResult-leave":()=>t("result-leave")},null):null,v.value?o.createVNode(tt,{class:"teleported","data-theme":e.theme,style:l.value,keyword:r.value},null):null,m.value?o.createVNode(tt,{class:"teleported","data-theme":e.theme,style:l.value,keyword:r.value,error:!0},null):null]}),o.createVNode("div",{class:"utils-right"},[n["utils-right"]?n["utils-right"]():null])])}}),In=o.defineComponent({name:"MapControls",inheritAttrs:!1,props:{showDeleteControls:{type:Boolean,default:!0},mapType:{type:String,default:"3d"},mapBase:{type:String,default:"bigemap"},currentDrawType:{type:String,default:null},mapNameVisible:{type:Boolean,default:!1},contourVisible:{type:Boolean,default:!1},tools:{type:Array,default:()=>Re},showBaseSwitch:{type:Boolean,default:!0}},emits:["delete","toggle-map-type","toggle-map-base","start-drawing","toggle-map-view","toggle-map-name","toggle-contour"],setup(e,{emit:t}){const n=o.computed(()=>e.currentDrawType!=null),r=l=>{n.value||t(l)},i=l=>{n.value&&e.currentDrawType!==l||t("start-drawing",l)},a=l=>{const s=ht(l);return s?s.icon:l};return()=>o.createVNode("div",{class:"eapc-control"},[e.showDeleteControls?o.createVNode("button",{type:"button",class:["item","delete-item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":"清除绘制图形",onClick:()=>r("delete")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("清除绘制图形")]),o.createVNode(G,{name:"clear",size:18},null)]):null,o.createVNode("button",{type:"button",class:["item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":`切换${e.mapType==="3d"?"2D":"3D"}地图`,onClick:()=>r("toggle-map-type")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("切换"),e.mapType==="3d"?"2D":"3D",o.createTextVNode("地图")]),o.createVNode(G,{name:e.mapType,size:e.mapType==="3d"?24:22},null)]),o.createVNode("button",{type:"button",class:["item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":"恢复视图",onClick:()=>r("toggle-map-view")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("恢复视图")]),o.createVNode(G,{name:"view",size:20},null)]),e.showBaseSwitch?o.createVNode("button",{type:"button",class:["item","is-button",{"is-disabled":n.value}],disabled:n.value,"aria-label":`切换${e.mapBase==="bigemap"?"物探地图":"生产地图"}底图`,onClick:()=>r("toggle-map-base")},[o.createVNode("span",{class:"txt"},[o.createTextVNode("切换"),e.mapBase==="bigemap"?"物探地图":"生产地图"]),o.createVNode(G,{name:"base",size:20},null)]):null,o.createVNode("button",{type:"button",class:["item","label-switch-item","is-button",{"is-on":e.mapNameVisible}],role:"switch","aria-checked":e.mapNameVisible,"aria-label":e.mapNameVisible?"关闭地图名称注记":"加载地图名称注记",onClick:()=>t("toggle-map-name",!e.mapNameVisible)},[o.createVNode("span",{class:"txt"},[e.mapNameVisible?"关闭地图名称":"加载地图名称"]),o.createVNode("span",{class:"label-switch","aria-hidden":"true"},[o.createVNode("span",{class:"label-switch__track"},[o.createVNode("span",{class:"label-switch__thumb"},null)])])]),e.mapType==="3d"?o.createVNode("button",{type:"button",class:["item","is-button",{active:e.contourVisible}],"aria-pressed":e.contourVisible,"aria-label":e.contourVisible?"关闭等高线":"开启等高线",onClick:()=>t("toggle-contour")},[o.createVNode("span",{class:"txt"},[e.contourVisible?"关闭等高线":"开启等高线"]),o.createVNode(G,{name:"contour",size:18},null)]):null,o.createVNode("div",{class:"eapc-control__divider"},null),e.tools.map(l=>o.createVNode("button",{type:"button",key:l.icon,class:["item","tool-item","is-button",{active:e.currentDrawType===l.icon,"is-disabled":n.value&&e.currentDrawType!==l.icon}],disabled:n.value&&e.currentDrawType!==l.icon,"aria-pressed":e.currentDrawType===l.icon,"aria-label":l.name,onClick:()=>i(l.icon)},[o.createVNode("span",{class:"txt"},[l.name]),o.createVNode(G,{name:a(l.icon),size:l.size},null)]))])}}),Oa=500,An=1e3,Ga={bigemap:"生产地图",geoserver:"物探地图"};function Ne(e){return e&&typeof e.value=="object"?e.value:e}function Ua(e){return e>=1e3?`${(e/1e3).toFixed(2)} km`:`${Math.round(e)} m`}function xn(e){return e>=1024*1024*1024?`${(e/1024/1024/1024).toFixed(2)} GB`:`${(e/1024/1024).toFixed(1)} MB`}const Ln=o.defineComponent({name:"MapStatus",inheritAttrs:!1,props:{map:{type:Object,default:null},mapBase:{type:String,default:"bigemap"},visible:{type:Boolean,default:!1}},setup(e){const t=o.ref(!1),n=o.ref(0),r=o.ref("--"),i=o.ref({text:"--",detail:""}),a=o.ref("--"),l=o.ref("--"),s=o.shallowRef(null),u=o.shallowRef(null),d=o.ref(!1);let c=0,f=0,h=0,p=[],b=null,v=null,m=0;const C=()=>{f=0,h=performance.now();const M=()=>{f+=1;const I=performance.now();I-h>=Oa&&(n.value=Math.round(f*1e3/(I-h)),f=0,h=I),c=requestAnimationFrame(M)};c=requestAnimationFrame(M)},y=()=>{try{const M=performance.memory;if(!M){r.value="--";return}const I=M.usedJSHeapSize,F=M.jsHeapSizeLimit;r.value=`${xn(I)} / ${xn(F)}`}catch{r.value="--"}},E=()=>{const M=Ne(e.map);if(!M)return;const I=D();if(!I)return;if(!!(I.SceneMode&&M.scene.mode===I.SceneMode.SCENE2D)){i.value={text:"2D 视图",detail:Ga[e.mapBase]||e.mapBase};return}try{const k=I.Cartographic.fromCartesian(M.camera.position);i.value={text:"3D 视图",detail:`视距 ${Ua(k.height)}`}}catch{i.value={text:"3D 视图",detail:"--"}}},_=M=>{v=M,m===0&&(m=requestAnimationFrame(()=>{m=0;const I=v;if(v=null,!I)return;const F=Ne(e.map);if(!F)return;const k=D();if(!k)return;const Y=F.camera.pickEllipsoid(new k.Cartesian2(I.offsetX,I.offsetY),F.scene.globe.ellipsoid);if(!Y)return;const K=k.Cartographic.fromCartesian(Y);a.value=k.Math.toDegrees(K.longitude).toFixed(6),l.value=k.Math.toDegrees(K.latitude).toFixed(6)}))},S=()=>{!s.value||!u.value||(d.value=u.value.scrollWidth>s.value.clientWidth+1)},A=()=>{t.value=!t.value},V=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),A())};o.onMounted(()=>{C(),y(),E(),S(),p.push(window.setInterval(y,An)),p.push(window.setInterval(E,An)),Ne(e.map)?.scene.canvas.addEventListener("mousemove",_),typeof ResizeObserver<"u"&&(b=new ResizeObserver(S),u.value&&b.observe(u.value),s.value&&b.observe(s.value))}),o.onUnmounted(()=>{cancelAnimationFrame(c),m!==0&&cancelAnimationFrame(m),v=null,b?.disconnect(),p.forEach(I=>window.clearInterval(I)),Ne(e.map)?.scene.canvas.removeEventListener("mousemove",_)});const U=()=>[o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("FPS")]),o.createVNode("b",{class:"map-status__value map-status__value--fps"},[n.value])]),o.createVNode("span",{class:"map-status__dot","aria-hidden":"true"},[o.createTextVNode("·")]),o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("内存")]),o.createVNode("span",{class:"map-status__value"},[r.value])]),o.createVNode("span",{class:"map-status__dot","aria-hidden":"true"},[o.createTextVNode("·")]),o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("层级")]),o.createVNode("span",{class:"map-status__value"},[i.value.text,i.value.detail?o.createVNode("em",{class:"map-status__detail"},[o.createTextVNode(" · "),i.value.detail]):null])]),o.createVNode("span",{class:"map-status__dot","aria-hidden":"true"},[o.createTextVNode("·")]),o.createVNode("span",{class:"map-status__item"},[o.createVNode("span",{class:"map-status__label"},[o.createTextVNode("坐标")]),o.createVNode("span",{class:"map-status__value map-status__value--coords"},[a.value,o.createTextVNode(", "),l.value])])],z=o.computed(()=>t.value&&d.value);return()=>e.visible?o.createVNode("div",{class:["map-status",t.value?"is-expanded":"is-collapsed"],role:"button",tabindex:0,title:t.value?"收起状态信息":"展开状态信息",onClick:A,onKeydown:V},[o.createVNode("span",{class:"map-status__badge","aria-hidden":t.value},[o.createVNode("b",{class:"map-status__badge-value"},[n.value])]),o.createVNode("span",{class:"map-status__expanded","aria-hidden":!t.value},[o.createVNode("span",{class:"map-status__row",ref:s},[o.createVNode("span",{class:["map-status__track",{"is-marquee":z.value}]},[o.createVNode("span",{class:"map-status__track-inner",ref:u},[U()]),z.value?o.createVNode("span",{class:"map-status__track-inner","aria-hidden":"true"},[U()]):null])])])]):null}}),Nn=o.defineComponent({name:"MapView",props:{config:{type:Object,default:void 0},theme:{type:String,default:"dark"},popupConfig:{type:Object,default:()=>{}}},emits:["init","draw-end","draw-delete","draw-clear","point-click","clear-button-click","clear-draw","ready","error","error-retry","expose"],async setup(e,{emit:t,expose:n,slots:r}){const i=Ra(e.config,{theme:e.theme,popupConfig:e.popupConfig}),a=Cn(i,{emit:(k,...Y)=>t(k,...Y),expose:n,onPointClick:k=>t("point-click",k)});await a.init().catch(()=>{});const{mapType:l,mapBase:s,currentDrawType:u,loadingTitle:d,loadingSubtitle:c,theme:f,mapNameVisible:h,showControls:p,showDeleteControls:b,showStatus:v,wmtsEnabled:m}=a,{state:C,showSearch:y,search:E,onDelete:_,handleStartDrawing:S,toggleMapType:A,resetView:V,toggleMapBaseLayer:U,setMapNameVisible:z,setContourVisible:M,contourVisible:I,map:F}=a;return()=>o.createVNode(o.Fragment,null,[o.createVNode(Je,{visible:C.value.isLoading&&!C.value.error,title:d.value,subtitle:c.value},null),o.createVNode(Tn,{visible:!!C.value.error,message:C.value.error?.message,onRetry:()=>t("error-retry")},null),o.createVNode(Ln,{map:F,mapBase:s.value,visible:v.value},null),y.value?o.createVNode(Mn,{showSearch:!0,theme:f.value,filteredList:E.filteredList.value,showResults:E.showResults.value,input:E.searchInput.value,isSearching:E.isSearching.value,searchError:E.searchError.value,highlightIndex:E.highlightIndex.value,selectedIndex:E.selectedIndex.value,"onSearch-input":E.handleInputSearch,"onSearch-focus":()=>{E.showResults.value=!0},"onSearch-clear":E.clearSearch,"onSearch-close":()=>{E.showResults.value=!1},"onSearch-navigate":k=>E.moveHighlight(k),"onSearch-select":()=>E.selectHighlighted(),"onResult-click":E.handleResultClick,"onResult-hover":k=>{E.highlightIndex.value=k},"onResult-leave":()=>{E.highlightIndex.value=-1}},{"utils-right":()=>r["utils-right"]?r["utils-right"]():null}):null,p.value?o.createVNode(In,{showDeleteControls:b.value,mapType:l.value,mapBase:s.value,currentDrawType:u.value??void 0,mapNameVisible:h.value,contourVisible:I.value,tools:i.tools,showBaseSwitch:m.value,onDelete:_,"onToggle-map-type":A,"onToggle-map-base":U,"onToggle-map-view":V,"onToggle-map-name":k=>z(k),"onToggle-contour":()=>M(!I.value),"onStart-drawing":S},null):null,r.default?r.default():null])}}),$a=Object.fromEntries(vn.map(e=>[e,{type:Ba[e],default:void 0}])),Wa=o.defineComponent({name:"MapContainer",inheritAttrs:!1,props:{config:{type:Object,default:void 0},...$a,hideSearch:{type:Boolean,default:void 0},theme:{type:String,default:"dark"},popupConfig:{type:Object,default:()=>{}}},emits:["init","draw-end","draw-delete","draw-clear","point-click","clear-button-click","clear-draw","ready","error","expose"],setup(e,{emit:t,slots:n,expose:r}){const i=o.ref(e.theme||"dark"),a=or(e.config,{containerId:e.containerId,position:e.position,serverUrl:e.serverUrl,accessToken:e.accessToken,libsUrl:e.libsUrl,showSearch:e.showSearch??e.hideSearch,showControls:e.showControls,showDeleteControls:e.showDeleteControls,showStatus:e.showStatus,tools:e.tools,searchDebounceTime:e.searchDebounceTime,wmtsUrlProvider:e.wmtsUrlProvider,geoserver:e.geoserver,contourConfig:e.contourConfig,lightingConfig:e.lightingConfig}),l=u=>{if(u&&typeof u.setTheme=="function"){const d=u.setTheme;u.setTheme=c=>{i.value=c,d(c)}}r(u),t("expose",u)},s=u=>(...d)=>{t(u,...d)};return()=>o.createVNode("div",{class:"map-container-wrapper","data-theme":i.value},[o.createVNode("div",{id:a.containerId,class:"map-container"},null),o.createVNode(o.Suspense,null,{default:()=>o.createVNode(Nn,{config:a,theme:i.value,popupConfig:e.popupConfig,onInit:s("init"),"onDraw-end":s("draw-end"),"onDraw-delete":s("draw-delete"),"onDraw-clear":s("draw-clear"),"onPoint-click":s("point-click"),"onClear-button-click":s("clear-button-click"),"onClear-draw":s("clear-draw"),onReady:s("ready"),onError:s("error"),onExpose:l},{default:u=>kn(n,"default",u),"utils-right":()=>kn(n,"utils-right",{})}),fallback:()=>o.createVNode(Je,{visible:!0},null)})])}});function kn(e,t,n){const r=e[t];return r?r(n):null}const Ha=o.defineComponent({name:"AppButton",inheritAttrs:!1,props:{type:{type:String,default:"primary"},size:{type:String,default:"medium"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(e,{slots:t,attrs:n,emit:r}){const i=o.computed(()=>["app-button",`app-button--${e.type}`,`app-button--${e.size}`,{"app-button--block":e.block},{"app-button--disabled":e.disabled||e.loading}]),a=l=>{e.disabled||e.loading||r("click",l)};return()=>o.createVNode("button",o.mergeProps({type:"button",class:i.value,disabled:e.disabled},n,{onClick:a}),[e.loading?o.createVNode(et,{size:14,class:"app-button__spinner"},null):null,t.default?o.createVNode("span",{class:"app-button__content"},[t.default()]):null])}});function _n(e,t){return/<svg\b[^>]*\sdata-keep-color\b/i.test(e)?e:e.replace(/#[0-9a-fA-F]{6}/g,t).replace(/#[0-9a-fA-F]{3}/g,t).replace(/fill="[^"]*"/g,`fill="${t}"`).replace(/stroke="[^"]*"/g,`stroke="${t}"`)}function Vn(e,t){const n=t/2;return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}"><circle cx="${n}" cy="${n}" r="${n}" fill="${e}"/></svg>`}function Pn(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return`data:image/svg+xml;base64,${btoa(n)}`}const ja={fontSize:12,textColor:"#FFFFFF",textBgColor:"rgba(0, 0, 0, 0.6)",padding:4,rounded:!0,borderRadius:4};function Bn(e){return{...ja,...e}}let nt=null;function Rn(e,t){nt||(nt=document.createElement("canvas"));const n=nt.getContext("2d");return n.font=`${t}px Microsoft YaHei, sans-serif`,Math.ceil(n.measureText(e).width)}const Ya=3e3,ge=new Map,qa=100;function Ka(e){const t=ge.get(e);return t?Promise.resolve(t):new Promise(n=>{const r=new Image;let i=!1;const a=()=>{i||(i=!0,clearTimeout(l),n(r))};r.src=e,r.onload=()=>{if(r.naturalWidth>0&&r.naturalHeight>0)for(ge.set(e,r);ge.size>qa;){const s=ge.keys().next().value;if(s===void 0)break;ge.delete(s)}a()},r.onerror=a;const l=setTimeout(a,Ya)})}function Xa(e,t,n,r,i){e.fillStyle=t.textBgColor,t.rounded?(e.beginPath(),e.roundRect(n,0,r,i,t.borderRadius),e.fill()):e.fillRect(n,0,r,i)}function zn(e,t,n,r,i){e.font=`${t.fontSize}px Microsoft YaHei, sans-serif`,e.fillStyle=t.textColor,e.textAlign="center",e.textBaseline="middle",e.fillText(n,r/2,i/2)}async function Za(e,t,n,r,i){const a=await Ka(t.icon);return a.naturalWidth>0&&a.naturalHeight>0?(e.drawImage(a,r,i,n,n),!0):(e.fillStyle=t.color,e.fillRect(r,i,n,n),!1)}async function Fn(e,t,n,r){const i=n.iconSize||32,a=Bn(n.textConfig),l=Rn(t,a.fontSize)+a.padding*2,s=a.fontSize+a.padding*2,u=Math.max(i,l),d=s+i,c=document.createElement("canvas");c.width=u*r,c.height=d*r;const f=c.getContext("2d");f.scale(r,r);const h=(u-l)/2;Xa(f,a,h,l,s),zn(f,a,t,u,s);const p=await Za(f,e,i,(u-i)/2,s);return{icon:c,width:u,height:d,type:"text",text:t,status:e.status,color:e.color,degraded:!p}}function Ja(e,t,n){const r=n.iconSize||32,i=Bn(n.textConfig),a=Rn(t,i.fontSize)+i.padding*2,l=i.fontSize+i.padding*2,s=Math.max(r,a),u=l+r,d=document.createElement("canvas");d.width=s,d.height=u;const c=d.getContext("2d");return c.fillStyle=i.textBgColor,c.fillRect(0,0,s,l),zn(c,i,t,s,l),c.fillStyle=e.color,c.fillRect((s-r)/2,l,r,r),{icon:d,width:s,height:u,type:"text",text:t,status:e.status,color:e.color}}const Qa="color_svg";function On(e,t){return t===void 0?`${e}_no_text`:t===""?`${e}_empty_text`:`${e}_text_${t}`}function Gn(e){return`${Qa}_${e}`}function rt(e){return R[e]?.color||R.default.color}const it=25,eo=8;function to(){return typeof MessageChannel<"u"?new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(0)}):new Promise(e=>setTimeout(e,0))}async function at(e){return performance.now()-e>=eo?(await to(),performance.now()):e}async function no(e,t){const n=new Map,r=new Map;t.forEach(i=>{const a=r.get(i.status)||[];a.push(i),r.set(i.status,a)});for(const[,i]of r){let a=performance.now();for(let l=0;l<i.length;l+=it){const s=i.slice(l,l+it);await Promise.all(s.map(async u=>{const d=u.id?.toString()??String(u.text??"");try{n.set(d,await e(u.status,u.text))}catch{n.set(d,await e(u.status))}})),l+it<i.length&&(a=await at(a))}}return n}async function ro(e,t){const n=Array.isArray(e)?e:[];if(n.length===0)return[];const r=new Array(n.length),i=new Map,a=new Map;for(let c=0;c<n.length;c++){const f=n[c],h=t.resolveColor(f),p=t.resolveBaseSvg(f),b=f.showName&&f.name?String(f.name).trim():"",v=`${p}${h}${b}`;r[c]=v,b?a.has(v)||a.set(v,{key:v,color:h,text:b,svg:p}):i.has(v)||i.set(v,{key:v,color:h,svg:p})}const l=new Map;let s=performance.now();for(const c of i.values()){const f=await t.createBaseIconBySvg(c.svg,c.color);f&&l.set(c.key,{icon:f.icon,width:f.width,height:f.height,type:f.type,text:f.text}),s=await at(s)}let u=0;const d=[];for(const c of a.values()){const f=t.peekTextIconBySvg(c.svg,c.color,c.text);f?(u++,l.set(c.key,f)):d.push(c)}t.onBatchStats?.({uniqueText:a.size,textHits:u,textGenerated:d.length}),s=performance.now();for(const c of d)l.set(c.key,await t.createTextIconBySvg(c.svg,c.color,c.text)),s=await at(s);for(let c=0;c<n.length;c++){const f=l.get(r[c]);if(!f)continue;const h=n[c];h.icon=f.icon,h.width=f.width,h.height=f.height}return n}function io(e,t){const n=JSON.stringify(R);for(const[r,i]of Object.entries(e))R[r]={color:i,text:R[r]?.text||R.default.text};n!==JSON.stringify(R)&&t()}function ao(){const e={default:R.default.color};for(const[t,n]of Object.entries(R))t!=="default"&&(e[t]=n.color);return e}const oo="color:";function Un(e){return`${oo}${e}`}class ${constructor(){this.maxIconCache=$.DEFAULT_MAX_ICON_CACHE,this.activeTasks=0,this.iconCache=new Map,this.colorCache=new Map,this.baseSvgCache=new Map,this.svgKeys=new Map,this.svgCount=0,this.compositeCache=new Map,this.runtimeStats={textHits:0,textGenerated:0,uniqueText:0},this.dpr=typeof window<"u"&&window.devicePixelRatio||1,this.rawSvg="",this.defaultConfig={iconSize:32}}static{this.DEFAULT_MAX_ICON_CACHE=8e3}static{this.TASK_MAX_ICON_CACHE=5e4}static{this.COMPOSITE_CACHE_CAP=2e4}get effectiveCacheLimit(){return this.activeTasks>0?$.TASK_MAX_ICON_CACHE:this.maxIconCache}touchCache(t){const n=this.iconCache.get(t);n&&(this.iconCache.delete(t),this.iconCache.set(t,n))}evictCacheIfNeeded(){for(;this.iconCache.size>this.effectiveCacheLimit;){const t=this.iconCache.keys().next().value;if(t===void 0)break;this.iconCache.delete(t)}}static getInstance(){return $.instance||($.instance=new $),$.instance}beginIconTask(){this.activeTasks++}endIconTask(){this.activeTasks>0&&this.activeTasks--,this.activeTasks===0&&(this.evictCacheIfNeeded(),this.evictCompositeCacheIfNeeded())}resolveSvgKey(t){const n=this.svgKeys.get(t);if(n)return n;const r=`svg#${this.svgCount++}`;return this.svgKeys.set(t,r),r}initialize(t,n){this.rawSvg=t,n&&(this.defaultConfig=n),n?.maxIconCache&&n.maxIconCache>0&&(this.maxIconCache=n.maxIconCache),this.preGenerateBaseColors()}preGenerateBaseColors(){if(this.colorCache.size>0||!this.rawSvg)return;new Set([...Object.keys(R),"default"]).forEach(n=>this.ensureColoredSvg(n,rt(n)))}ensureColoredSvg(t,n){const r=Gn(t);return this.colorCache.has(r)||this.colorCache.set(r,this.buildColoredSvg(n)),this.colorCache.get(r)}buildColoredSvg(t){const n=this.defaultConfig.iconSize||32;try{return _n(this.rawSvg,t)}catch{return Vn(t,n)}}normalizeText(t){const n=t?.trim();return n===""?"":n}buildBaseIcon(t,n){const i=`${this.resolveSvgKey(t||this.rawSvg)}${n}`,a=this.baseSvgCache.get(i);if(a)return a;const l=this.defaultConfig.iconSize||32,s=t||this.rawSvg;let u;try{u=Pn(_n(s,n))}catch{u=Pn(Vn(n,l))}const d={icon:u,width:l,height:l,type:"base",status:Un(n),color:n};return this.baseSvgCache.set(i,d),d}createBaseIconCore(t,n){return this.buildBaseIcon(this.rawSvg,n)}createBaseIconBySvg(t,n){return this.buildBaseIcon(t,n)}compositeKey(t,n,r){return`${this.resolveSvgKey(t||this.rawSvg)}${n}${r}`}peekTextIconBySvg(t,n,r){const i=this.compositeCache.get(this.compositeKey(t,n,r));if(i)return{icon:i.icon,width:i.width,height:i.height,type:i.type,text:i.text}}async createTextIconBySvg(t,n,r){const i=this.compositeKey(t,n,r),a=this.compositeCache.get(i);if(a)return{icon:a.icon,width:a.width,height:a.height,type:a.type,text:a.text};const l=this.buildBaseIcon(t,n),s=this.normalizeText(r)??"",u=await Fn(l,s,this.defaultConfig,this.dpr),d={icon:u.icon,width:u.width,height:u.height,type:u.type,text:u.text};return u.degraded||(this.compositeCache.set(i,{...u,text:s,status:l.status}),this.activeTasks===0&&this.evictCompositeCacheIfNeeded()),d}evictCompositeCacheIfNeeded(){for(;this.compositeCache.size>$.COMPOSITE_CACHE_CAP;){const t=this.compositeCache.keys().next().value;if(t===void 0)break;this.compositeCache.delete(t)}}matchCache(t,n,r){return t.status===n&&t.text===r}async createIcon(t,n){return this.createIconCore(t,rt(t),n)}async createIconByColor(t,n){return this.createIconCore(Un(t),t,n)}async createIconCore(t,n,r){const i=this.normalizeText(r),a=On(t,i),l=this.iconCache.get(a);if(l&&this.matchCache(l,t,i))return this.touchCache(a),{icon:l.icon,width:l.width,height:l.height,type:l.type,text:l.text};const s=await this.createBaseIconCore(t,n),u=i?await Fn(s,i,this.defaultConfig,this.dpr):s;return u.degraded||(this.iconCache.set(a,{...u,text:i,status:t}),this.evictCacheIfNeeded()),{icon:u.icon,width:u.width,height:u.height,type:u.type,text:u.text}}batchCreateIcons(t){return no(this.createIcon.bind(this),t)}batchCreatePointIcons(t){const n={resolveColor:r=>r.color||rt(r.status??"default"),resolveBaseSvg:r=>r.svg||this.rawSvg,createBaseIconBySvg:(r,i)=>Promise.resolve(this.buildBaseIcon(r,i)),createTextIconBySvg:(r,i,a)=>this.createTextIconBySvg(r,i,a),peekTextIconBySvg:(r,i,a)=>this.peekTextIconBySvg(r,i,a),iconSize:this.defaultConfig.iconSize||32,textConfig:this.defaultConfig.textConfig,dpr:this.dpr,onBatchStats:r=>{this.runtimeStats.textHits+=r.textHits,this.runtimeStats.textGenerated+=r.textGenerated,this.runtimeStats.uniqueText+=r.uniqueText}};return ro(t,n)}async createConditionalIcon(t,n){const r=n();return this.createIcon(t,r||void 0)}getIconHeightInfo(){const t=this.defaultConfig.iconSize||32,n=this.defaultConfig.textConfig||{},r=(n.fontSize??12)+(n.padding??0)*2;return{iconHeight:t,textHeight:r,totalHeight:t+r}}clearCache(){this.iconCache.clear(),this.colorCache.clear(),this.baseSvgCache.clear(),this.compositeCache.clear(),this.svgKeys.clear(),this.svgCount=0,this.runtimeStats={textHits:0,textGenerated:0,uniqueText:0},this.dpr=typeof window<"u"&&window.devicePixelRatio||1,this.preGenerateBaseColors()}clearCacheByStatus(t){for(const n of[...this.iconCache.keys()])n.startsWith(`${t}_`)&&this.iconCache.delete(n);this.colorCache.delete(Gn(t))}clearTextIconCache(t,n){this.iconCache.delete(On(t,n))}getCacheStats(){return{iconCache:this.iconCache.size,colorCache:this.colorCache.size,baseSvg:this.baseSvgCache.size,composite:this.compositeCache.size,total:this.iconCache.size+this.colorCache.size+this.baseSvgCache.size+this.compositeCache.size}}getRuntimeStats(){return{...this.runtimeStats}}getConfig(){return{...this.defaultConfig}}updateStatusColorMap(t){io(t,()=>this.clearCache())}getStatusColorMap(){return ao()}buildFallbackTextIcon(t,n){return Ja(t,n,this.defaultConfig)}}const lo=$.getInstance();function so(e){const t=e?.type,n=e?.data;if(t==="circle"&&Array.isArray(n?.center)&&n.center.length>=2)return{type:"circle",center:[n.center[0],n.center[1]],radius:Math.abs(Number(n.radius)||0)};if((t==="polygon"||t==="rectangle"||t==="triangle")&&Array.isArray(n?.path)&&n.path.length>=3){const r=n.path.map(i=>Array.isArray(i)&&i.length>=2?[Number(i[0]),Number(i[1])]:i&&typeof i.lng=="number"&&typeof i.lat=="number"?[i.lng,i.lat]:null).filter(i=>i!==null);if(r.length>=3)return{type:t,coordinates:r}}return null}var $n=(e=>(e.INIT_FAILED="INIT_FAILED",e.LOAD_SCRIPT_FAILED="LOAD_SCRIPT_FAILED",e.INVALID_PARAMS="INVALID_PARAMS",e.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",e.OPERATION_FAILED="OPERATION_FAILED",e))($n||{});class co extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="MapError"}}g.ANIMATION_DURATION=Te,g.AppButton=Ha,g.AppIcon=G,g.AppInput=Sn,g.AppSpinner=et,g.CAMERA_CONFIG=Ee,g.ConfigManager=St,g.DEFAULT_CONTOUR_CONFIG=wt,g.DEFAULT_LIBS_URL=be,g.DEFAULT_MAP_CONFIG=ze,g.DEFAULT_MASK_CONFIG=vt,g.DEFAULT_POSITION=te,g.DEFAULT_TOOLS=Re,g.DEFAULT_TRAJECTORY_CONFIG=yt,g.ErrorCode=$n,g.EventBus=Be,g.GEOMETRY_CONFIG=H,g.GameLoading=Je,g.ICON_MAP=Qe,g.IconManager=$,g.LIBRARIES=Oe,g.MORPH_3D_DELAY=bt,g.MapContainer=Wa,g.MapControls=In,g.MapError=Tn,g.MapErrorClass=co,g.MapManager=Z,g.MapStatus=Ln,g.MapTools=Mn,g.MapView=Nn,g.NoResultsPanel=tt,g.PERFORMANCE_CONFIG=ne,g.READY_DELAY=Ct,g.ResourceManager=Dt,g.STATUS_COLOR_MAP=R,g.ScriptLoader=It,g.SearchResultsPanel=Dn,g.WAVE_REMOVE_DELAY=Et,g.buildGeoServerWmtsUrl=gn,g.cartesianFromCoord=$r,g.cartesianToDegrees=De,g.cartographicToDegrees=Wt,g.closeCoordinates=$e,g.createGeoServerWmtsProvider=pn,g.createSearchShapeFromDrawEvent=so,g.eventBus=Xn,g.getBmgl=D,g.getDefaultToolbarEntries=pt,g.getDefaultTools=mt,g.getDrawToolEntries=gt,g.getDrawToolEntry=ht,g.getEntityType=$t,g.getLogLevel=Kn,g.getStatusInfo=ir,g.getSvg=En,g.iconManager=lo,g.isIconName=bn,g.logger=w,g.mapManager=se,g.normalizeMaskConfig=xe,g.normalizeTrajectoryConfig=qe,g.rectangleToPath=We,g.registerDrawTool=Zn,g.resolveUrl=Ge,g.scriptLoader=Ue,g.setBmgl=At,g.setLogLevel=qn,g.useMap=Pt,g.useMapCircleWave=tn,g.useMapContour=ln,g.useMapDraw=Jt,g.useMapEntity=Yt,g.useMapLayers=on,g.useMapLighting=hn,g.useMapMask=un,g.useMapPoint=Ut,g.useMapPopup=en,g.useMapTrajectory=sn,g.useMapView=Cn,g.useMapWeather=fn,g.waitForBmgl=xt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));