xm-netcdf-loader 1.0.2 → 1.0.3

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