map_view_vue3 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +232 -0
- package/map_view_vue3.js +1 -1
- package/map_view_vue3.umd.cjs +1 -1
- package/package.json +33 -4
- package/types/index.d.ts +0 -5
package/README.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# map_view_vue3
|
|
2
|
+
|
|
3
|
+
基于 Vue 3 + OpenLayers 的地图查看器组件,支持栅格图片、本地切片 XYZ、在线 XYZ、GeoJSON/SLD 数据加载,并提供坐标系切换、图层管理、拖拽加载等能力。
|
|
4
|
+
|
|
5
|
+
## 目录结构
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
map_view_vue3/
|
|
9
|
+
├─ map_view_vue3.js # ESM 构建产物
|
|
10
|
+
├─ map_view_vue3.umd.cjs # UMD 构建产物
|
|
11
|
+
├─ map_view_vue3.css # 组件样式
|
|
12
|
+
├─ types/index.d.ts # TypeScript 类型声明
|
|
13
|
+
├─ favicon.svg
|
|
14
|
+
└─ icons.svg
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 引入方式
|
|
18
|
+
|
|
19
|
+
### 方式一:按需引入组件
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { createApp } from 'vue'
|
|
23
|
+
import { MapViewVue3 } from 'map_view_vue3'
|
|
24
|
+
import 'map_view_vue3/style.css'
|
|
25
|
+
|
|
26
|
+
import App from './App.vue'
|
|
27
|
+
|
|
28
|
+
const app = createApp(App)
|
|
29
|
+
app.component('MapViewVue3', MapViewVue3)
|
|
30
|
+
app.mount('#app')
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 方式二:全局插件式注册
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { createApp } from 'vue'
|
|
37
|
+
import MapViewVue3 from 'map_view_vue3'
|
|
38
|
+
import 'map_view_vue3/style.css'
|
|
39
|
+
|
|
40
|
+
import App from './App.vue'
|
|
41
|
+
|
|
42
|
+
const app = createApp(App)
|
|
43
|
+
app.use(MapViewVue3)
|
|
44
|
+
app.mount('#app')
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 基础用法
|
|
48
|
+
|
|
49
|
+
```vue
|
|
50
|
+
<template>
|
|
51
|
+
<MapViewVue3
|
|
52
|
+
theme="light"
|
|
53
|
+
data-crs="EPSG:3857"
|
|
54
|
+
:zoom="4.2"
|
|
55
|
+
width="1000px"
|
|
56
|
+
height="800px"
|
|
57
|
+
map-background="#ffffff"
|
|
58
|
+
:auto-load="autoLoad"
|
|
59
|
+
@view-changed="onViewChanged"
|
|
60
|
+
@active-map-changed="onActiveMapChanged"
|
|
61
|
+
/>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script setup lang="ts">
|
|
65
|
+
import { ref } from 'vue'
|
|
66
|
+
|
|
67
|
+
const autoLoad = ref({
|
|
68
|
+
type: 'manifest',
|
|
69
|
+
url: 'http://localhost:7010/geojson/metadata.json',
|
|
70
|
+
baseUrl: 'http://localhost:7010/geojson'
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
function onViewChanged(state: { center: number[] | null; zoom: number | null; crs: string }) {
|
|
74
|
+
console.log('视野变化', state)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function onActiveMapChanged(payload: { id: number; name: string; kind: string }) {
|
|
78
|
+
console.log('当前地图变化', payload)
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Props
|
|
84
|
+
|
|
85
|
+
| 名称 | 类型 | 默认值 | 说明 |
|
|
86
|
+
| --- | --- | --- | --- |
|
|
87
|
+
| `theme` | `'light' \| 'dark'` | `'light'` | 明暗主题 |
|
|
88
|
+
| `dataCrs` | `string` | `'EPSG:3857'` | 初始数据坐标系 |
|
|
89
|
+
| `zoom` | `number` | `4.2` | 初始缩放级别 |
|
|
90
|
+
| `hidePanels` | `boolean` | `false` | 是否隐藏两侧面板 |
|
|
91
|
+
| `width` | `string \| number \| null` | `null` | 固定宽度,如 `'1000px'` |
|
|
92
|
+
| `height` | `string \| number \| null` | `null` | 固定高度,如 `'800px'` |
|
|
93
|
+
| `mapBackground` | `string \| null` | `null` | 地图画布背景色 |
|
|
94
|
+
| `autoLoad` | `AutoLoadConfig \| null` | `null` | 挂载后自动加载数据源 |
|
|
95
|
+
|
|
96
|
+
## autoLoad 示例
|
|
97
|
+
|
|
98
|
+
### 加载 GeoJSON 清单
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
const autoLoad = {
|
|
102
|
+
type: 'manifest',
|
|
103
|
+
url: 'https://example.com/geojson/metadata.json',
|
|
104
|
+
baseUrl: 'https://example.com/geojson'
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 加载图片
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
const autoLoad = {
|
|
112
|
+
type: 'image',
|
|
113
|
+
url: 'https://example.com/map.png',
|
|
114
|
+
worldFile: 'https://example.com/map.pgw',
|
|
115
|
+
crs: 'EPSG:3857',
|
|
116
|
+
name: '示例地图'
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 事件
|
|
121
|
+
|
|
122
|
+
| 事件名 | 参数 | 说明 |
|
|
123
|
+
| --- | --- | --- |
|
|
124
|
+
| `theme-changed` | `theme: 'light' \| 'dark'` | 主题切换 |
|
|
125
|
+
| `view-changed` | `{ center, zoom, crs }` | 视野变化 |
|
|
126
|
+
| `active-map-changed` | `{ id, name, kind }` | 当前地图切换 |
|
|
127
|
+
| `map-removed` | `{ id, name, kind }` | 地图删除 |
|
|
128
|
+
| `layer-removed` | `{ isGroup, name, layerCount, group }` | 图层删除 |
|
|
129
|
+
| `notify` | `{ message, type }` | 通知信息 |
|
|
130
|
+
|
|
131
|
+
## 常用实例方法
|
|
132
|
+
|
|
133
|
+
可以通过模板 `ref` 调用组件内部暴露的方法。
|
|
134
|
+
|
|
135
|
+
```vue
|
|
136
|
+
<template>
|
|
137
|
+
<MapViewVue3 ref="viewer" />
|
|
138
|
+
<button @click="loadLayers">加载图层</button>
|
|
139
|
+
</template>
|
|
140
|
+
|
|
141
|
+
<script setup lang="ts">
|
|
142
|
+
import { ref } from 'vue'
|
|
143
|
+
|
|
144
|
+
const viewer = ref()
|
|
145
|
+
|
|
146
|
+
async function loadLayers() {
|
|
147
|
+
await viewer.value?.loadGeoJsonFromData([
|
|
148
|
+
{
|
|
149
|
+
name: '道路',
|
|
150
|
+
geojson: { type: 'FeatureCollection', features: [] },
|
|
151
|
+
sld: '<StyledLayerDescriptor></StyledLayerDescriptor>'
|
|
152
|
+
}
|
|
153
|
+
])
|
|
154
|
+
}
|
|
155
|
+
</script>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
常用方法包括:
|
|
159
|
+
|
|
160
|
+
| 方法 | 说明 |
|
|
161
|
+
| --- | --- |
|
|
162
|
+
| `waitViewerReady()` | 等待地图查看器初始化完成 |
|
|
163
|
+
| `loadImageFromUrl(options)` | 通过 URL 加载图片地图 |
|
|
164
|
+
| `addXyzLayer(options)` | 加载在线 XYZ 图层 |
|
|
165
|
+
| `loadGeoJsonFromFiles(files)` | 加载 GeoJSON / SLD 文件 |
|
|
166
|
+
| `loadGeoJsonFromManifest(manifest, baseUrl?)` | 通过 manifest 加载矢量数据 |
|
|
167
|
+
| `loadGeoJsonFromData(layers)` | 直接传入 GeoJSON / SLD 数据 |
|
|
168
|
+
| `fitActiveMap()` | 定位到当前地图 |
|
|
169
|
+
| `fitToExtent(extent, projection?)` | 定位到指定范围 |
|
|
170
|
+
| `getViewState()` | 获取当前视野状态 |
|
|
171
|
+
| `getActiveMapInfo()` | 获取当前地图信息 |
|
|
172
|
+
| `applyTheme(theme)` | 切换明暗主题 |
|
|
173
|
+
| `normalizeEpsg(value)` | 规范化 EPSG 代码 |
|
|
174
|
+
|
|
175
|
+
## 数据格式说明
|
|
176
|
+
|
|
177
|
+
### GeoJSON / SLD 目录
|
|
178
|
+
|
|
179
|
+
支持按文件名主干配对的 `.geojson` / `.json` 与 `.sld` / `.xml` 文件。
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
layers/
|
|
183
|
+
├─ roads.geojson
|
|
184
|
+
├─ roads.sld
|
|
185
|
+
├─ buildings.geojson
|
|
186
|
+
└─ buildings.sld
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### manifest 示例
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"layers": [
|
|
194
|
+
{
|
|
195
|
+
"name": "道路",
|
|
196
|
+
"geojson": "roads.geojson",
|
|
197
|
+
"sld": "roads.sld"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "建筑",
|
|
201
|
+
"geojson": "buildings.geojson",
|
|
202
|
+
"sld": "buildings.sld"
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
如果 `metadata.json` 存在,会用于图层排序和标题显示。
|
|
209
|
+
|
|
210
|
+
## 注意事项
|
|
211
|
+
|
|
212
|
+
1. 使用前请确保项目已引入 Vue 3。
|
|
213
|
+
2. 本组件依赖 OpenLayers 与 proj4,构建产物中通常已经打包;如果你使用源码方式集成,请确保项目里已安装相关依赖。
|
|
214
|
+
3. 加载远程 GeoJSON、图片或切片时,注意目标服务是否允许跨域访问。
|
|
215
|
+
4. 如果使用本地切片目录,推荐按 `z/x/y.png` 的 XYZ 结构组织数据。
|
|
216
|
+
5. 如需在线获取 EPSG 定义,需要能访问 `epsg.io`。
|
|
217
|
+
|
|
218
|
+
## TypeScript
|
|
219
|
+
|
|
220
|
+
类型声明位于 `types/index.d.ts`,可以直接使用:
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
import type {
|
|
224
|
+
MapViewerProps,
|
|
225
|
+
MapViewerEmits,
|
|
226
|
+
MapViewerInstance
|
|
227
|
+
} from './map_view_vue3/types'
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## 许可证
|
|
231
|
+
|
|
232
|
+
ISC
|
package/map_view_vue3.js
CHANGED
|
@@ -16861,7 +16861,7 @@ var Qb = { id: "sidebar" }, $b = { class: "sidebar-header" }, ex = { class: "sid
|
|
|
16861
16861
|
class: "status-seg"
|
|
16862
16862
|
}, RS = { id: "drop-overlay" }, zS = ["data-type"], BS = /* @__PURE__ */ o({
|
|
16863
16863
|
name: "MapViewVue3",
|
|
16864
|
-
|
|
16864
|
+
name: "MapViewVue3",
|
|
16865
16865
|
props: {
|
|
16866
16866
|
theme: {
|
|
16867
16867
|
type: String,
|
package/map_view_vue3.umd.cjs
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Hf(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},Jf=class extends qf{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Yf,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0||e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass===void 0?ji:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){let t=this.getProjection();return t&&e&&!kn(t,e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||kn(t,e)))return this.tileGrid;let n=x(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Pf(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,u=new this.tileClass(o,c===void 0?H.EMPTY:H.IDLE,c===void 0?``:c,{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return u.key=a,u.addEventListener(l.CHANGE,this.handleTileChange.bind(this)),u}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||kn(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new $d(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i)||s,this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=rf(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=B(e);if(n){let e=x(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function Yf(e,t){if(ci){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`);let a={mode:r,credentials:i,referrerPolicy:e.getReferrerPolicy()};fetch(t,a).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();if(!n)return;n.width=t.width,n.height=t.height;let r=n.getContext(`2d`);r&&(r.drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`)))}).catch(()=>{e.getImage()?.dispatchEvent(new Event(`error`))})}else e.getImage().src=t}var Xf=class extends Jf{constructor(e){e||={};let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid===void 0?Lf({extent:Bf(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize}):e.tileGrid;super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0||e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter}getGutter(){return this.gutter_}};function Zf(e){let t=Object.keys(e.defs),n=t.length,r,i;for(r=0;r<n;++r){let n=t[r];if(!kt(n)){let t=e.defs(n),r=t.units;!r&&t.projName===`longlat`&&(r=`degrees`),yn(new mt({code:n,axisOrientation:t.axis,metersPerUnit:t.to_meter,units:r}))}}for(r=0;r<n;++r){let a=t[r],o=kt(a);for(i=0;i<n;++i){let n=t[i],r=kt(n);if(o&&r&&!Nt(a,n)){if(e.defs(a)===e.defs(n))Sn([o,r]);else{let t=e(a,n);En(o,r,Hn(o,r,t.forward),Hn(r,o,t.inverse))}}}}}function Qf(e){let t=e.load||gi,n=e.imageExtent,r=e.crossOrigin??null;return()=>{let i=new Image;return i.crossOrigin=r,e.referrerPolicy!==void 0&&(i.referrerPolicy=e.referrerPolicy),t(i,e.url).then(e=>{let t=L(n)/e.width,r=I(n)/e.height;return{image:e,extent:n,resolution:t===r?r:[t,r],pixelRatio:1}})}}var $f=class extends Of{constructor(e){let t=e.crossOrigin===void 0?null:e.crossOrigin,n=e.imageLoadFunction===void 0?kf:e.imageLoadFunction;super({attributions:e.attributions,interpolate:e.interpolate,projection:e.projection}),this.url_=e.url,this.imageExtent_=e.imageExtent,this.image=null,this.image=new fi(this.imageExtent_,void 0,1,Qf({url:e.url,imageExtent:e.imageExtent,crossOrigin:t,referrerPolicy:e.referrerPolicy,load:(e,t)=>{let r=this.image;return r.setImage(e),n(r,t),gi(e)}})),this.image.addEventListener(l.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(e,t,n,r){let i=this.image;return i&&Ie(e,i.getExtent())?i:null}getUrl(){return this.url_}},ep=class e extends sr{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(c),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(o(e[t],l.CHANGE,this.changed,this))}clone(){let t=new e(tp(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<de(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){ge(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)be(e,t[n].getExtent());return e}getGeometries(){return tp(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=Oe(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(tp(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function tp(e){return e.map(e=>e.clone())}var np=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=ae,this.supportedMediaTypes=void 0}getReadOptions(e,t){if(t){let n=t.dataProjection?B(t.dataProjection):this.readProjection(e);if(t.extent&&n&&n.getUnits()===`tile-pixels`){let e=B(n);e&&(e.setWorldExtent(t.extent),n=e)}t={dataProjection:n??void 0,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return y()}readFeature(e,t){return y()}readFeatures(e,t){return y()}readGeometry(e,t){return y()}readProjection(e){return y()}writeFeature(e,t){return y()}writeFeatures(e,t){return y()}writeGeometry(e,t){return y()}};function rp(e,t,n){let r=n?B(n.featureProjection):null,i=n?B(n.dataProjection):null,a=e;if(r&&i&&!kn(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;if(n.getUnits()===`tile-pixels`)a.transform(n,o);else{let e=Mn(n,o);e&&a.applyTransform(e)}}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}function ip(e,t,n){if(Array.isArray(t[0])){let r=t;return Qr(e,0,r,n)||(e=e.slice(),ei(e,0,r,n)),e}let r=t;return Zr(e,0,r,n)||(e=e.slice(),$r(e,0,r,n)),e}function ap(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>ap({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=(n.layout??`XY`).length;return rp(new Do(r,r===`Polygon`?ip(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat()??[],i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function op(e,t){if(!e)return null;if(Array.isArray(e))return new ep(e.map(e=>op(e,t)));let n=e.type,r=e.layout||`XY`,i;switch(n){case`Point`:i=new Kr(e.flatCoordinates,r);break;case`LineString`:i=new Ri(e.flatCoordinates,r);break;case`Polygon`:i=new ni(e.flatCoordinates,r,e.ends);break;case`MultiPoint`:i=new Co(e.flatCoordinates,r);break;case`MultiLineString`:i=new So(e.flatCoordinates,r,e.ends);break;case`MultiPolygon`:i=new To(e.flatCoordinates,r,e.ends);break;default:throw Error(`Unsupported geometry type: `+n)}return rp(i,!1,t)}var sp=class extends np{constructor(){super()}getType(){return`json`}readFeature(e,t){let n=cp(e);return n?this.readFeatureFromObject(n,this.getReadOptions(e,t)):[]}readFeatures(e,t){let n=cp(e);return n?this.readFeaturesFromObject(n,this.getReadOptions(e,t)):[]}readFeatureFromObject(e,t){return y()}readFeaturesFromObject(e,t){return y()}readGeometry(e,t){let n=cp(e);if(!n)throw Error(`Expected a JSON object`);return this.readGeometryFromObject(n,this.getReadOptions(e,t))}readGeometryFromObject(e,t){return y()}readProjection(e){let t=cp(e);if(!t)throw Error(`Expected a JSON object`);return this.readProjectionFromObject(t)}readProjectionFromObject(e){return y()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return y()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return y()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return y()}};function cp(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var lp=class extends sp{constructor(e){e||={},super(),this.dataProjection=B(e.dataProjection?e.dataProjection:`EPSG:4326`)??void 0,e.featureProjection&&(this.defaultFeatureProjection=B(e.featureProjection)??void 0),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=[`application/geo+json`,`application/vnd.geo+json`]}readFeatureFromObject(e,t){let n=e,r;r=n.type===`Feature`?n:{type:`Feature`,geometry:e,properties:null};let i=up(r.geometry,t);if(this.featureClass===Do)return ap({geometry:i??void 0,id:r.id,properties:r.properties??void 0},t);let a=this.featureClass,o=new a;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&`geometry_name`in r&&r.geometry_name&&o.setGeometryName(r.geometry_name),o.setGeometry(op(i,t)),`id`in r&&o.setId(r.id),r.properties&&o.setProperties(r.properties,!0),o}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return dp(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=B(t.properties.name);else if(t.type===`EPSG`)n=B(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`)}else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),o=e.getGeometry();return o&&(n.geometry=yp(o,t),delete i[e.getGeometryName()]),a(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return yp(e,this.adaptOptions(t))}};function up(e,t){if(!e||e.type!==`GeometryCollection`&&Array.isArray(e.coordinates)&&!e.coordinates.length)return null;let n;switch(e.type){case`Point`:n=pp(e);break;case`LineString`:n=mp(e);break;case`Polygon`:n=vp(e);break;case`MultiPoint`:n=gp(e);break;case`MultiLineString`:n=hp(e);break;case`MultiPolygon`:n=_p(e);break;case`GeometryCollection`:n=fp(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function dp(e,t){let n=up(e,t);return n?op(n,t):null}function fp(e,t){let n=e.geometries,r=[];for(let e of n){let n=up(e,t);n&&r.push(n)}return r}function pp(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:lr(t.length)}}function mp(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:lr(t[0]?.length||2)}}function hp(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:wr(r,0,t,n),layout:lr(n)}}function gp(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:lr(t[0]?.length||2)}}function _p(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:Tr(n,0,t,r),layout:lr(r)}}function vp(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:wr(n,0,t,r),layout:lr(r)}}function yp(e,t){e=rp(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=Tp(e,t);break;case`LineString`:r=xp(e,t);break;case`Polygon`:r=Ep(e,t);break;case`MultiPoint`:r=Cp(e,t);break;case`MultiLineString`:r=Sp(e,t);break;case`MultiPolygon`:r=wp(e,t);break;case`GeometryCollection`:r=bp(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function bp(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return yp(e,t)})}}function xp(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function Sp(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function Cp(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function wp(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function Tp(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function Ep(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}var Dp=[`fullscreenchange`,`webkitfullscreenchange`],Op={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`},kp=class extends Iu{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target}),this.on,this.once,this.un,this.keys_=e.keys!==void 0&&e.keys,this.source_=e.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=e.className===void 0?`ol-full-screen`:e.className,this.documentListeners_=[],this.activeClassName_=e.activeClassName===void 0?[this.cssClassName_+`-true`]:e.activeClassName.split(` `),this.inactiveClassName_=e.inactiveClassName===void 0?[this.cssClassName_+`-false`]:e.inactiveClassName.split(` `);let t=e.label===void 0?`⛶`:e.label;this.labelNode_=typeof t==`string`?document.createTextNode(t):t;let n=e.labelActive===void 0?`×`:e.labelActive;this.labelActiveNode_=typeof n==`string`?document.createTextNode(n):n;let r=e.tipLabel?e.tipLabel:`Toggle full-screen`;this.button_=document.createElement(`button`),this.button_.title=r,this.button_.setAttribute(`type`,`button`),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(l.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_);let i=this.element;i.className=`${this.cssClassName_} ${Sa} ${wa}`,i.appendChild(this.button_)}handleClick_(e){e.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){let e=this.getMap();if(!e)return;let t=e.getOwnerDocument();if(Ap(t)){if(jp(t))Pp(t);else{let n;if(n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),!n)return;this.keys_?Np(n):Mp(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=jp(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Ei(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(Op.ENTERFULLSCREEN)):(Ei(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(Op.LEAVEFULLSCREEN)),e.updateSize())}setClassName_(e,t){t?(e.classList.remove(...this.inactiveClassName_),e.classList.add(...this.activeClassName_)):(e.classList.remove(...this.activeClassName_),e.classList.add(...this.inactiveClassName_))}setMap(e){let t=this.getMap();t&&t.removeChangeListener(ju.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(ju.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)c(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();Ap(n)?this.element.classList.remove(Ca):this.element.classList.add(Ca);for(let t=0,r=Dp.length;t<r;++t)e.push(o(n,Dp[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function Ap(e){let t=e.body;return!!(t.webkitRequestFullscreen||`requestFullscreen`in t&&e.fullscreenEnabled)}function jp(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function Mp(e){let t=e;e.requestFullscreen?e.requestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}function Np(e){let t=e;t.webkitRequestFullscreen?t.webkitRequestFullscreen():Mp(e)}function Pp(e){let t=e;e.exitFullscreen?e.exitFullscreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()}var Fp=`projection`,Ip=`coordinateFormat`,Lp=class extends Iu{constructor(e){e||={};let t=document.createElement(`div`);t.className=e.className===void 0?`ol-mouse-position`:e.className,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un,this.addChangeListener(Fp,this.handleProjectionChanged_),e.coordinateFormat&&this.setCoordinateFormat(e.coordinateFormat),e.projection&&this.setProjection(e.projection),this.renderOnMouseOut_=e.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?e.placeholder:` `,this.renderedHTML_=t.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=e.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(Ip)}getProjection(){return this.get(Fp)}handleMouseMove(e){let t=this.getMap();t&&this.updateHTML_(t.getEventPixel(e))}handleMouseOut(e){this.updateHTML_(null)}setMap(e){if(super.setMap(e),e){let t=e.getViewport();if(!t)return;this.listenerKeys.push(o(t,Ou.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(o(t,Ou.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(Ip,e)}setProjection(e){this.set(Fp,B(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?An(this.mapProjection_,e):vn}let n=this.getMap();if(!n)return;let r=n.getCoordinateFromPixelInternal(e);if(r){let e=In();e&&(this.transform_=An(this.mapProjection_,e));let n=this.transform_;n&&n(r,r),this.wrapX_&<(r,e||this.getProjection()||this.mapProjection_);let i=this.getCoordinateFormat();t=i?i(r):r.toString()}}if(!this.renderedHTML_||t!==this.renderedHTML_){let e=this.element;e&&(e.innerHTML=t,this.renderedHTML_=t)}}render(e){let t=e.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}},Rp=`units`,zp=[1,2,5],Bp=25.4/.28,Vp=class extends Iu{constructor(e){e||={};let t=document.createElement(`div`);t.style.pointerEvents=`none`,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;let n=e.className===void 0?e.bar?`ol-scale-bar`:`ol-scale-line`:e.className;this.innerElement_=document.createElement(`div`),this.innerElement_.className=n+`-inner`,this.element.className=n+` `+Sa,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth===void 0?64:e.minWidth,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_=``,this.addChangeListener(Rp,this.handleUnitsChanged_),this.setUnits(e.units||`metric`),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(Rp)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(Rp,e)}setDpi(e){this.dpi_=e}updateElement_(){let e=this.viewState_;if(!e){let e=this.element;this.renderedVisible_&&e&&(e.style.display=`none`,this.renderedVisible_=!1);return}let t=e.center,n=e.projection,r=this.getUnits(),i=r==`degrees`?`degrees`:`m`,a=xn(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||Bp)/Bp,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||Bp)/Bp,c=o*a,l=``;if(r==`degrees`){let e=pt.degrees;c*=e,c<e/60?(l=`″`,a*=3600):c<e?(l=`′`,a*=60):l=`°`}else if(r==`imperial`)c<.9144?(l=`in`,a/=.0254):c<1609.344?(l=`ft`,a/=.3048):(l=`mi`,a/=1609.344);else if(r==`nautical`)a/=1852,l=`NM`;else if(r==`metric`)c<1e-6?(l=`nm`,a*=1e9):c<.001?(l=`μm`,a*=1e6):c<1?(l=`mm`,a*=1e3):c<1e3?l=`m`:(l=`km`,a/=1e3);else if(r==`us`)c<.9144?(l=`in`,a*=39.37):c<1609.344?(l=`ft`,a/=.30480061):(l=`mi`,a/=1609.3472);else throw Error(`Invalid units`);let u=3*Math.floor(Math.log(o*a)/Math.log(10)),d,f,p=0,m=0,h,g;for(;;){p=Math.floor(u/3);let e=10**p;if(d=zp[(u%3+3)%3]*e,f=Math.round(d/a),isNaN(f)){let e=this.element;e&&(e.style.display=`none`),this.renderedVisible_=!1;return}if(s!==void 0&&f>=s){d=m,f=h,p=g;break}if(f>=o)break;m=d,h=f,g=p,++u}let _=this.scaleBar_?this.createScaleBar(f,d,l):d.toFixed(p<0?-p:0)+` `+l;if(this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+`px`,this.renderedWidth_=f),!this.renderedVisible_){let e=this.element;e&&(e.style.display=``),this.renderedVisible_=!0}}createScaleBar(e,t,n){let r=this.getScaleForResolution(),i=r<1?Math.round(1/r).toLocaleString()+` : 1`:`1 : `+Math.round(r).toLocaleString(),a=this.scaleBarSteps_,o=e/a,s=[this.createMarker(`absolute`)];for(let r=0;r<a;++r){let i=r%2==0?`ol-scale-singlebar-odd`:`ol-scale-singlebar-even`;s.push(`<div><div class="ol-scale-singlebar ${i}" style="width: ${o}px;"></div>`+this.createMarker(`relative`)+(r%2==0||a===2?this.createStepText(r,e,!1,t,n):``)+`</div>`)}return s.push(this.createStepText(a,e,!0,t,n)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+i+`</div>`:``)+s.join(``)}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e===`absolute`?3:-10}px;"></div>`}createStepText(e,t,n,r,i){let a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?``:` `+i),o=e===0?-3:t/this.scaleBarSteps_*-1,s=e===0?0:t/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${o}px;text-align: ${e===0?`left`:`center`};min-width: ${s}px;left: ${n?t+`px`:`unset`};">`+a+`</div>`}getScaleForResolution(){let e=this.viewState_;if(!e)return 0;let t=xn(e.projection,e.resolution,e.center,`m`),n=this.dpi_||Bp;return 1e3/25.4*t*n}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function Hp(e){e(`EPSG:4326`,`+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees`),e(`EPSG:4269`,`+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees`),e(`EPSG:3857`,`+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs`);for(var t=1;t<=60;++t)e(`EPSG:`+(32600+t),`+proj=utm +zone=`+t+` +datum=WGS84 +units=m`),e(`EPSG:`+(32700+t),`+proj=utm +zone=`+t+` +south +datum=WGS84 +units=m`);e(`EPSG:5041`,`+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m`),e(`EPSG:5042`,`+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m`),e.WGS84=e[`EPSG:4326`],e[`EPSG:3785`]=e[`EPSG:3857`],e.GOOGLE=e[`EPSG:3857`],e[`EPSG:900913`]=e[`EPSG:3857`],e[`EPSG:102113`]=e[`EPSG:3857`]}var Up=6378137,Wp=6356752.314,Gp=.0066943799901413165,Kp=484813681109536e-20,X=Math.PI/2,qp=.16666666666666666,Jp=.04722222222222222,Yp=.022156084656084655,Xp=1e-10,Zp=.017453292519943295,Qp=57.29577951308232,Z=Math.PI/4,$p=Math.PI*2,em=3.14159265359,tm={};tm.greenwich=0,tm.lisbon=-9.131906111111,tm.paris=2.337229166667,tm.bogota=-74.080916666667,tm.madrid=-3.687938888889,tm.rome=12.452333333333,tm.bern=7.439583333333,tm.jakarta=106.807719444444,tm.ferro=-17.666666666667,tm.brussels=4.367975,tm.stockholm=18.058277777778,tm.athens=23.7163375,tm.oslo=10.722916666667;var nm={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}},rm=/[\s_\-\/\(\)]/g;function im(e,t){if(e[t])return e[t];for(var n=Object.keys(e),r=t.toLowerCase().replace(rm,``),i=-1,a,o;++i<n.length;)if(a=n[i],o=a.toLowerCase().replace(rm,``),o===r)return e[a]}function am(e){var t={},n=e.split(`+`).map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var n=t.split(`=`);return n.push(!0),e[n[0].toLowerCase()]=n[1],e},{}),r,i,a,o={proj:function(e){t.projName=[`lonlat`,`latlon`,`latlong`].includes(e)?`longlat`:e},datum:`datumCode`,rf:function(e){t.rf=parseFloat(e)},lat_0:function(e){t.lat0=e*Zp},lat_1:function(e){t.lat1=e*Zp},lat_2:function(e){t.lat2=e*Zp},lat_ts:function(e){t.lat_ts=e*Zp},lon_0:function(e){t.long0=e*Zp},lon_wrap:function(e){t.long_wrap=parseFloat(e)*Zp},lon_1:function(e){t.long1=e*Zp},lon_2:function(e){t.long2=e*Zp},alpha:function(e){t.alpha=parseFloat(e)*Zp},gamma:function(e){t.rectified_grid_angle=parseFloat(e)*Zp},lonc:function(e){t.longc=e*Zp},x_0:function(e){t.x0=parseFloat(e)},y_0:function(e){t.y0=parseFloat(e)},k_0:function(e){t.k0=parseFloat(e)},k:function(e){t.k0=parseFloat(e)},a:function(e){t.a=parseFloat(e)},b:function(e){t.b=parseFloat(e)},r:function(e){t.a=t.b=parseFloat(e)},r_a:function(){t.R_A=!0},zone:function(e){t.zone=parseInt(e,10)},south:function(){t.utmSouth=!0},towgs84:function(e){t.datum_params=e.split(`,`).map(function(e){return parseFloat(e)})},to_meter:function(e){t.to_meter=parseFloat(e)},units:function(e){t.units=e;var n=im(nm,e);n&&(t.to_meter=n.to_meter)},from_greenwich:function(e){t.from_greenwich=e*Zp},pm:function(e){t.from_greenwich=(im(tm,e)||parseFloat(e))*Zp},nadgrids:function(e){e===`@null`?t.datumCode=`none`:t.nadgrids=e},axis:function(e){var n=`ewnsud`;e.length===3&&n.indexOf(e.substr(0,1))!==-1&&n.indexOf(e.substr(1,1))!==-1&&n.indexOf(e.substr(2,1))!==-1&&(t.axis=e)},approx:function(){t.approx=!0},over:function(){t.over=!0}};for(r in n)i=n[r],r in o?(a=o[r],typeof a==`function`?a(i):t[a]=i):t[r]=i;return typeof t.datumCode==`string`&&t.datumCode!==`WGS84`&&(t.datumCode=t.datumCode.toLowerCase()),t.projStr=e,t}var om=class{static getId(e){let t=e.find(e=>Array.isArray(e)&&e[0]===`ID`);return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t=`unit`){if(!e||e.length<3)return{type:t,name:`unknown`,conversion_factor:null};let n=e[1],r=parseFloat(e[2])||null,i=e.find(e=>Array.isArray(e)&&e[0]===`ID`);return{type:t,name:n,conversion_factor:r,id:i?{authority:i[1],code:parseInt(i[2],10)}:null}}static convertAxis(e){let t=e[1]||`Unknown`,n,r=t.match(/^\((.)\)$/);if(r){let t=r[1].toUpperCase();if(t===`E`)n=`east`;else if(t===`N`)n=`north`;else if(t===`U`)n=`up`;else if(e[2])n=e[2];else throw Error(`Unknown axis abbreviation: ${t}`)}else n=e[2]||`unknown`;let i=e.find(e=>Array.isArray(e)&&e[0]===`ORDER`),a=i?parseInt(i[1],10):null,o=e.find(e=>Array.isArray(e)&&(e[0]===`LENGTHUNIT`||e[0]===`ANGLEUNIT`||e[0]===`SCALEUNIT`)),s=this.convertUnit(o);return{name:t,direction:n,unit:s,order:a}}static extractAxes(e){return e.filter(e=>Array.isArray(e)&&e[0]===`AXIS`).map(e=>this.convertAxis(e)).sort((e,t)=>(e.order||0)-(t.order||0))}static convert(e,t={}){switch(e[0]){case`PROJCRS`:t.type=`ProjectedCRS`,t.name=e[1],t.base_crs=e.find(e=>Array.isArray(e)&&e[0]===`BASEGEOGCRS`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`BASEGEOGCRS`)):null,t.conversion=e.find(e=>Array.isArray(e)&&e[0]===`CONVERSION`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`CONVERSION`)):null;let n=e.find(e=>Array.isArray(e)&&e[0]===`CS`);n&&(t.coordinate_system={subtype:n[1],axis:this.extractAxes(e)});let r=e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`);if(r){let e=this.convertUnit(r);t.coordinate_system.unit=e}t.id=this.getId(e);break;case`BASEGEOGCRS`:case`GEOGCRS`:case`GEODCRS`:t.type=e[0]===`GEODCRS`?`GeodeticCRS`:`GeographicCRS`,t.name=e[1];let i=e.find(e=>Array.isArray(e)&&(e[0]===`DATUM`||e[0]===`ENSEMBLE`));if(i){let n=this.convert(i);i[0]===`ENSEMBLE`?t.datum_ensemble=n:t.datum=n;let r=e.find(e=>Array.isArray(e)&&e[0]===`PRIMEM`);r&&r[1]!==`Greenwich`&&(n.prime_meridian={name:r[1],longitude:parseFloat(r[2])})}let a=e.find(e=>Array.isArray(e)&&e[0]===`CS`);t.coordinate_system={subtype:a?a[1]:`ellipsoidal`,axis:this.extractAxes(e)},t.id=this.getId(e);break;case`DATUM`:t.type=`GeodeticReferenceFrame`,t.name=e[1],t.ellipsoid=e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`)):null;break;case`ENSEMBLE`:t.type=`DatumEnsemble`,t.name=e[1],t.members=e.filter(e=>Array.isArray(e)&&e[0]===`MEMBER`).map(e=>({type:`DatumEnsembleMember`,name:e[1],id:this.getId(e)}));let o=e.find(e=>Array.isArray(e)&&e[0]===`ENSEMBLEACCURACY`);o&&(t.accuracy=parseFloat(o[1]));let s=e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`);s&&(t.ellipsoid=this.convert(s)),t.id=this.getId(e);break;case`ELLIPSOID`:t.type=`Ellipsoid`,t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`)&&this.convert(e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`),t);break;case`CONVERSION`:t.type=`Conversion`,t.name=e[1],t.method=e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)):null,t.parameters=e.filter(e=>Array.isArray(e)&&e[0]===`PARAMETER`).map(e=>this.convert(e));break;case`METHOD`:t.type=`Method`,t.name=e[1],t.id=this.getId(e);break;case`PARAMETER`:t.type=`Parameter`,t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(e=>Array.isArray(e)&&(e[0]===`LENGTHUNIT`||e[0]===`ANGLEUNIT`||e[0]===`SCALEUNIT`))),t.id=this.getId(e);break;case`BOUNDCRS`:t.type=`BoundCRS`;let c=e.find(e=>Array.isArray(e)&&e[0]===`SOURCECRS`);if(c){let e=c.find(e=>Array.isArray(e));t.source_crs=e?this.convert(e):null}let l=e.find(e=>Array.isArray(e)&&e[0]===`TARGETCRS`);if(l){let e=l.find(e=>Array.isArray(e));t.target_crs=e?this.convert(e):null}let u=e.find(e=>Array.isArray(e)&&e[0]===`ABRIDGEDTRANSFORMATION`);t.transformation=u?this.convert(u):null;break;case`ABRIDGEDTRANSFORMATION`:if(t.type=`Transformation`,t.name=e[1],t.method=e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)):null,t.parameters=e.filter(e=>Array.isArray(e)&&(e[0]===`PARAMETER`||e[0]===`PARAMETERFILE`)).map(e=>{if(e[0]===`PARAMETER`)return this.convert(e);if(e[0]===`PARAMETERFILE`)return{name:e[1],value:e[2],id:{authority:`EPSG`,code:8656}}}),t.parameters.length===7){let e=t.parameters[6];e.name===`Scale difference`&&(e.value=Math.round((e.value-1)*0xe8d4a51000)/1e6)}t.id=this.getId(e);break;case`AXIS`:t.coordinate_system||={type:`unspecified`,axis:[]},t.coordinate_system.axis.push(this.convertAxis(e));break;case`LENGTHUNIT`:let d=this.convertUnit(e,`LinearUnit`);t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(e=>{e.unit||=d}),d.conversion_factor&&d.conversion_factor!==1&&(t.semi_major_axis&&={value:t.semi_major_axis,unit:d});break;default:t.keyword=e[0]}return t}};function sm(e){return om.convert(e)}function cm(e){let t=e.toUpperCase();return t.includes(`PROJCRS`)||t.includes(`GEOGCRS`)||t.includes(`BOUNDCRS`)||t.includes(`VERTCRS`)||t.includes(`LENGTHUNIT`)||t.includes(`ANGLEUNIT`)||t.includes(`SCALEUNIT`)?`WKT2`:(t.includes(`PROJCS`)||t.includes(`GEOGCS`)||t.includes(`LOCAL_CS`)||t.includes(`VERT_CS`)||t.includes(`UNIT`),`WKT1`)}var lm=Sm,um=1,dm=2,fm=3,pm=4,mm=5,hm=-1,gm=/\s/,_m=/[A-Za-z]/,vm=/[A-Za-z84_]/,ym=/[,\]]/,bm=/[\d\.E\-\+]/;function xm(e){if(typeof e!=`string`)throw Error(`not a string`);this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=um}xm.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==pm)for(;gm.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case um:return this.neutral(e);case dm:return this.keyword(e);case pm:return this.quoted(e);case mm:return this.afterquote(e);case fm:return this.number(e);case hm:return}},xm.prototype.afterquote=function(e){if(e===`"`)this.word+=`"`,this.state=pm;else if(ym.test(e))this.word=this.word.trim(),this.afterItem(e);else throw Error(`havn't handled "`+e+`" in afterquote yet, index `+this.place)},xm.prototype.afterItem=function(e){e===`,`?(this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=um):e===`]`&&(this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=um,this.currentObject=this.stack.pop(),this.currentObject||(this.state=hm))},xm.prototype.number=function(e){if(bm.test(e))this.word+=e;else if(ym.test(e))this.word=parseFloat(this.word),this.afterItem(e);else throw Error(`havn't handled "`+e+`" in number yet, index `+this.place)},xm.prototype.quoted=function(e){e===`"`?this.state=mm:this.word+=e},xm.prototype.keyword=function(e){if(vm.test(e))this.word+=e;else if(e===`[`){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=um}else if(ym.test(e))this.afterItem(e);else throw Error(`havn't handled "`+e+`" in keyword yet, index `+this.place)},xm.prototype.neutral=function(e){if(_m.test(e))this.word=e,this.state=dm;else if(e===`"`)this.word=``,this.state=pm;else if(bm.test(e))this.word=e,this.state=fm;else if(ym.test(e))this.afterItem(e);else throw Error(`havn't handled "`+e+`" in neutral yet, index `+this.place)},xm.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===hm)return this.root;throw Error(`unable to parse string "`+this.text+`". State is `+this.state)};function Sm(e){return new xm(e).output()}function Cm(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var r=t?{}:e,i=n.reduce(function(e,t){return wm(t,e),e},r);t&&(e[t]=i)}function wm(e,t){if(!Array.isArray(e))t[e]=!0;else{var n=e.shift();if(n===`PARAMETER`&&(n=e.shift()),e.length===1){if(Array.isArray(e[0])){t[n]={},wm(e[0],t[n]);return}t[n]=e[0]}else if(!e.length)t[n]=!0;else if(n===`TOWGS84`)t[n]=e;else if(n===`AXIS`)n in t||(t[n]=[]),t[n].push(e);else{Array.isArray(n)||(t[n]={});var r;switch(n){case`UNIT`:case`PRIMEM`:case`VERT_DATUM`:t[n]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&wm(e[2],t[n]);return;case`SPHEROID`:case`ELLIPSOID`:t[n]={name:e[0],a:e[1],rf:e[2]},e.length===4&&wm(e[3],t[n]);return;case`EDATUM`:case`ENGINEERINGDATUM`:case`LOCAL_DATUM`:case`DATUM`:case`VERT_CS`:case`VERTCRS`:case`VERTICALCRS`:e[0]=[`name`,e[0]],Cm(t,n,e);return;case`COMPD_CS`:case`COMPOUNDCRS`:case`FITTED_CS`:case`PROJECTEDCRS`:case`PROJCRS`:case`GEOGCS`:case`GEOCCS`:case`PROJCS`:case`LOCAL_CS`:case`GEODCRS`:case`GEODETICCRS`:case`GEODETICDATUM`:case`ENGCRS`:case`ENGINEERINGCRS`:e[0]=[`name`,e[0]],Cm(t,n,e),t[n].type=n;return;default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return wm(e,t[n]);return Cm(t,n,e)}}}}var Tm=.017453292519943295;function Em(e){return e*Tm}function Dm(e){let t=(e.projName||``).toLowerCase().replace(/_/g,` `);e.long0===void 0&&e.longc!==void 0&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(t===`stereographic south pole`||t===`polar stereographic (variant b)`)?(e.lat0=Em(e.lat1>0?90:-90),e.lat_ts=e.lat1,delete e.lat1):!e.lat_ts&&e.lat0&&(t===`polar stereographic`||t===`polar stereographic (variant a)`)&&(e.lat_ts=e.lat0,e.lat0=Em(e.lat0>0?90:-90),delete e.lat1)}function Om(e){let t={units:null,to_meter:void 0};return typeof e==`string`?(t.units=e.toLowerCase(),t.units===`metre`&&(t.units=`meter`),t.units===`meter`&&(t.to_meter=1)):e&&e.name&&(t.units=e.name.toLowerCase(),t.units===`metre`&&(t.units=`meter`),t.to_meter=e.conversion_factor),t}function km(e){return typeof e==`object`?e.value*e.unit.conversion_factor:e}function Am(e,t){e.ellipsoid.radius?(t.a=e.ellipsoid.radius,t.rf=0):(t.a=km(e.ellipsoid.semi_major_axis),e.ellipsoid.inverse_flattening===void 0?e.ellipsoid.semi_major_axis!==void 0&&e.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-km(e.ellipsoid.semi_minor_axis))):t.rf=e.ellipsoid.inverse_flattening)}function jm(e,t={}){return!e||typeof e!=`object`?e:e.type===`BoundCRS`?(jm(e.source_crs,t),e.transformation&&(e.transformation.method&&e.transformation.method.name===`NTv2`?t.nadgrids=e.transformation.parameters[0].value:t.datum_params=e.transformation.parameters.map(e=>e.value)),t):(Object.keys(e).forEach(n=>{let r=e[n];if(r!==null)switch(n){case`name`:if(t.srsCode)break;t.name=r,t.srsCode=r;break;case`type`:r===`GeographicCRS`?t.projName=`longlat`:r===`GeodeticCRS`?t.projName=e.coordinate_system&&e.coordinate_system.subtype===`Cartesian`?`geocent`:`longlat`:r===`ProjectedCRS`&&e.conversion&&e.conversion.method&&(t.projName=e.conversion.method.name);break;case`datum`:case`datum_ensemble`:r.ellipsoid&&(t.ellps=r.ellipsoid.name,Am(r,t)),r.prime_meridian&&(t.from_greenwich=r.prime_meridian.longitude*Math.PI/180);break;case`ellipsoid`:t.ellps=r.name,Am(r,t);break;case`prime_meridian`:t.long0=(r.longitude||0)*Math.PI/180;break;case`coordinate_system`:if(r.axis){let e={east:`e`,north:`n`,west:`w`,south:`s`,up:`u`,down:`d`,geocentricx:`e`,geocentricy:`n`,geocentricz:`u`},n=r.axis.map(t=>e[t.direction.toLowerCase()]);if(n.every(Boolean)&&(t.axis=n.join(``),t.axis.length===2&&(t.axis+=`u`)),r.unit){let{units:e,to_meter:n}=Om(r.unit);t.units=e,t.to_meter=n}else if(r.axis[0]&&r.axis[0].unit){let{units:e,to_meter:n}=Om(r.axis[0].unit);t.units=e,t.to_meter=n}}break;case`id`:r.authority&&r.code&&(t.title=r.authority+`:`+r.code);break;case`conversion`:r.method&&r.method.name&&(t.projName=r.method.name),r.parameters&&r.parameters.forEach(e=>{let n=e.name.toLowerCase().replace(/\s+/g,`_`),r=e.value;t[n]=e.unit&&e.unit.conversion_factor?r*e.unit.conversion_factor:e.unit===`degree`?r*Math.PI/180:r});break;case`unit`:r.name&&(t.units=r.name.toLowerCase(),t.units===`metre`&&(t.units=`meter`)),r.conversion_factor&&(t.to_meter=r.conversion_factor);break;case`base_crs`:jm(r,t),t.datumCode=r.id?r.id.authority+`_`+r.id.code:r.name}}),!t.datumCode&&(e.type===`GeographicCRS`||e.type===`GeodeticCRS`)&&e.id&&(t.datumCode=e.id.authority+`_`+e.id.code),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),Dm(t),t)}var Mm=[`PROJECTEDCRS`,`PROJCRS`,`GEOGCS`,`GEOCCS`,`PROJCS`,`LOCAL_CS`,`GEODCRS`,`GEODETICCRS`,`GEODETICDATUM`,`ENGCRS`,`ENGINEERINGCRS`];function Nm(e,t){var n=t[0],r=t[1];!(n in e)&&r in e&&(e[n]=e[r],t.length===3&&(e[n]=t[2](e[n])))}function Pm(e){for(var t=Object.keys(e),n=0,r=t.length;n<r;++n){var i=t[n];Mm.indexOf(i)!==-1&&Fm(e[i]),typeof e[i]==`object`&&Pm(e[i])}}function Fm(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+`:`+e.AUTHORITY[t])}if(e.type===`GEOGCS`?e.projName=`longlat`:e.type===`LOCAL_CS`?(e.projName=`identity`,e.local=!0):e.projName=typeof e.PROJECTION==`object`?Object.keys(e.PROJECTION)[0]:e.PROJECTION,e.AXIS){for(var n=``,r=0,i=e.AXIS.length;r<i;++r){var a=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];a[0].indexOf(`north`)!==-1||(a[0]===`y`||a[0]===`lat`)&&a[1]===`north`?n+=`n`:a[0].indexOf(`south`)!==-1||(a[0]===`y`||a[0]===`lat`)&&a[1]===`south`?n+=`s`:a[0].indexOf(`east`)!==-1||(a[0]===`x`||a[0]===`lon`)&&a[1]===`east`?n+=`e`:(a[0].indexOf(`west`)!==-1||(a[0]===`x`||a[0]===`lon`)&&a[1]===`west`)&&(n+=`w`)}n.length===2&&(n+=`u`),n.length===3&&(e.axis=n)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units===`metre`&&(e.units=`meter`),e.UNIT.convert&&(e.type===`GEOGCS`?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type===`GEOGCS`&&(o=e),o&&(o.PRIMEM&&o.PRIMEM.convert&&(e.from_greenwich=Em(o.PRIMEM.convert)),e.datumCode=o.DATUM?o.DATUM.name.toLowerCase():o.name.toLowerCase(),e.datumCode.slice(0,2)===`d_`&&(e.datumCode=e.datumCode.slice(2)),e.datumCode===`new_zealand_1949`&&(e.datumCode=`nzgd49`),(e.datumCode===`wgs_1984`||e.datumCode===`world_geodetic_system_1984`)&&(e.PROJECTION===`Mercator_Auxiliary_Sphere`&&(e.sphere=!0),e.datumCode=`wgs84`),e.datumCode===`belge_1972`&&(e.datumCode=`rnb72`),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace(`_19`,``).replace(/[Cc]larke\_18/,`clrk`),e.ellps.toLowerCase().slice(0,13)===`international`&&(e.ellps=`intl`),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf(`osgb_1936`)&&(e.datumCode=`osgb36`),~e.datumCode.indexOf(`osni_1952`)&&(e.datumCode=`osni52`),(~e.datumCode.indexOf(`tm65`)||~e.datumCode.indexOf(`geodetic_datum_of_1965`))&&(e.datumCode=`ire65`),e.datumCode===`ch1903+`&&(e.datumCode=`ch1903`),~e.datumCode.indexOf(`israel`)&&(e.datumCode=`isr93`)),e.b&&!isFinite(e.b)&&(e.b=e.a),e.rectified_grid_angle&&=Em(e.rectified_grid_angle);function s(t){return t*(e.to_meter||1)}[[`standard_parallel_1`,`Standard_Parallel_1`],[`standard_parallel_1`,`Latitude of 1st standard parallel`],[`standard_parallel_2`,`Standard_Parallel_2`],[`standard_parallel_2`,`Latitude of 2nd standard parallel`],[`false_easting`,`False_Easting`],[`false_easting`,`False easting`],[`false-easting`,`Easting at false origin`],[`false_northing`,`False_Northing`],[`false_northing`,`False northing`],[`false_northing`,`Northing at false origin`],[`central_meridian`,`Central_Meridian`],[`central_meridian`,`Longitude of natural origin`],[`central_meridian`,`Longitude of false origin`],[`latitude_of_origin`,`Latitude_Of_Origin`],[`latitude_of_origin`,`Central_Parallel`],[`latitude_of_origin`,`Latitude of natural origin`],[`latitude_of_origin`,`Latitude of false origin`],[`scale_factor`,`Scale_Factor`],[`k0`,`scale_factor`],[`latitude_of_center`,`Latitude_Of_Center`],[`latitude_of_center`,`Latitude_of_center`],[`lat0`,`latitude_of_center`,Em],[`longitude_of_center`,`Longitude_Of_Center`],[`longitude_of_center`,`Longitude_of_center`],[`longc`,`longitude_of_center`,Em],[`x0`,`false_easting`,s],[`y0`,`false_northing`,s],[`long0`,`central_meridian`,Em],[`lat0`,`latitude_of_origin`,Em],[`lat0`,`standard_parallel_1`,Em],[`lat1`,`standard_parallel_1`,Em],[`lat2`,`standard_parallel_2`,Em],[`azimuth`,`Azimuth`],[`alpha`,`azimuth`,Em],[`srsCode`,`name`]].forEach(function(t){return Nm(e,t)}),Dm(e)}function Im(e){if(typeof e==`object`)return jm(e);let t=cm(e);var n=lm(e);if(t===`WKT2`)return jm(sm(n));var r=n[0],i={};return wm(n,i),Pm(i),i[r]}function Lm(e){var t=this;if(arguments.length===2){var n=arguments[1];typeof n==`string`?Lm[e]=n.charAt(0)===`+`?am(arguments[1]):Im(arguments[1]):n&&typeof n==`object`&&!(`projName`in n)?Lm[e]=Im(arguments[1]):(Lm[e]=n,n||delete Lm[e])}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(e){return Array.isArray(e)?Lm.apply(t,e):Lm(e)});if(typeof e==`string`){if(e in Lm)return Lm[e]}else`EPSG`in e?Lm[`EPSG:`+e.EPSG]=e:`ESRI`in e?Lm[`ESRI:`+e.ESRI]=e:`IAU2000`in e?Lm[`IAU2000:`+e.IAU2000]=e:console.log(e);return}}Hp(Lm);function Rm(e){return typeof e==`string`}function zm(e){return e in Lm}function Bm(e){return e.indexOf(`+`)!==0&&e.indexOf(`[`)!==-1||typeof e==`object`&&!(`srsCode`in e)}var Vm=[`3857`,`900913`,`3785`,`102113`];function Hm(e){if(e.title)return e.title.toLowerCase().indexOf(`epsg:`)===0&&Vm.indexOf(e.title.substr(5))>-1;var t=im(e,`authority`);if(t){var n=im(t,`epsg`);return n&&Vm.indexOf(n)>-1}}function Um(e){var t=im(e,`extension`);if(t)return im(t,`proj4`)}function Wm(e){return e[0]===`+`}function Gm(e){let t;if(Rm(e)){if(zm(e))t=Lm[e];else if(Bm(e)){t=Im(e);var n=Um(t);n&&(t=am(n))}else Wm(e)&&(t=am(e))}else t=`projName`in e?e:Im(e);return t&&Hm(t)?Lm[`EPSG:3857`]:t}function Km(e,t){e||={};var n,r;if(!t)return e;for(r in t)n=t[r],n!==void 0&&(e[r]=n);return e}function qm(e,t,n){var r=e*t;return n/Math.sqrt(1-r*r)}function Jm(e){return e<0?-1:1}function Q(e,t){return t||Math.abs(e)<=3.14159265359?e:e-Jm(e)*$p}function Ym(e,t,n){var r=e*n,i=.5*e;return r=((1-r)/(1+r))**i,Math.tan(.5*(X-t))/r}function Xm(e,t){for(var n=.5*e,r,i,a=X-2*Math.atan(t),o=0;o<=15;o++)if(r=e*Math.sin(a),i=X-2*Math.atan(t*((1-r)/(1+r))**n)-a,a+=i,Math.abs(i)<=1e-10)return a;return-9999}function Zm(){var e=this.b/this.a;this.es=1-e*e,`x0`in this||(this.x0=0),`y0`in this||(this.y0=0),this.long0=this.long0||0,this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):qm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||=this.k?this.k:1}function Qm(e){var t=e.x,n=e.y;if(n*57.29577951308232>90&&n*57.29577951308232<-90&&t*57.29577951308232>180&&t*57.29577951308232<-180)return null;var r,i;if(Math.abs(Math.abs(n)-X)<=1e-10)return null;if(this.sphere)r=this.x0+this.a*this.k0*Q(t-this.long0,this.over),i=this.y0+this.a*this.k0*Math.log(Math.tan(Z+.5*n));else{var a=Math.sin(n),o=Ym(this.e,n,a);r=this.x0+this.a*this.k0*Q(t-this.long0,this.over),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=r,e.y=i,e}function $m(e){var t=e.x-this.x0,n=e.y-this.y0,r,i;if(this.sphere)i=X-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var a=Math.exp(-n/(this.a*this.k0));if(i=Xm(this.e,a),i===-9999)return null}return r=Q(this.long0+t/(this.a*this.k0),this.over),e.x=r,e.y=i,e}var eh={init:Zm,forward:Qm,inverse:$m,names:[`Mercator`,`Popular Visualisation Pseudo Mercator`,`Mercator_1SP`,`Mercator_Auxiliary_Sphere`,`Mercator_Variant_A`,`merc`]};function th(){}function nh(e){return e}var rh=[`longlat`,`identity`,`lonlat`,`latlon`,`latlong`],ih=[eh,{init:th,forward:nh,inverse:nh,names:rh}],ah={},oh=[];function sh(e,t){var n=oh.length;return e.names?(oh[n]=e,e.names.forEach(function(e){ah[e.toLowerCase()]=n}),this):(console.log(t),!0)}function ch(e){return e.replace(/[-\(\)\s]+/g,` `).trim().replace(/ /g,`_`)}function lh(e){if(!e)return!1;var t=e.toLowerCase();if(ah[t]!==void 0&&oh[ah[t]]||(t=ch(t),t in ah&&oh[ah[t]]))return oh[ah[t]]}function uh(){ih.forEach(sh)}var dh={start:uh,add:sh,get:lh},fh={MERIT:{a:6378137,rf:298.257,ellipseName:`MERIT 1983`},SGS85:{a:6378136,rf:298.257,ellipseName:`Soviet Geodetic System 85`},GRS80:{a:6378137,rf:298.257222101,ellipseName:`GRS 1980(IUGG, 1980)`},IAU76:{a:6378140,rf:298.257,ellipseName:`IAU 1976`},airy:{a:6377563.396,b:6356256.91,ellipseName:`Airy 1830`},APL4:{a:6378137,rf:298.25,ellipseName:`Appl. Physics. 1965`},NWL9D:{a:6378145,rf:298.25,ellipseName:`Naval Weapons Lab., 1965`},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:`Modified Airy`},andrae:{a:6377104.43,rf:300,ellipseName:`Andrae 1876 (Den., Iclnd.)`},aust_SA:{a:6378160,rf:298.25,ellipseName:`Australian Natl & S. Amer. 1969`},GRS67:{a:6378160,rf:298.247167427,ellipseName:`GRS 67(IUGG 1967)`},bessel:{a:6377397.155,rf:299.1528128,ellipseName:`Bessel 1841`},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:`Bessel 1841 (Namibia)`},clrk66:{a:6378206.4,b:6356583.8,ellipseName:`Clarke 1866`},clrk80:{a:6378249.145,rf:293.4663,ellipseName:`Clarke 1880 mod.`},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:`Clarke 1880 (IGN)`},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:`Clarke 1858`},CPM:{a:6375738.7,rf:334.29,ellipseName:`Comm. des Poids et Mesures 1799`},delmbr:{a:6376428,rf:311.5,ellipseName:`Delambre 1810 (Belgium)`},engelis:{a:6378136.05,rf:298.2566,ellipseName:`Engelis 1985`},evrst30:{a:6377276.345,rf:300.8017,ellipseName:`Everest 1830`},evrst48:{a:6377304.063,rf:300.8017,ellipseName:`Everest 1948`},evrst56:{a:6377301.243,rf:300.8017,ellipseName:`Everest 1956`},evrst69:{a:6377295.664,rf:300.8017,ellipseName:`Everest 1969`},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:`Everest (Sabah & Sarawak)`},fschr60:{a:6378166,rf:298.3,ellipseName:`Fischer (Mercury Datum) 1960`},fschr60m:{a:6378155,rf:298.3,ellipseName:`Fischer 1960`},fschr68:{a:6378150,rf:298.3,ellipseName:`Fischer 1968`},helmert:{a:6378200,rf:298.3,ellipseName:`Helmert 1906`},hough:{a:6378270,rf:297,ellipseName:`Hough`},intl:{a:6378388,rf:297,ellipseName:`International 1909 (Hayford)`},kaula:{a:6378163,rf:298.24,ellipseName:`Kaula 1961`},lerch:{a:6378139,rf:298.257,ellipseName:`Lerch 1979`},mprts:{a:6397300,rf:191,ellipseName:`Maupertius 1738`},new_intl:{a:6378157.5,b:6356772.2,ellipseName:`New International 1967`},plessis:{a:6376523,b:6355863,ellipseName:`Plessis 1817 (France)`},krass:{a:6378245,rf:298.3,ellipseName:`Krassovsky, 1942`},SEasia:{a:6378155,b:6356773.3205,ellipseName:`Southeast Asia`},walbeck:{a:6376896,b:6355834.8467,ellipseName:`Walbeck`},WGS60:{a:6378165,rf:298.3,ellipseName:`WGS 60`},WGS66:{a:6378145,rf:298.25,ellipseName:`WGS 66`},WGS7:{a:6378135,rf:298.26,ellipseName:`WGS 72`},WGS84:{a:6378137,rf:298.257223563,ellipseName:`WGS 84`},sphere:{a:6370997,b:6370997,ellipseName:`Normal Sphere (r=6370997)`}},ph=fh.WGS84;function mh(e,t,n,r){var i=e*e,a=t*t,o=(i-a)/i,s=0;r?(e*=1-o*(qp+o*(Jp+o*Yp)),i=e*e,o=0):s=Math.sqrt(o);var c=(i-a)/a;return{es:o,e:s,ep2:c}}function hh(e,t,n,r,i){if(!e){var a=im(fh,r);a||=ph,e=a.a,t=a.b,n=a.rf}return n&&!t&&(t=(1-1/n)*e),(n===0||Math.abs(e-t)<1e-10)&&(i=!0,t=e),{a:e,b:t,rf:n,sphere:i}}var gh={wgs84:{towgs84:`0,0,0`,ellipse:`WGS84`,datumName:`WGS84`},ch1903:{towgs84:`674.374,15.056,405.346`,ellipse:`bessel`,datumName:`swiss`},ggrs87:{towgs84:`-199.87,74.79,246.62`,ellipse:`GRS80`,datumName:`Greek_Geodetic_Reference_System_1987`},nad83:{towgs84:`0,0,0`,ellipse:`GRS80`,datumName:`North_American_Datum_1983`},nad27:{nadgrids:`@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat`,ellipse:`clrk66`,datumName:`North_American_Datum_1927`},potsdam:{towgs84:`598.1,73.7,418.2,0.202,0.045,-2.455,6.7`,ellipse:`bessel`,datumName:`Potsdam Rauenberg 1950 DHDN`},carthage:{towgs84:`-263.0,6.0,431.0`,ellipse:`clrk80ign`,datumName:`Carthage 1934 Tunisia`},hermannskogel:{towgs84:`577.326,90.129,463.919,5.137,1.474,5.297,2.4232`,ellipse:`bessel`,datumName:`Hermannskogel`},mgi:{towgs84:`577.326,90.129,463.919,5.137,1.474,5.297,2.4232`,ellipse:`bessel`,datumName:`Militar-Geographische Institut`},osni52:{towgs84:`482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15`,ellipse:`airy`,datumName:`Irish National`},ire65:{towgs84:`482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15`,ellipse:`mod_airy`,datumName:`Ireland 1965`},rassadiran:{towgs84:`-133.63,-157.5,-158.62`,ellipse:`intl`,datumName:`Rassadiran`},nzgd49:{towgs84:`59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993`,ellipse:`intl`,datumName:`New Zealand Geodetic Datum 1949`},osgb36:{towgs84:`446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894`,ellipse:`airy`,datumName:`Ordnance Survey of Great Britain 1936`},s_jtsk:{towgs84:`589,76,480`,ellipse:`bessel`,datumName:`S-JTSK (Ferro)`},beduaram:{towgs84:`-106,-87,188`,ellipse:`clrk80`,datumName:`Beduaram`},gunung_segara:{towgs84:`-403,684,41`,ellipse:`bessel`,datumName:`Gunung Segara Jakarta`},rnb72:{towgs84:`106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1`,ellipse:`intl`,datumName:`Reseau National Belge 1972`},EPSG_5451:{towgs84:`6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649`},IGNF_LURESG:{towgs84:`-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43`},EPSG_4614:{towgs84:`-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065`},EPSG_4615:{towgs84:`-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748`},ESRI_37241:{towgs84:`-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031`},ESRI_37249:{towgs84:`-440.296,58.548,296.265,1.128,10.202,4.559,-0.438`},ESRI_37245:{towgs84:`-511.151,-181.269,139.609,1.05,2.703,1.798,3.071`},EPSG_4178:{towgs84:`24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01`},EPSG_4622:{towgs84:`-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984`},EPSG_4625:{towgs84:`126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227`},EPSG_5252:{towgs84:`0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439`},EPSG_4314:{towgs84:`597.1,71.4,412.1,0.894,0.068,-1.563,7.58`},EPSG_4282:{towgs84:`-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166`},EPSG_4231:{towgs84:`-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218`},EPSG_4274:{towgs84:`-230.994,102.591,25.199,0.633,-0.239,0.9,1.95`},EPSG_4134:{towgs84:`-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006`},EPSG_4254:{towgs84:`18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013`},EPSG_4159:{towgs84:`-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175`},EPSG_4687:{towgs84:`0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093`},EPSG_4227:{towgs84:`-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225`},EPSG_4746:{towgs84:`599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46`},EPSG_4745:{towgs84:`612.4,77,440.2,-0.054,0.057,-2.797,2.55`},EPSG_6311:{towgs84:`8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926`},EPSG_4289:{towgs84:`565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244`},EPSG_4230:{towgs84:`-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4`},EPSG_4154:{towgs84:`-123.02,-158.95,-168.47`},EPSG_4156:{towgs84:`570.8,85.7,462.8,4.998,1.587,5.261,3.56`},EPSG_4299:{towgs84:`482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15`},EPSG_4179:{towgs84:`33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84`},EPSG_4313:{towgs84:`-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747`},EPSG_4194:{towgs84:`163.511,127.533,-159.789`},EPSG_4195:{towgs84:`105,326,-102.5`},EPSG_4196:{towgs84:`-45,417,-3.5`},EPSG_4611:{towgs84:`-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246`},EPSG_4633:{towgs84:`137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824`},EPSG_4641:{towgs84:`-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993`},EPSG_4643:{towgs84:`-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002`},EPSG_4300:{towgs84:`482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15`},EPSG_4188:{towgs84:`482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15`},EPSG_4660:{towgs84:`982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805`},EPSG_4662:{towgs84:`97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259`},EPSG_3906:{towgs84:`577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664`},EPSG_4307:{towgs84:`-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547`},EPSG_6892:{towgs84:`-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686`},EPSG_4690:{towgs84:`221.597,152.441,176.523,2.403,1.3893,0.884,11.4648`},EPSG_4691:{towgs84:`218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817`},EPSG_4629:{towgs84:`72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653`},EPSG_4630:{towgs84:`165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111`},EPSG_4692:{towgs84:`217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093`},EPSG_9333:{towgs84:`0,0,0,-0.008393,0.000749,-0.010276,0`},EPSG_9059:{towgs84:`0,0,0`},EPSG_4312:{towgs84:`601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887`},EPSG_4123:{towgs84:`-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496`},EPSG_4309:{towgs84:`-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365`},ESRI_104106:{towgs84:`-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058`},EPSG_4281:{towgs84:`-219.247,-73.802,269.529`},EPSG_4322:{towgs84:`0,0,4.5`},EPSG_4324:{towgs84:`0,0,1.9`},EPSG_4284:{towgs84:`43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549`},EPSG_4277:{towgs84:`446.448,-125.157,542.06,0.15,0.247,0.842,-20.489`},EPSG_4207:{towgs84:`-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46`},EPSG_4688:{towgs84:`347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647`},EPSG_4689:{towgs84:`410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218`},EPSG_4720:{towgs84:`0,0,4.5`},EPSG_4273:{towgs84:`278.3,93,474.5,7.889,0.05,-6.61,6.21`},EPSG_4240:{towgs84:`204.64,834.74,293.8`},EPSG_4817:{towgs84:`278.3,93,474.5,7.889,0.05,-6.61,6.21`},ESRI_104131:{towgs84:`426.62,142.62,460.09,4.98,4.49,-12.42,-17.1`},EPSG_4265:{towgs84:`-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68`},EPSG_4263:{towgs84:`-111.92,-87.85,114.5,1.875,0.202,0.219,0.032`},EPSG_4298:{towgs84:`-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536`},EPSG_4270:{towgs84:`-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424`},EPSG_4229:{towgs84:`-121.8,98.1,-10.7`},EPSG_4220:{towgs84:`-55.5,-348,-229.2`},EPSG_4214:{towgs84:`12.646,-155.176,-80.863`},EPSG_4232:{towgs84:`-345,3,223`},EPSG_4238:{towgs84:`-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037`},EPSG_4168:{towgs84:`-170,33,326`},EPSG_4131:{towgs84:`199,931,318.9`},EPSG_4152:{towgs84:`-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0`},EPSG_5228:{towgs84:`572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378`},EPSG_8351:{towgs84:`485.021,169.465,483.839,7.786342,4.397554,4.102655,0`},EPSG_4683:{towgs84:`-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06`},EPSG_4133:{towgs84:`0,0,0`},EPSG_7373:{towgs84:`0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693`},EPSG_9075:{towgs84:`-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0`},EPSG_9072:{towgs84:`-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0`},EPSG_9294:{towgs84:`1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388`},EPSG_4212:{towgs84:`-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492`},EPSG_4191:{towgs84:`-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703`},EPSG_4237:{towgs84:`52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191`},EPSG_4740:{towgs84:`-1.08,-0.27,-0.9`},EPSG_4124:{towgs84:`419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496`},EPSG_5681:{towgs84:`584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922`},EPSG_4141:{towgs84:`23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262`},EPSG_4204:{towgs84:`-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194`},EPSG_4319:{towgs84:`226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798`},EPSG_4200:{towgs84:`24.82,-131.21,-82.66`},EPSG_4130:{towgs84:`0,0,0`},EPSG_4127:{towgs84:`-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359`},EPSG_4149:{towgs84:`674.374,15.056,405.346`},EPSG_4617:{towgs84:`-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0`},EPSG_4663:{towgs84:`-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485`},EPSG_4664:{towgs84:`-211.939,137.626,58.3,-0.089,0.251,0.079,0.384`},EPSG_4665:{towgs84:`-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048`},EPSG_4666:{towgs84:`631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43`},EPSG_4756:{towgs84:`-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188`},EPSG_4723:{towgs84:`-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925`},EPSG_4726:{towgs84:`8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081`},EPSG_4267:{towgs84:`-8.0,160.0,176.0`},EPSG_5365:{towgs84:`-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693`},EPSG_4218:{towgs84:`304.5,306.5,-318.1`},EPSG_4242:{towgs84:`-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95`},EPSG_4216:{towgs84:`-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289`},ESRI_104105:{towgs84:`631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43`},ESRI_104129:{towgs84:`0,0,0`},EPSG_4673:{towgs84:`174.05,-25.49,112.57`},EPSG_4202:{towgs84:`-124,-60,154`},EPSG_4203:{towgs84:`-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191`},EPSG_3819:{towgs84:`595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408`},EPSG_8694:{towgs84:`-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169`},EPSG_4145:{towgs84:`275.57,676.78,229.6`},EPSG_4283:{towgs84:`0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994`},EPSG_4317:{towgs84:`2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063`},EPSG_4272:{towgs84:`59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993`},EPSG_4248:{towgs84:`-307.7,265.3,-363.5`},EPSG_5561:{towgs84:`24,-121,-76`},EPSG_5233:{towgs84:`-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338`},ESRI_104130:{towgs84:`-86,-98,-119`},ESRI_104102:{towgs84:`682,-203,480`},ESRI_37207:{towgs84:`7,-10,-26`},EPSG_4675:{towgs84:`59.935,118.4,-10.871`},ESRI_104109:{towgs84:`-89.121,-348.182,260.871`},ESRI_104112:{towgs84:`-185.583,-230.096,281.361`},ESRI_104113:{towgs84:`25.1,-275.6,222.6`},IGNF_WGS72G:{towgs84:`0,12,6`},IGNF_NTFG:{towgs84:`-168,-60,320`},IGNF_EFATE57G:{towgs84:`-127,-769,472`},IGNF_PGP50G:{towgs84:`324.8,153.6,172.1`},IGNF_REUN47G:{towgs84:`94,-948,-1262`},IGNF_CSG67G:{towgs84:`-186,230,110`},IGNF_GUAD48G:{towgs84:`-467,-16,-300`},IGNF_TAHI51G:{towgs84:`162,117,154`},IGNF_TAHAAG:{towgs84:`65,342,77`},IGNF_NUKU72G:{towgs84:`84,274,65`},IGNF_PETRELS72G:{towgs84:`365,194,166`},IGNF_WALL78G:{towgs84:`253,-133,-127`},IGNF_MAYO50G:{towgs84:`-382,-59,-262`},IGNF_TANNAG:{towgs84:`-139,-967,436`},IGNF_IGN72G:{towgs84:`-13,-348,292`},IGNF_ATIGG:{towgs84:`1118,23,66`},IGNF_FANGA84G:{towgs84:`150.57,158.33,118.32`},IGNF_RUSAT84G:{towgs84:`202.13,174.6,-15.74`},IGNF_KAUE70G:{towgs84:`126.74,300.1,-75.49`},IGNF_MOP90G:{towgs84:`-10.8,-1.8,12.77`},IGNF_MHPF67G:{towgs84:`338.08,212.58,-296.17`},IGNF_TAHI79G:{towgs84:`160.61,116.05,153.69`},IGNF_ANAA92G:{towgs84:`1.5,3.84,4.81`},IGNF_MARQUI72G:{towgs84:`330.91,-13.92,58.56`},IGNF_APAT86G:{towgs84:`143.6,197.82,74.05`},IGNF_TUBU69G:{towgs84:`237.17,171.61,-77.84`},IGNF_STPM50G:{towgs84:`11.363,424.148,373.13`},EPSG_4150:{towgs84:`674.374,15.056,405.346`},EPSG_4754:{towgs84:`-208.4058,-109.8777,-2.5764`},ESRI_104101:{towgs84:`372.87,149.23,585.29`},EPSG_4693:{towgs84:`0,-0.15,0.68`},EPSG_6207:{towgs84:`293.17,726.18,245.36`},EPSG_4153:{towgs84:`-133.63,-157.5,-158.62`},EPSG_4132:{towgs84:`-241.54,-163.64,396.06`},EPSG_4221:{towgs84:`-154.5,150.7,100.4`},EPSG_4266:{towgs84:`-80.7,-132.5,41.1`},EPSG_4193:{towgs84:`-70.9,-151.8,-41.4`},EPSG_5340:{towgs84:`-0.41,0.46,-0.35`},EPSG_4246:{towgs84:`-294.7,-200.1,525.5`},EPSG_4318:{towgs84:`-3.2,-5.7,2.8`},EPSG_4121:{towgs84:`-199.87,74.79,246.62`},EPSG_4223:{towgs84:`-260.1,5.5,432.2`},EPSG_4158:{towgs84:`-0.465,372.095,171.736`},EPSG_4285:{towgs84:`-128.16,-282.42,21.93`},EPSG_4613:{towgs84:`-404.78,685.68,45.47`},EPSG_4607:{towgs84:`195.671,332.517,274.607`},EPSG_4475:{towgs84:`-381.788,-57.501,-256.673`},EPSG_4208:{towgs84:`-157.84,308.54,-146.6`},EPSG_4743:{towgs84:`70.995,-335.916,262.898`},EPSG_4710:{towgs84:`-323.65,551.39,-491.22`},EPSG_7881:{towgs84:`-0.077,0.079,0.086`},EPSG_4682:{towgs84:`283.729,735.942,261.143`},EPSG_4739:{towgs84:`-156,-271,-189`},EPSG_4679:{towgs84:`-80.01,253.26,291.19`},EPSG_4750:{towgs84:`-56.263,16.136,-22.856`},EPSG_4644:{towgs84:`-10.18,-350.43,291.37`},EPSG_4695:{towgs84:`-103.746,-9.614,-255.95`},EPSG_4292:{towgs84:`-355,21,72`},EPSG_4302:{towgs84:`-61.702,284.488,472.052`},EPSG_4143:{towgs84:`-124.76,53,466.79`},EPSG_4606:{towgs84:`-153,153,307`},EPSG_4699:{towgs84:`-770.1,158.4,-498.2`},EPSG_4247:{towgs84:`-273.5,110.6,-357.9`},EPSG_4160:{towgs84:`8.88,184.86,106.69`},EPSG_4161:{towgs84:`-233.43,6.65,173.64`},EPSG_9251:{towgs84:`-9.5,122.9,138.2`},EPSG_9253:{towgs84:`-78.1,101.6,133.3`},EPSG_4297:{towgs84:`-198.383,-240.517,-107.909`},EPSG_4269:{towgs84:`0,0,0`},EPSG_4301:{towgs84:`-147,506,687`},EPSG_4618:{towgs84:`-59,-11,-52`},EPSG_4612:{towgs84:`0,0,0`},EPSG_4678:{towgs84:`44.585,-131.212,-39.544`},EPSG_4250:{towgs84:`-130,29,364`},EPSG_4144:{towgs84:`214,804,268`},EPSG_4147:{towgs84:`-17.51,-108.32,-62.39`},EPSG_4259:{towgs84:`-254.1,-5.36,-100.29`},EPSG_4164:{towgs84:`-76,-138,67`},EPSG_4211:{towgs84:`-378.873,676.002,-46.255`},EPSG_4182:{towgs84:`-422.651,-172.995,84.02`},EPSG_4224:{towgs84:`-143.87,243.37,-33.52`},EPSG_4225:{towgs84:`-205.57,168.77,-4.12`},EPSG_5527:{towgs84:`-67.35,3.88,-38.22`},EPSG_4752:{towgs84:`98,390,-22`},EPSG_4310:{towgs84:`-30,190,89`},EPSG_9248:{towgs84:`-192.26,65.72,132.08`},EPSG_4680:{towgs84:`124.5,-63.5,-281`},EPSG_4701:{towgs84:`-79.9,-158,-168.9`},EPSG_4706:{towgs84:`-146.21,112.63,4.05`},EPSG_4805:{towgs84:`682,-203,480`},EPSG_4201:{towgs84:`-165,-11,206`},EPSG_4210:{towgs84:`-157,-2,-299`},EPSG_4183:{towgs84:`-104,167,-38`},EPSG_4139:{towgs84:`11,72,-101`},EPSG_4668:{towgs84:`-86,-98,-119`},EPSG_4717:{towgs84:`-2,151,181`},EPSG_4732:{towgs84:`102,52,-38`},EPSG_4280:{towgs84:`-377,681,-50`},EPSG_4209:{towgs84:`-138,-105,-289`},EPSG_4261:{towgs84:`31,146,47`},EPSG_4658:{towgs84:`-73,46,-86`},EPSG_4721:{towgs84:`265.025,384.929,-194.046`},EPSG_4222:{towgs84:`-136,-108,-292`},EPSG_4601:{towgs84:`-255,-15,71`},EPSG_4602:{towgs84:`725,685,536`},EPSG_4603:{towgs84:`72,213.7,93`},EPSG_4605:{towgs84:`9,183,236`},EPSG_4621:{towgs84:`137,248,-430`},EPSG_4657:{towgs84:`-28,199,5`},EPSG_4316:{towgs84:`103.25,-100.4,-307.19`},EPSG_4642:{towgs84:`-13,-348,292`},EPSG_4698:{towgs84:`145,-187,103`},EPSG_4192:{towgs84:`-206.1,-174.7,-87.7`},EPSG_4311:{towgs84:`-265,120,-358`},EPSG_4135:{towgs84:`58,-283,-182`},ESRI_104138:{towgs84:`198,-226,-347`},EPSG_4245:{towgs84:`-11,851,5`},EPSG_4142:{towgs84:`-125,53,467`},EPSG_4213:{towgs84:`-106,-87,188`},EPSG_4253:{towgs84:`-133,-77,-51`},EPSG_4129:{towgs84:`-132,-110,-335`},EPSG_4713:{towgs84:`-77,-128,142`},EPSG_4239:{towgs84:`217,823,299`},EPSG_4146:{towgs84:`295,736,257`},EPSG_4155:{towgs84:`-83,37,124`},EPSG_4165:{towgs84:`-173,253,27`},EPSG_4672:{towgs84:`175,-38,113`},EPSG_4236:{towgs84:`-637,-549,-203`},EPSG_4251:{towgs84:`-90,40,88`},EPSG_4271:{towgs84:`-2,374,172`},EPSG_4175:{towgs84:`-88,4,101`},EPSG_4716:{towgs84:`298,-304,-375`},EPSG_4315:{towgs84:`-23,259,-9`},EPSG_4744:{towgs84:`-242.2,-144.9,370.3`},EPSG_4244:{towgs84:`-97,787,86`},EPSG_4293:{towgs84:`616,97,-251`},EPSG_4714:{towgs84:`-127,-769,472`},EPSG_4736:{towgs84:`260,12,-147`},EPSG_6883:{towgs84:`-235,-110,393`},EPSG_6894:{towgs84:`-63,176,185`},EPSG_4205:{towgs84:`-43,-163,45`},EPSG_4256:{towgs84:`41,-220,-134`},EPSG_4262:{towgs84:`639,405,60`},EPSG_4604:{towgs84:`174,359,365`},EPSG_4169:{towgs84:`-115,118,426`},EPSG_4620:{towgs84:`-106,-129,165`},EPSG_4184:{towgs84:`-203,141,53`},EPSG_4616:{towgs84:`-289,-124,60`},EPSG_9403:{towgs84:`-307,-92,127`},EPSG_4684:{towgs84:`-133,-321,50`},EPSG_4708:{towgs84:`-491,-22,435`},EPSG_4707:{towgs84:`114,-116,-333`},EPSG_4709:{towgs84:`145,75,-272`},EPSG_4712:{towgs84:`-205,107,53`},EPSG_4711:{towgs84:`124,-234,-25`},EPSG_4718:{towgs84:`230,-199,-752`},EPSG_4719:{towgs84:`211,147,111`},EPSG_4724:{towgs84:`208,-435,-229`},EPSG_4725:{towgs84:`189,-79,-202`},EPSG_4735:{towgs84:`647,1777,-1124`},EPSG_4722:{towgs84:`-794,119,-298`},EPSG_4728:{towgs84:`-307,-92,127`},EPSG_4734:{towgs84:`-632,438,-609`},EPSG_4727:{towgs84:`912,-58,1227`},EPSG_4729:{towgs84:`185,165,42`},EPSG_4730:{towgs84:`170,42,84`},EPSG_4733:{towgs84:`276,-57,149`},ESRI_37218:{towgs84:`230,-199,-752`},ESRI_37240:{towgs84:`-7,215,225`},ESRI_37221:{towgs84:`252,-209,-751`},ESRI_4305:{towgs84:`-123,-206,219`},ESRI_104139:{towgs84:`-73,-247,227`},EPSG_4748:{towgs84:`51,391,-36`},EPSG_4219:{towgs84:`-384,664,-48`},EPSG_4255:{towgs84:`-333,-222,114`},EPSG_4257:{towgs84:`-587.8,519.75,145.76`},EPSG_4646:{towgs84:`-963,510,-359`},EPSG_6881:{towgs84:`-24,-203,268`},EPSG_6882:{towgs84:`-183,-15,273`},EPSG_4715:{towgs84:`-104,-129,239`},IGNF_RGF93GDD:{towgs84:`0,0,0`},IGNF_RGM04GDD:{towgs84:`0,0,0`},IGNF_RGSPM06GDD:{towgs84:`0,0,0`},IGNF_RGTAAF07GDD:{towgs84:`0,0,0`},IGNF_RGFG95GDD:{towgs84:`0,0,0`},IGNF_RGNCG:{towgs84:`0,0,0`},IGNF_RGPFGDD:{towgs84:`0,0,0`},IGNF_ETRS89G:{towgs84:`0,0,0`},IGNF_RGR92GDD:{towgs84:`0,0,0`},EPSG_4173:{towgs84:`0,0,0`},EPSG_4180:{towgs84:`0,0,0`},EPSG_4619:{towgs84:`0,0,0`},EPSG_4667:{towgs84:`0,0,0`},EPSG_4075:{towgs84:`0,0,0`},EPSG_6706:{towgs84:`0,0,0`},EPSG_7798:{towgs84:`0,0,0`},EPSG_4661:{towgs84:`0,0,0`},EPSG_4669:{towgs84:`0,0,0`},EPSG_8685:{towgs84:`0,0,0`},EPSG_4151:{towgs84:`0,0,0`},EPSG_9702:{towgs84:`0,0,0`},EPSG_4758:{towgs84:`0,0,0`},EPSG_4761:{towgs84:`0,0,0`},EPSG_4765:{towgs84:`0,0,0`},EPSG_8997:{towgs84:`0,0,0`},EPSG_4023:{towgs84:`0,0,0`},EPSG_4670:{towgs84:`0,0,0`},EPSG_4694:{towgs84:`0,0,0`},EPSG_4148:{towgs84:`0,0,0`},EPSG_4163:{towgs84:`0,0,0`},EPSG_4167:{towgs84:`0,0,0`},EPSG_4189:{towgs84:`0,0,0`},EPSG_4190:{towgs84:`0,0,0`},EPSG_4176:{towgs84:`0,0,0`},EPSG_4659:{towgs84:`0,0,0`},EPSG_3824:{towgs84:`0,0,0`},EPSG_3889:{towgs84:`0,0,0`},EPSG_4046:{towgs84:`0,0,0`},EPSG_4081:{towgs84:`0,0,0`},EPSG_4558:{towgs84:`0,0,0`},EPSG_4483:{towgs84:`0,0,0`},EPSG_5013:{towgs84:`0,0,0`},EPSG_5264:{towgs84:`0,0,0`},EPSG_5324:{towgs84:`0,0,0`},EPSG_5354:{towgs84:`0,0,0`},EPSG_5371:{towgs84:`0,0,0`},EPSG_5373:{towgs84:`0,0,0`},EPSG_5381:{towgs84:`0,0,0`},EPSG_5393:{towgs84:`0,0,0`},EPSG_5489:{towgs84:`0,0,0`},EPSG_5593:{towgs84:`0,0,0`},EPSG_6135:{towgs84:`0,0,0`},EPSG_6365:{towgs84:`0,0,0`},EPSG_5246:{towgs84:`0,0,0`},EPSG_7886:{towgs84:`0,0,0`},EPSG_8431:{towgs84:`0,0,0`},EPSG_8427:{towgs84:`0,0,0`},EPSG_8699:{towgs84:`0,0,0`},EPSG_8818:{towgs84:`0,0,0`},EPSG_4757:{towgs84:`0,0,0`},EPSG_9140:{towgs84:`0,0,0`},EPSG_8086:{towgs84:`0,0,0`},EPSG_4686:{towgs84:`0,0,0`},EPSG_4737:{towgs84:`0,0,0`},EPSG_4702:{towgs84:`0,0,0`},EPSG_4747:{towgs84:`0,0,0`},EPSG_4749:{towgs84:`0,0,0`},EPSG_4674:{towgs84:`0,0,0`},EPSG_4755:{towgs84:`0,0,0`},EPSG_4759:{towgs84:`0,0,0`},EPSG_4762:{towgs84:`0,0,0`},EPSG_4763:{towgs84:`0,0,0`},EPSG_4764:{towgs84:`0,0,0`},EPSG_4166:{towgs84:`0,0,0`},EPSG_4170:{towgs84:`0,0,0`},EPSG_5546:{towgs84:`0,0,0`},EPSG_7844:{towgs84:`0,0,0`},EPSG_4818:{towgs84:`589,76,480`},EPSG_10328:{towgs84:`0,0,0`},EPSG_9782:{towgs84:`0,0,0`},EPSG_9777:{towgs84:`0,0,0`},EPSG_10690:{towgs84:`0,0,0`},EPSG_10639:{towgs84:`0,0,0`},EPSG_10739:{towgs84:`0,0,0`},EPSG_7686:{towgs84:`0,0,0`},EPSG_8900:{towgs84:`0,0,0`},EPSG_5886:{towgs84:`0,0,0`},EPSG_7683:{towgs84:`0,0,0`},EPSG_6668:{towgs84:`0,0,0`},EPSG_20046:{towgs84:`0,0,0`},EPSG_10299:{towgs84:`0,0,0`},EPSG_10310:{towgs84:`0,0,0`},EPSG_10475:{towgs84:`0,0,0`},EPSG_4742:{towgs84:`0,0,0`},EPSG_10671:{towgs84:`0,0,0`},EPSG_10762:{towgs84:`0,0,0`},EPSG_10725:{towgs84:`0,0,0`},EPSG_10791:{towgs84:`0,0,0`},EPSG_10800:{towgs84:`0,0,0`},EPSG_10305:{towgs84:`0,0,0`},EPSG_10941:{towgs84:`0,0,0`},EPSG_10968:{towgs84:`0,0,0`},EPSG_10875:{towgs84:`0,0,0`},EPSG_6318:{towgs84:`0,0,0`},EPSG_10910:{towgs84:`0,0,0`}};for(var _h in gh){var vh=gh[_h];vh.datumName&&(gh[vh.datumName]=vh)}function yh(e,t,n,r,i,a,o){var s={};return s.datum_type=5,t&&(s.datum_type=4,s.datum_params=t.map(parseFloat),(s.datum_params[0]!==0||s.datum_params[1]!==0||s.datum_params[2]!==0)&&(s.datum_type=1),s.datum_params.length>3&&(s.datum_params[3]!==0||s.datum_params[4]!==0||s.datum_params[5]!==0||s.datum_params[6]!==0)&&(s.datum_type=2,s.datum_params[3]*=Kp,s.datum_params[4]*=Kp,s.datum_params[5]*=Kp,s.datum_params[6]=s.datum_params[6]/1e6+1)),o&&(s.datum_type=3,s.grids=o),s.a=n,s.b=r,s.es=i,s.ep2=a,s}var bh={};function xh(e,t,n){return t instanceof ArrayBuffer?Sh(e,t,n):{ready:Ch(e,t)}}function Sh(e,t,n){var r=!0;n!==void 0&&n.includeErrorFields===!1&&(r=!1);var i=new DataView(t),a=Oh(i),o=kh(i,a),s={header:o,subgrids:jh(i,o,a,r)};return bh[e]=s,s}async function Ch(e,t){for(var n=[],r=await t.getImageCount(),i=r-1;i>=0;i--){var a=await t.getImage(i),o=await a.readRasters(),s=[a.getWidth(),a.getHeight()],c=a.getBoundingBox().map(Eh),l=typeof a.fileDirectory.getValue==`function`?a.fileDirectory.getValue(`ModelPixelScale`):a.fileDirectory.ModelPixelScale,u=[l[0],l[1]].map(Eh),d=c[0]+(s[0]-1)*u[0],f=c[3]-(s[1]-1)*u[1],p=o[0],m=o[1],h=[];for(let e=s[1]-1;e>=0;e--)for(let t=s[0]-1;t>=0;t--){var g=e*s[0]+t;h.push([-Dh(m[g]),Dh(p[g])])}n.push({del:u,lim:s,ll:[-d,f],cvs:h})}var _={header:{nSubgrids:r},subgrids:n};return bh[e]=_,_}function wh(e){return e===void 0?null:e.split(`,`).map(Th)}function Th(e){if(e.length===0)return null;var t=e[0]===`@`;return t&&(e=e.slice(1)),e===`null`?{name:`null`,mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:bh[e]||null,isNull:!1}}function Eh(e){return e*Math.PI/180}function Dh(e){return e/3600*Math.PI/180}function Oh(e){var t=e.getInt32(8,!1);return t!==11&&(t=e.getInt32(8,!0),t!==11&&console.warn(`Failed to detect nadgrid endian-ness, defaulting to little-endian`),!0)}function kh(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:Ah(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function Ah(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function jh(e,t,n,r){for(var i=176,a=[],o=0;o<t.nSubgrids;o++){var s=Nh(e,i,n),c=Ph(e,i,s,n,r),l=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),u=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);a.push({ll:[Dh(s.lowerLongitude),Dh(s.lowerLatitude)],del:[Dh(s.longitudeInterval),Dh(s.latitudeInterval)],lim:[l,u],count:s.gridNodeCount,cvs:Mh(c)});var d=16;r===!1&&(d=8),i+=176+s.gridNodeCount*d}return a}function Mh(e){return e.map(function(e){return[Dh(e.longitudeShift),Dh(e.latitudeShift)]})}function Nh(e,t,n){return{name:Ah(e,t+8,t+16).trim(),parent:Ah(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function Ph(e,t,n,r,i){var a=t+176,o=16;i===!1&&(o=8);for(var s=[],c=0;c<n.gridNodeCount;c++){var l={latitudeShift:e.getFloat32(a+c*o,r),longitudeShift:e.getFloat32(a+c*o+4,r)};i!==!1&&(l.latitudeAccuracy=e.getFloat32(a+c*o+8,r),l.longitudeAccuracy=e.getFloat32(a+c*o+12,r)),s.push(l)}return s}function Fh(e,t){if(!(this instanceof Fh))return new Fh(e);this.forward=null,this.inverse=null,this.init=null,this.name,this.axis,this.names=null,this.title,t||=function(e){if(e)throw e};var n=Gm(e);if(typeof n!=`object`)t(`Could not parse to valid json: `+e);else{var r=Fh.projections.get(n.projName);if(!r)t(`Could not get projection name from: `+e);else{if(n.datumCode&&n.datumCode!==`none`){var i=im(gh,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(`,`):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.axis=n.axis||`enu`,n.ellps=n.ellps||`wgs84`,n.lat1=n.lat1||n.lat0;var a=hh(n.a,n.b,n.rf,n.ellps,n.sphere),o=mh(a.a,a.b,a.rf,n.R_A),s=wh(n.nadgrids),c=n.datum||yh(n.datumCode,n.datum_params,a.a,a.b,o.es,o.ep2,s);Km(this,n),Km(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=c,`init`in this&&typeof this.init==`function`&&this.init(),this.k0||=1,t(null,this)}}}Fh.projections=dh,Fh.projections.start();function Ih(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===1?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==2||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]}function Lh(e,t,n){var r=e.x,i=e.y,a=e.z?e.z:0,o,s,c,l;if(i<-X&&i>-1.001*X)i=-X;else if(i>X&&i<1.001*X)i=X;else if(i<-X)return{x:-1/0,y:-1/0,z:e.z};else if(i>X)return{x:1/0,y:1/0,z:e.z};return r>Math.PI&&(r-=2*Math.PI),s=Math.sin(i),l=Math.cos(i),c=s*s,o=n/Math.sqrt(1-t*c),{x:(o+a)*l*Math.cos(r),y:(o+a)*l*Math.sin(r),z:(o*(1-t)+a)*s}}function Rh(e,t,n,r){var i=1e-12,a=i*i,o=30,s,c,l,u,d,f,p,m,h,g,_,v,y,b=e.x,x=e.y,S=e.z?e.z:0,C,w,T;if(s=Math.sqrt(b*b+x*x),c=Math.sqrt(b*b+x*x+S*S),s/n<i){if(C=0,c/n<i)return w=X,T=-r,{x:e.x,y:e.y,z:e.z}}else C=Math.atan2(x,b);l=S/c,u=s/c,d=1/Math.sqrt(1-t*(2-t)*u*u),m=u*(1-t)*d,h=l*d,y=0;do y++,p=n/Math.sqrt(1-t*h*h),T=s*m+S*h-p*(1-t*h*h),f=t*p/(p+T),d=1/Math.sqrt(1-f*(2-f)*u*u),g=u*(1-f)*d,_=l*d,v=_*m-g*h,m=g,h=_;while(v*v>a&&y<o);return w=Math.atan(_/Math.abs(g)),{x:C,y:w,z:T}}function zh(e,t,n){if(t===1)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(t===2){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6];return{x:l*(e.x-c*e.y+s*e.z)+r,y:l*(c*e.x+e.y-o*e.z)+i,z:l*(-s*e.x+o*e.y+e.z)+a}}}function Bh(e,t,n){if(t===1)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(t===2){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=(e.x-r)/l,d=(e.y-i)/l,f=(e.z-a)/l;return{x:u+c*d-s*f,y:-c*u+d+o*f,z:s*u-o*d+f}}}function Vh(e){return e===1||e===2}function Hh(e,t,n){if(Ih(e,t)||e.datum_type===5||t.datum_type===5)return n;var r=e.a,i=e.es;if(e.datum_type===3){if(Uh(e,!1,n)!==0)return;r=Up,i=Gp}var a=t.a,o=t.b,s=t.es;if(t.datum_type===3&&(a=Up,o=Wp,s=Gp),i===s&&r===a&&!Vh(e.datum_type)&&!Vh(t.datum_type)||(n=Lh(n,i,r),Vh(e.datum_type)&&(n=zh(n,e.datum_type,e.datum_params)),Vh(t.datum_type)&&(n=Bh(n,t.datum_type,t.datum_params)),n=Rh(n,s,a,o),t.datum_type!==3||Uh(t,!0,n)===0))return n}function Uh(e,t,n){if(e.grids===null||e.grids.length===0)return console.log(`Grid shift grids not found`),-1;var r={x:-n.x,y:n.y},i={x:NaN,y:NaN},a=[];outer:for(var o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){i=r;break}if(s.grid===null){if(s.mandatory)return console.log(`Unable to find mandatory grid '`+s.name+`'`),-1}else for(var c=s.grid.subgrids,l=0,u=c.length;l<u;l++){var d=c[l],f=(Math.abs(d.del[1])+Math.abs(d.del[0]))/1e4,p=d.ll[0]-f,m=d.ll[1]-f,h=d.ll[0]+(d.lim[0]-1)*d.del[0]+f,g=d.ll[1]+(d.lim[1]-1)*d.del[1]+f;if(!(m>r.y||p>r.x||g<r.y||h<r.x)&&(i=Wh(r,t,d),!isNaN(i.x)))break outer}}return isNaN(i.x)?(console.log(`Failed to find a grid shift table for location '`+-r.x*Qp+` `+r.y*Qp+` tried: '`+a+`'`),-1):(n.x=-i.x,n.y=i.y,0)}function Wh(e,t,n){var r={x:NaN,y:NaN};if(isNaN(e.x))return r;var i={x:e.x,y:e.y};i.x-=n.ll[0],i.y-=n.ll[1],i.x=Q(i.x-Math.PI)+Math.PI;var a=Gh(i,n);if(t){if(isNaN(a.x))return r;a.x=i.x-a.x,a.y=i.y-a.y;var o=9,s=1e-12,c,l;do{if(l=Gh(a,n),isNaN(l.x)){console.log(`Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.`);break}c={x:i.x-(l.x+a.x),y:i.y-(l.y+a.y)},a.x+=c.x,a.y+=c.y}while(o--&&Math.abs(c.x)>s&&Math.abs(c.y)>s);if(o<0)return console.log(`Inverse grid shift iterator failed to converge.`),r;r.x=Q(a.x+n.ll[0]),r.y=a.y+n.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function Gh(e,t){var n={x:e.x/t.del[0],y:e.y/t.del[1]},r={x:Math.floor(n.x),y:Math.floor(n.y)},i={x:n.x-1*r.x,y:n.y-1*r.y},a={x:NaN,y:NaN},o;if(r.x<0||r.x>=t.lim[0]||r.y<0||r.y>=t.lim[1])return a;o=r.y*t.lim[0]+r.x;var s={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var c={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var l={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var u={x:t.cvs[o][0],y:t.cvs[o][1]},d=i.x*i.y,f=i.x*(1-i.y),p=(1-i.x)*(1-i.y),m=(1-i.x)*i.y;return a.x=p*s.x+f*c.x+m*u.x+d*l.x,a.y=p*s.y+f*c.y+m*u.y+d*l.y,a}var Kh=[`x`,`y`,`z`];function qh(e,t){let n={};for(let r=0,i=e.axis.length;r<i;r++){if(r===2&&t.z===void 0)continue;let i=t[Kh[r]];switch(e.axis[r]){case`e`:n.x=i;break;case`w`:n.x=-i;break;case`n`:n.y=i;break;case`s`:n.y=-i;break;case`u`:n.z=i;break;case`d`:n.z=-i;break;default:return null}}return n}function Jh(e,t){let n={};for(let r=0,i=e.axis.length;r<i;r++)if(r!==2||t.z!==void 0)switch(e.axis[r]){case`e`:n[Kh[r]]=t.x;break;case`w`:n[Kh[r]]=-t.x;break;case`n`:n[Kh[r]]=t.y;break;case`s`:n[Kh[r]]=-t.y;break;case`u`:n[Kh[r]]=t.z;break;case`d`:n[Kh[r]]=-t.z;break;default:return null}return n}function Yh(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function Xh(e){Zh(e.x),Zh(e.y)}function Zh(e){if(typeof Number.isFinite==`function`){if(Number.isFinite(e))return;throw TypeError(`coordinates must be finite numbers`)}if(typeof e!=`number`||e!==e||!isFinite(e))throw TypeError(`coordinates must be finite numbers`)}function Qh(e,t){return(e.datum.datum_type===1||e.datum.datum_type===2||e.datum.datum_type===3)&&t.datumCode!==`WGS84`||(t.datum.datum_type===1||t.datum.datum_type===2||t.datum.datum_type===3)&&e.datumCode!==`WGS84`}function $h(e,t,n,r){var i,a=n.z!==void 0;if(Xh(n),e.datum&&t.datum&&Qh(e,t)&&(i=new Fh(`WGS84`),n=$h(e,i,n,r),e=i),r&&e.axis!==`enu`&&(n=qh(e,n)),e.projName===`longlat`)n={x:n.x*Zp,y:n.y*Zp,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),n=e.inverse(n),!n)return;if(e.from_greenwich&&(n.x+=e.from_greenwich),n=Hh(e.datum,t.datum,n),n)return n=n,t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),t.projName===`longlat`?(t.long_wrap!==void 0&&(n.x=t.long_wrap+Q(n.x-t.long_wrap)),n={x:n.x*Qp,y:n.y*Qp,z:n.z||0}):(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),r&&t.axis!==`enu`?Jh(t,n):(n&&!a&&t.projName!==`geocent`&&delete n.z,n)}function eg(e,t,n,r){return $h(e,t,Array.isArray(n)?Yh(n):{x:n.x,y:n.y,z:n.z,m:n.m},r)}var tg=Fh(`WGS84`);function ng(e,t,n,r){var i,a,o;return Array.isArray(n)?(i=$h(e,t,Yh(n),r)||{x:NaN,y:NaN},n.length>2?(a=e.name!==void 0&&e.name===`geocent`||t.name!==void 0&&t.name===`geocent`,a?typeof i.z==`number`?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y,n[2]].concat(n.slice(3)):r&&typeof i.z==`number`?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y].concat(n.slice(2))):[i.x,i.y]):(i=$h(e,t,{x:n.x,y:n.y,z:n.z,m:n.m},r)||{x:NaN,y:NaN},o=Object.keys(n),o.length===2||(a=e.name!==void 0&&e.name===`geocent`||t.name!==void 0&&t.name===`geocent`,o.forEach(function(e){e!==`x`&&e!==`y`&&(e!==`z`||!a&&!r)&&(i[e]=n[e])})),i)}function rg(e){return e instanceof Fh?e:typeof e==`object`&&`oProj`in e?e.oProj:Fh(e)}function ig(e,t,n){var r,i,a=!1,o;return t===void 0?(i=rg(e),r=tg,a=!0):(t.x!==void 0||Array.isArray(t))&&(n=t,i=rg(e),r=tg,a=!0),r||=rg(e),i||=rg(t),n?ng(r,i,n):(o={forward:function(e,t){return ng(r,i,e,t)},inverse:function(e,t){return ng(i,r,e,t)}},a&&(o.oProj=i),o)}var ag=6,og=`AJSAJS`,sg=`AFAFAF`,cg=65,lg=73,ug=79,dg=86,fg=90,pg={forward:mg,inverse:hg,toPoint:gg};function mg(e,t){return t||=5,Sg(yg({lat:e[1],lon:e[0]}),t)}function hg(e){var t=bg(Eg(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function gg(e){var t=bg(Eg(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function _g(e){return Math.PI/180*e}function vg(e){return e/Math.PI*180}function yg(e){var t=e.lat,n=e.lon,r=6378137,i=.00669438,a=.9996,o,s,c,l,u,d,f,p=_g(t),m=_g(n),h,g=Math.floor((n+180)/6)+1;n===180&&(g=60),t>=56&&t<64&&n>=3&&n<12&&(g=32),t>=72&&t<84&&(n>=0&&n<9?g=31:n>=9&&n<21?g=33:n>=21&&n<33?g=35:n>=33&&n<42&&(g=37)),o=(g-1)*6-180+3,h=_g(o),s=i/(1-i),c=r/Math.sqrt(1-i*Math.sin(p)*Math.sin(p)),l=Math.tan(p)*Math.tan(p),u=s*Math.cos(p)*Math.cos(p),d=Math.cos(p)*(m-h),f=r*((1-i/4-3*i*i/64-5*i*i*i/256)*p-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*p)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*p)-35*i*i*i/3072*Math.sin(6*p));var _=a*c*(d+(1-l+u)*d*d*d/6+(5-18*l+l*l+72*u-58*s)*d*d*d*d*d/120)+5e5,v=a*(f+c*Math.tan(p)*(d*d/2+(5-l+9*u+4*u*u)*d*d*d*d/24+(61-58*l+l*l+600*u-330*s)*d*d*d*d*d*d/720));return t<0&&(v+=1e7),{northing:Math.round(v),easting:Math.round(_),zoneNumber:g,zoneLetter:xg(t)}}function bg(e){var t=e.northing,n=e.easting,r=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var a=.9996,o=6378137,s=.00669438,c,l=(1-Math.sqrt(1-s))/(1+Math.sqrt(1-s)),u,d,f,p,m,h,g,_,v,y=n-5e5,b=t;r<`N`&&(b-=1e7),g=(i-1)*6-180+3,c=s/(1-s),h=b/a,_=h/(o*(1-s/4-3*s*s/64-5*s*s*s/256)),v=_+(3*l/2-27*l*l*l/32)*Math.sin(2*_)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*_)+151*l*l*l/96*Math.sin(6*_),u=o/Math.sqrt(1-s*Math.sin(v)*Math.sin(v)),d=Math.tan(v)*Math.tan(v),f=c*Math.cos(v)*Math.cos(v),p=o*(1-s)/(1-s*Math.sin(v)*Math.sin(v))**1.5,m=y/(u*a);var x=v-u*Math.tan(v)/p*(m*m/2-(5+3*d+10*f-4*f*f-9*c)*m*m*m*m/24+(61+90*d+298*f+45*d*d-252*c-3*f*f)*m*m*m*m*m*m/720);x=vg(x);var S=(m-(1+2*d+f)*m*m*m/6+(5-2*f+28*d-3*f*f+8*c+24*d*d)*m*m*m*m*m/120)/Math.cos(v);S=g+vg(S);var C;if(e.accuracy){var w=bg({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});C={top:w.lat,right:w.lon,bottom:x,left:S}}else C={lat:x,lon:S};return C}function xg(e){var t=`Z`;return 84>=e&&e>=72?t=`X`:72>e&&e>=64?t=`W`:64>e&&e>=56?t=`V`:56>e&&e>=48?t=`U`:48>e&&e>=40?t=`T`:40>e&&e>=32?t=`S`:32>e&&e>=24?t=`R`:24>e&&e>=16?t=`Q`:16>e&&e>=8?t=`P`:8>e&&e>=0?t=`N`:0>e&&e>=-8?t=`M`:-8>e&&e>=-16?t=`L`:-16>e&&e>=-24?t=`K`:-24>e&&e>=-32?t=`J`:-32>e&&e>=-40?t=`H`:-40>e&&e>=-48?t=`G`:-48>e&&e>=-56?t=`F`:-56>e&&e>=-64?t=`E`:-64>e&&e>=-72?t=`D`:-72>e&&e>=-80&&(t=`C`),t}function Sg(e,t){var n=`00000`+e.easting,r=`00000`+e.northing;return e.zoneNumber+e.zoneLetter+Cg(e.easting,e.northing,e.zoneNumber)+n.substr(n.length-5,t)+r.substr(r.length-5,t)}function Cg(e,t,n){var r=wg(n);return Tg(Math.floor(e/1e5),Math.floor(t/1e5)%20,r)}function wg(e){var t=e%ag;return t===0&&(t=ag),t}function Tg(e,t,n){var r=n-1,i=og.charCodeAt(r),a=sg.charCodeAt(r),o=i+e-1,s=a+t,c=!1;return o>fg&&(o=o-fg+cg-1,c=!0),(o===lg||i<lg&&o>lg||(o>lg||i<lg)&&c)&&o++,(o===ug||i<ug&&o>ug||(o>ug||i<ug)&&c)&&(o++,o===lg&&o++),o>fg&&(o=o-fg+cg-1),s>dg?(s=s-dg+cg-1,c=!0):c=!1,(s===lg||a<lg&&s>lg||(s>lg||a<lg)&&c)&&s++,(s===ug||a<ug&&s>ug||(s>ug||a<ug)&&c)&&(s++,s===lg&&s++),s>dg&&(s=s-dg+cg-1),String.fromCharCode(o)+String.fromCharCode(s)}function Eg(e){if(e&&e.length===0)throw`MGRSPoint coverting from nothing`;for(var t=e.length,n=null,r=``,i,a=0;!/[A-Z]/.test(i=e.charAt(a));){if(a>=2)throw`MGRSPoint bad conversion from: `+e;r+=i,a++}var o=parseInt(r,10);if(a===0||a+3>t)throw`MGRSPoint bad conversion from: `+e;var s=e.charAt(a++);if(s<=`A`||s===`B`||s===`Y`||s>=`Z`||s===`I`||s===`O`)throw`MGRSPoint zone letter `+s+` not handled: `+e;n=e.substring(a,a+=2);for(var c=wg(o),l=Dg(n.charAt(0),c),u=Og(n.charAt(1),c);u<kg(s);)u+=2e6;var d=t-a;if(d%2!=0)throw`MGRSPoint has to have an even number
|
|
8
8
|
of digits after the zone letter and two 100km letters - front
|
|
9
9
|
half for easting meters, second half for
|
|
10
|
-
northing meters`+e;var f=d/2,p=0,m=0,h,g,_,v,y;return f>0&&(h=1e5/10**f,g=e.substring(a,a+f),p=parseFloat(g)*h,_=e.substring(a+f),m=parseFloat(_)*h),v=p+l,y=m+u,{easting:v,northing:y,zoneLetter:s,zoneNumber:o,accuracy:h}}function Dg(e,t){for(var n=og.charCodeAt(t-1),r=1e5,i=!1;n!==e.charCodeAt(0);){if(n++,n===lg&&n++,n===ug&&n++,n>fg){if(i)throw`Bad character: `+e;n=cg,i=!0}r+=1e5}return r}function Og(e,t){if(e>`V`)throw`MGRSPoint given invalid Northing `+e;for(var n=sg.charCodeAt(t-1),r=0,i=!1;n!==e.charCodeAt(0);){if(n++,n===lg&&n++,n===ug&&n++,n>dg){if(i)throw`Bad character: `+e;n=cg,i=!0}r+=1e5}return r}function kg(e){var t;switch(e){case`C`:t=11e5;break;case`D`:t=2e6;break;case`E`:t=28e5;break;case`F`:t=37e5;break;case`G`:t=46e5;break;case`H`:t=55e5;break;case`J`:t=64e5;break;case`K`:t=73e5;break;case`L`:t=82e5;break;case`M`:t=91e5;break;case`N`:t=0;break;case`P`:t=8e5;break;case`Q`:t=17e5;break;case`R`:t=26e5;break;case`S`:t=35e5;break;case`T`:t=44e5;break;case`U`:t=53e5;break;case`V`:t=62e5;break;case`W`:t=7e6;break;case`X`:t=79e5;break;default:t=-1}if(t>=0)return t;throw`Invalid zone letter: `+e}function Ag(e,t,n){if(!(this instanceof Ag))return new Ag(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e==`object`)this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e==`string`&&t===void 0){var r=e.split(`,`);this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=e,this.y=t,this.z=n||0;console.warn(`proj4.Point will be removed in version 3, use proj4.toPoint`)}Ag.fromMGRS=function(e){return new Ag(gg(e))},Ag.prototype.toMGRS=function(e){return mg([this.x,this.y],e)};var jg=1,Mg=.25,Ng=.046875,Pg=.01953125,Fg=.01068115234375,Ig=.75,Lg=.46875,Rg=.013020833333333334,zg=.007120768229166667,Bg=.3645833333333333,Vg=.005696614583333333,Hg=.3076171875;function Ug(e){var t=[];t[0]=jg-e*(Mg+e*(Ng+e*(Pg+e*Fg))),t[1]=e*(Ig-e*(Ng+e*(Pg+e*Fg)));var n=e*e;return t[2]=n*(Lg-e*(Rg+e*zg)),n*=e,t[3]=n*(Bg-e*Vg),t[4]=n*e*Hg,t}function Wg(e,t,n,r){return n*=t,t*=t,r[0]*e-n*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))}var Gg=20;function Kg(e,t,n){for(var r=1/(1-t),i=e,a=Gg;a;--a){var o=Math.sin(i),s=1-t*o*o;if(s=(Wg(i,o,Math.cos(i),n)-e)*(s*Math.sqrt(s))*r,i-=s,Math.abs(s)<1e-10)return i}return i}function qg(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.es&&(this.en=Ug(this.es),this.ml0=Wg(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Jg(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i,a,o,s=Math.sin(n),c=Math.cos(n);if(this.es){var l=c*r,u=l**2,d=this.ep2*c**2,f=d**2,p=(Math.abs(c)>1e-10?Math.tan(n):0)**2,m=p**2;i=1-this.es*s**2,l/=Math.sqrt(i);var h=Wg(n,s,c,this.en);a=this.a*(this.k0*l*(1+u/6*(1-p+d+u/20*(5-18*p+m+14*d-58*p*d+u/42*(61+179*m-m*p-479*p)))))+this.x0,o=this.a*(this.k0*(h-this.ml0+s*r*l/2*(1+u/12*(5-p+9*d+4*f+u/30*(61+m-58*p+270*d-330*p*d+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var g=c*Math.sin(r);if(Math.abs(Math.abs(g)-1)<1e-10)return 93;if(a=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,o=c*Math.cos(r)/Math.sqrt(1-g**2),g=Math.abs(o),g>=1){if(g-1>1e-10)return 93;o=0}else o=Math.acos(o);n<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return e.x=a,e.y=o,e}function Yg(e){var t,n,r,i,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(!this.es){var s=Math.exp(a/this.k0),c=.5*(s-1/s),l=this.lat0+o/this.k0,u=Math.cos(l);t=Math.sqrt((1-u**2)/(1+c**2)),r=Math.asin(t),o<0&&(r=-r),i=c===0&&u===0?0:Q(Math.atan2(c,u)+this.long0,this.over)}else if(t=this.ml0+o/this.k0,n=Kg(t,this.es,this.en),Math.abs(n)<X){var d=Math.sin(n),f=Math.cos(n),p=Math.abs(f)>1e-10?Math.tan(n):0,m=this.ep2*f**2,h=m**2,g=p**2,_=g**2;t=1-this.es*d**2;var v=a*Math.sqrt(t)/this.k0,y=v**2;t*=p,r=n-t*y/(1-this.es)*.5*(1-y/12*(5+3*g-9*m*g+m-4*h-y/30*(61+90*g-252*m*g+45*_+46*m-y/56*(1385+3633*g+4095*_+1574*_*g)))),i=Q(this.long0+v*(1-y/6*(1+2*g+m-y/20*(5+28*g+24*_+8*m*g+6*m-y/42*(61+662*g+1320*_+720*_*g))))/f,this.over)}else r=X*Jm(o),i=0;return e.x=i,e.y=r,e}var Xg={init:qg,forward:Jg,inverse:Yg,names:[`Fast_Transverse_Mercator`,`Fast Transverse Mercator`]};function Zg(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function Qg(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),r=Math.min(e,t)/(n||1);return n*Math.sqrt(1+r**2)}function $g(e){var t=1+e,n=t-1;return n===0?e:e*Math.log(t)/n}function e_(e){var t=Math.abs(e);return t=$g(t*(1+t/(Qg(1,t)+1))),e<0?-t:t}function t_(e,t){for(var n=2*Math.cos(2*t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return t+o*Math.sin(2*t)}function n_(e,t){for(var n=2*Math.cos(t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return Math.sin(t)*o}function r_(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function i_(e,t,n){for(var r=Math.sin(t),i=Math.cos(t),a=Zg(n),o=r_(n),s=2*i*o,c=-2*r*a,l=e.length-1,u=e[l],d=0,f=0,p=0,m,h;--l>=0;)m=f,h=d,f=u,d=p,u=-m+s*f-c*d+e[l],p=-h+c*f+s*d;return s=r*o,c=i*a,[s*u-c*p,s*p+c*u]}function a_(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw Error(`Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.`);this.approx&&(Xg.init.apply(this),this.forward=Xg.forward,this.inverse=Xg.inverse),this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.k0=this.k0===void 0?1:this.k0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+-2854/675*t))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+4642/4725*t))))),n*=t,this.cgb[1]=n*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+2323/945*t)))),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+-1522/945*t)))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+73814/2835*t))),this.cbg[2]=n*(-26/15+t*(34/21+t*(8/5+-12686/2835*t))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+-399572/14175*t)),this.cbg[3]=n*(1237/630+t*(-12/5+-24832/14175*t)),n*=t,this.cgb[4]=n*(4174/315+-144838/6237*t),this.cbg[4]=n*(-734/315+109598/31185*t),n*=t,this.cgb[5]=601676/22275*n,this.cbg[5]=444337/155925*n,n=t**2,this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+-96199/604800*t))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+7891/37800*t))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+1118711/3870720*t)))),this.gtu[1]=n*(13/48+t*(-3/5+t*(557/1440+t*(281/630+-1983433/1935360*t)))),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+-5569/90720*t))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+167603/181440*t))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+830251/7257600*t)),this.gtu[3]=n*(49561/161280+t*(-179/168+6601661/7257600*t)),n*=t,this.utg[4]=n*(-4583/161280+108847/3991680*t),this.gtu[4]=n*(34729/80640+-3418889/1995840*t),n*=t,this.utg[5]=-20648693/638668800*n,this.gtu[5]=212378941/319334400*n;var r=t_(this.cbg,this.lat0);this.Zb=-this.Qn*(r+n_(this.gtu,2*r))}function o_(e){var t=Q(e.x-this.long0,this.over),n=e.y;n=t_(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),a=Math.sin(t),o=Math.cos(t);n=Math.atan2(r,o*i),t=Math.atan2(a*i,Qg(r,i*o)),t=e_(Math.tan(t));var s=i_(this.gtu,2*n,2*t);n+=s[0],t+=s[1];var c,l;return Math.abs(t)<=2.623395162778?(c=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(c=1/0,l=1/0),e.x=c,e.y=l,e}function s_(e){var t=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,t/=this.Qn;var r,i;if(Math.abs(t)<=2.623395162778){var a=i_(this.utg,2*n,2*t);n+=a[0],t+=a[1],t=Math.atan(Zg(t));var o=Math.sin(n),s=Math.cos(n),c=Math.sin(t),l=Math.cos(t);n=Math.atan2(o*l,Qg(c,l*s)),t=Math.atan2(c,l*s),r=Q(t+this.long0,this.over),i=t_(this.cgb,n)}else r=1/0,i=1/0;return e.x=r,e.y=i,e}var c_={init:a_,forward:o_,inverse:s_,names:[`Extended_Transverse_Mercator`,`Extended Transverse Mercator`,`etmerc`,`Transverse_Mercator`,`Transverse Mercator`,`Gauss Kruger`,`Gauss_Kruger`,`tmerc`]};function l_(e,t){if(e===void 0){if(e=Math.floor((Q(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var u_=`etmerc`;function d_(){var e=l_(this.zone,this.long0);if(e===void 0)throw Error(`unknown utm zone`);this.lat0=0,this.long0=(6*Math.abs(e)-183)*Zp,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,c_.init.apply(this),this.forward=c_.forward,this.inverse=c_.inverse}var f_={init:d_,names:[`Universal Transverse Mercator System`,`utm`],dependsOn:u_};function p_(e,t){return((1-e)/(1+e))**t}var m_=20;function h_(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Z)/(Math.tan(.5*this.lat0+Z)**+this.C*p_(this.e*e,this.ratexp))}function g_(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.tan(.5*n+Z)**+this.C*p_(this.e*Math.sin(n),this.ratexp))-X,e.x=this.C*t,e}function __(e){for(var t=1e-14,n=e.x/this.C,r=e.y,i=(Math.tan(.5*r+Z)/this.K)**(1/this.C),a=m_;a>0&&(r=2*Math.atan(i*p_(this.e*Math.sin(e.y),-.5*this.e))-X,!(Math.abs(r-e.y)<t));--a)e.y=r;return a?(e.x=n,e.y=r,e):null}var v_={init:h_,forward:g_,inverse:__,names:[`gauss`]};function y_(){v_.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||=`Oblique Stereographic Alternative`)}function b_(e){var t,n,r,i;return e.x=Q(e.x-this.long0,this.over),v_.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*r),e.x=i*n*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*n*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function x_(e){var t,n,r,i,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=Qg(e.x,e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),n=Math.cos(o),i=Math.asin(n*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*n-e.y*this.sinc0*t)}else i=this.phic0,r=0;return e.x=r,e.y=i,v_.inverse.apply(this,[e]),e.x=Q(e.x+this.long0,this.over),e}var S_={init:y_,forward:b_,inverse:x_,names:[`Stereographic_North_Pole`,`Oblique_Stereographic`,`sterea`,`Oblique Stereographic Alternative`,`Double_Stereographic`]};function C_(e,t,n){return t*=n,Math.tan(.5*(X+e))*((1-t)/(1+t))**(.5*n)}function w_(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+Jm(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt((1+this.e)**+(1+this.e)*(1-this.e)**(1-this.e)),!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*qm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ym(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=qm(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(C_(this.lat0,this.sinlat0,this.e))-X,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function T_(e){var t=e.x,n=e.y,r=Math.sin(n),i=Math.cos(n),a,o,s,c,l,u,d=Q(t-this.long0,this.over);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=1e-10&&Math.abs(n+this.lat0)<=1e-10?(e.x=NaN,e.y=NaN,e):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(d)),e.x=this.a*a*i*Math.sin(d)+this.x0,e.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(d))+this.y0,e):(o=2*Math.atan(C_(n,r,this.e))-X,c=Math.cos(o),s=Math.sin(o),Math.abs(this.coslat0)<=1e-10?(l=Ym(this.e,n*this.con,this.con*r),u=2*this.a*this.k0*l/this.cons,e.x=this.x0+u*Math.sin(t-this.long0),e.y=this.y0-this.con*u*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<1e-10?(a=2*this.a*this.k0/(1+c*Math.cos(d)),e.y=a*s):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*c*Math.cos(d))),e.y=a*(this.cosX0*s-this.sinX0*c*Math.cos(d))+this.y0),e.x=a*c*Math.sin(d)+this.x0,e))}function E_(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,n=this.lat0,o<=1e-10?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<1e-10?this.lat0>0?Q(this.long0+Math.atan2(e.x,-1*e.y),this.over):Q(this.long0+Math.atan2(e.x,e.y),this.over):Q(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s)),this.over),e.x=t,e.y=n,e)}if(Math.abs(this.coslat0)<=1e-10){if(o<=1e-10)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),n=this.con*Xm(this.e,r),t=this.con*Q(this.con*this.long0+Math.atan2(e.x,-1*e.y),this.over)}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=1e-10?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/o),t=Q(this.long0+Math.atan2(e.x*Math.sin(i),o*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)),this.over)),n=-1*Xm(this.e,Math.tan(.5*(X+a)));return e.x=t,e.y=n,e}var D_={init:w_,forward:T_,inverse:E_,names:[`stere`,`Stereographic_South_Pole`,`Polar_Stereographic_variant_A`,`Polar_Stereographic_variant_B`,`Polar_Stereographic`],ssfn_:C_};function O_(){this.k0||=1;var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,r=1/this.rf,i=2*r-r**2,a=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*t**2),this.alpha=Math.sqrt(1+i/(1-i)*Math.cos(e)**4),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),c=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*c}function k_(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e}function A_(e){for(var t=e.x-this.x0,n=e.y-this.y0,r=t/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,c=0,l=a,u=-1e3,d=0;Math.abs(l-u)>1e-7;){if(++d>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(c))-Math.PI/2}return e.x=s,e.y=l,e}var j_={init:O_,forward:k_,inverse:A_,names:[`somerc`]},M_=1e-7;function N_(e){var t=[`Hotine_Oblique_Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`],n=typeof e.projName==`object`?Object.keys(e.projName)[0]:e.projName;return`no_uoff`in e||`no_off`in e||t.indexOf(n)!==-1||t.indexOf(ch(n))!==-1}function P_(){var e,t,n,r,i,a,o,s,c,l,u=0,d,f=0,p=0,m=0,h=0,g=0,_=0;this.k0||=1,this.no_off=N_(this),this.no_rot=`no_rot`in this;var v=!1;`alpha`in this&&(v=!0);var y=!1;if(`rectified_grid_angle`in this&&(y=!0),v&&(_=this.alpha),y&&(u=this.rectified_grid_angle,v||=(_=0,!0)),v||y)f=this.longc;else if(p=this.long1,h=this.lat1,m=this.long2,g=this.lat2,Math.abs(h-g)<=M_||(e=Math.abs(h))<=M_||Math.abs(e-X)<=M_||Math.abs(Math.abs(this.lat0)-X)<=M_||Math.abs(Math.abs(g)-X)<=M_)throw Error();var b=1-this.es;t=Math.sqrt(b),Math.abs(this.lat0)>1e-10?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),e=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*t/e,r=this.B*t/(n*Math.sqrt(e)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Ym(this.e,this.lat0,s)**+this.B):(this.B=1/t,this.A=this.k0,this.E=r=i=1),v||y?(v?(d=Math.asin(Math.sin(_)/r),y||(u=_)):(d=u,_=Math.asin(r*Math.sin(d))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(d))/this.B):(a=Ym(this.e,h,Math.sin(h))**+this.B,o=Ym(this.e,g,Math.sin(g))**+this.B,i=this.E/a,c=(o-a)/(o+a),l=this.E*this.E,l=(l-o*a)/(l+o*a),e=p-m,e<-Math.PI?m-=$p:e>Math.PI&&(m+=$p),this.lam0=Q(.5*(p+m)-Math.atan(l*Math.tan(.5*this.B*(p-m))/c)/this.B,this.over),d=Math.atan(2*Math.sin(this.B*Q(p-this.lam0,this.over))/(i-1/i)),u=_=Math.asin(r*Math.sin(d))),this.singam=Math.sin(d),this.cosgam=Math.cos(d),this.sinrot=Math.sin(u),this.cosrot=Math.cos(u),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(_))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*d,this.v_pole_n=this.ArB*Math.log(Math.tan(Z-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(Z+i))}function F_(e){var t={},n,r,i,a,o,s,c,l;if(e.x-=this.lam0,Math.abs(Math.abs(e.y)-X)>1e-10){if(o=this.E/Ym(this.e,e.y,Math.sin(e.y))**+this.B,s=1/o,n=.5*(o-s),r=.5*(o+s),a=Math.sin(this.B*e.x),i=(n*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)<1e-10)throw Error();l=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*e.x),c=Math.abs(s)<M_?this.A*e.x:this.ArB*Math.atan2(n*this.cosgam+a*this.singam,s)}else l=e.y>0?this.v_pole_n:this.v_pole_s,c=this.ArB*e.y;return this.no_rot?(t.x=c,t.y=l):(c-=this.u_0,t.x=l*this.cosrot+c*this.sinrot,t.y=c*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,e.z!==void 0&&(t.z=e.z),e.m!==void 0&&(t.m=e.m),t}function I_(e){var t,n,r,i,a,o,s,c={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(n=e.y,t=e.x):(n=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),i=.5*(r-1/r),a=.5*(r+1/r),o=Math.sin(this.BrA*t),s=(o*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(s)-1)<1e-10)c.x=0,c.y=s<0?-X:X;else{if(c.y=this.E/Math.sqrt((1+s)/(1-s)),c.y=Xm(this.e,c.y**(1/this.B)),c.y===1/0)throw Error();c.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return c.x+=this.lam0,e.z!==void 0&&(c.z=e.z),e.m!==void 0&&(c.m=e.m),c}var L_={init:P_,forward:F_,inverse:I_,names:[`Hotine_Oblique_Mercator`,`Hotine Oblique Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Variant_B`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`,`Hotine_Oblique_Mercator_Two_Point_Natural_Origin`,`Hotine_Oblique_Mercator_Azimuth_Center`,`Oblique_Mercator`,`omerc`]};function R_(){if(this.lat2||=this.lat1,this.k0||=1,this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),r=qm(this.e,t,n),i=Ym(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=qm(this.e,a,o),c=Ym(this.e,this.lat2,a),l=Ym(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>1e-10?Math.log(r/s)/Math.log(i/c):t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*i**+this.ns),this.rh=Math.abs(Math.abs(this.lat0)-X)<1e-10?0:this.a*this.f0*l**+this.ns,this.title||=`Lambert Conformal Conic`}}function z_(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=Jm(n)*(X-2*Xp));var r=Math.abs(Math.abs(n)-X),i,a;if(r>1e-10)i=Ym(this.e,n,Math.sin(n)),a=this.a*this.f0*i**+this.ns;else{if(r=n*this.ns,r<=0)return null;a=0}var o=this.ns*Q(t-this.long0,this.over);return e.x=this.k0*(a*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-a*Math.cos(o))+this.y0,e}function B_(e){var t,n,r,i,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),n=1):(t=-Math.sqrt(o*o+s*s),n=-1);var c=0;if(t!==0&&(c=Math.atan2(n*o,n*s)),t!==0||this.ns>0){if(n=1/this.ns,r=(t/(this.a*this.f0))**+n,i=Xm(this.e,r),i===-9999)return null}else i=-X;return a=Q(c/this.ns+this.long0,this.over),e.x=a,e.y=i,e}var V_={init:R_,forward:z_,inverse:B_,names:[`Lambert Tangential Conformal Conic Projection`,`Lambert_Conformal_Conic`,`Lambert_Conformal_Conic_1SP`,`Lambert_Conformal_Conic_2SP`,`lcc`,`Lambert Conic Conformal (1SP)`,`Lambert Conic Conformal (2SP)`]};function H_(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||=.863937979737193,this.long0||=.4334234309119251,this.k0||=.9999,this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.cos(this.fi0)**4/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)))**(this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.tan(this.fi0/2+this.s45)**+this.alfa*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.sin(this.fi0)**2),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function U_(e){var t,n,r,i,a,o,s,c=e.x,l=e.y,u=Q(c-this.long0,this.over);return t=((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)))**(this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.tan(l/2+this.s45)**+this.alfa/t)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),a=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.tan(this.s0/2+this.s45)**+this.n/Math.tan(i/2+this.s45)**+this.n,e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e}function W_(e){var t,n,r,i,a,o,s,c,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),a=Math.atan2(e.y,e.x),i=a/Math.sin(this.s0),r=2*(Math.atan((this.ro0/o)**(1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(t)),e.x=this.long0-n/this.alfa,s=t,c=0;var u=0;do e.y=2*(Math.atan(this.k**(-1/this.alfa)*Math.tan(t/2+this.s45)**(1/this.alfa)*((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)))**(this.e/2))-this.s45),Math.abs(s-e.y)<1e-10&&(c=1),s=e.y,u+=1;while(c===0&&u<15);return u>=15?null:e}var G_={init:H_,forward:U_,inverse:W_,names:[`Krovak`,`Krovak Modified`,`Krovak (North Orientated)`,`Krovak Modified (North Orientated)`,`krovak`]};function K_(e,t,n,r,i){return e*i-t*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function q_(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function J_(e){return .375*e*(1+.25*e*(1+.46875*e))}function Y_(e){return .05859375*e*e*(1+.75*e)}function X_(e){return e*e*e*(35/3072)}function Z_(e,t,n){var r=t*n;return e/Math.sqrt(1-r*r)}function Q_(e){return Math.abs(e)<X?e:e-Jm(e)*Math.PI}function $_(e,t,n,r,i){for(var a=e/t,o,s=0;s<15;s++)if(o=(e-(t*a-n*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(t-2*n*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=o,Math.abs(o)<=1e-10)return a;return NaN}function ev(){this.sphere||(this.e0=q_(this.es),this.e1=J_(this.es),this.e2=Y_(this.es),this.e3=X_(this.es),this.ml0=this.a*K_(this.e0,this.e1,this.e2,this.e3,this.lat0))}function tv(e){var t,n,r=e.x,i=e.y;if(r=Q(r-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),o=Math.cos(i),s=Z_(this.a,this.e,a),c=Math.tan(i)*Math.tan(i),l=r*Math.cos(i),u=l*l,d=this.es*o*o/(1-this.es),f=this.a*K_(this.e0,this.e1,this.e2,this.e3,i);t=s*l*(1-u*c*(1/6-(8-c+8*d)*u/120)),n=f-this.ml0+s*a/o*u*(.5+(5-c+6*d)*u/24)}return e.x=t+this.x0,e.y=n+this.y0,e}function nv(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i;if(this.sphere){var a=n+this.lat0;r=Math.asin(Math.sin(a)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(a))}else{var o=$_(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-X)<=1e-10)return e.x=this.long0,e.y=X,n<0&&(e.y*=-1),e;var s=Z_(this.a,this.e,Math.sin(o)),c=s*s*s/this.a/this.a*(1-this.es),l=Math.tan(o)**2,u=t*this.a/s,d=u*u;r=o-s*Math.tan(o)/c*u*u*(.5-(1+3*l)*u*u/24),i=u*(1-d*(l/3+(1+3*l)*l*d/15))/Math.cos(o)}return e.x=Q(i+this.long0,this.over),e.y=Q_(r),e}var rv={init:ev,forward:tv,inverse:nv,names:[`Cassini`,`Cassini_Soldner`,`cass`]};function iv(e,t){var n;return e>1e-7?(n=e*t,(1-e*e)*(t/(1-n*n)-.5/e*Math.log((1-n)/(1+n)))):2*t}var av=.3333333333333333,ov=.17222222222222222,sv=.10257936507936508,cv=.06388888888888888,lv=.0664021164021164,uv=.016415012942191543;function dv(e){var t,n=[];return n[0]=e*av,t=e*e,n[0]+=t*ov,n[1]=t*cv,t*=e,n[0]+=t*sv,n[1]+=t*lv,n[2]=t*uv,n}function fv(e,t){var n=e+e;return e+t[0]*Math.sin(n)+t[1]*Math.sin(n+n)+t[2]*Math.sin(n+n+n)}function pv(){var e=Math.abs(this.lat0);if(this.mode=Math.abs(e-X)<1e-10?this.lat0<0?1:2:Math.abs(e)<1e-10?3:4,this.es>0){var t;switch(this.qp=iv(this.e,1),this.mmf=.5/(1-this.es),this.apa=dv(this.es),this.mode){case 2:this.dd=1;break;case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=iv(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===4&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function mv(e){var t,n,r,i,a,o,s,c,l,u,d=e.x,f=e.y;if(d=Q(d-this.long0,this.over),this.sphere){if(a=Math.sin(f),u=Math.cos(f),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*a+this.cosph0*u*r,n<=1e-10)return null;n=Math.sqrt(2/n),t=n*u*Math.sin(d),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<1e-10)return null;n=Z-f*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),t=n*Math.sin(d),n*=r}}else{switch(s=0,c=0,l=0,r=Math.cos(d),i=Math.sin(d),a=Math.sin(f),o=iv(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=o/this.qp,c=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:l=1+this.sinb1*s+this.cosb1*c*r;break;case this.EQUIT:l=1+c*r;break;case this.N_POLE:l=X+f,o=this.qp-o;break;case this.S_POLE:l=f-X,o=this.qp+o}if(Math.abs(l)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),n=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*s-this.sinb1*c*r):(l=Math.sqrt(2/(1+c*r)))*s*this.ymf,t=this.xmf*l*c*i;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(l=Math.sqrt(o))*i,n=r*(this.mode===this.S_POLE?l:-l)):t=n=0}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e}function hv(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i,a,o,s,c,l;if(this.sphere){var u=0,d,f=0;if(d=Math.sqrt(t*t+n*n),i=d*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),u=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(d)<=1e-10?0:Math.asin(n*f/d),t*=f,n=u*d;break;case this.OBLIQ:i=Math.abs(d)<=1e-10?this.lat0:Math.asin(u*this.sinph0+n*f*this.cosph0/d),t*=f*this.cosph0,n=(u-Math.sin(i)*this.sinph0)*d;break;case this.N_POLE:n=-n,i=X-i;break;case this.S_POLE:i-=X}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,n)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,n*=this.dd,c=Math.sqrt(t*t+n*n),c<1e-10)return e.x=this.long0,e.y=this.lat0,e;o=2*Math.asin(.5*c/this.rq),a=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(l=a*this.sinb1+n*o*this.cosb1/c,s=this.qp*l,n=c*this.cosb1*a-n*this.sinb1*o):(l=n*o/c,s=this.qp*l,n=c*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),s=t*t+n*n,!s)return e.x=this.long0,e.y=this.lat0,e;l=1-s/this.qp,this.mode===this.S_POLE&&(l=-l)}r=Math.atan2(t,n),i=fv(Math.asin(l),this.apa)}return e.x=Q(this.long0+r,this.over),e.y=i,e}var gv={init:pv,forward:mv,inverse:hv,names:[`Lambert Azimuthal Equal Area`,`Lambert_Azimuthal_Equal_Area`,`laea`],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function _v(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function vv(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-this.temp**2,this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=qm(this.e3,this.sin_po,this.cos_po),this.qs1=iv(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=qm(this.e3,this.sin_po,this.cos_po),this.qs2=iv(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=iv(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>1e-10?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function yv(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=iv(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*Q(t-this.long0,this.over),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return e.x=o,e.y=s,e}function bv(e){var t,n,r,i,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),i=0,t!==0&&(i=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,n)),a=Q(i/this.ns0+this.long0,this.over),e.x=a,e.y=o,e}function xv(e,t){var n,r,i,a,o,s=_v(.5*t);if(e<1e-10)return s;for(var c=e*e,l=1;l<=25;l++)if(n=Math.sin(s),r=Math.cos(s),i=e*n,a=1-i*i,o=.5*a*a/r*(t/(1-c)-n/a+.5/e*Math.log((1-i)/(1+i))),s+=o,Math.abs(o)<=1e-7)return s;return null}var Sv={init:vv,forward:yv,inverse:bv,names:[`Albers_Conic_Equal_Area`,`Albers_Equal_Area`,`Albers`,`aea`],phi1z:xv};function Cv(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function wv(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=Q(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,o>0||Math.abs(o)<=1e-10?(s=this.x0+this.a*a*n*Math.sin(r)/o,c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)/o):(s=this.x0+this.infinity_dist*n*Math.sin(r),c=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function Tv(e){var t,n,r,i,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),n=Math.sin(i),r=Math.cos(i),o=_v(r*this.sin_p14+e.y*n*this.cos_p14/t),a=Math.atan2(e.x*n,t*this.cos_p14*r-e.y*this.sin_p14*n),a=Q(this.long0+a,this.over)):(o=this.phic0,a=0),e.x=a,e.y=o,e}var Ev={init:Cv,forward:wv,inverse:Tv,names:[`gnom`]};function Dv(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*X:X;for(var r=Math.asin(.5*t),i,a,o,s,c=0;c<30;c++)if(a=Math.sin(r),o=Math.cos(r),s=e*a,i=(1-s*s)**2/(2*o)*(t/(1-e*e)-a/(1-s*s)+.5/e*Math.log((1-s)/(1+s))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function Ov(){this.sphere||(this.k0=qm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function kv(e){var t=e.x,n=e.y,r,i,a=Q(t-this.long0,this.over);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=iv(this.e,Math.sin(n));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return e.x=r,e.y=i,e}function Av(e){e.x-=this.x0,e.y-=this.y0;var t,n;return this.sphere?(t=Q(this.long0+e.x/this.a/Math.cos(this.lat_ts),this.over),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=Dv(this.e,2*e.y*this.k0/this.a),t=Q(this.long0+e.x/(this.a*this.k0),this.over)),e.x=t,e.y=n,e}var jv={init:Ov,forward:kv,inverse:Av,names:[`cea`]};function Mv(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Equidistant Cylindrical (Plate Carre)`,this.rc=Math.cos(this.lat_ts)}function Nv(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i=Q_(n-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*i,e}function Pv(e){var t=e.x,n=e.y;return e.x=Q(this.long0+(t-this.x0)/(this.a*this.rc),this.over),e.y=Q_(this.lat0+(n-this.y0)/this.a),e}var Fv={init:Mv,forward:Nv,inverse:Pv,names:[`Equirectangular`,`Equidistant_Cylindrical`,`Equidistant_Cylindrical_Spherical`,`eqc`]},Iv=20;function Lv(){this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=q_(this.es),this.e1=J_(this.es),this.e2=Y_(this.es),this.e3=X_(this.es),this.ml0=this.a*K_(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Rv(e){var t=e.x,n=e.y,r,i,a,o=Q(t-this.long0,this.over);if(a=o*Math.sin(n),this.sphere)Math.abs(n)<=1e-10?(r=this.a*o,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(n),i=this.a*(Q_(n-this.lat0)+(1-Math.cos(a))/Math.tan(n)));else if(Math.abs(n)<=1e-10)r=this.a*o,i=-1*this.ml0;else{var s=Z_(this.a,this.e,Math.sin(n))/Math.tan(n);r=s*Math.sin(a),i=this.a*K_(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(a))}return e.x=r+this.x0,e.y=i+this.y0,e}function zv(e){var t,n,r=e.x-this.x0,i=e.y-this.y0,a,o,s,c,l;if(this.sphere){if(Math.abs(i+this.a*this.lat0)<=1e-10)t=Q(r/this.a+this.long0,this.over),n=0;else{o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,c=o;var u;for(a=Iv;a;--a)if(u=Math.tan(c),l=-1*(o*(c*u+1)-c-.5*(c*c+s)*u)/((c-o)/u-1),c+=l,Math.abs(l)<=1e-10){n=c;break}t=Q(this.long0+Math.asin(r*Math.tan(c)/this.a)/Math.sin(n),this.over)}}else if(Math.abs(i+this.ml0)<=1e-10)n=0,t=Q(this.long0+r/this.a,this.over);else{o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,c=o;var d,f,p,m,h;for(a=Iv;a;--a)if(h=this.e*Math.sin(c),d=Math.sqrt(1-h*h)*Math.tan(c),f=this.a*K_(this.e0,this.e1,this.e2,this.e3,c),p=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),m=f/this.a,l=(o*(d*m+1)-m-.5*d*(m*m+s))/(this.es*Math.sin(2*c)*(m*m+s-2*o*m)/(4*d)+(o-m)*(d*p-2/Math.sin(2*c))-p),c-=l,Math.abs(l)<=1e-10){n=c;break}d=Math.sqrt(1-this.es*Math.sin(n)**2)*Math.tan(n),t=Q(this.long0+Math.asin(r*d/this.a)/Math.sin(n),this.over)}return e.x=t,e.y=n,e}var Bv={init:Lv,forward:Rv,inverse:zv,names:[`Polyconic`,`American_Polyconic`,`poly`]};function Vv(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Hv(e){var t,n=e.x,r=e.y-this.lat0,i=n-this.long0,a=r/Kp*1e-5,o=i,s=1,c=0;for(t=1;t<=10;t++)s*=a,c+=this.A[t]*s;var l=c,u=o,d=1,f=0,p,m,h=0,g=0;for(t=1;t<=6;t++)p=d*l-f*u,m=f*l+d*u,d=p,f=m,h=h+this.B_re[t]*d-this.B_im[t]*f,g=g+this.B_im[t]*d+this.B_re[t]*f;return e.x=g*this.a+this.x0,e.y=h*this.a+this.y0,e}function Uv(e){var t,n=e.x,r=e.y,i=n-this.x0,a=(r-this.y0)/this.a,o=i/this.a,s=1,c=0,l,u,d=0,f=0;for(t=1;t<=6;t++)l=s*a-c*o,u=c*a+s*o,s=l,c=u,d=d+this.C_re[t]*s-this.C_im[t]*c,f=f+this.C_im[t]*s+this.C_re[t]*c;for(var p=0;p<this.iterations;p++){var m=d,h=f,g,_,v=a,y=o;for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,v+=(t-1)*(this.B_re[t]*m-this.B_im[t]*h),y+=(t-1)*(this.B_im[t]*m+this.B_re[t]*h);m=1,h=0;var b=this.B_re[1],x=this.B_im[1];for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,b+=t*(this.B_re[t]*m-this.B_im[t]*h),x+=t*(this.B_im[t]*m+this.B_re[t]*h);var S=b*b+x*x;d=(v*b+y*x)/S,f=(y*b-v*x)/S}var C=d,w=f,T=1,E=0;for(t=1;t<=9;t++)T*=C,E+=this.D[t]*T;var D=this.lat0+E*Kp*1e5;return e.x=this.long0+w,e.y=D,e}var Wv={init:Vv,forward:Hv,inverse:Uv,names:[`New_Zealand_Map_Grid`,`nzmg`],iterations:1};function Gv(){}function Kv(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=i,e.y=a,e}function qv(e){e.x-=this.x0,e.y-=this.y0;var t=Q(this.long0+e.x/this.a,this.over),n=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=n,e}var Jv={init:Gv,forward:Kv,inverse:qv,names:[`Miller_Cylindrical`,`mill`]},Yv=20;function Xv(){this.long0=this.long0||0,this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ug(this.es)}function Zv(e){var t,n,r=e.x,i=e.y;if(r=Q(r-this.long0,this.over),this.sphere){if(!this.m)i=this.n===1?i:Math.asin(this.n*Math.sin(i));else for(var a=this.n*Math.sin(i),o=Yv;o;--o){var s=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<1e-10)break}t=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var c=Math.sin(i),l=Math.cos(i);n=this.a*Wg(i,c,l,this.en),t=this.a*r*l/Math.sqrt(1-this.es*c*c)}return e.x=t,e.y=n,e}function Qv(e){var t,n,r,i;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=_v((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=_v(Math.sin(t)/this.n)),r=Q(r+this.long0,this.over),t=Q_(t)):(t=Kg(e.y/this.a,this.es,this.en),i=Math.abs(t),i<X?(i=Math.sin(t),n=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),r=Q(n,this.over)):i-1e-10<X&&(r=this.long0)),e.x=r,e.y=t,e}var $v={init:Xv,forward:Zv,inverse:Qv,names:[`Sinusoidal`,`sinu`]};function ey(){this.sphere=!0,this.b=this.a,this.m=1,this.n=2.5707963267948966,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)}var ty={init:ey,forward:Zv,inverse:Qv,names:[`Eckert_VI`,`eck6`]};function ny(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0}function ry(e){for(var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i=n,a=Math.PI*Math.sin(n);;){var o=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=o,Math.abs(o)<1e-10)break}i/=2,Math.PI/2-Math.abs(n)<1e-10&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,c=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=c,e}function iy(e){var t,n;e.x-=this.x0,e.y-=this.y0,n=e.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),t=Math.asin(n);var r=Q(this.long0+e.x/(.900316316158*this.a*Math.cos(t)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return e.x=r,e.y=i,e}var ay={init:ny,forward:ry,inverse:iy,names:[`Mollweide`,`moll`]};function oy(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=q_(this.es),this.e1=J_(this.es),this.e2=Y_(this.es),this.e3=X_(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=qm(this.e,this.sin_phi,this.cos_phi),this.ml1=K_(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=qm(this.e,this.sin_phi,this.cos_phi),this.ml2=K_(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=K_(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function sy(e){var t=e.x,n=e.y,r;if(this.sphere)r=this.a*(this.g-n);else{var i=K_(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-i)}var a=this.ns*Q(t-this.long0,this.over),o=this.x0+r*Math.sin(a),s=this.y0+this.rh-r*Math.cos(a);return e.x=o,e.y=s,e}function cy(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,n,r,i;this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;return n!==0&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=Q(this.long0+a/this.ns,this.over),r=Q_(this.g-n/this.a),e.x=i,e.y=r,e):(r=$_(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=Q(this.long0+a/this.ns,this.over),e.x=i,e.y=r,e)}var ly={init:oy,forward:sy,inverse:cy,names:[`Equidistant_Conic`,`eqdc`]};function uy(){this.R=this.a}function dy(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i,a;if(Math.abs(n)<=1e-10)return i=this.x0+this.R*r,a=this.y0,e.x=i,e.y=a,e;var o=_v(2*Math.abs(n/Math.PI));if(Math.abs(r)<=1e-10||Math.abs(Math.abs(n)-X)<=1e-10)return i=this.x0,a=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o),e.x=i,e.y=a,e;var s=.5*Math.abs(Math.PI/r-r/Math.PI),c=s*s,l=Math.sin(o),u=Math.cos(o),d=u/(l+u-1),f=d*d,p=d*(2/l-1),m=p*p,h=Math.PI*this.R*(s*(d-m)+Math.sqrt(c*(d-m)*(d-m)-(m+c)*(f-m)))/(m+c);r<0&&(h=-h),i=this.x0+h;var g=c+d;return h=Math.PI*this.R*(p*g-s*Math.sqrt((m+c)*(c+1)-g*g))/(m+c),a=n>=0?this.y0+h:this.y0-h,e.x=i,e.y=a,e}function fy(e){var t,n,r,i,a,o,s,c,l,u,d,f,p;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,r=e.x/d,i=e.y/d,a=r*r+i*i,o=-Math.abs(i)*(1+a),s=o-2*i*i+r*r,c=-2*o+1+2*i*i+a*a,p=i*i/c+(2*s*s*s/c/c/c-9*o*s/c/c)/27,l=(o-s*s/3/c)/c,u=2*Math.sqrt(-l/3),d=3*p/l/u,Math.abs(d)>1&&(d=d>=0?1:-1),f=Math.acos(d)/3,n=e.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI,t=Math.abs(r)<1e-10?this.long0:Q(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r,this.over),e.x=t,e.y=n,e}var py={init:uy,forward:dy,inverse:fy,names:[`Van_der_Grinten_I`,`VanDerGrinten`,`Van_der_Grinten`,`vandg`]};function my(e,t,n,r,i,a){let o=r-t,s=Math.atan((1-a)*Math.tan(e)),c=Math.atan((1-a)*Math.tan(n)),l=Math.sin(s),u=Math.cos(s),d=Math.sin(c),f=Math.cos(c),p=o,m,h=100,g,_,v,y,b,x,S,C,w,T,E,D,O,k;do{if(g=Math.sin(p),_=Math.cos(p),v=Math.sqrt(f*g*(f*g)+(u*d-l*f*_)*(u*d-l*f*_)),v===0)return{azi1:0,s12:0};y=l*d+u*f*_,b=Math.atan2(v,y),x=u*f*g/v,S=1-x*x,C=S===0?0:y-2*l*d/S,w=a/16*S*(4+a*(4-3*S)),m=p,p=o+(1-w)*a*x*(b+w*v*(C+w*y*(-1+2*C*C)))}while(Math.abs(p-m)>1e-12&&--h>0);return h===0?{azi1:NaN,s12:NaN}:(T=S*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),E=1+T/16384*(4096+T*(-768+T*(320-175*T))),D=T/1024*(256+T*(-128+T*(74-47*T))),O=D*v*(C+D/4*(y*(-1+2*C*C)-D/6*C*(-3+4*v*v)*(-3+4*C*C))),k=i*(1-a)*E*(b-O),{azi1:Math.atan2(f*g,u*d-l*f*_),s12:k})}function hy(e,t,n,r,i,a){let o=Math.atan((1-a)*Math.tan(e)),s=Math.sin(o),c=Math.cos(o),l=Math.sin(n),u=Math.cos(n),d=Math.atan2(s,c*u),f=c*l,p=1-f*f,m=p*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),h=1+m/16384*(4096+m*(-768+m*(320-175*m))),g=m/1024*(256+m*(-128+m*(74-47*m))),_=r/(i*(1-a)*h),v,y=100,b,x,S,C;do b=Math.cos(2*d+_),x=Math.sin(_),S=Math.cos(_),C=g*x*(b+g/4*(S*(-1+2*b*b)-g/6*b*(-3+4*x*x)*(-3+4*b*b))),v=_,_=r/(i*(1-a)*h)+C;while(Math.abs(_-v)>1e-12&&--y>0);if(y===0)return{lat2:NaN,lon2:NaN};let w=s*x-c*S*u,T=Math.atan2(s*S+c*x*u,(1-a)*Math.sqrt(f*f+w*w)),E=Math.atan2(x*l,c*S-s*x*u),D=a/16*p*(4+a*(4-3*p));return{lat2:T,lon2:t+(E-(1-D)*a*f*(_+D*x*(b+D*S*(-1+2*b*b))))}}function gy(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.f=this.es/(1+Math.sqrt(1-this.es))}function _y(e){var t=e.x,n=e.y,r=Math.sin(e.y),i=Math.cos(e.y),a=Q(t-this.long0,this.over),o,s,c,l,u,d,f,p,m,h,g;return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(e.x=this.x0+this.a*(X-n)*Math.sin(a),e.y=this.y0-this.a*(X-n)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=1e-10?(e.x=this.x0+this.a*(X+n)*Math.sin(a),e.y=this.y0+this.a*(X+n)*Math.cos(a),e):(m=this.sin_p12*r+this.cos_p12*i*Math.cos(a),f=Math.acos(m),p=f?f/Math.sin(f):1,e.x=this.x0+this.a*p*i*Math.sin(a),e.y=this.y0+this.a*p*(this.cos_p12*r-this.sin_p12*i*Math.cos(a)),e):(o=q_(this.es),s=J_(this.es),c=Y_(this.es),l=X_(this.es),Math.abs(this.sin_p12-1)<=1e-10?(u=this.a*K_(o,s,c,l,X),d=this.a*K_(o,s,c,l,n),e.x=this.x0+(u-d)*Math.sin(a),e.y=this.y0-(u-d)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=1e-10?(u=this.a*K_(o,s,c,l,X),d=this.a*K_(o,s,c,l,n),e.x=this.x0+(u+d)*Math.sin(a),e.y=this.y0+(u+d)*Math.cos(a),e):Math.abs(t)<1e-10&&Math.abs(n-this.lat0)<1e-10?(e.x=this.x0,e.y=this.y0,e):(h=my(this.lat0,this.long0,n,t,this.a,this.f),g=h.azi1,e.x=this.x0+h.s12*Math.sin(g),e.y=this.y0+h.s12*Math.cos(g),e))}function vy(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*X*this.a?void 0:(n=t/this.a,r=Math.sin(n),i=Math.cos(n),a=this.long0,Math.abs(t)<=1e-10?o=this.lat0:(o=_v(i*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-X,a=Math.abs(s)<=1e-10?this.lat0>=0?Q(this.long0+Math.atan2(e.x,-e.y),this.over):Q(this.long0-Math.atan2(-e.x,e.y),this.over):Q(this.long0+Math.atan2(e.x*r,t*this.cos_p12*i-e.y*this.sin_p12*r),this.over)),e.x=a,e.y=o,e)):(c=q_(this.es),l=J_(this.es),u=Y_(this.es),d=X_(this.es),Math.abs(this.sin_p12-1)<=1e-10?(f=this.a*K_(c,l,u,d,X),t=Math.sqrt(e.x*e.x+e.y*e.y),p=f-t,o=$_(p/this.a,c,l,u,d),a=Q(this.long0+Math.atan2(e.x,-1*e.y),this.over),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=1e-10?(f=this.a*K_(c,l,u,d,X),t=Math.sqrt(e.x*e.x+e.y*e.y),p=t-f,o=$_(p/this.a,c,l,u,d),a=Q(this.long0+Math.atan2(e.x,e.y),this.over),e.x=a,e.y=o,e):(m=Math.atan2(e.x,e.y),h=Math.sqrt(e.x*e.x+e.y*e.y),g=hy(this.lat0,this.long0,m,h,this.a,this.f),e.x=g.lon2,e.y=g.lat2,e))}var yy={init:gy,forward:_y,inverse:vy,names:[`Azimuthal_Equidistant`,`aeqd`]};function by(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function xy(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=Q(l-(this.long0||0),this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,(o>0||Math.abs(o)<=1e-10)&&(s=(this.x0||0)+this.a*a*n*Math.sin(r),c=(this.y0||0)+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function Sy(e){var t,n,r,i,a,o,s,c,l;return e.x-=this.x0||0,e.y-=this.y0||0,t=Math.sqrt(e.x*e.x+e.y*e.y),n=_v(t/this.a),r=Math.sin(n),i=Math.cos(n),c=this.long0||0,l=this.lat0||0,o=c,Math.abs(t)<=1e-10?(s=l,e.x=o,e.y=s,e):(s=_v(i*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(l)-X,Math.abs(a)<=1e-10?(o=Q(l>=0?c+Math.atan2(e.x,-e.y):c-Math.atan2(-e.x,e.y),this.over),e.x=o,e.y=s,e):(o=Q(c+Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),this.over),e.x=o,e.y=s,e))}var Cy={init:by,forward:xy,inverse:Sy,names:[`ortho`]},wy={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},$={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Ty(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Quadrilateralized Spherical Cube`,this.face=this.lat0>=X-Z/2?wy.TOP:this.lat0<=-(X-Z/2)?wy.BOTTOM:Math.abs(this.long0)<=Z?wy.FRONT:Math.abs(this.long0)<=X+Z?this.long0>0?wy.RIGHT:wy.LEFT:wy.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ey(e){var t={x:0,y:0},n,r,i,a,o,s,c={value:0};if(e.x-=this.long0,n=this.es===0?e.y:Math.atan(this.one_minus_f_squared*Math.tan(e.y)),r=e.x,this.face===wy.TOP)a=X-n,r>=Z&&r<=X+Z?(c.value=$.AREA_0,i=r-X):r>X+Z||r<=-(X+Z)?(c.value=$.AREA_1,i=r>0?r-em:r+em):r>-(X+Z)&&r<=-Z?(c.value=$.AREA_2,i=r+X):(c.value=$.AREA_3,i=r);else if(this.face===wy.BOTTOM)a=X+n,r>=Z&&r<=X+Z?(c.value=$.AREA_0,i=-r+X):r<Z&&r>=-Z?(c.value=$.AREA_1,i=-r):r<-Z&&r>=-(X+Z)?(c.value=$.AREA_2,i=-r-X):(c.value=$.AREA_3,i=r>0?-r+em:-r-em);else{var l,u,d,f,p,m,h;this.face===wy.RIGHT?r=ky(r,+X):this.face===wy.BACK?r=ky(r,+em):this.face===wy.LEFT&&(r=ky(r,-X)),f=Math.sin(n),p=Math.cos(n),m=Math.sin(r),h=Math.cos(r),l=p*h,u=p*m,d=f,this.face===wy.FRONT?(a=Math.acos(l),i=Oy(a,d,u,c)):this.face===wy.RIGHT?(a=Math.acos(u),i=Oy(a,d,-l,c)):this.face===wy.BACK?(a=Math.acos(-l),i=Oy(a,d,-u,c)):this.face===wy.LEFT?(a=Math.acos(-u),i=Oy(a,d,l,c)):(a=i=0,c.value=$.AREA_0)}return s=Math.atan(12/em*(i+Math.acos(Math.sin(i)*Math.cos(Z))-X)),o=Math.sqrt((1-Math.cos(a))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),c.value===$.AREA_1?s+=X:c.value===$.AREA_2?s+=em:c.value===$.AREA_3&&(s+=1.5*em),t.x=o*Math.cos(s),t.y=o*Math.sin(s),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Dy(e){var t={lam:0,phi:0},n,r,i,a,o,s,c,l,u,d={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),n=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?d.value=$.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(d.value=$.AREA_1,n-=X):e.x<0&&-e.x>=Math.abs(e.y)?(d.value=$.AREA_2,n=n<0?n+em:n-em):(d.value=$.AREA_3,n+=X),u=em/12*Math.tan(n),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),s=Math.atan(o),i=Math.cos(n),a=Math.tan(r),c=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(s)))),c<-1?c=-1:c>1&&(c=1),this.face===wy.TOP)l=Math.acos(c),t.phi=X-l,t.lam=d.value===$.AREA_0?s+X:d.value===$.AREA_1?s<0?s+em:s-em:d.value===$.AREA_2?s-X:s;else if(this.face===wy.BOTTOM)l=Math.acos(c),t.phi=l-X,t.lam=d.value===$.AREA_0?-s+X:d.value===$.AREA_1?-s:d.value===$.AREA_2?-s-X:s<0?-s-em:-s+em;else{var f=c,p,m;u=f*f,m=u>=1?0:Math.sqrt(1-u)*Math.sin(s),u+=m*m,p=u>=1?0:Math.sqrt(1-u),d.value===$.AREA_1?(u=p,p=-m,m=u):d.value===$.AREA_2?(p=-p,m=-m):d.value===$.AREA_3&&(u=p,p=m,m=-u),this.face===wy.RIGHT?(u=f,f=-p,p=u):this.face===wy.BACK?(f=-f,p=-p):this.face===wy.LEFT&&(u=f,f=p,p=-u),t.phi=Math.acos(-m)-X,t.lam=Math.atan2(p,f),this.face===wy.RIGHT?t.lam=ky(t.lam,-X):this.face===wy.BACK?t.lam=ky(t.lam,-em):this.face===wy.LEFT&&(t.lam=ky(t.lam,+X))}if(this.es!==0){var h=+(t.phi<0),g=Math.tan(t.phi),_=this.b/Math.sqrt(g*g+this.one_minus_f_squared);t.phi=Math.atan(Math.sqrt(this.a*this.a-_*_)/(this.one_minus_f*_)),h&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function Oy(e,t,n,r){var i;return e<1e-10?(r.value=$.AREA_0,i=0):(i=Math.atan2(t,n),Math.abs(i)<=Z?r.value=$.AREA_0:i>Z&&i<=X+Z?(r.value=$.AREA_1,i-=X):i>X+Z||i<=-(X+Z)?(r.value=$.AREA_2,i=i>=0?i-em:i+em):(r.value=$.AREA_3,i+=X)),i}function ky(e,t){var n=e+t;return n<-3.14159265359?n+=$p:n>3.14159265359&&(n-=$p),n}var Ay={init:Ty,forward:Ey,inverse:Dy,names:[`Quadrilateralized Spherical Cube`,`Quadrilateralized_Spherical_Cube`,`qsc`]},jy=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],My=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,422642e-15],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ny=.8487,Py=1.3523,Fy=Qp/5,Iy=1/Fy,Ly=18,Ry=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},zy=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function By(e,t,n,r){for(var i=t;r;--r){var a=e(i);if(i-=a,Math.abs(a)<n)break}return i}function Vy(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||`Robinson`}function Hy(e){var t=Q(e.x-this.long0,this.over),n=Math.abs(e.y),r=Math.floor(n*Fy);r<0?r=0:r>=Ly&&(r=Ly-1),n=Qp*(n-Iy*r);var i={x:Ry(jy[r],n)*t,y:Ry(My[r],n)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*Ny+this.x0,i.y=i.y*this.a*Py+this.y0,e.z!==void 0&&(i.z=e.z),e.m!==void 0&&(i.m=e.m),i}function Uy(e){var t={x:(e.x-this.x0)/(this.a*Ny),y:Math.abs(e.y-this.y0)/(this.a*Py)};if(t.y>=1)t.x/=jy[Ly][0],t.y=e.y<0?-X:X;else{var n=Math.floor(t.y*Ly);for(n<0?n=0:n>=Ly&&(n=Ly-1);;)if(My[n][0]>t.y)--n;else if(My[n+1][0]<=t.y)++n;else break;var r=My[n],i=5*(t.y-r[0])/(My[n+1][0]-r[0]);i=By(function(e){return(Ry(r,e)-t.y)/zy(r,e)},i,Xp,100),t.x/=Ry(jy[n],i),t.y=(5*n+i)*Zp,e.y<0&&(t.y=-t.y)}return t.x=Q(t.x+this.long0,this.over),e.z!==void 0&&(t.z=e.z),e.m!==void 0&&(t.m=e.m),t}var Wy={init:Vy,forward:Hy,inverse:Uy,names:[`Robinson`,`robin`]};function Gy(){this.name=`geocent`}function Ky(e){return Lh(e,this.es,this.a)}function qy(e){return Rh(e,this.es,this.a,this.b)}var Jy={init:Gy,forward:Ky,inverse:qy,names:[`Geocentric`,`geocentric`,`geocent`,`Geocent`]},Yy={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Xy={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Zy(){if(Object.keys(Xy).forEach(function(e){if(this[e]===void 0)this[e]=Xy[e].def;else if(Xy[e].num&&isNaN(this[e]))throw Error(`Invalid parameter value, must be numeric `+e+` = `+this[e]);else Xy[e].num&&(this[e]=parseFloat(this[e]));Xy[e].degrees&&(this[e]=this[e]*Zp)}.bind(this)),Math.abs(Math.abs(this.lat0)-X)<1e-10?this.mode=this.lat0<0?Yy.S_POLE:Yy.N_POLE:Math.abs(this.lat0)<1e-10?this.mode=Yy.EQUIT:(this.mode=Yy.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw Error(`Invalid height`);this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function Qy(e){e.x-=this.long0;var t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i,a;switch(this.mode){case Yy.OBLIQ:a=this.sinph0*t+this.cosph0*n*r;break;case Yy.EQUIT:a=n*r;break;case Yy.S_POLE:a=-t;break;case Yy.N_POLE:a=t}switch(a=this.pn1/(this.p-a),i=a*n*Math.sin(e.x),this.mode){case Yy.OBLIQ:a*=this.cosph0*t-this.sinph0*n*r;break;case Yy.EQUIT:a*=t;break;case Yy.N_POLE:a*=-(n*r);break;case Yy.S_POLE:a*=n*r}var o=a*this.cg+i*this.sg,s=1/(o*this.sw*this.h1+this.cw);return i=(i*this.cg-a*this.sg)*this.cw*s,a=o*s,e.x=i*this.a,e.y=a*this.a,e}function $y(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},n,r,i=1/(this.pn1-e.y*this.sw);n=this.pn1*e.x*i,r=this.pn1*e.y*this.cw*i,e.x=n*this.cg+r*this.sg,e.y=r*this.cg-n*this.sg;var a=Qg(e.x,e.y);if(Math.abs(a)<1e-10)t.x=0,t.y=e.y;else{var o,s=1-a*a*this.pfact;switch(s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case Yy.OBLIQ:t.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(t.y))*a,e.x*=s*this.cosph0;break;case Yy.EQUIT:t.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case Yy.N_POLE:t.y=Math.asin(o),e.y=-e.y;break;case Yy.S_POLE:t.y=-Math.asin(o)}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var eb={init:Zy,forward:Qy,inverse:$y,names:[`Tilted_Perspective`,`tpers`]};function tb(){if(this.flip_axis=+(this.sweep===`x`),this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw Error();if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape=`ellipse`}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape=`sphere`;this.title||=`Geostationary Satellite View`}function nb(e){var t=e.x,n=e.y,r,i,a,o;if(t-=this.long0,this.shape===`ellipse`){n=Math.atan(this.radius_p2*Math.tan(n));var s=this.radius_p/Qg(this.radius_p*Math.cos(n),Math.sin(n));if(i=s*Math.cos(t)*Math.cos(n),a=s*Math.sin(t)*Math.cos(n),o=s*Math.sin(n),(this.radius_g-i)*i-a*a-o*o*this.radius_p_inv2<0)return e.x=NaN,e.y=NaN,e;r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Qg(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Qg(a,r)))}else this.shape===`sphere`&&(r=Math.cos(n),i=Math.cos(t)*r,a=Math.sin(t)*r,o=Math.sin(n),r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Qg(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Qg(a,r))));return e.x*=this.a,e.y*=this.a,e}function rb(e){var t=-1,n=0,r=0,i,a,o,s;if(e.x/=this.a,e.y/=this.a,this.shape===`ellipse`){this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Qg(1,r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Qg(1,n));var c=r/this.radius_p;if(i=n*n+c*c+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape===`sphere`){if(this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+r*r+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t)}return e.x+=this.long0,e}var ib={init:tb,forward:nb,inverse:rb,names:[`Geostationary Satellite View`,`Geostationary_Satellite`,`geos`]},ab=1.340264,ob=-.081106,sb=893e-6,cb=.003796,lb=Math.sqrt(3)/2;function ub(){this.long0=this.long0===void 0?0:this.long0,this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.es!==0&&(this.apa=dv(this.es),this.qp=iv(this.e,1),this.rqda=Math.sqrt(.5*this.qp))}function db(e){var t=Q(e.x-this.long0,this.over),n=e.y,r=Math.sin(n);this.es!==0&&(r=iv(this.e,r)/this.qp);var i=Math.asin(lb*r),a=i*i,o=a*a*a;return e.x=t*Math.cos(i)/(lb*(ab+3*ob*a+o*(7*sb+9*cb*a))),e.y=i*(ab+ob*a+o*(sb+cb*a)),this.es!==0&&(e.x*=this.rqda,e.y*=this.rqda),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function fb(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,this.es!==0&&(e.x/=this.rqda,e.y/=this.rqda);for(var t=1e-9,n=12,r=e.y,i,a,o,s,c,l=0;l<n&&(i=r*r,a=i*i*i,o=r*(ab+ob*i+a*(sb+cb*i))-e.y,s=ab+3*ob*i+a*(7*sb+9*cb*i),r-=c=o/s,!(Math.abs(c)<t));++l);return i=r*r,a=i*i*i,e.x=lb*e.x*(ab+3*ob*i+a*(7*sb+9*cb*i))/Math.cos(r),e.y=Math.asin(Math.sin(r)/lb),this.es!==0&&(e.y=fv(e.y,this.apa)),e.x=Q(e.x+this.long0,this.over),e}var pb={init:ub,forward:db,inverse:fb,names:[`eqearth`,`Equal Earth`,`Equal_Earth`]},mb=1e-10;function hb(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<mb)throw Error();this.es?(this.en=Ug(this.es),this.m1=Wg(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=_b,this.forward=gb):(this.cphi1=Math.abs(this.phi1)+mb>=X?0:1/Math.tan(this.phi1),this.inverse=yb,this.forward=vb)}function gb(e){var t=Q(e.x-(this.long0||0),this.over),n=e.y,r=this.am1+this.m1-Wg(n,i=Math.sin(n),a=Math.cos(n),this.en),i=a*t/(r*Math.sqrt(1-this.es*i*i)),a;return e.x=r*Math.sin(i),e.y=this.am1-r*Math.cos(i),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function _b(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n=Qg(e.x,e.y=this.am1-e.y),r,i=Kg(this.am1+this.m1-n,this.es,this.en);if((t=Math.abs(i))<X)t=Math.sin(i),r=n*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else if(Math.abs(t-X)<=mb)r=0;else throw Error();return e.x=Q(r+(this.long0||0),this.over),e.y=Q_(i),e}function vb(e){var t=Q(e.x-(this.long0||0),this.over),n=e.y,r,i=this.cphi1+this.phi1-n;return Math.abs(i)>mb?(e.x=i*Math.sin(r=t*Math.cos(n)/i),e.y=this.cphi1-i*Math.cos(r)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function yb(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n,r=Qg(e.x,e.y=this.cphi1-e.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>X)throw Error();return t=Math.abs(Math.abs(n)-X)<=mb?0:r*Math.atan2(e.x,e.y)/Math.cos(n),e.x=Q(t+(this.long0||0),this.over),e.y=Q_(n),e}var bb={init:hb,names:[`bonne`,`Bonne (Werner lat_1=90)`]},xb={OBLIQUE:{forward:Db,inverse:kb},TRANSVERSE:{forward:Ob,inverse:Ab}},Sb={ROTATE:{o_alpha:`oAlpha`,o_lon_c:`oLongC`,o_lat_c:`oLatC`},NEW_POLE:{o_lat_p:`oLatP`,o_lon_p:`oLongP`},NEW_EQUATOR:{o_lon_1:`oLong1`,o_lat_1:`oLat1`,o_lon_2:`oLong2`,o_lat_2:`oLat2`}};function Cb(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||`General Oblique Transformation`,this.isIdentity=rh.includes(this.o_proj),!this.o_proj)throw Error(`Missing parameter: o_proj`);if(this.o_proj===`ob_tran`)throw Error(`Invalid value for o_proj: `+this.o_proj);let e=Fh(this.projStr.replace(`+proj=ob_tran`,``).replace(`+o_proj=`,`+proj=`).trim());if(!e)throw Error(`Invalid parameter: o_proj. Unknown projection `+this.o_proj);e.long0=0,this.obliqueProjection=e;let t,n=Object.keys(Sb),r=e=>{if(this[e]===void 0)return;let t=parseFloat(this[e])*Zp;if(isNaN(t))throw Error(`Invalid value for `+e+`: `+this[e]);return t};for(let e=0;e<n.length;e++){let i=Sb[n[e]],a=Object.entries(i);if(a.some(([e])=>this[e]!==void 0)){t=i;for(let e=0;e<a.length;e++){let[t,n]=a[e],i=r(t);if(i===void 0)throw Error(`Missing parameter: `+t+`.`);this[n]=i}break}}if(!t)throw Error(`No valid parameters provided for ob_tran projection.`);let{lamp:i,phip:a}=Eb(this,t);this.lamp=i,Math.abs(a)>1e-10?(this.cphip=Math.cos(a),this.sphip=Math.sin(a),this.projectionType=xb.OBLIQUE):this.projectionType=xb.TRANSVERSE}function wb(e){return this.projectionType.forward(this,e)}function Tb(e){return this.projectionType.inverse(this,e)}function Eb(e,t){let n,r;if(t===Sb.ROTATE){let t=e.oLongC,i=e.oLatC,a=e.oAlpha;if(Math.abs(Math.abs(i)-X)<=1e-10)throw Error(`Invalid value for o_lat_c: `+e.o_lat_c+` should be < 90°`);r=t+Math.atan2(-1*Math.cos(a),-1*Math.sin(a)*Math.sin(i)),n=Math.asin(Math.cos(i)*Math.sin(a))}else if(t===Sb.NEW_POLE)r=e.oLongP,n=e.oLatP;else{let t=e.oLong1,i=e.oLat1,a=e.oLong2,o=e.oLat2,s=Math.abs(i);if(Math.abs(i)>X-1e-10)throw Error(`Invalid value for o_lat_1: `+e.o_lat_1+` should be < 90°`);if(Math.abs(o)>X-1e-10)throw Error(`Invalid value for o_lat_2: `+e.o_lat_2+` should be < 90°`);if(Math.abs(i-o)<1e-10)throw Error(`Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2`);if(s<1e-10)throw Error(`Invalid value for o_lat_1: o_lat_1 should be different from zero`);r=Math.atan2(Math.cos(i)*Math.sin(o)*Math.cos(t)-Math.sin(i)*Math.cos(o)*Math.cos(a),Math.sin(i)*Math.cos(o)*Math.sin(a)-Math.cos(i)*Math.sin(o)*Math.sin(t)),n=Math.atan(-1*Math.cos(r-t)/Math.tan(i))}return{lamp:r,phip:n}}function Db(e,t){let{x:n,y:r}=t;n=Q(n-e.long0,e.over);let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=Q(Math.atan2(o*Math.sin(n),e.sphip*o*i+e.cphip*a)+e.lamp),t.y=Math.asin(e.sphip*a-e.cphip*o*i);let s=e.obliqueProjection.forward(t);return e.isIdentity&&(s.x*=Qp,s.y*=Qp),s}function Ob(e,t){let{x:n,y:r}=t;n=Q(n-e.long0,e.over);let i=Math.cos(r),a=Math.cos(n);t.x=Q(Math.atan2(i*Math.sin(n),Math.sin(r))+e.lamp),t.y=Math.asin(-1*i*a);let o=e.obliqueProjection.forward(t);return e.isIdentity&&(o.x*=Qp,o.y*=Qp),o}function kb(e,t){e.isIdentity&&(t.x*=Zp,t.y*=Zp);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){n-=e.lamp;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=Math.atan2(o*Math.sin(n),e.sphip*o*i-e.cphip*a),t.y=Math.asin(e.sphip*a+e.cphip*o*i)}return t.x=Q(t.x+e.long0),t}function Ab(e,t){e.isIdentity&&(t.x*=Zp,t.y*=Zp);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){let i=Math.cos(r);n-=e.lamp,t.x=Math.atan2(i*Math.sin(n),-1*Math.sin(r)),t.y=Math.asin(i*Math.cos(n))}return t.x=Q(t.x+e.long0),t}var jb={init:Cb,forward:wb,inverse:Tb,names:[`General Oblique Transformation`,`General_Oblique_Transformation`,`ob_tran`]};function Mb(e){e.Proj.projections.add(Xg),e.Proj.projections.add(c_),e.Proj.projections.add(f_),e.Proj.projections.add(S_),e.Proj.projections.add(D_),e.Proj.projections.add(j_),e.Proj.projections.add(L_),e.Proj.projections.add(V_),e.Proj.projections.add(G_),e.Proj.projections.add(rv),e.Proj.projections.add(gv),e.Proj.projections.add(Sv),e.Proj.projections.add(Ev),e.Proj.projections.add(jv),e.Proj.projections.add(Fv),e.Proj.projections.add(Bv),e.Proj.projections.add(Wv),e.Proj.projections.add(Jv),e.Proj.projections.add($v),e.Proj.projections.add(ty),e.Proj.projections.add(ay),e.Proj.projections.add(ly),e.Proj.projections.add(py),e.Proj.projections.add(yy),e.Proj.projections.add(Cy),e.Proj.projections.add(Ay),e.Proj.projections.add(Wy),e.Proj.projections.add(Jy),e.Proj.projections.add(eb),e.Proj.projections.add(ib),e.Proj.projections.add(pb),e.Proj.projections.add(bb),e.Proj.projections.add(jb)}var Nb=Object.assign(ig,{defaultDatum:`WGS84`,Proj:Fh,WGS84:new Fh(`WGS84`),Point:Ag,toPoint:Yh,defs:Lm,nadgrid:xh,transform:eg,mgrs:pg,version:`__VERSION__`});Mb(Nb);var Pb={id:`sidebar`},Fb={class:`sidebar-header`},Ib={class:`sidebar-body`},Lb={class:`block`},Rb={key:0,class:`hint`,id:`map-info-empty`},zb={id:`map-info`},Bb={class:`map-detail`},Vb={id:`info-name`},Hb={class:`map-detail`},Ub={id:`info-kind`},Wb={class:`map-detail`},Gb={id:`info-data-crs`},Kb={class:`map-detail`},qb={id:`info-extent`},Jb={class:`block`,id:`view-crs-block`},Yb={class:`row`},Xb=[`label`],Zb=[`value`],Qb={key:0,label:`自定义`},$b=[`value`],ex={class:`extent-grid`},tx=[`value`],nx=[`value`],rx=[`value`],ix=[`value`],ax={class:`extent-grid`},ox=[`value`],sx=[`value`],cx=[`value`],lx=[`value`],ux={class:`block`,id:`layer-list-block`},dx={class:`layer-list-title`},fx={key:0,class:`layer-summary`},px={id:`layer-list`},mx={class:`layer-info`},hx=[`title`],gx={class:`layer-meta`},_x={class:`layer-controls`},vx=[`onClick`],yx=[`onClick`],bx=[`title`,`onClick`],xx={class:`layer-info`},Sx=[`title`],Cx={class:`layer-meta`},wx={class:`layer-controls`},Tx=[`onClick`],Ex=[`onClick`],Dx=[`title`,`onClick`],Ox=[`title`,`onClick`],kx={class:`layer-info`},Ax=[`title`],jx={class:`layer-meta`},Mx={class:`layer-controls`},Nx=[`onClick`],Px=[`onClick`],Fx=[`title`,`onClick`],Ix={class:`map-loading-mask`},Lx={class:`dialog`},Rx={class:`dialog-header`},zx={class:`block`},Bx={class:`file-btn`},Vx={class:`file-name`,id:`img-file-name`},Hx={class:`file-btn secondary`},Ux={class:`file-name`,id:`world-file-name`},Wx={class:`extent-grid`},Gx={class:`hint`,id:`zone-hint`},Kx={key:0},qx=[`onClick`],Jx={class:`file-btn`},Yx={class:`file-name`,id:`tiles-dir-name`},Xx={class:`check`},Zx={class:`hint`,id:`tiles-info`},Qx={class:`file-btn`},$x={class:`file-name`,id:`geojson-dir-name`},eS={class:`hint`,id:`geojson-crs-hint`},tS={key:0},nS=[`onClick`],rS={class:`hint`,id:`geojson-info`},iS={class:`zoom-range`},aS=[`label`],oS=[`value`],sS={key:0,label:`自定义`},cS=[`value`],lS={class:`extent-grid`},uS={class:`hint`,id:`url-info`},dS={class:`block`},fS=[`label`],pS=[`value`],mS={key:0,label:`自定义`},hS=[`value`],gS={class:`custom-crs`},_S={class:`row`},vS={id:`statusbar`},yS={id:`status-info`,class:`status-seg`},bS={id:`drop-overlay`},xS=[`data-type`],SS=(0,t.defineComponent)({name:`MapViewVue3`,__name:`map_view_vue3`,props:{theme:{type:String,default:`light`},dataCrs:{type:String,default:`EPSG:3857`},zoom:{type:Number,default:4.2},hidePanels:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},mapBackground:{type:String,default:null},autoLoad:{type:Object,default:null}},emits:[`active-map-changed`,`layer-removed`,`map-removed`,`notify`,`theme-changed`,`view-changed`],setup(e,{expose:n,emit:r}){Zf(Nb);let i=e,a=r,o=(0,t.ref)(!1),s=(0,t.ref)(342),c=(0,t.ref)(0),l=(0,t.ref)(!1),u=(0,t.ref)(!1),d=(0,t.ref)(`raster`),f=(0,t.ref)(`image`),p=(0,t.ref)(!1),m=(0,t.ref)(!1),h=(0,t.ref)(!1),g=(0,t.ref)(!1),_=(0,t.ref)(`☀️`),v=(0,t.ref)(`切换到深色主题`),y=(0,t.ref)(``),b=(0,t.ref)(``),x=(0,t.ref)(`info`),S=(0,t.ref)(!1),C=(0,t.ref)({active:!1,name:``,kind:``,dataCrs:``,extent:`未知`}),w=(0,t.ref)([]),T=(0,t.ref)(!1),E=(0,t.ref)(``),D=(0,t.ref)(0),O=(0,t.ref)(0),k=(0,t.ref)([]),A=(0,t.ref)({dataCrs:[],viewCrs:[],urlExtentCrs:[]}),ee=(0,t.ref)([]),te=(0,t.ref)({minx:``,miny:``,maxx:``,maxy:``}),ne=(0,t.ref)({minx:``,miny:``,maxx:``,maxy:``}),j=(0,t.ref)({dataCrs:i.dataCrs,viewCrs:`EPSG:3857`,urlExtentCrs:i.dataCrs,imgFileName:`未选择文件`,worldFileName:`未选择文件`,zoneHint:{message:``,options:[]},tilesDirName:`未选择目录`,tilesInfo:`支持 QGIS / GDAL 等导出的 z/x/y.png 目录结构。`,tilesTms:!1,geojsonDirName:`未选择目录`,geojsonInfo:`支持按文件名配对的 .geojson 与 .sld。`,geojsonCrsHint:`未选择 GeoJSON。`,geojsonCrsOptions:[],urlTemplate:``,urlInfo:``,urlMinzoom:``,urlMaxzoom:``,customEpsg:``}),re=null,ie=null,M=null,ae=null,oe=null,se=null,ce=null,N=null,le=null,ue=null,de=null,P=null,fe=null,pe=null,F=null,he=null,ge=null,_e=null,ve=null,ye=null,xe=(0,t.ref)(null),Se=(0,t.ref)(null),Ce=(0,t.ref)(null);(0,t.ref)(null);let we=(0,t.ref)(null),Te=(0,t.ref)(null),Ee=(0,t.ref)(null),De=(0,t.ref)(null),Oe=(0,t.ref)(null),ke=(0,t.ref)(null),Ae=(0,t.ref)(null),je=(0,t.ref)(null),I=(0,t.ref)(null),Me=(0,t.ref)(null);(0,t.ref)(null);let Ne=(0,t.ref)(null),Pe=(0,t.ref)(null),Fe=(0,t.ref)(null),L=(0,t.ref)(null),Ie=(0,t.ref)(null),Le=(0,t.ref)(null);(0,t.ref)(null);let Re=(0,t.ref)(null),ze=(0,t.ref)(null),Be=(0,t.ref)(null),Ve=(0,t.ref)(null),He=(0,t.ref)(null),Ue=(0,t.ref)(null),R=(0,t.computed)(()=>{let e=e=>e==null||e===``?null:typeof e==`number`?e+`px`:String(e),t={},n=e(i.width),r=e(i.height);return n&&(t.width=n),r&&(t.height=r),t[`--sidebar-width`]=s.value+`px`,i.mapBackground&&(t[`--map-bg`]=i.mapBackground),t}),We=(0,t.computed)(()=>c.value>0||l.value);function Ge(){if(o.value)return;P=null,ye=new AbortController,ae=new mt({code:`PIXEL`,units:`pixels`}),yn(ae),re=[],it(`常用`,[{code:`EPSG:3857`,name:`EPSG:3857 · WGS84 伪墨卡托(网络地图)`},{code:`EPSG:4326`,name:`EPSG:4326 · WGS84 经纬度`},{code:`EPSG:4490`,name:`EPSG:4490 · CGCS2000 经纬度(2000国家大地坐标系)`,def:`+proj=longlat +ellps=GRS80 +no_defs`},{code:`PIXEL`,name:`像素坐标(未配准图片)`,pixel:!0}]);let e=[],t=[],n=[],r=[];for(let t=25;t<=45;t++){let n=t*3;e.push({code:`EPSG:${4513+t-25}`,name:`EPSG:${4513+t-25} · CGCS2000 3度带 ${t}(CM ${n}°E)`,def:rt(n,5e5+t*1e6),geoBox:[n-1.5,16,n+1.5,56]})}for(let e=13;e<=23;e++){let t=e*6-3;n.push({code:`EPSG:${4491+e-13}`,name:`EPSG:${4491+e-13} · CGCS2000 6度带 ${e}(CM ${t}°E)`,def:rt(t,5e5+e*1e6),geoBox:[t-3,16,t+3,56]})}it(`CGCS2000 3度带(含带号)`,e),it(`CGCS2000 3度带(中央经线)`,t),it(`CGCS2000 6度带(含带号)`,n),it(`CGCS2000 6度带(中央经线)`,r);let s=[],c=[];for(let e=1;e<=60;e++){let t=6*e-183;s.push({code:`EPSG:${32600+e}`,name:`EPSG:${32600+e} · WGS84 / UTM ${e}N(CM ${t}°E)`,def:`+proj=utm +zone=${e} +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs`,geoBox:[t-3,-80,t+3,84]}),c.push({code:`EPSG:${32700+e}`,name:`EPSG:${32700+e} · WGS84 / UTM ${e}S(CM ${t}°E)`,def:`+proj=utm +zone=${e} +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs`,geoBox:[t-3,-80,t+3,84]})}it(`UTM 北半球`,s),it(`UTM 南半球`,c),_e=new Map;for(let e of re)for(let t of e.items)_e.set(t.code,t);le=[],P=new Md({target:`map`,layers:[],view:new du({projection:j.value.viewCrs,center:Dn([108.5,36.5],j.value.viewCrs),zoom:i.zoom}),controls:[new zu({zoomInTipLabel:`放大`,zoomOutTipLabel:`缩小`}),new kp({tipLabel:`全屏`}),new Vp({units:`metric`,target:Le.value}),new Lp({coordinateFormat:e=>j.valueatCoord(e),undefinedHTML:`—`,target:Ie.value}),nt()]}),lt(),P.on(`moveend`,()=>{dt(),a(`view-changed`,tr())}),P.on(`loadstart`,()=>{l.value=!0}),P.on(`loadend`,()=>{l.value=!1}),ve=null,fe=[],N=null,ue=0,M={image:`图片`,tiles:`本地切片XYZ`,xyz:`在线切片XYZ`,geojson:`GeoJSON / SLD`},se=/(\d+)[\\/](\d+)[\\/](\d+)\.(png|jpe?g|webp)$/i,F=null,ge=null,he=null,ce=[`#3f8cff`,`#39c26d`,`#e8b339`,`#e8718d`,`#9b6fd8`,`#31b8b5`,`#f28f3b`,`#729b6f`],ie=/\.(geojson|json)$/i,oe=/\.(sld|xml)$/i,pe=null,de=0,f.value=`image`,I.value.addEventListener(`change`,()=>{let e=I.value.files&&I.value.files[0];e&&sn(e)}),Ue.value.addEventListener(`change`,async()=>{let e=Ue.value.files&&Ue.value.files[0];if(e)try{ge={text:await e.text(),name:e.name},j.value.worldFileName=e.name,on()}catch{z(`世界文件读取失败`,`err`)}}),Re.value.addEventListener(`change`,()=>dn(Re.value.files)),je.value.addEventListener(`change`,()=>Wn(je.value.files)),mr(i.theme),[`dragenter`,`dragover`].forEach(e=>document.addEventListener(e,e=>{e.preventDefault(),e.dataTransfer&&[...e.dataTransfer.types].includes(`Files`)&&(u.value=!0)},{signal:ye.signal})),document.addEventListener(`dragleave`,e=>{e.relatedTarget||(u.value=!1)},{signal:ye.signal}),document.addEventListener(`drop`,async e=>{e.preventDefault(),u.value=!1;let t=await gr(e.dataTransfer);if(!t.length)return;if(t.some(e=>ie.test(e.name)||oe.test(e.name))){Wn(t),Xn(`geojson`),await Gn();return}let n=t.find(e=>/\.(png|jpe?g|webp)$/i.test(e.name));if(!n){z(`请拖放图片或 GeoJSON/SLD`,`warn`);return}let r=t.find(e=>/\.(pgw|pwg|jgw|gfw|wld|pngw|jpgw)$/i.test(e.name));if(await sn(n),r)try{ge={text:await r.text(),name:r.name},j.value.worldFileName=r.name,on()}catch{}Xn(`image`),z(`图片已就绪,点击“加载到地图”`,`ok`)},{signal:ye.signal}),ot(),j.value.viewCrs=`EPSG:3857`,(async()=>{let e=new URLSearchParams(location.search),t=_r(e.get(`epsg`));t&&st(t)&&(j.value.dataCrs=t);let n=e.get(`xyz`),r=e.get(`img`);if(n){j.value.urlTemplate=n,e.get(`minzoom`)&&(j.value.urlMinzoom=e.get(`minzoom`)),e.get(`maxzoom`)&&(j.value.urlMaxzoom=e.get(`maxzoom`));let t=(e.get(`extent`)||``).split(`,`).map(e=>parseFloat(e.trim()));t.length===4&&t.every(Number.isFinite)&&(Ve.value.value=t[0],He.value.value=t[1],ze.value.value=t[2],Be.value.value=t[3]);let r=_r(e.get(`extentepsg`));r&&(j.value.urlExtentCrs=r),Xn(`url`),gn()}else if(r){Xn(`image`);let t=null,n=e.get(`worldfile`);if(n)try{let e=await fetch(n);e.ok&&(t=await e.text())}catch{}let i=null,a=e.get(`extent`);if(a){let e=a.split(`,`).map(Number);e.length===4&&e.every(isFinite)&&(i=e)}await un({url:r,name:decodeURIComponent(r.split(`/`).pop()||`图片`),worldText:t,extent:i})}})(),dt(),mn(),o.value=!0}function Ke(){c.value+=1}function qe(){c.value=Math.max(0,c.value-1)}function Je(e){e.preventDefault();let t=e.clientX,n=s.value,r=e=>{s.value=Math.min(620,Math.max(280,n+(e.clientX-t)))},i=()=>{window.removeEventListener(`mousemove`,r),window.removeEventListener(`mouseup`,i),document.body.style.cursor=``,document.body.style.userSelect=``};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,window.addEventListener(`mousemove`,r),window.addEventListener(`mouseup`,i)}function Ye(){Me.value.classList.add(`sidebar-collapsed`)}function Xe(){Me.value.classList.remove(`sidebar-collapsed`)}function Ze(){Me.value.classList.add(`panel-right-collapsed`)}function Qe(){Me.value.classList.remove(`panel-right-collapsed`)}function $e(){mr(Me.value.classList.contains(`light-theme`)?`dark`:`light`)}async function et(){let e=fe.length;f.value===`image`?await ln():f.value===`tiles`?pn():f.value===`geojson`?await dr():await gn(),fe.length>e&&er()}function tt(){ye&&=(ye.abort(),null),P&&=(P.setTarget(null),null),o.value=!1}function nt(){let e=document.createElement(`button`);e.innerHTML=`⤢`,e.title=`复位视图`;let t=document.createElement(`div`);return t.className=`ol-fit-all ol-control`,t.appendChild(e),e.addEventListener(`click`,()=>Bt()),new Iu({element:t})}function rt(e,t){return`+proj=tmerc +lat_0=0 +lon_0=${e} +k=1 +x_0=${t} +y_0=0 +ellps=GRS80 +units=m +no_defs`}function it(e,t){re.push({label:e,items:t})}function at(e){return{groups:re.map(t=>({label:t.label,items:t.items.filter(t=>e||!t.pixel)})).filter(e=>e.items.length),custom:le.map(e=>({code:e.code,name:`${e.code} · 自定义`}))}}function ot(){let e=at(!0),t=at(!1);A.value.dataCrs=e.groups,A.value.viewCrs=t.groups,A.value.urlExtentCrs=t.groups,ee.value=e.custom,j.value.urlExtentCrs||(j.value.urlExtentCrs=`EPSG:3857`)}function st(e){if(!e)return null;if(e===`PIXEL`)return ae;let t=B(e);if(t)return t;let n=_e.get(e)||le.find(t=>t.code===e);if(!n||!n.def)return null;if(Nb.defs(e,n.def),Zf(Nb),t=B(e),t&&n.geoBox&&!t.getExtent())try{let r=Pn(n.geoBox,`EPSG:4326`,e);r.every(isFinite)&&t.setExtent(r)}catch{}return t}function ct(e){let t=P.getView();if(!t||!e)return``;let n=t.getProjection(),r=n.getUnits()===`degrees`,i=e.map(e=>r?e.toFixed(6):e.toFixed(2)).join(`, `);if(n.getCode()===`PIXEL`)return`${i} px`;try{let t=On(e,n);return!isFinite(t[0])||!isFinite(t[1])?i:`${i} | ${t[0].toFixed(6)}, ${t[1].toFixed(6)}°`}catch{return i}}function lt(){P.getView().on(`change:resolution`,()=>dt())}function ut(e){return isFinite(e)?e>=1e3?e.toFixed(0):e>=1?e.toPrecision(4):e.toExponential(1):`-`}function dt(){let e=P&&P.getView();if(!e)return;let t=e.getZoom(),n=e.getResolution(),r=e.getProjection(),i=r.getUnits()===`degrees`?`°/px`:r.getCode()===`PIXEL`?`px`:`m/px`;y.value=`${r.getCode()} · 级别 ${t==null?`-`:t.toFixed(1)} · 分辨率 ${ut(n)} ${i}`,pt(),ft()}function ft(){let e=P&&P.getView(),t=e?e.getProjection():null;if(!N||!N.extent||!t){te.value={minx:``,miny:``,maxx:``,maxy:``};return}let n=N.extent;if(N.projection.getCode()!==t.getCode()){try{n=Pn(n,N.projection,t)}catch{n=null}if(!n||!n.every(isFinite)){te.value={minx:``,miny:``,maxx:``,maxy:``};return}}te.value={minx:ht(n[0]),miny:ht(n[1]),maxx:ht(n[2]),maxy:ht(n[3])}}function pt(){let e=P&&P.getView(),t=P&&P.getSize();if(!e||!t||!N||e.getResolution()==null){ne.value={minx:``,miny:``,maxx:``,maxy:``};return}let n=e.calculateExtent(t);!n||!n.every(isFinite)?ne.value={minx:``,miny:``,maxx:``,maxy:``}:ne.value={minx:ht(n[0]),miny:ht(n[1]),maxx:ht(n[2]),maxy:ht(n[3])}}function ht(e){return isFinite(e)?String(+(Math.abs(e)>=1e3?e.toFixed(2):e.toFixed(6))):``}function z(e,t=`info`){b.value=e,x.value=t,S.value=!0,clearTimeout(ve),ve=setTimeout(()=>{S.value=!1},3200)}function gt(e){return{image:`🖼️`,tiles:`🧩`,xyz:`🌐`,geojson:`🌍`}[e]||`🗺️`}function _t(e){Lt(e),N===e&&Vt(e.extent,e.projection)}function vt(){w.value=fe.map(e=>({id:e.id,entry:e,active:e===N,icon:gt(e.kind),name:e.name,meta:`${e.projection.getCode()} · ${e.viewProjectionCode}`}))}function yt(){if(Ct(),!N){C.value.active=!1;return}let e=N,t=e.projection.getCode();C.value={active:!0,name:e.name,kind:`${gt(e.kind)} ${M[e.kind]||`地图`}`,dataCrs:e.sourceCrs&&e.sourceCrs!==t?`${t}(源:${e.sourceCrs})`:t,extent:e.extent?`X ${Jt(e.extent[0])} ~ ${Jt(e.extent[2])};Y ${Jt(e.extent[1])} ~ ${Jt(e.extent[3])}`:`未知`}}function bt(e){for(let t of e){let e=t.get(`layer`),n=typeof e==`string`?e.trim():``;if(n)return n}return null}function xt(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!r.group){t.push({type:`layer`,sublayer:r}),n+=1;continue}let i=n,a=[];for(;n<e.length&&e[n].group===r.group;)a.push(e[n]),n+=1;t.push({type:`group`,key:`${i}:${r.group}`,name:r.group,children:a})}return t}function St(e){return e.visible&&e.groupVisible!==!1}function Ct(){if(N&&N.kind===`image`){E.value=`PNG 格式地图无可操作图层`,T.value=!0,k.value=[],D.value=0,O.value=0;return}E.value=``;let e=N&&N.sublayers?N.sublayers:[];D.value=e.length,O.value=e.reduce((e,t)=>e+(Number.isFinite(t.featureCount)?t.featureCount:0),0);let t=!!e.length;if(T.value=t,!t){k.value=[];return}let n=xt(N.sublayers).reverse();k.value=n.map((e,t)=>{if(e.type===`layer`){let n=e.sublayer,r=St(n);return{type:`layer`,key:`layer-${t}`,name:n.name,meta:`${gt(n.kind)} ${M[n.kind]||`图层`}${Number.isFinite(n.featureCount)?` · ${n.featureCount} 要素`:``}`,visible:r,sublayer:n}}let n=e.children.map((e,n)=>({key:`child-${t}-${n}`,name:e.name,meta:`${gt(e.kind)} ${M[e.kind]||`图层`}${Number.isFinite(e.featureCount)?` · ${e.featureCount} 要素`:``}`,visible:St(e),sublayer:e}));return{type:`group`,key:`group-${e.key}-${t}`,name:e.name,collapsed:!N.expandedLayerGroups.has(e.key),visible:n.every(e=>e.sublayer.groupVisible!==!1),group:e,children:n}})}function wt(e){let t=e.sublayer;e.visible?(t.visible=!1,t.layer.setVisible(!1)):(t.visible=!0,t.layer.setVisible(!0)),Ct()}function Tt(e){e.collapsed?N.expandedLayerGroups.add(e.group.key):N.expandedLayerGroups.delete(e.group.key),Ct()}function Et(e){let t=!e.visible;e.children.forEach(e=>{e.sublayer.groupVisible=t,e.sublayer.layer.setVisible(t&&e.sublayer.visible)}),Ct()}function Dt(e,t){let n=t.sublayer;t.visible?(n.visible=!1,n.layer.setVisible(!1)):(n.visible=!0,e.children.forEach(e=>{e.sublayer.groupVisible=!0,e.sublayer.layer.setVisible(e.sublayer.visible)})),Ct()}function Ot(e){if(!e||e.kind!==`geojson`)return null;try{let t=e.source||e.layer.getSource(),n=t&&typeof t.getExtent==`function`?t.getExtent():null;if(Array.isArray(n)&&n.every(isFinite)&&n[2]>n[0]&&n[3]>n[1])return n.slice()}catch{}return null}function kt(e){let t=N,n=e&&e.sublayer;if(!t||!n)return;let r=Ot(n);r?Vt(r,P.getView().getProjection()):Array.isArray(t.extent)&&t.extent.every(isFinite)&&t.extent[2]>t.extent[0]&&t.extent[3]>t.extent[1]?Vt(t.extent,t.projection):z(`该图层暂无有效范围`,`warn`)}function At(e){let t=N;if(!t||!e||!Array.isArray(e.children)||!e.children.length)return;let n=me(),r=!1;e.children.forEach(e=>{let t=Ot(e.sublayer);t&&(be(n,t),r=!0)}),r&&n.every(isFinite)&&n[2]>n[0]&&n[3]>n[1]?Vt(n,P.getView().getProjection()):Vt(t.extent,t.projection)}function jt(e){let t=N;if(!t||!e)return!1;let n=t.sublayers.indexOf(e);if(n<0)return!1;if(t.sublayers.splice(n,1),Array.isArray(t.sources)){let n=t.sources.indexOf(e.source);n>=0&&t.sources.splice(n,1)}if(t.layer&&typeof t.layer.getLayers==`function`){t.layer.getLayers().remove(e.layer);try{e.layer.dispose()}catch{}}return!0}function Mt(e){let t=N;t&&!t.sublayers.length?(zt(t),e&&z(e,`ok`)):(vt(),yt(),e&&z(e,`ok`))}function Nt(e){let t=e&&e.sublayer;t&&jt(t)&&(a(`layer-removed`,{isGroup:!1,name:t.name,layerCount:null,group:t.group}),console.log(`row`,e),Mt(`已删除图层:`+t.name))}function Pt(e){if(!e||!Array.isArray(e.children)||!e.children.length)return;let t=e.children.length;e.children.forEach(e=>jt(e.sublayer)),console.log(`row`,e),a(`layer-removed`,{isGroup:!0,name:e.name,layerCount:t,group:null}),Mt(`已删除图层组(`+t+` 个图层)`)}function Ft(e){Array.isArray(e.sublayers)||(e.sublayers=[{name:e.name,kind:e.kind,layer:e.layer,visible:!0}]);for(let t of e.sublayers)t.name=t.name||e.name,t.kind=t.kind||e.kind,t.group=t.group||null,t.groupVisible=!t.group||t.groupVisible!==!1,t.visible=t.visible!==!1,t.layer.setVisible(St(t)),t.layer.set(`title`,t.name);return e.sublayers}function It(){if(!N)return;let e=P.getView();N.viewState={center:e.getCenter(),resolution:e.getResolution()},N.viewProjectionCode=e.getProjection().getCode()}function Lt(e){if(!e||e===N)return;It(),N&&P.removeLayer(N.layer),N=e,P.addLayer(e.layer);let t=st(e.viewProjectionCode)||e.projection,n=e.viewState;n&&n.center&&n.center.every(isFinite)?Wt(t,{center:n.center,resolution:n.resolution}):(Wt(t),Vt(e.extent,e.projection)),vt(),dt(),yt(),a(`active-map-changed`,{id:e.id,name:e.name,kind:e.kind})}function Rt(e){e.id=++ue,e.expandedLayerGroups=new Set,e.sublayers=Ft(e),e.layer.set(`title`,e.name),e.viewProjectionCode=e.projection.getCode(),e.viewState=null,fe.unshift(e),Lt(e)}function zt(e){let t=fe.indexOf(e);t>=0&&fe.splice(t,1),N===e?(P.removeLayer(e.layer),N=null,fe.length?Lt(fe[0]):(vt(),yt(),dt())):vt();try{e.cleanup&&e.cleanup()}catch{}a(`map-removed`,{id:e.id,name:e.name,kind:e.kind})}function Bt(){N?Vt(N.extent,N.projection):z(`暂无地图`,`warn`)}function Vt(e,t){let n=P.getView(),r=n.getProjection(),i=e;if(t&&t.getCode()!==r.getCode()){try{i=Pn(e,t,r)}catch{i=null}if(!i||!i.every(isFinite)){z(`无法将数据范围转换到当前视图坐标系`,`warn`);return}}!i||i[2]<=i[0]||i[3]<=i[1]||n.fit(i,{padding:[60,60,60,60],maxZoom:28,duration:300})}function Ht(){j.value.viewCrs=P.getView().getProjection().getCode()}function Ut(e){let t=P.getView(),n=t.getProjection(),r=t.getCenter(),i=t.getResolution(),a=null,o=null;try{a=Nn(r,n,e);let t=xn(n,1,r,`m`),s=xn(e,1,a,`m`);a.every(isFinite)&&[t,s].every(isFinite)&&s>0?o=i*t/s:a=null}catch{a=null}return{center:a,resolution:o}}function Wt(e,{center:t,resolution:n}={}){let r=new du({projection:e});if(P.setView(r),t&&t.every(isFinite))r.setCenter(t);else{let t=e.getExtent();t?r.setCenter([(t[0]+t[2])/2,(t[1]+t[3])/2]):r.setCenter([0,0])}if(n&&isFinite(n)&&n>0)try{r.setResolution(n)}catch{}lt(),Ht(),N&&Array.isArray(N.sources)&&N.sources.forEach(e=>e.refresh()),dt()}function Gt(e){let t=e.getExtent();if(!t||!t.every(isFinite))try{t=Pn([-180,-90,180,90],`EPSG:4326`,e)}catch{t=[-1,-1,1,1]}let n=t[2]-t[0],r=t[3]-t[1],i=Math.max(n,r),a=(t[0]+t[2])/2,o=(t[1]+t[3])/2;return[a-i/2,o-i/2,a+i/2,o+i/2]}function Kt(e,t,n=0,r=null){let i=Gt(e),a=(i[2]-i[0])/256,o=[];for(let e=0;e<=t;e++)o.push(a/2**e);return new Nf({extent:r||i,origin:[i[0],i[3]],resolutions:o,tileSize:[256,256],minZoom:n,maxZoom:t})}function qt(e,t){let n=e.getResolution(t.minZ),[r,i]=e.getOrigin(t.minZ);return[r+t.x0*256*n,i-(t.y1+1)*256*n,r+(t.x1+1)*256*n,i-t.y0*256*n]}function Jt(e){return isFinite(e)?Math.abs(e)>=1e3?Math.round(e).toLocaleString(`zh-CN`):String(+e.toFixed(6)):`-`}function Yt(e){return`X ${Jt(e[0])} ~ ${Jt(e[2])};Y ${Jt(e[1])} ~ ${Jt(e[3])}`}function Xt(e,t){let n=st(t);if(!n||n.getCode()===`PIXEL`)return null;let r=Qt(e);return r?qt(Kt(n,r.maxZ,r.minZ),r):null}function Zt(e,t){let n=new Map;for(let r of e){let e=(r.webkitRelativePath||r.name).match(se);if(!e)continue;let i=+e[1],a=+e[2],o=+e[3];t&&(o=(1<<i)-1-o),n.set(`${i}/${a}/${o}`,r)}return n}function Qt(e){if(!e.size)return null;let t=1/0,n=-1/0,r=new Map;for(let i of e.keys()){let[e,a,o]=i.split(`/`).map(Number);e<t&&(t=e),e>n&&(n=e);let s=r.get(e);s||(s={x0:1/0,x1:-1/0,y0:1/0,y1:-1/0},r.set(e,s)),s.x0=Math.min(s.x0,a),s.x1=Math.max(s.x1,a),s.y0=Math.min(s.y0,o),s.y1=Math.max(s.y1,o)}return{minZ:t,maxZ:n,...r.get(t),ranges:r}}function $t(e,t,n,r){let i=parseInt(e,10);return Number.isFinite(i)?Math.min(n,Math.max(t,i)):r}function en(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>n(Error(`图片加载失败`)),r.src=e})}function tn(e){let t=e.trim().split(/\r?\n/).map(e=>parseFloat(e.trim()));if(t.length<6||t.slice(0,6).some(e=>!isFinite(e)))throw Error(`世界文件格式无法解析`);return t.slice(0,6)}function nn(e,t,n){let[r,i,a,o,s,c]=n;if(i||a)throw Error(`不支持带旋转的世界文件`);return[s-r/2,c+(t-.5)*o,s+(e-.5)*r,c-o/2]}function rn(e){if(!e)return null;let t=e[2];if(t<=1e6||t>=7e7)return null;let n=Math.round(t/1e6),r=[];return n>=25&&n<=45&&r.push({code:`EPSG:${4513+n-25}`,label:`3度带 ${n},中央经线 ${n*3}°E(EPSG:${4513+n-25},含带号)`}),n>=13&&n<=23&&r.push({code:`EPSG:${4491+n-13}`,label:`6度带 ${n},中央经线 ${n*6-3}°E(EPSG:${4491+n-13},含带号)`}),r.length?(j.value.zoneHint={message:`检测到高斯带号坐标,可能是:`,options:r},r[0].code):null}function an(e){if(j.value.zoneHint={message:``,options:[]},!e)return;let t=rn(e);t&&(j.value.dataCrs=t)}function on(){if(F&&F.width&&ge)try{let e=tn(ge.text),t=nn(F.width,F.height,e);ke.value.value=t[0],Ae.value.value=t[1],De.value.value=t[2],Oe.value.value=t[3],an(t),z(`已根据世界文件计算显示范围`,`ok`)}catch(e){z(`世界文件解析失败:${e.message}`,`err`)}}async function sn(e){F&&F.objectUrl&&URL.revokeObjectURL(F.objectUrl);let t=URL.createObjectURL(e);F={file:e,objectUrl:t,name:e.name,width:null,height:null},j.value.imgFileName=e.name,ke.value.value=Ae.value.value=De.value.value=Oe.value.value=``,an(null);try{let e=await en(t);F.width=e.width,F.height=e.height,on()}catch{z(`图片无法读取`,`err`)}}function cn(){let e=[ke.value,Ae.value,De.value,Oe.value].map(e=>e.value.trim());if(e.some(e=>e===``))return z(`请填写完整的四至范围:X/Y 的最小值和最大值`,`warn`),{ok:!1,extent:null};let t=e.map(Number);return t.some(e=>!isFinite(e))?(z(`范围数值无效`,`warn`),{ok:!1,extent:null}):t[2]>t[0]&&t[3]>t[1]?{ok:!0,extent:t}:(z(`范围无效:需要 X最大 > X最小 且 Y最大 > Y最小`,`warn`),{ok:!1,extent:null})}async function ln(){Ke();try{if(!F){z(`请先选择图片文件`,`warn`);return}let e=st(j.value.dataCrs);if(!e){z(`请先选择或注册有效的坐标系`,`warn`);return}let{width:t,height:n}=F;if(!t||!n)try{let e=await en(F.objectUrl);t=F.width=e.width,n=F.height=e.height}catch{z(`无法读取图片尺寸`,`err`);return}let r=cn();if(!r.ok)return;let i=r.extent,a=URL.createObjectURL(F.file),o=new uf({source:new $f({url:a,imageExtent:i,projection:e})});Rt({name:F.name,kind:`image`,layer:o,extent:i,projection:e,cleanup(){URL.revokeObjectURL(a)}})}finally{qe()}}async function un({url:e,name:t,worldText:n,extent:r,crs:i=null}){Ke();try{let a;try{a=await en(e)}catch{z(`无法加载图片:${e}`,`err`);return}if(n)try{let e=tn(n);r=nn(a.width,a.height,e)}catch(e){z(`世界文件解析失败:${e.message}`,`err`)}r||=[0,-a.height,a.width,0],an(r);let o=i||rn(r)||`EPSG:3857`;j.value.dataCrs=o;let s=st(o)||ae,c=new uf({source:new $f({url:e,imageExtent:r,projection:s})});ke.value.value=r[0],Ae.value.value=r[1],De.value.value=r[2],Oe.value.value=r[3],Rt({name:t,kind:`image`,layer:c,extent:r,projection:s,cleanup(){}})}finally{qe()}}function dn(e){let t=Array.from(e||[]);if(!t.length)return;let n=(t[0].webkitRelativePath||``).split(/[\\/]/)[0]||`本地切片XYZ目录`;he={name:n,files:t},j.value.tilesDirName=`${n}(${t.length} 个文件)`,fn()}function fn(){if(!he)return;let e=Zt(he.files,j.value.tilesTms),t=Qt(e);if(!t){j.value.tilesInfo=`未识别到本地切片XYZ(需要 z/x/y.png 目录结构)`;return}let n=Xt(e,j.value.dataCrs);j.value.tilesInfo=n?`已识别 ${e.size} 张切片,层级 ${t.minZ}–${t.maxZ}。显示范围(${j.value.dataCrs}):${Yt(n)}`:`已识别 ${e.size} 张切片,层级 ${t.minZ}–${t.maxZ}。`}function pn(){Ke();try{if(!he||!he.files.length){z(`请先选择本地切片XYZ目录`,`warn`);return}let e=st(j.value.dataCrs);if(!e){z(`请先选择或注册有效的坐标系`,`warn`);return}let t=Zt(he.files,j.value.tilesTms);if(!t.size){z(`所选目录中未找到 z/x/y 结构的切片文件`,`err`);return}let n=Qt(t),r=qt(Kt(e,n.maxZ,n.minZ),n),i=Kt(e,n.maxZ,n.minZ,r),a=new Map,o=new Xf({projection:e,tileGrid:i,wrapX:!1,minZoom:n.minZ,maxZoom:n.maxZ,tileUrlFunction:([e,n,r])=>{let i=t.get(`${e}/${n}/${r}`);if(!i)return;let o=a.get(i);return o||(o=URL.createObjectURL(i),a.set(i,o)),o}});Rt({name:he.name,kind:`tiles`,layer:new _f({source:o}),extent:r,projection:e,cleanup(){a.forEach(e=>URL.revokeObjectURL(e))}})}finally{qe()}}function mn(){let e=String(j.value.urlTemplate||``).trim();j.value.urlInfo=``,e&&(/^https?:\/\//i.test(e)?/\{z\}/.test(e)&&/\{x\}/.test(e)&&/(\{y\}|\{-y\})/.test(e)||(j.value.urlInfo=`模板需包含 {z}、{x} 和 {y}(或 {-y})。`):j.value.urlInfo=`URL 模板需以 http:// 或 https:// 开头。`)}async function hn(e,t,n,r,i=null){if(!e||!/^https?:\/\//i.test(e))return{error:`URL 模板需以 http:// 或 https:// 开头`};if(!/\{z\}/.test(e)||!/\{x\}/.test(e)||!/(\{y\}|\{-y\})/.test(e))return{error:`模板需包含 {z}、{x} 和 {y}(或 {-y})`};let a=st(t);if(!a)return{error:`请先选择或注册有效的坐标系`};let o=null;if(i){let e=st(i.crs);if(!e)return{error:`范围坐标系无效`};let t=i.extent;if(!t||!t.every(Number.isFinite))return{error:`范围数值无效`};if(t[0]>=t[2]||t[1]>=t[3])return{error:`范围需满足:X最小 < X最大,Y最小 < Y最大`};try{o=Pn(t,e,a)}catch{return{error:`范围坐标系换算失败`}}if(!o||!o.every(Number.isFinite))return{error:`范围坐标系换算失败`}}let s=r??$t(j.value.urlMaxzoom,0,24,22),c=n??$t(j.value.urlMinzoom,0,24,0),l={projection:a,tileGrid:Kt(a,Math.max(s,c),c,o),minZoom:c,maxZoom:s,url:e};return o&&(l.wrapX=!1),{entry:{name:`在线切片XYZ · ${e.length>28?e.slice(0,28)+`…`:e}`,kind:`xyz`,layer:new _f({source:new Xf(l)}),extent:o,projection:a,cleanup(){}}}}async function gn(){Ke();try{let e=String(j.value.urlTemplate||``).trim();if(!e){z(`请填写在线切片XYZ URL 模板`,`warn`);return}if(String(j.value.urlMinzoom||``).trim()===``){z(`请填写最小层级`,`warn`);return}if(String(j.value.urlMaxzoom||``).trim()===``){z(`请填写最大层级`,`warn`);return}let t=[Ve.value.value,He.value.value,ze.value.value,Be.value.value];if(t.some(e=>e.trim()===``)){z(`请填写完整的范围:X/Y 的最小值和最大值`,`warn`);return}let n=t.map(Number);if(!n.every(Number.isFinite)){z(`范围数值无效`,`warn`);return}let r={extent:n,crs:j.value.urlExtentCrs},i=await hn(e,j.value.dataCrs,null,null,r);if(!i.entry){z(i.error||`加载失败`,`warn`);return}j.value.urlInfo=`使用指定范围加载,已自动定位。`,Rt(i.entry)}finally{qe()}}function _n(e){let t=0,n=String(e||`vector`);for(let e=0;e<n.length;e++)t=t*31+n.charCodeAt(e)>>>0;return ce[t%ce.length]}function vn(e,t){return Array.from(e.getElementsByTagName(`*`)).filter(e=>e.localName===t)}function bn(e){let t=new Map,n=[...vn(e,`SvgParameter`),...vn(e,`CssParameter`)];for(let e of n){let n=e.getAttribute(`name`);n&&t.set(n.toLowerCase(),(e.textContent||``).trim())}return t}function Sn(e,t=`stroke`){let n=e.get(t);if(n)return new $o({color:n,width:Number(e.get(t+`-width`))||1,lineCap:e.get(t+`-linecap`)===`square`?`square`:void 0,lineJoin:e.get(t+`-linejoin`)===`mitre`?`miter`:void 0,lineDash:(e.get(t+`-dasharray`)||``).split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite)})}function Cn(e){let t=new DOMParser().parseFromString(e,`application/xml`);if(t.getElementsByTagName(`parsererror`).length)return null;let n=[],r=null,i=vn(t,`TextSymbolizer`).length>0;for(let e of vn(t,`PointSymbolizer`)){if(i)continue;let t=bn(e),a=t.has(`fill`)?new Qo({color:t.get(`fill`)}):void 0,o=Sn(t),s=Number((vn(e,`Size`)[0]||{}).textContent)||8,c=((vn(e,`WellKnownName`)[0]||{}).textContent||`circle`).toLowerCase(),l={radius:s/2,fill:a,stroke:o},u;u=c===`square`?new is({...l,points:4,angle:Math.PI/4}):c===`triangle`?new is({...l,points:3,angle:0}):c===`cross`?new is({...l,points:4,angle:0,radius2:s/6}):new as(l);let d=new os({image:u});n.push(d),r||=d}for(let e of vn(t,`LineSymbolizer`)){let t=Sn(bn(e));t&&n.push(new os({stroke:t}))}for(let e of vn(t,`PolygonSymbolizer`)){let t=bn(e),r=t.has(`fill`)?new Qo({color:t.get(`fill`)}):void 0,i=Sn(t);(r||i)&&n.push(new os({fill:r,stroke:i}))}for(let e of vn(t,`TextSymbolizer`)){let t=vn(e,`PropertyName`)[0],i=t?t.textContent.trim():``,a=bn(vn(e,`Font`)[0]||e),o=Number(a.get(`font-size`))||10,s=a.get(`font-family`)||`SimSun`,c=a.get(`font-weight`)||`normal`,l=new fs({font:(a.get(`font-style`)||`normal`)+` `+c+` `+o+`px "`+s+`", sans-serif`,fill:new Qo({color:bn(e).get(`fill`)||`#000000`}),text:i?` `:``});r?r.setText(l):n.push(new os({text:l}))}return n.length?n:null}function wn(e){let t=new DOMParser().parseFromString(e,`application/xml`);for(let e of vn(t,`TextSymbolizer`)){let t=vn(e,`PropertyName`)[0];if(t)return t.textContent.trim()}return``}function Tn(e){if(typeof e!=`string`)return null;let t=e.trim().split(`,`).map(e=>Number(e.trim()));if(t.length<3||t.slice(0,3).some(e=>!Number.isFinite(e)||e<0||e>255))return null;let n=t.length>=4&&Number.isFinite(t[3])&&t[3]>=0&&t[3]<=255?t[3]/255:1;return[t[0],t[1],t[2],n]}function En(e){let t=Number(e);return!Number.isFinite(t)||t<0||t>16777215?null:[t>>16&255,t>>8&255,t&255,1]}function kn(e){return Tn(e.get(`color`))||En(e.get(`color24`))||null}function An(e,t,n){if(!t)return;let r=e.getStroke(),i=e.getFill(),a=e.getText();n.includes(`Polygon`)?(r&&e.setStroke(new $o({color:t,width:r.getWidth(),lineCap:r.getLineCap(),lineJoin:r.getLineJoin(),lineDash:r.getLineDash(),lineDashOffset:r.getLineDashOffset(),miterLimit:r.getMiterLimit()})),i&&e.setFill(new Qo({color:t}))):n.includes(`LineString`)||n.includes(`Curve`)?r&&e.setStroke(new $o({color:t,width:r.getWidth(),lineCap:r.getLineCap(),lineJoin:r.getLineJoin(),lineDash:r.getLineDash(),lineDashOffset:r.getLineDashOffset(),miterLimit:r.getMiterLimit()})):n.includes(`Point`)&&(i&&e.setFill(new Qo({color:t})),a&&a.setFill(new Qo({color:t}))),a&&(n.includes(`Point`)||n.includes(`Polygon`))&&a.setFill(new Qo({color:t}))}function jn(e,t){let n=new Map;return(r,i)=>{let a=r.getGeometry(),o=a?a.getType():``,s=t?r.get(t):null,c=kn(r),l=c?c.join(`,`):`sld`,u=a&&a.getFirstCoordinate?a.getFirstCoordinate():P.getView().getCenter(),d=xn(P.getView().getProjection(),Number.isFinite(i)&&i>0?i:1,u,`m`),f=Number(r.get(`height`)),p=Number.isFinite(f)&&f>0?Math.max(3,Math.min(128,f/d)):null,m=Math.round(Math.log2(d)*4),h=Number(r.get(`angle`)),g=Number.isFinite(h)?h*Math.PI/180:null,_=o+`|`+l+`|`+m+`|`+String(s??``)+`|`+g,v=n.get(_);return v||(v=e.map(e=>{let n=e.clone();An(n,c,o);let r=n.getText();if(r&&t&&s!=null&&s!==``){if(r.setText(String(s)),p!=null){let e=r.getFont()||`normal normal 10px "SimSun", sans-serif`;r.setFont(e.replace(/([0-9]+(?:\.[0-9]+)?)px/,p.toFixed(2)+`px`))}g!=null&&r.setRotation(g)}return n}),n.set(_,v)),v}}function Mn(e,t){let n=e.get(`_sldStyle`);if(n)return typeof n==`function`?n(e,t):n;let r=e.getGeometry(),i=r?r.getType():``,a=e.get(`_styleColor`)||_n(e.get(`layer`)||e.get(`_layerName`)),o=e.get(`_labelProperty`)?e.get(e.get(`_labelProperty`)):e.get(`text`),s=o!=null&&o!==``?new fs({font:`12px "Microsoft YaHei", sans-serif`,fill:new Qo({color:`#1c2833`}),text:String(o)}):void 0;return i.includes(`Polygon`)?new os({fill:new Qo({color:a+`26`}),stroke:new $o({color:a,width:1.5}),text:s}):i.includes(`LineString`)||i.includes(`Curve`)?new os({stroke:new $o({color:a,width:1.4}),text:s}):new os({image:new as({radius:4.5,fill:new Qo({color:a}),stroke:new $o({color:`#ffffff`,width:1})}),text:s})}function Fn(e){let t=me();for(let n of e){let e=n.getGeometry();e&&be(t,e.getExtent())}return t}function In(e,t){return new Zo({loader(n,r,i){let a=e.map(e=>{let n=e.clone(),r=n.getGeometry();return r&&r.transform(t,i),n});return this.addFeatures(a),a}})}function Ln(e){let t=e&&e.crs&&e.crs.properties&&e.crs.properties.name;if(!t)return null;if(/CRS84$/i.test(t))return`EPSG:4326`;let n=String(t).match(/EPSG[:\s]+(\d+)/i);return n?`EPSG:`+n[1]:null}function Rn(e,t){let n=e===`EPSG:4326`?`EPSG:4326(WGS84 / CRS84)`:e;return t?n+`(`+t+` 个文件)`:n}function zn(e,t){t?!e||!e.size?(j.value.geojsonCrsHint=`已检查 ${t} 个 GeoJSON,未发现 CRS 声明。`,j.value.geojsonCrsOptions=[]):(j.value.geojsonCrsHint=`检测到 ${e.size} 种 CRS:`,j.value.geojsonCrsOptions=[...e].map(([e,t])=>({code:e,label:Rn(e,t)}))):(j.value.geojsonCrsHint=`未识别到 GeoJSON,无法检测 CRS。`,j.value.geojsonCrsOptions=[])}async function Bn(e,t){let n=new Map,r=0;for(let i of e){if(t!==de)return;try{let e=Ln(JSON.parse(await i.file.text()));e&&n.set(e,(n.get(e)||0)+1)}catch{}r+=1,zn(n,r)}if(t===de&&(zn(n,r),n.size)){let e=[...n.entries()].sort((e,t)=>t[1]-e[1]);j.value.dataCrs=e[0][0]}}function Vn(e){return/^metadata\.json$/i.test(e.name)}function Hn(e){let t=e.filter(e=>ie.test(e.name)&&!Vn(e)),n=new Map;for(let t of e)oe.test(t.name)&&n.set(t.name.replace(/\.[^.]+$/,``),t);return t.map(e=>({file:e,sld:n.get(e.name.replace(/\.[^.]+$/,``))||null}))}async function Un(e,t){if(!t)return{pairs:e,metadata:null};let n=JSON.parse(await t.text());if(!n||!Array.isArray(n.layers))throw Error(`metadata.json 缺少 layers 数组`);let r=new Map(e.map(e=>[e.file.name,e])),i=[],a=new Set;for(let e of n.layers){let t=e&&e.geojson,n=r.get(t);n&&!a.has(t)&&(n.layerTitle=e.title||``,i.push(n),a.add(t))}for(let t of e)a.has(t.file.name)||i.push(t);return{pairs:i,metadata:n}}function Wn(e){let t=Array.from(e||[]),n=t.length?(t[0].webkitRelativePath||``).split(/[\\/]/)[0]:`GeoJSON 目录`,r=Hn(t),i=t.find(Vn)||null;pe={name:n,files:t,pairs:r,metadataFile:i,metadataName:null},j.value.geojsonDirName=r.length?n+`(`+r.length+` 个 GeoJSON,`+r.filter(e=>e.sld).length+` 个 SLD)`:`未识别到 GeoJSON 文件`,j.value.geojsonInfo=r.length?(i?`已识别 metadata.json,将按其中的图层顺序加载;`:``)+`未配对的 .sld 使用默认矢量样式。`:`请选择包含 .geojson(或 .json)和可选同名 .sld 的目录。`,de+=1,r.length?(j.value.geojsonCrsHint=`正在检测 GeoJSON CRS…`,Bn(r,de)):j.value.geojsonCrsHint=`未选择 GeoJSON。`}async function Gn(){Ke();try{if(!pe||!pe.pairs.length){z(`请先选择包含 GeoJSON 文件的目录`,`warn`);return}let e=new lp,t=[],n=null,r=null,i=0,a=pe.pairs,o=[];try{if(pe.metadataFile){let e=await Un(pe.pairs,pe.metadataFile);a=e.pairs,pe.metadataName=e.metadata&&e.metadata.name?e.metadata.name:null}for(let s of a){let a=await s.file.text(),c=JSON.parse(a),l=Ln(c)||j.value.dataCrs,u=st(l);if(!u)throw Error(`无效坐标系:`+l);let d=e.readFeatures(c,{dataProjection:l,featureProjection:l});if(n){if(u.getCode()!==r)for(let e of d){let t=e.getGeometry();t&&t.transform(u,n)}}else n=u,r=u.getCode();if(s.sld){let e=await s.sld.text(),t=Cn(e);if(t){let n=jn(t,wn(e));for(let e of d)e.set(`_sldStyle`,n,!0),s.layerTitle&&e.set(`_layerName`,s.layerTitle,!0);i++}}o.push({pair:s,features:d}),t.push(...d)}}catch(e){z(`GeoJSON 加载失败:`+e.message,`err`);return}if(!t.length){z(`所选文件中没有有效要素`,`warn`);return}let s=o.map(({pair:e,features:t})=>{let r=In(t,n),i=new wu({source:r,style:(e,t)=>Mn(e,t)});return{name:e.layerTitle||e.file.name,kind:`geojson`,layer:i,featureCount:t.length,visible:!0,group:bt(t),groupVisible:!0,source:r}});if(s.some(e=>e.group===`0`))for(let e of s)e.group||=`0`;let c=new Ed({layers:s.map(e=>e.layer)});Rt({name:pe.metadataName||pe.name,kind:`geojson`,layer:c,sublayers:s.map(e=>{let t={...e};return delete t.source,t}),extent:Fn(t),projection:n,sourceCrs:r,sources:s.map(e=>e.source),cleanup(){}}),j.value.geojsonInfo=`已按 metadata.json 顺序加载 `+a.length+` 个图层、`+t.length+` 个要素,应用 `+i+` 个 SLD 样式,数据坐标系 `+r+`。`}finally{qe()}}function Kn(){let e=j.value.viewCrs,t=P.getView().getProjection();if(t.getCode()===e){z(`当前视图已使用该坐标系`,`info`);return}if(t.getCode()===`PIXEL`||e===`PIXEL`){z(`像素坐标无法与其他坐标系互转`,`warn`);return}let n=st(e);if(!n){z(`目标坐标系未注册`,`warn`);return}let{center:r,resolution:i}=Ut(n);Wt(n,{center:r,resolution:i}),r&&!i&&N&&Bt(),N&&(N.viewProjectionCode=n.getCode(),vt())}function qn(e,t){try{if(B(e)||(Nb.defs(e,t),Zf(Nb)),!B(e))throw Error(`注册失败`)}catch(e){return z(`坐标系注册失败:${e.message}`,`err`),!1}return le.some(t=>t.code===e)||le.push({code:e,name:`${e} · 自定义`,def:t}),ot(),j.value.dataCrs=e,!0}async function Jn(){let e=String(parseInt(Te.value.value.trim(),10));if(!e||e===`NaN`){z(`请输入有效的 EPSG 代码`,`warn`);return}let t=`EPSG:${e}`;z(`正在从 epsg.io 获取 ${t} …`);try{let n=await fetch(`https://epsg.io/${e}.proj4`);if(!n.ok)throw Error(`HTTP ${n.status}`);let r=(await n.text()).trim();if(!r.startsWith(`+`))throw Error(`返回内容不是 proj4 定义`);qn(t,r)&&z(`已注册并应用 ${t}`,`ok`)}catch(e){z(`获取失败(${e.message}),请检查网络后重试`,`err`)}}function Yn(e){d.value=e}function Xn(e){f.value=e,d.value=[`image`,`tiles`,`url`].includes(e)?`raster`:`vector`}function Zn(e){Yn(e),Xn(e===`raster`?`image`:`geojson`)}function Qn(){F&&F.objectUrl&&URL.revokeObjectURL(F.objectUrl),F=null,ge=null,he=null,pe=null,I.value.value=``,Ue.value.value=``,Re.value.value=``,je.value.value=``,j.value.imgFileName=`未选择文件`,j.value.worldFileName=`未选择文件`,j.value.tilesDirName=`未选择目录`,j.value.tilesInfo=`支持 QGIS / GDAL 等导出的 z/x/y.png 目录结构。`,j.value.tilesTms=!1,j.value.geojsonDirName=`未选择目录`,j.value.geojsonInfo=`支持按文件名配对的 .geojson 与 .sld。`,de+=1,j.value.geojsonCrsHint=`未选择 GeoJSON。`,j.value.geojsonCrsOptions=[],ke.value.value=Ae.value.value=De.value.value=Oe.value.value=``,j.value.zoneHint={message:``,options:[]},j.value.urlTemplate=``,j.value.urlMinzoom=j.value.urlMaxzoom=``,Ve.value.value=He.value.value=ze.value.value=Be.value.value=``,j.value.urlExtentCrs=`EPSG:3857`,j.value.urlInfo=``,j.value.customEpsg=``,j.value.dataCrs=`EPSG:3857`,Xn(`image`)}function $n(){Qn(),p.value=!0}function er(){p.value=!1}function tr(){if(!P)return null;let e=P.getView();return{center:e.getCenter(),zoom:e.getZoom(),crs:e.getProjection().getCode()}}function nr(){let e=N;if(!e)return null;let t=P.getView();return{id:e.id,name:e.name,kind:e.kind,dataCrs:e.projection.getCode(),viewCrs:e.viewProjectionCode,extent:e.extent,sublayerCount:e.sublayers.length,center:t.getCenter(),zoom:t.getZoom()}}async function rr({url:e,crs:t=`EPSG:3857`,minZoom:n=0,maxZoom:r=22,extent:i=null,extentCrs:a=null}={}){o.value||await fr();let s=await hn(e,t,n,r,i&&i.length===4?{extent:i,crs:a||t}:null);return s.entry?(Rt(s.entry),s.entry):(z(s.error||`加载失败`,`warn`),null)}async function ir({url:e,name:t=null,crs:n=null,worldFileUrl:r=null,worldText:i=null,extent:a=null}={}){if(o.value||await fr(),n&&(j.value.dataCrs=n),!i&&r)try{let e=await fetch(r);e.ok&&(i=await e.text())}catch{}return await un({url:e,name:t||decodeURIComponent(String(e).split(`/`).pop()||`图片`),worldText:i,extent:a,crs:n}),N}async function ar(e){return o.value||await fr(),Wn(e),await Gn(),N}async function or(e,t=``){o.value||await fr();let n=sr(e);if(!n.length)return z(`清单中没有文件`,`warn`),null;let r=[],i=[];for(let e of n){let n=cr(e.url,t);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP `+e.status);let t=await e.blob();r.push(new File([t],lr(n),{type:t.type||`application/octet-stream`}))}catch(e){console.error(`[manifest] 文件加载失败:`,n,e),i.push(lr(n)+`:`+e.message)}}if(i.length&&z(`有 `+i.length+` 个文件加载失败:`+i.slice(0,3).join(`;`)+(i.length>3?` 等`:``),`warn`),!r.length)throw Error(`矢量文件全部加载失败(共 `+i.length+` 个)`);return ar(r)}function sr(e){let t=e=>{if(typeof e==`string`)return{url:e};if(!e||typeof e!=`object`)return null;let t=e.url||e.geojson||e.image||e.png||null;return t?{url:t,type:e.type||null,name:e.name||e.title||null,crs:e.crs||null,worldFile:e.worldFile||e.worldfile||null,worldText:e.worldText||null,extent:Array.isArray(e.extent)&&e.extent.length===4?e.extent:null,sld:e.sld||null}:null},n=e=>{let n=[],r=t(e);return r&&n.push(r),e&&typeof e==`object`&&typeof e.sld==`string`&&e.sld&&(r&&r.url===e.sld||n.push({url:e.sld})),n};if(Array.isArray(e))return[].concat.apply([],e.map(n));if(!e)return[];if(Array.isArray(e.files))return[].concat.apply([],e.files.map(n));if(Array.isArray(e.layers)){let n=[];for(let r of e.layers)r&&r.geojson&&n.push(t(Object.assign({},r,{url:r.geojson,sld:null}))),r&&r.sld&&n.push({url:r.sld});return n.push({url:`metadata.json`}),n}return[]}function cr(e,t){let n=String(e);return/^https?:\/\//i.test(n)||!t?n:t.replace(/\/$/,``)+`/`+n.replace(/^\//,``)}function lr(e){return decodeURIComponent(String(e).split(`/`).pop().split(`?`)[0]||`未命名`)}async function ur(e){if(o.value||await fr(),!Array.isArray(e)||!e.length)return z(`没有可加载的图层数据`,`warn`),null;let t=[];for(let n of e){if(!n||!n.geojson)continue;let e=typeof n.geojson==`string`?n.geojson:JSON.stringify(n.geojson);if(t.push(new File([e],n.name+`.geojson`,{type:`application/geo+json`})),n.sld){let e=typeof n.sld==`string`?n.sld:JSON.stringify(n.sld);t.push(new File([e],n.name+`.sld`,{type:`application/xml`}))}}return t.length?ar(t):(z(`没有可加载的图层数据`,`warn`),null)}async function dr(){await Gn()}function fr(){return o.value?Promise.resolve():new Promise(e=>{let t=setInterval(()=>{o.value&&(clearInterval(t),e())},50)})}async function pr(){Ke();try{let e=i.autoLoad;if(!e||!e.url)return;if(e.type===`manifest`){let t=await fetch(e.url);if(!t.ok)throw Error(`获取失败:`+e.url+`(`+t.status+`)`);await or(await t.json(),e.baseUrl||``)}else e.type===`image`&&await ir({url:e.url,name:e.name||null,crs:e.crs||null,worldFileUrl:e.worldFile||null,worldText:e.worldText||null,extent:e.extent||null})}finally{qe()}}function mr(e){g.value=e===`light`,i.themeIcon=g.value?`🌙`:`☀️`,i.themeTitle=g.value?`切换到深色主题`:`切换到浅色主题`,a(`theme-changed`,e)}async function hr(e,t=``){if(!e)return[];if(e.isFile)return await new Promise(n=>{e.file(r=>{try{Object.defineProperty(r,"webkitRelativePath",{value:t+e.name})}catch{}n([r])},()=>n([]))});let n=e.createReader(),r=[];for(;;){let e=await new Promise(e=>n.readEntries(e,()=>e([])));if(!e.length)break;r.push(...e)}let i=[];for(let n of r)i.push(...await hr(n,t+e.name+`/`));return i}async function gr(e){let t=Array.from(e&&e.files||[]);if(t.length)return t;let n=Array.from(e&&e.items||[]).map(e=>e.webkitGetAsEntry&&e.webkitGetAsEntry()).filter(Boolean);return n.length?(await Promise.all(n.map(e=>hr(e)))).flat():[]}function _r(e){return e=String(e||``).trim(),/^\d+$/.test(e)?`EPSG:${e}`:/^epsg:\d+$/i.test(e)?e.toUpperCase():null}return(0,t.onMounted)(()=>{Ge(),pr().catch(e=>{console.error(`[autoLoad] 自动加载失败:`,e),z(`自动加载失败:`+e.message,`err`)}),i.hidePanels&&(Ye(),Ze())}),(0,t.onBeforeUnmount)(()=>{tt()}),n({viewerReady:o,sidebarWidth:s,loadingTasks:c,olLoading:l,dropVisible:u,sourceCategory:d,currentTab:f,loadDialogVisible:p,sidebarCollapsed:m,panelRightCollapsed:h,isLight:g,themeIcon:_,themeTitle:v,statusInfo:y,toastText:b,toastType:x,toastVisible:S,mapInfo:C,mapListItems:w,layerListVisible:T,layerListHint:E,layerTotal:D,layerFeatureTotal:O,layerListItems:k,crsOptions:A,customCrsOptions:ee,mapExtent:te,viewExtent:ne,form:j,initViewer:Ge,pushLoading:Ke,popLoading:qe,startSidebarResize:Je,collapseSidebar:Ye,expandSidebar:Xe,collapsePanelRight:Ze,expandPanelRight:Qe,toggleTheme:$e,loadToMap:et,destroyViewer:tt,createFitAllControl:nt,gkDef:rt,addGroup:it,buildCrsOptionGroups:at,refillCrsSelects:ot,ensureProjection:st,formatCoord:ct,attachViewListener:lt,fmtRes:ut,updateStatus:dt,updateMapExtent:ft,updateViewExtent:pt,fmtExtentInput:ht,toast:z,kindIcon:gt,selectAndFitMap:_t,renderMapList:vt,renderMapInfo:yt,inferGeoJsonGroup:bt,buildLayerGroups:xt,isLayerEffectivelyVisible:St,renderLayerList:Ct,toggleLayerVisible:wt,toggleLayerGroupExpanded:Tt,toggleLayerGroupVisible:Et,toggleLayerChildVisible:Dt,getVectorSourceExtent:Ot,zoomToLayer:kt,zoomToLayerGroup:At,removeSublayerInternal:jt,afterLayersRemoved:Mt,removeLayerItem:Nt,removeLayerGroup:Pt,normalizeSublayers:Ft,saveActiveViewState:It,selectMapEntry:Lt,addMapEntry:Rt,deleteMapEntry:zt,fitActiveMap:Bt,fitToExtent:Vt,syncViewCrsSelect:Ht,computeViewTransition:Ut,setViewProjection:Wt,worldSquareExtent:Gt,buildTileGrid:Kt,tilesExtent:qt,fmtExtentNum:Jt,extentText:Yt,extentFromTileMap:Xt,scanTileFiles:Zt,tileStats:Qt,clampInt:$t,getImageSize:en,parseWorldFile:tn,extentFromWorldFile:nn,guessCrsFromExtent:rn,updateZoneHint:an,applyWorldFileToExtent:on,onImageFileChosen:sn,readExtentInputs:cn,loadImageLayer:ln,addImageFromUrl:un,onTilesDirChosen:dn,updateTilesInfo:fn,loadTilesLayer:pn,updateUrlTemplateHint:mn,createXyzEntry:hn,loadUrlLayer:gn,vectorColor:_n,descendants:vn,svgParameters:bn,strokeFromParams:Sn,parseSldStyles:Cn,sldLabelProperty:wn,parseCadColor:Tn,parseCadColor24:En,resolveGeoJsonCadColor:kn,setStyleColor:An,makeSldStyleFunction:jn,defaultVectorStyle:Mn,featuresExtent:Fn,createReprojectingVectorSource:In,geoJsonCrsCode:Ln,geoJsonCrsChipLabel:Rn,updateGeoJsonCrsHint:zn,detectGeoJsonCrsHints:Bn,isMetadataJson:Vn,matchGeoJsonPairs:Hn,orderGeoJsonPairsByMetadata:Un,onGeoJsonDirChosen:Wn,loadGeoJsonLayers:Gn,switchViewProjection:Kn,registerCustom:qn,fetchAndRegisterEpsg:Jn,setSourceCategory:Yn,setActiveTab:Xn,setSourceCategoryAndDefault:Zn,resetLoadDialog:Qn,openLoadDialog:$n,closeLoadDialog:er,getViewState:tr,getActiveMapInfo:nr,addXyzLayer:rr,loadImageFromUrl:ir,loadGeoJsonFromFiles:ar,loadGeoJsonFromManifest:or,manifestEntries:sr,resolveManifestUrl:cr,manifestUrlName:lr,loadGeoJsonFromData:ur,loadGeoJsonForCurrentSource:dr,waitViewerReady:fr,processAutoLoad:pr,applyTheme:mr,readDroppedEntry:hr,filesFromDataTransfer:gr,normalizeEpsg:_r}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`mapViewer`,ref:Me,class:(0,t.normalizeClass)([`map-viewer-root`,{"light-theme":g.value,"sidebar-collapsed":m.value,"panel-right-collapsed":h.value}]),style:(0,t.normalizeStyle)(R.value)},[(0,t.createElementVNode)(`aside`,Pb,[(0,t.createElementVNode)(`header`,Fb,[n[11]||=(0,t.createElementVNode)(`div`,{class:`brand`},[(0,t.createElementVNode)(`span`,{class:`logo`},`🗺️`),(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`h1`,null,`地图查看器`),(0,t.createElementVNode)(`p`,null,`当前地图信息`)])],-1),(0,t.createElementVNode)(`button`,{id:`sidebar-collapse`,title:`收起面板`,ref_key:`sidebarCollapse`,ref:Pe,onClick:Ye},`‹`,512)]),(0,t.createElementVNode)(`div`,Ib,[(0,t.createElementVNode)(`section`,Lb,[n[16]||=(0,t.createElementVNode)(`h2`,null,`当前地图`,-1),C.value.active?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Rb,`暂无地图,请上传地图。`)),(0,t.withDirectives)((0,t.createElementVNode)(`div`,zb,[(0,t.createElementVNode)(`div`,Bb,[n[12]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`名称`,-1),(0,t.createElementVNode)(`span`,Vb,(0,t.toDisplayString)(C.value.name),1)]),(0,t.createElementVNode)(`div`,Hb,[n[13]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`类型`,-1),(0,t.createElementVNode)(`span`,Ub,(0,t.toDisplayString)(C.value.kind),1)]),(0,t.createElementVNode)(`div`,Wb,[n[14]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`数据坐标系`,-1),(0,t.createElementVNode)(`span`,Gb,(0,t.toDisplayString)(C.value.dataCrs),1)]),(0,t.createElementVNode)(`div`,Kb,[n[15]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`显示范围`,-1),(0,t.createElementVNode)(`span`,qb,(0,t.toDisplayString)(C.value.extent),1)])],512),[[t.vShow,C.value.active]])]),(0,t.withDirectives)((0,t.createElementVNode)(`section`,Jb,[n[25]||=(0,t.createElementVNode)(`h2`,null,`视图坐标系`,-1),(0,t.createElementVNode)(`div`,Yb,[(0,t.withDirectives)((0,t.createElementVNode)(`select`,{id:`view-crs`,"onUpdate:modelValue":n[0]||=e=>j.value.viewCrs=e},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(A.value.viewCrs,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,{key:e.label,label:e.label},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,Zb))),128))],8,Xb))),128)),ee.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,Qb,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ee.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,$b))),128))])):(0,t.createCommentVNode)(``,!0)],512),[[t.vModelSelect,j.value.viewCrs]]),(0,t.createElementVNode)(`button`,{id:`btn-switch-view`,class:`mini-btn`,type:`button`,ref_key:`btnSwitchView`,ref:we,onClick:Kn},`切换`,512)]),n[26]||=(0,t.createElementVNode)(`label`,{class:`grid-caption`},`显示范围`,-1),(0,t.createElementVNode)(`div`,ex,[(0,t.createElementVNode)(`label`,null,[n[17]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-minx`,step:`any`,readonly:``,value:te.value.minx},null,8,tx)]),(0,t.createElementVNode)(`label`,null,[n[18]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-miny`,step:`any`,readonly:``,value:te.value.miny},null,8,nx)]),(0,t.createElementVNode)(`label`,null,[n[19]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-maxx`,step:`any`,readonly:``,value:te.value.maxx},null,8,rx)]),(0,t.createElementVNode)(`label`,null,[n[20]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-maxy`,step:`any`,readonly:``,value:te.value.maxy},null,8,ix)])]),n[27]||=(0,t.createElementVNode)(`label`,{class:`grid-caption`},`当前视野`,-1),(0,t.createElementVNode)(`div`,ax,[(0,t.createElementVNode)(`label`,null,[n[21]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-minx`,step:`any`,readonly:``,value:ne.value.minx},null,8,ox)]),(0,t.createElementVNode)(`label`,null,[n[22]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-miny`,step:`any`,readonly:``,value:ne.value.miny},null,8,sx)]),(0,t.createElementVNode)(`label`,null,[n[23]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-maxx`,step:`any`,readonly:``,value:ne.value.maxx},null,8,cx)]),(0,t.createElementVNode)(`label`,null,[n[24]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-maxy`,step:`any`,readonly:``,value:ne.value.maxy},null,8,lx)])])],512),[[t.vShow,C.value.active]]),(0,t.withDirectives)((0,t.createElementVNode)(`section`,ux,[(0,t.createElementVNode)(`h2`,dx,[n[28]||=(0,t.createTextVNode)(`图层列表`,-1),E.value?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,fx,(0,t.toDisplayString)(D.value)+` 个图层 · `+(0,t.toDisplayString)(O.value)+` 个要素`,1))]),(0,t.withDirectives)((0,t.createElementVNode)(`p`,{class:`layer-list-hint`},(0,t.toDisplayString)(E.value),513),[[t.vShow,E.value]]),(0,t.createElementVNode)(`ul`,px,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(k.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[e.type===`layer`?((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:e.key,class:(0,t.normalizeClass)([`layer-item`,{"hidden-layer":!e.visible}])},[(0,t.createElementVNode)(`div`,mx,[(0,t.createElementVNode)(`span`,{class:`layer-name`,title:e.name},(0,t.toDisplayString)(e.name),9,hx),(0,t.createElementVNode)(`span`,gx,(0,t.toDisplayString)(e.meta),1)]),(0,t.createElementVNode)(`div`,_x,[(0,t.createElementVNode)(`button`,{class:`icon-btn layer-zoom`,type:`button`,title:`缩放到当前图层`,onClick:t=>kt(e)},`🔍`,8,vx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-delete`,type:`button`,title:`删除图层`,onClick:t=>Nt(e)},`🗑`,8,yx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-toggle`,type:`button`,title:e.visible?`隐藏图层`:`显示图层`,onClick:t=>wt(e)},(0,t.toDisplayString)(e.visible?`👁️`:`🚫`),9,bx)])],2)):((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:e.name,class:(0,t.normalizeClass)([`layer-item layer-group`,{"hidden-layer":!e.visible}])},[(0,t.createElementVNode)(`div`,xx,[(0,t.createElementVNode)(`span`,{class:`layer-name`,title:e.name},(0,t.toDisplayString)(e.name),9,Sx),(0,t.createElementVNode)(`span`,Cx,(0,t.toDisplayString)(e.meta),1)]),(0,t.createElementVNode)(`div`,wx,[(0,t.createElementVNode)(`button`,{class:`icon-btn layer-zoom`,type:`button`,title:`缩放到图层组`,onClick:t=>At(e)},`🔍`,8,Tx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-delete`,type:`button`,title:`删除图层组`,onClick:t=>Pt(e)},`🗑`,8,Ex),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-fold`,type:`button`,title:e.collapsed?`展开图层组`:`折叠图层组`,onClick:t=>Tt(e)},(0,t.toDisplayString)(e.collapsed?`▸`:`▾`),9,Dx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-toggle`,type:`button`,title:e.visible?`隐藏图层组`:`显示图层组`,onClick:t=>Et(e)},(0,t.toDisplayString)(e.visible?`👁️`:`🚫`),9,Ox)])],2)),e.type===`group`&&!e.collapsed?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:2},(0,t.renderList)(e.children,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:n.key,class:(0,t.normalizeClass)([`layer-item layer-child`,{"hidden-layer":!n.visible}])},[(0,t.createElementVNode)(`div`,kx,[(0,t.createElementVNode)(`span`,{class:`layer-name`,title:n.name},(0,t.toDisplayString)(n.name),9,Ax),(0,t.createElementVNode)(`span`,jx,(0,t.toDisplayString)(n.meta),1)]),(0,t.createElementVNode)(`div`,Mx,[(0,t.createElementVNode)(`button`,{class:`icon-btn layer-zoom`,type:`button`,title:`缩放到当前图层`,onClick:e=>kt(n)},`🔍`,8,Nx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-delete`,type:`button`,title:`删除图层`,onClick:e=>Nt(n)},`🗑`,8,Px),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-toggle`,type:`button`,title:n.visible?`隐藏图层`:`显示图层`,onClick:t=>Dt(e,n)},(0,t.toDisplayString)(n.visible?`👁️`:`🚫`),9,Fx)])],2))),128)):(0,t.createCommentVNode)(``,!0)],64))),256))])],512),[[t.vShow,T.value]])])]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:`sidebar-resizer`,title:`拖动调整侧栏宽度`,onMousedown:Je},null,544),[[t.vShow,!m.value]]),(0,t.createElementVNode)(`button`,{id:`sidebar-open`,title:`展开面板`,type:`button`,ref_key:`sidebarOpen`,ref:Fe,onClick:Xe},`›`,512),(0,t.createElementVNode)(`button`,{id:`panel-right-open`,title:`展开面板`,type:`button`,ref_key:`panelRightOpen`,ref:Ne,onClick:Qe},`‹`,512),n[56]||=(0,t.createElementVNode)(`main`,{id:`map`},null,-1),(0,t.withDirectives)((0,t.createElementVNode)(`div`,Ix,[...n[29]||=[(0,t.createElementVNode)(`span`,{class:`map-loading-spinner`},null,-1),(0,t.createElementVNode)(`span`,{class:`map-loading-text`},`地图加载中...`,-1)]],512),[[t.vShow,We.value]]),(0,t.createElementVNode)(`div`,{id:`load-dialog`,class:(0,t.normalizeClass)([`dialog-overlay`,{show:p.value}])},[(0,t.createElementVNode)(`div`,Lx,[(0,t.createElementVNode)(`header`,Rx,[n[30]||=(0,t.createElementVNode)(`div`,{class:`brand`},[(0,t.createElementVNode)(`span`,{class:`logo`},`📥`),(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`h1`,null,`加载地图`),(0,t.createElementVNode)(`p`,null,`选择数据源并加载`)])],-1),(0,t.createElementVNode)(`button`,{id:`btn-dialog-close`,title:`关闭`,type:`button`,ref_key:`btnDialogClose`,ref:xe,onClick:er},`✕`,512)]),(0,t.createElementVNode)(`div`,{ref_key:`dialogBody`,ref:Ee,class:`dialog-body`},[(0,t.createElementVNode)(`section`,zx,[n[51]||=(0,t.createElementVNode)(`h2`,null,`数据类型`,-1),(0,t.createElementVNode)(`div`,{class:`tabs source-type-tabs`,id:`source-type-tabs`,ref_key:`sourceTypeTabs`,ref:L},[(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`tab-btn source-type-btn`,{active:d.value===`raster`}]),type:`button`,onClick:n[1]||=e=>Zn(`raster`)},`栅格`,2),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`tab-btn source-type-btn`,{active:d.value===`vector`}]),type:`button`,onClick:n[2]||=e=>Zn(`vector`)},`矢量`,2)],512),n[52]||=(0,t.createElementVNode)(`h2`,null,`数据源`,-1),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`image`}]),id:`tab-image`},[(0,t.createElementVNode)(`label`,Bx,[n[31]||=(0,t.createTextVNode)(` 选择 PNG / JPG 图片 `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`img-file`,accept:`.png,.jpg,.jpeg,.webp,image/png,image/jpeg,image/webp`,hidden:``,ref_key:`imgFile`,ref:I},null,512)]),(0,t.createElementVNode)(`div`,Vx,(0,t.toDisplayString)(j.value.imgFileName),1),(0,t.createElementVNode)(`label`,Hx,[n[32]||=(0,t.createTextVNode)(` 坐标信息文件(可选 .pgw / .wld) `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`world-file`,accept:`.pgw,.pwg,.jgw,.gfw,.wld,.pngw,.jpgw,.txt`,hidden:``,ref_key:`worldFile`,ref:Ue},null,512)]),(0,t.createElementVNode)(`div`,Ux,(0,t.toDisplayString)(j.value.worldFileName),1),(0,t.createElementVNode)(`div`,Wx,[(0,t.createElementVNode)(`label`,null,[n[33]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-minx`,step:`any`,placeholder:`必填`,ref_key:`extMinx`,ref:ke},null,512)]),(0,t.createElementVNode)(`label`,null,[n[34]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-miny`,step:`any`,placeholder:`必填`,ref_key:`extMiny`,ref:Ae},null,512)]),(0,t.createElementVNode)(`label`,null,[n[35]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-maxx`,step:`any`,placeholder:`必填`,ref_key:`extMaxx`,ref:De},null,512)]),(0,t.createElementVNode)(`label`,null,[n[36]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-maxy`,step:`any`,placeholder:`必填`,ref_key:`extMaxy`,ref:Oe},null,512)])]),(0,t.createElementVNode)(`div`,Gx,[j.value.zoneHint.message?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Kx,(0,t.toDisplayString)(j.value.zoneHint.message),1)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(j.value.zoneHint.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.code,class:`chip`,type:`button`,onClick:t=>j.value.dataCrs=e.code},(0,t.toDisplayString)(e.label),9,qx))),128))]),n[37]||=(0,t.createElementVNode)(`p`,{class:`tip`},`范围必填:四至范围需填写完整,选择坐标信息文件后可自动计算填充。`,-1)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`tiles`}]),id:`tab-tiles`},[(0,t.createElementVNode)(`label`,Jx,[n[38]||=(0,t.createTextVNode)(` 选择切片XYZ目录(z/x/y 结构) `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`tiles-dir`,webkitdirectory:``,directory:``,multiple:``,hidden:``,ref_key:`tilesDir`,ref:Re},null,512)]),(0,t.createElementVNode)(`div`,Yx,(0,t.toDisplayString)(j.value.tilesDirName),1),(0,t.createElementVNode)(`label`,Xx,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`checkbox`,id:`tiles-tms`,"onUpdate:modelValue":n[3]||=e=>j.value.tilesTms=e,onChange:n[4]||=e=>fn()},null,544),[[t.vModelCheckbox,j.value.tilesTms]]),n[39]||=(0,t.createTextVNode)(` TMS 顺序(Y 轴从下往上)`,-1)]),(0,t.createElementVNode)(`div`,Zx,(0,t.toDisplayString)(j.value.tilesInfo),1),n[40]||=(0,t.createElementVNode)(`p`,{class:`tip`},`大多数切片XYZ使用 EPSG:3857(网络墨卡托)网格。`,-1)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`geojson`}]),id:`tab-geojson`},[(0,t.createElementVNode)(`label`,Qx,[n[41]||=(0,t.createTextVNode)(` 选择 GeoJSON + SLD 目录(同名配对) `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`geojson-dir`,webkitdirectory:``,directory:``,multiple:``,hidden:``,ref_key:`geojsonDir`,ref:je},null,512)]),(0,t.createElementVNode)(`div`,$x,(0,t.toDisplayString)(j.value.geojsonDirName),1),(0,t.createElementVNode)(`div`,eS,[j.value.geojsonCrsHint?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tS,(0,t.toDisplayString)(j.value.geojsonCrsHint),1)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(j.value.geojsonCrsOptions,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.code,class:`chip`,type:`button`,onClick:t=>j.value.dataCrs=e.code},(0,t.toDisplayString)(e.label),9,nS))),128))]),(0,t.createElementVNode)(`div`,rS,(0,t.toDisplayString)(j.value.geojsonInfo),1)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`url`}]),id:`tab-url`},[(0,t.createElementVNode)(`label`,null,[n[42]||=(0,t.createTextVNode)(`在线切片XYZ URL 模板 `,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`text`,id:`url-template`,placeholder:`https://example.com/tiles/{z}/{x}/{y}.png`,spellcheck:`false`,"onUpdate:modelValue":n[5]||=e=>j.value.urlTemplate=e,onChange:mn},null,544),[[t.vModelText,j.value.urlTemplate]])]),(0,t.createElementVNode)(`div`,iS,[(0,t.createElementVNode)(`label`,null,[n[43]||=(0,t.createTextVNode)(`最小层级`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`number`,id:`url-minzoom`,min:`0`,max:`24`,placeholder:`必填`,"onUpdate:modelValue":n[6]||=e=>j.value.urlMinzoom=e},null,512),[[t.vModelText,j.value.urlMinzoom]])]),(0,t.createElementVNode)(`label`,null,[n[44]||=(0,t.createTextVNode)(`最大层级`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`number`,id:`url-maxzoom`,min:`0`,max:`24`,placeholder:`必填`,"onUpdate:modelValue":n[7]||=e=>j.value.urlMaxzoom=e},null,512),[[t.vModelText,j.value.urlMaxzoom]])])]),(0,t.createElementVNode)(`label`,null,[n[45]||=(0,t.createTextVNode)(`范围`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`select`,{id:`url-extent-crs`,"onUpdate:modelValue":n[8]||=e=>j.value.urlExtentCrs=e},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(A.value.urlExtentCrs,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,{key:e.label,label:e.label},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,oS))),128))],8,aS))),128)),ee.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,sS,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ee.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,cS))),128))])):(0,t.createCommentVNode)(``,!0)],512),[[t.vModelSelect,j.value.urlExtentCrs]])]),(0,t.createElementVNode)(`div`,lS,[(0,t.createElementVNode)(`label`,null,[n[46]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-minx`,step:`any`,placeholder:`必填`,ref_key:`urlExtMinx`,ref:Ve},null,512)]),(0,t.createElementVNode)(`label`,null,[n[47]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-miny`,step:`any`,placeholder:`必填`,ref_key:`urlExtMiny`,ref:He},null,512)]),(0,t.createElementVNode)(`label`,null,[n[48]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-maxx`,step:`any`,placeholder:`必填`,ref_key:`urlExtMaxx`,ref:ze},null,512)]),(0,t.createElementVNode)(`label`,null,[n[49]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-maxy`,step:`any`,placeholder:`必填`,ref_key:`urlExtMaxy`,ref:Be},null,512)])]),(0,t.createElementVNode)(`div`,uS,(0,t.toDisplayString)(j.value.urlInfo),1),n[50]||=(0,t.createElementVNode)(`p`,{class:`tip`},`必须为完整 http(s) URL,模板变量 {z} {x} {y},TMS 用 {-y}。`,-1)],2)]),(0,t.createElementVNode)(`section`,dS,[n[54]||=(0,t.createElementVNode)(`h2`,null,`数据坐标系`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`select`,{id:`data-crs`,"onUpdate:modelValue":n[9]||=e=>j.value.dataCrs=e,onChange:n[10]||=e=>fn()},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(A.value.dataCrs,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,{key:e.label,label:e.label},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,pS))),128))],8,fS))),128)),ee.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,mS,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ee.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,hS))),128))])):(0,t.createCommentVNode)(``,!0)],544),[[t.vModelSelect,j.value.dataCrs]]),(0,t.createElementVNode)(`div`,gS,[(0,t.createElementVNode)(`div`,_S,[(0,t.createElementVNode)(`input`,{type:`number`,id:`custom-epsg`,min:`1`,step:`1`,placeholder:`EPSG 代码,如 4525`,ref_key:`customEpsg`,ref:Te},null,512),(0,t.createElementVNode)(`button`,{id:`btn-fetch-epsg`,class:`mini-btn`,type:`button`,ref_key:`btnFetchEpsg`,ref:Se,onClick:Jn},`在线获取`,512)]),n[53]||=(0,t.createElementVNode)(`p`,{class:`tip`},`在线获取来自 epsg.io,需要联网。`,-1)])]),(0,t.createElementVNode)(`button`,{id:`btn-load`,class:`primary-btn`,type:`button`,ref_key:`btnLoad`,ref:Ce,onClick:et},`加载到地图`,512)],512)])],2),(0,t.createElementVNode)(`footer`,vS,[(0,t.createElementVNode)(`span`,{id:`status-coords`,class:`status-seg`,ref_key:`statusCoords`,ref:Ie},null,512),(0,t.createElementVNode)(`span`,{id:`status-scale`,class:`status-seg`,ref_key:`statusScale`,ref:Le},null,512),(0,t.createElementVNode)(`span`,yS,(0,t.toDisplayString)(y.value),1)]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,bS,[...n[55]||=[(0,t.createElementVNode)(`div`,null,`松开鼠标,加载地图文件`,-1)]],512),[[t.vShow,u.value]]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{id:`toast`,"data-type":x.value},(0,t.toDisplayString)(b.value),9,xS),[[t.vShow,S.value]])],6))}}),CS=[SS];e.MapViewVue3=SS,e.default={install:e=>{CS.forEach(t=>{e.component(t.name,t)})}}});
|
|
10
|
+
northing meters`+e;var f=d/2,p=0,m=0,h,g,_,v,y;return f>0&&(h=1e5/10**f,g=e.substring(a,a+f),p=parseFloat(g)*h,_=e.substring(a+f),m=parseFloat(_)*h),v=p+l,y=m+u,{easting:v,northing:y,zoneLetter:s,zoneNumber:o,accuracy:h}}function Dg(e,t){for(var n=og.charCodeAt(t-1),r=1e5,i=!1;n!==e.charCodeAt(0);){if(n++,n===lg&&n++,n===ug&&n++,n>fg){if(i)throw`Bad character: `+e;n=cg,i=!0}r+=1e5}return r}function Og(e,t){if(e>`V`)throw`MGRSPoint given invalid Northing `+e;for(var n=sg.charCodeAt(t-1),r=0,i=!1;n!==e.charCodeAt(0);){if(n++,n===lg&&n++,n===ug&&n++,n>dg){if(i)throw`Bad character: `+e;n=cg,i=!0}r+=1e5}return r}function kg(e){var t;switch(e){case`C`:t=11e5;break;case`D`:t=2e6;break;case`E`:t=28e5;break;case`F`:t=37e5;break;case`G`:t=46e5;break;case`H`:t=55e5;break;case`J`:t=64e5;break;case`K`:t=73e5;break;case`L`:t=82e5;break;case`M`:t=91e5;break;case`N`:t=0;break;case`P`:t=8e5;break;case`Q`:t=17e5;break;case`R`:t=26e5;break;case`S`:t=35e5;break;case`T`:t=44e5;break;case`U`:t=53e5;break;case`V`:t=62e5;break;case`W`:t=7e6;break;case`X`:t=79e5;break;default:t=-1}if(t>=0)return t;throw`Invalid zone letter: `+e}function Ag(e,t,n){if(!(this instanceof Ag))return new Ag(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e==`object`)this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e==`string`&&t===void 0){var r=e.split(`,`);this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=e,this.y=t,this.z=n||0;console.warn(`proj4.Point will be removed in version 3, use proj4.toPoint`)}Ag.fromMGRS=function(e){return new Ag(gg(e))},Ag.prototype.toMGRS=function(e){return mg([this.x,this.y],e)};var jg=1,Mg=.25,Ng=.046875,Pg=.01953125,Fg=.01068115234375,Ig=.75,Lg=.46875,Rg=.013020833333333334,zg=.007120768229166667,Bg=.3645833333333333,Vg=.005696614583333333,Hg=.3076171875;function Ug(e){var t=[];t[0]=jg-e*(Mg+e*(Ng+e*(Pg+e*Fg))),t[1]=e*(Ig-e*(Ng+e*(Pg+e*Fg)));var n=e*e;return t[2]=n*(Lg-e*(Rg+e*zg)),n*=e,t[3]=n*(Bg-e*Vg),t[4]=n*e*Hg,t}function Wg(e,t,n,r){return n*=t,t*=t,r[0]*e-n*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))}var Gg=20;function Kg(e,t,n){for(var r=1/(1-t),i=e,a=Gg;a;--a){var o=Math.sin(i),s=1-t*o*o;if(s=(Wg(i,o,Math.cos(i),n)-e)*(s*Math.sqrt(s))*r,i-=s,Math.abs(s)<1e-10)return i}return i}function qg(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.es&&(this.en=Ug(this.es),this.ml0=Wg(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Jg(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i,a,o,s=Math.sin(n),c=Math.cos(n);if(this.es){var l=c*r,u=l**2,d=this.ep2*c**2,f=d**2,p=(Math.abs(c)>1e-10?Math.tan(n):0)**2,m=p**2;i=1-this.es*s**2,l/=Math.sqrt(i);var h=Wg(n,s,c,this.en);a=this.a*(this.k0*l*(1+u/6*(1-p+d+u/20*(5-18*p+m+14*d-58*p*d+u/42*(61+179*m-m*p-479*p)))))+this.x0,o=this.a*(this.k0*(h-this.ml0+s*r*l/2*(1+u/12*(5-p+9*d+4*f+u/30*(61+m-58*p+270*d-330*p*d+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var g=c*Math.sin(r);if(Math.abs(Math.abs(g)-1)<1e-10)return 93;if(a=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,o=c*Math.cos(r)/Math.sqrt(1-g**2),g=Math.abs(o),g>=1){if(g-1>1e-10)return 93;o=0}else o=Math.acos(o);n<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return e.x=a,e.y=o,e}function Yg(e){var t,n,r,i,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(!this.es){var s=Math.exp(a/this.k0),c=.5*(s-1/s),l=this.lat0+o/this.k0,u=Math.cos(l);t=Math.sqrt((1-u**2)/(1+c**2)),r=Math.asin(t),o<0&&(r=-r),i=c===0&&u===0?0:Q(Math.atan2(c,u)+this.long0,this.over)}else if(t=this.ml0+o/this.k0,n=Kg(t,this.es,this.en),Math.abs(n)<X){var d=Math.sin(n),f=Math.cos(n),p=Math.abs(f)>1e-10?Math.tan(n):0,m=this.ep2*f**2,h=m**2,g=p**2,_=g**2;t=1-this.es*d**2;var v=a*Math.sqrt(t)/this.k0,y=v**2;t*=p,r=n-t*y/(1-this.es)*.5*(1-y/12*(5+3*g-9*m*g+m-4*h-y/30*(61+90*g-252*m*g+45*_+46*m-y/56*(1385+3633*g+4095*_+1574*_*g)))),i=Q(this.long0+v*(1-y/6*(1+2*g+m-y/20*(5+28*g+24*_+8*m*g+6*m-y/42*(61+662*g+1320*_+720*_*g))))/f,this.over)}else r=X*Jm(o),i=0;return e.x=i,e.y=r,e}var Xg={init:qg,forward:Jg,inverse:Yg,names:[`Fast_Transverse_Mercator`,`Fast Transverse Mercator`]};function Zg(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function Qg(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),r=Math.min(e,t)/(n||1);return n*Math.sqrt(1+r**2)}function $g(e){var t=1+e,n=t-1;return n===0?e:e*Math.log(t)/n}function e_(e){var t=Math.abs(e);return t=$g(t*(1+t/(Qg(1,t)+1))),e<0?-t:t}function t_(e,t){for(var n=2*Math.cos(2*t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return t+o*Math.sin(2*t)}function n_(e,t){for(var n=2*Math.cos(t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return Math.sin(t)*o}function r_(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function i_(e,t,n){for(var r=Math.sin(t),i=Math.cos(t),a=Zg(n),o=r_(n),s=2*i*o,c=-2*r*a,l=e.length-1,u=e[l],d=0,f=0,p=0,m,h;--l>=0;)m=f,h=d,f=u,d=p,u=-m+s*f-c*d+e[l],p=-h+c*f+s*d;return s=r*o,c=i*a,[s*u-c*p,s*p+c*u]}function a_(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw Error(`Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.`);this.approx&&(Xg.init.apply(this),this.forward=Xg.forward,this.inverse=Xg.inverse),this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.k0=this.k0===void 0?1:this.k0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+-2854/675*t))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+4642/4725*t))))),n*=t,this.cgb[1]=n*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+2323/945*t)))),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+-1522/945*t)))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+73814/2835*t))),this.cbg[2]=n*(-26/15+t*(34/21+t*(8/5+-12686/2835*t))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+-399572/14175*t)),this.cbg[3]=n*(1237/630+t*(-12/5+-24832/14175*t)),n*=t,this.cgb[4]=n*(4174/315+-144838/6237*t),this.cbg[4]=n*(-734/315+109598/31185*t),n*=t,this.cgb[5]=601676/22275*n,this.cbg[5]=444337/155925*n,n=t**2,this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+-96199/604800*t))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+7891/37800*t))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+1118711/3870720*t)))),this.gtu[1]=n*(13/48+t*(-3/5+t*(557/1440+t*(281/630+-1983433/1935360*t)))),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+-5569/90720*t))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+167603/181440*t))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+830251/7257600*t)),this.gtu[3]=n*(49561/161280+t*(-179/168+6601661/7257600*t)),n*=t,this.utg[4]=n*(-4583/161280+108847/3991680*t),this.gtu[4]=n*(34729/80640+-3418889/1995840*t),n*=t,this.utg[5]=-20648693/638668800*n,this.gtu[5]=212378941/319334400*n;var r=t_(this.cbg,this.lat0);this.Zb=-this.Qn*(r+n_(this.gtu,2*r))}function o_(e){var t=Q(e.x-this.long0,this.over),n=e.y;n=t_(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),a=Math.sin(t),o=Math.cos(t);n=Math.atan2(r,o*i),t=Math.atan2(a*i,Qg(r,i*o)),t=e_(Math.tan(t));var s=i_(this.gtu,2*n,2*t);n+=s[0],t+=s[1];var c,l;return Math.abs(t)<=2.623395162778?(c=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(c=1/0,l=1/0),e.x=c,e.y=l,e}function s_(e){var t=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,t/=this.Qn;var r,i;if(Math.abs(t)<=2.623395162778){var a=i_(this.utg,2*n,2*t);n+=a[0],t+=a[1],t=Math.atan(Zg(t));var o=Math.sin(n),s=Math.cos(n),c=Math.sin(t),l=Math.cos(t);n=Math.atan2(o*l,Qg(c,l*s)),t=Math.atan2(c,l*s),r=Q(t+this.long0,this.over),i=t_(this.cgb,n)}else r=1/0,i=1/0;return e.x=r,e.y=i,e}var c_={init:a_,forward:o_,inverse:s_,names:[`Extended_Transverse_Mercator`,`Extended Transverse Mercator`,`etmerc`,`Transverse_Mercator`,`Transverse Mercator`,`Gauss Kruger`,`Gauss_Kruger`,`tmerc`]};function l_(e,t){if(e===void 0){if(e=Math.floor((Q(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var u_=`etmerc`;function d_(){var e=l_(this.zone,this.long0);if(e===void 0)throw Error(`unknown utm zone`);this.lat0=0,this.long0=(6*Math.abs(e)-183)*Zp,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,c_.init.apply(this),this.forward=c_.forward,this.inverse=c_.inverse}var f_={init:d_,names:[`Universal Transverse Mercator System`,`utm`],dependsOn:u_};function p_(e,t){return((1-e)/(1+e))**t}var m_=20;function h_(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Z)/(Math.tan(.5*this.lat0+Z)**+this.C*p_(this.e*e,this.ratexp))}function g_(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.tan(.5*n+Z)**+this.C*p_(this.e*Math.sin(n),this.ratexp))-X,e.x=this.C*t,e}function __(e){for(var t=1e-14,n=e.x/this.C,r=e.y,i=(Math.tan(.5*r+Z)/this.K)**(1/this.C),a=m_;a>0&&(r=2*Math.atan(i*p_(this.e*Math.sin(e.y),-.5*this.e))-X,!(Math.abs(r-e.y)<t));--a)e.y=r;return a?(e.x=n,e.y=r,e):null}var v_={init:h_,forward:g_,inverse:__,names:[`gauss`]};function y_(){v_.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||=`Oblique Stereographic Alternative`)}function b_(e){var t,n,r,i;return e.x=Q(e.x-this.long0,this.over),v_.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*r),e.x=i*n*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*n*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function x_(e){var t,n,r,i,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=Qg(e.x,e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),n=Math.cos(o),i=Math.asin(n*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*n-e.y*this.sinc0*t)}else i=this.phic0,r=0;return e.x=r,e.y=i,v_.inverse.apply(this,[e]),e.x=Q(e.x+this.long0,this.over),e}var S_={init:y_,forward:b_,inverse:x_,names:[`Stereographic_North_Pole`,`Oblique_Stereographic`,`sterea`,`Oblique Stereographic Alternative`,`Double_Stereographic`]};function C_(e,t,n){return t*=n,Math.tan(.5*(X+e))*((1-t)/(1+t))**(.5*n)}function w_(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+Jm(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt((1+this.e)**+(1+this.e)*(1-this.e)**(1-this.e)),!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*qm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ym(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=qm(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(C_(this.lat0,this.sinlat0,this.e))-X,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function T_(e){var t=e.x,n=e.y,r=Math.sin(n),i=Math.cos(n),a,o,s,c,l,u,d=Q(t-this.long0,this.over);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=1e-10&&Math.abs(n+this.lat0)<=1e-10?(e.x=NaN,e.y=NaN,e):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(d)),e.x=this.a*a*i*Math.sin(d)+this.x0,e.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(d))+this.y0,e):(o=2*Math.atan(C_(n,r,this.e))-X,c=Math.cos(o),s=Math.sin(o),Math.abs(this.coslat0)<=1e-10?(l=Ym(this.e,n*this.con,this.con*r),u=2*this.a*this.k0*l/this.cons,e.x=this.x0+u*Math.sin(t-this.long0),e.y=this.y0-this.con*u*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<1e-10?(a=2*this.a*this.k0/(1+c*Math.cos(d)),e.y=a*s):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*c*Math.cos(d))),e.y=a*(this.cosX0*s-this.sinX0*c*Math.cos(d))+this.y0),e.x=a*c*Math.sin(d)+this.x0,e))}function E_(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,n=this.lat0,o<=1e-10?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<1e-10?this.lat0>0?Q(this.long0+Math.atan2(e.x,-1*e.y),this.over):Q(this.long0+Math.atan2(e.x,e.y),this.over):Q(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s)),this.over),e.x=t,e.y=n,e)}if(Math.abs(this.coslat0)<=1e-10){if(o<=1e-10)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),n=this.con*Xm(this.e,r),t=this.con*Q(this.con*this.long0+Math.atan2(e.x,-1*e.y),this.over)}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=1e-10?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/o),t=Q(this.long0+Math.atan2(e.x*Math.sin(i),o*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)),this.over)),n=-1*Xm(this.e,Math.tan(.5*(X+a)));return e.x=t,e.y=n,e}var D_={init:w_,forward:T_,inverse:E_,names:[`stere`,`Stereographic_South_Pole`,`Polar_Stereographic_variant_A`,`Polar_Stereographic_variant_B`,`Polar_Stereographic`],ssfn_:C_};function O_(){this.k0||=1;var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,r=1/this.rf,i=2*r-r**2,a=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*t**2),this.alpha=Math.sqrt(1+i/(1-i)*Math.cos(e)**4),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),c=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*c}function k_(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e}function A_(e){for(var t=e.x-this.x0,n=e.y-this.y0,r=t/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,c=0,l=a,u=-1e3,d=0;Math.abs(l-u)>1e-7;){if(++d>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(c))-Math.PI/2}return e.x=s,e.y=l,e}var j_={init:O_,forward:k_,inverse:A_,names:[`somerc`]},M_=1e-7;function N_(e){var t=[`Hotine_Oblique_Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`],n=typeof e.projName==`object`?Object.keys(e.projName)[0]:e.projName;return`no_uoff`in e||`no_off`in e||t.indexOf(n)!==-1||t.indexOf(ch(n))!==-1}function P_(){var e,t,n,r,i,a,o,s,c,l,u=0,d,f=0,p=0,m=0,h=0,g=0,_=0;this.k0||=1,this.no_off=N_(this),this.no_rot=`no_rot`in this;var v=!1;`alpha`in this&&(v=!0);var y=!1;if(`rectified_grid_angle`in this&&(y=!0),v&&(_=this.alpha),y&&(u=this.rectified_grid_angle,v||=(_=0,!0)),v||y)f=this.longc;else if(p=this.long1,h=this.lat1,m=this.long2,g=this.lat2,Math.abs(h-g)<=M_||(e=Math.abs(h))<=M_||Math.abs(e-X)<=M_||Math.abs(Math.abs(this.lat0)-X)<=M_||Math.abs(Math.abs(g)-X)<=M_)throw Error();var b=1-this.es;t=Math.sqrt(b),Math.abs(this.lat0)>1e-10?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),e=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*t/e,r=this.B*t/(n*Math.sqrt(e)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Ym(this.e,this.lat0,s)**+this.B):(this.B=1/t,this.A=this.k0,this.E=r=i=1),v||y?(v?(d=Math.asin(Math.sin(_)/r),y||(u=_)):(d=u,_=Math.asin(r*Math.sin(d))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(d))/this.B):(a=Ym(this.e,h,Math.sin(h))**+this.B,o=Ym(this.e,g,Math.sin(g))**+this.B,i=this.E/a,c=(o-a)/(o+a),l=this.E*this.E,l=(l-o*a)/(l+o*a),e=p-m,e<-Math.PI?m-=$p:e>Math.PI&&(m+=$p),this.lam0=Q(.5*(p+m)-Math.atan(l*Math.tan(.5*this.B*(p-m))/c)/this.B,this.over),d=Math.atan(2*Math.sin(this.B*Q(p-this.lam0,this.over))/(i-1/i)),u=_=Math.asin(r*Math.sin(d))),this.singam=Math.sin(d),this.cosgam=Math.cos(d),this.sinrot=Math.sin(u),this.cosrot=Math.cos(u),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(_))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*d,this.v_pole_n=this.ArB*Math.log(Math.tan(Z-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(Z+i))}function F_(e){var t={},n,r,i,a,o,s,c,l;if(e.x-=this.lam0,Math.abs(Math.abs(e.y)-X)>1e-10){if(o=this.E/Ym(this.e,e.y,Math.sin(e.y))**+this.B,s=1/o,n=.5*(o-s),r=.5*(o+s),a=Math.sin(this.B*e.x),i=(n*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)<1e-10)throw Error();l=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*e.x),c=Math.abs(s)<M_?this.A*e.x:this.ArB*Math.atan2(n*this.cosgam+a*this.singam,s)}else l=e.y>0?this.v_pole_n:this.v_pole_s,c=this.ArB*e.y;return this.no_rot?(t.x=c,t.y=l):(c-=this.u_0,t.x=l*this.cosrot+c*this.sinrot,t.y=c*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,e.z!==void 0&&(t.z=e.z),e.m!==void 0&&(t.m=e.m),t}function I_(e){var t,n,r,i,a,o,s,c={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(n=e.y,t=e.x):(n=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),i=.5*(r-1/r),a=.5*(r+1/r),o=Math.sin(this.BrA*t),s=(o*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(s)-1)<1e-10)c.x=0,c.y=s<0?-X:X;else{if(c.y=this.E/Math.sqrt((1+s)/(1-s)),c.y=Xm(this.e,c.y**(1/this.B)),c.y===1/0)throw Error();c.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return c.x+=this.lam0,e.z!==void 0&&(c.z=e.z),e.m!==void 0&&(c.m=e.m),c}var L_={init:P_,forward:F_,inverse:I_,names:[`Hotine_Oblique_Mercator`,`Hotine Oblique Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Variant_B`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`,`Hotine_Oblique_Mercator_Two_Point_Natural_Origin`,`Hotine_Oblique_Mercator_Azimuth_Center`,`Oblique_Mercator`,`omerc`]};function R_(){if(this.lat2||=this.lat1,this.k0||=1,this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),r=qm(this.e,t,n),i=Ym(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=qm(this.e,a,o),c=Ym(this.e,this.lat2,a),l=Ym(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>1e-10?Math.log(r/s)/Math.log(i/c):t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*i**+this.ns),this.rh=Math.abs(Math.abs(this.lat0)-X)<1e-10?0:this.a*this.f0*l**+this.ns,this.title||=`Lambert Conformal Conic`}}function z_(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=Jm(n)*(X-2*Xp));var r=Math.abs(Math.abs(n)-X),i,a;if(r>1e-10)i=Ym(this.e,n,Math.sin(n)),a=this.a*this.f0*i**+this.ns;else{if(r=n*this.ns,r<=0)return null;a=0}var o=this.ns*Q(t-this.long0,this.over);return e.x=this.k0*(a*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-a*Math.cos(o))+this.y0,e}function B_(e){var t,n,r,i,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),n=1):(t=-Math.sqrt(o*o+s*s),n=-1);var c=0;if(t!==0&&(c=Math.atan2(n*o,n*s)),t!==0||this.ns>0){if(n=1/this.ns,r=(t/(this.a*this.f0))**+n,i=Xm(this.e,r),i===-9999)return null}else i=-X;return a=Q(c/this.ns+this.long0,this.over),e.x=a,e.y=i,e}var V_={init:R_,forward:z_,inverse:B_,names:[`Lambert Tangential Conformal Conic Projection`,`Lambert_Conformal_Conic`,`Lambert_Conformal_Conic_1SP`,`Lambert_Conformal_Conic_2SP`,`lcc`,`Lambert Conic Conformal (1SP)`,`Lambert Conic Conformal (2SP)`]};function H_(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||=.863937979737193,this.long0||=.4334234309119251,this.k0||=.9999,this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.cos(this.fi0)**4/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)))**(this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.tan(this.fi0/2+this.s45)**+this.alfa*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.sin(this.fi0)**2),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function U_(e){var t,n,r,i,a,o,s,c=e.x,l=e.y,u=Q(c-this.long0,this.over);return t=((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)))**(this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.tan(l/2+this.s45)**+this.alfa/t)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),a=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.tan(this.s0/2+this.s45)**+this.n/Math.tan(i/2+this.s45)**+this.n,e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e}function W_(e){var t,n,r,i,a,o,s,c,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),a=Math.atan2(e.y,e.x),i=a/Math.sin(this.s0),r=2*(Math.atan((this.ro0/o)**(1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(t)),e.x=this.long0-n/this.alfa,s=t,c=0;var u=0;do e.y=2*(Math.atan(this.k**(-1/this.alfa)*Math.tan(t/2+this.s45)**(1/this.alfa)*((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)))**(this.e/2))-this.s45),Math.abs(s-e.y)<1e-10&&(c=1),s=e.y,u+=1;while(c===0&&u<15);return u>=15?null:e}var G_={init:H_,forward:U_,inverse:W_,names:[`Krovak`,`Krovak Modified`,`Krovak (North Orientated)`,`Krovak Modified (North Orientated)`,`krovak`]};function K_(e,t,n,r,i){return e*i-t*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function q_(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function J_(e){return .375*e*(1+.25*e*(1+.46875*e))}function Y_(e){return .05859375*e*e*(1+.75*e)}function X_(e){return e*e*e*(35/3072)}function Z_(e,t,n){var r=t*n;return e/Math.sqrt(1-r*r)}function Q_(e){return Math.abs(e)<X?e:e-Jm(e)*Math.PI}function $_(e,t,n,r,i){for(var a=e/t,o,s=0;s<15;s++)if(o=(e-(t*a-n*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(t-2*n*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=o,Math.abs(o)<=1e-10)return a;return NaN}function ev(){this.sphere||(this.e0=q_(this.es),this.e1=J_(this.es),this.e2=Y_(this.es),this.e3=X_(this.es),this.ml0=this.a*K_(this.e0,this.e1,this.e2,this.e3,this.lat0))}function tv(e){var t,n,r=e.x,i=e.y;if(r=Q(r-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),o=Math.cos(i),s=Z_(this.a,this.e,a),c=Math.tan(i)*Math.tan(i),l=r*Math.cos(i),u=l*l,d=this.es*o*o/(1-this.es),f=this.a*K_(this.e0,this.e1,this.e2,this.e3,i);t=s*l*(1-u*c*(1/6-(8-c+8*d)*u/120)),n=f-this.ml0+s*a/o*u*(.5+(5-c+6*d)*u/24)}return e.x=t+this.x0,e.y=n+this.y0,e}function nv(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i;if(this.sphere){var a=n+this.lat0;r=Math.asin(Math.sin(a)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(a))}else{var o=$_(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-X)<=1e-10)return e.x=this.long0,e.y=X,n<0&&(e.y*=-1),e;var s=Z_(this.a,this.e,Math.sin(o)),c=s*s*s/this.a/this.a*(1-this.es),l=Math.tan(o)**2,u=t*this.a/s,d=u*u;r=o-s*Math.tan(o)/c*u*u*(.5-(1+3*l)*u*u/24),i=u*(1-d*(l/3+(1+3*l)*l*d/15))/Math.cos(o)}return e.x=Q(i+this.long0,this.over),e.y=Q_(r),e}var rv={init:ev,forward:tv,inverse:nv,names:[`Cassini`,`Cassini_Soldner`,`cass`]};function iv(e,t){var n;return e>1e-7?(n=e*t,(1-e*e)*(t/(1-n*n)-.5/e*Math.log((1-n)/(1+n)))):2*t}var av=.3333333333333333,ov=.17222222222222222,sv=.10257936507936508,cv=.06388888888888888,lv=.0664021164021164,uv=.016415012942191543;function dv(e){var t,n=[];return n[0]=e*av,t=e*e,n[0]+=t*ov,n[1]=t*cv,t*=e,n[0]+=t*sv,n[1]+=t*lv,n[2]=t*uv,n}function fv(e,t){var n=e+e;return e+t[0]*Math.sin(n)+t[1]*Math.sin(n+n)+t[2]*Math.sin(n+n+n)}function pv(){var e=Math.abs(this.lat0);if(this.mode=Math.abs(e-X)<1e-10?this.lat0<0?1:2:Math.abs(e)<1e-10?3:4,this.es>0){var t;switch(this.qp=iv(this.e,1),this.mmf=.5/(1-this.es),this.apa=dv(this.es),this.mode){case 2:this.dd=1;break;case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=iv(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===4&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function mv(e){var t,n,r,i,a,o,s,c,l,u,d=e.x,f=e.y;if(d=Q(d-this.long0,this.over),this.sphere){if(a=Math.sin(f),u=Math.cos(f),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*a+this.cosph0*u*r,n<=1e-10)return null;n=Math.sqrt(2/n),t=n*u*Math.sin(d),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<1e-10)return null;n=Z-f*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),t=n*Math.sin(d),n*=r}}else{switch(s=0,c=0,l=0,r=Math.cos(d),i=Math.sin(d),a=Math.sin(f),o=iv(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=o/this.qp,c=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:l=1+this.sinb1*s+this.cosb1*c*r;break;case this.EQUIT:l=1+c*r;break;case this.N_POLE:l=X+f,o=this.qp-o;break;case this.S_POLE:l=f-X,o=this.qp+o}if(Math.abs(l)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),n=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*s-this.sinb1*c*r):(l=Math.sqrt(2/(1+c*r)))*s*this.ymf,t=this.xmf*l*c*i;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(l=Math.sqrt(o))*i,n=r*(this.mode===this.S_POLE?l:-l)):t=n=0}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e}function hv(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i,a,o,s,c,l;if(this.sphere){var u=0,d,f=0;if(d=Math.sqrt(t*t+n*n),i=d*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),u=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(d)<=1e-10?0:Math.asin(n*f/d),t*=f,n=u*d;break;case this.OBLIQ:i=Math.abs(d)<=1e-10?this.lat0:Math.asin(u*this.sinph0+n*f*this.cosph0/d),t*=f*this.cosph0,n=(u-Math.sin(i)*this.sinph0)*d;break;case this.N_POLE:n=-n,i=X-i;break;case this.S_POLE:i-=X}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,n)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,n*=this.dd,c=Math.sqrt(t*t+n*n),c<1e-10)return e.x=this.long0,e.y=this.lat0,e;o=2*Math.asin(.5*c/this.rq),a=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(l=a*this.sinb1+n*o*this.cosb1/c,s=this.qp*l,n=c*this.cosb1*a-n*this.sinb1*o):(l=n*o/c,s=this.qp*l,n=c*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),s=t*t+n*n,!s)return e.x=this.long0,e.y=this.lat0,e;l=1-s/this.qp,this.mode===this.S_POLE&&(l=-l)}r=Math.atan2(t,n),i=fv(Math.asin(l),this.apa)}return e.x=Q(this.long0+r,this.over),e.y=i,e}var gv={init:pv,forward:mv,inverse:hv,names:[`Lambert Azimuthal Equal Area`,`Lambert_Azimuthal_Equal_Area`,`laea`],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function _v(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function vv(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-this.temp**2,this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=qm(this.e3,this.sin_po,this.cos_po),this.qs1=iv(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=qm(this.e3,this.sin_po,this.cos_po),this.qs2=iv(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=iv(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>1e-10?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function yv(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=iv(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*Q(t-this.long0,this.over),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return e.x=o,e.y=s,e}function bv(e){var t,n,r,i,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),i=0,t!==0&&(i=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,n)),a=Q(i/this.ns0+this.long0,this.over),e.x=a,e.y=o,e}function xv(e,t){var n,r,i,a,o,s=_v(.5*t);if(e<1e-10)return s;for(var c=e*e,l=1;l<=25;l++)if(n=Math.sin(s),r=Math.cos(s),i=e*n,a=1-i*i,o=.5*a*a/r*(t/(1-c)-n/a+.5/e*Math.log((1-i)/(1+i))),s+=o,Math.abs(o)<=1e-7)return s;return null}var Sv={init:vv,forward:yv,inverse:bv,names:[`Albers_Conic_Equal_Area`,`Albers_Equal_Area`,`Albers`,`aea`],phi1z:xv};function Cv(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function wv(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=Q(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,o>0||Math.abs(o)<=1e-10?(s=this.x0+this.a*a*n*Math.sin(r)/o,c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)/o):(s=this.x0+this.infinity_dist*n*Math.sin(r),c=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function Tv(e){var t,n,r,i,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),n=Math.sin(i),r=Math.cos(i),o=_v(r*this.sin_p14+e.y*n*this.cos_p14/t),a=Math.atan2(e.x*n,t*this.cos_p14*r-e.y*this.sin_p14*n),a=Q(this.long0+a,this.over)):(o=this.phic0,a=0),e.x=a,e.y=o,e}var Ev={init:Cv,forward:wv,inverse:Tv,names:[`gnom`]};function Dv(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*X:X;for(var r=Math.asin(.5*t),i,a,o,s,c=0;c<30;c++)if(a=Math.sin(r),o=Math.cos(r),s=e*a,i=(1-s*s)**2/(2*o)*(t/(1-e*e)-a/(1-s*s)+.5/e*Math.log((1-s)/(1+s))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function Ov(){this.sphere||(this.k0=qm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function kv(e){var t=e.x,n=e.y,r,i,a=Q(t-this.long0,this.over);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=iv(this.e,Math.sin(n));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return e.x=r,e.y=i,e}function Av(e){e.x-=this.x0,e.y-=this.y0;var t,n;return this.sphere?(t=Q(this.long0+e.x/this.a/Math.cos(this.lat_ts),this.over),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=Dv(this.e,2*e.y*this.k0/this.a),t=Q(this.long0+e.x/(this.a*this.k0),this.over)),e.x=t,e.y=n,e}var jv={init:Ov,forward:kv,inverse:Av,names:[`cea`]};function Mv(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Equidistant Cylindrical (Plate Carre)`,this.rc=Math.cos(this.lat_ts)}function Nv(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i=Q_(n-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*i,e}function Pv(e){var t=e.x,n=e.y;return e.x=Q(this.long0+(t-this.x0)/(this.a*this.rc),this.over),e.y=Q_(this.lat0+(n-this.y0)/this.a),e}var Fv={init:Mv,forward:Nv,inverse:Pv,names:[`Equirectangular`,`Equidistant_Cylindrical`,`Equidistant_Cylindrical_Spherical`,`eqc`]},Iv=20;function Lv(){this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=q_(this.es),this.e1=J_(this.es),this.e2=Y_(this.es),this.e3=X_(this.es),this.ml0=this.a*K_(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Rv(e){var t=e.x,n=e.y,r,i,a,o=Q(t-this.long0,this.over);if(a=o*Math.sin(n),this.sphere)Math.abs(n)<=1e-10?(r=this.a*o,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(n),i=this.a*(Q_(n-this.lat0)+(1-Math.cos(a))/Math.tan(n)));else if(Math.abs(n)<=1e-10)r=this.a*o,i=-1*this.ml0;else{var s=Z_(this.a,this.e,Math.sin(n))/Math.tan(n);r=s*Math.sin(a),i=this.a*K_(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(a))}return e.x=r+this.x0,e.y=i+this.y0,e}function zv(e){var t,n,r=e.x-this.x0,i=e.y-this.y0,a,o,s,c,l;if(this.sphere){if(Math.abs(i+this.a*this.lat0)<=1e-10)t=Q(r/this.a+this.long0,this.over),n=0;else{o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,c=o;var u;for(a=Iv;a;--a)if(u=Math.tan(c),l=-1*(o*(c*u+1)-c-.5*(c*c+s)*u)/((c-o)/u-1),c+=l,Math.abs(l)<=1e-10){n=c;break}t=Q(this.long0+Math.asin(r*Math.tan(c)/this.a)/Math.sin(n),this.over)}}else if(Math.abs(i+this.ml0)<=1e-10)n=0,t=Q(this.long0+r/this.a,this.over);else{o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,c=o;var d,f,p,m,h;for(a=Iv;a;--a)if(h=this.e*Math.sin(c),d=Math.sqrt(1-h*h)*Math.tan(c),f=this.a*K_(this.e0,this.e1,this.e2,this.e3,c),p=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),m=f/this.a,l=(o*(d*m+1)-m-.5*d*(m*m+s))/(this.es*Math.sin(2*c)*(m*m+s-2*o*m)/(4*d)+(o-m)*(d*p-2/Math.sin(2*c))-p),c-=l,Math.abs(l)<=1e-10){n=c;break}d=Math.sqrt(1-this.es*Math.sin(n)**2)*Math.tan(n),t=Q(this.long0+Math.asin(r*d/this.a)/Math.sin(n),this.over)}return e.x=t,e.y=n,e}var Bv={init:Lv,forward:Rv,inverse:zv,names:[`Polyconic`,`American_Polyconic`,`poly`]};function Vv(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Hv(e){var t,n=e.x,r=e.y-this.lat0,i=n-this.long0,a=r/Kp*1e-5,o=i,s=1,c=0;for(t=1;t<=10;t++)s*=a,c+=this.A[t]*s;var l=c,u=o,d=1,f=0,p,m,h=0,g=0;for(t=1;t<=6;t++)p=d*l-f*u,m=f*l+d*u,d=p,f=m,h=h+this.B_re[t]*d-this.B_im[t]*f,g=g+this.B_im[t]*d+this.B_re[t]*f;return e.x=g*this.a+this.x0,e.y=h*this.a+this.y0,e}function Uv(e){var t,n=e.x,r=e.y,i=n-this.x0,a=(r-this.y0)/this.a,o=i/this.a,s=1,c=0,l,u,d=0,f=0;for(t=1;t<=6;t++)l=s*a-c*o,u=c*a+s*o,s=l,c=u,d=d+this.C_re[t]*s-this.C_im[t]*c,f=f+this.C_im[t]*s+this.C_re[t]*c;for(var p=0;p<this.iterations;p++){var m=d,h=f,g,_,v=a,y=o;for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,v+=(t-1)*(this.B_re[t]*m-this.B_im[t]*h),y+=(t-1)*(this.B_im[t]*m+this.B_re[t]*h);m=1,h=0;var b=this.B_re[1],x=this.B_im[1];for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,b+=t*(this.B_re[t]*m-this.B_im[t]*h),x+=t*(this.B_im[t]*m+this.B_re[t]*h);var S=b*b+x*x;d=(v*b+y*x)/S,f=(y*b-v*x)/S}var C=d,w=f,T=1,E=0;for(t=1;t<=9;t++)T*=C,E+=this.D[t]*T;var D=this.lat0+E*Kp*1e5;return e.x=this.long0+w,e.y=D,e}var Wv={init:Vv,forward:Hv,inverse:Uv,names:[`New_Zealand_Map_Grid`,`nzmg`],iterations:1};function Gv(){}function Kv(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=i,e.y=a,e}function qv(e){e.x-=this.x0,e.y-=this.y0;var t=Q(this.long0+e.x/this.a,this.over),n=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=n,e}var Jv={init:Gv,forward:Kv,inverse:qv,names:[`Miller_Cylindrical`,`mill`]},Yv=20;function Xv(){this.long0=this.long0||0,this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ug(this.es)}function Zv(e){var t,n,r=e.x,i=e.y;if(r=Q(r-this.long0,this.over),this.sphere){if(!this.m)i=this.n===1?i:Math.asin(this.n*Math.sin(i));else for(var a=this.n*Math.sin(i),o=Yv;o;--o){var s=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<1e-10)break}t=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var c=Math.sin(i),l=Math.cos(i);n=this.a*Wg(i,c,l,this.en),t=this.a*r*l/Math.sqrt(1-this.es*c*c)}return e.x=t,e.y=n,e}function Qv(e){var t,n,r,i;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=_v((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=_v(Math.sin(t)/this.n)),r=Q(r+this.long0,this.over),t=Q_(t)):(t=Kg(e.y/this.a,this.es,this.en),i=Math.abs(t),i<X?(i=Math.sin(t),n=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),r=Q(n,this.over)):i-1e-10<X&&(r=this.long0)),e.x=r,e.y=t,e}var $v={init:Xv,forward:Zv,inverse:Qv,names:[`Sinusoidal`,`sinu`]};function ey(){this.sphere=!0,this.b=this.a,this.m=1,this.n=2.5707963267948966,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)}var ty={init:ey,forward:Zv,inverse:Qv,names:[`Eckert_VI`,`eck6`]};function ny(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0}function ry(e){for(var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i=n,a=Math.PI*Math.sin(n);;){var o=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=o,Math.abs(o)<1e-10)break}i/=2,Math.PI/2-Math.abs(n)<1e-10&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,c=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=c,e}function iy(e){var t,n;e.x-=this.x0,e.y-=this.y0,n=e.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),t=Math.asin(n);var r=Q(this.long0+e.x/(.900316316158*this.a*Math.cos(t)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return e.x=r,e.y=i,e}var ay={init:ny,forward:ry,inverse:iy,names:[`Mollweide`,`moll`]};function oy(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=q_(this.es),this.e1=J_(this.es),this.e2=Y_(this.es),this.e3=X_(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=qm(this.e,this.sin_phi,this.cos_phi),this.ml1=K_(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=qm(this.e,this.sin_phi,this.cos_phi),this.ml2=K_(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=K_(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function sy(e){var t=e.x,n=e.y,r;if(this.sphere)r=this.a*(this.g-n);else{var i=K_(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-i)}var a=this.ns*Q(t-this.long0,this.over),o=this.x0+r*Math.sin(a),s=this.y0+this.rh-r*Math.cos(a);return e.x=o,e.y=s,e}function cy(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,n,r,i;this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;return n!==0&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=Q(this.long0+a/this.ns,this.over),r=Q_(this.g-n/this.a),e.x=i,e.y=r,e):(r=$_(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=Q(this.long0+a/this.ns,this.over),e.x=i,e.y=r,e)}var ly={init:oy,forward:sy,inverse:cy,names:[`Equidistant_Conic`,`eqdc`]};function uy(){this.R=this.a}function dy(e){var t=e.x,n=e.y,r=Q(t-this.long0,this.over),i,a;if(Math.abs(n)<=1e-10)return i=this.x0+this.R*r,a=this.y0,e.x=i,e.y=a,e;var o=_v(2*Math.abs(n/Math.PI));if(Math.abs(r)<=1e-10||Math.abs(Math.abs(n)-X)<=1e-10)return i=this.x0,a=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o),e.x=i,e.y=a,e;var s=.5*Math.abs(Math.PI/r-r/Math.PI),c=s*s,l=Math.sin(o),u=Math.cos(o),d=u/(l+u-1),f=d*d,p=d*(2/l-1),m=p*p,h=Math.PI*this.R*(s*(d-m)+Math.sqrt(c*(d-m)*(d-m)-(m+c)*(f-m)))/(m+c);r<0&&(h=-h),i=this.x0+h;var g=c+d;return h=Math.PI*this.R*(p*g-s*Math.sqrt((m+c)*(c+1)-g*g))/(m+c),a=n>=0?this.y0+h:this.y0-h,e.x=i,e.y=a,e}function fy(e){var t,n,r,i,a,o,s,c,l,u,d,f,p;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,r=e.x/d,i=e.y/d,a=r*r+i*i,o=-Math.abs(i)*(1+a),s=o-2*i*i+r*r,c=-2*o+1+2*i*i+a*a,p=i*i/c+(2*s*s*s/c/c/c-9*o*s/c/c)/27,l=(o-s*s/3/c)/c,u=2*Math.sqrt(-l/3),d=3*p/l/u,Math.abs(d)>1&&(d=d>=0?1:-1),f=Math.acos(d)/3,n=e.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI,t=Math.abs(r)<1e-10?this.long0:Q(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r,this.over),e.x=t,e.y=n,e}var py={init:uy,forward:dy,inverse:fy,names:[`Van_der_Grinten_I`,`VanDerGrinten`,`Van_der_Grinten`,`vandg`]};function my(e,t,n,r,i,a){let o=r-t,s=Math.atan((1-a)*Math.tan(e)),c=Math.atan((1-a)*Math.tan(n)),l=Math.sin(s),u=Math.cos(s),d=Math.sin(c),f=Math.cos(c),p=o,m,h=100,g,_,v,y,b,x,S,C,w,T,E,D,O,k;do{if(g=Math.sin(p),_=Math.cos(p),v=Math.sqrt(f*g*(f*g)+(u*d-l*f*_)*(u*d-l*f*_)),v===0)return{azi1:0,s12:0};y=l*d+u*f*_,b=Math.atan2(v,y),x=u*f*g/v,S=1-x*x,C=S===0?0:y-2*l*d/S,w=a/16*S*(4+a*(4-3*S)),m=p,p=o+(1-w)*a*x*(b+w*v*(C+w*y*(-1+2*C*C)))}while(Math.abs(p-m)>1e-12&&--h>0);return h===0?{azi1:NaN,s12:NaN}:(T=S*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),E=1+T/16384*(4096+T*(-768+T*(320-175*T))),D=T/1024*(256+T*(-128+T*(74-47*T))),O=D*v*(C+D/4*(y*(-1+2*C*C)-D/6*C*(-3+4*v*v)*(-3+4*C*C))),k=i*(1-a)*E*(b-O),{azi1:Math.atan2(f*g,u*d-l*f*_),s12:k})}function hy(e,t,n,r,i,a){let o=Math.atan((1-a)*Math.tan(e)),s=Math.sin(o),c=Math.cos(o),l=Math.sin(n),u=Math.cos(n),d=Math.atan2(s,c*u),f=c*l,p=1-f*f,m=p*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),h=1+m/16384*(4096+m*(-768+m*(320-175*m))),g=m/1024*(256+m*(-128+m*(74-47*m))),_=r/(i*(1-a)*h),v,y=100,b,x,S,C;do b=Math.cos(2*d+_),x=Math.sin(_),S=Math.cos(_),C=g*x*(b+g/4*(S*(-1+2*b*b)-g/6*b*(-3+4*x*x)*(-3+4*b*b))),v=_,_=r/(i*(1-a)*h)+C;while(Math.abs(_-v)>1e-12&&--y>0);if(y===0)return{lat2:NaN,lon2:NaN};let w=s*x-c*S*u,T=Math.atan2(s*S+c*x*u,(1-a)*Math.sqrt(f*f+w*w)),E=Math.atan2(x*l,c*S-s*x*u),D=a/16*p*(4+a*(4-3*p));return{lat2:T,lon2:t+(E-(1-D)*a*f*(_+D*x*(b+D*S*(-1+2*b*b))))}}function gy(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.f=this.es/(1+Math.sqrt(1-this.es))}function _y(e){var t=e.x,n=e.y,r=Math.sin(e.y),i=Math.cos(e.y),a=Q(t-this.long0,this.over),o,s,c,l,u,d,f,p,m,h,g;return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(e.x=this.x0+this.a*(X-n)*Math.sin(a),e.y=this.y0-this.a*(X-n)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=1e-10?(e.x=this.x0+this.a*(X+n)*Math.sin(a),e.y=this.y0+this.a*(X+n)*Math.cos(a),e):(m=this.sin_p12*r+this.cos_p12*i*Math.cos(a),f=Math.acos(m),p=f?f/Math.sin(f):1,e.x=this.x0+this.a*p*i*Math.sin(a),e.y=this.y0+this.a*p*(this.cos_p12*r-this.sin_p12*i*Math.cos(a)),e):(o=q_(this.es),s=J_(this.es),c=Y_(this.es),l=X_(this.es),Math.abs(this.sin_p12-1)<=1e-10?(u=this.a*K_(o,s,c,l,X),d=this.a*K_(o,s,c,l,n),e.x=this.x0+(u-d)*Math.sin(a),e.y=this.y0-(u-d)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=1e-10?(u=this.a*K_(o,s,c,l,X),d=this.a*K_(o,s,c,l,n),e.x=this.x0+(u+d)*Math.sin(a),e.y=this.y0+(u+d)*Math.cos(a),e):Math.abs(t)<1e-10&&Math.abs(n-this.lat0)<1e-10?(e.x=this.x0,e.y=this.y0,e):(h=my(this.lat0,this.long0,n,t,this.a,this.f),g=h.azi1,e.x=this.x0+h.s12*Math.sin(g),e.y=this.y0+h.s12*Math.cos(g),e))}function vy(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*X*this.a?void 0:(n=t/this.a,r=Math.sin(n),i=Math.cos(n),a=this.long0,Math.abs(t)<=1e-10?o=this.lat0:(o=_v(i*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-X,a=Math.abs(s)<=1e-10?this.lat0>=0?Q(this.long0+Math.atan2(e.x,-e.y),this.over):Q(this.long0-Math.atan2(-e.x,e.y),this.over):Q(this.long0+Math.atan2(e.x*r,t*this.cos_p12*i-e.y*this.sin_p12*r),this.over)),e.x=a,e.y=o,e)):(c=q_(this.es),l=J_(this.es),u=Y_(this.es),d=X_(this.es),Math.abs(this.sin_p12-1)<=1e-10?(f=this.a*K_(c,l,u,d,X),t=Math.sqrt(e.x*e.x+e.y*e.y),p=f-t,o=$_(p/this.a,c,l,u,d),a=Q(this.long0+Math.atan2(e.x,-1*e.y),this.over),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=1e-10?(f=this.a*K_(c,l,u,d,X),t=Math.sqrt(e.x*e.x+e.y*e.y),p=t-f,o=$_(p/this.a,c,l,u,d),a=Q(this.long0+Math.atan2(e.x,e.y),this.over),e.x=a,e.y=o,e):(m=Math.atan2(e.x,e.y),h=Math.sqrt(e.x*e.x+e.y*e.y),g=hy(this.lat0,this.long0,m,h,this.a,this.f),e.x=g.lon2,e.y=g.lat2,e))}var yy={init:gy,forward:_y,inverse:vy,names:[`Azimuthal_Equidistant`,`aeqd`]};function by(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function xy(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=Q(l-(this.long0||0),this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,(o>0||Math.abs(o)<=1e-10)&&(s=(this.x0||0)+this.a*a*n*Math.sin(r),c=(this.y0||0)+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function Sy(e){var t,n,r,i,a,o,s,c,l;return e.x-=this.x0||0,e.y-=this.y0||0,t=Math.sqrt(e.x*e.x+e.y*e.y),n=_v(t/this.a),r=Math.sin(n),i=Math.cos(n),c=this.long0||0,l=this.lat0||0,o=c,Math.abs(t)<=1e-10?(s=l,e.x=o,e.y=s,e):(s=_v(i*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(l)-X,Math.abs(a)<=1e-10?(o=Q(l>=0?c+Math.atan2(e.x,-e.y):c-Math.atan2(-e.x,e.y),this.over),e.x=o,e.y=s,e):(o=Q(c+Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),this.over),e.x=o,e.y=s,e))}var Cy={init:by,forward:xy,inverse:Sy,names:[`ortho`]},wy={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},$={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Ty(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Quadrilateralized Spherical Cube`,this.face=this.lat0>=X-Z/2?wy.TOP:this.lat0<=-(X-Z/2)?wy.BOTTOM:Math.abs(this.long0)<=Z?wy.FRONT:Math.abs(this.long0)<=X+Z?this.long0>0?wy.RIGHT:wy.LEFT:wy.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ey(e){var t={x:0,y:0},n,r,i,a,o,s,c={value:0};if(e.x-=this.long0,n=this.es===0?e.y:Math.atan(this.one_minus_f_squared*Math.tan(e.y)),r=e.x,this.face===wy.TOP)a=X-n,r>=Z&&r<=X+Z?(c.value=$.AREA_0,i=r-X):r>X+Z||r<=-(X+Z)?(c.value=$.AREA_1,i=r>0?r-em:r+em):r>-(X+Z)&&r<=-Z?(c.value=$.AREA_2,i=r+X):(c.value=$.AREA_3,i=r);else if(this.face===wy.BOTTOM)a=X+n,r>=Z&&r<=X+Z?(c.value=$.AREA_0,i=-r+X):r<Z&&r>=-Z?(c.value=$.AREA_1,i=-r):r<-Z&&r>=-(X+Z)?(c.value=$.AREA_2,i=-r-X):(c.value=$.AREA_3,i=r>0?-r+em:-r-em);else{var l,u,d,f,p,m,h;this.face===wy.RIGHT?r=ky(r,+X):this.face===wy.BACK?r=ky(r,+em):this.face===wy.LEFT&&(r=ky(r,-X)),f=Math.sin(n),p=Math.cos(n),m=Math.sin(r),h=Math.cos(r),l=p*h,u=p*m,d=f,this.face===wy.FRONT?(a=Math.acos(l),i=Oy(a,d,u,c)):this.face===wy.RIGHT?(a=Math.acos(u),i=Oy(a,d,-l,c)):this.face===wy.BACK?(a=Math.acos(-l),i=Oy(a,d,-u,c)):this.face===wy.LEFT?(a=Math.acos(-u),i=Oy(a,d,l,c)):(a=i=0,c.value=$.AREA_0)}return s=Math.atan(12/em*(i+Math.acos(Math.sin(i)*Math.cos(Z))-X)),o=Math.sqrt((1-Math.cos(a))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),c.value===$.AREA_1?s+=X:c.value===$.AREA_2?s+=em:c.value===$.AREA_3&&(s+=1.5*em),t.x=o*Math.cos(s),t.y=o*Math.sin(s),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Dy(e){var t={lam:0,phi:0},n,r,i,a,o,s,c,l,u,d={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),n=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?d.value=$.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(d.value=$.AREA_1,n-=X):e.x<0&&-e.x>=Math.abs(e.y)?(d.value=$.AREA_2,n=n<0?n+em:n-em):(d.value=$.AREA_3,n+=X),u=em/12*Math.tan(n),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),s=Math.atan(o),i=Math.cos(n),a=Math.tan(r),c=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(s)))),c<-1?c=-1:c>1&&(c=1),this.face===wy.TOP)l=Math.acos(c),t.phi=X-l,t.lam=d.value===$.AREA_0?s+X:d.value===$.AREA_1?s<0?s+em:s-em:d.value===$.AREA_2?s-X:s;else if(this.face===wy.BOTTOM)l=Math.acos(c),t.phi=l-X,t.lam=d.value===$.AREA_0?-s+X:d.value===$.AREA_1?-s:d.value===$.AREA_2?-s-X:s<0?-s-em:-s+em;else{var f=c,p,m;u=f*f,m=u>=1?0:Math.sqrt(1-u)*Math.sin(s),u+=m*m,p=u>=1?0:Math.sqrt(1-u),d.value===$.AREA_1?(u=p,p=-m,m=u):d.value===$.AREA_2?(p=-p,m=-m):d.value===$.AREA_3&&(u=p,p=m,m=-u),this.face===wy.RIGHT?(u=f,f=-p,p=u):this.face===wy.BACK?(f=-f,p=-p):this.face===wy.LEFT&&(u=f,f=p,p=-u),t.phi=Math.acos(-m)-X,t.lam=Math.atan2(p,f),this.face===wy.RIGHT?t.lam=ky(t.lam,-X):this.face===wy.BACK?t.lam=ky(t.lam,-em):this.face===wy.LEFT&&(t.lam=ky(t.lam,+X))}if(this.es!==0){var h=+(t.phi<0),g=Math.tan(t.phi),_=this.b/Math.sqrt(g*g+this.one_minus_f_squared);t.phi=Math.atan(Math.sqrt(this.a*this.a-_*_)/(this.one_minus_f*_)),h&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function Oy(e,t,n,r){var i;return e<1e-10?(r.value=$.AREA_0,i=0):(i=Math.atan2(t,n),Math.abs(i)<=Z?r.value=$.AREA_0:i>Z&&i<=X+Z?(r.value=$.AREA_1,i-=X):i>X+Z||i<=-(X+Z)?(r.value=$.AREA_2,i=i>=0?i-em:i+em):(r.value=$.AREA_3,i+=X)),i}function ky(e,t){var n=e+t;return n<-3.14159265359?n+=$p:n>3.14159265359&&(n-=$p),n}var Ay={init:Ty,forward:Ey,inverse:Dy,names:[`Quadrilateralized Spherical Cube`,`Quadrilateralized_Spherical_Cube`,`qsc`]},jy=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],My=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,422642e-15],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ny=.8487,Py=1.3523,Fy=Qp/5,Iy=1/Fy,Ly=18,Ry=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},zy=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function By(e,t,n,r){for(var i=t;r;--r){var a=e(i);if(i-=a,Math.abs(a)<n)break}return i}function Vy(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||`Robinson`}function Hy(e){var t=Q(e.x-this.long0,this.over),n=Math.abs(e.y),r=Math.floor(n*Fy);r<0?r=0:r>=Ly&&(r=Ly-1),n=Qp*(n-Iy*r);var i={x:Ry(jy[r],n)*t,y:Ry(My[r],n)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*Ny+this.x0,i.y=i.y*this.a*Py+this.y0,e.z!==void 0&&(i.z=e.z),e.m!==void 0&&(i.m=e.m),i}function Uy(e){var t={x:(e.x-this.x0)/(this.a*Ny),y:Math.abs(e.y-this.y0)/(this.a*Py)};if(t.y>=1)t.x/=jy[Ly][0],t.y=e.y<0?-X:X;else{var n=Math.floor(t.y*Ly);for(n<0?n=0:n>=Ly&&(n=Ly-1);;)if(My[n][0]>t.y)--n;else if(My[n+1][0]<=t.y)++n;else break;var r=My[n],i=5*(t.y-r[0])/(My[n+1][0]-r[0]);i=By(function(e){return(Ry(r,e)-t.y)/zy(r,e)},i,Xp,100),t.x/=Ry(jy[n],i),t.y=(5*n+i)*Zp,e.y<0&&(t.y=-t.y)}return t.x=Q(t.x+this.long0,this.over),e.z!==void 0&&(t.z=e.z),e.m!==void 0&&(t.m=e.m),t}var Wy={init:Vy,forward:Hy,inverse:Uy,names:[`Robinson`,`robin`]};function Gy(){this.name=`geocent`}function Ky(e){return Lh(e,this.es,this.a)}function qy(e){return Rh(e,this.es,this.a,this.b)}var Jy={init:Gy,forward:Ky,inverse:qy,names:[`Geocentric`,`geocentric`,`geocent`,`Geocent`]},Yy={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Xy={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Zy(){if(Object.keys(Xy).forEach(function(e){if(this[e]===void 0)this[e]=Xy[e].def;else if(Xy[e].num&&isNaN(this[e]))throw Error(`Invalid parameter value, must be numeric `+e+` = `+this[e]);else Xy[e].num&&(this[e]=parseFloat(this[e]));Xy[e].degrees&&(this[e]=this[e]*Zp)}.bind(this)),Math.abs(Math.abs(this.lat0)-X)<1e-10?this.mode=this.lat0<0?Yy.S_POLE:Yy.N_POLE:Math.abs(this.lat0)<1e-10?this.mode=Yy.EQUIT:(this.mode=Yy.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw Error(`Invalid height`);this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function Qy(e){e.x-=this.long0;var t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i,a;switch(this.mode){case Yy.OBLIQ:a=this.sinph0*t+this.cosph0*n*r;break;case Yy.EQUIT:a=n*r;break;case Yy.S_POLE:a=-t;break;case Yy.N_POLE:a=t}switch(a=this.pn1/(this.p-a),i=a*n*Math.sin(e.x),this.mode){case Yy.OBLIQ:a*=this.cosph0*t-this.sinph0*n*r;break;case Yy.EQUIT:a*=t;break;case Yy.N_POLE:a*=-(n*r);break;case Yy.S_POLE:a*=n*r}var o=a*this.cg+i*this.sg,s=1/(o*this.sw*this.h1+this.cw);return i=(i*this.cg-a*this.sg)*this.cw*s,a=o*s,e.x=i*this.a,e.y=a*this.a,e}function $y(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},n,r,i=1/(this.pn1-e.y*this.sw);n=this.pn1*e.x*i,r=this.pn1*e.y*this.cw*i,e.x=n*this.cg+r*this.sg,e.y=r*this.cg-n*this.sg;var a=Qg(e.x,e.y);if(Math.abs(a)<1e-10)t.x=0,t.y=e.y;else{var o,s=1-a*a*this.pfact;switch(s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case Yy.OBLIQ:t.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(t.y))*a,e.x*=s*this.cosph0;break;case Yy.EQUIT:t.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case Yy.N_POLE:t.y=Math.asin(o),e.y=-e.y;break;case Yy.S_POLE:t.y=-Math.asin(o)}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var eb={init:Zy,forward:Qy,inverse:$y,names:[`Tilted_Perspective`,`tpers`]};function tb(){if(this.flip_axis=+(this.sweep===`x`),this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw Error();if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape=`ellipse`}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape=`sphere`;this.title||=`Geostationary Satellite View`}function nb(e){var t=e.x,n=e.y,r,i,a,o;if(t-=this.long0,this.shape===`ellipse`){n=Math.atan(this.radius_p2*Math.tan(n));var s=this.radius_p/Qg(this.radius_p*Math.cos(n),Math.sin(n));if(i=s*Math.cos(t)*Math.cos(n),a=s*Math.sin(t)*Math.cos(n),o=s*Math.sin(n),(this.radius_g-i)*i-a*a-o*o*this.radius_p_inv2<0)return e.x=NaN,e.y=NaN,e;r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Qg(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Qg(a,r)))}else this.shape===`sphere`&&(r=Math.cos(n),i=Math.cos(t)*r,a=Math.sin(t)*r,o=Math.sin(n),r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Qg(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Qg(a,r))));return e.x*=this.a,e.y*=this.a,e}function rb(e){var t=-1,n=0,r=0,i,a,o,s;if(e.x/=this.a,e.y/=this.a,this.shape===`ellipse`){this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Qg(1,r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Qg(1,n));var c=r/this.radius_p;if(i=n*n+c*c+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape===`sphere`){if(this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+r*r+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t)}return e.x+=this.long0,e}var ib={init:tb,forward:nb,inverse:rb,names:[`Geostationary Satellite View`,`Geostationary_Satellite`,`geos`]},ab=1.340264,ob=-.081106,sb=893e-6,cb=.003796,lb=Math.sqrt(3)/2;function ub(){this.long0=this.long0===void 0?0:this.long0,this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.es!==0&&(this.apa=dv(this.es),this.qp=iv(this.e,1),this.rqda=Math.sqrt(.5*this.qp))}function db(e){var t=Q(e.x-this.long0,this.over),n=e.y,r=Math.sin(n);this.es!==0&&(r=iv(this.e,r)/this.qp);var i=Math.asin(lb*r),a=i*i,o=a*a*a;return e.x=t*Math.cos(i)/(lb*(ab+3*ob*a+o*(7*sb+9*cb*a))),e.y=i*(ab+ob*a+o*(sb+cb*a)),this.es!==0&&(e.x*=this.rqda,e.y*=this.rqda),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function fb(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,this.es!==0&&(e.x/=this.rqda,e.y/=this.rqda);for(var t=1e-9,n=12,r=e.y,i,a,o,s,c,l=0;l<n&&(i=r*r,a=i*i*i,o=r*(ab+ob*i+a*(sb+cb*i))-e.y,s=ab+3*ob*i+a*(7*sb+9*cb*i),r-=c=o/s,!(Math.abs(c)<t));++l);return i=r*r,a=i*i*i,e.x=lb*e.x*(ab+3*ob*i+a*(7*sb+9*cb*i))/Math.cos(r),e.y=Math.asin(Math.sin(r)/lb),this.es!==0&&(e.y=fv(e.y,this.apa)),e.x=Q(e.x+this.long0,this.over),e}var pb={init:ub,forward:db,inverse:fb,names:[`eqearth`,`Equal Earth`,`Equal_Earth`]},mb=1e-10;function hb(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<mb)throw Error();this.es?(this.en=Ug(this.es),this.m1=Wg(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=_b,this.forward=gb):(this.cphi1=Math.abs(this.phi1)+mb>=X?0:1/Math.tan(this.phi1),this.inverse=yb,this.forward=vb)}function gb(e){var t=Q(e.x-(this.long0||0),this.over),n=e.y,r=this.am1+this.m1-Wg(n,i=Math.sin(n),a=Math.cos(n),this.en),i=a*t/(r*Math.sqrt(1-this.es*i*i)),a;return e.x=r*Math.sin(i),e.y=this.am1-r*Math.cos(i),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function _b(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n=Qg(e.x,e.y=this.am1-e.y),r,i=Kg(this.am1+this.m1-n,this.es,this.en);if((t=Math.abs(i))<X)t=Math.sin(i),r=n*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else if(Math.abs(t-X)<=mb)r=0;else throw Error();return e.x=Q(r+(this.long0||0),this.over),e.y=Q_(i),e}function vb(e){var t=Q(e.x-(this.long0||0),this.over),n=e.y,r,i=this.cphi1+this.phi1-n;return Math.abs(i)>mb?(e.x=i*Math.sin(r=t*Math.cos(n)/i),e.y=this.cphi1-i*Math.cos(r)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function yb(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n,r=Qg(e.x,e.y=this.cphi1-e.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>X)throw Error();return t=Math.abs(Math.abs(n)-X)<=mb?0:r*Math.atan2(e.x,e.y)/Math.cos(n),e.x=Q(t+(this.long0||0),this.over),e.y=Q_(n),e}var bb={init:hb,names:[`bonne`,`Bonne (Werner lat_1=90)`]},xb={OBLIQUE:{forward:Db,inverse:kb},TRANSVERSE:{forward:Ob,inverse:Ab}},Sb={ROTATE:{o_alpha:`oAlpha`,o_lon_c:`oLongC`,o_lat_c:`oLatC`},NEW_POLE:{o_lat_p:`oLatP`,o_lon_p:`oLongP`},NEW_EQUATOR:{o_lon_1:`oLong1`,o_lat_1:`oLat1`,o_lon_2:`oLong2`,o_lat_2:`oLat2`}};function Cb(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||`General Oblique Transformation`,this.isIdentity=rh.includes(this.o_proj),!this.o_proj)throw Error(`Missing parameter: o_proj`);if(this.o_proj===`ob_tran`)throw Error(`Invalid value for o_proj: `+this.o_proj);let e=Fh(this.projStr.replace(`+proj=ob_tran`,``).replace(`+o_proj=`,`+proj=`).trim());if(!e)throw Error(`Invalid parameter: o_proj. Unknown projection `+this.o_proj);e.long0=0,this.obliqueProjection=e;let t,n=Object.keys(Sb),r=e=>{if(this[e]===void 0)return;let t=parseFloat(this[e])*Zp;if(isNaN(t))throw Error(`Invalid value for `+e+`: `+this[e]);return t};for(let e=0;e<n.length;e++){let i=Sb[n[e]],a=Object.entries(i);if(a.some(([e])=>this[e]!==void 0)){t=i;for(let e=0;e<a.length;e++){let[t,n]=a[e],i=r(t);if(i===void 0)throw Error(`Missing parameter: `+t+`.`);this[n]=i}break}}if(!t)throw Error(`No valid parameters provided for ob_tran projection.`);let{lamp:i,phip:a}=Eb(this,t);this.lamp=i,Math.abs(a)>1e-10?(this.cphip=Math.cos(a),this.sphip=Math.sin(a),this.projectionType=xb.OBLIQUE):this.projectionType=xb.TRANSVERSE}function wb(e){return this.projectionType.forward(this,e)}function Tb(e){return this.projectionType.inverse(this,e)}function Eb(e,t){let n,r;if(t===Sb.ROTATE){let t=e.oLongC,i=e.oLatC,a=e.oAlpha;if(Math.abs(Math.abs(i)-X)<=1e-10)throw Error(`Invalid value for o_lat_c: `+e.o_lat_c+` should be < 90°`);r=t+Math.atan2(-1*Math.cos(a),-1*Math.sin(a)*Math.sin(i)),n=Math.asin(Math.cos(i)*Math.sin(a))}else if(t===Sb.NEW_POLE)r=e.oLongP,n=e.oLatP;else{let t=e.oLong1,i=e.oLat1,a=e.oLong2,o=e.oLat2,s=Math.abs(i);if(Math.abs(i)>X-1e-10)throw Error(`Invalid value for o_lat_1: `+e.o_lat_1+` should be < 90°`);if(Math.abs(o)>X-1e-10)throw Error(`Invalid value for o_lat_2: `+e.o_lat_2+` should be < 90°`);if(Math.abs(i-o)<1e-10)throw Error(`Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2`);if(s<1e-10)throw Error(`Invalid value for o_lat_1: o_lat_1 should be different from zero`);r=Math.atan2(Math.cos(i)*Math.sin(o)*Math.cos(t)-Math.sin(i)*Math.cos(o)*Math.cos(a),Math.sin(i)*Math.cos(o)*Math.sin(a)-Math.cos(i)*Math.sin(o)*Math.sin(t)),n=Math.atan(-1*Math.cos(r-t)/Math.tan(i))}return{lamp:r,phip:n}}function Db(e,t){let{x:n,y:r}=t;n=Q(n-e.long0,e.over);let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=Q(Math.atan2(o*Math.sin(n),e.sphip*o*i+e.cphip*a)+e.lamp),t.y=Math.asin(e.sphip*a-e.cphip*o*i);let s=e.obliqueProjection.forward(t);return e.isIdentity&&(s.x*=Qp,s.y*=Qp),s}function Ob(e,t){let{x:n,y:r}=t;n=Q(n-e.long0,e.over);let i=Math.cos(r),a=Math.cos(n);t.x=Q(Math.atan2(i*Math.sin(n),Math.sin(r))+e.lamp),t.y=Math.asin(-1*i*a);let o=e.obliqueProjection.forward(t);return e.isIdentity&&(o.x*=Qp,o.y*=Qp),o}function kb(e,t){e.isIdentity&&(t.x*=Zp,t.y*=Zp);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){n-=e.lamp;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=Math.atan2(o*Math.sin(n),e.sphip*o*i-e.cphip*a),t.y=Math.asin(e.sphip*a+e.cphip*o*i)}return t.x=Q(t.x+e.long0),t}function Ab(e,t){e.isIdentity&&(t.x*=Zp,t.y*=Zp);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){let i=Math.cos(r);n-=e.lamp,t.x=Math.atan2(i*Math.sin(n),-1*Math.sin(r)),t.y=Math.asin(i*Math.cos(n))}return t.x=Q(t.x+e.long0),t}var jb={init:Cb,forward:wb,inverse:Tb,names:[`General Oblique Transformation`,`General_Oblique_Transformation`,`ob_tran`]};function Mb(e){e.Proj.projections.add(Xg),e.Proj.projections.add(c_),e.Proj.projections.add(f_),e.Proj.projections.add(S_),e.Proj.projections.add(D_),e.Proj.projections.add(j_),e.Proj.projections.add(L_),e.Proj.projections.add(V_),e.Proj.projections.add(G_),e.Proj.projections.add(rv),e.Proj.projections.add(gv),e.Proj.projections.add(Sv),e.Proj.projections.add(Ev),e.Proj.projections.add(jv),e.Proj.projections.add(Fv),e.Proj.projections.add(Bv),e.Proj.projections.add(Wv),e.Proj.projections.add(Jv),e.Proj.projections.add($v),e.Proj.projections.add(ty),e.Proj.projections.add(ay),e.Proj.projections.add(ly),e.Proj.projections.add(py),e.Proj.projections.add(yy),e.Proj.projections.add(Cy),e.Proj.projections.add(Ay),e.Proj.projections.add(Wy),e.Proj.projections.add(Jy),e.Proj.projections.add(eb),e.Proj.projections.add(ib),e.Proj.projections.add(pb),e.Proj.projections.add(bb),e.Proj.projections.add(jb)}var Nb=Object.assign(ig,{defaultDatum:`WGS84`,Proj:Fh,WGS84:new Fh(`WGS84`),Point:Ag,toPoint:Yh,defs:Lm,nadgrid:xh,transform:eg,mgrs:pg,version:`__VERSION__`});Mb(Nb);var Pb={id:`sidebar`},Fb={class:`sidebar-header`},Ib={class:`sidebar-body`},Lb={class:`block`},Rb={key:0,class:`hint`,id:`map-info-empty`},zb={id:`map-info`},Bb={class:`map-detail`},Vb={id:`info-name`},Hb={class:`map-detail`},Ub={id:`info-kind`},Wb={class:`map-detail`},Gb={id:`info-data-crs`},Kb={class:`map-detail`},qb={id:`info-extent`},Jb={class:`block`,id:`view-crs-block`},Yb={class:`row`},Xb=[`label`],Zb=[`value`],Qb={key:0,label:`自定义`},$b=[`value`],ex={class:`extent-grid`},tx=[`value`],nx=[`value`],rx=[`value`],ix=[`value`],ax={class:`extent-grid`},ox=[`value`],sx=[`value`],cx=[`value`],lx=[`value`],ux={class:`block`,id:`layer-list-block`},dx={class:`layer-list-title`},fx={key:0,class:`layer-summary`},px={id:`layer-list`},mx={class:`layer-info`},hx=[`title`],gx={class:`layer-meta`},_x={class:`layer-controls`},vx=[`onClick`],yx=[`onClick`],bx=[`title`,`onClick`],xx={class:`layer-info`},Sx=[`title`],Cx={class:`layer-meta`},wx={class:`layer-controls`},Tx=[`onClick`],Ex=[`onClick`],Dx=[`title`,`onClick`],Ox=[`title`,`onClick`],kx={class:`layer-info`},Ax=[`title`],jx={class:`layer-meta`},Mx={class:`layer-controls`},Nx=[`onClick`],Px=[`onClick`],Fx=[`title`,`onClick`],Ix={class:`map-loading-mask`},Lx={class:`dialog`},Rx={class:`dialog-header`},zx={class:`block`},Bx={class:`file-btn`},Vx={class:`file-name`,id:`img-file-name`},Hx={class:`file-btn secondary`},Ux={class:`file-name`,id:`world-file-name`},Wx={class:`extent-grid`},Gx={class:`hint`,id:`zone-hint`},Kx={key:0},qx=[`onClick`],Jx={class:`file-btn`},Yx={class:`file-name`,id:`tiles-dir-name`},Xx={class:`check`},Zx={class:`hint`,id:`tiles-info`},Qx={class:`file-btn`},$x={class:`file-name`,id:`geojson-dir-name`},eS={class:`hint`,id:`geojson-crs-hint`},tS={key:0},nS=[`onClick`],rS={class:`hint`,id:`geojson-info`},iS={class:`zoom-range`},aS=[`label`],oS=[`value`],sS={key:0,label:`自定义`},cS=[`value`],lS={class:`extent-grid`},uS={class:`hint`,id:`url-info`},dS={class:`block`},fS=[`label`],pS=[`value`],mS={key:0,label:`自定义`},hS=[`value`],gS={class:`custom-crs`},_S={class:`row`},vS={id:`statusbar`},yS={id:`status-info`,class:`status-seg`},bS={id:`drop-overlay`},xS=[`data-type`],SS=(0,t.defineComponent)({name:`MapViewVue3`,name:`MapViewVue3`,props:{theme:{type:String,default:`light`},dataCrs:{type:String,default:`EPSG:3857`},zoom:{type:Number,default:4.2},hidePanels:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},mapBackground:{type:String,default:null},autoLoad:{type:Object,default:null}},emits:[`active-map-changed`,`layer-removed`,`map-removed`,`notify`,`theme-changed`,`view-changed`],setup(e,{expose:n,emit:r}){Zf(Nb);let i=e,a=r,o=(0,t.ref)(!1),s=(0,t.ref)(342),c=(0,t.ref)(0),l=(0,t.ref)(!1),u=(0,t.ref)(!1),d=(0,t.ref)(`raster`),f=(0,t.ref)(`image`),p=(0,t.ref)(!1),m=(0,t.ref)(!1),h=(0,t.ref)(!1),g=(0,t.ref)(!1),_=(0,t.ref)(`☀️`),v=(0,t.ref)(`切换到深色主题`),y=(0,t.ref)(``),b=(0,t.ref)(``),x=(0,t.ref)(`info`),S=(0,t.ref)(!1),C=(0,t.ref)({active:!1,name:``,kind:``,dataCrs:``,extent:`未知`}),w=(0,t.ref)([]),T=(0,t.ref)(!1),E=(0,t.ref)(``),D=(0,t.ref)(0),O=(0,t.ref)(0),k=(0,t.ref)([]),A=(0,t.ref)({dataCrs:[],viewCrs:[],urlExtentCrs:[]}),ee=(0,t.ref)([]),te=(0,t.ref)({minx:``,miny:``,maxx:``,maxy:``}),ne=(0,t.ref)({minx:``,miny:``,maxx:``,maxy:``}),j=(0,t.ref)({dataCrs:i.dataCrs,viewCrs:`EPSG:3857`,urlExtentCrs:i.dataCrs,imgFileName:`未选择文件`,worldFileName:`未选择文件`,zoneHint:{message:``,options:[]},tilesDirName:`未选择目录`,tilesInfo:`支持 QGIS / GDAL 等导出的 z/x/y.png 目录结构。`,tilesTms:!1,geojsonDirName:`未选择目录`,geojsonInfo:`支持按文件名配对的 .geojson 与 .sld。`,geojsonCrsHint:`未选择 GeoJSON。`,geojsonCrsOptions:[],urlTemplate:``,urlInfo:``,urlMinzoom:``,urlMaxzoom:``,customEpsg:``}),re=null,ie=null,M=null,ae=null,oe=null,se=null,ce=null,N=null,le=null,ue=null,de=null,P=null,fe=null,pe=null,F=null,he=null,ge=null,_e=null,ve=null,ye=null,xe=(0,t.ref)(null),Se=(0,t.ref)(null),Ce=(0,t.ref)(null);(0,t.ref)(null);let we=(0,t.ref)(null),Te=(0,t.ref)(null),Ee=(0,t.ref)(null),De=(0,t.ref)(null),Oe=(0,t.ref)(null),ke=(0,t.ref)(null),Ae=(0,t.ref)(null),je=(0,t.ref)(null),I=(0,t.ref)(null),Me=(0,t.ref)(null);(0,t.ref)(null);let Ne=(0,t.ref)(null),Pe=(0,t.ref)(null),Fe=(0,t.ref)(null),L=(0,t.ref)(null),Ie=(0,t.ref)(null),Le=(0,t.ref)(null);(0,t.ref)(null);let Re=(0,t.ref)(null),ze=(0,t.ref)(null),Be=(0,t.ref)(null),Ve=(0,t.ref)(null),He=(0,t.ref)(null),Ue=(0,t.ref)(null),R=(0,t.computed)(()=>{let e=e=>e==null||e===``?null:typeof e==`number`?e+`px`:String(e),t={},n=e(i.width),r=e(i.height);return n&&(t.width=n),r&&(t.height=r),t[`--sidebar-width`]=s.value+`px`,i.mapBackground&&(t[`--map-bg`]=i.mapBackground),t}),We=(0,t.computed)(()=>c.value>0||l.value);function Ge(){if(o.value)return;P=null,ye=new AbortController,ae=new mt({code:`PIXEL`,units:`pixels`}),yn(ae),re=[],it(`常用`,[{code:`EPSG:3857`,name:`EPSG:3857 · WGS84 伪墨卡托(网络地图)`},{code:`EPSG:4326`,name:`EPSG:4326 · WGS84 经纬度`},{code:`EPSG:4490`,name:`EPSG:4490 · CGCS2000 经纬度(2000国家大地坐标系)`,def:`+proj=longlat +ellps=GRS80 +no_defs`},{code:`PIXEL`,name:`像素坐标(未配准图片)`,pixel:!0}]);let e=[],t=[],n=[],r=[];for(let t=25;t<=45;t++){let n=t*3;e.push({code:`EPSG:${4513+t-25}`,name:`EPSG:${4513+t-25} · CGCS2000 3度带 ${t}(CM ${n}°E)`,def:rt(n,5e5+t*1e6),geoBox:[n-1.5,16,n+1.5,56]})}for(let e=13;e<=23;e++){let t=e*6-3;n.push({code:`EPSG:${4491+e-13}`,name:`EPSG:${4491+e-13} · CGCS2000 6度带 ${e}(CM ${t}°E)`,def:rt(t,5e5+e*1e6),geoBox:[t-3,16,t+3,56]})}it(`CGCS2000 3度带(含带号)`,e),it(`CGCS2000 3度带(中央经线)`,t),it(`CGCS2000 6度带(含带号)`,n),it(`CGCS2000 6度带(中央经线)`,r);let s=[],c=[];for(let e=1;e<=60;e++){let t=6*e-183;s.push({code:`EPSG:${32600+e}`,name:`EPSG:${32600+e} · WGS84 / UTM ${e}N(CM ${t}°E)`,def:`+proj=utm +zone=${e} +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs`,geoBox:[t-3,-80,t+3,84]}),c.push({code:`EPSG:${32700+e}`,name:`EPSG:${32700+e} · WGS84 / UTM ${e}S(CM ${t}°E)`,def:`+proj=utm +zone=${e} +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs`,geoBox:[t-3,-80,t+3,84]})}it(`UTM 北半球`,s),it(`UTM 南半球`,c),_e=new Map;for(let e of re)for(let t of e.items)_e.set(t.code,t);le=[],P=new Md({target:`map`,layers:[],view:new du({projection:j.value.viewCrs,center:Dn([108.5,36.5],j.value.viewCrs),zoom:i.zoom}),controls:[new zu({zoomInTipLabel:`放大`,zoomOutTipLabel:`缩小`}),new kp({tipLabel:`全屏`}),new Vp({units:`metric`,target:Le.value}),new Lp({coordinateFormat:e=>j.valueatCoord(e),undefinedHTML:`—`,target:Ie.value}),nt()]}),lt(),P.on(`moveend`,()=>{dt(),a(`view-changed`,tr())}),P.on(`loadstart`,()=>{l.value=!0}),P.on(`loadend`,()=>{l.value=!1}),ve=null,fe=[],N=null,ue=0,M={image:`图片`,tiles:`本地切片XYZ`,xyz:`在线切片XYZ`,geojson:`GeoJSON / SLD`},se=/(\d+)[\\/](\d+)[\\/](\d+)\.(png|jpe?g|webp)$/i,F=null,ge=null,he=null,ce=[`#3f8cff`,`#39c26d`,`#e8b339`,`#e8718d`,`#9b6fd8`,`#31b8b5`,`#f28f3b`,`#729b6f`],ie=/\.(geojson|json)$/i,oe=/\.(sld|xml)$/i,pe=null,de=0,f.value=`image`,I.value.addEventListener(`change`,()=>{let e=I.value.files&&I.value.files[0];e&&sn(e)}),Ue.value.addEventListener(`change`,async()=>{let e=Ue.value.files&&Ue.value.files[0];if(e)try{ge={text:await e.text(),name:e.name},j.value.worldFileName=e.name,on()}catch{z(`世界文件读取失败`,`err`)}}),Re.value.addEventListener(`change`,()=>dn(Re.value.files)),je.value.addEventListener(`change`,()=>Wn(je.value.files)),mr(i.theme),[`dragenter`,`dragover`].forEach(e=>document.addEventListener(e,e=>{e.preventDefault(),e.dataTransfer&&[...e.dataTransfer.types].includes(`Files`)&&(u.value=!0)},{signal:ye.signal})),document.addEventListener(`dragleave`,e=>{e.relatedTarget||(u.value=!1)},{signal:ye.signal}),document.addEventListener(`drop`,async e=>{e.preventDefault(),u.value=!1;let t=await gr(e.dataTransfer);if(!t.length)return;if(t.some(e=>ie.test(e.name)||oe.test(e.name))){Wn(t),Xn(`geojson`),await Gn();return}let n=t.find(e=>/\.(png|jpe?g|webp)$/i.test(e.name));if(!n){z(`请拖放图片或 GeoJSON/SLD`,`warn`);return}let r=t.find(e=>/\.(pgw|pwg|jgw|gfw|wld|pngw|jpgw)$/i.test(e.name));if(await sn(n),r)try{ge={text:await r.text(),name:r.name},j.value.worldFileName=r.name,on()}catch{}Xn(`image`),z(`图片已就绪,点击“加载到地图”`,`ok`)},{signal:ye.signal}),ot(),j.value.viewCrs=`EPSG:3857`,(async()=>{let e=new URLSearchParams(location.search),t=_r(e.get(`epsg`));t&&st(t)&&(j.value.dataCrs=t);let n=e.get(`xyz`),r=e.get(`img`);if(n){j.value.urlTemplate=n,e.get(`minzoom`)&&(j.value.urlMinzoom=e.get(`minzoom`)),e.get(`maxzoom`)&&(j.value.urlMaxzoom=e.get(`maxzoom`));let t=(e.get(`extent`)||``).split(`,`).map(e=>parseFloat(e.trim()));t.length===4&&t.every(Number.isFinite)&&(Ve.value.value=t[0],He.value.value=t[1],ze.value.value=t[2],Be.value.value=t[3]);let r=_r(e.get(`extentepsg`));r&&(j.value.urlExtentCrs=r),Xn(`url`),gn()}else if(r){Xn(`image`);let t=null,n=e.get(`worldfile`);if(n)try{let e=await fetch(n);e.ok&&(t=await e.text())}catch{}let i=null,a=e.get(`extent`);if(a){let e=a.split(`,`).map(Number);e.length===4&&e.every(isFinite)&&(i=e)}await un({url:r,name:decodeURIComponent(r.split(`/`).pop()||`图片`),worldText:t,extent:i})}})(),dt(),mn(),o.value=!0}function Ke(){c.value+=1}function qe(){c.value=Math.max(0,c.value-1)}function Je(e){e.preventDefault();let t=e.clientX,n=s.value,r=e=>{s.value=Math.min(620,Math.max(280,n+(e.clientX-t)))},i=()=>{window.removeEventListener(`mousemove`,r),window.removeEventListener(`mouseup`,i),document.body.style.cursor=``,document.body.style.userSelect=``};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,window.addEventListener(`mousemove`,r),window.addEventListener(`mouseup`,i)}function Ye(){Me.value.classList.add(`sidebar-collapsed`)}function Xe(){Me.value.classList.remove(`sidebar-collapsed`)}function Ze(){Me.value.classList.add(`panel-right-collapsed`)}function Qe(){Me.value.classList.remove(`panel-right-collapsed`)}function $e(){mr(Me.value.classList.contains(`light-theme`)?`dark`:`light`)}async function et(){let e=fe.length;f.value===`image`?await ln():f.value===`tiles`?pn():f.value===`geojson`?await dr():await gn(),fe.length>e&&er()}function tt(){ye&&=(ye.abort(),null),P&&=(P.setTarget(null),null),o.value=!1}function nt(){let e=document.createElement(`button`);e.innerHTML=`⤢`,e.title=`复位视图`;let t=document.createElement(`div`);return t.className=`ol-fit-all ol-control`,t.appendChild(e),e.addEventListener(`click`,()=>Bt()),new Iu({element:t})}function rt(e,t){return`+proj=tmerc +lat_0=0 +lon_0=${e} +k=1 +x_0=${t} +y_0=0 +ellps=GRS80 +units=m +no_defs`}function it(e,t){re.push({label:e,items:t})}function at(e){return{groups:re.map(t=>({label:t.label,items:t.items.filter(t=>e||!t.pixel)})).filter(e=>e.items.length),custom:le.map(e=>({code:e.code,name:`${e.code} · 自定义`}))}}function ot(){let e=at(!0),t=at(!1);A.value.dataCrs=e.groups,A.value.viewCrs=t.groups,A.value.urlExtentCrs=t.groups,ee.value=e.custom,j.value.urlExtentCrs||(j.value.urlExtentCrs=`EPSG:3857`)}function st(e){if(!e)return null;if(e===`PIXEL`)return ae;let t=B(e);if(t)return t;let n=_e.get(e)||le.find(t=>t.code===e);if(!n||!n.def)return null;if(Nb.defs(e,n.def),Zf(Nb),t=B(e),t&&n.geoBox&&!t.getExtent())try{let r=Pn(n.geoBox,`EPSG:4326`,e);r.every(isFinite)&&t.setExtent(r)}catch{}return t}function ct(e){let t=P.getView();if(!t||!e)return``;let n=t.getProjection(),r=n.getUnits()===`degrees`,i=e.map(e=>r?e.toFixed(6):e.toFixed(2)).join(`, `);if(n.getCode()===`PIXEL`)return`${i} px`;try{let t=On(e,n);return!isFinite(t[0])||!isFinite(t[1])?i:`${i} | ${t[0].toFixed(6)}, ${t[1].toFixed(6)}°`}catch{return i}}function lt(){P.getView().on(`change:resolution`,()=>dt())}function ut(e){return isFinite(e)?e>=1e3?e.toFixed(0):e>=1?e.toPrecision(4):e.toExponential(1):`-`}function dt(){let e=P&&P.getView();if(!e)return;let t=e.getZoom(),n=e.getResolution(),r=e.getProjection(),i=r.getUnits()===`degrees`?`°/px`:r.getCode()===`PIXEL`?`px`:`m/px`;y.value=`${r.getCode()} · 级别 ${t==null?`-`:t.toFixed(1)} · 分辨率 ${ut(n)} ${i}`,pt(),ft()}function ft(){let e=P&&P.getView(),t=e?e.getProjection():null;if(!N||!N.extent||!t){te.value={minx:``,miny:``,maxx:``,maxy:``};return}let n=N.extent;if(N.projection.getCode()!==t.getCode()){try{n=Pn(n,N.projection,t)}catch{n=null}if(!n||!n.every(isFinite)){te.value={minx:``,miny:``,maxx:``,maxy:``};return}}te.value={minx:ht(n[0]),miny:ht(n[1]),maxx:ht(n[2]),maxy:ht(n[3])}}function pt(){let e=P&&P.getView(),t=P&&P.getSize();if(!e||!t||!N||e.getResolution()==null){ne.value={minx:``,miny:``,maxx:``,maxy:``};return}let n=e.calculateExtent(t);!n||!n.every(isFinite)?ne.value={minx:``,miny:``,maxx:``,maxy:``}:ne.value={minx:ht(n[0]),miny:ht(n[1]),maxx:ht(n[2]),maxy:ht(n[3])}}function ht(e){return isFinite(e)?String(+(Math.abs(e)>=1e3?e.toFixed(2):e.toFixed(6))):``}function z(e,t=`info`){b.value=e,x.value=t,S.value=!0,clearTimeout(ve),ve=setTimeout(()=>{S.value=!1},3200)}function gt(e){return{image:`🖼️`,tiles:`🧩`,xyz:`🌐`,geojson:`🌍`}[e]||`🗺️`}function _t(e){Lt(e),N===e&&Vt(e.extent,e.projection)}function vt(){w.value=fe.map(e=>({id:e.id,entry:e,active:e===N,icon:gt(e.kind),name:e.name,meta:`${e.projection.getCode()} · ${e.viewProjectionCode}`}))}function yt(){if(Ct(),!N){C.value.active=!1;return}let e=N,t=e.projection.getCode();C.value={active:!0,name:e.name,kind:`${gt(e.kind)} ${M[e.kind]||`地图`}`,dataCrs:e.sourceCrs&&e.sourceCrs!==t?`${t}(源:${e.sourceCrs})`:t,extent:e.extent?`X ${Jt(e.extent[0])} ~ ${Jt(e.extent[2])};Y ${Jt(e.extent[1])} ~ ${Jt(e.extent[3])}`:`未知`}}function bt(e){for(let t of e){let e=t.get(`layer`),n=typeof e==`string`?e.trim():``;if(n)return n}return null}function xt(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!r.group){t.push({type:`layer`,sublayer:r}),n+=1;continue}let i=n,a=[];for(;n<e.length&&e[n].group===r.group;)a.push(e[n]),n+=1;t.push({type:`group`,key:`${i}:${r.group}`,name:r.group,children:a})}return t}function St(e){return e.visible&&e.groupVisible!==!1}function Ct(){if(N&&N.kind===`image`){E.value=`PNG 格式地图无可操作图层`,T.value=!0,k.value=[],D.value=0,O.value=0;return}E.value=``;let e=N&&N.sublayers?N.sublayers:[];D.value=e.length,O.value=e.reduce((e,t)=>e+(Number.isFinite(t.featureCount)?t.featureCount:0),0);let t=!!e.length;if(T.value=t,!t){k.value=[];return}let n=xt(N.sublayers).reverse();k.value=n.map((e,t)=>{if(e.type===`layer`){let n=e.sublayer,r=St(n);return{type:`layer`,key:`layer-${t}`,name:n.name,meta:`${gt(n.kind)} ${M[n.kind]||`图层`}${Number.isFinite(n.featureCount)?` · ${n.featureCount} 要素`:``}`,visible:r,sublayer:n}}let n=e.children.map((e,n)=>({key:`child-${t}-${n}`,name:e.name,meta:`${gt(e.kind)} ${M[e.kind]||`图层`}${Number.isFinite(e.featureCount)?` · ${e.featureCount} 要素`:``}`,visible:St(e),sublayer:e}));return{type:`group`,key:`group-${e.key}-${t}`,name:e.name,collapsed:!N.expandedLayerGroups.has(e.key),visible:n.every(e=>e.sublayer.groupVisible!==!1),group:e,children:n}})}function wt(e){let t=e.sublayer;e.visible?(t.visible=!1,t.layer.setVisible(!1)):(t.visible=!0,t.layer.setVisible(!0)),Ct()}function Tt(e){e.collapsed?N.expandedLayerGroups.add(e.group.key):N.expandedLayerGroups.delete(e.group.key),Ct()}function Et(e){let t=!e.visible;e.children.forEach(e=>{e.sublayer.groupVisible=t,e.sublayer.layer.setVisible(t&&e.sublayer.visible)}),Ct()}function Dt(e,t){let n=t.sublayer;t.visible?(n.visible=!1,n.layer.setVisible(!1)):(n.visible=!0,e.children.forEach(e=>{e.sublayer.groupVisible=!0,e.sublayer.layer.setVisible(e.sublayer.visible)})),Ct()}function Ot(e){if(!e||e.kind!==`geojson`)return null;try{let t=e.source||e.layer.getSource(),n=t&&typeof t.getExtent==`function`?t.getExtent():null;if(Array.isArray(n)&&n.every(isFinite)&&n[2]>n[0]&&n[3]>n[1])return n.slice()}catch{}return null}function kt(e){let t=N,n=e&&e.sublayer;if(!t||!n)return;let r=Ot(n);r?Vt(r,P.getView().getProjection()):Array.isArray(t.extent)&&t.extent.every(isFinite)&&t.extent[2]>t.extent[0]&&t.extent[3]>t.extent[1]?Vt(t.extent,t.projection):z(`该图层暂无有效范围`,`warn`)}function At(e){let t=N;if(!t||!e||!Array.isArray(e.children)||!e.children.length)return;let n=me(),r=!1;e.children.forEach(e=>{let t=Ot(e.sublayer);t&&(be(n,t),r=!0)}),r&&n.every(isFinite)&&n[2]>n[0]&&n[3]>n[1]?Vt(n,P.getView().getProjection()):Vt(t.extent,t.projection)}function jt(e){let t=N;if(!t||!e)return!1;let n=t.sublayers.indexOf(e);if(n<0)return!1;if(t.sublayers.splice(n,1),Array.isArray(t.sources)){let n=t.sources.indexOf(e.source);n>=0&&t.sources.splice(n,1)}if(t.layer&&typeof t.layer.getLayers==`function`){t.layer.getLayers().remove(e.layer);try{e.layer.dispose()}catch{}}return!0}function Mt(e){let t=N;t&&!t.sublayers.length?(zt(t),e&&z(e,`ok`)):(vt(),yt(),e&&z(e,`ok`))}function Nt(e){let t=e&&e.sublayer;t&&jt(t)&&(a(`layer-removed`,{isGroup:!1,name:t.name,layerCount:null,group:t.group}),console.log(`row`,e),Mt(`已删除图层:`+t.name))}function Pt(e){if(!e||!Array.isArray(e.children)||!e.children.length)return;let t=e.children.length;e.children.forEach(e=>jt(e.sublayer)),console.log(`row`,e),a(`layer-removed`,{isGroup:!0,name:e.name,layerCount:t,group:null}),Mt(`已删除图层组(`+t+` 个图层)`)}function Ft(e){Array.isArray(e.sublayers)||(e.sublayers=[{name:e.name,kind:e.kind,layer:e.layer,visible:!0}]);for(let t of e.sublayers)t.name=t.name||e.name,t.kind=t.kind||e.kind,t.group=t.group||null,t.groupVisible=!t.group||t.groupVisible!==!1,t.visible=t.visible!==!1,t.layer.setVisible(St(t)),t.layer.set(`title`,t.name);return e.sublayers}function It(){if(!N)return;let e=P.getView();N.viewState={center:e.getCenter(),resolution:e.getResolution()},N.viewProjectionCode=e.getProjection().getCode()}function Lt(e){if(!e||e===N)return;It(),N&&P.removeLayer(N.layer),N=e,P.addLayer(e.layer);let t=st(e.viewProjectionCode)||e.projection,n=e.viewState;n&&n.center&&n.center.every(isFinite)?Wt(t,{center:n.center,resolution:n.resolution}):(Wt(t),Vt(e.extent,e.projection)),vt(),dt(),yt(),a(`active-map-changed`,{id:e.id,name:e.name,kind:e.kind})}function Rt(e){e.id=++ue,e.expandedLayerGroups=new Set,e.sublayers=Ft(e),e.layer.set(`title`,e.name),e.viewProjectionCode=e.projection.getCode(),e.viewState=null,fe.unshift(e),Lt(e)}function zt(e){let t=fe.indexOf(e);t>=0&&fe.splice(t,1),N===e?(P.removeLayer(e.layer),N=null,fe.length?Lt(fe[0]):(vt(),yt(),dt())):vt();try{e.cleanup&&e.cleanup()}catch{}a(`map-removed`,{id:e.id,name:e.name,kind:e.kind})}function Bt(){N?Vt(N.extent,N.projection):z(`暂无地图`,`warn`)}function Vt(e,t){let n=P.getView(),r=n.getProjection(),i=e;if(t&&t.getCode()!==r.getCode()){try{i=Pn(e,t,r)}catch{i=null}if(!i||!i.every(isFinite)){z(`无法将数据范围转换到当前视图坐标系`,`warn`);return}}!i||i[2]<=i[0]||i[3]<=i[1]||n.fit(i,{padding:[60,60,60,60],maxZoom:28,duration:300})}function Ht(){j.value.viewCrs=P.getView().getProjection().getCode()}function Ut(e){let t=P.getView(),n=t.getProjection(),r=t.getCenter(),i=t.getResolution(),a=null,o=null;try{a=Nn(r,n,e);let t=xn(n,1,r,`m`),s=xn(e,1,a,`m`);a.every(isFinite)&&[t,s].every(isFinite)&&s>0?o=i*t/s:a=null}catch{a=null}return{center:a,resolution:o}}function Wt(e,{center:t,resolution:n}={}){let r=new du({projection:e});if(P.setView(r),t&&t.every(isFinite))r.setCenter(t);else{let t=e.getExtent();t?r.setCenter([(t[0]+t[2])/2,(t[1]+t[3])/2]):r.setCenter([0,0])}if(n&&isFinite(n)&&n>0)try{r.setResolution(n)}catch{}lt(),Ht(),N&&Array.isArray(N.sources)&&N.sources.forEach(e=>e.refresh()),dt()}function Gt(e){let t=e.getExtent();if(!t||!t.every(isFinite))try{t=Pn([-180,-90,180,90],`EPSG:4326`,e)}catch{t=[-1,-1,1,1]}let n=t[2]-t[0],r=t[3]-t[1],i=Math.max(n,r),a=(t[0]+t[2])/2,o=(t[1]+t[3])/2;return[a-i/2,o-i/2,a+i/2,o+i/2]}function Kt(e,t,n=0,r=null){let i=Gt(e),a=(i[2]-i[0])/256,o=[];for(let e=0;e<=t;e++)o.push(a/2**e);return new Nf({extent:r||i,origin:[i[0],i[3]],resolutions:o,tileSize:[256,256],minZoom:n,maxZoom:t})}function qt(e,t){let n=e.getResolution(t.minZ),[r,i]=e.getOrigin(t.minZ);return[r+t.x0*256*n,i-(t.y1+1)*256*n,r+(t.x1+1)*256*n,i-t.y0*256*n]}function Jt(e){return isFinite(e)?Math.abs(e)>=1e3?Math.round(e).toLocaleString(`zh-CN`):String(+e.toFixed(6)):`-`}function Yt(e){return`X ${Jt(e[0])} ~ ${Jt(e[2])};Y ${Jt(e[1])} ~ ${Jt(e[3])}`}function Xt(e,t){let n=st(t);if(!n||n.getCode()===`PIXEL`)return null;let r=Qt(e);return r?qt(Kt(n,r.maxZ,r.minZ),r):null}function Zt(e,t){let n=new Map;for(let r of e){let e=(r.webkitRelativePath||r.name).match(se);if(!e)continue;let i=+e[1],a=+e[2],o=+e[3];t&&(o=(1<<i)-1-o),n.set(`${i}/${a}/${o}`,r)}return n}function Qt(e){if(!e.size)return null;let t=1/0,n=-1/0,r=new Map;for(let i of e.keys()){let[e,a,o]=i.split(`/`).map(Number);e<t&&(t=e),e>n&&(n=e);let s=r.get(e);s||(s={x0:1/0,x1:-1/0,y0:1/0,y1:-1/0},r.set(e,s)),s.x0=Math.min(s.x0,a),s.x1=Math.max(s.x1,a),s.y0=Math.min(s.y0,o),s.y1=Math.max(s.y1,o)}return{minZ:t,maxZ:n,...r.get(t),ranges:r}}function $t(e,t,n,r){let i=parseInt(e,10);return Number.isFinite(i)?Math.min(n,Math.max(t,i)):r}function en(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>n(Error(`图片加载失败`)),r.src=e})}function tn(e){let t=e.trim().split(/\r?\n/).map(e=>parseFloat(e.trim()));if(t.length<6||t.slice(0,6).some(e=>!isFinite(e)))throw Error(`世界文件格式无法解析`);return t.slice(0,6)}function nn(e,t,n){let[r,i,a,o,s,c]=n;if(i||a)throw Error(`不支持带旋转的世界文件`);return[s-r/2,c+(t-.5)*o,s+(e-.5)*r,c-o/2]}function rn(e){if(!e)return null;let t=e[2];if(t<=1e6||t>=7e7)return null;let n=Math.round(t/1e6),r=[];return n>=25&&n<=45&&r.push({code:`EPSG:${4513+n-25}`,label:`3度带 ${n},中央经线 ${n*3}°E(EPSG:${4513+n-25},含带号)`}),n>=13&&n<=23&&r.push({code:`EPSG:${4491+n-13}`,label:`6度带 ${n},中央经线 ${n*6-3}°E(EPSG:${4491+n-13},含带号)`}),r.length?(j.value.zoneHint={message:`检测到高斯带号坐标,可能是:`,options:r},r[0].code):null}function an(e){if(j.value.zoneHint={message:``,options:[]},!e)return;let t=rn(e);t&&(j.value.dataCrs=t)}function on(){if(F&&F.width&&ge)try{let e=tn(ge.text),t=nn(F.width,F.height,e);ke.value.value=t[0],Ae.value.value=t[1],De.value.value=t[2],Oe.value.value=t[3],an(t),z(`已根据世界文件计算显示范围`,`ok`)}catch(e){z(`世界文件解析失败:${e.message}`,`err`)}}async function sn(e){F&&F.objectUrl&&URL.revokeObjectURL(F.objectUrl);let t=URL.createObjectURL(e);F={file:e,objectUrl:t,name:e.name,width:null,height:null},j.value.imgFileName=e.name,ke.value.value=Ae.value.value=De.value.value=Oe.value.value=``,an(null);try{let e=await en(t);F.width=e.width,F.height=e.height,on()}catch{z(`图片无法读取`,`err`)}}function cn(){let e=[ke.value,Ae.value,De.value,Oe.value].map(e=>e.value.trim());if(e.some(e=>e===``))return z(`请填写完整的四至范围:X/Y 的最小值和最大值`,`warn`),{ok:!1,extent:null};let t=e.map(Number);return t.some(e=>!isFinite(e))?(z(`范围数值无效`,`warn`),{ok:!1,extent:null}):t[2]>t[0]&&t[3]>t[1]?{ok:!0,extent:t}:(z(`范围无效:需要 X最大 > X最小 且 Y最大 > Y最小`,`warn`),{ok:!1,extent:null})}async function ln(){Ke();try{if(!F){z(`请先选择图片文件`,`warn`);return}let e=st(j.value.dataCrs);if(!e){z(`请先选择或注册有效的坐标系`,`warn`);return}let{width:t,height:n}=F;if(!t||!n)try{let e=await en(F.objectUrl);t=F.width=e.width,n=F.height=e.height}catch{z(`无法读取图片尺寸`,`err`);return}let r=cn();if(!r.ok)return;let i=r.extent,a=URL.createObjectURL(F.file),o=new uf({source:new $f({url:a,imageExtent:i,projection:e})});Rt({name:F.name,kind:`image`,layer:o,extent:i,projection:e,cleanup(){URL.revokeObjectURL(a)}})}finally{qe()}}async function un({url:e,name:t,worldText:n,extent:r,crs:i=null}){Ke();try{let a;try{a=await en(e)}catch{z(`无法加载图片:${e}`,`err`);return}if(n)try{let e=tn(n);r=nn(a.width,a.height,e)}catch(e){z(`世界文件解析失败:${e.message}`,`err`)}r||=[0,-a.height,a.width,0],an(r);let o=i||rn(r)||`EPSG:3857`;j.value.dataCrs=o;let s=st(o)||ae,c=new uf({source:new $f({url:e,imageExtent:r,projection:s})});ke.value.value=r[0],Ae.value.value=r[1],De.value.value=r[2],Oe.value.value=r[3],Rt({name:t,kind:`image`,layer:c,extent:r,projection:s,cleanup(){}})}finally{qe()}}function dn(e){let t=Array.from(e||[]);if(!t.length)return;let n=(t[0].webkitRelativePath||``).split(/[\\/]/)[0]||`本地切片XYZ目录`;he={name:n,files:t},j.value.tilesDirName=`${n}(${t.length} 个文件)`,fn()}function fn(){if(!he)return;let e=Zt(he.files,j.value.tilesTms),t=Qt(e);if(!t){j.value.tilesInfo=`未识别到本地切片XYZ(需要 z/x/y.png 目录结构)`;return}let n=Xt(e,j.value.dataCrs);j.value.tilesInfo=n?`已识别 ${e.size} 张切片,层级 ${t.minZ}–${t.maxZ}。显示范围(${j.value.dataCrs}):${Yt(n)}`:`已识别 ${e.size} 张切片,层级 ${t.minZ}–${t.maxZ}。`}function pn(){Ke();try{if(!he||!he.files.length){z(`请先选择本地切片XYZ目录`,`warn`);return}let e=st(j.value.dataCrs);if(!e){z(`请先选择或注册有效的坐标系`,`warn`);return}let t=Zt(he.files,j.value.tilesTms);if(!t.size){z(`所选目录中未找到 z/x/y 结构的切片文件`,`err`);return}let n=Qt(t),r=qt(Kt(e,n.maxZ,n.minZ),n),i=Kt(e,n.maxZ,n.minZ,r),a=new Map,o=new Xf({projection:e,tileGrid:i,wrapX:!1,minZoom:n.minZ,maxZoom:n.maxZ,tileUrlFunction:([e,n,r])=>{let i=t.get(`${e}/${n}/${r}`);if(!i)return;let o=a.get(i);return o||(o=URL.createObjectURL(i),a.set(i,o)),o}});Rt({name:he.name,kind:`tiles`,layer:new _f({source:o}),extent:r,projection:e,cleanup(){a.forEach(e=>URL.revokeObjectURL(e))}})}finally{qe()}}function mn(){let e=String(j.value.urlTemplate||``).trim();j.value.urlInfo=``,e&&(/^https?:\/\//i.test(e)?/\{z\}/.test(e)&&/\{x\}/.test(e)&&/(\{y\}|\{-y\})/.test(e)||(j.value.urlInfo=`模板需包含 {z}、{x} 和 {y}(或 {-y})。`):j.value.urlInfo=`URL 模板需以 http:// 或 https:// 开头。`)}async function hn(e,t,n,r,i=null){if(!e||!/^https?:\/\//i.test(e))return{error:`URL 模板需以 http:// 或 https:// 开头`};if(!/\{z\}/.test(e)||!/\{x\}/.test(e)||!/(\{y\}|\{-y\})/.test(e))return{error:`模板需包含 {z}、{x} 和 {y}(或 {-y})`};let a=st(t);if(!a)return{error:`请先选择或注册有效的坐标系`};let o=null;if(i){let e=st(i.crs);if(!e)return{error:`范围坐标系无效`};let t=i.extent;if(!t||!t.every(Number.isFinite))return{error:`范围数值无效`};if(t[0]>=t[2]||t[1]>=t[3])return{error:`范围需满足:X最小 < X最大,Y最小 < Y最大`};try{o=Pn(t,e,a)}catch{return{error:`范围坐标系换算失败`}}if(!o||!o.every(Number.isFinite))return{error:`范围坐标系换算失败`}}let s=r??$t(j.value.urlMaxzoom,0,24,22),c=n??$t(j.value.urlMinzoom,0,24,0),l={projection:a,tileGrid:Kt(a,Math.max(s,c),c,o),minZoom:c,maxZoom:s,url:e};return o&&(l.wrapX=!1),{entry:{name:`在线切片XYZ · ${e.length>28?e.slice(0,28)+`…`:e}`,kind:`xyz`,layer:new _f({source:new Xf(l)}),extent:o,projection:a,cleanup(){}}}}async function gn(){Ke();try{let e=String(j.value.urlTemplate||``).trim();if(!e){z(`请填写在线切片XYZ URL 模板`,`warn`);return}if(String(j.value.urlMinzoom||``).trim()===``){z(`请填写最小层级`,`warn`);return}if(String(j.value.urlMaxzoom||``).trim()===``){z(`请填写最大层级`,`warn`);return}let t=[Ve.value.value,He.value.value,ze.value.value,Be.value.value];if(t.some(e=>e.trim()===``)){z(`请填写完整的范围:X/Y 的最小值和最大值`,`warn`);return}let n=t.map(Number);if(!n.every(Number.isFinite)){z(`范围数值无效`,`warn`);return}let r={extent:n,crs:j.value.urlExtentCrs},i=await hn(e,j.value.dataCrs,null,null,r);if(!i.entry){z(i.error||`加载失败`,`warn`);return}j.value.urlInfo=`使用指定范围加载,已自动定位。`,Rt(i.entry)}finally{qe()}}function _n(e){let t=0,n=String(e||`vector`);for(let e=0;e<n.length;e++)t=t*31+n.charCodeAt(e)>>>0;return ce[t%ce.length]}function vn(e,t){return Array.from(e.getElementsByTagName(`*`)).filter(e=>e.localName===t)}function bn(e){let t=new Map,n=[...vn(e,`SvgParameter`),...vn(e,`CssParameter`)];for(let e of n){let n=e.getAttribute(`name`);n&&t.set(n.toLowerCase(),(e.textContent||``).trim())}return t}function Sn(e,t=`stroke`){let n=e.get(t);if(n)return new $o({color:n,width:Number(e.get(t+`-width`))||1,lineCap:e.get(t+`-linecap`)===`square`?`square`:void 0,lineJoin:e.get(t+`-linejoin`)===`mitre`?`miter`:void 0,lineDash:(e.get(t+`-dasharray`)||``).split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite)})}function Cn(e){let t=new DOMParser().parseFromString(e,`application/xml`);if(t.getElementsByTagName(`parsererror`).length)return null;let n=[],r=null,i=vn(t,`TextSymbolizer`).length>0;for(let e of vn(t,`PointSymbolizer`)){if(i)continue;let t=bn(e),a=t.has(`fill`)?new Qo({color:t.get(`fill`)}):void 0,o=Sn(t),s=Number((vn(e,`Size`)[0]||{}).textContent)||8,c=((vn(e,`WellKnownName`)[0]||{}).textContent||`circle`).toLowerCase(),l={radius:s/2,fill:a,stroke:o},u;u=c===`square`?new is({...l,points:4,angle:Math.PI/4}):c===`triangle`?new is({...l,points:3,angle:0}):c===`cross`?new is({...l,points:4,angle:0,radius2:s/6}):new as(l);let d=new os({image:u});n.push(d),r||=d}for(let e of vn(t,`LineSymbolizer`)){let t=Sn(bn(e));t&&n.push(new os({stroke:t}))}for(let e of vn(t,`PolygonSymbolizer`)){let t=bn(e),r=t.has(`fill`)?new Qo({color:t.get(`fill`)}):void 0,i=Sn(t);(r||i)&&n.push(new os({fill:r,stroke:i}))}for(let e of vn(t,`TextSymbolizer`)){let t=vn(e,`PropertyName`)[0],i=t?t.textContent.trim():``,a=bn(vn(e,`Font`)[0]||e),o=Number(a.get(`font-size`))||10,s=a.get(`font-family`)||`SimSun`,c=a.get(`font-weight`)||`normal`,l=new fs({font:(a.get(`font-style`)||`normal`)+` `+c+` `+o+`px "`+s+`", sans-serif`,fill:new Qo({color:bn(e).get(`fill`)||`#000000`}),text:i?` `:``});r?r.setText(l):n.push(new os({text:l}))}return n.length?n:null}function wn(e){let t=new DOMParser().parseFromString(e,`application/xml`);for(let e of vn(t,`TextSymbolizer`)){let t=vn(e,`PropertyName`)[0];if(t)return t.textContent.trim()}return``}function Tn(e){if(typeof e!=`string`)return null;let t=e.trim().split(`,`).map(e=>Number(e.trim()));if(t.length<3||t.slice(0,3).some(e=>!Number.isFinite(e)||e<0||e>255))return null;let n=t.length>=4&&Number.isFinite(t[3])&&t[3]>=0&&t[3]<=255?t[3]/255:1;return[t[0],t[1],t[2],n]}function En(e){let t=Number(e);return!Number.isFinite(t)||t<0||t>16777215?null:[t>>16&255,t>>8&255,t&255,1]}function kn(e){return Tn(e.get(`color`))||En(e.get(`color24`))||null}function An(e,t,n){if(!t)return;let r=e.getStroke(),i=e.getFill(),a=e.getText();n.includes(`Polygon`)?(r&&e.setStroke(new $o({color:t,width:r.getWidth(),lineCap:r.getLineCap(),lineJoin:r.getLineJoin(),lineDash:r.getLineDash(),lineDashOffset:r.getLineDashOffset(),miterLimit:r.getMiterLimit()})),i&&e.setFill(new Qo({color:t}))):n.includes(`LineString`)||n.includes(`Curve`)?r&&e.setStroke(new $o({color:t,width:r.getWidth(),lineCap:r.getLineCap(),lineJoin:r.getLineJoin(),lineDash:r.getLineDash(),lineDashOffset:r.getLineDashOffset(),miterLimit:r.getMiterLimit()})):n.includes(`Point`)&&(i&&e.setFill(new Qo({color:t})),a&&a.setFill(new Qo({color:t}))),a&&(n.includes(`Point`)||n.includes(`Polygon`))&&a.setFill(new Qo({color:t}))}function jn(e,t){let n=new Map;return(r,i)=>{let a=r.getGeometry(),o=a?a.getType():``,s=t?r.get(t):null,c=kn(r),l=c?c.join(`,`):`sld`,u=a&&a.getFirstCoordinate?a.getFirstCoordinate():P.getView().getCenter(),d=xn(P.getView().getProjection(),Number.isFinite(i)&&i>0?i:1,u,`m`),f=Number(r.get(`height`)),p=Number.isFinite(f)&&f>0?Math.max(3,Math.min(128,f/d)):null,m=Math.round(Math.log2(d)*4),h=Number(r.get(`angle`)),g=Number.isFinite(h)?h*Math.PI/180:null,_=o+`|`+l+`|`+m+`|`+String(s??``)+`|`+g,v=n.get(_);return v||(v=e.map(e=>{let n=e.clone();An(n,c,o);let r=n.getText();if(r&&t&&s!=null&&s!==``){if(r.setText(String(s)),p!=null){let e=r.getFont()||`normal normal 10px "SimSun", sans-serif`;r.setFont(e.replace(/([0-9]+(?:\.[0-9]+)?)px/,p.toFixed(2)+`px`))}g!=null&&r.setRotation(g)}return n}),n.set(_,v)),v}}function Mn(e,t){let n=e.get(`_sldStyle`);if(n)return typeof n==`function`?n(e,t):n;let r=e.getGeometry(),i=r?r.getType():``,a=e.get(`_styleColor`)||_n(e.get(`layer`)||e.get(`_layerName`)),o=e.get(`_labelProperty`)?e.get(e.get(`_labelProperty`)):e.get(`text`),s=o!=null&&o!==``?new fs({font:`12px "Microsoft YaHei", sans-serif`,fill:new Qo({color:`#1c2833`}),text:String(o)}):void 0;return i.includes(`Polygon`)?new os({fill:new Qo({color:a+`26`}),stroke:new $o({color:a,width:1.5}),text:s}):i.includes(`LineString`)||i.includes(`Curve`)?new os({stroke:new $o({color:a,width:1.4}),text:s}):new os({image:new as({radius:4.5,fill:new Qo({color:a}),stroke:new $o({color:`#ffffff`,width:1})}),text:s})}function Fn(e){let t=me();for(let n of e){let e=n.getGeometry();e&&be(t,e.getExtent())}return t}function In(e,t){return new Zo({loader(n,r,i){let a=e.map(e=>{let n=e.clone(),r=n.getGeometry();return r&&r.transform(t,i),n});return this.addFeatures(a),a}})}function Ln(e){let t=e&&e.crs&&e.crs.properties&&e.crs.properties.name;if(!t)return null;if(/CRS84$/i.test(t))return`EPSG:4326`;let n=String(t).match(/EPSG[:\s]+(\d+)/i);return n?`EPSG:`+n[1]:null}function Rn(e,t){let n=e===`EPSG:4326`?`EPSG:4326(WGS84 / CRS84)`:e;return t?n+`(`+t+` 个文件)`:n}function zn(e,t){t?!e||!e.size?(j.value.geojsonCrsHint=`已检查 ${t} 个 GeoJSON,未发现 CRS 声明。`,j.value.geojsonCrsOptions=[]):(j.value.geojsonCrsHint=`检测到 ${e.size} 种 CRS:`,j.value.geojsonCrsOptions=[...e].map(([e,t])=>({code:e,label:Rn(e,t)}))):(j.value.geojsonCrsHint=`未识别到 GeoJSON,无法检测 CRS。`,j.value.geojsonCrsOptions=[])}async function Bn(e,t){let n=new Map,r=0;for(let i of e){if(t!==de)return;try{let e=Ln(JSON.parse(await i.file.text()));e&&n.set(e,(n.get(e)||0)+1)}catch{}r+=1,zn(n,r)}if(t===de&&(zn(n,r),n.size)){let e=[...n.entries()].sort((e,t)=>t[1]-e[1]);j.value.dataCrs=e[0][0]}}function Vn(e){return/^metadata\.json$/i.test(e.name)}function Hn(e){let t=e.filter(e=>ie.test(e.name)&&!Vn(e)),n=new Map;for(let t of e)oe.test(t.name)&&n.set(t.name.replace(/\.[^.]+$/,``),t);return t.map(e=>({file:e,sld:n.get(e.name.replace(/\.[^.]+$/,``))||null}))}async function Un(e,t){if(!t)return{pairs:e,metadata:null};let n=JSON.parse(await t.text());if(!n||!Array.isArray(n.layers))throw Error(`metadata.json 缺少 layers 数组`);let r=new Map(e.map(e=>[e.file.name,e])),i=[],a=new Set;for(let e of n.layers){let t=e&&e.geojson,n=r.get(t);n&&!a.has(t)&&(n.layerTitle=e.title||``,i.push(n),a.add(t))}for(let t of e)a.has(t.file.name)||i.push(t);return{pairs:i,metadata:n}}function Wn(e){let t=Array.from(e||[]),n=t.length?(t[0].webkitRelativePath||``).split(/[\\/]/)[0]:`GeoJSON 目录`,r=Hn(t),i=t.find(Vn)||null;pe={name:n,files:t,pairs:r,metadataFile:i,metadataName:null},j.value.geojsonDirName=r.length?n+`(`+r.length+` 个 GeoJSON,`+r.filter(e=>e.sld).length+` 个 SLD)`:`未识别到 GeoJSON 文件`,j.value.geojsonInfo=r.length?(i?`已识别 metadata.json,将按其中的图层顺序加载;`:``)+`未配对的 .sld 使用默认矢量样式。`:`请选择包含 .geojson(或 .json)和可选同名 .sld 的目录。`,de+=1,r.length?(j.value.geojsonCrsHint=`正在检测 GeoJSON CRS…`,Bn(r,de)):j.value.geojsonCrsHint=`未选择 GeoJSON。`}async function Gn(){Ke();try{if(!pe||!pe.pairs.length){z(`请先选择包含 GeoJSON 文件的目录`,`warn`);return}let e=new lp,t=[],n=null,r=null,i=0,a=pe.pairs,o=[];try{if(pe.metadataFile){let e=await Un(pe.pairs,pe.metadataFile);a=e.pairs,pe.metadataName=e.metadata&&e.metadata.name?e.metadata.name:null}for(let s of a){let a=await s.file.text(),c=JSON.parse(a),l=Ln(c)||j.value.dataCrs,u=st(l);if(!u)throw Error(`无效坐标系:`+l);let d=e.readFeatures(c,{dataProjection:l,featureProjection:l});if(n){if(u.getCode()!==r)for(let e of d){let t=e.getGeometry();t&&t.transform(u,n)}}else n=u,r=u.getCode();if(s.sld){let e=await s.sld.text(),t=Cn(e);if(t){let n=jn(t,wn(e));for(let e of d)e.set(`_sldStyle`,n,!0),s.layerTitle&&e.set(`_layerName`,s.layerTitle,!0);i++}}o.push({pair:s,features:d}),t.push(...d)}}catch(e){z(`GeoJSON 加载失败:`+e.message,`err`);return}if(!t.length){z(`所选文件中没有有效要素`,`warn`);return}let s=o.map(({pair:e,features:t})=>{let r=In(t,n),i=new wu({source:r,style:(e,t)=>Mn(e,t)});return{name:e.layerTitle||e.file.name,kind:`geojson`,layer:i,featureCount:t.length,visible:!0,group:bt(t),groupVisible:!0,source:r}});if(s.some(e=>e.group===`0`))for(let e of s)e.group||=`0`;let c=new Ed({layers:s.map(e=>e.layer)});Rt({name:pe.metadataName||pe.name,kind:`geojson`,layer:c,sublayers:s.map(e=>{let t={...e};return delete t.source,t}),extent:Fn(t),projection:n,sourceCrs:r,sources:s.map(e=>e.source),cleanup(){}}),j.value.geojsonInfo=`已按 metadata.json 顺序加载 `+a.length+` 个图层、`+t.length+` 个要素,应用 `+i+` 个 SLD 样式,数据坐标系 `+r+`。`}finally{qe()}}function Kn(){let e=j.value.viewCrs,t=P.getView().getProjection();if(t.getCode()===e){z(`当前视图已使用该坐标系`,`info`);return}if(t.getCode()===`PIXEL`||e===`PIXEL`){z(`像素坐标无法与其他坐标系互转`,`warn`);return}let n=st(e);if(!n){z(`目标坐标系未注册`,`warn`);return}let{center:r,resolution:i}=Ut(n);Wt(n,{center:r,resolution:i}),r&&!i&&N&&Bt(),N&&(N.viewProjectionCode=n.getCode(),vt())}function qn(e,t){try{if(B(e)||(Nb.defs(e,t),Zf(Nb)),!B(e))throw Error(`注册失败`)}catch(e){return z(`坐标系注册失败:${e.message}`,`err`),!1}return le.some(t=>t.code===e)||le.push({code:e,name:`${e} · 自定义`,def:t}),ot(),j.value.dataCrs=e,!0}async function Jn(){let e=String(parseInt(Te.value.value.trim(),10));if(!e||e===`NaN`){z(`请输入有效的 EPSG 代码`,`warn`);return}let t=`EPSG:${e}`;z(`正在从 epsg.io 获取 ${t} …`);try{let n=await fetch(`https://epsg.io/${e}.proj4`);if(!n.ok)throw Error(`HTTP ${n.status}`);let r=(await n.text()).trim();if(!r.startsWith(`+`))throw Error(`返回内容不是 proj4 定义`);qn(t,r)&&z(`已注册并应用 ${t}`,`ok`)}catch(e){z(`获取失败(${e.message}),请检查网络后重试`,`err`)}}function Yn(e){d.value=e}function Xn(e){f.value=e,d.value=[`image`,`tiles`,`url`].includes(e)?`raster`:`vector`}function Zn(e){Yn(e),Xn(e===`raster`?`image`:`geojson`)}function Qn(){F&&F.objectUrl&&URL.revokeObjectURL(F.objectUrl),F=null,ge=null,he=null,pe=null,I.value.value=``,Ue.value.value=``,Re.value.value=``,je.value.value=``,j.value.imgFileName=`未选择文件`,j.value.worldFileName=`未选择文件`,j.value.tilesDirName=`未选择目录`,j.value.tilesInfo=`支持 QGIS / GDAL 等导出的 z/x/y.png 目录结构。`,j.value.tilesTms=!1,j.value.geojsonDirName=`未选择目录`,j.value.geojsonInfo=`支持按文件名配对的 .geojson 与 .sld。`,de+=1,j.value.geojsonCrsHint=`未选择 GeoJSON。`,j.value.geojsonCrsOptions=[],ke.value.value=Ae.value.value=De.value.value=Oe.value.value=``,j.value.zoneHint={message:``,options:[]},j.value.urlTemplate=``,j.value.urlMinzoom=j.value.urlMaxzoom=``,Ve.value.value=He.value.value=ze.value.value=Be.value.value=``,j.value.urlExtentCrs=`EPSG:3857`,j.value.urlInfo=``,j.value.customEpsg=``,j.value.dataCrs=`EPSG:3857`,Xn(`image`)}function $n(){Qn(),p.value=!0}function er(){p.value=!1}function tr(){if(!P)return null;let e=P.getView();return{center:e.getCenter(),zoom:e.getZoom(),crs:e.getProjection().getCode()}}function nr(){let e=N;if(!e)return null;let t=P.getView();return{id:e.id,name:e.name,kind:e.kind,dataCrs:e.projection.getCode(),viewCrs:e.viewProjectionCode,extent:e.extent,sublayerCount:e.sublayers.length,center:t.getCenter(),zoom:t.getZoom()}}async function rr({url:e,crs:t=`EPSG:3857`,minZoom:n=0,maxZoom:r=22,extent:i=null,extentCrs:a=null}={}){o.value||await fr();let s=await hn(e,t,n,r,i&&i.length===4?{extent:i,crs:a||t}:null);return s.entry?(Rt(s.entry),s.entry):(z(s.error||`加载失败`,`warn`),null)}async function ir({url:e,name:t=null,crs:n=null,worldFileUrl:r=null,worldText:i=null,extent:a=null}={}){if(o.value||await fr(),n&&(j.value.dataCrs=n),!i&&r)try{let e=await fetch(r);e.ok&&(i=await e.text())}catch{}return await un({url:e,name:t||decodeURIComponent(String(e).split(`/`).pop()||`图片`),worldText:i,extent:a,crs:n}),N}async function ar(e){return o.value||await fr(),Wn(e),await Gn(),N}async function or(e,t=``){o.value||await fr();let n=sr(e);if(!n.length)return z(`清单中没有文件`,`warn`),null;let r=[],i=[];for(let e of n){let n=cr(e.url,t);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP `+e.status);let t=await e.blob();r.push(new File([t],lr(n),{type:t.type||`application/octet-stream`}))}catch(e){console.error(`[manifest] 文件加载失败:`,n,e),i.push(lr(n)+`:`+e.message)}}if(i.length&&z(`有 `+i.length+` 个文件加载失败:`+i.slice(0,3).join(`;`)+(i.length>3?` 等`:``),`warn`),!r.length)throw Error(`矢量文件全部加载失败(共 `+i.length+` 个)`);return ar(r)}function sr(e){let t=e=>{if(typeof e==`string`)return{url:e};if(!e||typeof e!=`object`)return null;let t=e.url||e.geojson||e.image||e.png||null;return t?{url:t,type:e.type||null,name:e.name||e.title||null,crs:e.crs||null,worldFile:e.worldFile||e.worldfile||null,worldText:e.worldText||null,extent:Array.isArray(e.extent)&&e.extent.length===4?e.extent:null,sld:e.sld||null}:null},n=e=>{let n=[],r=t(e);return r&&n.push(r),e&&typeof e==`object`&&typeof e.sld==`string`&&e.sld&&(r&&r.url===e.sld||n.push({url:e.sld})),n};if(Array.isArray(e))return[].concat.apply([],e.map(n));if(!e)return[];if(Array.isArray(e.files))return[].concat.apply([],e.files.map(n));if(Array.isArray(e.layers)){let n=[];for(let r of e.layers)r&&r.geojson&&n.push(t(Object.assign({},r,{url:r.geojson,sld:null}))),r&&r.sld&&n.push({url:r.sld});return n.push({url:`metadata.json`}),n}return[]}function cr(e,t){let n=String(e);return/^https?:\/\//i.test(n)||!t?n:t.replace(/\/$/,``)+`/`+n.replace(/^\//,``)}function lr(e){return decodeURIComponent(String(e).split(`/`).pop().split(`?`)[0]||`未命名`)}async function ur(e){if(o.value||await fr(),!Array.isArray(e)||!e.length)return z(`没有可加载的图层数据`,`warn`),null;let t=[];for(let n of e){if(!n||!n.geojson)continue;let e=typeof n.geojson==`string`?n.geojson:JSON.stringify(n.geojson);if(t.push(new File([e],n.name+`.geojson`,{type:`application/geo+json`})),n.sld){let e=typeof n.sld==`string`?n.sld:JSON.stringify(n.sld);t.push(new File([e],n.name+`.sld`,{type:`application/xml`}))}}return t.length?ar(t):(z(`没有可加载的图层数据`,`warn`),null)}async function dr(){await Gn()}function fr(){return o.value?Promise.resolve():new Promise(e=>{let t=setInterval(()=>{o.value&&(clearInterval(t),e())},50)})}async function pr(){Ke();try{let e=i.autoLoad;if(!e||!e.url)return;if(e.type===`manifest`){let t=await fetch(e.url);if(!t.ok)throw Error(`获取失败:`+e.url+`(`+t.status+`)`);await or(await t.json(),e.baseUrl||``)}else e.type===`image`&&await ir({url:e.url,name:e.name||null,crs:e.crs||null,worldFileUrl:e.worldFile||null,worldText:e.worldText||null,extent:e.extent||null})}finally{qe()}}function mr(e){g.value=e===`light`,i.themeIcon=g.value?`🌙`:`☀️`,i.themeTitle=g.value?`切换到深色主题`:`切换到浅色主题`,a(`theme-changed`,e)}async function hr(e,t=``){if(!e)return[];if(e.isFile)return await new Promise(n=>{e.file(r=>{try{Object.defineProperty(r,"webkitRelativePath",{value:t+e.name})}catch{}n([r])},()=>n([]))});let n=e.createReader(),r=[];for(;;){let e=await new Promise(e=>n.readEntries(e,()=>e([])));if(!e.length)break;r.push(...e)}let i=[];for(let n of r)i.push(...await hr(n,t+e.name+`/`));return i}async function gr(e){let t=Array.from(e&&e.files||[]);if(t.length)return t;let n=Array.from(e&&e.items||[]).map(e=>e.webkitGetAsEntry&&e.webkitGetAsEntry()).filter(Boolean);return n.length?(await Promise.all(n.map(e=>hr(e)))).flat():[]}function _r(e){return e=String(e||``).trim(),/^\d+$/.test(e)?`EPSG:${e}`:/^epsg:\d+$/i.test(e)?e.toUpperCase():null}return(0,t.onMounted)(()=>{Ge(),pr().catch(e=>{console.error(`[autoLoad] 自动加载失败:`,e),z(`自动加载失败:`+e.message,`err`)}),i.hidePanels&&(Ye(),Ze())}),(0,t.onBeforeUnmount)(()=>{tt()}),n({viewerReady:o,sidebarWidth:s,loadingTasks:c,olLoading:l,dropVisible:u,sourceCategory:d,currentTab:f,loadDialogVisible:p,sidebarCollapsed:m,panelRightCollapsed:h,isLight:g,themeIcon:_,themeTitle:v,statusInfo:y,toastText:b,toastType:x,toastVisible:S,mapInfo:C,mapListItems:w,layerListVisible:T,layerListHint:E,layerTotal:D,layerFeatureTotal:O,layerListItems:k,crsOptions:A,customCrsOptions:ee,mapExtent:te,viewExtent:ne,form:j,initViewer:Ge,pushLoading:Ke,popLoading:qe,startSidebarResize:Je,collapseSidebar:Ye,expandSidebar:Xe,collapsePanelRight:Ze,expandPanelRight:Qe,toggleTheme:$e,loadToMap:et,destroyViewer:tt,createFitAllControl:nt,gkDef:rt,addGroup:it,buildCrsOptionGroups:at,refillCrsSelects:ot,ensureProjection:st,formatCoord:ct,attachViewListener:lt,fmtRes:ut,updateStatus:dt,updateMapExtent:ft,updateViewExtent:pt,fmtExtentInput:ht,toast:z,kindIcon:gt,selectAndFitMap:_t,renderMapList:vt,renderMapInfo:yt,inferGeoJsonGroup:bt,buildLayerGroups:xt,isLayerEffectivelyVisible:St,renderLayerList:Ct,toggleLayerVisible:wt,toggleLayerGroupExpanded:Tt,toggleLayerGroupVisible:Et,toggleLayerChildVisible:Dt,getVectorSourceExtent:Ot,zoomToLayer:kt,zoomToLayerGroup:At,removeSublayerInternal:jt,afterLayersRemoved:Mt,removeLayerItem:Nt,removeLayerGroup:Pt,normalizeSublayers:Ft,saveActiveViewState:It,selectMapEntry:Lt,addMapEntry:Rt,deleteMapEntry:zt,fitActiveMap:Bt,fitToExtent:Vt,syncViewCrsSelect:Ht,computeViewTransition:Ut,setViewProjection:Wt,worldSquareExtent:Gt,buildTileGrid:Kt,tilesExtent:qt,fmtExtentNum:Jt,extentText:Yt,extentFromTileMap:Xt,scanTileFiles:Zt,tileStats:Qt,clampInt:$t,getImageSize:en,parseWorldFile:tn,extentFromWorldFile:nn,guessCrsFromExtent:rn,updateZoneHint:an,applyWorldFileToExtent:on,onImageFileChosen:sn,readExtentInputs:cn,loadImageLayer:ln,addImageFromUrl:un,onTilesDirChosen:dn,updateTilesInfo:fn,loadTilesLayer:pn,updateUrlTemplateHint:mn,createXyzEntry:hn,loadUrlLayer:gn,vectorColor:_n,descendants:vn,svgParameters:bn,strokeFromParams:Sn,parseSldStyles:Cn,sldLabelProperty:wn,parseCadColor:Tn,parseCadColor24:En,resolveGeoJsonCadColor:kn,setStyleColor:An,makeSldStyleFunction:jn,defaultVectorStyle:Mn,featuresExtent:Fn,createReprojectingVectorSource:In,geoJsonCrsCode:Ln,geoJsonCrsChipLabel:Rn,updateGeoJsonCrsHint:zn,detectGeoJsonCrsHints:Bn,isMetadataJson:Vn,matchGeoJsonPairs:Hn,orderGeoJsonPairsByMetadata:Un,onGeoJsonDirChosen:Wn,loadGeoJsonLayers:Gn,switchViewProjection:Kn,registerCustom:qn,fetchAndRegisterEpsg:Jn,setSourceCategory:Yn,setActiveTab:Xn,setSourceCategoryAndDefault:Zn,resetLoadDialog:Qn,openLoadDialog:$n,closeLoadDialog:er,getViewState:tr,getActiveMapInfo:nr,addXyzLayer:rr,loadImageFromUrl:ir,loadGeoJsonFromFiles:ar,loadGeoJsonFromManifest:or,manifestEntries:sr,resolveManifestUrl:cr,manifestUrlName:lr,loadGeoJsonFromData:ur,loadGeoJsonForCurrentSource:dr,waitViewerReady:fr,processAutoLoad:pr,applyTheme:mr,readDroppedEntry:hr,filesFromDataTransfer:gr,normalizeEpsg:_r}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`mapViewer`,ref:Me,class:(0,t.normalizeClass)([`map-viewer-root`,{"light-theme":g.value,"sidebar-collapsed":m.value,"panel-right-collapsed":h.value}]),style:(0,t.normalizeStyle)(R.value)},[(0,t.createElementVNode)(`aside`,Pb,[(0,t.createElementVNode)(`header`,Fb,[n[11]||=(0,t.createElementVNode)(`div`,{class:`brand`},[(0,t.createElementVNode)(`span`,{class:`logo`},`🗺️`),(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`h1`,null,`地图查看器`),(0,t.createElementVNode)(`p`,null,`当前地图信息`)])],-1),(0,t.createElementVNode)(`button`,{id:`sidebar-collapse`,title:`收起面板`,ref_key:`sidebarCollapse`,ref:Pe,onClick:Ye},`‹`,512)]),(0,t.createElementVNode)(`div`,Ib,[(0,t.createElementVNode)(`section`,Lb,[n[16]||=(0,t.createElementVNode)(`h2`,null,`当前地图`,-1),C.value.active?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Rb,`暂无地图,请上传地图。`)),(0,t.withDirectives)((0,t.createElementVNode)(`div`,zb,[(0,t.createElementVNode)(`div`,Bb,[n[12]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`名称`,-1),(0,t.createElementVNode)(`span`,Vb,(0,t.toDisplayString)(C.value.name),1)]),(0,t.createElementVNode)(`div`,Hb,[n[13]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`类型`,-1),(0,t.createElementVNode)(`span`,Ub,(0,t.toDisplayString)(C.value.kind),1)]),(0,t.createElementVNode)(`div`,Wb,[n[14]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`数据坐标系`,-1),(0,t.createElementVNode)(`span`,Gb,(0,t.toDisplayString)(C.value.dataCrs),1)]),(0,t.createElementVNode)(`div`,Kb,[n[15]||=(0,t.createElementVNode)(`span`,{class:`detail-label`},`显示范围`,-1),(0,t.createElementVNode)(`span`,qb,(0,t.toDisplayString)(C.value.extent),1)])],512),[[t.vShow,C.value.active]])]),(0,t.withDirectives)((0,t.createElementVNode)(`section`,Jb,[n[25]||=(0,t.createElementVNode)(`h2`,null,`视图坐标系`,-1),(0,t.createElementVNode)(`div`,Yb,[(0,t.withDirectives)((0,t.createElementVNode)(`select`,{id:`view-crs`,"onUpdate:modelValue":n[0]||=e=>j.value.viewCrs=e},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(A.value.viewCrs,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,{key:e.label,label:e.label},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,Zb))),128))],8,Xb))),128)),ee.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,Qb,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ee.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,$b))),128))])):(0,t.createCommentVNode)(``,!0)],512),[[t.vModelSelect,j.value.viewCrs]]),(0,t.createElementVNode)(`button`,{id:`btn-switch-view`,class:`mini-btn`,type:`button`,ref_key:`btnSwitchView`,ref:we,onClick:Kn},`切换`,512)]),n[26]||=(0,t.createElementVNode)(`label`,{class:`grid-caption`},`显示范围`,-1),(0,t.createElementVNode)(`div`,ex,[(0,t.createElementVNode)(`label`,null,[n[17]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-minx`,step:`any`,readonly:``,value:te.value.minx},null,8,tx)]),(0,t.createElementVNode)(`label`,null,[n[18]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-miny`,step:`any`,readonly:``,value:te.value.miny},null,8,nx)]),(0,t.createElementVNode)(`label`,null,[n[19]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-maxx`,step:`any`,readonly:``,value:te.value.maxx},null,8,rx)]),(0,t.createElementVNode)(`label`,null,[n[20]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`map-ext-maxy`,step:`any`,readonly:``,value:te.value.maxy},null,8,ix)])]),n[27]||=(0,t.createElementVNode)(`label`,{class:`grid-caption`},`当前视野`,-1),(0,t.createElementVNode)(`div`,ax,[(0,t.createElementVNode)(`label`,null,[n[21]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-minx`,step:`any`,readonly:``,value:ne.value.minx},null,8,ox)]),(0,t.createElementVNode)(`label`,null,[n[22]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-miny`,step:`any`,readonly:``,value:ne.value.miny},null,8,sx)]),(0,t.createElementVNode)(`label`,null,[n[23]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-maxx`,step:`any`,readonly:``,value:ne.value.maxx},null,8,cx)]),(0,t.createElementVNode)(`label`,null,[n[24]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`view-ext-maxy`,step:`any`,readonly:``,value:ne.value.maxy},null,8,lx)])])],512),[[t.vShow,C.value.active]]),(0,t.withDirectives)((0,t.createElementVNode)(`section`,ux,[(0,t.createElementVNode)(`h2`,dx,[n[28]||=(0,t.createTextVNode)(`图层列表`,-1),E.value?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,fx,(0,t.toDisplayString)(D.value)+` 个图层 · `+(0,t.toDisplayString)(O.value)+` 个要素`,1))]),(0,t.withDirectives)((0,t.createElementVNode)(`p`,{class:`layer-list-hint`},(0,t.toDisplayString)(E.value),513),[[t.vShow,E.value]]),(0,t.createElementVNode)(`ul`,px,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(k.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[e.type===`layer`?((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:e.key,class:(0,t.normalizeClass)([`layer-item`,{"hidden-layer":!e.visible}])},[(0,t.createElementVNode)(`div`,mx,[(0,t.createElementVNode)(`span`,{class:`layer-name`,title:e.name},(0,t.toDisplayString)(e.name),9,hx),(0,t.createElementVNode)(`span`,gx,(0,t.toDisplayString)(e.meta),1)]),(0,t.createElementVNode)(`div`,_x,[(0,t.createElementVNode)(`button`,{class:`icon-btn layer-zoom`,type:`button`,title:`缩放到当前图层`,onClick:t=>kt(e)},`🔍`,8,vx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-delete`,type:`button`,title:`删除图层`,onClick:t=>Nt(e)},`🗑`,8,yx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-toggle`,type:`button`,title:e.visible?`隐藏图层`:`显示图层`,onClick:t=>wt(e)},(0,t.toDisplayString)(e.visible?`👁️`:`🚫`),9,bx)])],2)):((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:e.name,class:(0,t.normalizeClass)([`layer-item layer-group`,{"hidden-layer":!e.visible}])},[(0,t.createElementVNode)(`div`,xx,[(0,t.createElementVNode)(`span`,{class:`layer-name`,title:e.name},(0,t.toDisplayString)(e.name),9,Sx),(0,t.createElementVNode)(`span`,Cx,(0,t.toDisplayString)(e.meta),1)]),(0,t.createElementVNode)(`div`,wx,[(0,t.createElementVNode)(`button`,{class:`icon-btn layer-zoom`,type:`button`,title:`缩放到图层组`,onClick:t=>At(e)},`🔍`,8,Tx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-delete`,type:`button`,title:`删除图层组`,onClick:t=>Pt(e)},`🗑`,8,Ex),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-fold`,type:`button`,title:e.collapsed?`展开图层组`:`折叠图层组`,onClick:t=>Tt(e)},(0,t.toDisplayString)(e.collapsed?`▸`:`▾`),9,Dx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-toggle`,type:`button`,title:e.visible?`隐藏图层组`:`显示图层组`,onClick:t=>Et(e)},(0,t.toDisplayString)(e.visible?`👁️`:`🚫`),9,Ox)])],2)),e.type===`group`&&!e.collapsed?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:2},(0,t.renderList)(e.children,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:n.key,class:(0,t.normalizeClass)([`layer-item layer-child`,{"hidden-layer":!n.visible}])},[(0,t.createElementVNode)(`div`,kx,[(0,t.createElementVNode)(`span`,{class:`layer-name`,title:n.name},(0,t.toDisplayString)(n.name),9,Ax),(0,t.createElementVNode)(`span`,jx,(0,t.toDisplayString)(n.meta),1)]),(0,t.createElementVNode)(`div`,Mx,[(0,t.createElementVNode)(`button`,{class:`icon-btn layer-zoom`,type:`button`,title:`缩放到当前图层`,onClick:e=>kt(n)},`🔍`,8,Nx),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-delete`,type:`button`,title:`删除图层`,onClick:e=>Nt(n)},`🗑`,8,Px),(0,t.createElementVNode)(`button`,{class:`icon-btn layer-toggle`,type:`button`,title:n.visible?`隐藏图层`:`显示图层`,onClick:t=>Dt(e,n)},(0,t.toDisplayString)(n.visible?`👁️`:`🚫`),9,Fx)])],2))),128)):(0,t.createCommentVNode)(``,!0)],64))),256))])],512),[[t.vShow,T.value]])])]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:`sidebar-resizer`,title:`拖动调整侧栏宽度`,onMousedown:Je},null,544),[[t.vShow,!m.value]]),(0,t.createElementVNode)(`button`,{id:`sidebar-open`,title:`展开面板`,type:`button`,ref_key:`sidebarOpen`,ref:Fe,onClick:Xe},`›`,512),(0,t.createElementVNode)(`button`,{id:`panel-right-open`,title:`展开面板`,type:`button`,ref_key:`panelRightOpen`,ref:Ne,onClick:Qe},`‹`,512),n[56]||=(0,t.createElementVNode)(`main`,{id:`map`},null,-1),(0,t.withDirectives)((0,t.createElementVNode)(`div`,Ix,[...n[29]||=[(0,t.createElementVNode)(`span`,{class:`map-loading-spinner`},null,-1),(0,t.createElementVNode)(`span`,{class:`map-loading-text`},`地图加载中...`,-1)]],512),[[t.vShow,We.value]]),(0,t.createElementVNode)(`div`,{id:`load-dialog`,class:(0,t.normalizeClass)([`dialog-overlay`,{show:p.value}])},[(0,t.createElementVNode)(`div`,Lx,[(0,t.createElementVNode)(`header`,Rx,[n[30]||=(0,t.createElementVNode)(`div`,{class:`brand`},[(0,t.createElementVNode)(`span`,{class:`logo`},`📥`),(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`h1`,null,`加载地图`),(0,t.createElementVNode)(`p`,null,`选择数据源并加载`)])],-1),(0,t.createElementVNode)(`button`,{id:`btn-dialog-close`,title:`关闭`,type:`button`,ref_key:`btnDialogClose`,ref:xe,onClick:er},`✕`,512)]),(0,t.createElementVNode)(`div`,{ref_key:`dialogBody`,ref:Ee,class:`dialog-body`},[(0,t.createElementVNode)(`section`,zx,[n[51]||=(0,t.createElementVNode)(`h2`,null,`数据类型`,-1),(0,t.createElementVNode)(`div`,{class:`tabs source-type-tabs`,id:`source-type-tabs`,ref_key:`sourceTypeTabs`,ref:L},[(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`tab-btn source-type-btn`,{active:d.value===`raster`}]),type:`button`,onClick:n[1]||=e=>Zn(`raster`)},`栅格`,2),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`tab-btn source-type-btn`,{active:d.value===`vector`}]),type:`button`,onClick:n[2]||=e=>Zn(`vector`)},`矢量`,2)],512),n[52]||=(0,t.createElementVNode)(`h2`,null,`数据源`,-1),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`image`}]),id:`tab-image`},[(0,t.createElementVNode)(`label`,Bx,[n[31]||=(0,t.createTextVNode)(` 选择 PNG / JPG 图片 `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`img-file`,accept:`.png,.jpg,.jpeg,.webp,image/png,image/jpeg,image/webp`,hidden:``,ref_key:`imgFile`,ref:I},null,512)]),(0,t.createElementVNode)(`div`,Vx,(0,t.toDisplayString)(j.value.imgFileName),1),(0,t.createElementVNode)(`label`,Hx,[n[32]||=(0,t.createTextVNode)(` 坐标信息文件(可选 .pgw / .wld) `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`world-file`,accept:`.pgw,.pwg,.jgw,.gfw,.wld,.pngw,.jpgw,.txt`,hidden:``,ref_key:`worldFile`,ref:Ue},null,512)]),(0,t.createElementVNode)(`div`,Ux,(0,t.toDisplayString)(j.value.worldFileName),1),(0,t.createElementVNode)(`div`,Wx,[(0,t.createElementVNode)(`label`,null,[n[33]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-minx`,step:`any`,placeholder:`必填`,ref_key:`extMinx`,ref:ke},null,512)]),(0,t.createElementVNode)(`label`,null,[n[34]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-miny`,step:`any`,placeholder:`必填`,ref_key:`extMiny`,ref:Ae},null,512)]),(0,t.createElementVNode)(`label`,null,[n[35]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-maxx`,step:`any`,placeholder:`必填`,ref_key:`extMaxx`,ref:De},null,512)]),(0,t.createElementVNode)(`label`,null,[n[36]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`ext-maxy`,step:`any`,placeholder:`必填`,ref_key:`extMaxy`,ref:Oe},null,512)])]),(0,t.createElementVNode)(`div`,Gx,[j.value.zoneHint.message?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Kx,(0,t.toDisplayString)(j.value.zoneHint.message),1)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(j.value.zoneHint.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.code,class:`chip`,type:`button`,onClick:t=>j.value.dataCrs=e.code},(0,t.toDisplayString)(e.label),9,qx))),128))]),n[37]||=(0,t.createElementVNode)(`p`,{class:`tip`},`范围必填:四至范围需填写完整,选择坐标信息文件后可自动计算填充。`,-1)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`tiles`}]),id:`tab-tiles`},[(0,t.createElementVNode)(`label`,Jx,[n[38]||=(0,t.createTextVNode)(` 选择切片XYZ目录(z/x/y 结构) `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`tiles-dir`,webkitdirectory:``,directory:``,multiple:``,hidden:``,ref_key:`tilesDir`,ref:Re},null,512)]),(0,t.createElementVNode)(`div`,Yx,(0,t.toDisplayString)(j.value.tilesDirName),1),(0,t.createElementVNode)(`label`,Xx,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`checkbox`,id:`tiles-tms`,"onUpdate:modelValue":n[3]||=e=>j.value.tilesTms=e,onChange:n[4]||=e=>fn()},null,544),[[t.vModelCheckbox,j.value.tilesTms]]),n[39]||=(0,t.createTextVNode)(` TMS 顺序(Y 轴从下往上)`,-1)]),(0,t.createElementVNode)(`div`,Zx,(0,t.toDisplayString)(j.value.tilesInfo),1),n[40]||=(0,t.createElementVNode)(`p`,{class:`tip`},`大多数切片XYZ使用 EPSG:3857(网络墨卡托)网格。`,-1)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`geojson`}]),id:`tab-geojson`},[(0,t.createElementVNode)(`label`,Qx,[n[41]||=(0,t.createTextVNode)(` 选择 GeoJSON + SLD 目录(同名配对) `,-1),(0,t.createElementVNode)(`input`,{type:`file`,id:`geojson-dir`,webkitdirectory:``,directory:``,multiple:``,hidden:``,ref_key:`geojsonDir`,ref:je},null,512)]),(0,t.createElementVNode)(`div`,$x,(0,t.toDisplayString)(j.value.geojsonDirName),1),(0,t.createElementVNode)(`div`,eS,[j.value.geojsonCrsHint?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tS,(0,t.toDisplayString)(j.value.geojsonCrsHint),1)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(j.value.geojsonCrsOptions,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.code,class:`chip`,type:`button`,onClick:t=>j.value.dataCrs=e.code},(0,t.toDisplayString)(e.label),9,nS))),128))]),(0,t.createElementVNode)(`div`,rS,(0,t.toDisplayString)(j.value.geojsonInfo),1)],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tab-pane`,{active:f.value===`url`}]),id:`tab-url`},[(0,t.createElementVNode)(`label`,null,[n[42]||=(0,t.createTextVNode)(`在线切片XYZ URL 模板 `,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`text`,id:`url-template`,placeholder:`https://example.com/tiles/{z}/{x}/{y}.png`,spellcheck:`false`,"onUpdate:modelValue":n[5]||=e=>j.value.urlTemplate=e,onChange:mn},null,544),[[t.vModelText,j.value.urlTemplate]])]),(0,t.createElementVNode)(`div`,iS,[(0,t.createElementVNode)(`label`,null,[n[43]||=(0,t.createTextVNode)(`最小层级`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`number`,id:`url-minzoom`,min:`0`,max:`24`,placeholder:`必填`,"onUpdate:modelValue":n[6]||=e=>j.value.urlMinzoom=e},null,512),[[t.vModelText,j.value.urlMinzoom]])]),(0,t.createElementVNode)(`label`,null,[n[44]||=(0,t.createTextVNode)(`最大层级`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`number`,id:`url-maxzoom`,min:`0`,max:`24`,placeholder:`必填`,"onUpdate:modelValue":n[7]||=e=>j.value.urlMaxzoom=e},null,512),[[t.vModelText,j.value.urlMaxzoom]])])]),(0,t.createElementVNode)(`label`,null,[n[45]||=(0,t.createTextVNode)(`范围`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`select`,{id:`url-extent-crs`,"onUpdate:modelValue":n[8]||=e=>j.value.urlExtentCrs=e},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(A.value.urlExtentCrs,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,{key:e.label,label:e.label},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,oS))),128))],8,aS))),128)),ee.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,sS,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ee.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,cS))),128))])):(0,t.createCommentVNode)(``,!0)],512),[[t.vModelSelect,j.value.urlExtentCrs]])]),(0,t.createElementVNode)(`div`,lS,[(0,t.createElementVNode)(`label`,null,[n[46]||=(0,t.createTextVNode)(`X 最小(西)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-minx`,step:`any`,placeholder:`必填`,ref_key:`urlExtMinx`,ref:Ve},null,512)]),(0,t.createElementVNode)(`label`,null,[n[47]||=(0,t.createTextVNode)(`Y 最小(南)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-miny`,step:`any`,placeholder:`必填`,ref_key:`urlExtMiny`,ref:He},null,512)]),(0,t.createElementVNode)(`label`,null,[n[48]||=(0,t.createTextVNode)(`X 最大(东)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-maxx`,step:`any`,placeholder:`必填`,ref_key:`urlExtMaxx`,ref:ze},null,512)]),(0,t.createElementVNode)(`label`,null,[n[49]||=(0,t.createTextVNode)(`Y 最大(北)`,-1),(0,t.createElementVNode)(`input`,{type:`number`,id:`url-ext-maxy`,step:`any`,placeholder:`必填`,ref_key:`urlExtMaxy`,ref:Be},null,512)])]),(0,t.createElementVNode)(`div`,uS,(0,t.toDisplayString)(j.value.urlInfo),1),n[50]||=(0,t.createElementVNode)(`p`,{class:`tip`},`必须为完整 http(s) URL,模板变量 {z} {x} {y},TMS 用 {-y}。`,-1)],2)]),(0,t.createElementVNode)(`section`,dS,[n[54]||=(0,t.createElementVNode)(`h2`,null,`数据坐标系`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`select`,{id:`data-crs`,"onUpdate:modelValue":n[9]||=e=>j.value.dataCrs=e,onChange:n[10]||=e=>fn()},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(A.value.dataCrs,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,{key:e.label,label:e.label},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,pS))),128))],8,fS))),128)),ee.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,mS,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ee.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.code,value:e.code},(0,t.toDisplayString)(e.name),9,hS))),128))])):(0,t.createCommentVNode)(``,!0)],544),[[t.vModelSelect,j.value.dataCrs]]),(0,t.createElementVNode)(`div`,gS,[(0,t.createElementVNode)(`div`,_S,[(0,t.createElementVNode)(`input`,{type:`number`,id:`custom-epsg`,min:`1`,step:`1`,placeholder:`EPSG 代码,如 4525`,ref_key:`customEpsg`,ref:Te},null,512),(0,t.createElementVNode)(`button`,{id:`btn-fetch-epsg`,class:`mini-btn`,type:`button`,ref_key:`btnFetchEpsg`,ref:Se,onClick:Jn},`在线获取`,512)]),n[53]||=(0,t.createElementVNode)(`p`,{class:`tip`},`在线获取来自 epsg.io,需要联网。`,-1)])]),(0,t.createElementVNode)(`button`,{id:`btn-load`,class:`primary-btn`,type:`button`,ref_key:`btnLoad`,ref:Ce,onClick:et},`加载到地图`,512)],512)])],2),(0,t.createElementVNode)(`footer`,vS,[(0,t.createElementVNode)(`span`,{id:`status-coords`,class:`status-seg`,ref_key:`statusCoords`,ref:Ie},null,512),(0,t.createElementVNode)(`span`,{id:`status-scale`,class:`status-seg`,ref_key:`statusScale`,ref:Le},null,512),(0,t.createElementVNode)(`span`,yS,(0,t.toDisplayString)(y.value),1)]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,bS,[...n[55]||=[(0,t.createElementVNode)(`div`,null,`松开鼠标,加载地图文件`,-1)]],512),[[t.vShow,u.value]]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{id:`toast`,"data-type":x.value},(0,t.toDisplayString)(b.value),9,xS),[[t.vShow,S.value]])],6))}}),CS=[SS];e.MapViewVue3=SS,e.default={install:e=>{CS.forEach(t=>{e.component(t.name,t)})}}});
|
package/package.json
CHANGED
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "map_view_vue3",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "基于 Vue 3 + OpenLayers 的地图查看器组件",
|
|
5
5
|
"main": "map_view_vue3.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [
|
|
10
|
+
"keywords": [
|
|
11
|
+
"vue3",
|
|
12
|
+
"openlayers",
|
|
13
|
+
"map",
|
|
14
|
+
"viewer"
|
|
15
|
+
],
|
|
11
16
|
"author": "",
|
|
12
|
-
"license": "ISC"
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"module": "map_view_vue3.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./types/index.d.ts",
|
|
22
|
+
"import": "./map_view_vue3.js",
|
|
23
|
+
"require": "./map_view_vue3.umd.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./style.css": "./map_view_vue3.css",
|
|
26
|
+
"./dist/style.css": "./map_view_vue3.css",
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"map_view_vue3.js",
|
|
31
|
+
"map_view_vue3.umd.cjs",
|
|
32
|
+
"map_view_vue3.css",
|
|
33
|
+
"types",
|
|
34
|
+
"favicon.svg",
|
|
35
|
+
"icons.svg",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"vue": "^3.2.0"
|
|
40
|
+
},
|
|
41
|
+
"style": "./map_view_vue3.css"
|
|
13
42
|
}
|
package/types/index.d.ts
CHANGED