xm-netcdf-loader 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/composables/useLeafletMap.d.ts +10 -1
- package/dist/xm-netcdf-loader.cjs.js +1 -1
- package/dist/xm-netcdf-loader.cjs.js.map +1 -1
- package/dist/xm-netcdf-loader.es.js +527 -523
- package/dist/xm-netcdf-loader.es.js.map +1 -1
- package/dist/xm-netcdf-loader.umd.js +1 -1
- package/dist/xm-netcdf-loader.umd.js.map +1 -1
- package/package.json +3 -3
- package/dist/wasm/constants.d.ts +0 -158
- package/dist/wasm/constants.d.ts.map +0 -1
- package/dist/wasm/constants.js +0 -249
- package/dist/wasm/constants.js.map +0 -1
- package/dist/wasm/dimension.d.ts +0 -9
- package/dist/wasm/dimension.d.ts.map +0 -1
- package/dist/wasm/dimension.js +0 -19
- package/dist/wasm/dimension.js.map +0 -1
- package/dist/wasm/group.d.ts +0 -35
- package/dist/wasm/group.d.ts.map +0 -1
- package/dist/wasm/group.js +0 -189
- package/dist/wasm/group.js.map +0 -1
- package/dist/wasm/index.d.ts +0 -17
- package/dist/wasm/index.d.ts.map +0 -1
- package/dist/wasm/index.js +0 -49
- package/dist/wasm/index.js.map +0 -1
- package/dist/wasm/netcdf-getters.d.ts +0 -120
- package/dist/wasm/netcdf-getters.d.ts.map +0 -1
- package/dist/wasm/netcdf-getters.js +0 -816
- package/dist/wasm/netcdf-getters.js.map +0 -1
- package/dist/wasm/netcdf-worker.d.ts +0 -2
- package/dist/wasm/netcdf-worker.d.ts.map +0 -1
- package/dist/wasm/netcdf-worker.js +0 -154
- package/dist/wasm/netcdf-worker.js.map +0 -1
- package/dist/wasm/netcdf4-wasm.js +0 -2
- package/dist/wasm/netcdf4-wasm.wasm +0 -0
- package/dist/wasm/netcdf4.d.ts +0 -218
- package/dist/wasm/netcdf4.d.ts.map +0 -1
- package/dist/wasm/netcdf4.js +0 -1049
- package/dist/wasm/netcdf4.js.map +0 -1
- package/dist/wasm/slice.d.ts +0 -57
- package/dist/wasm/slice.d.ts.map +0 -1
- package/dist/wasm/slice.js +0 -60
- package/dist/wasm/slice.js.map +0 -1
- package/dist/wasm/test-setup.d.ts +0 -13
- package/dist/wasm/test-setup.d.ts.map +0 -1
- package/dist/wasm/test-setup.js +0 -78
- package/dist/wasm/test-setup.js.map +0 -1
- package/dist/wasm/types.d.ts +0 -444
- package/dist/wasm/types.d.ts.map +0 -1
- package/dist/wasm/types.js +0 -3
- package/dist/wasm/types.js.map +0 -1
- package/dist/wasm/variable.d.ts +0 -36
- package/dist/wasm/variable.d.ts.map +0 -1
- package/dist/wasm/variable.js +0 -152
- package/dist/wasm/variable.js.map +0 -1
- package/dist/wasm/wasm-module.d.ts +0 -6
- package/dist/wasm/wasm-module.d.ts.map +0 -1
- package/dist/wasm/wasm-module.js +0 -1502
- package/dist/wasm/wasm-module.js.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
var Ce = Object.defineProperty;
|
|
2
2
|
var Me = (t, l, n) => l in t ? Ce(t, l, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[l] = n;
|
|
3
3
|
var L = (t, l, n) => Me(t, typeof l != "symbol" ? l + "" : l, n);
|
|
4
|
-
import { reactive as al, computed as B, ref as
|
|
5
|
-
import * as Te from "@earthyscience/netcdf4-wasm";
|
|
4
|
+
import { reactive as al, computed as B, ref as w, watch as q, onUnmounted as Ae, toRef as tt } from "vue";
|
|
6
5
|
const Fl = [
|
|
7
6
|
[0.267004, 4874e-6, 0.329415],
|
|
8
7
|
[0.26851, 9605e-6, 0.335427],
|
|
@@ -270,38 +269,38 @@ function jt(t) {
|
|
|
270
269
|
255
|
|
271
270
|
];
|
|
272
271
|
}
|
|
273
|
-
function
|
|
272
|
+
function Te(t) {
|
|
274
273
|
const l = Math.round(255 * (0.0588 + t * 1)), n = Math.round(255 * (0.0196 + t * (0.0196 - 0.0196))), e = Math.round(255 * (0.8588 + t * (0.0196 - 0.8588)));
|
|
275
274
|
return [l, n, e, 255];
|
|
276
275
|
}
|
|
277
|
-
function
|
|
276
|
+
function we(t) {
|
|
278
277
|
const l = Math.round(255 * (0 + t * 1)), n = Math.round(255 * (0 + t * 1)), e = Math.round(255 * (0 + t * 1));
|
|
279
278
|
return [l, n, e, 255];
|
|
280
279
|
}
|
|
281
|
-
function
|
|
280
|
+
function Se(t) {
|
|
282
281
|
const l = Math.round(255 * (0 + t * 1)), n = Math.round(255 * (0 + t * 0)), e = Math.round(255 * (0 + t * 1));
|
|
283
282
|
return [l, n, e, 255];
|
|
284
283
|
}
|
|
285
|
-
function
|
|
284
|
+
function Ne(t) {
|
|
286
285
|
let l = 1, n = 1, e = 1;
|
|
287
286
|
return t < 0.125 ? (l = 0, n = 0, e = 0.5 + 4 * t) : t < 0.375 ? (l = 0, n = 4 * (t - 0.125), e = 1) : t < 0.625 ? (l = 4 * (t - 0.375), n = 1, e = 1 - 4 * (t - 0.375)) : t < 0.875 ? (l = 1, n = 1 - 4 * (t - 0.625), e = 0) : (l = 1 - 4 * (t - 0.875), n = 0, e = 0), [Math.round(l * 255), Math.round(n * 255), Math.round(e * 255), 255];
|
|
288
287
|
}
|
|
289
|
-
function
|
|
288
|
+
function Ve(t) {
|
|
290
289
|
let l = 1, n = 1, e = 1;
|
|
291
290
|
return t < 0.333 ? (l = 3 * t, n = 0, e = 0) : t < 0.667 ? (l = 1, n = 3 * (t - 0.333), e = 0) : (l = 1, n = 1, e = 3 * (t - 0.667)), [Math.round(l * 255), Math.round(n * 255), Math.round(e * 255), 255];
|
|
292
291
|
}
|
|
293
|
-
function
|
|
292
|
+
function Pe(t) {
|
|
294
293
|
return [Math.round(t * 255), Math.round((1 - t) * 255), 255, 255];
|
|
295
294
|
}
|
|
296
|
-
function
|
|
295
|
+
function De(t) {
|
|
297
296
|
const l = Math.round(t * 255);
|
|
298
297
|
return [l, l, l, 255];
|
|
299
298
|
}
|
|
300
|
-
function
|
|
301
|
-
return { viridis: jt, plasma:
|
|
299
|
+
function Oe() {
|
|
300
|
+
return { viridis: jt, plasma: Te, inferno: we, magma: Se, jet: Ne, hot: Ve, cool: Pe, grayscale: De };
|
|
302
301
|
}
|
|
303
302
|
function wn(t) {
|
|
304
|
-
return
|
|
303
|
+
return Oe()[t] ?? jt;
|
|
305
304
|
}
|
|
306
305
|
function Sn(t, l) {
|
|
307
306
|
const n = document.createElement("canvas");
|
|
@@ -311,7 +310,7 @@ function et(t, l, n, e) {
|
|
|
311
310
|
const o = t.getContext("2d"), i = new ImageData(new Uint8ClampedArray(l), n, e);
|
|
312
311
|
o.putImageData(i, 0, 0);
|
|
313
312
|
}
|
|
314
|
-
function
|
|
313
|
+
function Le(t, l, n, e = !0) {
|
|
315
314
|
const o = Sn(t, l), i = o.getContext("2d"), r = i.createImageData(t, l);
|
|
316
315
|
if (e)
|
|
317
316
|
for (let a = 0; a < l; a++) {
|
|
@@ -331,7 +330,7 @@ function Fe(t, l, n, e = !0) {
|
|
|
331
330
|
}
|
|
332
331
|
return i.putImageData(r, 0, 0), i.strokeStyle = "#333", i.lineWidth = 1, i.strokeRect(0, 0, t, l), o;
|
|
333
332
|
}
|
|
334
|
-
const
|
|
333
|
+
const Fe = {
|
|
335
334
|
id: "68541156820de978f2963673",
|
|
336
335
|
name: "气象专用色标",
|
|
337
336
|
version: "zefanc-20250619",
|
|
@@ -11126,11 +11125,11 @@ const ke = {
|
|
|
11126
11125
|
]
|
|
11127
11126
|
};
|
|
11128
11127
|
let pn = null;
|
|
11129
|
-
function
|
|
11130
|
-
return pn === null && (pn =
|
|
11128
|
+
function ke() {
|
|
11129
|
+
return pn === null && (pn = Fe), pn;
|
|
11131
11130
|
}
|
|
11132
11131
|
async function Gt(t) {
|
|
11133
|
-
const l = await
|
|
11132
|
+
const l = await ke();
|
|
11134
11133
|
if (!l) return null;
|
|
11135
11134
|
const n = t.toUpperCase();
|
|
11136
11135
|
return l.item.find((e) => e.name.toUpperCase() === n) ?? null;
|
|
@@ -11139,7 +11138,7 @@ function El(t) {
|
|
|
11139
11138
|
const l = t.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
|
|
11140
11139
|
return l ? [parseInt(l[1], 10), parseInt(l[2], 10), parseInt(l[3], 10)] : [128, 128, 128];
|
|
11141
11140
|
}
|
|
11142
|
-
function
|
|
11141
|
+
function je(t) {
|
|
11143
11142
|
const l = t.items;
|
|
11144
11143
|
return (n) => {
|
|
11145
11144
|
if (l.length === 0) return [128, 128, 128, 255];
|
|
@@ -11173,7 +11172,7 @@ function Ge(t) {
|
|
|
11173
11172
|
];
|
|
11174
11173
|
};
|
|
11175
11174
|
}
|
|
11176
|
-
const
|
|
11175
|
+
const Fr = (t, l) => {
|
|
11177
11176
|
const n = al({
|
|
11178
11177
|
colorbarCanvas: t.colorbarCanvas,
|
|
11179
11178
|
dataStats: null,
|
|
@@ -11181,9 +11180,9 @@ const kr = (t, l) => {
|
|
|
11181
11180
|
colormap: "",
|
|
11182
11181
|
colorsJsonItem: null
|
|
11183
11182
|
});
|
|
11184
|
-
return n.dataStats = t.dataStats || null, n.variableName = t.variableName || "", n.colormap = t.colormap || "", n.colorsJsonItem = t.ColorsJsonItem || null,
|
|
11185
|
-
},
|
|
11186
|
-
const n = B(() => !!t.colorsJsonItem), e = "viridis", o =
|
|
11183
|
+
return n.dataStats = t.dataStats || null, n.variableName = t.variableName || "", n.colormap = t.colormap || "", n.colorsJsonItem = t.ColorsJsonItem || null, Ge(n, l.colormapChange);
|
|
11184
|
+
}, Ge = (t, l) => {
|
|
11185
|
+
const n = B(() => !!t.colorsJsonItem), e = "viridis", o = w(t.colormap || e), i = t.colorbarCanvas, r = B(() => t.colorsJsonItem ? t.colorsJsonItem.minValue.toFixed(2) : t.dataStats && t.dataStats.min !== null && t.dataStats.min !== void 0 ? t.dataStats.min.toFixed(2) : "N/A"), a = B(() => t.colorsJsonItem ? t.colorsJsonItem.maxValue.toFixed(2) : t.dataStats && t.dataStats.max !== null && t.dataStats.max !== void 0 ? t.dataStats.max.toFixed(2) : "N/A"), u = B(() => t.colorsJsonItem ? ((t.colorsJsonItem.minValue + t.colorsJsonItem.maxValue) / 2).toFixed(2) : t.dataStats && t.dataStats.min !== null && t.dataStats.max !== null ? ((t.dataStats.min + t.dataStats.max) / 2).toFixed(2) : "N/A"), s = B(() => t.colorsJsonItem ? (t.colorsJsonItem.maxValue - t.colorsJsonItem.minValue).toFixed(2) : t.dataStats && t.dataStats.min !== null && t.dataStats.max !== null ? (t.dataStats.max - t.dataStats.min).toFixed(2) : "N/A"), c = B(() => {
|
|
11187
11186
|
const g = wn(o.value), h = [];
|
|
11188
11187
|
for (let d = 0; d <= 10; d++) {
|
|
11189
11188
|
const f = d / 10, [b, x, p] = g(f);
|
|
@@ -11207,12 +11206,12 @@ const kr = (t, l) => {
|
|
|
11207
11206
|
const h = t.colorsJsonItem, d = i.value.width, f = i.value.height;
|
|
11208
11207
|
g.clearRect(0, 0, d, f);
|
|
11209
11208
|
const b = h.minValue, x = h.maxValue, p = x - b || 1;
|
|
11210
|
-
for (let
|
|
11211
|
-
const
|
|
11212
|
-
g.fillStyle = `rgb(${
|
|
11209
|
+
for (let y = 0; y < h.items.length; y++) {
|
|
11210
|
+
const R = h.items[y], _ = h.items[y + 1], v = Math.max(R.min, b), C = R.max !== null ? Math.min(R.max, x) : _ ? _.min : x, I = Math.round((v - b) / p * d), E = Math.max(1, Math.round((C - v) / p * d)), [S, M, A] = El(R.color);
|
|
11211
|
+
g.fillStyle = `rgb(${S},${M},${A})`, g.fillRect(I, 0, E, f);
|
|
11213
11212
|
}
|
|
11214
11213
|
} else {
|
|
11215
|
-
const h =
|
|
11214
|
+
const h = Le(200, 20, wn(o.value), !1);
|
|
11216
11215
|
g.clearRect(0, 0, i.value.width, i.value.height), g.drawImage(h, 0, 0);
|
|
11217
11216
|
}
|
|
11218
11217
|
}
|
|
@@ -11271,7 +11270,7 @@ class ul extends Error {
|
|
|
11271
11270
|
return `[${this.severity.toUpperCase()}] ${this.type}: ${this.message}`;
|
|
11272
11271
|
}
|
|
11273
11272
|
}
|
|
11274
|
-
class
|
|
11273
|
+
class We {
|
|
11275
11274
|
constructor(l = {}) {
|
|
11276
11275
|
L(this, "options");
|
|
11277
11276
|
L(this, "errors", []);
|
|
@@ -11422,7 +11421,7 @@ class ot {
|
|
|
11422
11421
|
return typeof l != "number" || typeof n != "number" ? (e.push("Coordinates must be numbers"), e) : ((l < -90 || l > 90) && e.push(`Latitude out of range: ${l}. Must be between -90 and 90`), (n < -180 || n > 180) && e.push(`Longitude out of range: ${n}. Must be between -180 and 180`), e);
|
|
11423
11422
|
}
|
|
11424
11423
|
}
|
|
11425
|
-
async function
|
|
11424
|
+
async function ze(t, l = 3, n = 1e3) {
|
|
11426
11425
|
let e;
|
|
11427
11426
|
for (let o = 0; o <= l; o++)
|
|
11428
11427
|
try {
|
|
@@ -11436,7 +11435,7 @@ async function Xe(t, l = 3, n = 1e3) {
|
|
|
11436
11435
|
}
|
|
11437
11436
|
let xn = null;
|
|
11438
11437
|
function Wt() {
|
|
11439
|
-
return xn || (xn = new
|
|
11438
|
+
return xn || (xn = new We({ logToConsole: !0, showUserNotifications: !0, maxErrors: 100 })), xn;
|
|
11440
11439
|
}
|
|
11441
11440
|
function Yl(t) {
|
|
11442
11441
|
if (t == null) return null;
|
|
@@ -11448,7 +11447,7 @@ function Yl(t) {
|
|
|
11448
11447
|
}
|
|
11449
11448
|
return null;
|
|
11450
11449
|
}
|
|
11451
|
-
function
|
|
11450
|
+
function Xe(t, l) {
|
|
11452
11451
|
const n = Yl(l.scale_factor), e = Yl(l.add_offset), o = Yl(l._FillValue) ?? Yl(l.missing_value), i = l._Unsigned, r = typeof i == "string" && i === "true" || Array.isArray(i) && i[0] === "true", a = n !== null || e !== null, u = n ?? 1, s = e ?? 0, c = new Float32Array(t.length);
|
|
11453
11452
|
for (let m = 0; m < t.length; m++) {
|
|
11454
11453
|
let g = t[m];
|
|
@@ -11460,7 +11459,7 @@ function Ze(t, l) {
|
|
|
11460
11459
|
}
|
|
11461
11460
|
return c;
|
|
11462
11461
|
}
|
|
11463
|
-
function
|
|
11462
|
+
function Ze(t, l = null, n = null) {
|
|
11464
11463
|
if (!t || t.length === 0)
|
|
11465
11464
|
return new Float32Array(0);
|
|
11466
11465
|
let e = l, o = n;
|
|
@@ -11485,7 +11484,7 @@ function He(t, l = null, n = null) {
|
|
|
11485
11484
|
}
|
|
11486
11485
|
return i;
|
|
11487
11486
|
}
|
|
11488
|
-
function
|
|
11487
|
+
function He(t, l) {
|
|
11489
11488
|
const n = new Uint8ClampedArray(t.length * 4);
|
|
11490
11489
|
for (let e = 0; e < t.length; e++) {
|
|
11491
11490
|
const o = t[e], i = e * 4;
|
|
@@ -11498,7 +11497,7 @@ function Ue(t, l) {
|
|
|
11498
11497
|
}
|
|
11499
11498
|
return n;
|
|
11500
11499
|
}
|
|
11501
|
-
function
|
|
11500
|
+
function Ue(t, l) {
|
|
11502
11501
|
const n = new Uint8ClampedArray(t.length * 4);
|
|
11503
11502
|
for (let e = 0; e < t.length; e++) {
|
|
11504
11503
|
const o = t[e], i = e * 4;
|
|
@@ -11511,7 +11510,7 @@ function Be(t, l) {
|
|
|
11511
11510
|
}
|
|
11512
11511
|
return n;
|
|
11513
11512
|
}
|
|
11514
|
-
function
|
|
11513
|
+
function Be(t, l, n) {
|
|
11515
11514
|
const [e, o] = l, [i, r] = n;
|
|
11516
11515
|
if (t.length !== e * o)
|
|
11517
11516
|
throw new Error(`Data length (${t.length}) doesn't match original shape ${e}x${o}`);
|
|
@@ -11523,8 +11522,8 @@ function $e(t, l, n) {
|
|
|
11523
11522
|
}
|
|
11524
11523
|
return a;
|
|
11525
11524
|
}
|
|
11526
|
-
const
|
|
11527
|
-
function
|
|
11525
|
+
const zt = /* @__PURE__ */ new Set(["lon", "lat", "longitude", "latitude", "x", "y"]);
|
|
11526
|
+
function $e(t, l) {
|
|
11528
11527
|
return zt.has(t.toLowerCase()) ? !0 : (l.units ?? []).some((e) => e === "degrees_east" || e === "degrees_north");
|
|
11529
11528
|
}
|
|
11530
11529
|
function it(t, l) {
|
|
@@ -11538,8 +11537,11 @@ function it(t, l) {
|
|
|
11538
11537
|
function Xt(t) {
|
|
11539
11538
|
return Object.entries(t).filter(([l, n]) => (n.dimensions ?? []).length === 2 && !zt.has(l.toLowerCase())).map(([l]) => l);
|
|
11540
11539
|
}
|
|
11541
|
-
function
|
|
11542
|
-
|
|
11540
|
+
async function Ye() {
|
|
11541
|
+
return await import("/netcdf4-wasm/netcdf4.js");
|
|
11542
|
+
}
|
|
11543
|
+
function Ke() {
|
|
11544
|
+
const t = Wt(), l = w(!1), n = w(null), e = w(null), o = al({
|
|
11543
11545
|
dimensions: {},
|
|
11544
11546
|
variables: {},
|
|
11545
11547
|
attributes: {},
|
|
@@ -11548,34 +11550,36 @@ function qe() {
|
|
|
11548
11550
|
async function a(b) {
|
|
11549
11551
|
l.value = !0, n.value = null;
|
|
11550
11552
|
try {
|
|
11551
|
-
console.log("Loading netCDF file:", b.name, b.size)
|
|
11552
|
-
|
|
11553
|
-
|
|
11553
|
+
console.log("Loading netCDF file:", b.name, b.size);
|
|
11554
|
+
const { NetCDF4: x } = await Ye();
|
|
11555
|
+
e.value = await ze(
|
|
11556
|
+
() => x.fromBlobLazy(b, {
|
|
11557
|
+
locateFile: (C) => C.endsWith(".wasm") ? "/netcdf4-wasm/netcdf4.wasm" : C
|
|
11554
11558
|
}),
|
|
11555
11559
|
2,
|
|
11556
11560
|
1e3
|
|
11557
11561
|
), console.log("Dataset loaded:", e.value);
|
|
11558
|
-
const
|
|
11559
|
-
console.log("Dataset hierarchy:",
|
|
11560
|
-
const
|
|
11561
|
-
for (const [
|
|
11562
|
-
R[
|
|
11562
|
+
const p = await e.value.getCompleteHierarchy();
|
|
11563
|
+
console.log("Dataset hierarchy:", p), await e.value.load();
|
|
11564
|
+
const y = e.value.dimensions, R = {};
|
|
11565
|
+
for (const [C, I] of Object.entries(y))
|
|
11566
|
+
R[C] = { name: C, size: I.size };
|
|
11563
11567
|
o.dimensions = R;
|
|
11564
|
-
const
|
|
11565
|
-
for (const [
|
|
11566
|
-
const
|
|
11567
|
-
var
|
|
11568
|
-
return ((
|
|
11568
|
+
const _ = e.value.variables, v = {};
|
|
11569
|
+
for (const [C, I] of Object.entries(_)) {
|
|
11570
|
+
const E = I.dimensions ?? [], S = E.map((M) => {
|
|
11571
|
+
var A;
|
|
11572
|
+
return ((A = R[M]) == null ? void 0 : A.size) ?? 0;
|
|
11569
11573
|
});
|
|
11570
|
-
|
|
11574
|
+
v[C] = { name: C, dimensions: E, shape: S, dtype: I.datatype, type: I.datatype };
|
|
11571
11575
|
}
|
|
11572
|
-
return o.variables =
|
|
11576
|
+
return o.variables = v, o.attributes = p.attributes ?? {}, o.fileInfo = {
|
|
11573
11577
|
filename: b.name,
|
|
11574
11578
|
size: b.size,
|
|
11575
11579
|
format: e.value.file_format,
|
|
11576
11580
|
dimensionsCount: Object.keys(o.dimensions).length,
|
|
11577
11581
|
variablesCount: Object.keys(o.variables).length
|
|
11578
|
-
}, o.dimensions.lon && console.log("Lon dimension:", o.dimensions.lon), o.dimensions.lat && console.log("Lat dimension:", o.dimensions.lat), await u(), s(), await c(
|
|
11582
|
+
}, o.dimensions.lon && console.log("Lon dimension:", o.dimensions.lon), o.dimensions.lat && console.log("Lat dimension:", o.dimensions.lat), await u(), s(), await c(p), { dataset: e.value, metadata: o, variableData: i, dataStats: r, success: !0 };
|
|
11579
11583
|
} catch (x) {
|
|
11580
11584
|
const p = x instanceof Error ? x.message : String(x);
|
|
11581
11585
|
return console.error("Error loading netCDF file:", x), n.value = p, t.handle(
|
|
@@ -11593,7 +11597,7 @@ function qe() {
|
|
|
11593
11597
|
for (const x of Object.keys(i)) delete i[x];
|
|
11594
11598
|
for (const [x, p] of Object.entries(o.variables))
|
|
11595
11599
|
try {
|
|
11596
|
-
const
|
|
11600
|
+
const y = await e.value.getVariableArray(x), R = ((b = e.value.variables[x]) == null ? void 0 : b._attributes) ?? {}, _ = Xe(y, R);
|
|
11597
11601
|
i[x] = {
|
|
11598
11602
|
data: _,
|
|
11599
11603
|
shape: p.shape,
|
|
@@ -11604,10 +11608,10 @@ function qe() {
|
|
|
11604
11608
|
shape: p.shape,
|
|
11605
11609
|
sample: Array.from(_.slice(0, 5))
|
|
11606
11610
|
});
|
|
11607
|
-
} catch (
|
|
11608
|
-
const
|
|
11609
|
-
console.warn(`Could not extract data for variable ${x}:`,
|
|
11610
|
-
error:
|
|
11611
|
+
} catch (y) {
|
|
11612
|
+
const R = y instanceof Error ? y.message : String(y);
|
|
11613
|
+
console.warn(`Could not extract data for variable ${x}:`, y), i[x] = {
|
|
11614
|
+
error: R,
|
|
11611
11615
|
shape: p.shape,
|
|
11612
11616
|
dimensions: p.dimensions
|
|
11613
11617
|
};
|
|
@@ -11632,37 +11636,37 @@ function qe() {
|
|
|
11632
11636
|
continue;
|
|
11633
11637
|
}
|
|
11634
11638
|
const p = x.data;
|
|
11635
|
-
let
|
|
11636
|
-
for (let
|
|
11637
|
-
const E = p[
|
|
11638
|
-
E != null && !isNaN(E) && (
|
|
11639
|
+
let y = 1 / 0, R = -1 / 0, _ = 0, v = 0;
|
|
11640
|
+
for (let I = 0; I < p.length; I++) {
|
|
11641
|
+
const E = p[I];
|
|
11642
|
+
E != null && !isNaN(E) && (y = Math.min(y, E), R = Math.max(R, E), _ += E, v++);
|
|
11639
11643
|
}
|
|
11640
|
-
const C =
|
|
11644
|
+
const C = v > 0 ? _ / v : null;
|
|
11641
11645
|
r[b] = {
|
|
11642
|
-
min: isFinite(
|
|
11643
|
-
max: isFinite(
|
|
11646
|
+
min: isFinite(y) ? y : null,
|
|
11647
|
+
max: isFinite(R) ? R : null,
|
|
11644
11648
|
mean: C,
|
|
11645
11649
|
std: null,
|
|
11646
11650
|
count: p.length,
|
|
11647
|
-
validCount:
|
|
11648
|
-
missingCount: p.length -
|
|
11651
|
+
validCount: v,
|
|
11652
|
+
missingCount: p.length - v
|
|
11649
11653
|
}, console.log(`Stats for ${b}:`, r[b]);
|
|
11650
11654
|
}
|
|
11651
11655
|
}
|
|
11652
11656
|
async function c(b) {
|
|
11653
|
-
var p,
|
|
11657
|
+
var p, y, R;
|
|
11654
11658
|
if (!e.value) return;
|
|
11655
11659
|
const x = b.dimensions ?? {};
|
|
11656
|
-
for (const [_,
|
|
11657
|
-
if (
|
|
11660
|
+
for (const [_, v] of Object.entries(x))
|
|
11661
|
+
if ($e(_, v) && !((p = i[_]) != null && p.data))
|
|
11658
11662
|
try {
|
|
11659
|
-
const C = await e.value.getVariableArray(_),
|
|
11663
|
+
const C = await e.value.getVariableArray(_), I = C.length;
|
|
11660
11664
|
i[_] = {
|
|
11661
11665
|
data: C,
|
|
11662
|
-
shape: [
|
|
11666
|
+
shape: [I],
|
|
11663
11667
|
dimensions: [_],
|
|
11664
11668
|
type: "f4"
|
|
11665
|
-
}, console.log(`Loaded coordinate array '${_}': n=${
|
|
11669
|
+
}, console.log(`Loaded coordinate array '${_}': n=${I}, first=${(y = C[0]) == null ? void 0 : y.toFixed(4)}, last=${(R = C[I - 1]) == null ? void 0 : R.toFixed(4)}`);
|
|
11666
11670
|
} catch (C) {
|
|
11667
11671
|
console.warn(`Could not load coordinate array for dimension '${_}':`, String(C));
|
|
11668
11672
|
}
|
|
@@ -11675,35 +11679,35 @@ function qe() {
|
|
|
11675
11679
|
throw console.error(`Error getting variable ${b}:`, p), p;
|
|
11676
11680
|
}
|
|
11677
11681
|
}
|
|
11678
|
-
async function g(b, x, p,
|
|
11682
|
+
async function g(b, x, p, y = "/") {
|
|
11679
11683
|
if (!e.value) throw new Error("No dataset loaded");
|
|
11680
11684
|
try {
|
|
11681
|
-
return await e.value.getSlicedVariableArray(b, x, p,
|
|
11682
|
-
} catch (
|
|
11683
|
-
throw console.error(`Error getting sliced variable ${b}:`,
|
|
11685
|
+
return await e.value.getSlicedVariableArray(b, x, p, y);
|
|
11686
|
+
} catch (R) {
|
|
11687
|
+
throw console.error(`Error getting sliced variable ${b}:`, R), R;
|
|
11684
11688
|
}
|
|
11685
11689
|
}
|
|
11686
11690
|
async function h(b, x, p) {
|
|
11687
11691
|
var k, O, G, X;
|
|
11688
11692
|
if (!e.value) throw new Error("No dataset loaded");
|
|
11689
|
-
const
|
|
11690
|
-
if (!
|
|
11691
|
-
const
|
|
11692
|
-
if (_ === -1 ||
|
|
11693
|
+
const y = o.variables[b];
|
|
11694
|
+
if (!y) throw new Error(`Variable ${b} not found`);
|
|
11695
|
+
const R = y.dimensions, _ = R.indexOf("lon"), v = R.indexOf("lat");
|
|
11696
|
+
if (_ === -1 || v === -1)
|
|
11693
11697
|
throw new Error(`Variable ${b} does not have lon/lat dimensions`);
|
|
11694
|
-
let C,
|
|
11695
|
-
const E = (k = i.lon) == null ? void 0 : k.data,
|
|
11696
|
-
if (E &&
|
|
11697
|
-
C = it(E, x),
|
|
11698
|
+
let C, I;
|
|
11699
|
+
const E = (k = i.lon) == null ? void 0 : k.data, S = (O = i.lat) == null ? void 0 : O.data;
|
|
11700
|
+
if (E && S)
|
|
11701
|
+
C = it(E, x), I = it(S, p);
|
|
11698
11702
|
else {
|
|
11699
|
-
const P = ((G = o.dimensions.lon) == null ? void 0 : G.size) ??
|
|
11700
|
-
C = Math.max(0, Math.min(P - 1, Math.round((x + 180) / 360 * (P - 1)))),
|
|
11703
|
+
const P = ((G = o.dimensions.lon) == null ? void 0 : G.size) ?? y.shape[_] ?? 1, Q = ((X = o.dimensions.lat) == null ? void 0 : X.size) ?? y.shape[v] ?? 1;
|
|
11704
|
+
C = Math.max(0, Math.min(P - 1, Math.round((x + 180) / 360 * (P - 1)))), I = Math.max(0, Math.min(Q - 1, Math.round((90 - p) / 180 * (Q - 1))));
|
|
11701
11705
|
}
|
|
11702
|
-
const M = [],
|
|
11703
|
-
for (let P = 0; P <
|
|
11704
|
-
P === _ ? (M.push(C),
|
|
11706
|
+
const M = [], A = [];
|
|
11707
|
+
for (let P = 0; P < R.length; P++)
|
|
11708
|
+
P === _ ? (M.push(C), A.push(1)) : P === v ? (M.push(I), A.push(1)) : (M.push(0), A.push(1));
|
|
11705
11709
|
try {
|
|
11706
|
-
const P = await g(b, M,
|
|
11710
|
+
const P = await g(b, M, A);
|
|
11707
11711
|
return P.length > 0 ? P[0] : null;
|
|
11708
11712
|
} catch (P) {
|
|
11709
11713
|
throw console.error(`Error getting data at coordinate (lon=${x}, lat=${p}):`, P), P;
|
|
@@ -11741,15 +11745,15 @@ function qe() {
|
|
|
11741
11745
|
detect2dVariables: () => Xt(o.variables)
|
|
11742
11746
|
};
|
|
11743
11747
|
}
|
|
11744
|
-
const
|
|
11745
|
-
const l =
|
|
11748
|
+
const kr = (t) => {
|
|
11749
|
+
const l = w(null), n = Wt(), e = w([]), o = w(!1), i = w(null), {
|
|
11746
11750
|
isLoading: r,
|
|
11747
11751
|
error: a,
|
|
11748
11752
|
metadata: u,
|
|
11749
11753
|
variableData: s,
|
|
11750
11754
|
dataStats: c,
|
|
11751
11755
|
loadNetCdfFile: m
|
|
11752
|
-
} =
|
|
11756
|
+
} = Ke(), g = a, h = B(() => Xt(u.variables || {}));
|
|
11753
11757
|
async function d(b) {
|
|
11754
11758
|
if (console.log(b, "handleFileSelect进入了"), !b) return;
|
|
11755
11759
|
e.value = [], i.value = null;
|
|
@@ -11768,10 +11772,10 @@ const jr = (t) => {
|
|
|
11768
11772
|
const p = await m(b);
|
|
11769
11773
|
if (p.success) {
|
|
11770
11774
|
console.log("File loaded successfully:", b.name), console.log("Metadata:", u);
|
|
11771
|
-
const
|
|
11772
|
-
return
|
|
11775
|
+
const y = ot.validateNetCDFMetadata(u);
|
|
11776
|
+
return y.length > 0 && (e.value = y, y.forEach((R) => {
|
|
11773
11777
|
n.handle(
|
|
11774
|
-
new ul(nl.NETCDF_PARSE,
|
|
11778
|
+
new ul(nl.NETCDF_PARSE, R, Z.WARNING),
|
|
11775
11779
|
{ fileName: b.name }
|
|
11776
11780
|
);
|
|
11777
11781
|
})), console.log(t, "回调函数"), t && t.dataLoaded && t.dataLoaded({
|
|
@@ -11787,9 +11791,9 @@ const jr = (t) => {
|
|
|
11787
11791
|
} else
|
|
11788
11792
|
throw new Error(p.error || "Failed to load netCDF file");
|
|
11789
11793
|
} catch (p) {
|
|
11790
|
-
const
|
|
11791
|
-
i.value =
|
|
11792
|
-
new ul(nl.NETCDF_LOAD,
|
|
11794
|
+
const y = p instanceof Error ? p.message : String(p);
|
|
11795
|
+
i.value = y, n.handle(
|
|
11796
|
+
new ul(nl.NETCDF_LOAD, y, Z.ERROR, p instanceof Error ? p : null),
|
|
11793
11797
|
{ fileName: b.name }
|
|
11794
11798
|
);
|
|
11795
11799
|
} finally {
|
|
@@ -11799,8 +11803,8 @@ const jr = (t) => {
|
|
|
11799
11803
|
function f(b) {
|
|
11800
11804
|
var _;
|
|
11801
11805
|
if (b === 0) return "0 Bytes";
|
|
11802
|
-
const x = b ?? ((_ = l.value) == null ? void 0 : _.size) ?? 0, p = 1024,
|
|
11803
|
-
return parseFloat((x / Math.pow(p,
|
|
11806
|
+
const x = b ?? ((_ = l.value) == null ? void 0 : _.size) ?? 0, p = 1024, y = ["Bytes", "KB", "MB", "GB"], R = Math.floor(Math.log(b) / Math.log(p));
|
|
11807
|
+
return parseFloat((x / Math.pow(p, R)).toFixed(2)) + " " + y[R];
|
|
11804
11808
|
}
|
|
11805
11809
|
return {
|
|
11806
11810
|
isLoading: o,
|
|
@@ -11814,7 +11818,7 @@ const jr = (t) => {
|
|
|
11814
11818
|
validationErrors: e
|
|
11815
11819
|
};
|
|
11816
11820
|
};
|
|
11817
|
-
function
|
|
11821
|
+
function qe(...t) {
|
|
11818
11822
|
console.warn(...t);
|
|
11819
11823
|
}
|
|
11820
11824
|
const j = {
|
|
@@ -11858,18 +11862,18 @@ function kn(t, l, n, e, o) {
|
|
|
11858
11862
|
function jn(t) {
|
|
11859
11863
|
return kn(1 / 0, 1 / 0, -1 / 0, -1 / 0, t);
|
|
11860
11864
|
}
|
|
11861
|
-
function
|
|
11865
|
+
function Je(t, l) {
|
|
11862
11866
|
const n = t[0], e = t[1];
|
|
11863
11867
|
return kn(n, e, n, e, l);
|
|
11864
11868
|
}
|
|
11865
|
-
function
|
|
11869
|
+
function Qe(t, l, n, e, o) {
|
|
11866
11870
|
const i = jn(o);
|
|
11867
11871
|
return Bt(i, t, l, n, e);
|
|
11868
11872
|
}
|
|
11869
|
-
function
|
|
11873
|
+
function lo(t, l) {
|
|
11870
11874
|
return t[0] == l[0] && t[2] == l[2] && t[1] == l[1] && t[3] == l[3];
|
|
11871
11875
|
}
|
|
11872
|
-
function
|
|
11876
|
+
function no(t, l) {
|
|
11873
11877
|
return l[0] < t[0] && (t[0] = l[0]), l[2] > t[2] && (t[2] = l[2]), l[1] < t[1] && (t[1] = l[1]), l[3] > t[3] && (t[3] = l[3]), t;
|
|
11874
11878
|
}
|
|
11875
11879
|
function nn(t, l) {
|
|
@@ -11877,17 +11881,17 @@ function nn(t, l) {
|
|
|
11877
11881
|
}
|
|
11878
11882
|
function Bt(t, l, n, e, o) {
|
|
11879
11883
|
for (; n < e; n += o)
|
|
11880
|
-
|
|
11884
|
+
to(t, l[n], l[n + 1]);
|
|
11881
11885
|
return t;
|
|
11882
11886
|
}
|
|
11883
|
-
function
|
|
11887
|
+
function to(t, l, n) {
|
|
11884
11888
|
t[0] = Math.min(t[0], l), t[1] = Math.min(t[1], n), t[2] = Math.max(t[2], l), t[3] = Math.max(t[3], n);
|
|
11885
11889
|
}
|
|
11886
|
-
function
|
|
11890
|
+
function eo(t, l) {
|
|
11887
11891
|
let n;
|
|
11888
11892
|
return n = l(Gn(t)), n || (n = l(Wn(t)), n) || (n = l(zn(t)), n) || (n = l(cn(t)), n) ? n : !1;
|
|
11889
11893
|
}
|
|
11890
|
-
function
|
|
11894
|
+
function oo(t) {
|
|
11891
11895
|
let l = 0;
|
|
11892
11896
|
return Hl(t) || (l = D(t) * H(t)), l;
|
|
11893
11897
|
}
|
|
@@ -11901,7 +11905,7 @@ function Vl(t) {
|
|
|
11901
11905
|
return [(t[0] + t[2]) / 2, (t[1] + t[3]) / 2];
|
|
11902
11906
|
}
|
|
11903
11907
|
function $t(t, l, n, e, o) {
|
|
11904
|
-
const [i, r, a, u, s, c, m, g] =
|
|
11908
|
+
const [i, r, a, u, s, c, m, g] = io(
|
|
11905
11909
|
t,
|
|
11906
11910
|
l,
|
|
11907
11911
|
n,
|
|
@@ -11915,7 +11919,7 @@ function $t(t, l, n, e, o) {
|
|
|
11915
11919
|
o
|
|
11916
11920
|
);
|
|
11917
11921
|
}
|
|
11918
|
-
function
|
|
11922
|
+
function io(t, l, n, e) {
|
|
11919
11923
|
const o = l * e[0] / 2, i = l * e[1] / 2, r = Math.cos(n), a = Math.sin(n), u = o * r, s = o * a, c = i * r, m = i * a, g = t[0], h = t[1];
|
|
11920
11924
|
return [
|
|
11921
11925
|
g - u + m,
|
|
@@ -11952,10 +11956,10 @@ function Ol(t, l) {
|
|
|
11952
11956
|
function Hl(t) {
|
|
11953
11957
|
return t[2] < t[0] || t[3] < t[1];
|
|
11954
11958
|
}
|
|
11955
|
-
function
|
|
11959
|
+
function ro(t, l) {
|
|
11956
11960
|
return l ? (l[0] = t[0], l[1] = t[1], l[2] = t[2], l[3] = t[3], l) : t;
|
|
11957
11961
|
}
|
|
11958
|
-
function
|
|
11962
|
+
function ao(t, l, n) {
|
|
11959
11963
|
let e = !1;
|
|
11960
11964
|
const o = at(t, l), i = at(t, n);
|
|
11961
11965
|
if (o === j.INTERSECTING || i === j.INTERSECTING)
|
|
@@ -11970,7 +11974,7 @@ function uo(t, l, n) {
|
|
|
11970
11974
|
function $(t, l, n) {
|
|
11971
11975
|
return Math.min(Math.max(t, l), n);
|
|
11972
11976
|
}
|
|
11973
|
-
function
|
|
11977
|
+
function uo(t, l, n, e, o, i) {
|
|
11974
11978
|
const r = o - n, a = i - e;
|
|
11975
11979
|
if (r !== 0 || a !== 0) {
|
|
11976
11980
|
const u = ((t - n) * r + (l - e) * a) / (r * r + a * a);
|
|
@@ -11982,7 +11986,7 @@ function Tl(t, l, n, e) {
|
|
|
11982
11986
|
const o = n - t, i = e - l;
|
|
11983
11987
|
return o * o + i * i;
|
|
11984
11988
|
}
|
|
11985
|
-
function
|
|
11989
|
+
function so(t) {
|
|
11986
11990
|
const l = t.length;
|
|
11987
11991
|
for (let e = 0; e < l; e++) {
|
|
11988
11992
|
let o = e, i = Math.abs(t[e][e]);
|
|
@@ -12018,7 +12022,7 @@ function wl(t, l) {
|
|
|
12018
12022
|
const n = t % l;
|
|
12019
12023
|
return n * l < 0 ? n + l : n;
|
|
12020
12024
|
}
|
|
12021
|
-
function
|
|
12025
|
+
function co(t, l, n) {
|
|
12022
12026
|
return t + n * (l - t);
|
|
12023
12027
|
}
|
|
12024
12028
|
function Kt(t, l) {
|
|
@@ -12034,7 +12038,7 @@ function Vn(t, l, n) {
|
|
|
12034
12038
|
const e = n - l;
|
|
12035
12039
|
return ((t - l) % e + e) % e + l;
|
|
12036
12040
|
}
|
|
12037
|
-
function
|
|
12041
|
+
function mo(t, l) {
|
|
12038
12042
|
return t[0] += +l[0], t[1] += +l[1], t;
|
|
12039
12043
|
}
|
|
12040
12044
|
function en(t, l) {
|
|
@@ -12046,7 +12050,7 @@ function en(t, l) {
|
|
|
12046
12050
|
}
|
|
12047
12051
|
return n;
|
|
12048
12052
|
}
|
|
12049
|
-
function
|
|
12053
|
+
function bo(t, l) {
|
|
12050
12054
|
const n = Math.cos(l), e = Math.sin(l), o = t[0] * n - t[1] * e, i = t[1] * n + t[0] * e;
|
|
12051
12055
|
return t[0] = o, t[1] = i, t;
|
|
12052
12056
|
}
|
|
@@ -12191,7 +12195,7 @@ class Xn {
|
|
|
12191
12195
|
return this.getPointResolutionFunc_;
|
|
12192
12196
|
}
|
|
12193
12197
|
}
|
|
12194
|
-
const Ul = 6378137, Ml = Math.PI * Ul,
|
|
12198
|
+
const Ul = 6378137, Ml = Math.PI * Ul, go = [-Ml, -Ml, Ml, Ml], ho = [-180, -85, 180, 85], ql = Ul * Math.log(Math.tan(Math.PI / 2));
|
|
12195
12199
|
class Il extends Xn {
|
|
12196
12200
|
/**
|
|
12197
12201
|
* @param {string} code Code.
|
|
@@ -12200,9 +12204,9 @@ class Il extends Xn {
|
|
|
12200
12204
|
super({
|
|
12201
12205
|
code: l,
|
|
12202
12206
|
units: "m",
|
|
12203
|
-
extent:
|
|
12207
|
+
extent: go,
|
|
12204
12208
|
global: !0,
|
|
12205
|
-
worldExtent:
|
|
12209
|
+
worldExtent: ho,
|
|
12206
12210
|
getPointResolution: function(n, e) {
|
|
12207
12211
|
return n / Math.cosh(e[1] / Ul);
|
|
12208
12212
|
}
|
|
@@ -12217,7 +12221,7 @@ const st = [
|
|
|
12217
12221
|
new Il("http://www.opengis.net/def/crs/EPSG/0/3857"),
|
|
12218
12222
|
new Il("http://www.opengis.net/gml/srs/epsg.xml#3857")
|
|
12219
12223
|
];
|
|
12220
|
-
function
|
|
12224
|
+
function po(t, l, n, e) {
|
|
12221
12225
|
const o = t.length;
|
|
12222
12226
|
n = n > 1 ? n : 2, e = e ?? n, l === void 0 && (n > 2 ? l = t.slice() : l = new Array(o));
|
|
12223
12227
|
for (let i = 0; i < o; i += e) {
|
|
@@ -12227,14 +12231,14 @@ function xo(t, l, n, e) {
|
|
|
12227
12231
|
}
|
|
12228
12232
|
return l;
|
|
12229
12233
|
}
|
|
12230
|
-
function
|
|
12234
|
+
function xo(t, l, n, e) {
|
|
12231
12235
|
const o = t.length;
|
|
12232
12236
|
n = n > 1 ? n : 2, e = e ?? n, l === void 0 && (n > 2 ? l = t.slice() : l = new Array(o));
|
|
12233
12237
|
for (let i = 0; i < o; i += e)
|
|
12234
12238
|
l[i] = 180 * t[i] / Ml, l[i + 1] = 360 * Math.atan(Math.exp(t[i + 1] / Ul)) / Math.PI - 90;
|
|
12235
12239
|
return l;
|
|
12236
12240
|
}
|
|
12237
|
-
const
|
|
12241
|
+
const fo = 6378137, ct = [-180, -90, 180, 90], Ro = Math.PI * fo / 180;
|
|
12238
12242
|
class hl extends Xn {
|
|
12239
12243
|
/**
|
|
12240
12244
|
* @param {string} code Code.
|
|
@@ -12247,7 +12251,7 @@ class hl extends Xn {
|
|
|
12247
12251
|
extent: ct,
|
|
12248
12252
|
axisOrientation: n,
|
|
12249
12253
|
global: !0,
|
|
12250
|
-
metersPerUnit:
|
|
12254
|
+
metersPerUnit: Ro,
|
|
12251
12255
|
worldExtent: ct
|
|
12252
12256
|
});
|
|
12253
12257
|
}
|
|
@@ -12262,17 +12266,17 @@ const mt = [
|
|
|
12262
12266
|
new hl("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
|
|
12263
12267
|
];
|
|
12264
12268
|
let Pn = {};
|
|
12265
|
-
function
|
|
12269
|
+
function yo(t) {
|
|
12266
12270
|
return Pn[t] || Pn[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
|
|
12267
12271
|
}
|
|
12268
|
-
function
|
|
12272
|
+
function _o(t, l) {
|
|
12269
12273
|
Pn[t] = l;
|
|
12270
12274
|
}
|
|
12271
12275
|
function Jt(t) {
|
|
12272
12276
|
for (const l in t)
|
|
12273
12277
|
delete t[l];
|
|
12274
12278
|
}
|
|
12275
|
-
function
|
|
12279
|
+
function Io(t) {
|
|
12276
12280
|
let l;
|
|
12277
12281
|
for (l in t)
|
|
12278
12282
|
return !1;
|
|
@@ -12286,34 +12290,34 @@ function Xl(t, l, n) {
|
|
|
12286
12290
|
function fn(t, l) {
|
|
12287
12291
|
return t in Sl && l in Sl[t] ? Sl[t][l] : null;
|
|
12288
12292
|
}
|
|
12289
|
-
const on = 0.9996, J = 669438e-8, mn = J * J, bn = mn * J, pl = J / (1 - J), bt = Math.sqrt(1 - J), Pl = (1 - bt) / (1 + bt), Qt = Pl * Pl, Zn = Qt * Pl, Hn = Zn * Pl, le = Hn * Pl, ne = 1 - J / 4 - 3 * mn / 64 - 5 * bn / 256,
|
|
12290
|
-
function
|
|
12291
|
-
const e = t - 5e5, r = (n.north ? l : l - 1e7) / on / (rn * ne), a = r +
|
|
12292
|
-
let M = (
|
|
12293
|
+
const on = 0.9996, J = 669438e-8, mn = J * J, bn = mn * J, pl = J / (1 - J), bt = Math.sqrt(1 - J), Pl = (1 - bt) / (1 + bt), Qt = Pl * Pl, Zn = Qt * Pl, Hn = Zn * Pl, le = Hn * Pl, ne = 1 - J / 4 - 3 * mn / 64 - 5 * bn / 256, vo = 3 * J / 8 + 3 * mn / 32 + 45 * bn / 1024, Eo = 15 * mn / 256 + 45 * bn / 1024, Co = 35 * bn / 3072, Mo = 3 / 2 * Pl - 27 / 32 * Zn + 269 / 512 * le, Ao = 21 / 16 * Qt - 55 / 32 * Hn, To = 151 / 96 * Zn - 417 / 128 * le, wo = 1097 / 512 * Hn, rn = 6378137;
|
|
12294
|
+
function So(t, l, n) {
|
|
12295
|
+
const e = t - 5e5, r = (n.north ? l : l - 1e7) / on / (rn * ne), a = r + Mo * Math.sin(2 * r) + Ao * Math.sin(4 * r) + To * Math.sin(6 * r) + wo * Math.sin(8 * r), u = Math.sin(a), s = u * u, c = Math.cos(a), m = u / c, g = m * m, h = g * g, d = 1 - J * s, f = Math.sqrt(1 - J * s), b = rn / f, x = (1 - J) / d, p = pl * c ** 2, y = p * p, R = e / (b * on), _ = R * R, v = _ * R, C = v * R, I = C * R, E = I * R, S = a - m / x * (_ / 2 - C / 24 * (5 + 3 * g + 10 * p - 4 * y - 9 * pl)) + E / 720 * (61 + 90 * g + 298 * p + 45 * h - 252 * pl - 3 * y);
|
|
12296
|
+
let M = (R - v / 6 * (1 + 2 * g + p) + I / 120 * (5 - 2 * p + 28 * g - 3 * y + 8 * pl + 24 * h)) / c;
|
|
12293
12297
|
return M = Vn(
|
|
12294
12298
|
M + gl(te(n.number)),
|
|
12295
12299
|
-Math.PI,
|
|
12296
12300
|
Math.PI
|
|
12297
|
-
), [ut(M), ut(
|
|
12301
|
+
), [ut(M), ut(S)];
|
|
12298
12302
|
}
|
|
12299
|
-
const gt = -80, dt = 84,
|
|
12300
|
-
function
|
|
12301
|
-
t = Vn(t,
|
|
12302
|
-
const e = gl(l), o = Math.sin(e), i = Math.cos(e), r = o / i, a = r * r, u = a * a, s = gl(t), c = te(n.number), m = gl(c), g = rn / Math.sqrt(1 - J * o ** 2), h = pl * i ** 2, d = i * Vn(s - m, -Math.PI, Math.PI), f = d * d, b = f * d, x = b * d, p = x * d,
|
|
12303
|
-
let
|
|
12304
|
-
return n.north || (
|
|
12303
|
+
const gt = -80, dt = 84, No = -180, Vo = 180;
|
|
12304
|
+
function Po(t, l, n) {
|
|
12305
|
+
t = Vn(t, No, Vo), l < gt ? l = gt : l > dt && (l = dt);
|
|
12306
|
+
const e = gl(l), o = Math.sin(e), i = Math.cos(e), r = o / i, a = r * r, u = a * a, s = gl(t), c = te(n.number), m = gl(c), g = rn / Math.sqrt(1 - J * o ** 2), h = pl * i ** 2, d = i * Vn(s - m, -Math.PI, Math.PI), f = d * d, b = f * d, x = b * d, p = x * d, y = p * d, R = rn * (ne * e - vo * Math.sin(2 * e) + Eo * Math.sin(4 * e) - Co * Math.sin(6 * e)), _ = on * g * (d + b / 6 * (1 - a + h) + p / 120 * (5 - 18 * a + u + 72 * h - 58 * pl)) + 5e5;
|
|
12307
|
+
let v = on * (R + g * r * (f / 2 + x / 24 * (5 - a + 9 * h + 4 * h ** 2) + y / 720 * (61 - 58 * a + u + 600 * h - 330 * pl)));
|
|
12308
|
+
return n.north || (v += 1e7), [_, v];
|
|
12305
12309
|
}
|
|
12306
12310
|
function te(t) {
|
|
12307
12311
|
return (t - 1) * 6 - 180 + 3;
|
|
12308
12312
|
}
|
|
12309
|
-
const
|
|
12313
|
+
const Do = [
|
|
12310
12314
|
/^EPSG:(\d+)$/,
|
|
12311
12315
|
/^urn:ogc:def:crs:EPSG::(\d+)$/,
|
|
12312
12316
|
/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/
|
|
12313
12317
|
];
|
|
12314
12318
|
function ee(t) {
|
|
12315
12319
|
let l = 0;
|
|
12316
|
-
for (const o of
|
|
12320
|
+
for (const o of Do) {
|
|
12317
12321
|
const i = t.match(o);
|
|
12318
12322
|
if (i) {
|
|
12319
12323
|
l = parseInt(i[1]);
|
|
@@ -12336,23 +12340,23 @@ function ht(t, l) {
|
|
|
12336
12340
|
return e;
|
|
12337
12341
|
};
|
|
12338
12342
|
}
|
|
12339
|
-
function
|
|
12343
|
+
function Oo(t) {
|
|
12340
12344
|
return ee(t) ? new Xn({ code: t, units: "m" }) : null;
|
|
12341
12345
|
}
|
|
12342
|
-
function
|
|
12346
|
+
function Lo(t) {
|
|
12343
12347
|
const l = ee(t.getCode());
|
|
12344
12348
|
return l ? {
|
|
12345
|
-
forward: ht(
|
|
12346
|
-
inverse: ht(
|
|
12349
|
+
forward: ht(Po, l),
|
|
12350
|
+
inverse: ht(So, l)
|
|
12347
12351
|
} : null;
|
|
12348
12352
|
}
|
|
12349
|
-
const
|
|
12353
|
+
const Fo = 63710088e-1;
|
|
12350
12354
|
function pt(t, l, n) {
|
|
12351
|
-
n = n ||
|
|
12355
|
+
n = n || Fo;
|
|
12352
12356
|
const e = gl(t[1]), o = gl(l[1]), i = (o - e) / 2, r = gl(l[0] - t[0]) / 2, a = Math.sin(i) * Math.sin(i) + Math.sin(r) * Math.sin(r) * Math.cos(e) * Math.cos(o);
|
|
12353
12357
|
return 2 * n * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
12354
12358
|
}
|
|
12355
|
-
const
|
|
12359
|
+
const ko = [Lo], jo = [Oo];
|
|
12356
12360
|
let Dn = !0;
|
|
12357
12361
|
function oe(t) {
|
|
12358
12362
|
Dn = !1;
|
|
@@ -12367,18 +12371,18 @@ function Un(t, l) {
|
|
|
12367
12371
|
return l;
|
|
12368
12372
|
}
|
|
12369
12373
|
function On(t) {
|
|
12370
|
-
|
|
12374
|
+
_o(t.getCode(), t), Xl(t, t, Un);
|
|
12371
12375
|
}
|
|
12372
|
-
function
|
|
12376
|
+
function Go(t) {
|
|
12373
12377
|
t.forEach(On);
|
|
12374
12378
|
}
|
|
12375
12379
|
function tl(t) {
|
|
12376
12380
|
if (typeof t != "string")
|
|
12377
12381
|
return t;
|
|
12378
|
-
const l =
|
|
12382
|
+
const l = yo(t);
|
|
12379
12383
|
if (l)
|
|
12380
12384
|
return l;
|
|
12381
|
-
for (const n of
|
|
12385
|
+
for (const n of jo) {
|
|
12382
12386
|
const e = n(t);
|
|
12383
12387
|
if (e)
|
|
12384
12388
|
return e;
|
|
@@ -12424,13 +12428,13 @@ function xt(t, l, n, e) {
|
|
|
12424
12428
|
return o;
|
|
12425
12429
|
}
|
|
12426
12430
|
function ft(t) {
|
|
12427
|
-
|
|
12431
|
+
Go(t), t.forEach(function(l) {
|
|
12428
12432
|
t.forEach(function(n) {
|
|
12429
12433
|
l !== n && Xl(l, n, Un);
|
|
12430
12434
|
});
|
|
12431
12435
|
});
|
|
12432
12436
|
}
|
|
12433
|
-
function
|
|
12437
|
+
function Wo(t, l, n, e) {
|
|
12434
12438
|
t.forEach(function(o) {
|
|
12435
12439
|
l.forEach(function(i) {
|
|
12436
12440
|
Xl(o, i, n), Xl(i, o, e);
|
|
@@ -12443,7 +12447,7 @@ function Bn(t, l) {
|
|
|
12443
12447
|
t
|
|
12444
12448
|
) : tl(l);
|
|
12445
12449
|
}
|
|
12446
|
-
function
|
|
12450
|
+
function zo(t) {
|
|
12447
12451
|
return (
|
|
12448
12452
|
/**
|
|
12449
12453
|
* @param {Array<number>} input Input.
|
|
@@ -12471,7 +12475,7 @@ function Rn(t, l) {
|
|
|
12471
12475
|
"EPSG:3857"
|
|
12472
12476
|
);
|
|
12473
12477
|
}
|
|
12474
|
-
function
|
|
12478
|
+
function Xo(t, l) {
|
|
12475
12479
|
const n = gn(
|
|
12476
12480
|
t,
|
|
12477
12481
|
"EPSG:3857",
|
|
@@ -12491,7 +12495,7 @@ function $n(t, l) {
|
|
|
12491
12495
|
if (o)
|
|
12492
12496
|
return o;
|
|
12493
12497
|
let i = null, r = null;
|
|
12494
|
-
for (const u of
|
|
12498
|
+
for (const u of ko)
|
|
12495
12499
|
i || (i = u(t)), r || (r = u(l));
|
|
12496
12500
|
if (!i && !r)
|
|
12497
12501
|
return null;
|
|
@@ -12541,29 +12545,29 @@ function yt(t, l) {
|
|
|
12541
12545
|
return t;
|
|
12542
12546
|
}
|
|
12543
12547
|
function cl(t, l) {
|
|
12544
|
-
return Dn && !en(t, [0, 0]) && t[0] >= -180 && t[0] <= 180 && t[1] >= -90 && t[1] <= 90 && (Dn = !1,
|
|
12548
|
+
return Dn && !en(t, [0, 0]) && t[0] >= -180 && t[0] <= 180 && t[1] >= -90 && t[1] <= 90 && (Dn = !1, qe(
|
|
12545
12549
|
"Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates."
|
|
12546
12550
|
)), t;
|
|
12547
12551
|
}
|
|
12548
|
-
function
|
|
12552
|
+
function Zo(t, l) {
|
|
12549
12553
|
return t;
|
|
12550
12554
|
}
|
|
12551
12555
|
function Al(t, l) {
|
|
12552
12556
|
return t;
|
|
12553
12557
|
}
|
|
12554
|
-
function
|
|
12555
|
-
ft(st), ft(mt),
|
|
12558
|
+
function Ho() {
|
|
12559
|
+
ft(st), ft(mt), Wo(
|
|
12556
12560
|
mt,
|
|
12557
12561
|
st,
|
|
12558
|
-
|
|
12559
|
-
|
|
12562
|
+
po,
|
|
12563
|
+
xo
|
|
12560
12564
|
);
|
|
12561
12565
|
}
|
|
12562
|
-
|
|
12563
|
-
const jl =
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12566
|
+
Ho();
|
|
12567
|
+
const jl = w(!1), _t = w(null);
|
|
12568
|
+
w(!1);
|
|
12569
|
+
w(null);
|
|
12570
|
+
w(!1);
|
|
12567
12571
|
const bl = al({
|
|
12568
12572
|
lat: 112.750412,
|
|
12569
12573
|
lng: 33.741496
|
|
@@ -12581,10 +12585,10 @@ function ie() {
|
|
|
12581
12585
|
}, 100);
|
|
12582
12586
|
});
|
|
12583
12587
|
}
|
|
12584
|
-
const
|
|
12588
|
+
const jr = ({ map: t, mapInitialized: l, mapError: n, isLoading: e, currentCoords: o }) => (t.value = t.value, l.value = l.value, n.value = n.value, e.value = e.value, bl.lat = o.lat, bl.lng = o.lng, jl.value = !0, console.log(t, "地图状态已更新"), {
|
|
12585
12589
|
setupEventHandlers: ie
|
|
12586
12590
|
});
|
|
12587
|
-
function
|
|
12591
|
+
function Uo({ map: t, mapInitialized: l, mapError: n, isLoading: e, currentCoords: o }) {
|
|
12588
12592
|
console.log(t, "useOpenLayersMap"), jl.value = !0, ie(), bl.lat = o.lat, bl.lng = o.lng;
|
|
12589
12593
|
function i() {
|
|
12590
12594
|
t.value && (t.value.setTarget(void 0), t.value = null, l.value = !1, console.log("地图已销毁"));
|
|
@@ -12600,7 +12604,7 @@ function Bo({ map: t, mapInitialized: l, mapError: n, isLoading: e, currentCoord
|
|
|
12600
12604
|
}
|
|
12601
12605
|
function a() {
|
|
12602
12606
|
if (!t.value) return null;
|
|
12603
|
-
const m =
|
|
12607
|
+
const m = Xo(t.value.getView().getCenter());
|
|
12604
12608
|
return {
|
|
12605
12609
|
lat: m[1],
|
|
12606
12610
|
lng: m[0]
|
|
@@ -12683,30 +12687,30 @@ function un(t, l, n, e, o, i, r, a) {
|
|
|
12683
12687
|
const u = Math.sin(i), s = Math.cos(i);
|
|
12684
12688
|
return t[0] = e * s, t[1] = o * u, t[2] = -e * u, t[3] = o * s, t[4] = r * e * s - a * e * u + l, t[5] = r * o * u + a * o * s + n, t;
|
|
12685
12689
|
}
|
|
12686
|
-
function
|
|
12687
|
-
const n =
|
|
12690
|
+
function Bo(t, l) {
|
|
12691
|
+
const n = $o(l);
|
|
12688
12692
|
rl(n !== 0, "Transformation matrix cannot be inverted");
|
|
12689
12693
|
const e = l[0], o = l[1], i = l[2], r = l[3], a = l[4], u = l[5];
|
|
12690
12694
|
return t[0] = r / n, t[1] = -o / n, t[2] = -i / n, t[3] = e / n, t[4] = (i * u - r * a) / n, t[5] = -(e * u - o * a) / n, t;
|
|
12691
12695
|
}
|
|
12692
|
-
function
|
|
12696
|
+
function $o(t) {
|
|
12693
12697
|
return t[0] * t[3] - t[1] * t[2];
|
|
12694
12698
|
}
|
|
12695
|
-
const
|
|
12696
|
-
function
|
|
12699
|
+
const Yo = [1e5, 1e5, 1e5, 1e5, 2, 2];
|
|
12700
|
+
function Ko(t) {
|
|
12697
12701
|
return "matrix(" + t.join(", ") + ")";
|
|
12698
12702
|
}
|
|
12699
12703
|
function It(t) {
|
|
12700
12704
|
return t.substring(7, t.length - 1).split(",").map(parseFloat);
|
|
12701
12705
|
}
|
|
12702
|
-
function
|
|
12706
|
+
function qo(t, l) {
|
|
12703
12707
|
const n = It(t), e = It(l);
|
|
12704
12708
|
for (let o = 0; o < 6; ++o)
|
|
12705
|
-
if (Math.round((n[o] - e[o]) *
|
|
12709
|
+
if (Math.round((n[o] - e[o]) * Yo[o]) !== 0)
|
|
12706
12710
|
return !1;
|
|
12707
12711
|
return !0;
|
|
12708
12712
|
}
|
|
12709
|
-
function
|
|
12713
|
+
function Jo(t, l) {
|
|
12710
12714
|
return t > l ? 1 : t < l ? -1 : 0;
|
|
12711
12715
|
}
|
|
12712
12716
|
function Yn(t, l, n) {
|
|
@@ -12745,7 +12749,7 @@ function Yn(t, l, n) {
|
|
|
12745
12749
|
}
|
|
12746
12750
|
return e - 1;
|
|
12747
12751
|
}
|
|
12748
|
-
function
|
|
12752
|
+
function Qo(t, l) {
|
|
12749
12753
|
const n = Array.isArray(l) ? l : [l], e = n.length;
|
|
12750
12754
|
for (let o = 0; o < e; o++)
|
|
12751
12755
|
t[t.length] = n[o];
|
|
@@ -12759,8 +12763,8 @@ function re(t, l) {
|
|
|
12759
12763
|
return !1;
|
|
12760
12764
|
return !0;
|
|
12761
12765
|
}
|
|
12762
|
-
const Rl = typeof navigator < "u" && typeof navigator.userAgent < "u" ? navigator.userAgent.toLowerCase() : "",
|
|
12763
|
-
|
|
12766
|
+
const Rl = typeof navigator < "u" && typeof navigator.userAgent < "u" ? navigator.userAgent.toLowerCase() : "", li = Rl.includes("safari") && !Rl.includes("chrom");
|
|
12767
|
+
li && (Rl.includes("version/15.4") || /cpu (os|iphone os) 15_4 like mac os x/.test(Rl));
|
|
12764
12768
|
Rl.includes("webkit") && Rl.includes("edge");
|
|
12765
12769
|
Rl.includes("macintosh");
|
|
12766
12770
|
const ae = typeof WorkerGlobalScope < "u" && typeof OffscreenCanvas < "u" && self instanceof WorkerGlobalScope, ue = typeof Image < "u" && Image.prototype.decode, se = typeof createImageBitmap == "function";
|
|
@@ -12796,7 +12800,7 @@ function ce(t) {
|
|
|
12796
12800
|
const l = t.canvas;
|
|
12797
12801
|
l.width = 1, l.height = 1, t.clearRect(0, 0, 1, 1);
|
|
12798
12802
|
}
|
|
12799
|
-
function
|
|
12803
|
+
function ni() {
|
|
12800
12804
|
return new Proxy(
|
|
12801
12805
|
{
|
|
12802
12806
|
/**
|
|
@@ -12845,18 +12849,18 @@ function ti() {
|
|
|
12845
12849
|
}
|
|
12846
12850
|
);
|
|
12847
12851
|
}
|
|
12848
|
-
function
|
|
12852
|
+
function ti(t) {
|
|
12849
12853
|
return typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && t instanceof OffscreenCanvas;
|
|
12850
12854
|
}
|
|
12851
|
-
const
|
|
12855
|
+
const ei = [NaN, NaN, NaN, 0];
|
|
12852
12856
|
let In;
|
|
12853
|
-
function
|
|
12857
|
+
function oi() {
|
|
12854
12858
|
return In || (In = yl(1, 1, void 0, {
|
|
12855
12859
|
willReadFrequently: !0,
|
|
12856
12860
|
desynchronized: !0
|
|
12857
12861
|
})), In;
|
|
12858
12862
|
}
|
|
12859
|
-
const
|
|
12863
|
+
const ii = /^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, ri = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, ai = /^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, ui = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;
|
|
12860
12864
|
function Jl(t, l) {
|
|
12861
12865
|
return t.endsWith("%") ? Number(t.substring(0, t.length - 1)) / l : Number(t);
|
|
12862
12866
|
}
|
|
@@ -12865,7 +12869,7 @@ function Wl(t) {
|
|
|
12865
12869
|
}
|
|
12866
12870
|
function me(t) {
|
|
12867
12871
|
if (t.toLowerCase().startsWith("rgb")) {
|
|
12868
|
-
const i = t.match(
|
|
12872
|
+
const i = t.match(ri) || t.match(ii) || t.match(ai);
|
|
12869
12873
|
if (i) {
|
|
12870
12874
|
const r = i[4], a = 100 / 255;
|
|
12871
12875
|
return [
|
|
@@ -12878,7 +12882,7 @@ function me(t) {
|
|
|
12878
12882
|
Wl(t);
|
|
12879
12883
|
}
|
|
12880
12884
|
if (t.startsWith("#")) {
|
|
12881
|
-
if (
|
|
12885
|
+
if (ui.test(t)) {
|
|
12882
12886
|
const i = t.substring(1), r = i.length <= 4 ? 1 : 2, a = [0, 0, 0, 255];
|
|
12883
12887
|
for (let u = 0, s = i.length; u < s; u += r) {
|
|
12884
12888
|
let c = parseInt(i.substring(u, u + r), 16);
|
|
@@ -12888,7 +12892,7 @@ function me(t) {
|
|
|
12888
12892
|
}
|
|
12889
12893
|
Wl(t);
|
|
12890
12894
|
}
|
|
12891
|
-
const l =
|
|
12895
|
+
const l = oi();
|
|
12892
12896
|
l.fillStyle = "#abcdef";
|
|
12893
12897
|
let n = l.fillStyle;
|
|
12894
12898
|
l.fillStyle = t, l.fillStyle === n && (l.fillStyle = "#fedcba", n = l.fillStyle, l.fillStyle = t, l.fillStyle === n && Wl(t));
|
|
@@ -12899,14 +12903,14 @@ function me(t) {
|
|
|
12899
12903
|
const o = Array.from(l.getImageData(0, 0, 1, 1).data);
|
|
12900
12904
|
return o[3] = Kt(o[3] / 255, 3), o;
|
|
12901
12905
|
}
|
|
12902
|
-
const
|
|
12906
|
+
const si = 1024, kl = {};
|
|
12903
12907
|
let vn = 0;
|
|
12904
|
-
function
|
|
12908
|
+
function ci(t) {
|
|
12905
12909
|
if (t === "none")
|
|
12906
|
-
return
|
|
12910
|
+
return ei;
|
|
12907
12911
|
if (kl.hasOwnProperty(t))
|
|
12908
12912
|
return kl[t];
|
|
12909
|
-
if (vn >=
|
|
12913
|
+
if (vn >= si) {
|
|
12910
12914
|
let n = 0;
|
|
12911
12915
|
for (const e in kl)
|
|
12912
12916
|
n++ & 3 || (delete kl[e], --vn);
|
|
@@ -12918,7 +12922,7 @@ function mi(t) {
|
|
|
12918
12922
|
return kl[t] = l, ++vn, l;
|
|
12919
12923
|
}
|
|
12920
12924
|
function Et(t) {
|
|
12921
|
-
return Array.isArray(t) ? t :
|
|
12925
|
+
return Array.isArray(t) ? t : ci(t);
|
|
12922
12926
|
}
|
|
12923
12927
|
class dn {
|
|
12924
12928
|
/**
|
|
@@ -12943,7 +12947,7 @@ class dn {
|
|
|
12943
12947
|
this.propagationStopped = !0;
|
|
12944
12948
|
}
|
|
12945
12949
|
}
|
|
12946
|
-
class
|
|
12950
|
+
class mi extends dn {
|
|
12947
12951
|
/**
|
|
12948
12952
|
* @param {import("./EventType.js").default} type Type.
|
|
12949
12953
|
* @param {import("../transform.js").Transform} [inversePixelTransform] Transform for
|
|
@@ -12977,7 +12981,7 @@ const Gl = {
|
|
|
12977
12981
|
*/
|
|
12978
12982
|
PRECOMPOSE: "precompose"
|
|
12979
12983
|
};
|
|
12980
|
-
class
|
|
12984
|
+
class bi {
|
|
12981
12985
|
constructor() {
|
|
12982
12986
|
/**
|
|
12983
12987
|
* @private
|
|
@@ -13064,7 +13068,7 @@ const dl = {
|
|
|
13064
13068
|
*/
|
|
13065
13069
|
CHANGE: "change"
|
|
13066
13070
|
};
|
|
13067
|
-
class
|
|
13071
|
+
class gi {
|
|
13068
13072
|
constructor() {
|
|
13069
13073
|
this.disposed = !1;
|
|
13070
13074
|
}
|
|
@@ -13083,14 +13087,14 @@ class di {
|
|
|
13083
13087
|
}
|
|
13084
13088
|
function Ln() {
|
|
13085
13089
|
}
|
|
13086
|
-
function
|
|
13090
|
+
function di(t) {
|
|
13087
13091
|
let l, n, e;
|
|
13088
13092
|
return function() {
|
|
13089
13093
|
const o = Array.prototype.slice.call(arguments);
|
|
13090
13094
|
return (!n || this !== e || !re(o, n)) && (e = this, n = o, l = t.apply(this, arguments)), l;
|
|
13091
13095
|
};
|
|
13092
13096
|
}
|
|
13093
|
-
function
|
|
13097
|
+
function hi(t) {
|
|
13094
13098
|
function l() {
|
|
13095
13099
|
let n;
|
|
13096
13100
|
try {
|
|
@@ -13102,7 +13106,7 @@ function pi(t) {
|
|
|
13102
13106
|
}
|
|
13103
13107
|
return l();
|
|
13104
13108
|
}
|
|
13105
|
-
class be extends
|
|
13109
|
+
class be extends gi {
|
|
13106
13110
|
/**
|
|
13107
13111
|
* @param {*} [target] Default event target for dispatched events.
|
|
13108
13112
|
*/
|
|
@@ -13292,7 +13296,7 @@ class ge extends be {
|
|
|
13292
13296
|
n.ol_key
|
|
13293
13297
|
);
|
|
13294
13298
|
if (e)
|
|
13295
|
-
|
|
13299
|
+
pi(e);
|
|
13296
13300
|
else if (Array.isArray(l))
|
|
13297
13301
|
for (let o = 0, i = l.length; o < i; ++o)
|
|
13298
13302
|
this.removeEventListener(l[o], n);
|
|
@@ -13300,7 +13304,7 @@ class ge extends be {
|
|
|
13300
13304
|
this.removeEventListener(l, n);
|
|
13301
13305
|
}
|
|
13302
13306
|
}
|
|
13303
|
-
function
|
|
13307
|
+
function pi(t) {
|
|
13304
13308
|
if (Array.isArray(t))
|
|
13305
13309
|
for (let l = 0, n = t.length; l < n; ++l)
|
|
13306
13310
|
Nl(t[l]);
|
|
@@ -13313,17 +13317,17 @@ function xi(t) {
|
|
|
13313
13317
|
function F() {
|
|
13314
13318
|
throw new Error("Unimplemented abstract method.");
|
|
13315
13319
|
}
|
|
13316
|
-
let
|
|
13317
|
-
function
|
|
13318
|
-
return t.ol_uid || (t.ol_uid = String(++
|
|
13320
|
+
let xi = 0;
|
|
13321
|
+
function fi(t) {
|
|
13322
|
+
return t.ol_uid || (t.ol_uid = String(++xi));
|
|
13319
13323
|
}
|
|
13320
|
-
const
|
|
13321
|
-
class
|
|
13324
|
+
const Ri = 5;
|
|
13325
|
+
class yi extends ge {
|
|
13322
13326
|
/**
|
|
13323
13327
|
* @param {LayerType} layer Layer.
|
|
13324
13328
|
*/
|
|
13325
13329
|
constructor(l) {
|
|
13326
|
-
super(), this.ready = !0, this.boundHandleImageChange_ = this.handleImageChange_.bind(this), this.layer_ = l, this.staleKeys_ = new Array(), this.maxStaleKeys =
|
|
13330
|
+
super(), this.ready = !0, this.boundHandleImageChange_ = this.handleImageChange_.bind(this), this.layer_ = l, this.staleKeys_ = new Array(), this.maxStaleKeys = Ri;
|
|
13327
13331
|
}
|
|
13328
13332
|
/**
|
|
13329
13333
|
* @return {Array<string>} Get the list of stale keys.
|
|
@@ -13440,12 +13444,12 @@ class _i extends ge {
|
|
|
13440
13444
|
}
|
|
13441
13445
|
}
|
|
13442
13446
|
let Cl = null;
|
|
13443
|
-
function
|
|
13447
|
+
function _i() {
|
|
13444
13448
|
Cl = yl(1, 1, void 0, {
|
|
13445
13449
|
willReadFrequently: !0
|
|
13446
13450
|
});
|
|
13447
13451
|
}
|
|
13448
|
-
class
|
|
13452
|
+
class Ii extends yi {
|
|
13449
13453
|
/**
|
|
13450
13454
|
* @param {LayerType} layer Layer.
|
|
13451
13455
|
*/
|
|
@@ -13459,7 +13463,7 @@ class vi extends _i {
|
|
|
13459
13463
|
* @return {Uint8ClampedArray|null} The image data.
|
|
13460
13464
|
*/
|
|
13461
13465
|
getImageData(l, n, e) {
|
|
13462
|
-
Cl ||
|
|
13466
|
+
Cl || _i(), Cl.clearRect(0, 0, 1, 1);
|
|
13463
13467
|
let o;
|
|
13464
13468
|
try {
|
|
13465
13469
|
Cl.drawImage(l, n, e, 1, 1, 0, 0, 1, 1), o = Cl.getImageData(0, 0, 1, 1).data;
|
|
@@ -13490,10 +13494,10 @@ class vi extends _i {
|
|
|
13490
13494
|
Et(e)
|
|
13491
13495
|
))) {
|
|
13492
13496
|
const a = l.firstElementChild;
|
|
13493
|
-
|
|
13497
|
+
ti(a) && (r = a.getContext("2d"));
|
|
13494
13498
|
}
|
|
13495
|
-
if (r &&
|
|
13496
|
-
i = ae ?
|
|
13499
|
+
if (r && qo(r.canvas.style.transform, n) ? (this.container = l, this.context = r, this.containerReused = !0) : this.containerReused ? (this.container = null, this.context = null, this.containerReused = !1) : this.container && (this.container.style.backgroundColor = null), !this.container) {
|
|
13500
|
+
i = ae ? ni() : document.createElement("div"), i.className = o;
|
|
13497
13501
|
let a = i.style;
|
|
13498
13502
|
a.position = "absolute", a.width = "100%", a.height = "100%", r = yl();
|
|
13499
13503
|
const u = (
|
|
@@ -13532,8 +13536,8 @@ class vi extends _i {
|
|
|
13532
13536
|
i,
|
|
13533
13537
|
-a / 2,
|
|
13534
13538
|
-u / 2
|
|
13535
|
-
),
|
|
13536
|
-
const s =
|
|
13539
|
+
), Bo(this.inversePixelTransform, this.pixelTransform);
|
|
13540
|
+
const s = Ko(this.pixelTransform);
|
|
13537
13541
|
if (this.useContainer(n, s, this.getBackground(l)), !this.containerReused) {
|
|
13538
13542
|
const c = this.context.canvas;
|
|
13539
13543
|
c.width != a || c.height != u ? (c.width = a, c.height = u) : this.context.clearRect(0, 0, a, u), s !== /** @type {HTMLCanvasElement} */
|
|
@@ -13549,7 +13553,7 @@ class vi extends _i {
|
|
|
13549
13553
|
dispatchRenderEvent_(l, n, e) {
|
|
13550
13554
|
const o = this.getLayer();
|
|
13551
13555
|
if (o.hasListener(l)) {
|
|
13552
|
-
const i = new
|
|
13556
|
+
const i = new mi(
|
|
13553
13557
|
l,
|
|
13554
13558
|
this.inversePixelTransform,
|
|
13555
13559
|
e,
|
|
@@ -13584,7 +13588,7 @@ class vi extends _i {
|
|
|
13584
13588
|
* @return {import('../../render/canvas/ZIndexContext.js').ZIndexContextProxy} Context.
|
|
13585
13589
|
*/
|
|
13586
13590
|
getRenderContext(l) {
|
|
13587
|
-
return l.declutter && !this.deferredContext_ && (this.deferredContext_ = new
|
|
13591
|
+
return l.declutter && !this.deferredContext_ && (this.deferredContext_ = new bi()), l.declutter ? this.deferredContext_.getContext() : this.context;
|
|
13588
13592
|
}
|
|
13589
13593
|
/**
|
|
13590
13594
|
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
@@ -13634,7 +13638,7 @@ class vi extends _i {
|
|
|
13634
13638
|
delete this.frameState, super.disposeInternal();
|
|
13635
13639
|
}
|
|
13636
13640
|
}
|
|
13637
|
-
class
|
|
13641
|
+
class vi extends Ii {
|
|
13638
13642
|
/**
|
|
13639
13643
|
* @param {import("../../layer/Image.js").default} imageLayer Image layer.
|
|
13640
13644
|
*/
|
|
@@ -13709,15 +13713,15 @@ class Ei extends vi {
|
|
|
13709
13713
|
const e = this.image, o = e.getExtent(), i = e.getResolution(), [r, a] = Array.isArray(i) ? i : [i, i], u = e.getPixelRatio(), s = l.layerStatesArray[l.layerIndex], c = l.pixelRatio, m = l.viewState, g = m.center, h = m.resolution, d = c * r / (h * u), f = c * a / (h * u);
|
|
13710
13714
|
this.prepareContainer(l, n);
|
|
13711
13715
|
const b = this.context.canvas.width, x = this.context.canvas.height, p = this.getRenderContext(l);
|
|
13712
|
-
let
|
|
13716
|
+
let y = !1, R = !0;
|
|
13713
13717
|
if (s.extent) {
|
|
13714
13718
|
const E = Al(
|
|
13715
13719
|
s.extent,
|
|
13716
13720
|
m.projection
|
|
13717
13721
|
);
|
|
13718
|
-
|
|
13722
|
+
R = Ol(E, l.extent), y = R && !Nn(E, l.extent), y && this.clipUnrotated(p, l, E);
|
|
13719
13723
|
}
|
|
13720
|
-
const _ = e.getImage(),
|
|
13724
|
+
const _ = e.getImage(), v = un(
|
|
13721
13725
|
this.tempTransform,
|
|
13722
13726
|
b / 2,
|
|
13723
13727
|
x / 2,
|
|
@@ -13728,15 +13732,15 @@ class Ei extends vi {
|
|
|
13728
13732
|
u * (g[1] - o[3]) / a
|
|
13729
13733
|
);
|
|
13730
13734
|
this.renderedResolution = a * c / u;
|
|
13731
|
-
const C = _.width *
|
|
13732
|
-
if (this.getLayer().getSource().getInterpolate() || (p.imageSmoothingEnabled = !1), this.preRender(p, l),
|
|
13733
|
-
const E =
|
|
13734
|
-
M !== 1 && (p.save(), p.globalAlpha = M), p.drawImage(_, 0, 0, +_.width, +_.height, E,
|
|
13735
|
+
const C = _.width * v[0], I = _.height * v[3];
|
|
13736
|
+
if (this.getLayer().getSource().getInterpolate() || (p.imageSmoothingEnabled = !1), this.preRender(p, l), R && C >= 0.5 && I >= 0.5) {
|
|
13737
|
+
const E = v[4], S = v[5], M = s.opacity;
|
|
13738
|
+
M !== 1 && (p.save(), p.globalAlpha = M), p.drawImage(_, 0, 0, +_.width, +_.height, E, S, C, I), M !== 1 && p.restore();
|
|
13735
13739
|
}
|
|
13736
|
-
return this.postRender(this.context, l),
|
|
13740
|
+
return this.postRender(this.context, l), y && p.restore(), p.imageSmoothingEnabled = !0, this.container;
|
|
13737
13741
|
}
|
|
13738
13742
|
}
|
|
13739
|
-
const
|
|
13743
|
+
const Ei = {
|
|
13740
13744
|
/**
|
|
13741
13745
|
* Triggered when a property is changed.
|
|
13742
13746
|
* @event module:ol/Object.ObjectEvent#propertychange
|
|
@@ -13759,7 +13763,7 @@ class hn extends ge {
|
|
|
13759
13763
|
* @param {NoInfer<Properties>} [values] An object with key-value pairs.
|
|
13760
13764
|
*/
|
|
13761
13765
|
constructor(l) {
|
|
13762
|
-
super(), this.on, this.once, this.un,
|
|
13766
|
+
super(), this.on, this.once, this.un, fi(this), this.values_ = null, l !== void 0 && this.setProperties(l);
|
|
13763
13767
|
}
|
|
13764
13768
|
/**
|
|
13765
13769
|
* Gets a value.
|
|
@@ -13809,7 +13813,7 @@ class hn extends ge {
|
|
|
13809
13813
|
*/
|
|
13810
13814
|
notify(l, n) {
|
|
13811
13815
|
let e;
|
|
13812
|
-
e = `change:${l}`, this.hasListener(e) && this.dispatchEvent(new Mt(e, l, n)), e =
|
|
13816
|
+
e = `change:${l}`, this.hasListener(e) && this.dispatchEvent(new Mt(e, l, n)), e = Ei.PROPERTYCHANGE, this.hasListener(e) && this.dispatchEvent(new Mt(e, l, n));
|
|
13813
13817
|
}
|
|
13814
13818
|
/**
|
|
13815
13819
|
* @param {string} key Key name.
|
|
@@ -13869,7 +13873,7 @@ class hn extends ge {
|
|
|
13869
13873
|
unset(l, n) {
|
|
13870
13874
|
if (this.values_ && l in this.values_) {
|
|
13871
13875
|
const e = this.values_[l];
|
|
13872
|
-
delete this.values_[l],
|
|
13876
|
+
delete this.values_[l], Io(this.values_) && (this.values_ = null), n || this.notify(l, e);
|
|
13873
13877
|
}
|
|
13874
13878
|
}
|
|
13875
13879
|
}
|
|
@@ -13905,19 +13909,19 @@ function At(t, l, n) {
|
|
|
13905
13909
|
}
|
|
13906
13910
|
);
|
|
13907
13911
|
}
|
|
13908
|
-
function
|
|
13912
|
+
function Ci(t) {
|
|
13909
13913
|
return t;
|
|
13910
13914
|
}
|
|
13911
|
-
function
|
|
13915
|
+
function Mi(t) {
|
|
13912
13916
|
return Math.pow(t, 3);
|
|
13913
13917
|
}
|
|
13914
|
-
function
|
|
13915
|
-
return 1 -
|
|
13918
|
+
function Ai(t) {
|
|
13919
|
+
return 1 - Mi(1 - t);
|
|
13916
13920
|
}
|
|
13917
|
-
function
|
|
13921
|
+
function Ti(t) {
|
|
13918
13922
|
return 3 * t * t - 2 * t * t * t;
|
|
13919
13923
|
}
|
|
13920
|
-
function
|
|
13924
|
+
function wi(t, l, n, e, o, i, r) {
|
|
13921
13925
|
i = i || [], r = r || 2;
|
|
13922
13926
|
let a = 0;
|
|
13923
13927
|
for (let u = l; u < n; u += e) {
|
|
@@ -13928,7 +13932,7 @@ function Si(t, l, n, e, o, i, r) {
|
|
|
13928
13932
|
}
|
|
13929
13933
|
return i && i.length != a && (i.length = a), i;
|
|
13930
13934
|
}
|
|
13931
|
-
function
|
|
13935
|
+
function Si(t, l, n, e, o, i, r) {
|
|
13932
13936
|
r = r || [];
|
|
13933
13937
|
const a = Math.cos(o), u = Math.sin(o), s = i[0], c = i[1];
|
|
13934
13938
|
let m = 0;
|
|
@@ -13940,7 +13944,7 @@ function Ni(t, l, n, e, o, i, r) {
|
|
|
13940
13944
|
}
|
|
13941
13945
|
return r && r.length != m && (r.length = m), r;
|
|
13942
13946
|
}
|
|
13943
|
-
function
|
|
13947
|
+
function Ni(t, l, n, e, o, i, r, a) {
|
|
13944
13948
|
a = a || [];
|
|
13945
13949
|
const u = r[0], s = r[1];
|
|
13946
13950
|
let c = 0;
|
|
@@ -13952,7 +13956,7 @@ function Vi(t, l, n, e, o, i, r, a) {
|
|
|
13952
13956
|
}
|
|
13953
13957
|
return a && a.length != c && (a.length = c), a;
|
|
13954
13958
|
}
|
|
13955
|
-
function
|
|
13959
|
+
function Vi(t, l, n, e, o, i, r) {
|
|
13956
13960
|
r = r || [];
|
|
13957
13961
|
let a = 0;
|
|
13958
13962
|
for (let u = l; u < n; u += e) {
|
|
@@ -13962,10 +13966,10 @@ function Pi(t, l, n, e, o, i, r) {
|
|
|
13962
13966
|
}
|
|
13963
13967
|
return r && r.length != a && (r.length = a), r;
|
|
13964
13968
|
}
|
|
13965
|
-
const Tt = tn(),
|
|
13966
|
-
class
|
|
13969
|
+
const Tt = tn(), Pi = [NaN, NaN];
|
|
13970
|
+
class Di extends hn {
|
|
13967
13971
|
constructor() {
|
|
13968
|
-
super(), this.extent_ = Dl(), this.extentRevision_ = -1, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0, this.simplifyTransformedInternal =
|
|
13972
|
+
super(), this.extent_ = Dl(), this.extentRevision_ = -1, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0, this.simplifyTransformedInternal = di(
|
|
13969
13973
|
(l, n, e) => {
|
|
13970
13974
|
if (!e)
|
|
13971
13975
|
return this.getSimplifiedGeometry(n);
|
|
@@ -14013,7 +14017,7 @@ class Oi extends hn {
|
|
|
14013
14017
|
* @return {boolean} Contains (x, y).
|
|
14014
14018
|
*/
|
|
14015
14019
|
containsXY(l, n) {
|
|
14016
|
-
return this.closestPointXY(l, n,
|
|
14020
|
+
return this.closestPointXY(l, n, Pi, Number.MIN_VALUE) === 0;
|
|
14017
14021
|
}
|
|
14018
14022
|
/**
|
|
14019
14023
|
* Return the closest point of the geometry to the passed point as
|
|
@@ -14056,7 +14060,7 @@ class Oi extends hn {
|
|
|
14056
14060
|
const n = this.computeExtent(this.extent_);
|
|
14057
14061
|
(isNaN(n[0]) || isNaN(n[1])) && jn(n), this.extentRevision_ = this.getRevision();
|
|
14058
14062
|
}
|
|
14059
|
-
return
|
|
14063
|
+
return ro(this.extent_, l);
|
|
14060
14064
|
}
|
|
14061
14065
|
/**
|
|
14062
14066
|
* Rotate the geometry around a given coordinate. This modifies the geometry
|
|
@@ -14173,7 +14177,7 @@ class Oi extends hn {
|
|
|
14173
14177
|
0,
|
|
14174
14178
|
0
|
|
14175
14179
|
);
|
|
14176
|
-
const m =
|
|
14180
|
+
const m = wi(
|
|
14177
14181
|
i,
|
|
14178
14182
|
0,
|
|
14179
14183
|
i.length,
|
|
@@ -14186,7 +14190,7 @@ class Oi extends hn {
|
|
|
14186
14190
|
return this.applyTransform(o), this;
|
|
14187
14191
|
}
|
|
14188
14192
|
}
|
|
14189
|
-
class Kn extends
|
|
14193
|
+
class Kn extends Di {
|
|
14190
14194
|
constructor() {
|
|
14191
14195
|
super(), this.layout = "XY", this.stride = 2, this.flatCoordinates;
|
|
14192
14196
|
}
|
|
@@ -14197,7 +14201,7 @@ class Kn extends Oi {
|
|
|
14197
14201
|
* @override
|
|
14198
14202
|
*/
|
|
14199
14203
|
computeExtent(l) {
|
|
14200
|
-
return
|
|
14204
|
+
return Qe(
|
|
14201
14205
|
this.flatCoordinates,
|
|
14202
14206
|
0,
|
|
14203
14207
|
this.flatCoordinates.length,
|
|
@@ -14304,7 +14308,7 @@ class Kn extends Oi {
|
|
|
14304
14308
|
n = /** @type {Array<unknown>} */
|
|
14305
14309
|
n[0];
|
|
14306
14310
|
}
|
|
14307
|
-
o = n.length, l =
|
|
14311
|
+
o = n.length, l = Oi(o);
|
|
14308
14312
|
}
|
|
14309
14313
|
this.layout = l, this.stride = o;
|
|
14310
14314
|
}
|
|
@@ -14338,7 +14342,7 @@ class Kn extends Oi {
|
|
|
14338
14342
|
const e = this.getFlatCoordinates();
|
|
14339
14343
|
if (e) {
|
|
14340
14344
|
const o = this.getStride();
|
|
14341
|
-
|
|
14345
|
+
Si(
|
|
14342
14346
|
e,
|
|
14343
14347
|
0,
|
|
14344
14348
|
e.length,
|
|
@@ -14364,7 +14368,7 @@ class Kn extends Oi {
|
|
|
14364
14368
|
const o = this.getFlatCoordinates();
|
|
14365
14369
|
if (o) {
|
|
14366
14370
|
const i = this.getStride();
|
|
14367
|
-
|
|
14371
|
+
Ni(
|
|
14368
14372
|
o,
|
|
14369
14373
|
0,
|
|
14370
14374
|
o.length,
|
|
@@ -14388,7 +14392,7 @@ class Kn extends Oi {
|
|
|
14388
14392
|
const e = this.getFlatCoordinates();
|
|
14389
14393
|
if (e) {
|
|
14390
14394
|
const o = this.getStride();
|
|
14391
|
-
|
|
14395
|
+
Vi(
|
|
14392
14396
|
e,
|
|
14393
14397
|
0,
|
|
14394
14398
|
e.length,
|
|
@@ -14400,7 +14404,7 @@ class Kn extends Oi {
|
|
|
14400
14404
|
}
|
|
14401
14405
|
}
|
|
14402
14406
|
}
|
|
14403
|
-
function
|
|
14407
|
+
function Oi(t) {
|
|
14404
14408
|
let l;
|
|
14405
14409
|
return t == 2 ? l = "XY" : t == 3 ? l = "XYZ" : t == 4 && (l = "XYZM"), /** @type {import("./Geometry.js").GeometryLayout} */
|
|
14406
14410
|
l;
|
|
@@ -14420,7 +14424,7 @@ function de(t, l, n, e) {
|
|
|
14420
14424
|
}
|
|
14421
14425
|
return o / 2;
|
|
14422
14426
|
}
|
|
14423
|
-
function
|
|
14427
|
+
function Li(t, l, n, e) {
|
|
14424
14428
|
let o = 0;
|
|
14425
14429
|
for (let i = 0, r = n.length; i < r; ++i) {
|
|
14426
14430
|
const a = n[i];
|
|
@@ -14439,7 +14443,7 @@ function St(t, l, n, e, o, i, r) {
|
|
|
14439
14443
|
m = n;
|
|
14440
14444
|
else if (g > 0) {
|
|
14441
14445
|
for (let h = 0; h < e; ++h)
|
|
14442
|
-
r[h] =
|
|
14446
|
+
r[h] = co(
|
|
14443
14447
|
t[l + h],
|
|
14444
14448
|
t[n + h],
|
|
14445
14449
|
g
|
|
@@ -14461,7 +14465,7 @@ function he(t, l, n, e, o) {
|
|
|
14461
14465
|
}
|
|
14462
14466
|
return o;
|
|
14463
14467
|
}
|
|
14464
|
-
function
|
|
14468
|
+
function Fi(t, l, n, e, o) {
|
|
14465
14469
|
for (let i = 0, r = n.length; i < r; ++i) {
|
|
14466
14470
|
const a = n[i];
|
|
14467
14471
|
o = he(t, l, a, e, o), l = a;
|
|
@@ -14520,7 +14524,7 @@ function pe(t, l, n, e, o, i, r, a, u, s, c) {
|
|
|
14520
14524
|
}
|
|
14521
14525
|
return s;
|
|
14522
14526
|
}
|
|
14523
|
-
function
|
|
14527
|
+
function ki(t, l, n, e, o, i, r, a, u, s, c) {
|
|
14524
14528
|
c = c || [NaN, NaN];
|
|
14525
14529
|
for (let m = 0, g = n.length; m < g; ++m) {
|
|
14526
14530
|
const h = n[m];
|
|
@@ -14540,7 +14544,7 @@ function ji(t, l, n, e, o, i, r, a, u, s, c) {
|
|
|
14540
14544
|
}
|
|
14541
14545
|
return s;
|
|
14542
14546
|
}
|
|
14543
|
-
function
|
|
14547
|
+
function ji(t, l, n, e) {
|
|
14544
14548
|
for (let o = 0, i = n.length; o < i; ++o)
|
|
14545
14549
|
t[l++] = n[o];
|
|
14546
14550
|
return l;
|
|
@@ -14553,7 +14557,7 @@ function xe(t, l, n, e) {
|
|
|
14553
14557
|
}
|
|
14554
14558
|
return l;
|
|
14555
14559
|
}
|
|
14556
|
-
function
|
|
14560
|
+
function Gi(t, l, n, e, o) {
|
|
14557
14561
|
o = o || [];
|
|
14558
14562
|
let i = 0;
|
|
14559
14563
|
for (let r = 0, a = n.length; r < a; ++r) {
|
|
@@ -14574,7 +14578,7 @@ function fe(t, l, n, e, o) {
|
|
|
14574
14578
|
o[i++] = t.slice(r, r + e);
|
|
14575
14579
|
return o.length = i, o;
|
|
14576
14580
|
}
|
|
14577
|
-
function
|
|
14581
|
+
function Wi(t, l, n, e, o) {
|
|
14578
14582
|
o = o !== void 0 ? o : [];
|
|
14579
14583
|
let i = 0;
|
|
14580
14584
|
for (let r = 0, a = n.length; r < a; ++r) {
|
|
@@ -14589,7 +14593,7 @@ function zi(t, l, n, e, o) {
|
|
|
14589
14593
|
}
|
|
14590
14594
|
return o.length = i, o;
|
|
14591
14595
|
}
|
|
14592
|
-
function
|
|
14596
|
+
function zi(t, l, n, e, o, i, r) {
|
|
14593
14597
|
const a = (n - l) / e;
|
|
14594
14598
|
if (a < 3) {
|
|
14595
14599
|
for (; l < n; l += e)
|
|
@@ -14605,7 +14609,7 @@ function Xi(t, l, n, e, o, i, r) {
|
|
|
14605
14609
|
let h = 0;
|
|
14606
14610
|
const d = t[g], f = t[g + 1], b = t[m], x = t[m + 1];
|
|
14607
14611
|
for (let p = g + e; p < m; p += e) {
|
|
14608
|
-
const
|
|
14612
|
+
const y = t[p], R = t[p + 1], _ = uo(y, R, d, f, b, x);
|
|
14609
14613
|
_ > h && (c = p, h = _);
|
|
14610
14614
|
}
|
|
14611
14615
|
h > o && (u[(c - l) / e] = 1, g + e < c && s.push(g, c), c + e < m && s.push(c, m));
|
|
@@ -14617,7 +14621,7 @@ function Xi(t, l, n, e, o, i, r) {
|
|
|
14617
14621
|
function vl(t, l) {
|
|
14618
14622
|
return l * Math.round(t / l);
|
|
14619
14623
|
}
|
|
14620
|
-
function
|
|
14624
|
+
function Xi(t, l, n, e, o, i, r) {
|
|
14621
14625
|
if (l == n)
|
|
14622
14626
|
return r;
|
|
14623
14627
|
let a = vl(t[l], o), u = vl(t[l + 1], o);
|
|
@@ -14640,10 +14644,10 @@ function Zi(t, l, n, e, o, i, r) {
|
|
|
14640
14644
|
}
|
|
14641
14645
|
return i[r++] = s, i[r++] = c, r;
|
|
14642
14646
|
}
|
|
14643
|
-
function
|
|
14647
|
+
function Zi(t, l, n, e, o, i, r, a) {
|
|
14644
14648
|
for (let u = 0, s = n.length; u < s; ++u) {
|
|
14645
14649
|
const c = n[u];
|
|
14646
|
-
r =
|
|
14650
|
+
r = Xi(
|
|
14647
14651
|
t,
|
|
14648
14652
|
l,
|
|
14649
14653
|
c,
|
|
@@ -14746,7 +14750,7 @@ class Zl extends Kn {
|
|
|
14746
14750
|
*/
|
|
14747
14751
|
getSimplifiedGeometryInternal(l) {
|
|
14748
14752
|
const n = [];
|
|
14749
|
-
return n.length =
|
|
14753
|
+
return n.length = zi(
|
|
14750
14754
|
this.flatCoordinates,
|
|
14751
14755
|
0,
|
|
14752
14756
|
this.flatCoordinates.length,
|
|
@@ -14848,7 +14852,7 @@ class qn extends Kn {
|
|
|
14848
14852
|
* @override
|
|
14849
14853
|
*/
|
|
14850
14854
|
computeExtent(l) {
|
|
14851
|
-
return
|
|
14855
|
+
return Je(this.flatCoordinates, l);
|
|
14852
14856
|
}
|
|
14853
14857
|
/**
|
|
14854
14858
|
* Get the type of this geometry.
|
|
@@ -14876,7 +14880,7 @@ class qn extends Kn {
|
|
|
14876
14880
|
* @override
|
|
14877
14881
|
*/
|
|
14878
14882
|
setCoordinates(l, n) {
|
|
14879
|
-
this.setLayout(n, l, 0), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length =
|
|
14883
|
+
this.setLayout(n, l, 0), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = ji(
|
|
14880
14884
|
this.flatCoordinates,
|
|
14881
14885
|
0,
|
|
14882
14886
|
l,
|
|
@@ -14884,8 +14888,8 @@ class qn extends Kn {
|
|
|
14884
14888
|
), this.changed();
|
|
14885
14889
|
}
|
|
14886
14890
|
}
|
|
14887
|
-
function
|
|
14888
|
-
return !
|
|
14891
|
+
function Hi(t, l, n, e, o) {
|
|
14892
|
+
return !eo(
|
|
14889
14893
|
o,
|
|
14890
14894
|
/**
|
|
14891
14895
|
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
|
@@ -14919,23 +14923,23 @@ function Re(t, l, n, e, o, i) {
|
|
|
14919
14923
|
return !1;
|
|
14920
14924
|
return !0;
|
|
14921
14925
|
}
|
|
14922
|
-
function
|
|
14926
|
+
function Ui(t, l, n, e, o, i, r) {
|
|
14923
14927
|
let a, u, s, c, m, g, h;
|
|
14924
14928
|
const d = o[i + 1], f = [];
|
|
14925
|
-
for (let p = 0,
|
|
14926
|
-
const
|
|
14927
|
-
for (c = t[
|
|
14929
|
+
for (let p = 0, y = n.length; p < y; ++p) {
|
|
14930
|
+
const R = n[p];
|
|
14931
|
+
for (c = t[R - e], g = t[R - e + 1], a = l; a < R; a += e)
|
|
14928
14932
|
m = t[a], h = t[a + 1], (d <= g && h <= d || g <= d && d <= h) && (s = (d - g) / (h - g) * (m - c) + c, f.push(s)), c = m, g = h;
|
|
14929
14933
|
}
|
|
14930
14934
|
let b = NaN, x = -1 / 0;
|
|
14931
|
-
for (f.sort(
|
|
14935
|
+
for (f.sort(Jo), c = f[0], a = 1, u = f.length; a < u; ++a) {
|
|
14932
14936
|
m = f[a];
|
|
14933
14937
|
const p = Math.abs(m - c);
|
|
14934
14938
|
p > x && (s = (c + m) / 2, Re(t, l, n, e, s, d) && (b = s, x = p)), c = m;
|
|
14935
14939
|
}
|
|
14936
14940
|
return isNaN(b) && (b = o[i]), [b, d, x];
|
|
14937
14941
|
}
|
|
14938
|
-
function
|
|
14942
|
+
function Bi(t, l, n, e, o) {
|
|
14939
14943
|
let i;
|
|
14940
14944
|
for (l += e; l < n; l += e)
|
|
14941
14945
|
if (i = o(
|
|
@@ -14946,7 +14950,7 @@ function $i(t, l, n, e, o) {
|
|
|
14946
14950
|
return !1;
|
|
14947
14951
|
}
|
|
14948
14952
|
function ye(t, l, n, e, o, i) {
|
|
14949
|
-
return i = i ?? Bt(Dl(), t, l, n, e), Ol(o, i) ? i[0] >= o[0] && i[2] <= o[2] || i[1] >= o[1] && i[3] <= o[3] ? !0 :
|
|
14953
|
+
return i = i ?? Bt(Dl(), t, l, n, e), Ol(o, i) ? i[0] >= o[0] && i[2] <= o[2] || i[1] >= o[1] && i[3] <= o[3] ? !0 : Bi(
|
|
14950
14954
|
t,
|
|
14951
14955
|
l,
|
|
14952
14956
|
n,
|
|
@@ -14958,11 +14962,11 @@ function ye(t, l, n, e, o, i) {
|
|
|
14958
14962
|
* `false` otherwise.
|
|
14959
14963
|
*/
|
|
14960
14964
|
function(r, a) {
|
|
14961
|
-
return
|
|
14965
|
+
return ao(o, r, a);
|
|
14962
14966
|
}
|
|
14963
14967
|
) : !1;
|
|
14964
14968
|
}
|
|
14965
|
-
function
|
|
14969
|
+
function $i(t, l, n, e, o) {
|
|
14966
14970
|
return !!(ye(t, l, n, e, o) || xl(
|
|
14967
14971
|
t,
|
|
14968
14972
|
l,
|
|
@@ -14993,13 +14997,13 @@ function Yi(t, l, n, e, o) {
|
|
|
14993
14997
|
o[3]
|
|
14994
14998
|
));
|
|
14995
14999
|
}
|
|
14996
|
-
function
|
|
14997
|
-
if (
|
|
15000
|
+
function Yi(t, l, n, e, o) {
|
|
15001
|
+
if (!$i(t, l, n[0], e, o))
|
|
14998
15002
|
return !1;
|
|
14999
15003
|
if (n.length === 1)
|
|
15000
15004
|
return !0;
|
|
15001
15005
|
for (let i = 1, r = n.length; i < r; ++i)
|
|
15002
|
-
if (
|
|
15006
|
+
if (Hi(
|
|
15003
15007
|
t,
|
|
15004
15008
|
n[i - 1],
|
|
15005
15009
|
n[i],
|
|
@@ -15015,7 +15019,7 @@ function Ki(t, l, n, e, o) {
|
|
|
15015
15019
|
return !1;
|
|
15016
15020
|
return !0;
|
|
15017
15021
|
}
|
|
15018
|
-
function
|
|
15022
|
+
function Ki(t, l, n, e) {
|
|
15019
15023
|
for (; l < n - e; ) {
|
|
15020
15024
|
for (let o = 0; o < e; ++o) {
|
|
15021
15025
|
const i = t[l + o];
|
|
@@ -15032,7 +15036,7 @@ function _e(t, l, n, e) {
|
|
|
15032
15036
|
}
|
|
15033
15037
|
return o === 0 ? void 0 : o > 0;
|
|
15034
15038
|
}
|
|
15035
|
-
function
|
|
15039
|
+
function qi(t, l, n, e, o) {
|
|
15036
15040
|
o = o !== void 0 ? o : !1;
|
|
15037
15041
|
for (let i = 0, r = n.length; i < r; ++i) {
|
|
15038
15042
|
const a = n[i], u = _e(
|
|
@@ -15059,7 +15063,7 @@ function Nt(t, l, n, e, o) {
|
|
|
15059
15063
|
a,
|
|
15060
15064
|
e
|
|
15061
15065
|
);
|
|
15062
|
-
(i === 0 ? o && u || !o && !u : o && !u || !o && u) &&
|
|
15066
|
+
(i === 0 ? o && u || !o && !u : o && !u || !o && u) && Ki(t, l, a, e), l = a;
|
|
15063
15067
|
}
|
|
15064
15068
|
return l;
|
|
15065
15069
|
}
|
|
@@ -15092,7 +15096,7 @@ class sn extends Kn {
|
|
|
15092
15096
|
* @api
|
|
15093
15097
|
*/
|
|
15094
15098
|
appendLinearRing(l) {
|
|
15095
|
-
this.flatCoordinates ?
|
|
15099
|
+
this.flatCoordinates ? Qo(this.flatCoordinates, l.getFlatCoordinates()) : this.flatCoordinates = l.getFlatCoordinates().slice(), this.ends_.push(this.flatCoordinates.length), this.changed();
|
|
15096
15100
|
}
|
|
15097
15101
|
/**
|
|
15098
15102
|
* Make a complete copy of the geometry.
|
|
@@ -15118,14 +15122,14 @@ class sn extends Kn {
|
|
|
15118
15122
|
*/
|
|
15119
15123
|
closestPointXY(l, n, e, o) {
|
|
15120
15124
|
return o < Zt(this.getExtent(), l, n) ? o : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
15121
|
-
|
|
15125
|
+
Fi(
|
|
15122
15126
|
this.flatCoordinates,
|
|
15123
15127
|
0,
|
|
15124
15128
|
this.ends_,
|
|
15125
15129
|
this.stride,
|
|
15126
15130
|
0
|
|
15127
15131
|
)
|
|
15128
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
15132
|
+
), this.maxDeltaRevision_ = this.getRevision()), ki(
|
|
15129
15133
|
this.flatCoordinates,
|
|
15130
15134
|
0,
|
|
15131
15135
|
this.ends_,
|
|
@@ -15160,7 +15164,7 @@ class sn extends Kn {
|
|
|
15160
15164
|
* @api
|
|
15161
15165
|
*/
|
|
15162
15166
|
getArea() {
|
|
15163
|
-
return
|
|
15167
|
+
return Li(
|
|
15164
15168
|
this.getOrientedFlatCoordinates(),
|
|
15165
15169
|
0,
|
|
15166
15170
|
this.ends_,
|
|
@@ -15183,7 +15187,7 @@ class sn extends Kn {
|
|
|
15183
15187
|
*/
|
|
15184
15188
|
getCoordinates(l) {
|
|
15185
15189
|
let n;
|
|
15186
|
-
return l !== void 0 ? (n = this.getOrientedFlatCoordinates().slice(), Nt(n, 0, this.ends_, this.stride, l)) : n = this.flatCoordinates,
|
|
15190
|
+
return l !== void 0 ? (n = this.getOrientedFlatCoordinates().slice(), Nt(n, 0, this.ends_, this.stride, l)) : n = this.flatCoordinates, Wi(n, 0, this.ends_, this.stride);
|
|
15187
15191
|
}
|
|
15188
15192
|
/**
|
|
15189
15193
|
* @return {Array<number>} Ends.
|
|
@@ -15197,7 +15201,7 @@ class sn extends Kn {
|
|
|
15197
15201
|
getFlatInteriorPoint() {
|
|
15198
15202
|
if (this.flatInteriorPointRevision_ != this.getRevision()) {
|
|
15199
15203
|
const l = Vl(this.getExtent());
|
|
15200
|
-
this.flatInteriorPoint_ =
|
|
15204
|
+
this.flatInteriorPoint_ = Ui(
|
|
15201
15205
|
this.getOrientedFlatCoordinates(),
|
|
15202
15206
|
0,
|
|
15203
15207
|
this.ends_,
|
|
@@ -15272,7 +15276,7 @@ class sn extends Kn {
|
|
|
15272
15276
|
getOrientedFlatCoordinates() {
|
|
15273
15277
|
if (this.orientedRevision_ != this.getRevision()) {
|
|
15274
15278
|
const l = this.flatCoordinates;
|
|
15275
|
-
|
|
15279
|
+
qi(l, 0, this.ends_, this.stride) ? this.orientedFlatCoordinates_ = l : (this.orientedFlatCoordinates_ = l.slice(), this.orientedFlatCoordinates_.length = Nt(
|
|
15276
15280
|
this.orientedFlatCoordinates_,
|
|
15277
15281
|
0,
|
|
15278
15282
|
this.ends_,
|
|
@@ -15292,7 +15296,7 @@ class sn extends Kn {
|
|
|
15292
15296
|
*/
|
|
15293
15297
|
getSimplifiedGeometryInternal(l) {
|
|
15294
15298
|
const n = [], e = [];
|
|
15295
|
-
return n.length =
|
|
15299
|
+
return n.length = Zi(
|
|
15296
15300
|
this.flatCoordinates,
|
|
15297
15301
|
0,
|
|
15298
15302
|
this.ends_,
|
|
@@ -15320,7 +15324,7 @@ class sn extends Kn {
|
|
|
15320
15324
|
* @override
|
|
15321
15325
|
*/
|
|
15322
15326
|
intersectsExtent(l) {
|
|
15323
|
-
return
|
|
15327
|
+
return Yi(
|
|
15324
15328
|
this.getOrientedFlatCoordinates(),
|
|
15325
15329
|
0,
|
|
15326
15330
|
this.ends_,
|
|
@@ -15337,7 +15341,7 @@ class sn extends Kn {
|
|
|
15337
15341
|
*/
|
|
15338
15342
|
setCoordinates(l, n) {
|
|
15339
15343
|
this.setLayout(n, l, 2), this.flatCoordinates || (this.flatCoordinates = []);
|
|
15340
|
-
const e =
|
|
15344
|
+
const e = Gi(
|
|
15341
15345
|
this.flatCoordinates,
|
|
15342
15346
|
0,
|
|
15343
15347
|
l,
|
|
@@ -15373,7 +15377,7 @@ function Qn(t, l, n) {
|
|
|
15373
15377
|
const o = 50;
|
|
15374
15378
|
return e *= Math.log(1 + o * Math.max(0, t / l - 1)) / o + 1, n && (e = Math.max(e, n), e /= Math.log(1 + o * Math.max(0, n / t - 1)) / o + 1), $(e, n / 2, l * 2);
|
|
15375
15379
|
}
|
|
15376
|
-
function
|
|
15380
|
+
function Ji(t, l, n, e) {
|
|
15377
15381
|
return l = l !== void 0 ? l : !0, /**
|
|
15378
15382
|
* @param {number|undefined} resolution Resolution.
|
|
15379
15383
|
* @param {number} direction Direction.
|
|
@@ -15400,7 +15404,7 @@ function Qi(t, l, n, e) {
|
|
|
15400
15404
|
}
|
|
15401
15405
|
};
|
|
15402
15406
|
}
|
|
15403
|
-
function
|
|
15407
|
+
function Qi(t, l, n, e, o, i) {
|
|
15404
15408
|
return e = e !== void 0 ? e : !0, n = n !== void 0 ? n : 0, /**
|
|
15405
15409
|
* @param {number|undefined} resolution Resolution.
|
|
15406
15410
|
* @param {number} direction Direction.
|
|
@@ -15455,7 +15459,7 @@ function Pt(t, l, n, e, o) {
|
|
|
15455
15459
|
}
|
|
15456
15460
|
};
|
|
15457
15461
|
}
|
|
15458
|
-
function
|
|
15462
|
+
function lr(t) {
|
|
15459
15463
|
if (t !== void 0)
|
|
15460
15464
|
return 0;
|
|
15461
15465
|
}
|
|
@@ -15463,7 +15467,7 @@ function Dt(t) {
|
|
|
15463
15467
|
if (t !== void 0)
|
|
15464
15468
|
return t;
|
|
15465
15469
|
}
|
|
15466
|
-
function
|
|
15470
|
+
function nr(t) {
|
|
15467
15471
|
const l = 2 * Math.PI / t;
|
|
15468
15472
|
return (
|
|
15469
15473
|
/**
|
|
@@ -15479,7 +15483,7 @@ function tr(t) {
|
|
|
15479
15483
|
}
|
|
15480
15484
|
);
|
|
15481
15485
|
}
|
|
15482
|
-
function
|
|
15486
|
+
function tr(t) {
|
|
15483
15487
|
const l = gl(5);
|
|
15484
15488
|
return (
|
|
15485
15489
|
/**
|
|
@@ -15492,7 +15496,7 @@ function er(t) {
|
|
|
15492
15496
|
}
|
|
15493
15497
|
);
|
|
15494
15498
|
}
|
|
15495
|
-
const
|
|
15499
|
+
const er = 256, En = 0;
|
|
15496
15500
|
class Ot extends hn {
|
|
15497
15501
|
/**
|
|
15498
15502
|
* @param {ViewOptions} [options] View options.
|
|
@@ -15509,9 +15513,9 @@ class Ot extends hn {
|
|
|
15509
15513
|
for (const a in ll)
|
|
15510
15514
|
delete n[a];
|
|
15511
15515
|
this.setProperties(n, !0);
|
|
15512
|
-
const e =
|
|
15516
|
+
const e = ir(l);
|
|
15513
15517
|
this.maxResolution_ = e.maxResolution, this.minResolution_ = e.minResolution, this.zoomFactor_ = e.zoomFactor, this.resolutions_ = l.resolutions, this.padding_ = l.padding, this.minZoom_ = e.minZoom;
|
|
15514
|
-
const o =
|
|
15518
|
+
const o = or(l), i = e.constraint, r = rr(l);
|
|
15515
15519
|
this.constraints_ = {
|
|
15516
15520
|
center: o,
|
|
15517
15521
|
resolution: i,
|
|
@@ -15629,7 +15633,7 @@ class Ot extends hn {
|
|
|
15629
15633
|
complete: !1,
|
|
15630
15634
|
anchor: c.anchor,
|
|
15631
15635
|
duration: c.duration !== void 0 ? c.duration : 1e3,
|
|
15632
|
-
easing: c.easing ||
|
|
15636
|
+
easing: c.easing || Ti,
|
|
15633
15637
|
callback: e
|
|
15634
15638
|
};
|
|
15635
15639
|
if (c.center && (m.sourceCenter = r, m.targetCenter = c.center.slice(), r = m.targetCenter), c.zoom !== void 0 ? (m.sourceResolution = a, m.targetResolution = this.getResolutionForZoom(c.zoom), a = m.targetResolution) : c.resolution && (m.sourceResolution = a, m.targetResolution = c.resolution, a = m.targetResolution), c.rotation !== void 0) {
|
|
@@ -15637,7 +15641,7 @@ class Ot extends hn {
|
|
|
15637
15641
|
const g = wl(c.rotation - u + Math.PI, 2 * Math.PI) - Math.PI;
|
|
15638
15642
|
m.targetRotation = u + g, u = m.targetRotation;
|
|
15639
15643
|
}
|
|
15640
|
-
|
|
15644
|
+
ar(m) ? m.complete = !0 : i += m.duration, s.push(m);
|
|
15641
15645
|
}
|
|
15642
15646
|
this.animations_.push(s), this.setHint(ol.ANIMATING, 1), this.updateAnimations_();
|
|
15643
15647
|
}
|
|
@@ -15753,7 +15757,7 @@ class Ot extends hn {
|
|
|
15753
15757
|
calculateCenterRotate(l, n) {
|
|
15754
15758
|
let e;
|
|
15755
15759
|
const o = this.getCenterInternal();
|
|
15756
|
-
return o !== void 0 && (e = [o[0] - n[0], o[1] - n[1]],
|
|
15760
|
+
return o !== void 0 && (e = [o[0] - n[0], o[1] - n[1]], bo(e, l - this.getRotation()), mo(e, n)), e;
|
|
15757
15761
|
}
|
|
15758
15762
|
/**
|
|
15759
15763
|
* @param {number} resolution Target resolution.
|
|
@@ -15847,7 +15851,7 @@ class Ot extends hn {
|
|
|
15847
15851
|
*/
|
|
15848
15852
|
calculateExtent(l) {
|
|
15849
15853
|
const n = this.calculateExtentInternal(l);
|
|
15850
|
-
return
|
|
15854
|
+
return Zo(n, this.getProjection());
|
|
15851
15855
|
}
|
|
15852
15856
|
/**
|
|
15853
15857
|
* @param {import("./size.js").Size} [size] Box pixel size. If not provided,
|
|
@@ -16476,7 +16480,7 @@ class Ot extends hn {
|
|
|
16476
16480
|
center: u,
|
|
16477
16481
|
resolution: a,
|
|
16478
16482
|
duration: l,
|
|
16479
|
-
easing:
|
|
16483
|
+
easing: Ai,
|
|
16480
16484
|
anchor: e
|
|
16481
16485
|
}));
|
|
16482
16486
|
}
|
|
@@ -16560,7 +16564,7 @@ function Ql(t, l) {
|
|
|
16560
16564
|
t(l);
|
|
16561
16565
|
}, 0);
|
|
16562
16566
|
}
|
|
16563
|
-
function
|
|
16567
|
+
function or(t) {
|
|
16564
16568
|
if (t.extent !== void 0) {
|
|
16565
16569
|
const n = t.smoothExtentConstraint !== void 0 ? t.smoothExtentConstraint : !0;
|
|
16566
16570
|
return At(t.extent, t.constrainOnlyCenter, n);
|
|
@@ -16570,15 +16574,15 @@ function ir(t) {
|
|
|
16570
16574
|
const n = l.getExtent().slice();
|
|
16571
16575
|
return n[0] = -1 / 0, n[2] = 1 / 0, At(n, !1, !1);
|
|
16572
16576
|
}
|
|
16573
|
-
return
|
|
16577
|
+
return Ci;
|
|
16574
16578
|
}
|
|
16575
|
-
function
|
|
16579
|
+
function ir(t) {
|
|
16576
16580
|
let l, n, e, r = t.minZoom !== void 0 ? t.minZoom : En, a = t.maxZoom !== void 0 ? t.maxZoom : 28;
|
|
16577
16581
|
const u = t.zoomFactor !== void 0 ? t.zoomFactor : 2, s = t.multiWorld !== void 0 ? t.multiWorld : !1, c = t.smoothResolutionConstraint !== void 0 ? t.smoothResolutionConstraint : !0, m = t.showFullExtent !== void 0 ? t.showFullExtent : !1, g = Bn(t.projection, "EPSG:3857"), h = g.getExtent();
|
|
16578
16582
|
let d = t.constrainOnlyCenter, f = t.extent;
|
|
16579
16583
|
if (!s && !f && g.isGlobal() && (d = !1, f = h), t.resolutions !== void 0) {
|
|
16580
16584
|
const b = t.resolutions;
|
|
16581
|
-
n = b[r], e = b[a] !== void 0 ? b[a] : b[b.length - 1], t.constrainResolution ? l =
|
|
16585
|
+
n = b[r], e = b[a] !== void 0 ? b[a] : b[b.length - 1], t.constrainResolution ? l = Ji(
|
|
16582
16586
|
b,
|
|
16583
16587
|
c,
|
|
16584
16588
|
!d && f,
|
|
@@ -16594,10 +16598,10 @@ function rr(t) {
|
|
|
16594
16598
|
const x = (h ? Math.max(D(h), H(h)) : (
|
|
16595
16599
|
// use an extent that can fit the whole world if need be
|
|
16596
16600
|
360 * qt.degrees / g.getMetersPerUnit()
|
|
16597
|
-
)) /
|
|
16601
|
+
)) / er / Math.pow(2, En), p = x / Math.pow(2, 28 - En);
|
|
16598
16602
|
n = t.maxResolution, n !== void 0 ? r = 0 : n = x / Math.pow(u, r), e = t.minResolution, e === void 0 && (t.maxZoom !== void 0 ? t.maxResolution !== void 0 ? e = n / Math.pow(u, a) : e = x / Math.pow(u, a) : e = p), a = r + Math.floor(
|
|
16599
16603
|
Math.log(n / e) / Math.log(u)
|
|
16600
|
-
), e = n / Math.pow(u, a - r), t.constrainResolution ? l =
|
|
16604
|
+
), e = n / Math.pow(u, a - r), t.constrainResolution ? l = Qi(
|
|
16601
16605
|
u,
|
|
16602
16606
|
n,
|
|
16603
16607
|
e,
|
|
@@ -16620,14 +16624,14 @@ function rr(t) {
|
|
|
16620
16624
|
zoomFactor: u
|
|
16621
16625
|
};
|
|
16622
16626
|
}
|
|
16623
|
-
function
|
|
16627
|
+
function rr(t) {
|
|
16624
16628
|
if (t.enableRotation !== void 0 ? t.enableRotation : !0) {
|
|
16625
16629
|
const n = t.constrainRotation;
|
|
16626
|
-
return n === void 0 || n === !0 ?
|
|
16630
|
+
return n === void 0 || n === !0 ? tr() : n === !1 ? Dt : typeof n == "number" ? nr(n) : Dt;
|
|
16627
16631
|
}
|
|
16628
|
-
return
|
|
16632
|
+
return lr;
|
|
16629
16633
|
}
|
|
16630
|
-
function
|
|
16634
|
+
function ar(t) {
|
|
16631
16635
|
return !(t.sourceCenter && t.targetCenter && !en(t.sourceCenter, t.targetCenter) || t.sourceResolution !== t.targetResolution || t.sourceRotation !== t.targetRotation);
|
|
16632
16636
|
}
|
|
16633
16637
|
function Cn(t, l, n, e, o) {
|
|
@@ -16637,7 +16641,7 @@ function Cn(t, l, n, e, o) {
|
|
|
16637
16641
|
const s = a * i - u * r, c = u * i + a * r;
|
|
16638
16642
|
return [s, c];
|
|
16639
16643
|
}
|
|
16640
|
-
const
|
|
16644
|
+
const T = {
|
|
16641
16645
|
OPACITY: "opacity",
|
|
16642
16646
|
VISIBLE: "visible",
|
|
16643
16647
|
EXTENT: "extent",
|
|
@@ -16649,17 +16653,17 @@ const A = {
|
|
|
16649
16653
|
SOURCE: "source",
|
|
16650
16654
|
MAP: "map"
|
|
16651
16655
|
};
|
|
16652
|
-
class
|
|
16656
|
+
class ur extends hn {
|
|
16653
16657
|
/**
|
|
16654
16658
|
* @param {Options<NoInfer<Properties>>} options Layer options.
|
|
16655
16659
|
*/
|
|
16656
16660
|
constructor(l) {
|
|
16657
16661
|
super(), this.on, this.once, this.un, this.background_ = l.background;
|
|
16658
16662
|
const n = Object.assign({}, l);
|
|
16659
|
-
typeof l.properties == "object" && (delete n.properties, Object.assign(n, l.properties)), n[
|
|
16660
|
-
typeof n[
|
|
16663
|
+
typeof l.properties == "object" && (delete n.properties, Object.assign(n, l.properties)), n[T.OPACITY] = l.opacity !== void 0 ? l.opacity : 1, rl(
|
|
16664
|
+
typeof n[T.OPACITY] == "number",
|
|
16661
16665
|
"Layer opacity must be a number"
|
|
16662
|
-
), n[
|
|
16666
|
+
), n[T.VISIBLE] = l.visible !== void 0 ? l.visible : !0, n[T.Z_INDEX] = l.zIndex, n[T.MAX_RESOLUTION] = l.maxResolution !== void 0 ? l.maxResolution : 1 / 0, n[T.MIN_RESOLUTION] = l.minResolution !== void 0 ? l.minResolution : 0, n[T.MIN_ZOOM] = l.minZoom !== void 0 ? l.minZoom : -1 / 0, n[T.MAX_ZOOM] = l.maxZoom !== void 0 ? l.maxZoom : 1 / 0, this.className_ = n.className !== void 0 ? n.className : "ol-layer", delete n.className, this.setProperties(n), this.state_ = null;
|
|
16663
16667
|
}
|
|
16664
16668
|
/**
|
|
16665
16669
|
* Get the background for this layer.
|
|
@@ -16717,7 +16721,7 @@ class sr extends hn {
|
|
|
16717
16721
|
getExtent() {
|
|
16718
16722
|
return (
|
|
16719
16723
|
/** @type {import("../extent.js").Extent|undefined} */
|
|
16720
|
-
this.get(
|
|
16724
|
+
this.get(T.EXTENT)
|
|
16721
16725
|
);
|
|
16722
16726
|
}
|
|
16723
16727
|
/**
|
|
@@ -16730,7 +16734,7 @@ class sr extends hn {
|
|
|
16730
16734
|
getMaxResolution() {
|
|
16731
16735
|
return (
|
|
16732
16736
|
/** @type {number} */
|
|
16733
|
-
this.get(
|
|
16737
|
+
this.get(T.MAX_RESOLUTION)
|
|
16734
16738
|
);
|
|
16735
16739
|
}
|
|
16736
16740
|
/**
|
|
@@ -16743,7 +16747,7 @@ class sr extends hn {
|
|
|
16743
16747
|
getMinResolution() {
|
|
16744
16748
|
return (
|
|
16745
16749
|
/** @type {number} */
|
|
16746
|
-
this.get(
|
|
16750
|
+
this.get(T.MIN_RESOLUTION)
|
|
16747
16751
|
);
|
|
16748
16752
|
}
|
|
16749
16753
|
/**
|
|
@@ -16756,7 +16760,7 @@ class sr extends hn {
|
|
|
16756
16760
|
getMinZoom() {
|
|
16757
16761
|
return (
|
|
16758
16762
|
/** @type {number} */
|
|
16759
|
-
this.get(
|
|
16763
|
+
this.get(T.MIN_ZOOM)
|
|
16760
16764
|
);
|
|
16761
16765
|
}
|
|
16762
16766
|
/**
|
|
@@ -16769,7 +16773,7 @@ class sr extends hn {
|
|
|
16769
16773
|
getMaxZoom() {
|
|
16770
16774
|
return (
|
|
16771
16775
|
/** @type {number} */
|
|
16772
|
-
this.get(
|
|
16776
|
+
this.get(T.MAX_ZOOM)
|
|
16773
16777
|
);
|
|
16774
16778
|
}
|
|
16775
16779
|
/**
|
|
@@ -16781,7 +16785,7 @@ class sr extends hn {
|
|
|
16781
16785
|
getOpacity() {
|
|
16782
16786
|
return (
|
|
16783
16787
|
/** @type {number} */
|
|
16784
|
-
this.get(
|
|
16788
|
+
this.get(T.OPACITY)
|
|
16785
16789
|
);
|
|
16786
16790
|
}
|
|
16787
16791
|
/**
|
|
@@ -16801,7 +16805,7 @@ class sr extends hn {
|
|
|
16801
16805
|
getVisible() {
|
|
16802
16806
|
return (
|
|
16803
16807
|
/** @type {boolean} */
|
|
16804
|
-
this.get(
|
|
16808
|
+
this.get(T.VISIBLE)
|
|
16805
16809
|
);
|
|
16806
16810
|
}
|
|
16807
16811
|
/**
|
|
@@ -16814,7 +16818,7 @@ class sr extends hn {
|
|
|
16814
16818
|
getZIndex() {
|
|
16815
16819
|
return (
|
|
16816
16820
|
/** @type {number|undefined} */
|
|
16817
|
-
this.get(
|
|
16821
|
+
this.get(T.Z_INDEX)
|
|
16818
16822
|
);
|
|
16819
16823
|
}
|
|
16820
16824
|
/**
|
|
@@ -16832,7 +16836,7 @@ class sr extends hn {
|
|
|
16832
16836
|
* @api
|
|
16833
16837
|
*/
|
|
16834
16838
|
setExtent(l) {
|
|
16835
|
-
this.set(
|
|
16839
|
+
this.set(T.EXTENT, l);
|
|
16836
16840
|
}
|
|
16837
16841
|
/**
|
|
16838
16842
|
* Set the maximum resolution at which the layer is visible.
|
|
@@ -16841,7 +16845,7 @@ class sr extends hn {
|
|
|
16841
16845
|
* @api
|
|
16842
16846
|
*/
|
|
16843
16847
|
setMaxResolution(l) {
|
|
16844
|
-
this.set(
|
|
16848
|
+
this.set(T.MAX_RESOLUTION, l);
|
|
16845
16849
|
}
|
|
16846
16850
|
/**
|
|
16847
16851
|
* Set the minimum resolution at which the layer is visible.
|
|
@@ -16850,7 +16854,7 @@ class sr extends hn {
|
|
|
16850
16854
|
* @api
|
|
16851
16855
|
*/
|
|
16852
16856
|
setMinResolution(l) {
|
|
16853
|
-
this.set(
|
|
16857
|
+
this.set(T.MIN_RESOLUTION, l);
|
|
16854
16858
|
}
|
|
16855
16859
|
/**
|
|
16856
16860
|
* Set the maximum zoom (exclusive) at which the layer is visible.
|
|
@@ -16861,7 +16865,7 @@ class sr extends hn {
|
|
|
16861
16865
|
* @api
|
|
16862
16866
|
*/
|
|
16863
16867
|
setMaxZoom(l) {
|
|
16864
|
-
this.set(
|
|
16868
|
+
this.set(T.MAX_ZOOM, l);
|
|
16865
16869
|
}
|
|
16866
16870
|
/**
|
|
16867
16871
|
* Set the minimum zoom (inclusive) at which the layer is visible.
|
|
@@ -16872,7 +16876,7 @@ class sr extends hn {
|
|
|
16872
16876
|
* @api
|
|
16873
16877
|
*/
|
|
16874
16878
|
setMinZoom(l) {
|
|
16875
|
-
this.set(
|
|
16879
|
+
this.set(T.MIN_ZOOM, l);
|
|
16876
16880
|
}
|
|
16877
16881
|
/**
|
|
16878
16882
|
* Set the opacity of the layer, allowed values range from 0 to 1.
|
|
@@ -16881,7 +16885,7 @@ class sr extends hn {
|
|
|
16881
16885
|
* @api
|
|
16882
16886
|
*/
|
|
16883
16887
|
setOpacity(l) {
|
|
16884
|
-
rl(typeof l == "number", "Layer opacity must be a number"), this.set(
|
|
16888
|
+
rl(typeof l == "number", "Layer opacity must be a number"), this.set(T.OPACITY, l);
|
|
16885
16889
|
}
|
|
16886
16890
|
/**
|
|
16887
16891
|
* Set the visibility of the layer (`true` or `false`).
|
|
@@ -16890,7 +16894,7 @@ class sr extends hn {
|
|
|
16890
16894
|
* @api
|
|
16891
16895
|
*/
|
|
16892
16896
|
setVisible(l) {
|
|
16893
|
-
this.set(
|
|
16897
|
+
this.set(T.VISIBLE, l);
|
|
16894
16898
|
}
|
|
16895
16899
|
/**
|
|
16896
16900
|
* Set Z-index of the layer, which is used to order layers before rendering.
|
|
@@ -16900,7 +16904,7 @@ class sr extends hn {
|
|
|
16900
16904
|
* @api
|
|
16901
16905
|
*/
|
|
16902
16906
|
setZIndex(l) {
|
|
16903
|
-
this.set(
|
|
16907
|
+
this.set(T.Z_INDEX, l);
|
|
16904
16908
|
}
|
|
16905
16909
|
/**
|
|
16906
16910
|
* Clean up.
|
|
@@ -16910,14 +16914,14 @@ class sr extends hn {
|
|
|
16910
16914
|
this.state_ && (this.state_.layer = null, this.state_ = null), super.disposeInternal();
|
|
16911
16915
|
}
|
|
16912
16916
|
}
|
|
16913
|
-
class
|
|
16917
|
+
class sr extends ur {
|
|
16914
16918
|
/**
|
|
16915
16919
|
* @param {Options<SourceType, NoInfer<Properties>>} options Layer options.
|
|
16916
16920
|
*/
|
|
16917
16921
|
constructor(l) {
|
|
16918
16922
|
const n = Object.assign({}, l);
|
|
16919
16923
|
delete n.source, super(n), this.on, this.once, this.un, this.mapPrecomposeKey_ = null, this.mapRenderKey_ = null, this.sourceChangeKey_ = null, this.renderer_ = null, this.sourceReady_ = !1, this.rendered = !1, l.render && (this.render = l.render), l.map && this.setMap(l.map), this.addChangeListener(
|
|
16920
|
-
|
|
16924
|
+
T.SOURCE,
|
|
16921
16925
|
this.handleSourcePropertyChange_
|
|
16922
16926
|
);
|
|
16923
16927
|
const e = l.source ? (
|
|
@@ -16951,7 +16955,7 @@ class cr extends sr {
|
|
|
16951
16955
|
getSource() {
|
|
16952
16956
|
return (
|
|
16953
16957
|
/** @type {SourceType} */
|
|
16954
|
-
this.get(
|
|
16958
|
+
this.get(T.SOURCE) || null
|
|
16955
16959
|
);
|
|
16956
16960
|
}
|
|
16957
16961
|
/**
|
|
@@ -17029,7 +17033,7 @@ class cr extends sr {
|
|
|
17029
17033
|
} else
|
|
17030
17034
|
o = this.getLayerState();
|
|
17031
17035
|
const i = this.getExtent();
|
|
17032
|
-
return
|
|
17036
|
+
return cr(o, n.viewState) && (!i || Ol(i, n.extent));
|
|
17033
17037
|
}
|
|
17034
17038
|
/**
|
|
17035
17039
|
* Get the attributions of the source of this layer for the given view.
|
|
@@ -17089,14 +17093,14 @@ class cr extends sr {
|
|
|
17089
17093
|
* @param {import("../Map.js").default|null} map Map.
|
|
17090
17094
|
*/
|
|
17091
17095
|
setMapInternal(l) {
|
|
17092
|
-
l || this.unrender(), this.set(
|
|
17096
|
+
l || this.unrender(), this.set(T.MAP, l);
|
|
17093
17097
|
}
|
|
17094
17098
|
/**
|
|
17095
17099
|
* For use inside the library only.
|
|
17096
17100
|
* @return {import("../Map.js").default|null} Map.
|
|
17097
17101
|
*/
|
|
17098
17102
|
getMapInternal() {
|
|
17099
|
-
return this.get(
|
|
17103
|
+
return this.get(T.MAP);
|
|
17100
17104
|
}
|
|
17101
17105
|
/**
|
|
17102
17106
|
* Sets the layer to be rendered on top of other layers on a map. The map will
|
|
@@ -17140,7 +17144,7 @@ class cr extends sr {
|
|
|
17140
17144
|
* @api
|
|
17141
17145
|
*/
|
|
17142
17146
|
setSource(l) {
|
|
17143
|
-
this.set(
|
|
17147
|
+
this.set(T.SOURCE, l);
|
|
17144
17148
|
}
|
|
17145
17149
|
/**
|
|
17146
17150
|
* Get the renderer for this layer.
|
|
@@ -17177,7 +17181,7 @@ class cr extends sr {
|
|
|
17177
17181
|
this.clearRenderer(), this.setSource(null), super.disposeInternal();
|
|
17178
17182
|
}
|
|
17179
17183
|
}
|
|
17180
|
-
function
|
|
17184
|
+
function cr(t, l) {
|
|
17181
17185
|
if (!t.visible)
|
|
17182
17186
|
return !1;
|
|
17183
17187
|
const n = l.resolution;
|
|
@@ -17186,7 +17190,7 @@ function mr(t, l) {
|
|
|
17186
17190
|
const e = l.zoom;
|
|
17187
17191
|
return e > t.minZoom && e <= t.maxZoom;
|
|
17188
17192
|
}
|
|
17189
|
-
class
|
|
17193
|
+
class mr extends sr {
|
|
17190
17194
|
/**
|
|
17191
17195
|
* @param {Options<ImageSourceType>} [options] Layer options.
|
|
17192
17196
|
*/
|
|
@@ -17194,7 +17198,7 @@ class br extends cr {
|
|
|
17194
17198
|
l = l || {}, super(l);
|
|
17195
17199
|
}
|
|
17196
17200
|
}
|
|
17197
|
-
class
|
|
17201
|
+
class br extends mr {
|
|
17198
17202
|
/**
|
|
17199
17203
|
* @param {import("./BaseImage.js").Options<ImageSourceType>} [options] Layer options.
|
|
17200
17204
|
*/
|
|
@@ -17205,7 +17209,7 @@ class gr extends br {
|
|
|
17205
17209
|
* @override
|
|
17206
17210
|
*/
|
|
17207
17211
|
createRenderer() {
|
|
17208
|
-
return new
|
|
17212
|
+
return new vi(this);
|
|
17209
17213
|
}
|
|
17210
17214
|
/**
|
|
17211
17215
|
* Get data for a pixel location. A four element RGBA array will be returned. For requests outside the
|
|
@@ -17284,7 +17288,7 @@ class lt extends be {
|
|
|
17284
17288
|
if (this.state == V.IDLE && this.loader) {
|
|
17285
17289
|
this.state = V.LOADING, this.changed();
|
|
17286
17290
|
const l = this.getResolution(), n = Array.isArray(l) ? l[0] : l;
|
|
17287
|
-
|
|
17291
|
+
hi(
|
|
17288
17292
|
() => this.loader(
|
|
17289
17293
|
this.getExtent(),
|
|
17290
17294
|
n,
|
|
@@ -17310,7 +17314,7 @@ class lt extends be {
|
|
|
17310
17314
|
this.resolution = l;
|
|
17311
17315
|
}
|
|
17312
17316
|
}
|
|
17313
|
-
function
|
|
17317
|
+
function gr(t, l) {
|
|
17314
17318
|
return new Promise((n, e) => {
|
|
17315
17319
|
function o() {
|
|
17316
17320
|
r(), n(t);
|
|
@@ -17324,19 +17328,19 @@ function dr(t, l) {
|
|
|
17324
17328
|
t.addEventListener("load", o), t.addEventListener("error", i);
|
|
17325
17329
|
});
|
|
17326
17330
|
}
|
|
17327
|
-
function
|
|
17331
|
+
function dr(t, l) {
|
|
17328
17332
|
return t.src && ue ? new Promise(
|
|
17329
17333
|
(n, e) => t.decode().then(() => n(t)).catch(
|
|
17330
17334
|
(o) => t.complete && t.width ? n(t) : e(o)
|
|
17331
17335
|
)
|
|
17332
|
-
) :
|
|
17336
|
+
) : gr(t);
|
|
17333
17337
|
}
|
|
17334
17338
|
function Ie(t, l) {
|
|
17335
17339
|
return l && (t.src = l), t.src && ue && se ? t.decode().then(() => createImageBitmap(t)).catch((n) => {
|
|
17336
17340
|
if (t.complete && t.width)
|
|
17337
17341
|
return t;
|
|
17338
17342
|
throw n;
|
|
17339
|
-
}) :
|
|
17343
|
+
}) : dr(t);
|
|
17340
17344
|
}
|
|
17341
17345
|
let Mn;
|
|
17342
17346
|
const zl = [];
|
|
@@ -17346,7 +17350,7 @@ function Lt(t, l, n, e, o) {
|
|
|
17346
17350
|
function An(t, l) {
|
|
17347
17351
|
return Math.abs(t[l * 4] - 210) > 2 || Math.abs(t[l * 4 + 3] - 0.75 * 255) > 2;
|
|
17348
17352
|
}
|
|
17349
|
-
function
|
|
17353
|
+
function hr() {
|
|
17350
17354
|
if (Mn === void 0) {
|
|
17351
17355
|
const t = yl(6, 6, zl);
|
|
17352
17356
|
t.globalCompositeOperation = "lighter", t.fillStyle = "rgba(210, 0, 0, 0.75)", Lt(t, 4, 5, 4, 0), Lt(t, 4, 5, 0, 5);
|
|
@@ -17355,7 +17359,7 @@ function pr() {
|
|
|
17355
17359
|
}
|
|
17356
17360
|
return Mn;
|
|
17357
17361
|
}
|
|
17358
|
-
function
|
|
17362
|
+
function pr(t, l, n, e) {
|
|
17359
17363
|
const o = gn(n, l, t);
|
|
17360
17364
|
let i = xt(
|
|
17361
17365
|
l,
|
|
@@ -17373,7 +17377,7 @@ function xr(t, l, n, e) {
|
|
|
17373
17377
|
}
|
|
17374
17378
|
return i;
|
|
17375
17379
|
}
|
|
17376
|
-
function
|
|
17380
|
+
function xr(t, l, n, e, o, i, r, a, u, s, c, m, g, h) {
|
|
17377
17381
|
const d = yl(
|
|
17378
17382
|
Math.round(n * t),
|
|
17379
17383
|
Math.round(n * l),
|
|
@@ -17387,62 +17391,62 @@ function fr(t, l, n, e, o, i, r, a, u, s, c, m, g, h) {
|
|
|
17387
17391
|
}
|
|
17388
17392
|
d.globalCompositeOperation = "lighter";
|
|
17389
17393
|
const b = Dl();
|
|
17390
|
-
u.forEach(function(_,
|
|
17391
|
-
|
|
17394
|
+
u.forEach(function(_, v, C) {
|
|
17395
|
+
no(b, _.extent);
|
|
17392
17396
|
});
|
|
17393
17397
|
let x;
|
|
17394
|
-
const p = n / e,
|
|
17398
|
+
const p = n / e, y = (m ? 1 : 1 + Math.pow(2, -24)) / p;
|
|
17395
17399
|
(u.length !== 1 || s !== 0) && (x = yl(
|
|
17396
17400
|
Math.round(D(b) * p),
|
|
17397
17401
|
Math.round(H(b) * p),
|
|
17398
17402
|
zl
|
|
17399
|
-
), m || (x.imageSmoothingEnabled = !1), u.forEach(function(_,
|
|
17403
|
+
), m || (x.imageSmoothingEnabled = !1), u.forEach(function(_, v, C) {
|
|
17400
17404
|
if (_.image.width > 0 && _.image.height > 0) {
|
|
17401
17405
|
if (_.clipExtent) {
|
|
17402
17406
|
x.save();
|
|
17403
|
-
const
|
|
17407
|
+
const A = (_.clipExtent[0] - b[0]) * p, k = -(_.clipExtent[3] - b[3]) * p, O = D(_.clipExtent) * p, G = H(_.clipExtent) * p;
|
|
17404
17408
|
x.rect(
|
|
17405
|
-
m ?
|
|
17409
|
+
m ? A : Math.round(A),
|
|
17406
17410
|
m ? k : Math.round(k),
|
|
17407
|
-
m ? O : Math.round(
|
|
17411
|
+
m ? O : Math.round(A + O) - Math.round(A),
|
|
17408
17412
|
m ? G : Math.round(k + G) - Math.round(k)
|
|
17409
17413
|
), x.clip();
|
|
17410
17414
|
}
|
|
17411
|
-
const
|
|
17415
|
+
const I = (_.extent[0] - b[0]) * p, E = -(_.extent[3] - b[3]) * p, S = D(_.extent) * p, M = H(_.extent) * p;
|
|
17412
17416
|
x.drawImage(
|
|
17413
17417
|
_.image,
|
|
17414
17418
|
s,
|
|
17415
17419
|
s,
|
|
17416
17420
|
_.image.width - 2 * s,
|
|
17417
17421
|
_.image.height - 2 * s,
|
|
17418
|
-
m ?
|
|
17422
|
+
m ? I : Math.round(I),
|
|
17419
17423
|
m ? E : Math.round(E),
|
|
17420
|
-
m ?
|
|
17424
|
+
m ? S : Math.round(I + S) - Math.round(I),
|
|
17421
17425
|
m ? M : Math.round(E + M) - Math.round(E)
|
|
17422
17426
|
), _.clipExtent && x.restore();
|
|
17423
17427
|
}
|
|
17424
17428
|
}));
|
|
17425
|
-
const
|
|
17426
|
-
return a.getTriangles().forEach(function(_,
|
|
17427
|
-
const
|
|
17428
|
-
let
|
|
17429
|
-
const X = f((E[0][0] -
|
|
17430
|
-
-(E[0][1] -
|
|
17431
|
-
), Q = f((E[1][0] -
|
|
17432
|
-
-(E[1][1] -
|
|
17433
|
-
), Ll = f((E[2][0] -
|
|
17434
|
-
-(E[2][1] -
|
|
17435
|
-
), N =
|
|
17436
|
-
|
|
17429
|
+
const R = cn(r);
|
|
17430
|
+
return a.getTriangles().forEach(function(_, v, C) {
|
|
17431
|
+
const I = _.source, E = _.target;
|
|
17432
|
+
let S = I[0][0], M = I[0][1], A = I[1][0], k = I[1][1], O = I[2][0], G = I[2][1];
|
|
17433
|
+
const X = f((E[0][0] - R[0]) / i), P = f(
|
|
17434
|
+
-(E[0][1] - R[1]) / i
|
|
17435
|
+
), Q = f((E[1][0] - R[0]) / i), sl = f(
|
|
17436
|
+
-(E[1][1] - R[1]) / i
|
|
17437
|
+
), Ll = f((E[2][0] - R[0]) / i), Bl = f(
|
|
17438
|
+
-(E[2][1] - R[1]) / i
|
|
17439
|
+
), N = S, U = M;
|
|
17440
|
+
S = 0, M = 0, A -= N, k -= U, O -= N, G -= U;
|
|
17437
17441
|
const $l = [
|
|
17438
|
-
[
|
|
17442
|
+
[A, k, 0, 0, Q - X],
|
|
17439
17443
|
[O, G, 0, 0, Ll - X],
|
|
17440
|
-
[0, 0,
|
|
17444
|
+
[0, 0, A, k, sl - P],
|
|
17441
17445
|
[0, 0, O, G, Bl - P]
|
|
17442
|
-
], Y =
|
|
17446
|
+
], Y = so($l);
|
|
17443
17447
|
if (!Y)
|
|
17444
17448
|
return;
|
|
17445
|
-
if (d.save(), d.beginPath(),
|
|
17449
|
+
if (d.save(), d.beginPath(), hr() || !m) {
|
|
17446
17450
|
d.moveTo(Q, sl);
|
|
17447
17451
|
const W = 4, z = X - Q, _l = P - sl;
|
|
17448
17452
|
for (let el = 0; el < W; el++)
|
|
@@ -17469,7 +17473,7 @@ function fr(t, l, n, e, o, i, r, a, u, s, c, m, g, h) {
|
|
|
17469
17473
|
);
|
|
17470
17474
|
let K;
|
|
17471
17475
|
if (x)
|
|
17472
|
-
K = x.canvas, d.scale(
|
|
17476
|
+
K = x.canvas, d.scale(y, -y);
|
|
17473
17477
|
else {
|
|
17474
17478
|
const W = u[0], z = W.extent;
|
|
17475
17479
|
K = W.image, d.scale(
|
|
@@ -17483,8 +17487,8 @@ function fr(t, l, n, e, o, i, r, a, u, s, c, m, g, h) {
|
|
|
17483
17487
|
function Fn(t) {
|
|
17484
17488
|
return Array.isArray(t) ? Math.min(...t) : t;
|
|
17485
17489
|
}
|
|
17486
|
-
const
|
|
17487
|
-
class
|
|
17490
|
+
const fr = 10, Ft = 0.25;
|
|
17491
|
+
class Rr {
|
|
17488
17492
|
/**
|
|
17489
17493
|
* @param {import("../proj/Projection.js").default} sourceProj Source projection.
|
|
17490
17494
|
* @param {import("../proj/Projection.js").default} targetProj Target projection.
|
|
@@ -17497,21 +17501,21 @@ class yr {
|
|
|
17497
17501
|
constructor(l, n, e, o, i, r, a) {
|
|
17498
17502
|
this.sourceProj_ = l, this.targetProj_ = n;
|
|
17499
17503
|
let u = {};
|
|
17500
|
-
const s = a ?
|
|
17501
|
-
(
|
|
17504
|
+
const s = a ? zo(
|
|
17505
|
+
(y) => il(
|
|
17502
17506
|
a,
|
|
17503
|
-
gn(
|
|
17507
|
+
gn(y, this.targetProj_, this.sourceProj_)
|
|
17504
17508
|
)
|
|
17505
17509
|
) : an(this.targetProj_, this.sourceProj_);
|
|
17506
|
-
this.transformInv_ = function(
|
|
17507
|
-
const
|
|
17508
|
-
return u[
|
|
17510
|
+
this.transformInv_ = function(y) {
|
|
17511
|
+
const R = y[0] + "/" + y[1];
|
|
17512
|
+
return u[R] || (u[R] = s(y)), u[R];
|
|
17509
17513
|
}, this.maxSourceExtent_ = o, this.errorThresholdSquared_ = i * i, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!o && !!this.sourceProj_.getExtent() && D(o) >= D(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? D(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? D(this.targetProj_.getExtent()) : null;
|
|
17510
|
-
const c = cn(e), m = zn(e), g = Wn(e), h = Gn(e), d = this.transformInv_(c), f = this.transformInv_(m), b = this.transformInv_(g), x = this.transformInv_(h), p =
|
|
17514
|
+
const c = cn(e), m = zn(e), g = Wn(e), h = Gn(e), d = this.transformInv_(c), f = this.transformInv_(m), b = this.transformInv_(g), x = this.transformInv_(h), p = fr + (r ? Math.max(
|
|
17511
17515
|
0,
|
|
17512
17516
|
Math.ceil(
|
|
17513
17517
|
Math.log2(
|
|
17514
|
-
|
|
17518
|
+
oo(e) / (r * r * 256 * 256)
|
|
17515
17519
|
)
|
|
17516
17520
|
)
|
|
17517
17521
|
) : 0);
|
|
@@ -17526,27 +17530,27 @@ class yr {
|
|
|
17526
17530
|
x,
|
|
17527
17531
|
p
|
|
17528
17532
|
), this.wrapsXInSource_) {
|
|
17529
|
-
let
|
|
17530
|
-
this.triangles_.forEach(function(
|
|
17531
|
-
|
|
17532
|
-
|
|
17533
|
-
|
|
17534
|
-
|
|
17535
|
-
|
|
17533
|
+
let y = 1 / 0;
|
|
17534
|
+
this.triangles_.forEach(function(R, _, v) {
|
|
17535
|
+
y = Math.min(
|
|
17536
|
+
y,
|
|
17537
|
+
R.source[0][0],
|
|
17538
|
+
R.source[1][0],
|
|
17539
|
+
R.source[2][0]
|
|
17536
17540
|
);
|
|
17537
|
-
}), this.triangles_.forEach((
|
|
17541
|
+
}), this.triangles_.forEach((R) => {
|
|
17538
17542
|
if (Math.max(
|
|
17539
|
-
|
|
17540
|
-
|
|
17541
|
-
|
|
17542
|
-
) -
|
|
17543
|
+
R.source[0][0],
|
|
17544
|
+
R.source[1][0],
|
|
17545
|
+
R.source[2][0]
|
|
17546
|
+
) - y > this.sourceWorldWidth_ / 2) {
|
|
17543
17547
|
const _ = [
|
|
17544
|
-
[
|
|
17545
|
-
[
|
|
17546
|
-
[
|
|
17548
|
+
[R.source[0][0], R.source[0][1]],
|
|
17549
|
+
[R.source[1][0], R.source[1][1]],
|
|
17550
|
+
[R.source[2][0], R.source[2][1]]
|
|
17547
17551
|
];
|
|
17548
|
-
_[0][0] -
|
|
17549
|
-
const
|
|
17552
|
+
_[0][0] - y > this.sourceWorldWidth_ / 2 && (_[0][0] -= this.sourceWorldWidth_), _[1][0] - y > this.sourceWorldWidth_ / 2 && (_[1][0] -= this.sourceWorldWidth_), _[2][0] - y > this.sourceWorldWidth_ / 2 && (_[2][0] -= this.sourceWorldWidth_);
|
|
17553
|
+
const v = Math.min(
|
|
17550
17554
|
_[0][0],
|
|
17551
17555
|
_[1][0],
|
|
17552
17556
|
_[2][0]
|
|
@@ -17555,7 +17559,7 @@ class yr {
|
|
|
17555
17559
|
_[0][0],
|
|
17556
17560
|
_[1][0],
|
|
17557
17561
|
_[2][0]
|
|
17558
|
-
) -
|
|
17562
|
+
) - v < this.sourceWorldWidth_ / 2 && (R.source = _);
|
|
17559
17563
|
}
|
|
17560
17564
|
});
|
|
17561
17565
|
}
|
|
@@ -17620,12 +17624,12 @@ class yr {
|
|
|
17620
17624
|
const b = [(l[0] + e[0]) / 2, (l[1] + e[1]) / 2], x = this.transformInv_(b);
|
|
17621
17625
|
let p;
|
|
17622
17626
|
h ? p = (wl(i[0], g) + wl(a[0], g)) / 2 - wl(x[0], g) : p = (i[0] + a[0]) / 2 - x[0];
|
|
17623
|
-
const
|
|
17624
|
-
d = p * p +
|
|
17627
|
+
const y = (i[1] + a[1]) / 2 - x[1];
|
|
17628
|
+
d = p * p + y * y > this.errorThresholdSquared_;
|
|
17625
17629
|
}
|
|
17626
17630
|
if (d) {
|
|
17627
17631
|
if (Math.abs(l[0] - e[0]) <= Math.abs(l[1] - e[1])) {
|
|
17628
|
-
const b = [(n[0] + e[0]) / 2, (n[1] + e[1]) / 2], x = this.transformInv_(b), p = [(o[0] + l[0]) / 2, (o[1] + l[1]) / 2],
|
|
17632
|
+
const b = [(n[0] + e[0]) / 2, (n[1] + e[1]) / 2], x = this.transformInv_(b), p = [(o[0] + l[0]) / 2, (o[1] + l[1]) / 2], y = this.transformInv_(p);
|
|
17629
17633
|
this.addQuad_(
|
|
17630
17634
|
l,
|
|
17631
17635
|
n,
|
|
@@ -17634,21 +17638,21 @@ class yr {
|
|
|
17634
17638
|
i,
|
|
17635
17639
|
r,
|
|
17636
17640
|
x,
|
|
17637
|
-
|
|
17641
|
+
y,
|
|
17638
17642
|
s - 1
|
|
17639
17643
|
), this.addQuad_(
|
|
17640
17644
|
p,
|
|
17641
17645
|
b,
|
|
17642
17646
|
e,
|
|
17643
17647
|
o,
|
|
17644
|
-
|
|
17648
|
+
y,
|
|
17645
17649
|
x,
|
|
17646
17650
|
a,
|
|
17647
17651
|
u,
|
|
17648
17652
|
s - 1
|
|
17649
17653
|
);
|
|
17650
17654
|
} else {
|
|
17651
|
-
const b = [(l[0] + n[0]) / 2, (l[1] + n[1]) / 2], x = this.transformInv_(b), p = [(e[0] + o[0]) / 2, (e[1] + o[1]) / 2],
|
|
17655
|
+
const b = [(l[0] + n[0]) / 2, (l[1] + n[1]) / 2], x = this.transformInv_(b), p = [(e[0] + o[0]) / 2, (e[1] + o[1]) / 2], y = this.transformInv_(p);
|
|
17652
17656
|
this.addQuad_(
|
|
17653
17657
|
l,
|
|
17654
17658
|
b,
|
|
@@ -17656,7 +17660,7 @@ class yr {
|
|
|
17656
17660
|
o,
|
|
17657
17661
|
i,
|
|
17658
17662
|
x,
|
|
17659
|
-
|
|
17663
|
+
y,
|
|
17660
17664
|
u,
|
|
17661
17665
|
s - 1
|
|
17662
17666
|
), this.addQuad_(
|
|
@@ -17667,7 +17671,7 @@ class yr {
|
|
|
17667
17671
|
x,
|
|
17668
17672
|
r,
|
|
17669
17673
|
a,
|
|
17670
|
-
|
|
17674
|
+
y,
|
|
17671
17675
|
s - 1
|
|
17672
17676
|
);
|
|
17673
17677
|
}
|
|
@@ -17700,8 +17704,8 @@ class yr {
|
|
|
17700
17704
|
return this.triangles_;
|
|
17701
17705
|
}
|
|
17702
17706
|
}
|
|
17703
|
-
const
|
|
17704
|
-
class
|
|
17707
|
+
const yr = 0.5;
|
|
17708
|
+
class _r extends lt {
|
|
17705
17709
|
/**
|
|
17706
17710
|
* @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
|
|
17707
17711
|
* @param {import("../proj/Projection.js").default} targetProj Target projection.
|
|
@@ -17717,12 +17721,12 @@ class Ir extends lt {
|
|
|
17717
17721
|
u && l.canWrapX() && (u = u.slice(), u[0] = -1 / 0, u[2] = 1 / 0);
|
|
17718
17722
|
let s = n.getExtent();
|
|
17719
17723
|
s && n.canWrapX() && (s = s.slice(), s[0] = -1 / 0, s[2] = 1 / 0);
|
|
17720
|
-
const c = s ? Yt(e, s) : e, m = Vl(c), g =
|
|
17724
|
+
const c = s ? Yt(e, s) : e, m = Vl(c), g = pr(
|
|
17721
17725
|
l,
|
|
17722
17726
|
n,
|
|
17723
17727
|
m,
|
|
17724
17728
|
o
|
|
17725
|
-
), h =
|
|
17729
|
+
), h = yr, d = new Rr(
|
|
17726
17730
|
l,
|
|
17727
17731
|
n,
|
|
17728
17732
|
c,
|
|
@@ -17759,7 +17763,7 @@ class Ir extends lt {
|
|
|
17759
17763
|
const l = this.sourceImage_.getState();
|
|
17760
17764
|
if (l == V.LOADED) {
|
|
17761
17765
|
const n = D(this.targetExtent_) / this.targetResolution_, e = H(this.targetExtent_) / this.targetResolution_;
|
|
17762
|
-
this.canvas_ =
|
|
17766
|
+
this.canvas_ = xr(
|
|
17763
17767
|
n,
|
|
17764
17768
|
e,
|
|
17765
17769
|
this.sourcePixelRatio_,
|
|
@@ -17809,7 +17813,7 @@ class Ir extends lt {
|
|
|
17809
17813
|
), this.sourceListenerKey_ = null;
|
|
17810
17814
|
}
|
|
17811
17815
|
}
|
|
17812
|
-
class
|
|
17816
|
+
class Ir extends hn {
|
|
17813
17817
|
/**
|
|
17814
17818
|
* @param {Options} options Source options.
|
|
17815
17819
|
*/
|
|
@@ -17924,7 +17928,7 @@ const ln = 4, Tn = {
|
|
|
17924
17928
|
*/
|
|
17925
17929
|
IMAGELOADERROR: "imageloaderror"
|
|
17926
17930
|
};
|
|
17927
|
-
class
|
|
17931
|
+
class vr extends dn {
|
|
17928
17932
|
/**
|
|
17929
17933
|
* @param {string} type Type.
|
|
17930
17934
|
* @param {import("../Image.js").default} image The image.
|
|
@@ -17933,7 +17937,7 @@ class Er extends dn {
|
|
|
17933
17937
|
super(l), this.image = n;
|
|
17934
17938
|
}
|
|
17935
17939
|
}
|
|
17936
|
-
class
|
|
17940
|
+
class Er extends Ir {
|
|
17937
17941
|
/**
|
|
17938
17942
|
* @param {Options} options Single image source options.
|
|
17939
17943
|
*/
|
|
@@ -17983,11 +17987,11 @@ class Cr extends vr {
|
|
|
17983
17987
|
if (!i || !o || Rt(i, o))
|
|
17984
17988
|
return i && (o = i), this.getImageInternal(l, n, e, o);
|
|
17985
17989
|
if (this.reprojectedImage_) {
|
|
17986
|
-
if (this.reprojectedRevision_ == this.getRevision() && Rt(this.reprojectedImage_.getProjection(), o) && this.reprojectedImage_.getResolution() == n &&
|
|
17990
|
+
if (this.reprojectedRevision_ == this.getRevision() && Rt(this.reprojectedImage_.getProjection(), o) && this.reprojectedImage_.getResolution() == n && lo(this.reprojectedImage_.getExtent(), l))
|
|
17987
17991
|
return this.reprojectedImage_;
|
|
17988
17992
|
this.reprojectedImage_.dispose(), this.reprojectedImage_ = null;
|
|
17989
17993
|
}
|
|
17990
|
-
return this.reprojectedImage_ = new
|
|
17994
|
+
return this.reprojectedImage_ = new _r(
|
|
17991
17995
|
i,
|
|
17992
17996
|
o,
|
|
17993
17997
|
l,
|
|
@@ -18008,7 +18012,7 @@ class Cr extends vr {
|
|
|
18008
18012
|
*/
|
|
18009
18013
|
getImageInternal(l, n, e, o) {
|
|
18010
18014
|
if (this.loader) {
|
|
18011
|
-
const i =
|
|
18015
|
+
const i = Mr(l, n, e, 1), r = this.findNearestResolution(n);
|
|
18012
18016
|
if (this.image && (this.static_ || this.wantedProjection_ === o && (this.wantedExtent_ && Nn(this.wantedExtent_, i) || Nn(this.image.getExtent(), i)) && (this.wantedResolution_ && Fn(this.wantedResolution_) === r || Fn(this.image.getResolution()) === r)))
|
|
18013
18017
|
return this.image;
|
|
18014
18018
|
this.wantedProjection_ = o, this.wantedExtent_ = i, this.wantedResolution_ = r, this.image = new lt(
|
|
@@ -18047,20 +18051,20 @@ class Cr extends vr {
|
|
|
18047
18051
|
default:
|
|
18048
18052
|
return;
|
|
18049
18053
|
}
|
|
18050
|
-
this.hasListener(e) && this.dispatchEvent(new
|
|
18054
|
+
this.hasListener(e) && this.dispatchEvent(new vr(e, n));
|
|
18051
18055
|
}
|
|
18052
18056
|
}
|
|
18053
|
-
function
|
|
18057
|
+
function Cr(t, l) {
|
|
18054
18058
|
t.getImage().src = l;
|
|
18055
18059
|
}
|
|
18056
|
-
function
|
|
18060
|
+
function Mr(t, l, n, e) {
|
|
18057
18061
|
const o = l / n, i = Vl(t), r = Kl(D(t) / o, ln), a = Kl(H(t) / o, ln), u = Kl((e - 1) * r / 2, ln), s = r + 2 * u, c = Kl((e - 1) * a / 2, ln), m = a + 2 * c;
|
|
18058
18062
|
return $t(i, o, 0, [
|
|
18059
18063
|
s,
|
|
18060
18064
|
m
|
|
18061
18065
|
]);
|
|
18062
18066
|
}
|
|
18063
|
-
function
|
|
18067
|
+
function Ar(t) {
|
|
18064
18068
|
const l = t.load || Ie, n = t.imageExtent, e = t.crossOrigin ?? null;
|
|
18065
18069
|
return () => {
|
|
18066
18070
|
const o = new Image();
|
|
@@ -18070,12 +18074,12 @@ function Tr(t) {
|
|
|
18070
18074
|
});
|
|
18071
18075
|
};
|
|
18072
18076
|
}
|
|
18073
|
-
class
|
|
18077
|
+
class Tr extends Er {
|
|
18074
18078
|
/**
|
|
18075
18079
|
* @param {Options} options ImageStatic options.
|
|
18076
18080
|
*/
|
|
18077
18081
|
constructor(l) {
|
|
18078
|
-
const n = l.crossOrigin !== void 0 ? l.crossOrigin : null, e = l.imageLoadFunction !== void 0 ? l.imageLoadFunction :
|
|
18082
|
+
const n = l.crossOrigin !== void 0 ? l.crossOrigin : null, e = l.imageLoadFunction !== void 0 ? l.imageLoadFunction : Cr;
|
|
18079
18083
|
super({
|
|
18080
18084
|
attributions: l.attributions,
|
|
18081
18085
|
interpolate: l.interpolate,
|
|
@@ -18084,7 +18088,7 @@ class wr extends Cr {
|
|
|
18084
18088
|
this.imageExtent_,
|
|
18085
18089
|
void 0,
|
|
18086
18090
|
1,
|
|
18087
|
-
|
|
18091
|
+
Ar({
|
|
18088
18092
|
url: l.url,
|
|
18089
18093
|
imageExtent: l.imageExtent,
|
|
18090
18094
|
crossOrigin: n,
|
|
@@ -18124,9 +18128,9 @@ class wr extends Cr {
|
|
|
18124
18128
|
return this.url_;
|
|
18125
18129
|
}
|
|
18126
18130
|
}
|
|
18127
|
-
function
|
|
18131
|
+
function wr() {
|
|
18128
18132
|
console.log("useMapRendering");
|
|
18129
|
-
const t =
|
|
18133
|
+
const t = w(!1), l = w(null), n = w(null), e = w(null), o = al({
|
|
18130
18134
|
colormap: "viridis",
|
|
18131
18135
|
opacity: 0.8,
|
|
18132
18136
|
showBounds: !0,
|
|
@@ -18136,48 +18140,48 @@ function Sr() {
|
|
|
18136
18140
|
maxValue: null
|
|
18137
18141
|
});
|
|
18138
18142
|
async function i(h, d, f, b, x) {
|
|
18139
|
-
var p,
|
|
18143
|
+
var p, y, R, _;
|
|
18140
18144
|
t.value = !0, l.value = null;
|
|
18141
18145
|
try {
|
|
18142
|
-
const
|
|
18143
|
-
if (!
|
|
18144
|
-
const C = ((
|
|
18145
|
-
if (C === 0 ||
|
|
18146
|
+
const v = h.data;
|
|
18147
|
+
if (!v || v.length === 0) throw new Error("No data available");
|
|
18148
|
+
const C = ((y = (p = d.dimensions) == null ? void 0 : p.lon) == null ? void 0 : y.size) ?? 0, I = ((_ = (R = d.dimensions) == null ? void 0 : R.lat) == null ? void 0 : _.size) ?? 0;
|
|
18149
|
+
if (C === 0 || I === 0) throw new Error("Invalid dimension sizes");
|
|
18146
18150
|
let E;
|
|
18147
|
-
b ? E = b : E = a(C,
|
|
18148
|
-
const M = (await r(
|
|
18151
|
+
b ? E = b : E = a(C, I);
|
|
18152
|
+
const M = (await r(v, C, I, x)).canvas.toDataURL("image/png");
|
|
18149
18153
|
console.log("Image URL:", M);
|
|
18150
|
-
const
|
|
18151
|
-
source: new
|
|
18154
|
+
const A = new br({
|
|
18155
|
+
source: new Tr({
|
|
18152
18156
|
url: M,
|
|
18153
18157
|
imageExtent: E,
|
|
18154
18158
|
projection: "EPSG:4326"
|
|
18155
18159
|
}),
|
|
18156
18160
|
opacity: o.opacity
|
|
18157
18161
|
});
|
|
18158
|
-
return f.addLayer(
|
|
18159
|
-
} catch (
|
|
18160
|
-
const C =
|
|
18161
|
-
throw l.value = C,
|
|
18162
|
+
return f.addLayer(A), o.autoFit && f.getView().fit(E, { size: f.getSize(), padding: [20, 20, 20, 20] }), n.value = A, e.value = E, A;
|
|
18163
|
+
} catch (v) {
|
|
18164
|
+
const C = v instanceof Error ? v.message : String(v);
|
|
18165
|
+
throw l.value = C, v;
|
|
18162
18166
|
} finally {
|
|
18163
18167
|
t.value = !1;
|
|
18164
18168
|
}
|
|
18165
18169
|
}
|
|
18166
18170
|
async function r(h, d, f, b) {
|
|
18167
|
-
let x = h, p = d,
|
|
18171
|
+
let x = h, p = d, y = f;
|
|
18168
18172
|
if (o.resampleTo) {
|
|
18169
|
-
const [
|
|
18170
|
-
|
|
18173
|
+
const [I, E] = o.resampleTo;
|
|
18174
|
+
I > 0 && E > 0 && (x = Be(h, [f, d], [E, I]), p = I, y = E);
|
|
18171
18175
|
}
|
|
18172
18176
|
if (b) {
|
|
18173
|
-
const
|
|
18174
|
-
if (
|
|
18175
|
-
const E =
|
|
18176
|
-
return et(M,
|
|
18177
|
+
const I = await Gt(b);
|
|
18178
|
+
if (I) {
|
|
18179
|
+
const E = je(I), S = Ue(x, E), M = Sn(p, y);
|
|
18180
|
+
return et(M, S, p, y), { canvas: M, pixelData: S, normalizedData: null, width: p, height: y };
|
|
18177
18181
|
}
|
|
18178
18182
|
}
|
|
18179
|
-
const
|
|
18180
|
-
return et(C,
|
|
18183
|
+
const R = Ze(x, o.minValue ?? void 0, o.maxValue ?? void 0), _ = wn(o.colormap), v = He(R, _), C = Sn(p, y);
|
|
18184
|
+
return et(C, v, p, y), { canvas: C, pixelData: v, normalizedData: R, width: p, height: y };
|
|
18181
18185
|
}
|
|
18182
18186
|
function a(h, d) {
|
|
18183
18187
|
return [-180, -60, 180, 85];
|
|
@@ -18189,10 +18193,10 @@ function Sr() {
|
|
|
18189
18193
|
var x, p;
|
|
18190
18194
|
if (o.colormap = h, n.value && d && f)
|
|
18191
18195
|
try {
|
|
18192
|
-
const
|
|
18193
|
-
c(),
|
|
18194
|
-
} catch (
|
|
18195
|
-
console.error("更新色彩方案时出错:",
|
|
18196
|
+
const y = ((p = (x = n.value).getMap) == null ? void 0 : p.call(x)) ?? n.value.get("map");
|
|
18197
|
+
c(), y && await i(d, f, y, void 0, b);
|
|
18198
|
+
} catch (y) {
|
|
18199
|
+
console.error("更新色彩方案时出错:", y);
|
|
18196
18200
|
}
|
|
18197
18201
|
}
|
|
18198
18202
|
function c() {
|
|
@@ -18204,11 +18208,11 @@ function Sr() {
|
|
|
18204
18208
|
}
|
|
18205
18209
|
function m(h, d, f) {
|
|
18206
18210
|
if (!e.value || !(d != null && d.data)) return null;
|
|
18207
|
-
const b = d.data, x = d.shape ?? [], p = d.dimensions ?? [],
|
|
18208
|
-
if (
|
|
18209
|
-
const _ = x[
|
|
18210
|
-
if (_ === 0 ||
|
|
18211
|
-
const [C,
|
|
18211
|
+
const b = d.data, x = d.shape ?? [], p = d.dimensions ?? [], y = p.indexOf("lon"), R = p.indexOf("lat");
|
|
18212
|
+
if (y === -1 || R === -1) return null;
|
|
18213
|
+
const _ = x[y] ?? 0, v = x[R] ?? 0;
|
|
18214
|
+
if (_ === 0 || v === 0) return null;
|
|
18215
|
+
const [C, I, E, S] = e.value, M = Math.floor((h.lng - C) / (E - C) * (_ - 1)), A = Math.floor((h.lat - I) / (S - I) * (v - 1)), k = v - 1 - A, O = Math.max(0, Math.min(_ - 1, M)), X = Math.max(0, Math.min(v - 1, k)) * _ + O;
|
|
18212
18216
|
return X >= 0 && X < b.length ? b[X] : null;
|
|
18213
18217
|
}
|
|
18214
18218
|
function g() {
|
|
@@ -18228,10 +18232,10 @@ function Sr() {
|
|
|
18228
18232
|
reset: g
|
|
18229
18233
|
};
|
|
18230
18234
|
}
|
|
18231
|
-
function
|
|
18235
|
+
function Sr(t, l, n, e, o, i) {
|
|
18232
18236
|
let r = null, a = null, u = null;
|
|
18233
18237
|
console.log("useGridLabels执行", t, l, n, e, o);
|
|
18234
|
-
const s =
|
|
18238
|
+
const s = w(document.getElementById("xmGridLabelsCanvas") || null);
|
|
18235
18239
|
function c() {
|
|
18236
18240
|
const b = s.value, x = b == null ? void 0 : b.parentElement;
|
|
18237
18241
|
!b || !x || (b.width = x.clientWidth, b.height = x.clientHeight);
|
|
@@ -18243,20 +18247,20 @@ function Nr(t, l, n, e, o, i) {
|
|
|
18243
18247
|
x && x.clearRect(0, 0, b.width, b.height);
|
|
18244
18248
|
}
|
|
18245
18249
|
function g() {
|
|
18246
|
-
const b = s.value, x = t.value, p = l.value,
|
|
18247
|
-
if (!b || !x || !p || !
|
|
18248
|
-
const
|
|
18249
|
-
if (!
|
|
18250
|
-
const _ = b.width,
|
|
18251
|
-
|
|
18250
|
+
const b = s.value, x = t.value, p = l.value, y = n.value;
|
|
18251
|
+
if (!b || !x || !p || !y) return;
|
|
18252
|
+
const R = b.getContext("2d");
|
|
18253
|
+
if (!R) return;
|
|
18254
|
+
const _ = b.width, v = b.height;
|
|
18255
|
+
R.clearRect(0, 0, _, v);
|
|
18252
18256
|
const C = o.value;
|
|
18253
|
-
|
|
18254
|
-
for (let
|
|
18255
|
-
for (let E = C / 2; E <
|
|
18256
|
-
const
|
|
18257
|
+
R.font = "11px monospace", R.textAlign = "center", R.textBaseline = "middle";
|
|
18258
|
+
for (let I = C / 2; I < _; I += C)
|
|
18259
|
+
for (let E = C / 2; E < v; E += C) {
|
|
18260
|
+
const S = [I, E], M = x.getCoordinateFromPixel(S), [A, k] = M, O = i({ lat: k, lng: A }, p, y);
|
|
18257
18261
|
if (O === null || !isFinite(O)) continue;
|
|
18258
18262
|
const G = O.toFixed(1);
|
|
18259
|
-
|
|
18263
|
+
R.strokeStyle = "rgba(0, 0, 0, 0.72)", R.lineWidth = 3, R.lineJoin = "round", R.strokeText(G, I, E), R.fillStyle = "white", R.fillText(G, I, E);
|
|
18260
18264
|
}
|
|
18261
18265
|
}
|
|
18262
18266
|
function h() {
|
|
@@ -18285,7 +18289,7 @@ function Nr(t, l, n, e, o, i) {
|
|
|
18285
18289
|
console.log("地图销毁--组件内部清理"), t.value && f(t.value), r && (r.disconnect(), r = null);
|
|
18286
18290
|
});
|
|
18287
18291
|
}
|
|
18288
|
-
class
|
|
18292
|
+
class Nr {
|
|
18289
18293
|
constructor(l = {}) {
|
|
18290
18294
|
L(this, "options");
|
|
18291
18295
|
L(this, "isRendering", !1);
|
|
@@ -18324,7 +18328,7 @@ class Vr {
|
|
|
18324
18328
|
};
|
|
18325
18329
|
}
|
|
18326
18330
|
}
|
|
18327
|
-
function
|
|
18331
|
+
function Vr(t, l) {
|
|
18328
18332
|
let n;
|
|
18329
18333
|
return function(...o) {
|
|
18330
18334
|
const i = () => {
|
|
@@ -18333,7 +18337,7 @@ function Pr(t, l) {
|
|
|
18333
18337
|
clearTimeout(n), n = setTimeout(i, l);
|
|
18334
18338
|
};
|
|
18335
18339
|
}
|
|
18336
|
-
function
|
|
18340
|
+
function Pr(t, l) {
|
|
18337
18341
|
let n = !1;
|
|
18338
18342
|
return function(...o) {
|
|
18339
18343
|
n || (t(...o), n = !0, setTimeout(() => {
|
|
@@ -18341,7 +18345,7 @@ function Dr(t, l) {
|
|
|
18341
18345
|
}, l));
|
|
18342
18346
|
};
|
|
18343
18347
|
}
|
|
18344
|
-
const
|
|
18348
|
+
const Gr = (t, l, n) => {
|
|
18345
18349
|
console.log("info-getFileData接收得参数", l);
|
|
18346
18350
|
const e = al({
|
|
18347
18351
|
variableData: null,
|
|
@@ -18349,9 +18353,9 @@ const Wr = (t, l, n) => {
|
|
|
18349
18353
|
bounds: null,
|
|
18350
18354
|
variableName: null
|
|
18351
18355
|
});
|
|
18352
|
-
return e.variableData = l.variableData || null, e.metadata = l.metadata || null, e.bounds = l.bounds || null, e.variableName = l.variableName || null,
|
|
18353
|
-
},
|
|
18354
|
-
const e =
|
|
18356
|
+
return e.variableData = l.variableData || null, e.metadata = l.metadata || null, e.bounds = l.bounds || null, e.variableName = l.variableName || null, Dr(t, e, n);
|
|
18357
|
+
}, Dr = (t, l, n) => {
|
|
18358
|
+
const e = w(!1);
|
|
18355
18359
|
q(
|
|
18356
18360
|
() => l.variableName,
|
|
18357
18361
|
async (N) => {
|
|
@@ -18364,7 +18368,7 @@ const Wr = (t, l, n) => {
|
|
|
18364
18368
|
},
|
|
18365
18369
|
{ immediate: !0 }
|
|
18366
18370
|
);
|
|
18367
|
-
const o =
|
|
18371
|
+
const o = w(!0), i = w(80), r = w(2), a = w(null), u = w({ current: 0, total: 0, percent: 0 }), s = w(!0), c = w(1e6), {
|
|
18368
18372
|
mapState: m,
|
|
18369
18373
|
map: g,
|
|
18370
18374
|
mapInitialized: h,
|
|
@@ -18373,29 +18377,29 @@ const Wr = (t, l, n) => {
|
|
|
18373
18377
|
currentCoords: b,
|
|
18374
18378
|
mouseEvents: x,
|
|
18375
18379
|
destroyMap: p,
|
|
18376
|
-
setView:
|
|
18377
|
-
getCenter:
|
|
18380
|
+
setView: y,
|
|
18381
|
+
getCenter: R,
|
|
18378
18382
|
getZoom: _,
|
|
18379
|
-
fitBounds:
|
|
18383
|
+
fitBounds: v,
|
|
18380
18384
|
formatCoords: C
|
|
18381
|
-
} =
|
|
18385
|
+
} = Uo(t);
|
|
18382
18386
|
if (console.log(g, "useOpenLayersMap地图看看"), !m)
|
|
18383
18387
|
throw new Error("地图未初始化");
|
|
18384
18388
|
const {
|
|
18385
|
-
overlay:
|
|
18389
|
+
overlay: I,
|
|
18386
18390
|
bounds: E,
|
|
18387
|
-
options:
|
|
18391
|
+
options: S,
|
|
18388
18392
|
isLoading: M,
|
|
18389
|
-
createDataOverlay:
|
|
18393
|
+
createDataOverlay: A,
|
|
18390
18394
|
updateOpacity: k,
|
|
18391
18395
|
removeOverlay: O,
|
|
18392
18396
|
getValueAtCoordinate: G
|
|
18393
|
-
} =
|
|
18394
|
-
console.log(
|
|
18395
|
-
const X = B(() => !!
|
|
18397
|
+
} = wr();
|
|
18398
|
+
console.log(I, "overlay看看");
|
|
18399
|
+
const X = B(() => !!I.value);
|
|
18396
18400
|
console.log(X, "hasDataOverlay看看");
|
|
18397
18401
|
const P = B(() => M.value);
|
|
18398
|
-
|
|
18402
|
+
Sr(
|
|
18399
18403
|
g,
|
|
18400
18404
|
tt(l, "variableData"),
|
|
18401
18405
|
tt(l, "metadata"),
|
|
@@ -18403,10 +18407,10 @@ const Wr = (t, l, n) => {
|
|
|
18403
18407
|
i,
|
|
18404
18408
|
G
|
|
18405
18409
|
);
|
|
18406
|
-
const Q =
|
|
18410
|
+
const Q = Vr(async (N, U, $l) => {
|
|
18407
18411
|
const Y = [112.1292, 34.51661], K = [113.1107, 34.51661], W = [113.1107, 33.53511], z = [112.1292, 33.53511], _l = Math.min(Y[0], z[0], K[0], W[0]), el = Math.max(Y[0], z[0], K[0], W[0]), ve = Math.min(Y[1], z[1], K[1], W[1]), Ee = Math.max(Y[1], z[1], K[1], W[1]), nt = [_l, ve, el, Ee];
|
|
18408
|
-
s.value && N.data.length > c.value ? await Ll(N, U, nt, l.variableName ?? void 0) : await
|
|
18409
|
-
}, 300), sl =
|
|
18412
|
+
s.value && N.data.length > c.value ? await Ll(N, U, nt, l.variableName ?? void 0) : await A(N, U, g.value, nt, l.variableName ?? void 0);
|
|
18413
|
+
}, 300), sl = Pr(() => {
|
|
18410
18414
|
if (h.value) {
|
|
18411
18415
|
const N = _();
|
|
18412
18416
|
N !== null && (r.value = N);
|
|
@@ -18444,7 +18448,7 @@ const Wr = (t, l, n) => {
|
|
|
18444
18448
|
}
|
|
18445
18449
|
);
|
|
18446
18450
|
async function Ll(N, U, $l, Y) {
|
|
18447
|
-
a.value && a.value.cancel(), a.value = new
|
|
18451
|
+
a.value && a.value.cancel(), a.value = new Nr({
|
|
18448
18452
|
chunkSize: 1e5,
|
|
18449
18453
|
delayBetweenChunks: 10
|
|
18450
18454
|
}), O(), u.value = { current: 0, total: 0, percent: 0 };
|
|
@@ -18459,7 +18463,7 @@ const Wr = (t, l, n) => {
|
|
|
18459
18463
|
u.value = z;
|
|
18460
18464
|
},
|
|
18461
18465
|
() => {
|
|
18462
|
-
|
|
18466
|
+
A(N, U, g.value, $l ?? void 0, Y), a.value = null;
|
|
18463
18467
|
}
|
|
18464
18468
|
);
|
|
18465
18469
|
} catch (z) {
|
|
@@ -18467,7 +18471,7 @@ const Wr = (t, l, n) => {
|
|
|
18467
18471
|
}
|
|
18468
18472
|
}
|
|
18469
18473
|
return {
|
|
18470
|
-
options:
|
|
18474
|
+
options: S,
|
|
18471
18475
|
bounds: E,
|
|
18472
18476
|
currentZoom: r,
|
|
18473
18477
|
mapCoords: b,
|
|
@@ -18480,7 +18484,7 @@ const Wr = (t, l, n) => {
|
|
|
18480
18484
|
sl.call(null);
|
|
18481
18485
|
}
|
|
18482
18486
|
};
|
|
18483
|
-
},
|
|
18487
|
+
}, Wr = (t) => {
|
|
18484
18488
|
const l = al({
|
|
18485
18489
|
coordinates: { lat: null, lng: null },
|
|
18486
18490
|
dataValue: null,
|
|
@@ -18490,7 +18494,7 @@ const Wr = (t, l, n) => {
|
|
|
18490
18494
|
error: null
|
|
18491
18495
|
});
|
|
18492
18496
|
l.coordinates = t.coordinates || { lat: null, lng: null }, l.dataValue = t.dataValue || null, l.dataStats = t.dataStats || null, l.currentFile = t.currentFile || null, l.isLoading = t.isLoading || !1, l.error = t.error || null;
|
|
18493
|
-
const n =
|
|
18497
|
+
const n = w("ready"), e = B(() => l.error ? "错误" : l.isLoading ? "加载中" : l.currentFile && !l.isLoading ? "就绪" : "等待中"), o = B(() => l.error ? l.error : l.isLoading ? "正在解析 netCDF 数据" : l.currentFile ? "数据已加载,可以使用" : "请上传 netCDF 文件以开始使用"), i = B(() => l.dataValue === null || l.dataValue === void 0 ? "--" : typeof l.dataValue == "number" ? l.dataValue.toFixed(2) : l.dataValue), r = B(() => {
|
|
18494
18498
|
var s, c;
|
|
18495
18499
|
const u = (m) => m == null ? "--" : typeof m == "number" ? m.toFixed(4) : String(m);
|
|
18496
18500
|
return {
|
|
@@ -18518,15 +18522,15 @@ const Wr = (t, l, n) => {
|
|
|
18518
18522
|
systemStatus: n,
|
|
18519
18523
|
formatFileSize: a
|
|
18520
18524
|
};
|
|
18521
|
-
},
|
|
18525
|
+
}, zr = "0.0.1";
|
|
18522
18526
|
export {
|
|
18523
18527
|
Xt as detect2dVariables,
|
|
18524
|
-
|
|
18525
|
-
|
|
18528
|
+
Fr as getColorData,
|
|
18529
|
+
Gr as getFileData,
|
|
18526
18530
|
Gt as getJsonItemForVariable,
|
|
18527
|
-
|
|
18528
|
-
|
|
18529
|
-
|
|
18530
|
-
|
|
18531
|
+
Wr as getStatusInfo,
|
|
18532
|
+
kr as useLoadFile,
|
|
18533
|
+
jr as useMapInfo,
|
|
18534
|
+
zr as version
|
|
18531
18535
|
};
|
|
18532
18536
|
//# sourceMappingURL=xm-netcdf-loader.es.js.map
|