@eox/drawtools 0.14.3 → 0.15.0

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.
@@ -283,8 +283,8 @@ et.elementStyles = [], et.shadowRootOptions = { mode: "open" }, et[ft("elementPr
283
283
  * SPDX-License-Identifier: BSD-3-Clause
284
284
  */
285
285
  const gt = globalThis, Nt = gt.trustedTypes, We = Nt ? Nt.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Pi = "$lit$", G = `lit$${Math.random().toFixed(9).slice(2)}$`, Mi = "?" + G, Ln = `<${Mi}>`, B = document, pt = () => B.createComment(""), yt = (n) => n === null || typeof n != "object" && typeof n != "function", ye = Array.isArray, Rn = (n) => ye(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", te = `[
286
- \f\r]`, dt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qe = /-->/g, De = />/g, T = RegExp(`>|${te}(?:([^\\s"'>=/]+)(${te}*=${te}*(?:[^
287
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Ze = /'/g, Ke = /"/g, Si = /^(?:script|style|textarea|title)$/i, Tn = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), H = Tn(1), at = Symbol.for("lit-noChange"), w = Symbol.for("lit-nothing"), Qe = /* @__PURE__ */ new WeakMap(), O = B.createTreeWalker(B, 129);
286
+ \f\r]`, dt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qe = /-->/g, Ke = />/g, T = RegExp(`>|${te}(?:([^\\s"'>=/]+)(${te}*=${te}*(?:[^
287
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), De = /'/g, Ze = /"/g, Si = /^(?:script|style|textarea|title)$/i, Tn = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), H = Tn(1), at = Symbol.for("lit-noChange"), w = Symbol.for("lit-nothing"), Qe = /* @__PURE__ */ new WeakMap(), O = B.createTreeWalker(B, 129);
288
288
  function $i(n, t) {
289
289
  if (!ye(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
290
290
  return We !== void 0 ? We.createHTML(t) : t;
@@ -295,7 +295,7 @@ const Nn = (n, t) => {
295
295
  for (let a = 0; a < e; a++) {
296
296
  const l = n[a];
297
297
  let h, c, u = -1, d = 0;
298
- for (; d < l.length && (o.lastIndex = d, c = o.exec(l), c !== null); ) d = o.lastIndex, o === dt ? c[1] === "!--" ? o = qe : c[1] !== void 0 ? o = De : c[2] !== void 0 ? (Si.test(c[2]) && (r = RegExp("</" + c[2], "g")), o = T) : c[3] !== void 0 && (o = T) : o === T ? c[0] === ">" ? (o = r ?? dt, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, h = c[1], o = c[3] === void 0 ? T : c[3] === '"' ? Ke : Ze) : o === Ke || o === Ze ? o = T : o === qe || o === De ? o = dt : (o = T, r = void 0);
298
+ for (; d < l.length && (o.lastIndex = d, c = o.exec(l), c !== null); ) d = o.lastIndex, o === dt ? c[1] === "!--" ? o = qe : c[1] !== void 0 ? o = Ke : c[2] !== void 0 ? (Si.test(c[2]) && (r = RegExp("</" + c[2], "g")), o = T) : c[3] !== void 0 && (o = T) : o === T ? c[0] === ">" ? (o = r ?? dt, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, h = c[1], o = c[3] === void 0 ? T : c[3] === '"' ? Ze : De) : o === Ze || o === De ? o = T : o === qe || o === Ke ? o = dt : (o = T, r = void 0);
299
299
  const f = o === T && n[a + 1].startsWith("/>") ? " " : "";
300
300
  s += o === dt ? l + Ln : u >= 0 ? (i.push(h), l.slice(0, u) + Pi + l.slice(u) + G + f) : l + G + (u === -2 ? a : f);
301
301
  }
@@ -607,7 +607,7 @@ const Jn = Yn(class extends Bn {
607
607
  if (n.clickId === t) return;
608
608
  const i = e ? [] : [t];
609
609
  n.hoverInteraction.highlightById(i);
610
- }, Dn = (n, t) => {
610
+ }, Kn = (n, t) => {
611
611
  n.stopPropagation();
612
612
  const e = Number(n.target.getAttribute("index")), i = t.drawLayer.getSource().getFeatures()[e];
613
613
  t.drawLayer.getSource().removeFeature(i), t.drawnFeatures.splice(e, 1), t.requestUpdate();
@@ -617,7 +617,7 @@ const Jn = Yn(class extends Bn {
617
617
  }, ei = {
618
618
  type: "FeatureCollection",
619
619
  features: []
620
- }, Zn = (n, t) => {
620
+ }, Dn = (n, t) => {
621
621
  const { clickId: e, drawLayer: i, olMap: r, clickInteraction: s } = t, o = s.getId(n);
622
622
  if (e === o) {
623
623
  const l = i.getSource().getExtent();
@@ -627,7 +627,7 @@ const Jn = Yn(class extends Bn {
627
627
  s.highlightById([o]), r.getView().fit(c, ti);
628
628
  }
629
629
  t.requestUpdate();
630
- }, Kn = "ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";
630
+ }, Zn = "ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";
631
631
  class Fi extends X {
632
632
  constructor() {
633
633
  super();
@@ -647,7 +647,7 @@ class Fi extends X {
647
647
  * @type string | number
648
648
  */
649
649
  R(this, "clickId");
650
- this.eoxDrawTools = null, this.eoxMap = null, this.olMap = null, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.featureName = "Feature", this.modify = null, this.unstyled = !1;
650
+ this.eoxDrawTools = null, this.eoxMap = null, this.olMap = null, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.featureName = "Feature", this.featureNameKey = null, this.modify = null, this.unstyled = !1;
651
651
  }
652
652
  /**
653
653
  * Handles the deletion of an individual feature.
@@ -655,7 +655,7 @@ class Fi extends X {
655
655
  * @param {Event & { target: HTMLButtonElement }} evt - Event object containing button target.
656
656
  */
657
657
  _handleDelete(e) {
658
- Dn(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
658
+ Kn(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
659
659
  }
660
660
  /**
661
661
  * Handles the selection and deselection of a feature from the list.
@@ -663,7 +663,7 @@ class Fi extends X {
663
663
  * @param {import("ol").Feature} feature - The selected feature.
664
664
  */
665
665
  _handleFeatureSelectAndDeselect(e) {
666
- Zn(e, this);
666
+ Dn(e, this);
667
667
  }
668
668
  /**
669
669
  *
@@ -689,18 +689,18 @@ class Fi extends X {
689
689
  var e, i;
690
690
  return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (i = this.clickInteraction) == null ? void 0 : i.selectedFids[0], H`
691
691
  <style>
692
- ${!this.unstyled && Kn}
692
+ ${!this.unstyled && Zn}
693
693
  </style>
694
694
  <ul class="list-wrap">
695
695
  ${this.drawnFeatures.map((r, s) => {
696
696
  const o = s + 1, a = Object.values(
697
697
  this.eoxMap.selectInteractions
698
- )[0].getId(r), l = this.hoverId === a, h = this.clickId === a;
698
+ )[0].getId(r), l = this.hoverId === a, h = this.clickId === a, u = l || h ? "selected" : w, d = r.get(this.featureNameKey), f = d || `${this.featureName} ${o}`;
699
699
  return Jn(
700
700
  o,
701
701
  H`
702
702
  <li
703
- class="${l || h ? "selected" : w}"
703
+ class="${u}"
704
704
  @mouseover=${() => this._handleHoverFeature(a)}
705
705
  @mouseout=${() => this._handleHoverFeature(a, !0)}
706
706
  >
@@ -708,9 +708,7 @@ class Fi extends X {
708
708
  class="list"
709
709
  @click="${() => this._handleFeatureSelectAndDeselect(r)}"
710
710
  >
711
- <span class="title"
712
- >${this.featureName} ${o}</span
713
- >
711
+ <span class="title">${f}</span>
714
712
  <button
715
713
  index=${s}
716
714
  data-cy="deleteFeatureBtn"
@@ -736,6 +734,7 @@ R(Fi, "properties", {
736
734
  drawLayer: { attribute: !1, state: !0 },
737
735
  drawnFeatures: { attribute: !1, state: !0, type: Array },
738
736
  featureName: { attribute: !1, state: !0, type: String },
737
+ featureNameKey: { attribute: !1, state: !0, type: String },
739
738
  modify: { attribute: !1, state: !0 },
740
739
  unstyled: { type: Boolean }
741
740
  });
@@ -1380,7 +1379,7 @@ const C = {
1380
1379
  BELOW: 8,
1381
1380
  LEFT: 16
1382
1381
  };
1383
- function D(n, t, e) {
1382
+ function K(n, t, e) {
1384
1383
  let i, r;
1385
1384
  return t < n[0] ? i = n[0] - t : n[2] < t ? i = t - n[2] : i = 0, e < n[1] ? r = n[1] - e : n[3] < e ? r = e - n[3] : r = 0, i * i + r * r;
1386
1385
  }
@@ -1716,12 +1715,12 @@ function ne(n, t) {
1716
1715
  const jt = 0.9996, P = 669438e-8, zt = P * P, Jt = zt * P, k = P / (1 - P), ci = Math.sqrt(1 - P), ct = (1 - ci) / (1 + ci), Ui = ct * ct, xe = Ui * ct, Pe = xe * ct, Xi = Pe * ct, Yi = 1 - P / 4 - 3 * zt / 64 - 5 * Jt / 256, Lr = 3 * P / 8 + 3 * zt / 32 + 45 * Jt / 1024, Rr = 15 * zt / 256 + 45 * Jt / 1024, Tr = 35 * Jt / 3072, Nr = 3 / 2 * ct - 27 / 32 * xe + 269 / 512 * Xi, Or = 21 / 16 * Ui - 55 / 32 * Pe, kr = 151 / 96 * xe - 417 / 128 * Xi, jr = 1097 / 512 * Pe, Ht = 6378137;
1717
1716
  function Hr(n, t, e) {
1718
1717
  const i = n - 5e5, o = (e.north ? t : t - 1e7) / jt / (Ht * Yi), a = o + Nr * Math.sin(2 * o) + Or * Math.sin(4 * o) + kr * Math.sin(6 * o) + jr * Math.sin(8 * o), l = Math.sin(a), h = l * l, c = Math.cos(a), u = l / c, d = u * u, f = d * d, g = 1 - P * h, p = Math.sqrt(1 - P * h), _ = Ht / p, b = (1 - P) / g, v = k * c ** 2, S = v * v, E = i / (_ * jt), L = E * E, ut = L * E, He = ut * E, Ue = He * E, vn = Ue * E, wn = a - u / b * (L / 2 - He / 24 * (5 + 3 * d + 10 * v - 4 * S - 9 * k)) + vn / 720 * (61 + 90 * d + 298 * v + 45 * f - 252 * k - 3 * S);
1719
- let Kt = (E - ut / 6 * (1 + 2 * d + v) + Ue / 120 * (5 - 2 * v + 28 * d - 3 * S + 8 * k + 24 * f)) / c;
1720
- return Kt = ae(
1721
- Kt + Tt(Bi(e.number)),
1718
+ let Zt = (E - ut / 6 * (1 + 2 * d + v) + Ue / 120 * (5 - 2 * v + 28 * d - 3 * S + 8 * k + 24 * f)) / c;
1719
+ return Zt = ae(
1720
+ Zt + Tt(Bi(e.number)),
1722
1721
  -Math.PI,
1723
1722
  Math.PI
1724
- ), [oi(Kt), oi(wn)];
1723
+ ), [oi(Zt), oi(wn)];
1725
1724
  }
1726
1725
  const ui = -80, di = 84, Ur = -180, Xr = 180;
1727
1726
  function Yr(n, t, e) {
@@ -1809,14 +1808,14 @@ function gi(n) {
1809
1808
  });
1810
1809
  });
1811
1810
  }
1812
- function Dr(n, t, e, i) {
1811
+ function Kr(n, t, e, i) {
1813
1812
  n.forEach(function(r) {
1814
1813
  t.forEach(function(s) {
1815
1814
  vt(r, s, e), vt(s, r, i);
1816
1815
  });
1817
1816
  });
1818
1817
  }
1819
- function Zr(n, t) {
1818
+ function Dr(n, t) {
1820
1819
  if (n === t)
1821
1820
  return !0;
1822
1821
  const e = n.getUnits() === t.getUnits();
@@ -1864,15 +1863,15 @@ function ce(n, t) {
1864
1863
  const e = x(n), i = x(t);
1865
1864
  return zi(e, i);
1866
1865
  }
1867
- function Kr() {
1868
- gi(ai), gi(hi), Dr(
1866
+ function Zr() {
1867
+ gi(ai), gi(hi), Kr(
1869
1868
  hi,
1870
1869
  ai,
1871
1870
  Sr,
1872
1871
  $r
1873
1872
  );
1874
1873
  }
1875
- Kr();
1874
+ Zr();
1876
1875
  new Array(6);
1877
1876
  function Ji() {
1878
1877
  return [1, 0, 0, 1, 0, 0];
@@ -1927,7 +1926,7 @@ function es(n, t, e, i, r, s, o) {
1927
1926
  return o && o.length != a && (o.length = a), o;
1928
1927
  }
1929
1928
  const pi = Ji(), is = [NaN, NaN];
1930
- class Di extends Ni {
1929
+ class Ki extends Ni {
1931
1930
  constructor() {
1932
1931
  super(), this.extent_ = ve(), this.extentRevision_ = -1, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0, this.simplifyTransformedInternal = Ii(
1933
1932
  (t, e, i) => {
@@ -2150,7 +2149,7 @@ class Di extends Ni {
2150
2149
  return this.applyTransform(r), this;
2151
2150
  }
2152
2151
  }
2153
- class Z extends Di {
2152
+ class D extends Ki {
2154
2153
  constructor() {
2155
2154
  super(), this.layout = "XY", this.stride = 2, this.flatCoordinates;
2156
2155
  }
@@ -2268,7 +2267,7 @@ class Z extends Di {
2268
2267
  e = /** @type {Array<unknown>} */
2269
2268
  e[0];
2270
2269
  }
2271
- r = e.length, t = K(r);
2270
+ r = e.length, t = Z(r);
2272
2271
  }
2273
2272
  this.layout = t, this.stride = r;
2274
2273
  }
@@ -2364,7 +2363,7 @@ class Z extends Di {
2364
2363
  }
2365
2364
  }
2366
2365
  }
2367
- function K(n) {
2366
+ function Z(n) {
2368
2367
  let t;
2369
2368
  return n == 2 ? t = "XY" : n == 3 ? t = "XYZ" : n == 4 && (t = "XYZM"), /** @type {import("./Geometry.js").GeometryLayout} */
2370
2369
  t;
@@ -2401,7 +2400,7 @@ function At(n, t, e, i, r) {
2401
2400
  }
2402
2401
  return r.length = s, r;
2403
2402
  }
2404
- function Zi(n, t, e, i, r) {
2403
+ function Di(n, t, e, i, r) {
2405
2404
  r = r || [];
2406
2405
  let s = 0;
2407
2406
  for (let o = 0, a = e.length; o < a; ++o) {
@@ -2416,7 +2415,7 @@ function Zi(n, t, e, i, r) {
2416
2415
  }
2417
2416
  return r.length = s, r;
2418
2417
  }
2419
- function Ki(n, t, e, i) {
2418
+ function Zi(n, t, e, i) {
2420
2419
  const r = [];
2421
2420
  let s = ve();
2422
2421
  for (let o = 0, a = e.length; o < a; ++o) {
@@ -2775,7 +2774,7 @@ function cs(n, t, e, i, r, s, o, a) {
2775
2774
  }
2776
2775
  return o;
2777
2776
  }
2778
- class V extends Di {
2777
+ class V extends Ki {
2779
2778
  /**
2780
2779
  * @param {Array<Geometry>} geometries Geometries.
2781
2780
  */
@@ -2819,7 +2818,7 @@ class V extends Di {
2819
2818
  * @override
2820
2819
  */
2821
2820
  closestPointXY(t, e, i, r) {
2822
- if (r < D(this.getExtent(), t, e))
2821
+ if (r < K(this.getExtent(), t, e))
2823
2822
  return r;
2824
2823
  const s = this.geometries_;
2825
2824
  for (let o = 0, a = s.length; o < a; ++o)
@@ -3184,7 +3183,7 @@ function fs(n, t, e, i, r, s, o, a, l, h, c) {
3184
3183
  }
3185
3184
  return h;
3186
3185
  }
3187
- function Dt(n, t, e, i, r) {
3186
+ function Kt(n, t, e, i, r) {
3188
3187
  r = r !== void 0 ? r : [];
3189
3188
  let s = 0;
3190
3189
  for (let o = t; o < e; o += i)
@@ -3196,7 +3195,7 @@ function Ne(n, t, e, i, r) {
3196
3195
  let s = 0;
3197
3196
  for (let o = 0, a = e.length; o < a; ++o) {
3198
3197
  const l = e[o];
3199
- r[s++] = Dt(
3198
+ r[s++] = Kt(
3200
3199
  n,
3201
3200
  t,
3202
3201
  l,
@@ -3221,7 +3220,7 @@ function gs(n, t, e, i, r) {
3221
3220
  }
3222
3221
  return r.length = s, r;
3223
3222
  }
3224
- class wt extends Z {
3223
+ class wt extends D {
3225
3224
  /**
3226
3225
  * @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
3227
3226
  * For internal use, flat coordinates in combination with `layout` are also accepted.
@@ -3256,7 +3255,7 @@ class wt extends Z {
3256
3255
  * @override
3257
3256
  */
3258
3257
  closestPointXY(t, e, i, r) {
3259
- return r < D(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
3258
+ return r < K(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
3260
3259
  Ie(
3261
3260
  this.flatCoordinates,
3262
3261
  0,
@@ -3297,7 +3296,7 @@ class wt extends Z {
3297
3296
  * @override
3298
3297
  */
3299
3298
  getCoordinates() {
3300
- return Dt(
3299
+ return Kt(
3301
3300
  this.flatCoordinates,
3302
3301
  0,
3303
3302
  this.flatCoordinates.length,
@@ -3367,7 +3366,7 @@ function sn(n, t, e, i, r) {
3367
3366
  return s;
3368
3367
  return !1;
3369
3368
  }
3370
- function Zt(n, t, e, i, r, s) {
3369
+ function Dt(n, t, e, i, r, s) {
3371
3370
  return s = s ?? Hi(ve(), n, t, e, i), wr(r, s) ? s[0] >= r[0] && s[2] <= r[2] || s[1] >= r[1] && s[3] <= r[3] ? !0 : sn(
3372
3371
  n,
3373
3372
  t,
@@ -3386,14 +3385,14 @@ function Zt(n, t, e, i, r, s) {
3386
3385
  }
3387
3386
  function ps(n, t, e, i, r) {
3388
3387
  for (let s = 0, o = e.length; s < o; ++s) {
3389
- if (Zt(n, t, e[s], i, r))
3388
+ if (Dt(n, t, e[s], i, r))
3390
3389
  return !0;
3391
3390
  t = e[s];
3392
3391
  }
3393
3392
  return !1;
3394
3393
  }
3395
3394
  function ys(n, t, e, i, r) {
3396
- return !!(Zt(n, t, e, i, r) || j(
3395
+ return !!(Dt(n, t, e, i, r) || j(
3397
3396
  n,
3398
3397
  t,
3399
3398
  e,
@@ -3435,7 +3434,7 @@ function on(n, t, e, i, r) {
3435
3434
  e[s],
3436
3435
  i,
3437
3436
  r
3438
- ) && !Zt(
3437
+ ) && !Dt(
3439
3438
  n,
3440
3439
  e[s - 1],
3441
3440
  e[s],
@@ -3462,7 +3461,7 @@ function an(n, t, e, i) {
3462
3461
  }
3463
3462
  return o;
3464
3463
  }
3465
- class z extends Z {
3464
+ class z extends D {
3466
3465
  /**
3467
3466
  * @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
3468
3467
  * For internal use, flat coordinates in combination with `layout` are also accepted.
@@ -3509,7 +3508,7 @@ class z extends Z {
3509
3508
  * @override
3510
3509
  */
3511
3510
  closestPointXY(t, e, i, r) {
3512
- return r < D(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
3511
+ return r < K(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
3513
3512
  Ie(
3514
3513
  this.flatCoordinates,
3515
3514
  0,
@@ -3581,7 +3580,7 @@ class z extends Z {
3581
3580
  * @override
3582
3581
  */
3583
3582
  getCoordinates() {
3584
- return Dt(
3583
+ return Kt(
3585
3584
  this.flatCoordinates,
3586
3585
  0,
3587
3586
  this.flatCoordinates.length,
@@ -3667,7 +3666,7 @@ class z extends Z {
3667
3666
  * @override
3668
3667
  */
3669
3668
  intersectsExtent(t) {
3670
- return Zt(
3669
+ return Dt(
3671
3670
  this.flatCoordinates,
3672
3671
  0,
3673
3672
  this.flatCoordinates.length,
@@ -3692,7 +3691,7 @@ class z extends Z {
3692
3691
  ), this.changed();
3693
3692
  }
3694
3693
  }
3695
- class Ct extends Z {
3694
+ class Ct extends D {
3696
3695
  /**
3697
3696
  * @param {Array<Array<import("../coordinate.js").Coordinate>|LineString>|Array<number>} coordinates
3698
3697
  * Coordinates or LineString geometries. (For internal use, flat coordinates in
@@ -3757,7 +3756,7 @@ class Ct extends Z {
3757
3756
  * @override
3758
3757
  */
3759
3758
  closestPointXY(t, e, i, r) {
3760
- return r < D(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
3759
+ return r < K(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
3761
3760
  Le(
3762
3761
  this.flatCoordinates,
3763
3762
  0,
@@ -3962,7 +3961,7 @@ class Ct extends Z {
3962
3961
  this.flatCoordinates.length = i.length === 0 ? 0 : i[i.length - 1], this.changed();
3963
3962
  }
3964
3963
  }
3965
- class J extends Z {
3964
+ class J extends D {
3966
3965
  /**
3967
3966
  * @param {import("../coordinate.js").Coordinate} coordinates Coordinates.
3968
3967
  * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
@@ -4055,7 +4054,7 @@ class J extends Z {
4055
4054
  ), this.changed();
4056
4055
  }
4057
4056
  }
4058
- class Ft extends Z {
4057
+ class Ft extends D {
4059
4058
  /**
4060
4059
  * @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
4061
4060
  * For internal use, flat coordinates in combination with `layout` are also accepted.
@@ -4102,7 +4101,7 @@ class Ft extends Z {
4102
4101
  * @override
4103
4102
  */
4104
4103
  closestPointXY(t, e, i, r) {
4105
- if (r < D(this.getExtent(), t, e))
4104
+ if (r < K(this.getExtent(), t, e))
4106
4105
  return r;
4107
4106
  const s = this.flatCoordinates, o = this.stride;
4108
4107
  for (let a = 0, l = s.length; a < l; a += o) {
@@ -4128,7 +4127,7 @@ class Ft extends Z {
4128
4127
  * @override
4129
4128
  */
4130
4129
  getCoordinates() {
4131
- return Dt(
4130
+ return Kt(
4132
4131
  this.flatCoordinates,
4133
4132
  0,
4134
4133
  this.flatCoordinates.length,
@@ -4205,7 +4204,7 @@ class Ft extends Z {
4205
4204
  ), this.changed();
4206
4205
  }
4207
4206
  }
4208
- class W extends Z {
4207
+ class W extends D {
4209
4208
  /**
4210
4209
  * @param {!Array<Array<import("../coordinate.js").Coordinate>>|!Array<number>} coordinates
4211
4210
  * Array of linear rings that define the polygon. The first linear ring of the
@@ -4259,7 +4258,7 @@ class W extends Z {
4259
4258
  * @override
4260
4259
  */
4261
4260
  closestPointXY(t, e, i, r) {
4262
- return r < D(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
4261
+ return r < K(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
4263
4262
  Le(
4264
4263
  this.flatCoordinates,
4265
4264
  0,
@@ -4489,7 +4488,7 @@ class W extends Z {
4489
4488
  this.flatCoordinates.length = i.length === 0 ? 0 : i[i.length - 1], this.changed();
4490
4489
  }
4491
4490
  }
4492
- class bt extends Z {
4491
+ class bt extends D {
4493
4492
  /**
4494
4493
  * @param {Array<Array<Array<import("../coordinate.js").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates.
4495
4494
  * For internal use, flat coordinates in combination with `layout` and `endss` are also accepted.
@@ -4563,7 +4562,7 @@ class bt extends Z {
4563
4562
  * @override
4564
4563
  */
4565
4564
  closestPointXY(t, e, i, r) {
4566
- return r < D(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
4565
+ return r < K(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
4567
4566
  ds(
4568
4567
  this.flatCoordinates,
4569
4568
  0,
@@ -4653,7 +4652,7 @@ class bt extends Z {
4653
4652
  */
4654
4653
  getFlatInteriorPoints() {
4655
4654
  if (this.flatInteriorPointsRevision_ != this.getRevision()) {
4656
- const t = Ki(
4655
+ const t = Zi(
4657
4656
  this.flatCoordinates,
4658
4657
  0,
4659
4658
  this.endss_,
@@ -4800,7 +4799,7 @@ class bt extends Z {
4800
4799
  */
4801
4800
  setCoordinates(t, e) {
4802
4801
  this.setLayout(e, t, 3), this.flatCoordinates || (this.flatCoordinates = []);
4803
- const i = Zi(
4802
+ const i = Di(
4804
4803
  this.flatCoordinates,
4805
4804
  0,
4806
4805
  t,
@@ -4874,7 +4873,7 @@ class q {
4874
4873
  */
4875
4874
  getFlatInteriorPoints() {
4876
4875
  if (!this.flatInteriorPoints_) {
4877
- const t = ls(this.flatCoordinates_, this.ends_), e = Ki(this.flatCoordinates_, 0, t, 2);
4876
+ const t = ls(this.flatCoordinates_, this.ends_), e = Zi(this.flatCoordinates_, 0, t, 2);
4878
4877
  this.flatInteriorPoints_ = Qi(
4879
4878
  this.flatCoordinates_,
4880
4879
  0,
@@ -5239,7 +5238,7 @@ class ln {
5239
5238
  function Et(n, t, e) {
5240
5239
  const i = e ? x(e.featureProjection) : null, r = e ? x(e.dataProjection) : null;
5241
5240
  let s = n;
5242
- if (i && r && !Zr(i, r)) {
5241
+ if (i && r && !Dr(i, r)) {
5243
5242
  t && (s = /** @type {T} */
5244
5243
  n.clone());
5245
5244
  const o = t ? i : r, a = t ? r : i;
@@ -5737,7 +5736,7 @@ function xs(n) {
5737
5736
  return {
5738
5737
  type: "Point",
5739
5738
  flatCoordinates: t,
5740
- layout: K(t.length)
5739
+ layout: Z(t.length)
5741
5740
  };
5742
5741
  }
5743
5742
  function Ps(n) {
@@ -5747,7 +5746,7 @@ function Ps(n) {
5747
5746
  type: "LineString",
5748
5747
  flatCoordinates: e,
5749
5748
  ends: [e.length],
5750
- layout: K(((i = t[0]) == null ? void 0 : i.length) || 2)
5749
+ layout: Z(((i = t[0]) == null ? void 0 : i.length) || 2)
5751
5750
  };
5752
5751
  }
5753
5752
  function Ms(n) {
@@ -5757,7 +5756,7 @@ function Ms(n) {
5757
5756
  type: "MultiLineString",
5758
5757
  flatCoordinates: i,
5759
5758
  ends: r,
5760
- layout: K(e)
5759
+ layout: Z(e)
5761
5760
  };
5762
5761
  }
5763
5762
  function Ss(n) {
@@ -5766,12 +5765,12 @@ function Ss(n) {
5766
5765
  return {
5767
5766
  type: "MultiPoint",
5768
5767
  flatCoordinates: t.flat(),
5769
- layout: K(((e = t[0]) == null ? void 0 : e.length) || 2)
5768
+ layout: Z(((e = t[0]) == null ? void 0 : e.length) || 2)
5770
5769
  };
5771
5770
  }
5772
5771
  function $s(n) {
5773
5772
  var s, o;
5774
- const t = n.coordinates, e = [], i = ((o = (s = t[0]) == null ? void 0 : s[0]) == null ? void 0 : o[0].length) || 2, r = Zi(
5773
+ const t = n.coordinates, e = [], i = ((o = (s = t[0]) == null ? void 0 : s[0]) == null ? void 0 : o[0].length) || 2, r = Di(
5775
5774
  e,
5776
5775
  0,
5777
5776
  t,
@@ -5781,7 +5780,7 @@ function $s(n) {
5781
5780
  type: "MultiPolygon",
5782
5781
  flatCoordinates: e,
5783
5782
  ends: r,
5784
- layout: K(i)
5783
+ layout: Z(i)
5785
5784
  };
5786
5785
  }
5787
5786
  function As(n) {
@@ -5791,7 +5790,7 @@ function As(n) {
5791
5790
  type: "Polygon",
5792
5791
  flatCoordinates: e,
5793
5792
  ends: r,
5794
- layout: K(i)
5793
+ layout: Z(i)
5795
5794
  };
5796
5795
  }
5797
5796
  function fe(n, t) {
@@ -6626,7 +6625,7 @@ function qs(n) {
6626
6625
  let e = "";
6627
6626
  return (t === "XYZ" || t === "XYZM") && (e += un), (t === "XYM" || t === "XYZM") && (e += dn), e;
6628
6627
  }
6629
- const Ds = {
6628
+ const Ks = {
6630
6629
  Point: fn,
6631
6630
  LineString: je,
6632
6631
  Polygon: gn,
@@ -6636,7 +6635,7 @@ const Ds = {
6636
6635
  GeometryCollection: zs
6637
6636
  };
6638
6637
  function pn(n) {
6639
- const t = n.getType(), e = Ds[t], i = e(n);
6638
+ const t = n.getType(), e = Ks[t], i = e(n);
6640
6639
  let r = Us[t];
6641
6640
  if (typeof /** @type {?} */
6642
6641
  n.getFlatCoordinates == "function") {
@@ -6648,7 +6647,7 @@ function pn(n) {
6648
6647
  }
6649
6648
  return i.length === 0 ? r + " " + cn : r + "(" + i + ")";
6650
6649
  }
6651
- const Zs = (n, t) => new Bs().writeFeatures(n, t);
6650
+ const Ds = (n, t) => new Bs().writeFeatures(n, t);
6652
6651
  /**
6653
6652
  * @license
6654
6653
  * Copyright 2021 Google LLC
@@ -6782,7 +6781,7 @@ R(yn, "properties", {
6782
6781
  unstyled: { type: Boolean }
6783
6782
  });
6784
6783
  customElements.define("eox-drawtools-controller", yn);
6785
- const Ks = `
6784
+ const Zs = `
6786
6785
  button.discard:before {
6787
6786
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
6788
6787
  }
@@ -6933,7 +6932,7 @@ const Ks = `
6933
6932
  o = Os(n.drawnFeatures);
6934
6933
  break;
6935
6934
  case "wkt":
6936
- o = Zs(n.drawnFeatures);
6935
+ o = Ds(n.drawnFeatures);
6937
6936
  break;
6938
6937
  case "feature":
6939
6938
  o = n.drawnFeatures;
@@ -7085,7 +7084,7 @@ class co extends X {
7085
7084
  * @type boolean
7086
7085
  */
7087
7086
  F(this, St);
7088
- this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.layerId = "", this.drawnFeatures = [], this.featureName = "Feature", this.featureStyles = null, this.modify = null, this.multipleFeatures = !1, this.importFeatures = !1, this.showEditor = !1, this.showList = !1, this.projection = "EPSG:4326", this.type = "Polygon", this.selectionEvents = null, this.format = "feature", this.unstyled = !1, this.noShadow = !1;
7087
+ this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.layerId = "", this.drawnFeatures = [], this.featureName = "Feature", this.featureNameKey = null, this.featureStyles = null, this.modify = null, this.multipleFeatures = !1, this.importFeatures = !1, this.showEditor = !1, this.showList = !1, this.projection = "EPSG:4326", this.type = "Polygon", this.selectionEvents = null, this.format = "feature", this.unstyled = !1, this.noShadow = !1;
7089
7088
  }
7090
7089
  // Define properties with defaults and types
7091
7090
  static get properties() {
@@ -7098,6 +7097,7 @@ class co extends X {
7098
7097
  drawLayer: { attribute: !1, state: !0 },
7099
7098
  drawnFeatures: { attribute: !1, state: !0, type: Array },
7100
7099
  featureName: { attribute: "feature-name", type: String },
7100
+ featureNameKey: { attribute: "feature-name-key", type: String },
7101
7101
  layerId: { attribute: "layer-id", type: String },
7102
7102
  featureStyles: { attribute: !1 },
7103
7103
  modify: { attribute: !1, state: !0 },
@@ -7233,7 +7233,7 @@ class co extends X {
7233
7233
  <style>
7234
7234
  :host { display: block; }
7235
7235
  ${!this.unstyled && oo}
7236
- ${!this.unstyled && Ks}
7236
+ ${!this.unstyled && Zs}
7237
7237
  </style>
7238
7238
 
7239
7239
  <!-- Controller Component -->
@@ -7263,6 +7263,7 @@ class co extends X {
7263
7263
  .drawLayer=${this.drawLayer}
7264
7264
  .drawnFeatures=${this.drawnFeatures}
7265
7265
  .featureName=${this.featureName}
7266
+ .featureNameKey=${this.featureNameKey}
7266
7267
  .modify=${this.modify}
7267
7268
  .unstyled=${this.unstyled}
7268
7269
  @changed=${() => {