@eox/drawtools 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-drawtools.js +485 -438
- package/dist/eox-drawtools.umd.cjs +69 -43
- package/package.json +1 -1
- package/src/components/controller.js +35 -3
- package/src/components/list.js +9 -2
- package/src/enums/test.js +1 -0
- package/src/helpers/generate-upload-events.js +11 -5
- package/src/main.js +15 -7
- package/src/methods/draw/create-select-handler.js +2 -2
- package/src/methods/draw/discard-drawing.js +1 -1
- package/src/methods/draw/init-layer.js +32 -5
- package/src/methods/draw/init-selection.js +3 -3
- package/src/methods/draw/on-draw-end.js +1 -1
- package/src/methods/draw/start-drawing.js +2 -2
- package/src/methods/list/delete-feature.js +2 -1
- package/src/style.eox.js +3 -0
- package/types/drawtools/src/components/controller.d.ts.map +1 -1
- package/types/drawtools/src/components/list.d.ts.map +1 -1
- package/types/drawtools/src/enums/test.d.ts +1 -0
- package/types/drawtools/src/helpers/generate-upload-events.d.ts +4 -2
- package/types/drawtools/src/helpers/generate-upload-events.d.ts.map +1 -1
- package/types/drawtools/src/main.d.ts +5 -2
- package/types/drawtools/src/main.d.ts.map +1 -1
- package/types/drawtools/src/methods/draw/init-layer.d.ts +1 -1
- package/types/drawtools/src/methods/draw/init-layer.d.ts.map +1 -1
- package/types/drawtools/src/methods/list/delete-feature.d.ts +1 -1
- package/types/drawtools/src/methods/list/delete-feature.d.ts.map +1 -1
- package/types/drawtools/src/style.eox.d.ts.map +1 -1
- package/types/map/src/custom/sources/Cluster.d.ts +20 -0
- package/types/map/src/custom/sources/Cluster.d.ts.map +1 -0
- package/types/map/src/helpers/add-new-feature.d.ts.map +1 -1
- package/types/map/src/helpers/cluster-explode.d.ts +38 -0
- package/types/map/src/helpers/cluster-explode.d.ts.map +1 -0
- package/types/map/src/helpers/generate.d.ts.map +1 -1
- package/types/map/src/helpers/index.d.ts +1 -0
- package/types/map/src/helpers/parse-feature.d.ts.map +1 -1
- package/types/map/src/helpers/parse-text.d.ts +1 -2
- package/types/map/src/helpers/parse-text.d.ts.map +1 -1
- package/types/map/src/helpers/select.d.ts.map +1 -1
- package/types/map/src/helpers/tile-grid.d.ts +3 -7
- package/types/map/src/helpers/tile-grid.d.ts.map +1 -1
- package/types/map/src/layers.d.ts +3 -2
- package/types/map/src/layers.d.ts.map +1 -1
- package/types/map/src/methods/map/setters.d.ts.map +1 -1
- package/types/map/src/types.d.ts +14 -1
- package/types/map/src/types.d.ts.map +1 -1
package/dist/eox-drawtools.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var vi = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var Ut = (i) => {
|
|
3
3
|
throw TypeError(i);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var ki = (i, e, t) => e in i ? vi(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
6
|
+
var I = (i, e, t) => ki(i, typeof e != "symbol" ? e + "" : e, t), Yt = (i, e, t) => e.has(i) || Ut("Cannot " + t);
|
|
7
|
+
var S = (i, e, t) => (Yt(i, e, "read from private field"), t ? t.call(i) : e.get(i)), A = (i, e, t) => e.has(i) ? Ut("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), P = (i, e, t, r) => (Yt(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t);
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2019 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
let
|
|
13
|
+
const Le = globalThis, ft = Le.ShadowRoot && (Le.ShadyCSS === void 0 || Le.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _r = Symbol(), Xt = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
let xi = class {
|
|
15
15
|
constructor(e, t, r) {
|
|
16
16
|
if (this._$cssResult$ = !0, r !== _r) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
17
17
|
this.cssText = e, this.t = t;
|
|
@@ -19,9 +19,9 @@ let ki = class {
|
|
|
19
19
|
get styleSheet() {
|
|
20
20
|
let e = this.o;
|
|
21
21
|
const t = this.t;
|
|
22
|
-
if (
|
|
22
|
+
if (ft && e === void 0) {
|
|
23
23
|
const r = t !== void 0 && t.length === 1;
|
|
24
|
-
r && (e =
|
|
24
|
+
r && (e = Xt.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && Xt.set(t, e));
|
|
25
25
|
}
|
|
26
26
|
return e;
|
|
27
27
|
}
|
|
@@ -29,13 +29,13 @@ let ki = class {
|
|
|
29
29
|
return this.cssText;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
const _i = (i) => new
|
|
33
|
-
if (
|
|
32
|
+
const _i = (i) => new xi(typeof i == "string" ? i : i + "", void 0, _r), wi = (i, e) => {
|
|
33
|
+
if (ft) i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
34
34
|
else for (const t of e) {
|
|
35
|
-
const r = document.createElement("style"), n =
|
|
35
|
+
const r = document.createElement("style"), n = Le.litNonce;
|
|
36
36
|
n !== void 0 && r.setAttribute("nonce", n), r.textContent = t.cssText, i.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, Bt = ft ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
|
|
39
39
|
let t = "";
|
|
40
40
|
for (const r of e.cssRules) t += r.cssText;
|
|
41
41
|
return _i(t);
|
|
@@ -45,10 +45,10 @@ const _i = (i) => new ki(typeof i == "string" ? i : i + "", void 0, _r), wi = (i
|
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: zi, defineProperty: Ci, getOwnPropertyDescriptor:
|
|
48
|
+
const { is: zi, defineProperty: Ci, getOwnPropertyDescriptor: Mi, getOwnPropertyNames: Si, getOwnPropertySymbols: $i, getPrototypeOf: Pi } = Object, L = globalThis, qt = L.trustedTypes, Ei = qt ? qt.emptyScript : "", De = L.reactiveElementPolyfillSupport, he = (i, e) => i, st = { toAttribute(i, e) {
|
|
49
49
|
switch (e) {
|
|
50
50
|
case Boolean:
|
|
51
|
-
i = i ?
|
|
51
|
+
i = i ? Ei : null;
|
|
52
52
|
break;
|
|
53
53
|
case Object:
|
|
54
54
|
case Array:
|
|
@@ -73,8 +73,8 @@ const { is: zi, defineProperty: Ci, getOwnPropertyDescriptor: Si, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return t;
|
|
76
|
-
} }, wr = (i, e) => !zi(i, e),
|
|
77
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
76
|
+
} }, wr = (i, e) => !zi(i, e), Jt = { attribute: !0, type: String, converter: st, reflect: !1, hasChanged: wr };
|
|
77
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), L.litPropertyMetadata ?? (L.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
78
|
class ee extends HTMLElement {
|
|
79
79
|
static addInitializer(e) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
@@ -82,14 +82,14 @@ class ee extends HTMLElement {
|
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(e, t =
|
|
85
|
+
static createProperty(e, t = Jt) {
|
|
86
86
|
if (t.state && (t.attribute = !1), this._$Ei(), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
87
87
|
const r = Symbol(), n = this.getPropertyDescriptor(e, r, t);
|
|
88
88
|
n !== void 0 && Ci(this.prototype, e, n);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
static getPropertyDescriptor(e, t, r) {
|
|
92
|
-
const { get: n, set: o } =
|
|
92
|
+
const { get: n, set: o } = Mi(this.prototype, e) ?? { get() {
|
|
93
93
|
return this[t];
|
|
94
94
|
}, set(a) {
|
|
95
95
|
this[t] = a;
|
|
@@ -102,17 +102,17 @@ class ee extends HTMLElement {
|
|
|
102
102
|
}, configurable: !0, enumerable: !0 };
|
|
103
103
|
}
|
|
104
104
|
static getPropertyOptions(e) {
|
|
105
|
-
return this.elementProperties.get(e) ??
|
|
105
|
+
return this.elementProperties.get(e) ?? Jt;
|
|
106
106
|
}
|
|
107
107
|
static _$Ei() {
|
|
108
108
|
if (this.hasOwnProperty(he("elementProperties"))) return;
|
|
109
|
-
const e =
|
|
109
|
+
const e = Pi(this);
|
|
110
110
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
111
111
|
}
|
|
112
112
|
static finalize() {
|
|
113
113
|
if (this.hasOwnProperty(he("finalized"))) return;
|
|
114
114
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(he("properties"))) {
|
|
115
|
-
const t = this.properties, r = [...
|
|
115
|
+
const t = this.properties, r = [...Si(t), ...$i(t)];
|
|
116
116
|
for (const n of r) this.createProperty(n, t[n]);
|
|
117
117
|
}
|
|
118
118
|
const e = this[Symbol.metadata];
|
|
@@ -131,8 +131,8 @@ class ee extends HTMLElement {
|
|
|
131
131
|
const t = [];
|
|
132
132
|
if (Array.isArray(e)) {
|
|
133
133
|
const r = new Set(e.flat(1 / 0).reverse());
|
|
134
|
-
for (const n of r) t.unshift(
|
|
135
|
-
} else e !== void 0 && t.push(
|
|
134
|
+
for (const n of r) t.unshift(Bt(n));
|
|
135
|
+
} else e !== void 0 && t.push(Bt(e));
|
|
136
136
|
return t;
|
|
137
137
|
}
|
|
138
138
|
static _$Eu(e, t) {
|
|
@@ -186,7 +186,7 @@ class ee extends HTMLElement {
|
|
|
186
186
|
var o;
|
|
187
187
|
const r = this.constructor.elementProperties.get(e), n = this.constructor._$Eu(e, r);
|
|
188
188
|
if (n !== void 0 && r.reflect === !0) {
|
|
189
|
-
const a = (((o = r.converter) == null ? void 0 : o.toAttribute) !== void 0 ? r.converter :
|
|
189
|
+
const a = (((o = r.converter) == null ? void 0 : o.toAttribute) !== void 0 ? r.converter : st).toAttribute(t, r.type);
|
|
190
190
|
this._$Em = e, a == null ? this.removeAttribute(n) : this.setAttribute(n, a), this._$Em = null;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -194,7 +194,7 @@ class ee extends HTMLElement {
|
|
|
194
194
|
var o;
|
|
195
195
|
const r = this.constructor, n = r._$Eh.get(e);
|
|
196
196
|
if (n !== void 0 && this._$Em !== n) {
|
|
197
|
-
const a = r.getPropertyOptions(n), s = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter :
|
|
197
|
+
const a = r.getPropertyOptions(n), s = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : st;
|
|
198
198
|
this._$Em = n, this[n] = s.fromAttribute(t, a.type), this._$Em = null;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
@@ -273,37 +273,37 @@ class ee extends HTMLElement {
|
|
|
273
273
|
firstUpdated(e) {
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
ee.elementStyles = [], ee.shadowRootOptions = { mode: "open" }, ee[he("elementProperties")] = /* @__PURE__ */ new Map(), ee[he("finalized")] = /* @__PURE__ */ new Map(), De == null || De({ ReactiveElement: ee }), (
|
|
276
|
+
ee.elementStyles = [], ee.shadowRootOptions = { mode: "open" }, ee[he("elementProperties")] = /* @__PURE__ */ new Map(), ee[he("finalized")] = /* @__PURE__ */ new Map(), De == null || De({ ReactiveElement: ee }), (L.reactiveElementVersions ?? (L.reactiveElementVersions = [])).push("2.0.4");
|
|
277
277
|
/**
|
|
278
278
|
* @license
|
|
279
279
|
* Copyright 2017 Google LLC
|
|
280
280
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
281
281
|
*/
|
|
282
|
-
const me = globalThis,
|
|
283
|
-
\f\r]`, ue = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
285
|
-
function
|
|
286
|
-
if (!
|
|
287
|
-
return
|
|
288
|
-
}
|
|
289
|
-
const
|
|
282
|
+
const me = globalThis, Ie = me.trustedTypes, Wt = Ie ? Ie.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, zr = "$lit$", F = `lit$${Math.random().toFixed(9).slice(2)}$`, Cr = "?" + F, Ai = `<${Cr}>`, U = document, pe = () => U.createComment(""), ge = (i) => i === null || typeof i != "object" && typeof i != "function", bt = Array.isArray, Fi = (i) => bt(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", Qe = `[
|
|
283
|
+
\f\r]`, ue = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Zt = /-->/g, Kt = />/g, R = RegExp(`>|${Qe}(?:([^\\s"'>=/]+)(${Qe}*=${Qe}*(?:[^
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Dt = /'/g, Qt = /"/g, Mr = /^(?:script|style|textarea|title)$/i, Li = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), k = Li(1), ae = Symbol.for("lit-noChange"), x = Symbol.for("lit-nothing"), er = /* @__PURE__ */ new WeakMap(), T = U.createTreeWalker(U, 129);
|
|
285
|
+
function Sr(i, e) {
|
|
286
|
+
if (!bt(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
|
+
return Wt !== void 0 ? Wt.createHTML(e) : e;
|
|
288
|
+
}
|
|
289
|
+
const Gi = (i, e) => {
|
|
290
290
|
const t = i.length - 1, r = [];
|
|
291
291
|
let n, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = ue;
|
|
292
292
|
for (let s = 0; s < t; s++) {
|
|
293
293
|
const l = i[s];
|
|
294
294
|
let c, d, u = -1, h = 0;
|
|
295
|
-
for (; h < l.length && (a.lastIndex = h, d = a.exec(l), d !== null); ) h = a.lastIndex, a === ue ? d[1] === "!--" ? a =
|
|
295
|
+
for (; h < l.length && (a.lastIndex = h, d = a.exec(l), d !== null); ) h = a.lastIndex, a === ue ? d[1] === "!--" ? a = Zt : d[1] !== void 0 ? a = Kt : d[2] !== void 0 ? (Mr.test(d[2]) && (n = RegExp("</" + d[2], "g")), a = R) : d[3] !== void 0 && (a = R) : a === R ? d[0] === ">" ? (a = n ?? ue, u = -1) : d[1] === void 0 ? u = -2 : (u = a.lastIndex - d[2].length, c = d[1], a = d[3] === void 0 ? R : d[3] === '"' ? Qt : Dt) : a === Qt || a === Dt ? a = R : a === Zt || a === Kt ? a = ue : (a = R, n = void 0);
|
|
296
296
|
const m = a === R && i[s + 1].startsWith("/>") ? " " : "";
|
|
297
297
|
o += a === ue ? l + Ai : u >= 0 ? (r.push(c), l.slice(0, u) + zr + l.slice(u) + F + m) : l + F + (u === -2 ? s : m);
|
|
298
298
|
}
|
|
299
|
-
return [
|
|
299
|
+
return [Sr(i, o + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
|
|
300
300
|
};
|
|
301
301
|
class fe {
|
|
302
302
|
constructor({ strings: e, _$litType$: t }, r) {
|
|
303
303
|
let n;
|
|
304
304
|
this.parts = [];
|
|
305
305
|
let o = 0, a = 0;
|
|
306
|
-
const s = e.length - 1, l = this.parts, [c, d] =
|
|
306
|
+
const s = e.length - 1, l = this.parts, [c, d] = Gi(e, t);
|
|
307
307
|
if (this.el = fe.createElement(c, r), T.currentNode = this.el.content, t === 2 || t === 3) {
|
|
308
308
|
const u = this.el.content.firstChild;
|
|
309
309
|
u.replaceWith(...u.childNodes);
|
|
@@ -314,10 +314,10 @@ class fe {
|
|
|
314
314
|
const h = d[a++], m = n.getAttribute(u).split(F), p = /([.?@])?(.*)/.exec(h);
|
|
315
315
|
l.push({ type: 1, index: o, name: p[2], strings: m, ctor: p[1] === "." ? Ri : p[1] === "?" ? Ni : p[1] === "@" ? Ti : Ve }), n.removeAttribute(u);
|
|
316
316
|
} else u.startsWith(F) && (l.push({ type: 6, index: o }), n.removeAttribute(u));
|
|
317
|
-
if (
|
|
317
|
+
if (Mr.test(n.tagName)) {
|
|
318
318
|
const u = n.textContent.split(F), h = u.length - 1;
|
|
319
319
|
if (h > 0) {
|
|
320
|
-
n.textContent =
|
|
320
|
+
n.textContent = Ie ? Ie.emptyScript : "";
|
|
321
321
|
for (let m = 0; m < h; m++) n.append(u[m], pe()), T.nextNode(), l.push({ type: 2, index: ++o });
|
|
322
322
|
n.append(u[h], pe());
|
|
323
323
|
}
|
|
@@ -342,7 +342,7 @@ function se(i, e, t = i, r) {
|
|
|
342
342
|
const o = ge(e) ? void 0 : e._$litDirective$;
|
|
343
343
|
return (n == null ? void 0 : n.constructor) !== o && ((s = n == null ? void 0 : n._$AO) == null || s.call(n, !1), o === void 0 ? n = void 0 : (n = new o(i), n._$AT(i, t, r)), r !== void 0 ? (t._$Co ?? (t._$Co = []))[r] = n : t._$Cl = n), n !== void 0 && (e = se(i, n._$AS(i, e.values), n, r)), e;
|
|
344
344
|
}
|
|
345
|
-
let
|
|
345
|
+
let Ii = class {
|
|
346
346
|
constructor(e, t) {
|
|
347
347
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
348
348
|
}
|
|
@@ -359,7 +359,7 @@ let Li = class {
|
|
|
359
359
|
for (; l !== void 0; ) {
|
|
360
360
|
if (a === l.index) {
|
|
361
361
|
let c;
|
|
362
|
-
l.type === 2 ? c = new
|
|
362
|
+
l.type === 2 ? c = new yt(o, o.nextSibling, this, e) : l.type === 1 ? c = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (c = new Oi(o, this, e)), this._$AV.push(c), l = r[++s];
|
|
363
363
|
}
|
|
364
364
|
a !== (l == null ? void 0 : l.index) && (o = T.nextNode(), a++);
|
|
365
365
|
}
|
|
@@ -369,7 +369,7 @@ let Li = class {
|
|
|
369
369
|
let t = 0;
|
|
370
370
|
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, t), t += r.strings.length - 2) : r._$AI(e[t])), t++;
|
|
371
371
|
}
|
|
372
|
-
},
|
|
372
|
+
}, yt = class $r {
|
|
373
373
|
get _$AU() {
|
|
374
374
|
var e;
|
|
375
375
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
@@ -402,22 +402,22 @@ let Li = class {
|
|
|
402
402
|
}
|
|
403
403
|
$(e) {
|
|
404
404
|
var o;
|
|
405
|
-
const { values: t, _$litType$: r } = e, n = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = fe.createElement(
|
|
405
|
+
const { values: t, _$litType$: r } = e, n = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = fe.createElement(Sr(r.h, r.h[0]), this.options)), r);
|
|
406
406
|
if (((o = this._$AH) == null ? void 0 : o._$AD) === n) this._$AH.p(t);
|
|
407
407
|
else {
|
|
408
|
-
const a = new
|
|
408
|
+
const a = new Ii(n, this), s = a.u(this.options);
|
|
409
409
|
a.p(t), this.T(s), this._$AH = a;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
_$AC(e) {
|
|
413
|
-
let t =
|
|
414
|
-
return t === void 0 &&
|
|
413
|
+
let t = er.get(e.strings);
|
|
414
|
+
return t === void 0 && er.set(e.strings, t = new fe(e)), t;
|
|
415
415
|
}
|
|
416
416
|
k(e) {
|
|
417
|
-
|
|
417
|
+
bt(this._$AH) || (this._$AH = [], this._$AR());
|
|
418
418
|
const t = this._$AH;
|
|
419
419
|
let r, n = 0;
|
|
420
|
-
for (const o of e) n === t.length ? t.push(r = new
|
|
420
|
+
for (const o of e) n === t.length ? t.push(r = new $r(this.O(pe()), this.O(pe()), this, this.options)) : r = t[n], r._$AI(o), n++;
|
|
421
421
|
n < t.length && (this._$AR(r && r._$AB.nextSibling, n), t.length = n);
|
|
422
422
|
}
|
|
423
423
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
@@ -499,13 +499,13 @@ class Oi {
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
const et = me.litHtmlPolyfillSupport;
|
|
502
|
-
et == null || et(fe,
|
|
502
|
+
et == null || et(fe, yt), (me.litHtmlVersions ?? (me.litHtmlVersions = [])).push("3.2.1");
|
|
503
503
|
const Hi = (i, e, t) => {
|
|
504
504
|
const r = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
505
505
|
let n = r._$litPart$;
|
|
506
506
|
if (n === void 0) {
|
|
507
507
|
const o = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
508
|
-
r._$litPart$ = n = new
|
|
508
|
+
r._$litPart$ = n = new yt(e.insertBefore(pe(), o), o, void 0, t ?? {});
|
|
509
509
|
}
|
|
510
510
|
return n._$AI(i), n;
|
|
511
511
|
};
|
|
@@ -539,8 +539,8 @@ class j extends ee {
|
|
|
539
539
|
return ae;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
var
|
|
543
|
-
j._$litElement$ = !0, j.finalized = !0, (
|
|
542
|
+
var xr;
|
|
543
|
+
j._$litElement$ = !0, j.finalized = !0, (xr = globalThis.litElementHydrateSupport) == null || xr.call(globalThis, { LitElement: j });
|
|
544
544
|
const tt = globalThis.litElementPolyfillSupport;
|
|
545
545
|
tt == null || tt({ LitElement: j });
|
|
546
546
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
@@ -603,46 +603,46 @@ const Xi = ji(class extends Vi {
|
|
|
603
603
|
if (i.clickId === e) return;
|
|
604
604
|
const r = t ? [] : [e];
|
|
605
605
|
i.hoverInteraction.highlightById(r);
|
|
606
|
-
}, Ji = (i, e) => {
|
|
606
|
+
}, Ji = (i, e, t) => {
|
|
607
607
|
i.stopPropagation();
|
|
608
|
-
const
|
|
609
|
-
e.drawLayer.getSource().removeFeature(
|
|
610
|
-
},
|
|
608
|
+
const r = Number(i.target.getAttribute("index")), n = e.drawLayer.getSource().getFeatures()[r];
|
|
609
|
+
e.drawLayer.getSource().removeFeature(n), e.drawnFeatures.splice(r, 1), t.emitDrawnFeatures(), e.requestUpdate();
|
|
610
|
+
}, tr = {
|
|
611
611
|
duration: 750,
|
|
612
612
|
padding: [20, 20, 20, 20]
|
|
613
|
-
},
|
|
613
|
+
}, rr = {
|
|
614
614
|
type: "FeatureCollection",
|
|
615
615
|
features: []
|
|
616
616
|
}, Wi = (i, e) => {
|
|
617
617
|
const { clickId: t, drawLayer: r, olMap: n, clickInteraction: o } = e, a = o.getId(i);
|
|
618
618
|
if (t === a) {
|
|
619
619
|
const l = r.getSource().getExtent();
|
|
620
|
-
n.getView().fit(l,
|
|
620
|
+
n.getView().fit(l, tr), o.highlightById([]);
|
|
621
621
|
} else {
|
|
622
622
|
const l = e.eoxMap.projection || "EPSG:3857", c = e.eoxDrawTools.projection, d = i.clone().getGeometry().transform(c, l).getExtent();
|
|
623
|
-
o.highlightById([a]), n.getView().fit(d,
|
|
623
|
+
o.highlightById([a]), n.getView().fit(d, tr);
|
|
624
624
|
}
|
|
625
625
|
e.requestUpdate();
|
|
626
626
|
};
|
|
627
|
-
class
|
|
627
|
+
class Pr extends j {
|
|
628
628
|
constructor() {
|
|
629
629
|
super();
|
|
630
630
|
/**
|
|
631
631
|
* @type {import("@eox/map").EOxMap["selectInteractions"][string]}
|
|
632
632
|
*/
|
|
633
|
-
|
|
633
|
+
I(this, "hoverInteraction");
|
|
634
634
|
/**
|
|
635
635
|
* @type {import("@eox/map").EOxMap["selectInteractions"][string]}
|
|
636
636
|
*/
|
|
637
|
-
|
|
637
|
+
I(this, "clickInteraction");
|
|
638
638
|
/**
|
|
639
639
|
* @type string | number
|
|
640
640
|
*/
|
|
641
|
-
|
|
641
|
+
I(this, "hoverId");
|
|
642
642
|
/**
|
|
643
643
|
* @type string | number
|
|
644
644
|
*/
|
|
645
|
-
|
|
645
|
+
I(this, "clickId");
|
|
646
646
|
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;
|
|
647
647
|
}
|
|
648
648
|
/**
|
|
@@ -651,7 +651,7 @@ class Er extends j {
|
|
|
651
651
|
* @param {Event & { target: HTMLButtonElement }} evt - Event object containing button target.
|
|
652
652
|
*/
|
|
653
653
|
_handleDelete(t) {
|
|
654
|
-
Ji(t, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
|
|
654
|
+
Ji(t, this, this.eoxDrawTools), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
|
|
655
655
|
}
|
|
656
656
|
/**
|
|
657
657
|
* Handles the selection and deselection of a feature from the list.
|
|
@@ -696,9 +696,12 @@ class Er extends j {
|
|
|
696
696
|
return k`
|
|
697
697
|
<ul class="list no-space">
|
|
698
698
|
${this.drawnFeatures.map((o, a) => {
|
|
699
|
+
var g;
|
|
699
700
|
const s = a + 1, l = Object.values(
|
|
700
701
|
this.eoxMap.selectInteractions
|
|
701
|
-
)[0].getId(o), c = this.hoverId === l, d = this.clickId === l, u = c ? "surface-container-low" : d ? "fill" : x, h =
|
|
702
|
+
)[0].getId(o), c = this.hoverId === l, d = this.clickId === l, u = c ? "surface-container-low" : d ? "fill" : x, h = (g = this.featureNameKey) == null ? void 0 : g.split("."), m = o.get(this.featureNameKey) || (h == null ? void 0 : h.reduce((f, _) => f == null ? void 0 : f[_], {
|
|
703
|
+
...o.getProperties()
|
|
704
|
+
})), p = m || `${this.featureName} ${s}`;
|
|
702
705
|
return Xi(
|
|
703
706
|
s,
|
|
704
707
|
k`
|
|
@@ -709,7 +712,7 @@ class Er extends j {
|
|
|
709
712
|
@click="${() => this._handleFeatureSelectAndDeselect(o)}"
|
|
710
713
|
>
|
|
711
714
|
<div class="max">
|
|
712
|
-
<span class="title">${
|
|
715
|
+
<span class="title">${p}</span>
|
|
713
716
|
</div>
|
|
714
717
|
<button
|
|
715
718
|
index=${a}
|
|
@@ -727,7 +730,7 @@ class Er extends j {
|
|
|
727
730
|
`;
|
|
728
731
|
}
|
|
729
732
|
}
|
|
730
|
-
|
|
733
|
+
I(Pr, "properties", {
|
|
731
734
|
eoxDrawTools: { attribute: !1, state: !0 },
|
|
732
735
|
eoxMap: { attribute: !1, state: !0 },
|
|
733
736
|
olMap: { attribute: !1, state: !0 },
|
|
@@ -739,7 +742,7 @@ L(Er, "properties", {
|
|
|
739
742
|
modify: { attribute: !1, state: !0 },
|
|
740
743
|
unstyled: { type: Boolean }
|
|
741
744
|
});
|
|
742
|
-
customElements.define("eox-drawtools-list",
|
|
745
|
+
customElements.define("eox-drawtools-list", Pr);
|
|
743
746
|
const Zi = (i) => {
|
|
744
747
|
const { multipleFeatures: e, drawnFeatures: t, currentlyDrawing: r } = i, n = !e && (t == null ? void 0 : t.length) > 0 || r, o = !(t != null && t.length) && !r;
|
|
745
748
|
return { drawDisabled: n, discardDisabled: o };
|
|
@@ -760,7 +763,7 @@ const Di = {
|
|
|
760
763
|
* @api
|
|
761
764
|
*/
|
|
762
765
|
PROPERTYCHANGE: "propertychange"
|
|
763
|
-
},
|
|
766
|
+
}, vt = {
|
|
764
767
|
/**
|
|
765
768
|
* Generic change event. Triggered when the revision counter is increased.
|
|
766
769
|
* @event module:ol/events/Event~BaseEvent#change
|
|
@@ -787,16 +790,16 @@ class Qi {
|
|
|
787
790
|
}
|
|
788
791
|
function en(i, e, t) {
|
|
789
792
|
let r, n;
|
|
790
|
-
t = t ||
|
|
793
|
+
t = t || Er;
|
|
791
794
|
let o = 0, a = i.length, s = !1;
|
|
792
795
|
for (; o < a; )
|
|
793
796
|
r = o + (a - o >> 1), n = +t(i[r], e), n < 0 ? o = r + 1 : (a = r, s = !n);
|
|
794
797
|
return s ? o : ~o;
|
|
795
798
|
}
|
|
796
|
-
function
|
|
799
|
+
function Er(i, e) {
|
|
797
800
|
return i > e ? 1 : i < e ? -1 : 0;
|
|
798
801
|
}
|
|
799
|
-
function
|
|
802
|
+
function E(i, e) {
|
|
800
803
|
const t = Array.isArray(e) ? e : [e], r = t.length;
|
|
801
804
|
for (let n = 0; n < r; n++)
|
|
802
805
|
i[i.length] = t[n];
|
|
@@ -810,7 +813,7 @@ function tn(i, e) {
|
|
|
810
813
|
return !1;
|
|
811
814
|
return !0;
|
|
812
815
|
}
|
|
813
|
-
function
|
|
816
|
+
function ir() {
|
|
814
817
|
}
|
|
815
818
|
function Ar(i) {
|
|
816
819
|
let e, t, r;
|
|
@@ -823,13 +826,13 @@ function Fr(i) {
|
|
|
823
826
|
for (const e in i)
|
|
824
827
|
delete i[e];
|
|
825
828
|
}
|
|
826
|
-
function
|
|
829
|
+
function Lr(i) {
|
|
827
830
|
let e;
|
|
828
831
|
for (e in i)
|
|
829
832
|
return !1;
|
|
830
833
|
return !e;
|
|
831
834
|
}
|
|
832
|
-
class
|
|
835
|
+
class Gr {
|
|
833
836
|
/**
|
|
834
837
|
* @param {string} type Type.
|
|
835
838
|
*/
|
|
@@ -883,7 +886,7 @@ class rn extends Qi {
|
|
|
883
886
|
const t = typeof e == "string", r = t ? e : e.type, n = this.listeners_ && this.listeners_[r];
|
|
884
887
|
if (!n)
|
|
885
888
|
return;
|
|
886
|
-
const o = t ? new
|
|
889
|
+
const o = t ? new Gr(e) : (
|
|
887
890
|
/** @type {Event} */
|
|
888
891
|
e
|
|
889
892
|
);
|
|
@@ -901,7 +904,7 @@ class rn extends Qi {
|
|
|
901
904
|
if (--a[r] === 0) {
|
|
902
905
|
let c = s[r];
|
|
903
906
|
for (delete s[r]; c--; )
|
|
904
|
-
this.removeEventListener(r,
|
|
907
|
+
this.removeEventListener(r, ir);
|
|
905
908
|
delete a[r];
|
|
906
909
|
}
|
|
907
910
|
return l;
|
|
@@ -942,7 +945,7 @@ class rn extends Qi {
|
|
|
942
945
|
if (!r)
|
|
943
946
|
return;
|
|
944
947
|
const n = r.indexOf(t);
|
|
945
|
-
n !== -1 && (this.pendingRemovals_ && e in this.pendingRemovals_ ? (r[n] =
|
|
948
|
+
n !== -1 && (this.pendingRemovals_ && e in this.pendingRemovals_ ? (r[n] = ir, ++this.pendingRemovals_[e]) : (r.splice(n, 1), r.length === 0 && delete this.listeners_[e]));
|
|
946
949
|
}
|
|
947
950
|
}
|
|
948
951
|
function be(i, e, t, r, n) {
|
|
@@ -959,7 +962,7 @@ function be(i, e, t, r, n) {
|
|
|
959
962
|
};
|
|
960
963
|
return i.addEventListener(e, t), o;
|
|
961
964
|
}
|
|
962
|
-
function
|
|
965
|
+
function nr(i, e, t, r) {
|
|
963
966
|
return be(i, e, t, r, !0);
|
|
964
967
|
}
|
|
965
968
|
function Re(i) {
|
|
@@ -977,7 +980,7 @@ class Ue extends rn {
|
|
|
977
980
|
* @api
|
|
978
981
|
*/
|
|
979
982
|
changed() {
|
|
980
|
-
++this.revision_, this.dispatchEvent(
|
|
983
|
+
++this.revision_, this.dispatchEvent(vt.CHANGE);
|
|
981
984
|
}
|
|
982
985
|
/**
|
|
983
986
|
* Get the version number for this object. Each time the object is modified,
|
|
@@ -1020,9 +1023,9 @@ class Ue extends rn {
|
|
|
1020
1023
|
const n = e.length;
|
|
1021
1024
|
r = new Array(n);
|
|
1022
1025
|
for (let o = 0; o < n; ++o)
|
|
1023
|
-
r[o] =
|
|
1026
|
+
r[o] = nr(this, e[o], t);
|
|
1024
1027
|
} else
|
|
1025
|
-
r =
|
|
1028
|
+
r = nr(
|
|
1026
1029
|
this,
|
|
1027
1030
|
/** @type {string} */
|
|
1028
1031
|
e,
|
|
@@ -1063,14 +1066,14 @@ function nn(i) {
|
|
|
1063
1066
|
i
|
|
1064
1067
|
);
|
|
1065
1068
|
}
|
|
1066
|
-
function
|
|
1069
|
+
function b() {
|
|
1067
1070
|
throw new Error("Unimplemented abstract method.");
|
|
1068
1071
|
}
|
|
1069
1072
|
let on = 0;
|
|
1070
1073
|
function an(i) {
|
|
1071
1074
|
return i.ol_uid || (i.ol_uid = String(++on));
|
|
1072
1075
|
}
|
|
1073
|
-
class
|
|
1076
|
+
class or extends Gr {
|
|
1074
1077
|
/**
|
|
1075
1078
|
* @param {string} type The event type.
|
|
1076
1079
|
* @param {string} key The property name.
|
|
@@ -1080,7 +1083,7 @@ class ir extends Ir {
|
|
|
1080
1083
|
super(e), this.key = t, this.oldValue = r;
|
|
1081
1084
|
}
|
|
1082
1085
|
}
|
|
1083
|
-
class
|
|
1086
|
+
class Ir extends Ue {
|
|
1084
1087
|
/**
|
|
1085
1088
|
* @param {Object<string, *>} [values] An object with key-value pairs.
|
|
1086
1089
|
*/
|
|
@@ -1132,7 +1135,7 @@ class Lr extends Ue {
|
|
|
1132
1135
|
*/
|
|
1133
1136
|
notify(e, t) {
|
|
1134
1137
|
let r;
|
|
1135
|
-
r = `change:${e}`, this.hasListener(r) && this.dispatchEvent(new
|
|
1138
|
+
r = `change:${e}`, this.hasListener(r) && this.dispatchEvent(new or(r, e, t)), r = Di.PROPERTYCHANGE, this.hasListener(r) && this.dispatchEvent(new or(r, e, t));
|
|
1136
1139
|
}
|
|
1137
1140
|
/**
|
|
1138
1141
|
* @param {string} key Key name.
|
|
@@ -1192,7 +1195,7 @@ class Lr extends Ue {
|
|
|
1192
1195
|
unset(e, t) {
|
|
1193
1196
|
if (this.values_ && e in this.values_) {
|
|
1194
1197
|
const r = this.values_[e];
|
|
1195
|
-
delete this.values_[e],
|
|
1198
|
+
delete this.values_[e], Lr(this.values_) && (this.values_ = null), t || this.notify(e, r);
|
|
1196
1199
|
}
|
|
1197
1200
|
}
|
|
1198
1201
|
}
|
|
@@ -1200,7 +1203,7 @@ function sn(i, e) {
|
|
|
1200
1203
|
if (!i)
|
|
1201
1204
|
throw new Error(e);
|
|
1202
1205
|
}
|
|
1203
|
-
class le extends
|
|
1206
|
+
class le extends Ir {
|
|
1204
1207
|
/**
|
|
1205
1208
|
* @param {Geometry|ObjectWithGeometry<Geometry>} [geometryOrProperties]
|
|
1206
1209
|
* You may pass a Geometry object directly, or an object literal containing
|
|
@@ -1307,7 +1310,7 @@ class le extends Lr {
|
|
|
1307
1310
|
const e = this.getGeometry();
|
|
1308
1311
|
e && (this.geometryChangeKey_ = be(
|
|
1309
1312
|
e,
|
|
1310
|
-
|
|
1313
|
+
vt.CHANGE,
|
|
1311
1314
|
this.handleGeometryChange_,
|
|
1312
1315
|
this
|
|
1313
1316
|
)), this.changed();
|
|
@@ -1372,7 +1375,7 @@ function ln(i) {
|
|
|
1372
1375
|
return e;
|
|
1373
1376
|
};
|
|
1374
1377
|
}
|
|
1375
|
-
const
|
|
1378
|
+
const w = {
|
|
1376
1379
|
UNKNOWN: 0,
|
|
1377
1380
|
INTERSECTING: 1,
|
|
1378
1381
|
ABOVE: 2,
|
|
@@ -1387,26 +1390,26 @@ function W(i, e, t) {
|
|
|
1387
1390
|
function Rr(i, e, t) {
|
|
1388
1391
|
return i[0] <= e && e <= i[2] && i[1] <= t && t <= i[3];
|
|
1389
1392
|
}
|
|
1390
|
-
function
|
|
1393
|
+
function ar(i, e) {
|
|
1391
1394
|
const t = i[0], r = i[1], n = i[2], o = i[3], a = e[0], s = e[1];
|
|
1392
|
-
let l =
|
|
1393
|
-
return a < t ? l = l |
|
|
1395
|
+
let l = w.UNKNOWN;
|
|
1396
|
+
return a < t ? l = l | w.LEFT : a > n && (l = l | w.RIGHT), s < r ? l = l | w.BELOW : s > o && (l = l | w.ABOVE), l === w.UNKNOWN && (l = w.INTERSECTING), l;
|
|
1394
1397
|
}
|
|
1395
|
-
function
|
|
1398
|
+
function kt() {
|
|
1396
1399
|
return [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
1397
1400
|
}
|
|
1398
1401
|
function Nr(i, e, t, r, n) {
|
|
1399
1402
|
return n ? (n[0] = i, n[1] = e, n[2] = t, n[3] = r, n) : [i, e, t, r];
|
|
1400
1403
|
}
|
|
1401
|
-
function
|
|
1404
|
+
function xt(i) {
|
|
1402
1405
|
return Nr(1 / 0, 1 / 0, -1 / 0, -1 / 0, i);
|
|
1403
1406
|
}
|
|
1404
1407
|
function Tr(i, e) {
|
|
1405
1408
|
const t = i[0], r = i[1];
|
|
1406
1409
|
return Nr(t, r, t, r, e);
|
|
1407
1410
|
}
|
|
1408
|
-
function
|
|
1409
|
-
const o =
|
|
1411
|
+
function _t(i, e, t, r, n) {
|
|
1412
|
+
const o = xt(n);
|
|
1410
1413
|
return Or(o, i, e, t, r);
|
|
1411
1414
|
}
|
|
1412
1415
|
function cn(i, e) {
|
|
@@ -1450,13 +1453,13 @@ function bn(i, e) {
|
|
|
1450
1453
|
}
|
|
1451
1454
|
function yn(i, e, t) {
|
|
1452
1455
|
let r = !1;
|
|
1453
|
-
const n =
|
|
1454
|
-
if (n ===
|
|
1456
|
+
const n = ar(i, e), o = ar(i, t);
|
|
1457
|
+
if (n === w.INTERSECTING || o === w.INTERSECTING)
|
|
1455
1458
|
r = !0;
|
|
1456
1459
|
else {
|
|
1457
1460
|
const a = i[0], s = i[1], l = i[2], c = i[3], d = e[0], u = e[1], h = t[0], m = t[1], p = (m - u) / (h - d);
|
|
1458
|
-
let g,
|
|
1459
|
-
o &
|
|
1461
|
+
let g, f;
|
|
1462
|
+
o & w.ABOVE && !(n & w.ABOVE) && (g = h - (m - c) / p, r = g >= a && g <= l), !r && o & w.RIGHT && !(n & w.RIGHT) && (f = m - (h - l) * p, r = f >= s && f <= c), !r && o & w.BELOW && !(n & w.BELOW) && (g = h - (m - s) / p, r = g >= a && g <= l), !r && o & w.LEFT && !(n & w.LEFT) && (f = m - (h - a) * p, r = f >= s && f <= c);
|
|
1460
1463
|
}
|
|
1461
1464
|
return r;
|
|
1462
1465
|
}
|
|
@@ -1472,22 +1475,22 @@ function V(i, e, t, r) {
|
|
|
1472
1475
|
const n = t - i, o = r - e;
|
|
1473
1476
|
return n * n + o * o;
|
|
1474
1477
|
}
|
|
1475
|
-
function
|
|
1478
|
+
function sr(i) {
|
|
1476
1479
|
return i * 180 / Math.PI;
|
|
1477
1480
|
}
|
|
1478
|
-
function
|
|
1481
|
+
function Ge(i) {
|
|
1479
1482
|
return i * Math.PI / 180;
|
|
1480
1483
|
}
|
|
1481
|
-
function
|
|
1484
|
+
function wt(i, e, t) {
|
|
1482
1485
|
return i + t * (e - i);
|
|
1483
1486
|
}
|
|
1484
|
-
function
|
|
1487
|
+
function lt(i, e, t) {
|
|
1485
1488
|
if (i >= e && i < t)
|
|
1486
1489
|
return i;
|
|
1487
1490
|
const r = t - e;
|
|
1488
1491
|
return ((i - e) % r + r) % r + e;
|
|
1489
1492
|
}
|
|
1490
|
-
const
|
|
1493
|
+
const kn = {
|
|
1491
1494
|
// use the radius of the Normal sphere
|
|
1492
1495
|
radians: 6370997 / (2 * Math.PI),
|
|
1493
1496
|
degrees: 2 * Math.PI * 6370997 / 360,
|
|
@@ -1495,7 +1498,7 @@ const xn = {
|
|
|
1495
1498
|
m: 1,
|
|
1496
1499
|
"us-ft": 1200 / 3937
|
|
1497
1500
|
};
|
|
1498
|
-
class
|
|
1501
|
+
class zt {
|
|
1499
1502
|
/**
|
|
1500
1503
|
* @param {Options} options Projection options.
|
|
1501
1504
|
*/
|
|
@@ -1541,7 +1544,7 @@ class _t {
|
|
|
1541
1544
|
* @api
|
|
1542
1545
|
*/
|
|
1543
1546
|
getMetersPerUnit() {
|
|
1544
|
-
return this.metersPerUnit_ ||
|
|
1547
|
+
return this.metersPerUnit_ || kn[this.units_];
|
|
1545
1548
|
}
|
|
1546
1549
|
/**
|
|
1547
1550
|
* Get the world extent for this projection.
|
|
@@ -1628,8 +1631,8 @@ class _t {
|
|
|
1628
1631
|
return this.getPointResolutionFunc_;
|
|
1629
1632
|
}
|
|
1630
1633
|
}
|
|
1631
|
-
const
|
|
1632
|
-
class D extends
|
|
1634
|
+
const Se = 6378137, te = Math.PI * Se, xn = [-te, -te, te, te], _n = [-180, -85, 180, 85], Ee = Se * Math.log(Math.tan(Math.PI / 2));
|
|
1635
|
+
class D extends zt {
|
|
1633
1636
|
/**
|
|
1634
1637
|
* @param {string} code Code.
|
|
1635
1638
|
*/
|
|
@@ -1637,16 +1640,16 @@ class D extends _t {
|
|
|
1637
1640
|
super({
|
|
1638
1641
|
code: e,
|
|
1639
1642
|
units: "m",
|
|
1640
|
-
extent:
|
|
1643
|
+
extent: xn,
|
|
1641
1644
|
global: !0,
|
|
1642
1645
|
worldExtent: _n,
|
|
1643
1646
|
getPointResolution: function(t, r) {
|
|
1644
|
-
return t / Math.cosh(r[1] /
|
|
1647
|
+
return t / Math.cosh(r[1] / Se);
|
|
1645
1648
|
}
|
|
1646
1649
|
});
|
|
1647
1650
|
}
|
|
1648
1651
|
}
|
|
1649
|
-
const
|
|
1652
|
+
const lr = [
|
|
1650
1653
|
new D("EPSG:3857"),
|
|
1651
1654
|
new D("EPSG:102100"),
|
|
1652
1655
|
new D("EPSG:102113"),
|
|
@@ -1659,8 +1662,8 @@ function wn(i, e, t, r) {
|
|
|
1659
1662
|
t = t > 1 ? t : 2, r = r ?? t, e === void 0 && (t > 2 ? e = i.slice() : e = new Array(n));
|
|
1660
1663
|
for (let o = 0; o < n; o += r) {
|
|
1661
1664
|
e[o] = te * i[o] / 180;
|
|
1662
|
-
let a =
|
|
1663
|
-
a >
|
|
1665
|
+
let a = Se * Math.log(Math.tan(Math.PI * (+i[o + 1] + 90) / 360));
|
|
1666
|
+
a > Ee ? a = Ee : a < -Ee && (a = -Ee), e[o + 1] = a;
|
|
1664
1667
|
}
|
|
1665
1668
|
return e;
|
|
1666
1669
|
}
|
|
@@ -1668,11 +1671,11 @@ function zn(i, e, t, r) {
|
|
|
1668
1671
|
const n = i.length;
|
|
1669
1672
|
t = t > 1 ? t : 2, r = r ?? t, e === void 0 && (t > 2 ? e = i.slice() : e = new Array(n));
|
|
1670
1673
|
for (let o = 0; o < n; o += r)
|
|
1671
|
-
e[o] = 180 * i[o] / te, e[o + 1] = 360 * Math.atan(Math.exp(i[o + 1] /
|
|
1674
|
+
e[o] = 180 * i[o] / te, e[o + 1] = 360 * Math.atan(Math.exp(i[o + 1] / Se)) / Math.PI - 90;
|
|
1672
1675
|
return e;
|
|
1673
1676
|
}
|
|
1674
|
-
const Cn = 6378137,
|
|
1675
|
-
class N extends
|
|
1677
|
+
const Cn = 6378137, cr = [-180, -90, 180, 90], Mn = Math.PI * Cn / 180;
|
|
1678
|
+
class N extends zt {
|
|
1676
1679
|
/**
|
|
1677
1680
|
* @param {string} code Code.
|
|
1678
1681
|
* @param {string} [axisOrientation] Axis orientation.
|
|
@@ -1681,15 +1684,15 @@ class N extends _t {
|
|
|
1681
1684
|
super({
|
|
1682
1685
|
code: e,
|
|
1683
1686
|
units: "degrees",
|
|
1684
|
-
extent:
|
|
1687
|
+
extent: cr,
|
|
1685
1688
|
axisOrientation: t,
|
|
1686
1689
|
global: !0,
|
|
1687
|
-
metersPerUnit:
|
|
1688
|
-
worldExtent:
|
|
1690
|
+
metersPerUnit: Mn,
|
|
1691
|
+
worldExtent: cr
|
|
1689
1692
|
});
|
|
1690
1693
|
}
|
|
1691
1694
|
}
|
|
1692
|
-
const
|
|
1695
|
+
const dr = [
|
|
1693
1696
|
new N("CRS:84"),
|
|
1694
1697
|
new N("EPSG:4326", "neu"),
|
|
1695
1698
|
new N("urn:ogc:def:crs:OGC:1.3:CRS84"),
|
|
@@ -1698,12 +1701,12 @@ const lr = [
|
|
|
1698
1701
|
new N("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu"),
|
|
1699
1702
|
new N("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
|
|
1700
1703
|
];
|
|
1701
|
-
let
|
|
1702
|
-
function
|
|
1703
|
-
return
|
|
1704
|
+
let ct = {};
|
|
1705
|
+
function Sn(i) {
|
|
1706
|
+
return ct[i] || ct[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
|
|
1704
1707
|
}
|
|
1705
|
-
function
|
|
1706
|
-
|
|
1708
|
+
function $n(i, e) {
|
|
1709
|
+
ct[i] = e;
|
|
1707
1710
|
}
|
|
1708
1711
|
let re = {};
|
|
1709
1712
|
function ye(i, e, t) {
|
|
@@ -1713,22 +1716,22 @@ function ye(i, e, t) {
|
|
|
1713
1716
|
function rt(i, e) {
|
|
1714
1717
|
return i in re && e in re[i] ? re[i][e] : null;
|
|
1715
1718
|
}
|
|
1716
|
-
const Te = 0.9996,
|
|
1719
|
+
const Te = 0.9996, M = 669438e-8, Xe = M * M, Be = Xe * M, O = M / (1 - M), ur = Math.sqrt(1 - M), ce = (1 - ur) / (1 + ur), Hr = ce * ce, Ct = Hr * ce, Mt = Ct * ce, jr = Mt * ce, Vr = 1 - M / 4 - 3 * Xe / 64 - 5 * Be / 256, Pn = 3 * M / 8 + 3 * Xe / 32 + 45 * Be / 1024, En = 15 * Xe / 256 + 45 * Be / 1024, An = 35 * Be / 3072, Fn = 3 / 2 * ce - 27 / 32 * Ct + 269 / 512 * jr, Ln = 21 / 16 * Hr - 55 / 32 * Mt, Gn = 151 / 96 * Ct - 417 / 128 * jr, In = 1097 / 512 * Mt, Oe = 6378137;
|
|
1717
1720
|
function Rn(i, e, t) {
|
|
1718
|
-
const r = i - 5e5, a = (t.north ? e : e - 1e7) / Te / (Oe * Vr), s = a + Fn * Math.sin(2 * a) +
|
|
1719
|
-
let Ke = (z - de / 6 * (1 + 2 * h + v) +
|
|
1720
|
-
return Ke =
|
|
1721
|
-
Ke +
|
|
1721
|
+
const r = i - 5e5, a = (t.north ? e : e - 1e7) / Te / (Oe * Vr), s = a + Fn * Math.sin(2 * a) + Ln * Math.sin(4 * a) + Gn * Math.sin(6 * a) + In * Math.sin(8 * a), l = Math.sin(s), c = l * l, d = Math.cos(s), u = l / d, h = u * u, m = h * h, p = 1 - M * c, g = Math.sqrt(1 - M * c), f = Oe / g, _ = (1 - M) / p, v = O * d ** 2, $ = v * v, z = r / (f * Te), G = z * z, de = G * z, jt = de * z, Vt = jt * z, bi = Vt * z, yi = s - u / _ * (G / 2 - jt / 24 * (5 + 3 * h + 10 * v - 4 * $ - 9 * O)) + bi / 720 * (61 + 90 * h + 298 * v + 45 * m - 252 * O - 3 * $);
|
|
1722
|
+
let Ke = (z - de / 6 * (1 + 2 * h + v) + Vt / 120 * (5 - 2 * v + 28 * h - 3 * $ + 8 * O + 24 * m)) / d;
|
|
1723
|
+
return Ke = lt(
|
|
1724
|
+
Ke + Ge(Ur(t.number)),
|
|
1722
1725
|
-Math.PI,
|
|
1723
1726
|
Math.PI
|
|
1724
|
-
), [
|
|
1727
|
+
), [sr(Ke), sr(yi)];
|
|
1725
1728
|
}
|
|
1726
|
-
const
|
|
1729
|
+
const hr = -80, mr = 84, Nn = -180, Tn = 180;
|
|
1727
1730
|
function On(i, e, t) {
|
|
1728
|
-
i =
|
|
1729
|
-
const r =
|
|
1730
|
-
let de = Te * (z + h * a * (g / 2 +
|
|
1731
|
-
return t.north || (de += 1e7), [
|
|
1731
|
+
i = lt(i, Nn, Tn), e < hr ? e = hr : e > mr && (e = mr);
|
|
1732
|
+
const r = Ge(e), n = Math.sin(r), o = Math.cos(r), a = n / o, s = a * a, l = s * s, c = Ge(i), d = Ur(t.number), u = Ge(d), h = Oe / Math.sqrt(1 - M * n ** 2), m = O * o ** 2, p = o * lt(c - u, -Math.PI, Math.PI), g = p * p, f = g * p, _ = f * p, v = _ * p, $ = v * p, z = Oe * (Vr * r - Pn * Math.sin(2 * r) + En * Math.sin(4 * r) - An * Math.sin(6 * r)), G = Te * h * (p + f / 6 * (1 - s + m) + v / 120 * (5 - 18 * s + l + 72 * m - 58 * O)) + 5e5;
|
|
1733
|
+
let de = Te * (z + h * a * (g / 2 + _ / 24 * (5 - s + 9 * m + 4 * m ** 2) + $ / 720 * (61 - 58 * s + l + 600 * m - 330 * O)));
|
|
1734
|
+
return t.north || (de += 1e7), [G, de];
|
|
1732
1735
|
}
|
|
1733
1736
|
function Ur(i) {
|
|
1734
1737
|
return (i - 1) * 6 - 180 + 3;
|
|
@@ -1752,7 +1755,7 @@ function Yr(i) {
|
|
|
1752
1755
|
let t = 0, r = !1;
|
|
1753
1756
|
return e > 32700 && e < 32761 ? t = e - 32700 : e > 32600 && e < 32661 && (r = !0, t = e - 32600), t ? { number: t, north: r } : null;
|
|
1754
1757
|
}
|
|
1755
|
-
function
|
|
1758
|
+
function pr(i, e) {
|
|
1756
1759
|
return function(t, r, n, o) {
|
|
1757
1760
|
const a = t.length;
|
|
1758
1761
|
n = n > 1 ? n : 2, o = o ?? n, r || (n > 2 ? r = t.slice() : r = new Array(a));
|
|
@@ -1764,17 +1767,17 @@ function hr(i, e) {
|
|
|
1764
1767
|
};
|
|
1765
1768
|
}
|
|
1766
1769
|
function jn(i) {
|
|
1767
|
-
return Yr(i) ? new
|
|
1770
|
+
return Yr(i) ? new zt({ code: i, units: "m" }) : null;
|
|
1768
1771
|
}
|
|
1769
1772
|
function Vn(i) {
|
|
1770
1773
|
const e = Yr(i.getCode());
|
|
1771
1774
|
return e ? {
|
|
1772
|
-
forward:
|
|
1773
|
-
inverse:
|
|
1775
|
+
forward: pr(On, e),
|
|
1776
|
+
inverse: pr(Rn, e)
|
|
1774
1777
|
} : null;
|
|
1775
1778
|
}
|
|
1776
1779
|
const Un = [Vn], Yn = [jn];
|
|
1777
|
-
function
|
|
1780
|
+
function St(i, e) {
|
|
1778
1781
|
if (e !== void 0) {
|
|
1779
1782
|
for (let t = 0, r = i.length; t < r; ++t)
|
|
1780
1783
|
e[t] = i[t];
|
|
@@ -1783,16 +1786,16 @@ function Ct(i, e) {
|
|
|
1783
1786
|
e = i.slice();
|
|
1784
1787
|
return e;
|
|
1785
1788
|
}
|
|
1786
|
-
function
|
|
1787
|
-
|
|
1789
|
+
function dt(i) {
|
|
1790
|
+
$n(i.getCode(), i), ye(i, i, St);
|
|
1788
1791
|
}
|
|
1789
1792
|
function Xn(i) {
|
|
1790
|
-
i.forEach(
|
|
1793
|
+
i.forEach(dt);
|
|
1791
1794
|
}
|
|
1792
1795
|
function C(i) {
|
|
1793
1796
|
if (typeof i != "string")
|
|
1794
1797
|
return i;
|
|
1795
|
-
const e =
|
|
1798
|
+
const e = Sn(i);
|
|
1796
1799
|
if (e)
|
|
1797
1800
|
return e;
|
|
1798
1801
|
for (const t of Yn) {
|
|
@@ -1802,10 +1805,10 @@ function C(i) {
|
|
|
1802
1805
|
}
|
|
1803
1806
|
return null;
|
|
1804
1807
|
}
|
|
1805
|
-
function
|
|
1808
|
+
function gr(i) {
|
|
1806
1809
|
Xn(i), i.forEach(function(e) {
|
|
1807
1810
|
i.forEach(function(t) {
|
|
1808
|
-
e !== t && ye(e, t,
|
|
1811
|
+
e !== t && ye(e, t, St);
|
|
1809
1812
|
});
|
|
1810
1813
|
});
|
|
1811
1814
|
}
|
|
@@ -1820,7 +1823,7 @@ function qn(i, e) {
|
|
|
1820
1823
|
if (i === e)
|
|
1821
1824
|
return !0;
|
|
1822
1825
|
const t = i.getUnits() === e.getUnits();
|
|
1823
|
-
return (i.getCode() === e.getCode() || Xr(i, e) ===
|
|
1826
|
+
return (i.getCode() === e.getCode() || Xr(i, e) === St) && t;
|
|
1824
1827
|
}
|
|
1825
1828
|
function Xr(i, e) {
|
|
1826
1829
|
const t = i.getCode(), r = e.getCode();
|
|
@@ -1853,21 +1856,21 @@ function Xr(i, e) {
|
|
|
1853
1856
|
l
|
|
1854
1857
|
));
|
|
1855
1858
|
}
|
|
1856
|
-
return n && (
|
|
1859
|
+
return n && (dt(i), dt(e), ye(i, e, n)), n;
|
|
1857
1860
|
}
|
|
1858
1861
|
function it(i, e) {
|
|
1859
1862
|
return function(t, r, n, o) {
|
|
1860
1863
|
return r = i(t, r, n, o), e(r, r, n, o);
|
|
1861
1864
|
};
|
|
1862
1865
|
}
|
|
1863
|
-
function
|
|
1866
|
+
function ut(i, e) {
|
|
1864
1867
|
const t = C(i), r = C(e);
|
|
1865
1868
|
return Xr(t, r);
|
|
1866
1869
|
}
|
|
1867
1870
|
function Jn() {
|
|
1868
|
-
|
|
1871
|
+
gr(lr), gr(dr), Bn(
|
|
1872
|
+
dr,
|
|
1869
1873
|
lr,
|
|
1870
|
-
ar,
|
|
1871
1874
|
wn,
|
|
1872
1875
|
zn
|
|
1873
1876
|
);
|
|
@@ -1926,10 +1929,10 @@ function Kn(i, e, t, r, n, o, a) {
|
|
|
1926
1929
|
}
|
|
1927
1930
|
return a && a.length != s && (a.length = s), a;
|
|
1928
1931
|
}
|
|
1929
|
-
const
|
|
1930
|
-
class Wr extends
|
|
1932
|
+
const fr = Br(), Dn = [NaN, NaN];
|
|
1933
|
+
class Wr extends Ir {
|
|
1931
1934
|
constructor() {
|
|
1932
|
-
super(), this.extent_ =
|
|
1935
|
+
super(), this.extent_ = kt(), this.extentRevision_ = -1, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0, this.simplifyTransformedInternal = Ar(
|
|
1933
1936
|
(e, t, r) => {
|
|
1934
1937
|
if (!r)
|
|
1935
1938
|
return this.getSimplifiedGeometry(t);
|
|
@@ -1958,7 +1961,7 @@ class Wr extends Lr {
|
|
|
1958
1961
|
* @return {!Geometry} Clone.
|
|
1959
1962
|
*/
|
|
1960
1963
|
clone() {
|
|
1961
|
-
return
|
|
1964
|
+
return b();
|
|
1962
1965
|
}
|
|
1963
1966
|
/**
|
|
1964
1967
|
* @abstract
|
|
@@ -1969,7 +1972,7 @@ class Wr extends Lr {
|
|
|
1969
1972
|
* @return {number} Minimum squared distance.
|
|
1970
1973
|
*/
|
|
1971
1974
|
closestPointXY(e, t, r, n) {
|
|
1972
|
-
return
|
|
1975
|
+
return b();
|
|
1973
1976
|
}
|
|
1974
1977
|
/**
|
|
1975
1978
|
* @param {number} x X.
|
|
@@ -2007,7 +2010,7 @@ class Wr extends Lr {
|
|
|
2007
2010
|
* @return {import("../extent.js").Extent} extent Extent.
|
|
2008
2011
|
*/
|
|
2009
2012
|
computeExtent(e) {
|
|
2010
|
-
return
|
|
2013
|
+
return b();
|
|
2011
2014
|
}
|
|
2012
2015
|
/**
|
|
2013
2016
|
* Get the extent of the geometry.
|
|
@@ -2018,7 +2021,7 @@ class Wr extends Lr {
|
|
|
2018
2021
|
getExtent(e) {
|
|
2019
2022
|
if (this.extentRevision_ != this.getRevision()) {
|
|
2020
2023
|
const t = this.computeExtent(this.extent_);
|
|
2021
|
-
(isNaN(t[0]) || isNaN(t[1])) &&
|
|
2024
|
+
(isNaN(t[0]) || isNaN(t[1])) && xt(t), this.extentRevision_ = this.getRevision();
|
|
2022
2025
|
}
|
|
2023
2026
|
return bn(this.extent_, e);
|
|
2024
2027
|
}
|
|
@@ -2031,7 +2034,7 @@ class Wr extends Lr {
|
|
|
2031
2034
|
* @api
|
|
2032
2035
|
*/
|
|
2033
2036
|
rotate(e, t) {
|
|
2034
|
-
|
|
2037
|
+
b();
|
|
2035
2038
|
}
|
|
2036
2039
|
/**
|
|
2037
2040
|
* Scale the geometry (with an optional origin). This modifies the geometry
|
|
@@ -2044,7 +2047,7 @@ class Wr extends Lr {
|
|
|
2044
2047
|
* @api
|
|
2045
2048
|
*/
|
|
2046
2049
|
scale(e, t, r) {
|
|
2047
|
-
|
|
2050
|
+
b();
|
|
2048
2051
|
}
|
|
2049
2052
|
/**
|
|
2050
2053
|
* Create a simplified version of this geometry. For linestrings, this uses
|
|
@@ -2067,7 +2070,7 @@ class Wr extends Lr {
|
|
|
2067
2070
|
* @return {Geometry} Simplified geometry.
|
|
2068
2071
|
*/
|
|
2069
2072
|
getSimplifiedGeometry(e) {
|
|
2070
|
-
return
|
|
2073
|
+
return b();
|
|
2071
2074
|
}
|
|
2072
2075
|
/**
|
|
2073
2076
|
* Get the type of this geometry.
|
|
@@ -2075,7 +2078,7 @@ class Wr extends Lr {
|
|
|
2075
2078
|
* @return {Type} Geometry type.
|
|
2076
2079
|
*/
|
|
2077
2080
|
getType() {
|
|
2078
|
-
return
|
|
2081
|
+
return b();
|
|
2079
2082
|
}
|
|
2080
2083
|
/**
|
|
2081
2084
|
* Apply a transform function to the coordinates of the geometry.
|
|
@@ -2087,7 +2090,7 @@ class Wr extends Lr {
|
|
|
2087
2090
|
* Called with a flat array of geometry coordinates.
|
|
2088
2091
|
*/
|
|
2089
2092
|
applyTransform(e) {
|
|
2090
|
-
|
|
2093
|
+
b();
|
|
2091
2094
|
}
|
|
2092
2095
|
/**
|
|
2093
2096
|
* Test if the geometry and the passed extent intersect.
|
|
@@ -2096,7 +2099,7 @@ class Wr extends Lr {
|
|
|
2096
2099
|
* @return {boolean} `true` if the geometry and the extent intersect.
|
|
2097
2100
|
*/
|
|
2098
2101
|
intersectsExtent(e) {
|
|
2099
|
-
return
|
|
2102
|
+
return b();
|
|
2100
2103
|
}
|
|
2101
2104
|
/**
|
|
2102
2105
|
* Translate the geometry. This modifies the geometry coordinates in place. If
|
|
@@ -2107,7 +2110,7 @@ class Wr extends Lr {
|
|
|
2107
2110
|
* @api
|
|
2108
2111
|
*/
|
|
2109
2112
|
translate(e, t) {
|
|
2110
|
-
|
|
2113
|
+
b();
|
|
2111
2114
|
}
|
|
2112
2115
|
/**
|
|
2113
2116
|
* Transform each coordinate of the geometry from one coordinate reference
|
|
@@ -2128,7 +2131,7 @@ class Wr extends Lr {
|
|
|
2128
2131
|
const r = C(e), n = r.getUnits() == "tile-pixels" ? function(o, a, s) {
|
|
2129
2132
|
const l = r.getExtent(), c = r.getWorldExtent(), d = Ne(c) / Ne(l);
|
|
2130
2133
|
qr(
|
|
2131
|
-
|
|
2134
|
+
fr,
|
|
2132
2135
|
c[0],
|
|
2133
2136
|
c[3],
|
|
2134
2137
|
d,
|
|
@@ -2142,11 +2145,11 @@ class Wr extends Lr {
|
|
|
2142
2145
|
0,
|
|
2143
2146
|
o.length,
|
|
2144
2147
|
s,
|
|
2145
|
-
|
|
2148
|
+
fr,
|
|
2146
2149
|
a
|
|
2147
|
-
), h =
|
|
2150
|
+
), h = ut(r, t);
|
|
2148
2151
|
return h ? h(u, u, s) : u;
|
|
2149
|
-
} :
|
|
2152
|
+
} : ut(r, t);
|
|
2150
2153
|
return this.applyTransform(n), this;
|
|
2151
2154
|
}
|
|
2152
2155
|
}
|
|
@@ -2161,7 +2164,7 @@ class Z extends Wr {
|
|
|
2161
2164
|
* @override
|
|
2162
2165
|
*/
|
|
2163
2166
|
computeExtent(e) {
|
|
2164
|
-
return
|
|
2167
|
+
return _t(
|
|
2165
2168
|
this.flatCoordinates,
|
|
2166
2169
|
0,
|
|
2167
2170
|
this.flatCoordinates.length,
|
|
@@ -2174,7 +2177,7 @@ class Z extends Wr {
|
|
|
2174
2177
|
* @return {Array<*> | null} Coordinates.
|
|
2175
2178
|
*/
|
|
2176
2179
|
getCoordinates() {
|
|
2177
|
-
return
|
|
2180
|
+
return b();
|
|
2178
2181
|
}
|
|
2179
2182
|
/**
|
|
2180
2183
|
* Return the first coordinate of the geometry.
|
|
@@ -2239,7 +2242,7 @@ class Z extends Wr {
|
|
|
2239
2242
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
|
2240
2243
|
*/
|
|
2241
2244
|
setFlatCoordinates(e, t) {
|
|
2242
|
-
this.stride =
|
|
2245
|
+
this.stride = br(e), this.layout = e, this.flatCoordinates = t;
|
|
2243
2246
|
}
|
|
2244
2247
|
/**
|
|
2245
2248
|
* @abstract
|
|
@@ -2247,7 +2250,7 @@ class Z extends Wr {
|
|
|
2247
2250
|
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
2248
2251
|
*/
|
|
2249
2252
|
setCoordinates(e, t) {
|
|
2250
|
-
|
|
2253
|
+
b();
|
|
2251
2254
|
}
|
|
2252
2255
|
/**
|
|
2253
2256
|
* @param {import("./Geometry.js").GeometryLayout|undefined} layout Layout.
|
|
@@ -2258,7 +2261,7 @@ class Z extends Wr {
|
|
|
2258
2261
|
setLayout(e, t, r) {
|
|
2259
2262
|
let n;
|
|
2260
2263
|
if (e)
|
|
2261
|
-
n =
|
|
2264
|
+
n = br(e);
|
|
2262
2265
|
else {
|
|
2263
2266
|
for (let o = 0; o < r; ++o) {
|
|
2264
2267
|
if (t.length === 0) {
|
|
@@ -2369,7 +2372,7 @@ function K(i) {
|
|
|
2369
2372
|
return i == 2 ? e = "XY" : i == 3 ? e = "XYZ" : i == 4 && (e = "XYZM"), /** @type {import("./Geometry.js").GeometryLayout} */
|
|
2370
2373
|
e;
|
|
2371
2374
|
}
|
|
2372
|
-
function
|
|
2375
|
+
function br(i) {
|
|
2373
2376
|
let e;
|
|
2374
2377
|
return i == "XY" ? e = 2 : i == "XYZ" || i == "XYM" ? e = 3 : i == "XYZM" && (e = 4), /** @type {number} */
|
|
2375
2378
|
e;
|
|
@@ -2387,7 +2390,7 @@ function qe(i, e, t, r) {
|
|
|
2387
2390
|
}
|
|
2388
2391
|
return e;
|
|
2389
2392
|
}
|
|
2390
|
-
function
|
|
2393
|
+
function $e(i, e, t, r, n) {
|
|
2391
2394
|
n = n || [];
|
|
2392
2395
|
let o = 0;
|
|
2393
2396
|
for (let a = 0, s = t.length; a < s; ++a) {
|
|
@@ -2405,7 +2408,7 @@ function Zr(i, e, t, r, n) {
|
|
|
2405
2408
|
n = n || [];
|
|
2406
2409
|
let o = 0;
|
|
2407
2410
|
for (let a = 0, s = t.length; a < s; ++a) {
|
|
2408
|
-
const l =
|
|
2411
|
+
const l = $e(
|
|
2409
2412
|
i,
|
|
2410
2413
|
e,
|
|
2411
2414
|
t[a],
|
|
@@ -2418,10 +2421,10 @@ function Zr(i, e, t, r, n) {
|
|
|
2418
2421
|
}
|
|
2419
2422
|
function Kr(i, e, t, r) {
|
|
2420
2423
|
const n = [];
|
|
2421
|
-
let o =
|
|
2424
|
+
let o = kt();
|
|
2422
2425
|
for (let a = 0, s = t.length; a < s; ++a) {
|
|
2423
2426
|
const l = t[a];
|
|
2424
|
-
o =
|
|
2427
|
+
o = _t(
|
|
2425
2428
|
i,
|
|
2426
2429
|
e,
|
|
2427
2430
|
l[0],
|
|
@@ -2457,7 +2460,7 @@ function H(i, e, t, r, n, o) {
|
|
|
2457
2460
|
}
|
|
2458
2461
|
return a !== 0;
|
|
2459
2462
|
}
|
|
2460
|
-
function
|
|
2463
|
+
function $t(i, e, t, r, n, o) {
|
|
2461
2464
|
if (t.length === 0 || !H(i, e, t[0], r, n, o))
|
|
2462
2465
|
return !1;
|
|
2463
2466
|
for (let a = 1, s = t.length; a < s; ++a)
|
|
@@ -2470,33 +2473,33 @@ function to(i, e, t, r, n, o) {
|
|
|
2470
2473
|
return !1;
|
|
2471
2474
|
for (let a = 0, s = t.length; a < s; ++a) {
|
|
2472
2475
|
const l = t[a];
|
|
2473
|
-
if (
|
|
2476
|
+
if ($t(i, e, l, r, n, o))
|
|
2474
2477
|
return !0;
|
|
2475
2478
|
e = l[l.length - 1];
|
|
2476
2479
|
}
|
|
2477
2480
|
return !1;
|
|
2478
2481
|
}
|
|
2479
|
-
function
|
|
2482
|
+
function Pt(i, e, t, r, n, o, a) {
|
|
2480
2483
|
let s, l, c, d, u, h, m;
|
|
2481
2484
|
const p = n[o + 1], g = [];
|
|
2482
|
-
for (let v = 0,
|
|
2485
|
+
for (let v = 0, $ = t.length; v < $; ++v) {
|
|
2483
2486
|
const z = t[v];
|
|
2484
2487
|
for (d = i[z - r], h = i[z - r + 1], s = e; s < z; s += r)
|
|
2485
2488
|
u = i[s], m = i[s + 1], (p <= h && m <= p || h <= p && p <= m) && (c = (p - h) / (m - h) * (u - d) + d, g.push(c)), d = u, h = m;
|
|
2486
2489
|
}
|
|
2487
|
-
let
|
|
2488
|
-
for (g.sort(
|
|
2490
|
+
let f = NaN, _ = -1 / 0;
|
|
2491
|
+
for (g.sort(Er), d = g[0], s = 1, l = g.length; s < l; ++s) {
|
|
2489
2492
|
u = g[s];
|
|
2490
2493
|
const v = Math.abs(u - d);
|
|
2491
|
-
v >
|
|
2494
|
+
v > _ && (c = (d + u) / 2, $t(i, e, t, r, c, p) && (f = c, _ = v)), d = u;
|
|
2492
2495
|
}
|
|
2493
|
-
return isNaN(
|
|
2496
|
+
return isNaN(f) && (f = n[o]), a ? (a.push(f, p, _), a) : [f, p, _];
|
|
2494
2497
|
}
|
|
2495
2498
|
function Dr(i, e, t, r, n) {
|
|
2496
2499
|
let o = [];
|
|
2497
2500
|
for (let a = 0, s = t.length; a < s; ++a) {
|
|
2498
2501
|
const l = t[a];
|
|
2499
|
-
o =
|
|
2502
|
+
o = Pt(
|
|
2500
2503
|
i,
|
|
2501
2504
|
e,
|
|
2502
2505
|
l,
|
|
@@ -2518,19 +2521,19 @@ function He(i, e, t, r, n, o, a) {
|
|
|
2518
2521
|
else if (c !== 0) {
|
|
2519
2522
|
let d = i[e], u = i[e + 1], h = 0;
|
|
2520
2523
|
const m = [0];
|
|
2521
|
-
for (let
|
|
2522
|
-
const
|
|
2523
|
-
h += Math.sqrt((
|
|
2524
|
+
for (let f = e + r; f < t; f += r) {
|
|
2525
|
+
const _ = i[f], v = i[f + 1];
|
|
2526
|
+
h += Math.sqrt((_ - d) * (_ - d) + (v - u) * (v - u)), m.push(h), d = _, u = v;
|
|
2524
2527
|
}
|
|
2525
2528
|
const p = n * h, g = en(m, p);
|
|
2526
2529
|
g < 0 ? (l = (p - m[-g - 2]) / (m[-g - 1] - m[-g - 2]), s = e + (-g - 2) * r) : s = e + g * r;
|
|
2527
2530
|
}
|
|
2528
2531
|
a = a > 1 ? a : 2, o = o || new Array(a);
|
|
2529
2532
|
for (let d = 0; d < a; ++d)
|
|
2530
|
-
o[d] = s === void 0 ? NaN : l === void 0 ? i[s + d] :
|
|
2533
|
+
o[d] = s === void 0 ? NaN : l === void 0 ? i[s + d] : wt(i[s + d], i[s + r + d], l);
|
|
2531
2534
|
return o;
|
|
2532
2535
|
}
|
|
2533
|
-
function
|
|
2536
|
+
function ht(i, e, t, r, n, o) {
|
|
2534
2537
|
if (t == e)
|
|
2535
2538
|
return null;
|
|
2536
2539
|
let a;
|
|
@@ -2552,7 +2555,7 @@ function dt(i, e, t, r, n, o) {
|
|
|
2552
2555
|
a = [];
|
|
2553
2556
|
for (let h = 0; h < r - 1; ++h)
|
|
2554
2557
|
a.push(
|
|
2555
|
-
|
|
2558
|
+
wt(
|
|
2556
2559
|
i[(s - 1) * r + h],
|
|
2557
2560
|
i[s * r + h],
|
|
2558
2561
|
u
|
|
@@ -2562,7 +2565,7 @@ function dt(i, e, t, r, n, o) {
|
|
|
2562
2565
|
}
|
|
2563
2566
|
function ro(i, e, t, r, n, o, a) {
|
|
2564
2567
|
if (a)
|
|
2565
|
-
return
|
|
2568
|
+
return ht(
|
|
2566
2569
|
i,
|
|
2567
2570
|
e,
|
|
2568
2571
|
t[t.length - 1],
|
|
@@ -2581,7 +2584,7 @@ function ro(i, e, t, r, n, o, a) {
|
|
|
2581
2584
|
if (n < i[e + r - 1])
|
|
2582
2585
|
return null;
|
|
2583
2586
|
if (n <= i[d - 1])
|
|
2584
|
-
return
|
|
2587
|
+
return ht(
|
|
2585
2588
|
i,
|
|
2586
2589
|
e,
|
|
2587
2590
|
d,
|
|
@@ -2603,7 +2606,7 @@ function io(i, e, t, r) {
|
|
|
2603
2606
|
e += r, t -= r;
|
|
2604
2607
|
}
|
|
2605
2608
|
}
|
|
2606
|
-
function
|
|
2609
|
+
function Et(i, e, t, r) {
|
|
2607
2610
|
let n = 0, o = i[t - r], a = i[t - r + 1];
|
|
2608
2611
|
for (; e < t; e += r) {
|
|
2609
2612
|
const s = i[e], l = i[e + 1];
|
|
@@ -2611,10 +2614,10 @@ function Pt(i, e, t, r) {
|
|
|
2611
2614
|
}
|
|
2612
2615
|
return n === 0 ? void 0 : n > 0;
|
|
2613
2616
|
}
|
|
2614
|
-
function
|
|
2617
|
+
function At(i, e, t, r, n) {
|
|
2615
2618
|
n = n !== void 0 ? n : !1;
|
|
2616
2619
|
for (let o = 0, a = t.length; o < a; ++o) {
|
|
2617
|
-
const s = t[o], l =
|
|
2620
|
+
const s = t[o], l = Et(
|
|
2618
2621
|
i,
|
|
2619
2622
|
e,
|
|
2620
2623
|
s,
|
|
@@ -2632,7 +2635,7 @@ function Et(i, e, t, r, n) {
|
|
|
2632
2635
|
function Qr(i, e, t, r, n) {
|
|
2633
2636
|
for (let o = 0, a = t.length; o < a; ++o) {
|
|
2634
2637
|
const s = t[o];
|
|
2635
|
-
if (!
|
|
2638
|
+
if (!At(i, e, s, r, n))
|
|
2636
2639
|
return !1;
|
|
2637
2640
|
s.length && (e = s[s.length - 1]);
|
|
2638
2641
|
}
|
|
@@ -2641,7 +2644,7 @@ function Qr(i, e, t, r, n) {
|
|
|
2641
2644
|
function je(i, e, t, r, n) {
|
|
2642
2645
|
n = n !== void 0 ? n : !1;
|
|
2643
2646
|
for (let o = 0, a = t.length; o < a; ++o) {
|
|
2644
|
-
const s = t[o], l =
|
|
2647
|
+
const s = t[o], l = Et(
|
|
2645
2648
|
i,
|
|
2646
2649
|
e,
|
|
2647
2650
|
s,
|
|
@@ -2651,7 +2654,7 @@ function je(i, e, t, r, n) {
|
|
|
2651
2654
|
}
|
|
2652
2655
|
return e;
|
|
2653
2656
|
}
|
|
2654
|
-
function
|
|
2657
|
+
function mt(i, e, t, r, n) {
|
|
2655
2658
|
for (let o = 0, a = t.length; o < a; ++o)
|
|
2656
2659
|
e = je(
|
|
2657
2660
|
i,
|
|
@@ -2666,7 +2669,7 @@ function no(i, e) {
|
|
|
2666
2669
|
const t = [];
|
|
2667
2670
|
let r = 0, n = 0, o;
|
|
2668
2671
|
for (let a = 0, s = e.length; a < s; ++a) {
|
|
2669
|
-
const l = e[a], c =
|
|
2672
|
+
const l = e[a], c = Et(i, r, l, 2);
|
|
2670
2673
|
if (o === void 0 && (o = c), c === o)
|
|
2671
2674
|
t.push(e.slice(n, a + 1));
|
|
2672
2675
|
else {
|
|
@@ -2692,10 +2695,10 @@ function Je(i, e, t, r, n, o, a) {
|
|
|
2692
2695
|
for (; c.length > 0; ) {
|
|
2693
2696
|
const u = c.pop(), h = c.pop();
|
|
2694
2697
|
let m = 0;
|
|
2695
|
-
const p = i[h], g = i[h + 1],
|
|
2698
|
+
const p = i[h], g = i[h + 1], f = i[u], _ = i[u + 1];
|
|
2696
2699
|
for (let v = h + r; v < u; v += r) {
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2700
|
+
const $ = i[v], z = i[v + 1], G = vn($, z, p, g, f, _);
|
|
2701
|
+
G > m && (d = v, m = G);
|
|
2699
2702
|
}
|
|
2700
2703
|
m > n && (l[(d - e) / r] = 1, h + r < d && c.push(h, d), d + r < u && c.push(d, u));
|
|
2701
2704
|
}
|
|
@@ -2735,8 +2738,8 @@ function oo(i, e, t, r, n, o, a) {
|
|
|
2735
2738
|
const u = Q(i[e], n), h = Q(i[e + 1], n);
|
|
2736
2739
|
if (e += r, u == c && h == d)
|
|
2737
2740
|
continue;
|
|
2738
|
-
const m = c - s, p = d - l, g = u - s,
|
|
2739
|
-
if (m *
|
|
2741
|
+
const m = c - s, p = d - l, g = u - s, f = h - l;
|
|
2742
|
+
if (m * f == p * g && (m < 0 && g < m || m == g || m > 0 && g > m) && (p < 0 && f < p || p == f || p > 0 && f > p)) {
|
|
2740
2743
|
c = u, d = h;
|
|
2741
2744
|
continue;
|
|
2742
2745
|
}
|
|
@@ -2744,7 +2747,7 @@ function oo(i, e, t, r, n, o, a) {
|
|
|
2744
2747
|
}
|
|
2745
2748
|
return o[a++] = c, o[a++] = d, a;
|
|
2746
2749
|
}
|
|
2747
|
-
function
|
|
2750
|
+
function Ft(i, e, t, r, n, o, a, s) {
|
|
2748
2751
|
for (let l = 0, c = t.length; l < c; ++l) {
|
|
2749
2752
|
const d = t[l];
|
|
2750
2753
|
a = oo(
|
|
@@ -2762,7 +2765,7 @@ function $t(i, e, t, r, n, o, a, s) {
|
|
|
2762
2765
|
function ao(i, e, t, r, n, o, a, s) {
|
|
2763
2766
|
for (let l = 0, c = t.length; l < c; ++l) {
|
|
2764
2767
|
const d = t[l], u = [];
|
|
2765
|
-
a =
|
|
2768
|
+
a = Ft(
|
|
2766
2769
|
i,
|
|
2767
2770
|
e,
|
|
2768
2771
|
d,
|
|
@@ -2795,7 +2798,7 @@ class Y extends Wr {
|
|
|
2795
2798
|
const e = this.geometries_;
|
|
2796
2799
|
for (let t = 0, r = e.length; t < r; ++t)
|
|
2797
2800
|
this.changeEventsKeys_.push(
|
|
2798
|
-
be(e[t],
|
|
2801
|
+
be(e[t], vt.CHANGE, this.changed, this)
|
|
2799
2802
|
);
|
|
2800
2803
|
}
|
|
2801
2804
|
/**
|
|
@@ -2851,7 +2854,7 @@ class Y extends Wr {
|
|
|
2851
2854
|
* @override
|
|
2852
2855
|
*/
|
|
2853
2856
|
computeExtent(e) {
|
|
2854
|
-
|
|
2857
|
+
xt(e);
|
|
2855
2858
|
const t = this.geometries_;
|
|
2856
2859
|
for (let r = 0, n = t.length; r < n; ++r)
|
|
2857
2860
|
cn(e, t[r].getExtent());
|
|
@@ -3045,7 +3048,7 @@ function so(i, e, t, r) {
|
|
|
3045
3048
|
}
|
|
3046
3049
|
return n;
|
|
3047
3050
|
}
|
|
3048
|
-
function
|
|
3051
|
+
function yr(i, e, t, r, n, o, a) {
|
|
3049
3052
|
const s = i[e], l = i[e + 1], c = i[t] - s, d = i[t + 1] - l;
|
|
3050
3053
|
let u;
|
|
3051
3054
|
if (c === 0 && d === 0)
|
|
@@ -3056,7 +3059,7 @@ function fr(i, e, t, r, n, o, a) {
|
|
|
3056
3059
|
u = t;
|
|
3057
3060
|
else if (h > 0) {
|
|
3058
3061
|
for (let m = 0; m < r; ++m)
|
|
3059
|
-
a[m] =
|
|
3062
|
+
a[m] = wt(
|
|
3060
3063
|
i[e + m],
|
|
3061
3064
|
i[t + m],
|
|
3062
3065
|
h
|
|
@@ -3070,7 +3073,7 @@ function fr(i, e, t, r, n, o, a) {
|
|
|
3070
3073
|
a[h] = i[u + h];
|
|
3071
3074
|
a.length = r;
|
|
3072
3075
|
}
|
|
3073
|
-
function
|
|
3076
|
+
function Lt(i, e, t, r, n) {
|
|
3074
3077
|
let o = i[e], a = i[e + 1];
|
|
3075
3078
|
for (e += r; e < t; e += r) {
|
|
3076
3079
|
const s = i[e], l = i[e + 1], c = V(o, a, s, l);
|
|
@@ -3078,21 +3081,21 @@ function At(i, e, t, r, n) {
|
|
|
3078
3081
|
}
|
|
3079
3082
|
return n;
|
|
3080
3083
|
}
|
|
3081
|
-
function
|
|
3084
|
+
function Gt(i, e, t, r, n) {
|
|
3082
3085
|
for (let o = 0, a = t.length; o < a; ++o) {
|
|
3083
3086
|
const s = t[o];
|
|
3084
|
-
n =
|
|
3087
|
+
n = Lt(i, e, s, r, n), e = s;
|
|
3085
3088
|
}
|
|
3086
3089
|
return n;
|
|
3087
3090
|
}
|
|
3088
3091
|
function lo(i, e, t, r, n) {
|
|
3089
3092
|
for (let o = 0, a = t.length; o < a; ++o) {
|
|
3090
3093
|
const s = t[o];
|
|
3091
|
-
n =
|
|
3094
|
+
n = Gt(i, e, s, r, n), e = s[s.length - 1];
|
|
3092
3095
|
}
|
|
3093
3096
|
return n;
|
|
3094
3097
|
}
|
|
3095
|
-
function
|
|
3098
|
+
function It(i, e, t, r, n, o, a, s, l, c, d) {
|
|
3096
3099
|
if (e == t)
|
|
3097
3100
|
return c;
|
|
3098
3101
|
let u, h;
|
|
@@ -3112,7 +3115,7 @@ function Gt(i, e, t, r, n, o, a, s, l, c, d) {
|
|
|
3112
3115
|
d = d || [NaN, NaN];
|
|
3113
3116
|
let m = e + r;
|
|
3114
3117
|
for (; m < t; )
|
|
3115
|
-
if (
|
|
3118
|
+
if (yr(
|
|
3116
3119
|
i,
|
|
3117
3120
|
m - r,
|
|
3118
3121
|
m,
|
|
@@ -3129,7 +3132,7 @@ function Gt(i, e, t, r, n, o, a, s, l, c, d) {
|
|
|
3129
3132
|
(Math.sqrt(h) - Math.sqrt(c)) / n | 0,
|
|
3130
3133
|
1
|
|
3131
3134
|
);
|
|
3132
|
-
if (o && (
|
|
3135
|
+
if (o && (yr(
|
|
3133
3136
|
i,
|
|
3134
3137
|
t - r,
|
|
3135
3138
|
e,
|
|
@@ -3144,11 +3147,11 @@ function Gt(i, e, t, r, n, o, a, s, l, c, d) {
|
|
|
3144
3147
|
}
|
|
3145
3148
|
return c;
|
|
3146
3149
|
}
|
|
3147
|
-
function
|
|
3150
|
+
function Rt(i, e, t, r, n, o, a, s, l, c, d) {
|
|
3148
3151
|
d = d || [NaN, NaN];
|
|
3149
3152
|
for (let u = 0, h = t.length; u < h; ++u) {
|
|
3150
3153
|
const m = t[u];
|
|
3151
|
-
c =
|
|
3154
|
+
c = It(
|
|
3152
3155
|
i,
|
|
3153
3156
|
e,
|
|
3154
3157
|
m,
|
|
@@ -3168,7 +3171,7 @@ function co(i, e, t, r, n, o, a, s, l, c, d) {
|
|
|
3168
3171
|
d = d || [NaN, NaN];
|
|
3169
3172
|
for (let u = 0, h = t.length; u < h; ++u) {
|
|
3170
3173
|
const m = t[u];
|
|
3171
|
-
c =
|
|
3174
|
+
c = Rt(
|
|
3172
3175
|
i,
|
|
3173
3176
|
e,
|
|
3174
3177
|
m,
|
|
@@ -3191,7 +3194,7 @@ function We(i, e, t, r, n) {
|
|
|
3191
3194
|
n[o++] = i.slice(a, a + r);
|
|
3192
3195
|
return n.length = o, n;
|
|
3193
3196
|
}
|
|
3194
|
-
function
|
|
3197
|
+
function Nt(i, e, t, r, n) {
|
|
3195
3198
|
n = n !== void 0 ? n : [];
|
|
3196
3199
|
let o = 0;
|
|
3197
3200
|
for (let a = 0, s = t.length; a < s; ++a) {
|
|
@@ -3211,7 +3214,7 @@ function uo(i, e, t, r, n) {
|
|
|
3211
3214
|
let o = 0;
|
|
3212
3215
|
for (let a = 0, s = t.length; a < s; ++a) {
|
|
3213
3216
|
const l = t[a];
|
|
3214
|
-
n[o++] = l.length === 1 && l[0] === e ? [] :
|
|
3217
|
+
n[o++] = l.length === 1 && l[0] === e ? [] : Nt(
|
|
3215
3218
|
i,
|
|
3216
3219
|
e,
|
|
3217
3220
|
l,
|
|
@@ -3257,14 +3260,14 @@ class ve extends Z {
|
|
|
3257
3260
|
*/
|
|
3258
3261
|
closestPointXY(e, t, r, n) {
|
|
3259
3262
|
return n < W(this.getExtent(), e, t) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
3260
|
-
|
|
3263
|
+
Lt(
|
|
3261
3264
|
this.flatCoordinates,
|
|
3262
3265
|
0,
|
|
3263
3266
|
this.flatCoordinates.length,
|
|
3264
3267
|
this.stride,
|
|
3265
3268
|
0
|
|
3266
3269
|
)
|
|
3267
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
3270
|
+
), this.maxDeltaRevision_ = this.getRevision()), It(
|
|
3268
3271
|
this.flatCoordinates,
|
|
3269
3272
|
0,
|
|
3270
3273
|
this.flatCoordinates.length,
|
|
@@ -3368,7 +3371,7 @@ function ii(i, e, t, r, n) {
|
|
|
3368
3371
|
return !1;
|
|
3369
3372
|
}
|
|
3370
3373
|
function Ze(i, e, t, r, n, o) {
|
|
3371
|
-
return o = o ?? Or(
|
|
3374
|
+
return o = o ?? Or(kt(), i, e, t, r), fn(n, o) ? o[0] >= n[0] && o[2] <= n[2] || o[1] >= n[1] && o[3] <= n[3] ? !0 : ii(
|
|
3372
3375
|
i,
|
|
3373
3376
|
e,
|
|
3374
3377
|
t,
|
|
@@ -3485,7 +3488,7 @@ class X extends Z {
|
|
|
3485
3488
|
* @api
|
|
3486
3489
|
*/
|
|
3487
3490
|
appendCoordinate(e) {
|
|
3488
|
-
|
|
3491
|
+
E(this.flatCoordinates, e), this.changed();
|
|
3489
3492
|
}
|
|
3490
3493
|
/**
|
|
3491
3494
|
* Make a complete copy of the geometry.
|
|
@@ -3510,14 +3513,14 @@ class X extends Z {
|
|
|
3510
3513
|
*/
|
|
3511
3514
|
closestPointXY(e, t, r, n) {
|
|
3512
3515
|
return n < W(this.getExtent(), e, t) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
3513
|
-
|
|
3516
|
+
Lt(
|
|
3514
3517
|
this.flatCoordinates,
|
|
3515
3518
|
0,
|
|
3516
3519
|
this.flatCoordinates.length,
|
|
3517
3520
|
this.stride,
|
|
3518
3521
|
0
|
|
3519
3522
|
)
|
|
3520
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
3523
|
+
), this.maxDeltaRevision_ = this.getRevision()), It(
|
|
3521
3524
|
this.flatCoordinates,
|
|
3522
3525
|
0,
|
|
3523
3526
|
this.flatCoordinates.length,
|
|
@@ -3565,7 +3568,7 @@ class X extends Z {
|
|
|
3565
3568
|
* @api
|
|
3566
3569
|
*/
|
|
3567
3570
|
getCoordinateAtM(e, t) {
|
|
3568
|
-
return this.layout != "XYM" && this.layout != "XYZM" ? null : (t = t !== void 0 ? t : !1,
|
|
3571
|
+
return this.layout != "XYM" && this.layout != "XYZM" ? null : (t = t !== void 0 ? t : !1, ht(
|
|
3569
3572
|
this.flatCoordinates,
|
|
3570
3573
|
0,
|
|
3571
3574
|
this.flatCoordinates.length,
|
|
@@ -3692,7 +3695,7 @@ class X extends Z {
|
|
|
3692
3695
|
), this.changed();
|
|
3693
3696
|
}
|
|
3694
3697
|
}
|
|
3695
|
-
class
|
|
3698
|
+
class ke extends Z {
|
|
3696
3699
|
/**
|
|
3697
3700
|
* @param {Array<Array<import("../coordinate.js").Coordinate>|LineString>|Array<number>} coordinates
|
|
3698
3701
|
* Coordinates or LineString geometries. (For internal use, flat coordinates in
|
|
@@ -3720,7 +3723,7 @@ class xe extends Z {
|
|
|
3720
3723
|
), o = [], a = [];
|
|
3721
3724
|
for (let l = 0, c = n.length; l < c; ++l) {
|
|
3722
3725
|
const d = n[l];
|
|
3723
|
-
|
|
3726
|
+
E(o, d.getFlatCoordinates()), a.push(o.length);
|
|
3724
3727
|
}
|
|
3725
3728
|
const s = n.length === 0 ? this.getLayout() : n[0].getLayout();
|
|
3726
3729
|
this.setFlatCoordinates(s, o), this.ends_ = a;
|
|
@@ -3732,7 +3735,7 @@ class xe extends Z {
|
|
|
3732
3735
|
* @api
|
|
3733
3736
|
*/
|
|
3734
3737
|
appendLineString(e) {
|
|
3735
|
-
|
|
3738
|
+
E(this.flatCoordinates, e.getFlatCoordinates().slice()), this.ends_.push(this.flatCoordinates.length), this.changed();
|
|
3736
3739
|
}
|
|
3737
3740
|
/**
|
|
3738
3741
|
* Make a complete copy of the geometry.
|
|
@@ -3741,7 +3744,7 @@ class xe extends Z {
|
|
|
3741
3744
|
* @override
|
|
3742
3745
|
*/
|
|
3743
3746
|
clone() {
|
|
3744
|
-
const e = new
|
|
3747
|
+
const e = new ke(
|
|
3745
3748
|
this.flatCoordinates.slice(),
|
|
3746
3749
|
this.layout,
|
|
3747
3750
|
this.ends_.slice()
|
|
@@ -3758,14 +3761,14 @@ class xe extends Z {
|
|
|
3758
3761
|
*/
|
|
3759
3762
|
closestPointXY(e, t, r, n) {
|
|
3760
3763
|
return n < W(this.getExtent(), e, t) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
3761
|
-
|
|
3764
|
+
Gt(
|
|
3762
3765
|
this.flatCoordinates,
|
|
3763
3766
|
0,
|
|
3764
3767
|
this.ends_,
|
|
3765
3768
|
this.stride,
|
|
3766
3769
|
0
|
|
3767
3770
|
)
|
|
3768
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
3771
|
+
), this.maxDeltaRevision_ = this.getRevision()), Rt(
|
|
3769
3772
|
this.flatCoordinates,
|
|
3770
3773
|
0,
|
|
3771
3774
|
this.ends_,
|
|
@@ -3818,7 +3821,7 @@ class xe extends Z {
|
|
|
3818
3821
|
* @override
|
|
3819
3822
|
*/
|
|
3820
3823
|
getCoordinates() {
|
|
3821
|
-
return
|
|
3824
|
+
return Nt(
|
|
3822
3825
|
this.flatCoordinates,
|
|
3823
3826
|
0,
|
|
3824
3827
|
this.ends_,
|
|
@@ -3878,7 +3881,7 @@ class xe extends Z {
|
|
|
3878
3881
|
o,
|
|
3879
3882
|
0.5
|
|
3880
3883
|
);
|
|
3881
|
-
|
|
3884
|
+
E(e, c), r = l;
|
|
3882
3885
|
}
|
|
3883
3886
|
return e;
|
|
3884
3887
|
}
|
|
@@ -3899,7 +3902,7 @@ class xe extends Z {
|
|
|
3899
3902
|
t,
|
|
3900
3903
|
0,
|
|
3901
3904
|
r
|
|
3902
|
-
), new
|
|
3905
|
+
), new ke(t, "XY", r);
|
|
3903
3906
|
}
|
|
3904
3907
|
/**
|
|
3905
3908
|
* Get the type of this geometry.
|
|
@@ -3935,7 +3938,7 @@ class xe extends Z {
|
|
|
3935
3938
|
*/
|
|
3936
3939
|
setCoordinates(e, t) {
|
|
3937
3940
|
this.setLayout(t, e, 2), this.flatCoordinates || (this.flatCoordinates = []);
|
|
3938
|
-
const r =
|
|
3941
|
+
const r = $e(
|
|
3939
3942
|
this.flatCoordinates,
|
|
3940
3943
|
0,
|
|
3941
3944
|
e,
|
|
@@ -4038,7 +4041,7 @@ class B extends Z {
|
|
|
4038
4041
|
), this.changed();
|
|
4039
4042
|
}
|
|
4040
4043
|
}
|
|
4041
|
-
class
|
|
4044
|
+
class Pe extends Z {
|
|
4042
4045
|
/**
|
|
4043
4046
|
* @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
|
|
4044
4047
|
* For internal use, flat coordinates in combination with `layout` are also accepted.
|
|
@@ -4061,7 +4064,7 @@ class Ee extends Z {
|
|
|
4061
4064
|
* @api
|
|
4062
4065
|
*/
|
|
4063
4066
|
appendPoint(e) {
|
|
4064
|
-
|
|
4067
|
+
E(this.flatCoordinates, e.getFlatCoordinates()), this.changed();
|
|
4065
4068
|
}
|
|
4066
4069
|
/**
|
|
4067
4070
|
* Make a complete copy of the geometry.
|
|
@@ -4070,7 +4073,7 @@ class Ee extends Z {
|
|
|
4070
4073
|
* @override
|
|
4071
4074
|
*/
|
|
4072
4075
|
clone() {
|
|
4073
|
-
const e = new
|
|
4076
|
+
const e = new Pe(
|
|
4074
4077
|
this.flatCoordinates.slice(),
|
|
4075
4078
|
this.layout
|
|
4076
4079
|
);
|
|
@@ -4217,7 +4220,7 @@ class q extends Z {
|
|
|
4217
4220
|
* @api
|
|
4218
4221
|
*/
|
|
4219
4222
|
appendLinearRing(e) {
|
|
4220
|
-
this.flatCoordinates ?
|
|
4223
|
+
this.flatCoordinates ? E(this.flatCoordinates, e.getFlatCoordinates()) : this.flatCoordinates = e.getFlatCoordinates().slice(), this.ends_.push(this.flatCoordinates.length), this.changed();
|
|
4221
4224
|
}
|
|
4222
4225
|
/**
|
|
4223
4226
|
* Make a complete copy of the geometry.
|
|
@@ -4243,14 +4246,14 @@ class q extends Z {
|
|
|
4243
4246
|
*/
|
|
4244
4247
|
closestPointXY(e, t, r, n) {
|
|
4245
4248
|
return n < W(this.getExtent(), e, t) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
4246
|
-
|
|
4249
|
+
Gt(
|
|
4247
4250
|
this.flatCoordinates,
|
|
4248
4251
|
0,
|
|
4249
4252
|
this.ends_,
|
|
4250
4253
|
this.stride,
|
|
4251
4254
|
0
|
|
4252
4255
|
)
|
|
4253
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
4256
|
+
), this.maxDeltaRevision_ = this.getRevision()), Rt(
|
|
4254
4257
|
this.flatCoordinates,
|
|
4255
4258
|
0,
|
|
4256
4259
|
this.ends_,
|
|
@@ -4270,7 +4273,7 @@ class q extends Z {
|
|
|
4270
4273
|
* @override
|
|
4271
4274
|
*/
|
|
4272
4275
|
containsXY(e, t) {
|
|
4273
|
-
return
|
|
4276
|
+
return $t(
|
|
4274
4277
|
this.getOrientedFlatCoordinates(),
|
|
4275
4278
|
0,
|
|
4276
4279
|
this.ends_,
|
|
@@ -4308,7 +4311,7 @@ class q extends Z {
|
|
|
4308
4311
|
*/
|
|
4309
4312
|
getCoordinates(e) {
|
|
4310
4313
|
let t;
|
|
4311
|
-
return e !== void 0 ? (t = this.getOrientedFlatCoordinates().slice(), je(t, 0, this.ends_, this.stride, e)) : t = this.flatCoordinates,
|
|
4314
|
+
return e !== void 0 ? (t = this.getOrientedFlatCoordinates().slice(), je(t, 0, this.ends_, this.stride, e)) : t = this.flatCoordinates, Nt(t, 0, this.ends_, this.stride);
|
|
4312
4315
|
}
|
|
4313
4316
|
/**
|
|
4314
4317
|
* @return {Array<number>} Ends.
|
|
@@ -4322,7 +4325,7 @@ class q extends Z {
|
|
|
4322
4325
|
getFlatInteriorPoint() {
|
|
4323
4326
|
if (this.flatInteriorPointRevision_ != this.getRevision()) {
|
|
4324
4327
|
const e = Ye(this.getExtent());
|
|
4325
|
-
this.flatInteriorPoint_ =
|
|
4328
|
+
this.flatInteriorPoint_ = Pt(
|
|
4326
4329
|
this.getOrientedFlatCoordinates(),
|
|
4327
4330
|
0,
|
|
4328
4331
|
this.ends_,
|
|
@@ -4397,7 +4400,7 @@ class q extends Z {
|
|
|
4397
4400
|
getOrientedFlatCoordinates() {
|
|
4398
4401
|
if (this.orientedRevision_ != this.getRevision()) {
|
|
4399
4402
|
const e = this.flatCoordinates;
|
|
4400
|
-
|
|
4403
|
+
At(e, 0, this.ends_, this.stride) ? this.orientedFlatCoordinates_ = e : (this.orientedFlatCoordinates_ = e.slice(), this.orientedFlatCoordinates_.length = je(
|
|
4401
4404
|
this.orientedFlatCoordinates_,
|
|
4402
4405
|
0,
|
|
4403
4406
|
this.ends_,
|
|
@@ -4417,7 +4420,7 @@ class q extends Z {
|
|
|
4417
4420
|
*/
|
|
4418
4421
|
getSimplifiedGeometryInternal(e) {
|
|
4419
4422
|
const t = [], r = [];
|
|
4420
|
-
return t.length =
|
|
4423
|
+
return t.length = Ft(
|
|
4421
4424
|
this.flatCoordinates,
|
|
4422
4425
|
0,
|
|
4423
4426
|
this.ends_,
|
|
@@ -4462,7 +4465,7 @@ class q extends Z {
|
|
|
4462
4465
|
*/
|
|
4463
4466
|
setCoordinates(e, t) {
|
|
4464
4467
|
this.setLayout(t, e, 2), this.flatCoordinates || (this.flatCoordinates = []);
|
|
4465
|
-
const r =
|
|
4468
|
+
const r = $e(
|
|
4466
4469
|
this.flatCoordinates,
|
|
4467
4470
|
0,
|
|
4468
4471
|
e,
|
|
@@ -4472,7 +4475,7 @@ class q extends Z {
|
|
|
4472
4475
|
this.flatCoordinates.length = r.length === 0 ? 0 : r[r.length - 1], this.changed();
|
|
4473
4476
|
}
|
|
4474
4477
|
}
|
|
4475
|
-
class
|
|
4478
|
+
class xe extends Z {
|
|
4476
4479
|
/**
|
|
4477
4480
|
* @param {Array<Array<Array<import("../coordinate.js").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates.
|
|
4478
4481
|
* For internal use, flat coordinates in combination with `layout` and `endss` are also accepted.
|
|
@@ -4489,7 +4492,7 @@ class ke extends Z {
|
|
|
4489
4492
|
const c = n[s], d = o.length, u = c.getEnds();
|
|
4490
4493
|
for (let h = 0, m = u.length; h < m; ++h)
|
|
4491
4494
|
u[h] += d;
|
|
4492
|
-
|
|
4495
|
+
E(o, c.getFlatCoordinates()), a.push(u);
|
|
4493
4496
|
}
|
|
4494
4497
|
t = n.length === 0 ? this.getLayout() : n[0].getLayout(), e = o, r = a;
|
|
4495
4498
|
}
|
|
@@ -4514,7 +4517,7 @@ class ke extends Z {
|
|
|
4514
4517
|
this.flatCoordinates = e.getFlatCoordinates().slice(), t = e.getEnds().slice(), this.endss_.push();
|
|
4515
4518
|
else {
|
|
4516
4519
|
const r = this.flatCoordinates.length;
|
|
4517
|
-
|
|
4520
|
+
E(this.flatCoordinates, e.getFlatCoordinates()), t = e.getEnds().slice();
|
|
4518
4521
|
for (let n = 0, o = t.length; n < o; ++n)
|
|
4519
4522
|
t[n] += r;
|
|
4520
4523
|
}
|
|
@@ -4530,7 +4533,7 @@ class ke extends Z {
|
|
|
4530
4533
|
const e = this.endss_.length, t = new Array(e);
|
|
4531
4534
|
for (let n = 0; n < e; ++n)
|
|
4532
4535
|
t[n] = this.endss_[n].slice();
|
|
4533
|
-
const r = new
|
|
4536
|
+
const r = new xe(
|
|
4534
4537
|
this.flatCoordinates.slice(),
|
|
4535
4538
|
this.layout,
|
|
4536
4539
|
t
|
|
@@ -4612,7 +4615,7 @@ class ke extends Z {
|
|
|
4612
4615
|
*/
|
|
4613
4616
|
getCoordinates(e) {
|
|
4614
4617
|
let t;
|
|
4615
|
-
return e !== void 0 ? (t = this.getOrientedFlatCoordinates().slice(),
|
|
4618
|
+
return e !== void 0 ? (t = this.getOrientedFlatCoordinates().slice(), mt(
|
|
4616
4619
|
t,
|
|
4617
4620
|
0,
|
|
4618
4621
|
this.endss_,
|
|
@@ -4662,7 +4665,7 @@ class ke extends Z {
|
|
|
4662
4665
|
* @api
|
|
4663
4666
|
*/
|
|
4664
4667
|
getInteriorPoints() {
|
|
4665
|
-
return new
|
|
4668
|
+
return new Pe(this.getFlatInteriorPoints().slice(), "XYM");
|
|
4666
4669
|
}
|
|
4667
4670
|
/**
|
|
4668
4671
|
* @return {Array<number>} Oriented flat coordinates.
|
|
@@ -4670,7 +4673,7 @@ class ke extends Z {
|
|
|
4670
4673
|
getOrientedFlatCoordinates() {
|
|
4671
4674
|
if (this.orientedRevision_ != this.getRevision()) {
|
|
4672
4675
|
const e = this.flatCoordinates;
|
|
4673
|
-
Qr(e, 0, this.endss_, this.stride) ? this.orientedFlatCoordinates_ = e : (this.orientedFlatCoordinates_ = e.slice(), this.orientedFlatCoordinates_.length =
|
|
4676
|
+
Qr(e, 0, this.endss_, this.stride) ? this.orientedFlatCoordinates_ = e : (this.orientedFlatCoordinates_ = e.slice(), this.orientedFlatCoordinates_.length = mt(
|
|
4674
4677
|
this.orientedFlatCoordinates_,
|
|
4675
4678
|
0,
|
|
4676
4679
|
this.endss_,
|
|
@@ -4699,7 +4702,7 @@ class ke extends Z {
|
|
|
4699
4702
|
t,
|
|
4700
4703
|
0,
|
|
4701
4704
|
r
|
|
4702
|
-
), new
|
|
4705
|
+
), new xe(t, "XY", r);
|
|
4703
4706
|
}
|
|
4704
4707
|
/**
|
|
4705
4708
|
* Return the polygon at the specified index.
|
|
@@ -4799,7 +4802,7 @@ class ke extends Z {
|
|
|
4799
4802
|
this.changed();
|
|
4800
4803
|
}
|
|
4801
4804
|
}
|
|
4802
|
-
const
|
|
4805
|
+
const vr = Br();
|
|
4803
4806
|
class J {
|
|
4804
4807
|
/**
|
|
4805
4808
|
* @param {Type} type Geometry type.
|
|
@@ -4828,7 +4831,7 @@ class J {
|
|
|
4828
4831
|
* @api
|
|
4829
4832
|
*/
|
|
4830
4833
|
getExtent() {
|
|
4831
|
-
return this.extent_ || (this.extent_ = this.type_ === "Point" ? Tr(this.flatCoordinates_) :
|
|
4834
|
+
return this.extent_ || (this.extent_ = this.type_ === "Point" ? Tr(this.flatCoordinates_) : _t(
|
|
4832
4835
|
this.flatCoordinates_,
|
|
4833
4836
|
0,
|
|
4834
4837
|
this.flatCoordinates_.length,
|
|
@@ -4841,7 +4844,7 @@ class J {
|
|
|
4841
4844
|
getFlatInteriorPoint() {
|
|
4842
4845
|
if (!this.flatInteriorPoints_) {
|
|
4843
4846
|
const e = Ye(this.getExtent());
|
|
4844
|
-
this.flatInteriorPoints_ =
|
|
4847
|
+
this.flatInteriorPoints_ = Pt(
|
|
4845
4848
|
this.flatCoordinates_,
|
|
4846
4849
|
0,
|
|
4847
4850
|
this.ends_,
|
|
@@ -4894,7 +4897,7 @@ class J {
|
|
|
4894
4897
|
);
|
|
4895
4898
|
for (let n = 0, o = r.length; n < o; ++n) {
|
|
4896
4899
|
const a = r[n], s = He(e, t, a, 2, 0.5);
|
|
4897
|
-
|
|
4900
|
+
E(this.flatMidpoints_, s), t = a;
|
|
4898
4901
|
}
|
|
4899
4902
|
}
|
|
4900
4903
|
return this.flatMidpoints_;
|
|
@@ -4986,7 +4989,7 @@ class J {
|
|
|
4986
4989
|
if (t && r) {
|
|
4987
4990
|
const n = Ne(r) / Ne(t);
|
|
4988
4991
|
qr(
|
|
4989
|
-
|
|
4992
|
+
vr,
|
|
4990
4993
|
r[0],
|
|
4991
4994
|
r[3],
|
|
4992
4995
|
n,
|
|
@@ -4999,7 +5002,7 @@ class J {
|
|
|
4999
5002
|
0,
|
|
5000
5003
|
this.flatCoordinates_.length,
|
|
5001
5004
|
2,
|
|
5002
|
-
|
|
5005
|
+
vr,
|
|
5003
5006
|
this.flatCoordinates_
|
|
5004
5007
|
);
|
|
5005
5008
|
}
|
|
@@ -5070,7 +5073,7 @@ class J {
|
|
|
5070
5073
|
);
|
|
5071
5074
|
break;
|
|
5072
5075
|
case "Polygon":
|
|
5073
|
-
n = [], r.length =
|
|
5076
|
+
n = [], r.length = Ft(
|
|
5074
5077
|
r,
|
|
5075
5078
|
0,
|
|
5076
5079
|
this.simplifiedGeometry_.ends_,
|
|
@@ -5140,7 +5143,7 @@ class oi {
|
|
|
5140
5143
|
* @return {Type} The format type.
|
|
5141
5144
|
*/
|
|
5142
5145
|
getType() {
|
|
5143
|
-
return
|
|
5146
|
+
return b();
|
|
5144
5147
|
}
|
|
5145
5148
|
/**
|
|
5146
5149
|
* Read a single feature from a source.
|
|
@@ -5151,7 +5154,7 @@ class oi {
|
|
|
5151
5154
|
* @return {FeatureType|Array<FeatureType>} Feature.
|
|
5152
5155
|
*/
|
|
5153
5156
|
readFeature(e, t) {
|
|
5154
|
-
return
|
|
5157
|
+
return b();
|
|
5155
5158
|
}
|
|
5156
5159
|
/**
|
|
5157
5160
|
* Read all features from a source.
|
|
@@ -5162,7 +5165,7 @@ class oi {
|
|
|
5162
5165
|
* @return {Array<FeatureType>} Features.
|
|
5163
5166
|
*/
|
|
5164
5167
|
readFeatures(e, t) {
|
|
5165
|
-
return
|
|
5168
|
+
return b();
|
|
5166
5169
|
}
|
|
5167
5170
|
/**
|
|
5168
5171
|
* Read a single geometry from a source.
|
|
@@ -5173,7 +5176,7 @@ class oi {
|
|
|
5173
5176
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
|
5174
5177
|
*/
|
|
5175
5178
|
readGeometry(e, t) {
|
|
5176
|
-
return
|
|
5179
|
+
return b();
|
|
5177
5180
|
}
|
|
5178
5181
|
/**
|
|
5179
5182
|
* Read the projection from a source.
|
|
@@ -5183,7 +5186,7 @@ class oi {
|
|
|
5183
5186
|
* @return {import("../proj/Projection.js").default|undefined} Projection.
|
|
5184
5187
|
*/
|
|
5185
5188
|
readProjection(e) {
|
|
5186
|
-
return
|
|
5189
|
+
return b();
|
|
5187
5190
|
}
|
|
5188
5191
|
/**
|
|
5189
5192
|
* Encode a feature in this format.
|
|
@@ -5194,7 +5197,7 @@ class oi {
|
|
|
5194
5197
|
* @return {string|ArrayBuffer} Result.
|
|
5195
5198
|
*/
|
|
5196
5199
|
writeFeature(e, t) {
|
|
5197
|
-
return
|
|
5200
|
+
return b();
|
|
5198
5201
|
}
|
|
5199
5202
|
/**
|
|
5200
5203
|
* Encode an array of features in this format.
|
|
@@ -5205,7 +5208,7 @@ class oi {
|
|
|
5205
5208
|
* @return {string|ArrayBuffer} Result.
|
|
5206
5209
|
*/
|
|
5207
5210
|
writeFeatures(e, t) {
|
|
5208
|
-
return
|
|
5211
|
+
return b();
|
|
5209
5212
|
}
|
|
5210
5213
|
/**
|
|
5211
5214
|
* Write a single geometry in this format.
|
|
@@ -5216,7 +5219,7 @@ class oi {
|
|
|
5216
5219
|
* @return {string|ArrayBuffer} Result.
|
|
5217
5220
|
*/
|
|
5218
5221
|
writeGeometry(e, t) {
|
|
5219
|
-
return
|
|
5222
|
+
return b();
|
|
5220
5223
|
}
|
|
5221
5224
|
}
|
|
5222
5225
|
function _e(i, e, t) {
|
|
@@ -5226,7 +5229,7 @@ function _e(i, e, t) {
|
|
|
5226
5229
|
e && (o = /** @type {T} */
|
|
5227
5230
|
i.clone());
|
|
5228
5231
|
const a = e ? r : n, s = e ? n : r;
|
|
5229
|
-
a.getUnits() === "tile-pixels" ? o.transform(a, s) : o.applyTransform(
|
|
5232
|
+
a.getUnits() === "tile-pixels" ? o.transform(a, s) : o.applyTransform(ut(a, s));
|
|
5230
5233
|
}
|
|
5231
5234
|
if (e && t && /** @type {WriteOptions} */
|
|
5232
5235
|
t.decimals !== void 0) {
|
|
@@ -5248,12 +5251,12 @@ const fo = {
|
|
|
5248
5251
|
Point: B,
|
|
5249
5252
|
LineString: X,
|
|
5250
5253
|
Polygon: q,
|
|
5251
|
-
MultiPoint:
|
|
5252
|
-
MultiLineString:
|
|
5253
|
-
MultiPolygon:
|
|
5254
|
+
MultiPoint: Pe,
|
|
5255
|
+
MultiLineString: ke,
|
|
5256
|
+
MultiPolygon: xe
|
|
5254
5257
|
};
|
|
5255
5258
|
function bo(i, e, t) {
|
|
5256
|
-
return Array.isArray(e[0]) ? (Qr(i, 0, e, t) || (i = i.slice(),
|
|
5259
|
+
return Array.isArray(e[0]) ? (Qr(i, 0, e, t) || (i = i.slice(), mt(i, 0, e, t)), i) : (At(i, 0, e, t) || (i = i.slice(), je(i, 0, e, t)), i);
|
|
5257
5260
|
}
|
|
5258
5261
|
function ai(i, e) {
|
|
5259
5262
|
var o;
|
|
@@ -5279,12 +5282,12 @@ function ai(i, e) {
|
|
|
5279
5282
|
e
|
|
5280
5283
|
);
|
|
5281
5284
|
}
|
|
5282
|
-
function
|
|
5285
|
+
function Tt(i, e) {
|
|
5283
5286
|
if (!i)
|
|
5284
5287
|
return null;
|
|
5285
5288
|
if (Array.isArray(i)) {
|
|
5286
5289
|
const r = i.map(
|
|
5287
|
-
(n) =>
|
|
5290
|
+
(n) => Tt(n, e)
|
|
5288
5291
|
);
|
|
5289
5292
|
return new Y(r);
|
|
5290
5293
|
}
|
|
@@ -5346,7 +5349,7 @@ class yo extends oi {
|
|
|
5346
5349
|
* @return {FeatureType|Array<FeatureType>} Feature.
|
|
5347
5350
|
*/
|
|
5348
5351
|
readFeatureFromObject(e, t) {
|
|
5349
|
-
return
|
|
5352
|
+
return b();
|
|
5350
5353
|
}
|
|
5351
5354
|
/**
|
|
5352
5355
|
* @abstract
|
|
@@ -5356,7 +5359,7 @@ class yo extends oi {
|
|
|
5356
5359
|
* @return {Array<FeatureType>} Features.
|
|
5357
5360
|
*/
|
|
5358
5361
|
readFeaturesFromObject(e, t) {
|
|
5359
|
-
return
|
|
5362
|
+
return b();
|
|
5360
5363
|
}
|
|
5361
5364
|
/**
|
|
5362
5365
|
* Read a geometry.
|
|
@@ -5381,7 +5384,7 @@ class yo extends oi {
|
|
|
5381
5384
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
|
5382
5385
|
*/
|
|
5383
5386
|
readGeometryFromObject(e, t) {
|
|
5384
|
-
return
|
|
5387
|
+
return b();
|
|
5385
5388
|
}
|
|
5386
5389
|
/**
|
|
5387
5390
|
* Read the projection.
|
|
@@ -5401,7 +5404,7 @@ class yo extends oi {
|
|
|
5401
5404
|
* @return {import("../proj/Projection.js").default} Projection.
|
|
5402
5405
|
*/
|
|
5403
5406
|
readProjectionFromObject(e) {
|
|
5404
|
-
return
|
|
5407
|
+
return b();
|
|
5405
5408
|
}
|
|
5406
5409
|
/**
|
|
5407
5410
|
* Encode a feature as string.
|
|
@@ -5422,7 +5425,7 @@ class yo extends oi {
|
|
|
5422
5425
|
* @return {Object} Object.
|
|
5423
5426
|
*/
|
|
5424
5427
|
writeFeatureObject(e, t) {
|
|
5425
|
-
return
|
|
5428
|
+
return b();
|
|
5426
5429
|
}
|
|
5427
5430
|
/**
|
|
5428
5431
|
* Encode an array of features as string.
|
|
@@ -5443,7 +5446,7 @@ class yo extends oi {
|
|
|
5443
5446
|
* @return {Object} Object.
|
|
5444
5447
|
*/
|
|
5445
5448
|
writeFeaturesObject(e, t) {
|
|
5446
|
-
return
|
|
5449
|
+
return b();
|
|
5447
5450
|
}
|
|
5448
5451
|
/**
|
|
5449
5452
|
* Encode a geometry as string.
|
|
@@ -5464,7 +5467,7 @@ class yo extends oi {
|
|
|
5464
5467
|
* @return {Object} Object.
|
|
5465
5468
|
*/
|
|
5466
5469
|
writeGeometryObject(e, t) {
|
|
5467
|
-
return
|
|
5470
|
+
return b();
|
|
5468
5471
|
}
|
|
5469
5472
|
}
|
|
5470
5473
|
function Ae(i) {
|
|
@@ -5504,7 +5507,7 @@ class vo extends yo {
|
|
|
5504
5507
|
),
|
|
5505
5508
|
properties: null
|
|
5506
5509
|
};
|
|
5507
|
-
const n =
|
|
5510
|
+
const n = Ot(r.geometry);
|
|
5508
5511
|
if (this.featureClass === J)
|
|
5509
5512
|
return (
|
|
5510
5513
|
/** @type {FeatureType|Array<FeatureType>} */
|
|
@@ -5518,7 +5521,7 @@ class vo extends yo {
|
|
|
5518
5521
|
)
|
|
5519
5522
|
);
|
|
5520
5523
|
const o = new le();
|
|
5521
|
-
return this.geometryName_ ? o.setGeometryName(this.geometryName_) : this.extractGeometryName_ && r.geometry_name && o.setGeometryName(r.geometry_name), o.setGeometry(
|
|
5524
|
+
return this.geometryName_ ? o.setGeometryName(this.geometryName_) : this.extractGeometryName_ && r.geometry_name && o.setGeometryName(r.geometry_name), o.setGeometry(Tt(n, t)), "id" in r && o.setId(r.id), r.properties && o.setProperties(r.properties, !0), /** @type {FeatureType|Array<FeatureType>} */
|
|
5522
5525
|
o;
|
|
5523
5526
|
}
|
|
5524
5527
|
/**
|
|
@@ -5563,7 +5566,7 @@ class vo extends yo {
|
|
|
5563
5566
|
* @override
|
|
5564
5567
|
*/
|
|
5565
5568
|
readGeometryFromObject(e, t) {
|
|
5566
|
-
return
|
|
5569
|
+
return ko(e, t);
|
|
5567
5570
|
}
|
|
5568
5571
|
/**
|
|
5569
5572
|
* @param {Object} object Object.
|
|
@@ -5607,7 +5610,7 @@ class vo extends yo {
|
|
|
5607
5610
|
if (n !== void 0 && (r.id = n), !e.hasProperties())
|
|
5608
5611
|
return r;
|
|
5609
5612
|
const o = e.getProperties(), a = e.getGeometry();
|
|
5610
|
-
return a && (r.geometry =
|
|
5613
|
+
return a && (r.geometry = pt(a, t), delete o[e.getGeometryName()]), Lr(o) || (r.properties = o), r;
|
|
5611
5614
|
}
|
|
5612
5615
|
/**
|
|
5613
5616
|
* Encode an array of features as a GeoJSON object.
|
|
@@ -5638,10 +5641,10 @@ class vo extends yo {
|
|
|
5638
5641
|
* @override
|
|
5639
5642
|
*/
|
|
5640
5643
|
writeGeometryObject(e, t) {
|
|
5641
|
-
return
|
|
5644
|
+
return pt(e, this.adaptOptions(t));
|
|
5642
5645
|
}
|
|
5643
5646
|
}
|
|
5644
|
-
function
|
|
5647
|
+
function Ot(i, e) {
|
|
5645
5648
|
if (!i)
|
|
5646
5649
|
return null;
|
|
5647
5650
|
let t;
|
|
@@ -5661,7 +5664,7 @@ function Nt(i, e) {
|
|
|
5661
5664
|
break;
|
|
5662
5665
|
}
|
|
5663
5666
|
case "Polygon": {
|
|
5664
|
-
t =
|
|
5667
|
+
t = So(
|
|
5665
5668
|
/** @type {GeoJSONPolygon} */
|
|
5666
5669
|
i
|
|
5667
5670
|
);
|
|
@@ -5682,14 +5685,14 @@ function Nt(i, e) {
|
|
|
5682
5685
|
break;
|
|
5683
5686
|
}
|
|
5684
5687
|
case "MultiPolygon": {
|
|
5685
|
-
t =
|
|
5688
|
+
t = Mo(
|
|
5686
5689
|
/** @type {GeoJSONMultiPolygon} */
|
|
5687
5690
|
i
|
|
5688
5691
|
);
|
|
5689
5692
|
break;
|
|
5690
5693
|
}
|
|
5691
5694
|
case "GeometryCollection": {
|
|
5692
|
-
t =
|
|
5695
|
+
t = xo(
|
|
5693
5696
|
/** @type {GeoJSONGeometryCollection} */
|
|
5694
5697
|
i
|
|
5695
5698
|
);
|
|
@@ -5700,18 +5703,18 @@ function Nt(i, e) {
|
|
|
5700
5703
|
}
|
|
5701
5704
|
return t;
|
|
5702
5705
|
}
|
|
5703
|
-
function xo(i, e) {
|
|
5704
|
-
const t = Nt(i);
|
|
5705
|
-
return Rt(t, e);
|
|
5706
|
-
}
|
|
5707
5706
|
function ko(i, e) {
|
|
5707
|
+
const t = Ot(i);
|
|
5708
|
+
return Tt(t, e);
|
|
5709
|
+
}
|
|
5710
|
+
function xo(i, e) {
|
|
5708
5711
|
return i.geometries.map(
|
|
5709
5712
|
/**
|
|
5710
5713
|
* @param {GeoJSONGeometry} geometry Geometry.
|
|
5711
5714
|
* @return {import("./Feature.js").GeometryObject} geometry Geometry.
|
|
5712
5715
|
*/
|
|
5713
5716
|
function(r) {
|
|
5714
|
-
return
|
|
5717
|
+
return Ot(r);
|
|
5715
5718
|
}
|
|
5716
5719
|
);
|
|
5717
5720
|
}
|
|
@@ -5735,7 +5738,7 @@ function wo(i) {
|
|
|
5735
5738
|
}
|
|
5736
5739
|
function zo(i) {
|
|
5737
5740
|
var o, a;
|
|
5738
|
-
const e = i.coordinates, t = ((a = (o = e[0]) == null ? void 0 : o[0]) == null ? void 0 : a.length) || 2, r = [], n =
|
|
5741
|
+
const e = i.coordinates, t = ((a = (o = e[0]) == null ? void 0 : o[0]) == null ? void 0 : a.length) || 2, r = [], n = $e(r, 0, e, t);
|
|
5739
5742
|
return {
|
|
5740
5743
|
type: "MultiLineString",
|
|
5741
5744
|
flatCoordinates: r,
|
|
@@ -5752,7 +5755,7 @@ function Co(i) {
|
|
|
5752
5755
|
layout: K(((t = e[0]) == null ? void 0 : t.length) || 2)
|
|
5753
5756
|
};
|
|
5754
5757
|
}
|
|
5755
|
-
function
|
|
5758
|
+
function Mo(i) {
|
|
5756
5759
|
var o, a;
|
|
5757
5760
|
const e = i.coordinates, t = [], r = ((a = (o = e[0]) == null ? void 0 : o[0]) == null ? void 0 : a[0].length) || 2, n = Zr(
|
|
5758
5761
|
t,
|
|
@@ -5767,9 +5770,9 @@ function So(i) {
|
|
|
5767
5770
|
layout: K(r)
|
|
5768
5771
|
};
|
|
5769
5772
|
}
|
|
5770
|
-
function
|
|
5773
|
+
function So(i) {
|
|
5771
5774
|
var o, a;
|
|
5772
|
-
const e = i.coordinates, t = [], r = (a = (o = e[0]) == null ? void 0 : o[0]) == null ? void 0 : a.length, n =
|
|
5775
|
+
const e = i.coordinates, t = [], r = (a = (o = e[0]) == null ? void 0 : o[0]) == null ? void 0 : a.length, n = $e(t, 0, e, r);
|
|
5773
5776
|
return {
|
|
5774
5777
|
type: "Polygon",
|
|
5775
5778
|
flatCoordinates: t,
|
|
@@ -5777,27 +5780,27 @@ function Mo(i) {
|
|
|
5777
5780
|
layout: K(r)
|
|
5778
5781
|
};
|
|
5779
5782
|
}
|
|
5780
|
-
function
|
|
5783
|
+
function pt(i, e) {
|
|
5781
5784
|
i = _e(i, !0, e);
|
|
5782
5785
|
const t = i.getType();
|
|
5783
5786
|
let r;
|
|
5784
5787
|
switch (t) {
|
|
5785
5788
|
case "Point": {
|
|
5786
|
-
r =
|
|
5789
|
+
r = Lo(
|
|
5787
5790
|
/** @type {import("../geom/Point.js").default} */
|
|
5788
5791
|
i
|
|
5789
5792
|
);
|
|
5790
5793
|
break;
|
|
5791
5794
|
}
|
|
5792
5795
|
case "LineString": {
|
|
5793
|
-
r =
|
|
5796
|
+
r = Po(
|
|
5794
5797
|
/** @type {import("../geom/LineString.js").default} */
|
|
5795
5798
|
i
|
|
5796
5799
|
);
|
|
5797
5800
|
break;
|
|
5798
5801
|
}
|
|
5799
5802
|
case "Polygon": {
|
|
5800
|
-
r =
|
|
5803
|
+
r = Go(
|
|
5801
5804
|
/** @type {import("../geom/Polygon.js").default} */
|
|
5802
5805
|
i,
|
|
5803
5806
|
e
|
|
@@ -5812,7 +5815,7 @@ function ht(i, e) {
|
|
|
5812
5815
|
break;
|
|
5813
5816
|
}
|
|
5814
5817
|
case "MultiLineString": {
|
|
5815
|
-
r =
|
|
5818
|
+
r = Eo(
|
|
5816
5819
|
/** @type {import("../geom/MultiLineString.js").default} */
|
|
5817
5820
|
i
|
|
5818
5821
|
);
|
|
@@ -5827,7 +5830,7 @@ function ht(i, e) {
|
|
|
5827
5830
|
break;
|
|
5828
5831
|
}
|
|
5829
5832
|
case "GeometryCollection": {
|
|
5830
|
-
r =
|
|
5833
|
+
r = $o(
|
|
5831
5834
|
/** @type {import("../geom/GeometryCollection.js").default} */
|
|
5832
5835
|
i,
|
|
5833
5836
|
e
|
|
@@ -5846,21 +5849,21 @@ function ht(i, e) {
|
|
|
5846
5849
|
}
|
|
5847
5850
|
return r;
|
|
5848
5851
|
}
|
|
5849
|
-
function
|
|
5852
|
+
function $o(i, e) {
|
|
5850
5853
|
return e = Object.assign({}, e), delete e.featureProjection, {
|
|
5851
5854
|
type: "GeometryCollection",
|
|
5852
5855
|
geometries: i.getGeometriesArray().map(function(r) {
|
|
5853
|
-
return
|
|
5856
|
+
return pt(r, e);
|
|
5854
5857
|
})
|
|
5855
5858
|
};
|
|
5856
5859
|
}
|
|
5857
|
-
function
|
|
5860
|
+
function Po(i, e) {
|
|
5858
5861
|
return {
|
|
5859
5862
|
type: "LineString",
|
|
5860
5863
|
coordinates: i.getCoordinates()
|
|
5861
5864
|
};
|
|
5862
5865
|
}
|
|
5863
|
-
function
|
|
5866
|
+
function Eo(i, e) {
|
|
5864
5867
|
return {
|
|
5865
5868
|
type: "MultiLineString",
|
|
5866
5869
|
coordinates: i.getCoordinates()
|
|
@@ -5879,20 +5882,20 @@ function Fo(i, e) {
|
|
|
5879
5882
|
coordinates: i.getCoordinates(t)
|
|
5880
5883
|
};
|
|
5881
5884
|
}
|
|
5882
|
-
function
|
|
5885
|
+
function Lo(i, e) {
|
|
5883
5886
|
return {
|
|
5884
5887
|
type: "Point",
|
|
5885
5888
|
coordinates: i.getCoordinates()
|
|
5886
5889
|
};
|
|
5887
5890
|
}
|
|
5888
|
-
function
|
|
5891
|
+
function Go(i, e) {
|
|
5889
5892
|
let t;
|
|
5890
5893
|
return e && (t = e.rightHanded), {
|
|
5891
5894
|
type: "Polygon",
|
|
5892
5895
|
coordinates: i.getCoordinates(t)
|
|
5893
5896
|
};
|
|
5894
5897
|
}
|
|
5895
|
-
const
|
|
5898
|
+
const Io = (i, e) => new vo().writeFeaturesObject(i, e);
|
|
5896
5899
|
class Ro extends oi {
|
|
5897
5900
|
constructor() {
|
|
5898
5901
|
super();
|
|
@@ -5927,7 +5930,7 @@ class Ro extends oi {
|
|
|
5927
5930
|
* @return {import("../Feature.js").default} Feature.
|
|
5928
5931
|
*/
|
|
5929
5932
|
readFeatureFromText(e, t) {
|
|
5930
|
-
return
|
|
5933
|
+
return b();
|
|
5931
5934
|
}
|
|
5932
5935
|
/**
|
|
5933
5936
|
* Read the features from the source.
|
|
@@ -5952,7 +5955,7 @@ class Ro extends oi {
|
|
|
5952
5955
|
* @return {Array<import("../Feature.js").default>} Features.
|
|
5953
5956
|
*/
|
|
5954
5957
|
readFeaturesFromText(e, t) {
|
|
5955
|
-
return
|
|
5958
|
+
return b();
|
|
5956
5959
|
}
|
|
5957
5960
|
/**
|
|
5958
5961
|
* Read the geometry from the source.
|
|
@@ -5977,7 +5980,7 @@ class Ro extends oi {
|
|
|
5977
5980
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
|
5978
5981
|
*/
|
|
5979
5982
|
readGeometryFromText(e, t) {
|
|
5980
|
-
return
|
|
5983
|
+
return b();
|
|
5981
5984
|
}
|
|
5982
5985
|
/**
|
|
5983
5986
|
* Read the projection from the source.
|
|
@@ -6018,7 +6021,7 @@ class Ro extends oi {
|
|
|
6018
6021
|
* @return {string} Text.
|
|
6019
6022
|
*/
|
|
6020
6023
|
writeFeatureText(e, t) {
|
|
6021
|
-
return
|
|
6024
|
+
return b();
|
|
6022
6025
|
}
|
|
6023
6026
|
/**
|
|
6024
6027
|
* Encode an array of features as string.
|
|
@@ -6040,7 +6043,7 @@ class Ro extends oi {
|
|
|
6040
6043
|
* @return {string} Text.
|
|
6041
6044
|
*/
|
|
6042
6045
|
writeFeaturesText(e, t) {
|
|
6043
|
-
return
|
|
6046
|
+
return b();
|
|
6044
6047
|
}
|
|
6045
6048
|
/**
|
|
6046
6049
|
* Write a single geometry.
|
|
@@ -6062,7 +6065,7 @@ class Ro extends oi {
|
|
|
6062
6065
|
* @return {string} Text.
|
|
6063
6066
|
*/
|
|
6064
6067
|
writeGeometryText(e, t) {
|
|
6065
|
-
return
|
|
6068
|
+
return b();
|
|
6066
6069
|
}
|
|
6067
6070
|
}
|
|
6068
6071
|
function Fe(i) {
|
|
@@ -6072,10 +6075,10 @@ const No = {
|
|
|
6072
6075
|
POINT: B,
|
|
6073
6076
|
LINESTRING: X,
|
|
6074
6077
|
POLYGON: q,
|
|
6075
|
-
MULTIPOINT:
|
|
6076
|
-
MULTILINESTRING:
|
|
6077
|
-
MULTIPOLYGON:
|
|
6078
|
-
}, si = "EMPTY", li = "Z", ci = "M", To = "ZM",
|
|
6078
|
+
MULTIPOINT: Pe,
|
|
6079
|
+
MULTILINESTRING: ke,
|
|
6080
|
+
MULTIPOLYGON: xe
|
|
6081
|
+
}, si = "EMPTY", li = "Z", ci = "M", To = "ZM", y = {
|
|
6079
6082
|
START: 0,
|
|
6080
6083
|
TEXT: 1,
|
|
6081
6084
|
LEFT_PAREN: 2,
|
|
@@ -6142,20 +6145,20 @@ class Ho {
|
|
|
6142
6145
|
const e = this.nextChar_(), t = this.index_;
|
|
6143
6146
|
let r = e, n;
|
|
6144
6147
|
if (e == "(")
|
|
6145
|
-
n =
|
|
6148
|
+
n = y.LEFT_PAREN;
|
|
6146
6149
|
else if (e == ",")
|
|
6147
|
-
n =
|
|
6150
|
+
n = y.COMMA;
|
|
6148
6151
|
else if (e == ")")
|
|
6149
|
-
n =
|
|
6152
|
+
n = y.RIGHT_PAREN;
|
|
6150
6153
|
else if (this.isNumeric_(e) || e == "-")
|
|
6151
|
-
n =
|
|
6154
|
+
n = y.NUMBER, r = this.readNumber_();
|
|
6152
6155
|
else if (this.isAlpha_(e))
|
|
6153
|
-
n =
|
|
6156
|
+
n = y.TEXT, r = this.readText_();
|
|
6154
6157
|
else {
|
|
6155
6158
|
if (this.isWhiteSpace_(e))
|
|
6156
6159
|
return this.nextToken();
|
|
6157
6160
|
if (e === "")
|
|
6158
|
-
n =
|
|
6161
|
+
n = y.EOF;
|
|
6159
6162
|
else
|
|
6160
6163
|
throw new Error("Unexpected character: " + e);
|
|
6161
6164
|
}
|
|
@@ -6198,7 +6201,7 @@ class jo {
|
|
|
6198
6201
|
constructor(e) {
|
|
6199
6202
|
this.lexer_ = e, this.token_ = {
|
|
6200
6203
|
position: 0,
|
|
6201
|
-
type:
|
|
6204
|
+
type: y.START
|
|
6202
6205
|
}, this.layout_ = "XY";
|
|
6203
6206
|
}
|
|
6204
6207
|
/**
|
|
@@ -6240,7 +6243,7 @@ class jo {
|
|
|
6240
6243
|
parseGeometryLayout_() {
|
|
6241
6244
|
let e = "XY";
|
|
6242
6245
|
const t = this.token_;
|
|
6243
|
-
if (this.isTokenType(
|
|
6246
|
+
if (this.isTokenType(y.TEXT)) {
|
|
6244
6247
|
const r = t.value;
|
|
6245
6248
|
r === li ? e = "XYZ" : r === ci ? e = "XYM" : r === To && (e = "XYZM"), e !== "XY" && this.consume_();
|
|
6246
6249
|
}
|
|
@@ -6251,12 +6254,12 @@ class jo {
|
|
|
6251
6254
|
* @private
|
|
6252
6255
|
*/
|
|
6253
6256
|
parseGeometryCollectionText_() {
|
|
6254
|
-
if (this.match(
|
|
6257
|
+
if (this.match(y.LEFT_PAREN)) {
|
|
6255
6258
|
const e = [];
|
|
6256
6259
|
do
|
|
6257
6260
|
e.push(this.parseGeometry_());
|
|
6258
|
-
while (this.match(
|
|
6259
|
-
if (this.match(
|
|
6261
|
+
while (this.match(y.COMMA));
|
|
6262
|
+
if (this.match(y.RIGHT_PAREN))
|
|
6260
6263
|
return e;
|
|
6261
6264
|
}
|
|
6262
6265
|
throw new Error(this.formatErrorMessage_());
|
|
@@ -6266,9 +6269,9 @@ class jo {
|
|
|
6266
6269
|
* @private
|
|
6267
6270
|
*/
|
|
6268
6271
|
parsePointText_() {
|
|
6269
|
-
if (this.match(
|
|
6272
|
+
if (this.match(y.LEFT_PAREN)) {
|
|
6270
6273
|
const e = this.parsePoint_();
|
|
6271
|
-
if (this.match(
|
|
6274
|
+
if (this.match(y.RIGHT_PAREN))
|
|
6272
6275
|
return e;
|
|
6273
6276
|
}
|
|
6274
6277
|
throw new Error(this.formatErrorMessage_());
|
|
@@ -6278,9 +6281,9 @@ class jo {
|
|
|
6278
6281
|
* @private
|
|
6279
6282
|
*/
|
|
6280
6283
|
parseLineStringText_() {
|
|
6281
|
-
if (this.match(
|
|
6284
|
+
if (this.match(y.LEFT_PAREN)) {
|
|
6282
6285
|
const e = this.parsePointList_();
|
|
6283
|
-
if (this.match(
|
|
6286
|
+
if (this.match(y.RIGHT_PAREN))
|
|
6284
6287
|
return e;
|
|
6285
6288
|
}
|
|
6286
6289
|
throw new Error(this.formatErrorMessage_());
|
|
@@ -6290,9 +6293,9 @@ class jo {
|
|
|
6290
6293
|
* @private
|
|
6291
6294
|
*/
|
|
6292
6295
|
parsePolygonText_() {
|
|
6293
|
-
if (this.match(
|
|
6296
|
+
if (this.match(y.LEFT_PAREN)) {
|
|
6294
6297
|
const e = this.parseLineStringTextList_();
|
|
6295
|
-
if (this.match(
|
|
6298
|
+
if (this.match(y.RIGHT_PAREN))
|
|
6296
6299
|
return e;
|
|
6297
6300
|
}
|
|
6298
6301
|
throw new Error(this.formatErrorMessage_());
|
|
@@ -6302,9 +6305,9 @@ class jo {
|
|
|
6302
6305
|
* @private
|
|
6303
6306
|
*/
|
|
6304
6307
|
parseMultiPointText_() {
|
|
6305
|
-
if (this.match(
|
|
6308
|
+
if (this.match(y.LEFT_PAREN)) {
|
|
6306
6309
|
let e;
|
|
6307
|
-
if (this.token_.type ==
|
|
6310
|
+
if (this.token_.type == y.LEFT_PAREN ? e = this.parsePointTextList_() : e = this.parsePointList_(), this.match(y.RIGHT_PAREN))
|
|
6308
6311
|
return e;
|
|
6309
6312
|
}
|
|
6310
6313
|
throw new Error(this.formatErrorMessage_());
|
|
@@ -6315,9 +6318,9 @@ class jo {
|
|
|
6315
6318
|
* @private
|
|
6316
6319
|
*/
|
|
6317
6320
|
parseMultiLineStringText_() {
|
|
6318
|
-
if (this.match(
|
|
6321
|
+
if (this.match(y.LEFT_PAREN)) {
|
|
6319
6322
|
const e = this.parseLineStringTextList_();
|
|
6320
|
-
if (this.match(
|
|
6323
|
+
if (this.match(y.RIGHT_PAREN))
|
|
6321
6324
|
return e;
|
|
6322
6325
|
}
|
|
6323
6326
|
throw new Error(this.formatErrorMessage_());
|
|
@@ -6327,9 +6330,9 @@ class jo {
|
|
|
6327
6330
|
* @private
|
|
6328
6331
|
*/
|
|
6329
6332
|
parseMultiPolygonText_() {
|
|
6330
|
-
if (this.match(
|
|
6333
|
+
if (this.match(y.LEFT_PAREN)) {
|
|
6331
6334
|
const e = this.parsePolygonTextList_();
|
|
6332
|
-
if (this.match(
|
|
6335
|
+
if (this.match(y.RIGHT_PAREN))
|
|
6333
6336
|
return e;
|
|
6334
6337
|
}
|
|
6335
6338
|
throw new Error(this.formatErrorMessage_());
|
|
@@ -6342,7 +6345,7 @@ class jo {
|
|
|
6342
6345
|
const e = [], t = this.layout_.length;
|
|
6343
6346
|
for (let r = 0; r < t; ++r) {
|
|
6344
6347
|
const n = this.token_;
|
|
6345
|
-
if (this.match(
|
|
6348
|
+
if (this.match(y.NUMBER))
|
|
6346
6349
|
e.push(
|
|
6347
6350
|
/** @type {number} */
|
|
6348
6351
|
n.value
|
|
@@ -6360,7 +6363,7 @@ class jo {
|
|
|
6360
6363
|
*/
|
|
6361
6364
|
parsePointList_() {
|
|
6362
6365
|
const e = [this.parsePoint_()];
|
|
6363
|
-
for (; this.match(
|
|
6366
|
+
for (; this.match(y.COMMA); )
|
|
6364
6367
|
e.push(this.parsePoint_());
|
|
6365
6368
|
return e;
|
|
6366
6369
|
}
|
|
@@ -6370,7 +6373,7 @@ class jo {
|
|
|
6370
6373
|
*/
|
|
6371
6374
|
parsePointTextList_() {
|
|
6372
6375
|
const e = [this.parsePointText_()];
|
|
6373
|
-
for (; this.match(
|
|
6376
|
+
for (; this.match(y.COMMA); )
|
|
6374
6377
|
e.push(this.parsePointText_());
|
|
6375
6378
|
return e;
|
|
6376
6379
|
}
|
|
@@ -6380,7 +6383,7 @@ class jo {
|
|
|
6380
6383
|
*/
|
|
6381
6384
|
parseLineStringTextList_() {
|
|
6382
6385
|
const e = [this.parseLineStringText_()];
|
|
6383
|
-
for (; this.match(
|
|
6386
|
+
for (; this.match(y.COMMA); )
|
|
6384
6387
|
e.push(this.parseLineStringText_());
|
|
6385
6388
|
return e;
|
|
6386
6389
|
}
|
|
@@ -6390,7 +6393,7 @@ class jo {
|
|
|
6390
6393
|
*/
|
|
6391
6394
|
parsePolygonTextList_() {
|
|
6392
6395
|
const e = [this.parsePolygonText_()];
|
|
6393
|
-
for (; this.match(
|
|
6396
|
+
for (; this.match(y.COMMA); )
|
|
6394
6397
|
e.push(this.parsePolygonText_());
|
|
6395
6398
|
return e;
|
|
6396
6399
|
}
|
|
@@ -6399,7 +6402,7 @@ class jo {
|
|
|
6399
6402
|
* @private
|
|
6400
6403
|
*/
|
|
6401
6404
|
isEmptyGeometry_() {
|
|
6402
|
-
const e = this.isTokenType(
|
|
6405
|
+
const e = this.isTokenType(y.TEXT) && this.token_.value == si;
|
|
6403
6406
|
return e && this.consume_(), e;
|
|
6404
6407
|
}
|
|
6405
6408
|
/**
|
|
@@ -6416,7 +6419,7 @@ class jo {
|
|
|
6416
6419
|
*/
|
|
6417
6420
|
parseGeometry_() {
|
|
6418
6421
|
const e = this.token_;
|
|
6419
|
-
if (this.match(
|
|
6422
|
+
if (this.match(y.TEXT)) {
|
|
6420
6423
|
const t = (
|
|
6421
6424
|
/** @type {string} */
|
|
6422
6425
|
e.value
|
|
@@ -6580,7 +6583,7 @@ function Yo(i) {
|
|
|
6580
6583
|
e.push(hi(t[r]));
|
|
6581
6584
|
return e.join(",");
|
|
6582
6585
|
}
|
|
6583
|
-
function
|
|
6586
|
+
function Ht(i) {
|
|
6584
6587
|
const e = i.getCoordinates(), t = [];
|
|
6585
6588
|
for (let r = 0, n = e.length; r < n; ++r)
|
|
6586
6589
|
t.push(e[r].join(" "));
|
|
@@ -6589,13 +6592,13 @@ function Tt(i) {
|
|
|
6589
6592
|
function Xo(i) {
|
|
6590
6593
|
const e = [], t = i.getLineStrings();
|
|
6591
6594
|
for (let r = 0, n = t.length; r < n; ++r)
|
|
6592
|
-
e.push("(" +
|
|
6595
|
+
e.push("(" + Ht(t[r]) + ")");
|
|
6593
6596
|
return e.join(",");
|
|
6594
6597
|
}
|
|
6595
6598
|
function ui(i) {
|
|
6596
6599
|
const e = [], t = i.getLinearRings();
|
|
6597
6600
|
for (let r = 0, n = t.length; r < n; ++r)
|
|
6598
|
-
e.push("(" +
|
|
6601
|
+
e.push("(" + Ht(t[r]) + ")");
|
|
6599
6602
|
return e.join(",");
|
|
6600
6603
|
}
|
|
6601
6604
|
function Bo(i) {
|
|
@@ -6611,7 +6614,7 @@ function qo(i) {
|
|
|
6611
6614
|
}
|
|
6612
6615
|
const Jo = {
|
|
6613
6616
|
Point: di,
|
|
6614
|
-
LineString:
|
|
6617
|
+
LineString: Ht,
|
|
6615
6618
|
Polygon: ui,
|
|
6616
6619
|
MultiPoint: Uo,
|
|
6617
6620
|
MultiLineString: Xo,
|
|
@@ -6637,7 +6640,7 @@ const Wo = (i, e) => new Vo().writeFeatures(i, e);
|
|
|
6637
6640
|
* Copyright 2021 Google LLC
|
|
6638
6641
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6639
6642
|
*/
|
|
6640
|
-
function
|
|
6643
|
+
function ot(i, e, t) {
|
|
6641
6644
|
return i ? e(i) : t == null ? void 0 : t(i);
|
|
6642
6645
|
}
|
|
6643
6646
|
var we, ze;
|
|
@@ -6659,7 +6662,7 @@ class mi extends j {
|
|
|
6659
6662
|
*/
|
|
6660
6663
|
updateButtonStates() {
|
|
6661
6664
|
const { drawDisabled: t, discardDisabled: r } = Zi(this);
|
|
6662
|
-
|
|
6665
|
+
P(this, we, t), P(this, ze, r);
|
|
6663
6666
|
}
|
|
6664
6667
|
/**
|
|
6665
6668
|
* Overrides createRenderRoot to handle shadow DOM
|
|
@@ -6727,12 +6730,20 @@ class mi extends j {
|
|
|
6727
6730
|
</svg>`, a = k`<svg
|
|
6728
6731
|
xmlns="http://www.w3.org/2000/svg"
|
|
6729
6732
|
viewBox="0 0 24 24"
|
|
6733
|
+
>
|
|
6734
|
+
<title>pencil-outline</title>
|
|
6735
|
+
<path
|
|
6736
|
+
d="M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"
|
|
6737
|
+
/>
|
|
6738
|
+
</svg>`, s = k`<svg
|
|
6739
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6740
|
+
viewBox="0 0 24 24"
|
|
6730
6741
|
>
|
|
6731
6742
|
<title>import</title>
|
|
6732
6743
|
<path
|
|
6733
6744
|
d="M14,12L10,8V11H2V13H10V16M20,18V6C20,4.89 19.1,4 18,4H6A2,2 0 0,0 4,6V9H6V6H18V18H6V15H4V18A2,2 0 0,0 6,20H18A2,2 0 0,0 20,18Z"
|
|
6734
6745
|
/>
|
|
6735
|
-
</svg>`,
|
|
6746
|
+
</svg>`, l = k`<svg
|
|
6736
6747
|
xmlns="http://www.w3.org/2000/svg"
|
|
6737
6748
|
viewBox="0 0 24 24"
|
|
6738
6749
|
>
|
|
@@ -6750,7 +6761,7 @@ class mi extends j {
|
|
|
6750
6761
|
data-cy="drawBtn"
|
|
6751
6762
|
class="transparent square primary-text no-margin small"
|
|
6752
6763
|
title="${this.unstyled ? this.select ? "Select" : "Draw" : ""}"
|
|
6753
|
-
?disabled="${
|
|
6764
|
+
?disabled="${S(this, we) || x}"
|
|
6754
6765
|
@click="${() => this.drawFunc.start()}"
|
|
6755
6766
|
>
|
|
6756
6767
|
${this.unstyled ? t : k`
|
|
@@ -6768,7 +6779,7 @@ class mi extends j {
|
|
|
6768
6779
|
data-cy="discardBtn"
|
|
6769
6780
|
class="transparent square error-text no-margin small"
|
|
6770
6781
|
title="${this.unstyled ? "Discard" : ""}"
|
|
6771
|
-
?disabled="${
|
|
6782
|
+
?disabled="${S(this, ze) || x}"
|
|
6772
6783
|
@click="${() => this.drawFunc.discard()}"
|
|
6773
6784
|
>
|
|
6774
6785
|
${this.unstyled ? "discard" : k`
|
|
@@ -6778,8 +6789,26 @@ class mi extends j {
|
|
|
6778
6789
|
</button>
|
|
6779
6790
|
</div>
|
|
6780
6791
|
|
|
6792
|
+
<!-- Editor Button -->
|
|
6793
|
+
${ot(
|
|
6794
|
+
this.showEditor,
|
|
6795
|
+
() => k`
|
|
6796
|
+
<button
|
|
6797
|
+
data-cy="editorBtn"
|
|
6798
|
+
class="transparent circle primary-text no-margin small"
|
|
6799
|
+
title="${this.unstyled ? "Edit features" : ""}"
|
|
6800
|
+
@click=${() => this.renderRoot.querySelector("#editor").classList.toggle("hidden")}
|
|
6801
|
+
>
|
|
6802
|
+
${this.unstyled ? "import" : k`
|
|
6803
|
+
<i class="small">${a}</i>
|
|
6804
|
+
<div class="tooltip bottom">Edit features</div>
|
|
6805
|
+
`}
|
|
6806
|
+
</button>
|
|
6807
|
+
`
|
|
6808
|
+
)}
|
|
6809
|
+
|
|
6781
6810
|
<!-- Import Button -->
|
|
6782
|
-
${
|
|
6811
|
+
${ot(
|
|
6783
6812
|
this.importFeatures,
|
|
6784
6813
|
() => k`
|
|
6785
6814
|
<!-- Import Input Field : Hidden -->
|
|
@@ -6801,8 +6830,8 @@ class mi extends j {
|
|
|
6801
6830
|
)}
|
|
6802
6831
|
>
|
|
6803
6832
|
${this.unstyled ? "import" : k`
|
|
6804
|
-
<i class="small">${
|
|
6805
|
-
<div class="tooltip
|
|
6833
|
+
<i class="small">${s}</i>
|
|
6834
|
+
<div class="tooltip bottom">Import features</div>
|
|
6806
6835
|
`}
|
|
6807
6836
|
</button>
|
|
6808
6837
|
`
|
|
@@ -6810,13 +6839,13 @@ class mi extends j {
|
|
|
6810
6839
|
</nav>
|
|
6811
6840
|
|
|
6812
6841
|
<!-- Geo JSON Wrapper -->
|
|
6813
|
-
${
|
|
6842
|
+
${ot(
|
|
6814
6843
|
this.showEditor,
|
|
6815
6844
|
() => k`
|
|
6816
|
-
<div class="field textarea border extra">
|
|
6845
|
+
<div id="editor" class="field textarea border extra hidden">
|
|
6817
6846
|
<!-- Geo JSON Editor -->
|
|
6818
6847
|
<textarea
|
|
6819
|
-
style="font-family: monospace"
|
|
6848
|
+
style="font-family: monospace; font-size: small; line-height: 1.4; padding: 0.4rem;"
|
|
6820
6849
|
@drop=${this.drawFunc.import}
|
|
6821
6850
|
@input=${this.drawFunc.editor}
|
|
6822
6851
|
.value=${this.geoJSON}
|
|
@@ -6829,7 +6858,7 @@ class mi extends j {
|
|
|
6829
6858
|
@click=${() => Ki(this.geoJSON)}
|
|
6830
6859
|
>
|
|
6831
6860
|
${this.unstyled ? "copy" : k`
|
|
6832
|
-
<i class="tiny">${
|
|
6861
|
+
<i class="tiny">${l}</i>
|
|
6833
6862
|
<div class="tooltip top">Copy</div>
|
|
6834
6863
|
`}
|
|
6835
6864
|
</button>
|
|
@@ -6840,7 +6869,7 @@ class mi extends j {
|
|
|
6840
6869
|
}
|
|
6841
6870
|
}
|
|
6842
6871
|
we = new WeakMap(), ze = new WeakMap(), // Define properties with default values and types
|
|
6843
|
-
|
|
6872
|
+
I(mi, "properties", {
|
|
6844
6873
|
multipleFeatures: { attribute: !1, type: Boolean },
|
|
6845
6874
|
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
6846
6875
|
currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
|
|
@@ -6904,33 +6933,39 @@ const Do = `
|
|
|
6904
6933
|
padding-left: var(--padding);
|
|
6905
6934
|
padding-right: var(--padding);
|
|
6906
6935
|
}
|
|
6936
|
+
.hidden {
|
|
6937
|
+
display: none;
|
|
6938
|
+
}
|
|
6907
6939
|
`, Qo = (i) => {
|
|
6908
6940
|
(() => {
|
|
6941
|
+
var t;
|
|
6909
6942
|
if (i.emitDrawnFeatures(), !i.multipleFeatures)
|
|
6910
|
-
i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent(), i.currentlyDrawing = !1;
|
|
6943
|
+
(t = i.draw) == null || t.setActive(!1), i.selectionEvents.removeSelectionEvent(), i.currentlyDrawing = !1;
|
|
6911
6944
|
else if (i.continuous)
|
|
6912
6945
|
if (!i.layerId)
|
|
6913
6946
|
i.drawLayer.getSource().clear(), i.drawnFeatures = [];
|
|
6914
6947
|
else {
|
|
6915
|
-
const
|
|
6916
|
-
if (i.drawLayer.getSource().clear(), !
|
|
6948
|
+
const n = i.drawLayer.getSource().getFeatures().at(-1);
|
|
6949
|
+
if (i.drawLayer.getSource().clear(), !n)
|
|
6917
6950
|
return;
|
|
6918
|
-
i.drawLayer.getSource().addFeature(
|
|
6951
|
+
i.drawLayer.getSource().addFeature(n), i.drawnFeatures = [n];
|
|
6919
6952
|
}
|
|
6920
6953
|
})(), i.requestUpdate();
|
|
6921
6954
|
}, ea = (i) => {
|
|
6922
6955
|
const e = () => {
|
|
6923
|
-
|
|
6956
|
+
var r;
|
|
6957
|
+
i.drawLayer.set("isDrawingEnabled", !0), (r = i.draw) == null || r.setActive(!0), i.selectionEvents.addSelectionEvent();
|
|
6924
6958
|
}, t = () => {
|
|
6925
6959
|
i.currentlyDrawing = !0, i.requestUpdate();
|
|
6926
6960
|
};
|
|
6927
6961
|
e(), t(), document.addEventListener("keydown", ({ key: r }) => {
|
|
6928
|
-
|
|
6962
|
+
var n;
|
|
6963
|
+
r === "Escape" && i.currentlyDrawing && ((n = i.draw) == null || n.setActive(!1), i.currentlyDrawing = !1, i.requestUpdate());
|
|
6929
6964
|
});
|
|
6930
|
-
},
|
|
6931
|
-
var
|
|
6965
|
+
}, at = (i, e) => {
|
|
6966
|
+
var c, d, u, h, m;
|
|
6932
6967
|
const r = Ko(i.for), n = r.map, o = "0, 65, 112";
|
|
6933
|
-
|
|
6968
|
+
i.drawLayer = r.addOrUpdateLayer({
|
|
6934
6969
|
zIndex: 100,
|
|
6935
6970
|
type: "Vector",
|
|
6936
6971
|
properties: {
|
|
@@ -6942,7 +6977,7 @@ const Do = `
|
|
|
6942
6977
|
source: {
|
|
6943
6978
|
type: "Vector"
|
|
6944
6979
|
},
|
|
6945
|
-
style: ((
|
|
6980
|
+
style: ((c = i.featureStyles) == null ? void 0 : c.layer) || {
|
|
6946
6981
|
"fill-color": `rgba(${o}, 0.1)`,
|
|
6947
6982
|
"stroke-color": `rgba(${o}, 1)`,
|
|
6948
6983
|
"stroke-width": 2,
|
|
@@ -6958,7 +6993,7 @@ const Do = `
|
|
|
6958
6993
|
type: i.type,
|
|
6959
6994
|
modify: i.allowModify,
|
|
6960
6995
|
stopClick: !0,
|
|
6961
|
-
style: ((
|
|
6996
|
+
style: ((d = i.featureStyles) == null ? void 0 : d.layer) || {
|
|
6962
6997
|
"fill-color": `rgba(${o}, 0.1)`,
|
|
6963
6998
|
"stroke-color": `rgba(${o}, 1)`,
|
|
6964
6999
|
"stroke-width": 1,
|
|
@@ -6973,7 +7008,7 @@ const Do = `
|
|
|
6973
7008
|
options: {
|
|
6974
7009
|
id: "SelectLayerHoverInteraction",
|
|
6975
7010
|
condition: "pointermove",
|
|
6976
|
-
style: ((
|
|
7011
|
+
style: ((u = i.featureStyles) == null ? void 0 : u.hover) || {
|
|
6977
7012
|
"fill-color": `rgba(${o}, 0.2)`,
|
|
6978
7013
|
"stroke-color": `rgba(${o}, 1)`,
|
|
6979
7014
|
"stroke-width": 2
|
|
@@ -6987,7 +7022,7 @@ const Do = `
|
|
|
6987
7022
|
id: "SelectLayerClickInteraction",
|
|
6988
7023
|
condition: "click",
|
|
6989
7024
|
panIn: !0,
|
|
6990
|
-
style: ((
|
|
7025
|
+
style: ((h = i.featureStyles) == null ? void 0 : h.click) || {
|
|
6991
7026
|
"fill-color": `rgba(${o}, 0.2)`,
|
|
6992
7027
|
"stroke-color": `rgba(${o}, 1)`,
|
|
6993
7028
|
"stroke-width": 2
|
|
@@ -6999,10 +7034,16 @@ const Do = `
|
|
|
6999
7034
|
/** @type {unknown} */
|
|
7000
7035
|
r.interactions.drawInteraction, i.modify = /** @type {import("ol/interaction").Modify} */
|
|
7001
7036
|
/** @type {unknown} */
|
|
7002
|
-
r.interactions.drawInteractionmodify,
|
|
7037
|
+
r.interactions.drawInteractionmodify, gt(i, r, i.layerId);
|
|
7038
|
+
const a = () => i.onModifyEnd(), s = () => Qo(i);
|
|
7039
|
+
return (m = i.modify) == null || m.on("modifyend", a), r.addEventListener("addfeatures", s), i.drawnFeatures && i.drawLayer.getSource().addFeatures(i.drawnFeatures), { EoxMap: r, OlMap: n, reset: (p) => {
|
|
7040
|
+
var g;
|
|
7041
|
+
!p.eoxMap || !p.drawLayer || (p.drawLayer.getSource().clear(), p.eoxMap.map.removeLayer(p.drawLayer), (g = p.modify) == null || g.un("modifyend", a), p.eoxMap.removeEventListener("addfeatures", s), p.layerId || (p.draw = null), p.modify = null);
|
|
7042
|
+
} };
|
|
7003
7043
|
}, ta = (i) => {
|
|
7004
7044
|
const e = () => {
|
|
7005
|
-
|
|
7045
|
+
var r;
|
|
7046
|
+
i.drawnFeatures = [], (r = i.draw) == null || r.setActive(!1), i.selectionEvents.removeSelectionEvent(), i.drawLayer.getSource().clear(), i.geoJSON = null;
|
|
7006
7047
|
}, t = () => {
|
|
7007
7048
|
i.emitDrawnFeatures(), i.currentlyDrawing = !1, i.requestUpdate();
|
|
7008
7049
|
};
|
|
@@ -7018,7 +7059,7 @@ const Do = `
|
|
|
7018
7059
|
let a;
|
|
7019
7060
|
switch (i.format) {
|
|
7020
7061
|
case "geojson":
|
|
7021
|
-
a =
|
|
7062
|
+
a = Io(i.drawnFeatures);
|
|
7022
7063
|
break;
|
|
7023
7064
|
case "wkt":
|
|
7024
7065
|
a = Wo(i.drawnFeatures);
|
|
@@ -7039,14 +7080,17 @@ const Do = `
|
|
|
7039
7080
|
));
|
|
7040
7081
|
};
|
|
7041
7082
|
return { addSelectionEvent: () => {
|
|
7042
|
-
|
|
7083
|
+
if (i.layerId) {
|
|
7084
|
+
const n = i.eoxMap.selectInteractions.SelectLayerHoverInteraction;
|
|
7085
|
+
n == null || n.setActive(!0), i.eoxMap.addEventListener("select", e);
|
|
7086
|
+
}
|
|
7043
7087
|
}, removeSelectionEvent: () => {
|
|
7044
7088
|
var o;
|
|
7045
7089
|
const n = (o = i.eoxMap.selectInteractions) == null ? void 0 : o.SelectLayerHoverInteraction;
|
|
7046
|
-
n && (n.selectedFids = [], n.setActive(!1)), i.eoxMap.removeEventListener("select", e);
|
|
7090
|
+
n && (n.selectedFids = [], n == null || n.setActive(!1)), i.eoxMap.removeEventListener("select", e);
|
|
7047
7091
|
} };
|
|
7048
|
-
},
|
|
7049
|
-
var l, c;
|
|
7092
|
+
}, gt = (i, e, t) => {
|
|
7093
|
+
var l, c, d, u;
|
|
7050
7094
|
if (!t || !e)
|
|
7051
7095
|
return;
|
|
7052
7096
|
const r = e.getLayerById(t), n = r ? (
|
|
@@ -7086,7 +7130,7 @@ const Do = `
|
|
|
7086
7130
|
};
|
|
7087
7131
|
n.interactions = [o, a], e.addOrUpdateLayer(n), gi(e.layers, t, [n]);
|
|
7088
7132
|
const s = i.draw;
|
|
7089
|
-
i.draw = e.selectInteractions.SelectLayerClickInteraction, s.setActive(!1), e.selectInteractions.SelectLayerClickInteraction.setActive(!1), e.selectInteractions.SelectLayerHoverInteraction.setActive(!1);
|
|
7133
|
+
i.draw = e.selectInteractions.SelectLayerClickInteraction, s == null || s.setActive(!1), (d = e.selectInteractions.SelectLayerClickInteraction) == null || d.setActive(!1), (u = e.selectInteractions.SelectLayerHoverInteraction) == null || u.setActive(!1);
|
|
7090
7134
|
};
|
|
7091
7135
|
function gi(i, e, t) {
|
|
7092
7136
|
const r = i.findIndex(
|
|
@@ -7104,16 +7148,16 @@ function gi(i, e, t) {
|
|
|
7104
7148
|
const na = (i, e, t, r) => {
|
|
7105
7149
|
if (e) {
|
|
7106
7150
|
if (t) {
|
|
7107
|
-
r && t !== r &&
|
|
7151
|
+
r && t !== r && kr(i, e), gt(i, e, t);
|
|
7108
7152
|
return;
|
|
7109
7153
|
}
|
|
7110
7154
|
if (!t && r) {
|
|
7111
|
-
|
|
7155
|
+
kr(i, e);
|
|
7112
7156
|
return;
|
|
7113
7157
|
}
|
|
7114
7158
|
}
|
|
7115
7159
|
};
|
|
7116
|
-
function
|
|
7160
|
+
function kr(i, e) {
|
|
7117
7161
|
e && (i.discardDrawing(), i.selectionEvents.removeSelectionEvent(), i.draw = /** @type {import("ol/interaction").Draw} */
|
|
7118
7162
|
e.interactions.drawInteraction, e.selectInteractions.SelectLayerClickInteraction.remove(), e.selectInteractions.SelectLayerHoverInteraction.remove());
|
|
7119
7163
|
}
|
|
@@ -7136,11 +7180,9 @@ function aa(i) {
|
|
|
7136
7180
|
}
|
|
7137
7181
|
function fi(i, e) {
|
|
7138
7182
|
aa(i);
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
);
|
|
7143
|
-
Array.from(t).forEach((r) => sa(r, e));
|
|
7183
|
+
let t;
|
|
7184
|
+
"dataTransfer" in i && i.dataTransfer ? t = i.dataTransfer.files : i.target && "files" in i.target ? t = /**@type {HTMLInputElement}*/
|
|
7185
|
+
i.target.files : t = [], Array.from(t).forEach((r) => sa(r, e)), i.target && "value" in i.target && (i.target.value = "");
|
|
7144
7186
|
}
|
|
7145
7187
|
function sa(i, e) {
|
|
7146
7188
|
const t = new FileReader();
|
|
@@ -7148,7 +7190,7 @@ function sa(i, e) {
|
|
|
7148
7190
|
typeof t.result == "string" && e.handleFeatureChange(t.result);
|
|
7149
7191
|
};
|
|
7150
7192
|
}
|
|
7151
|
-
var ie, ne, Ce, oe,
|
|
7193
|
+
var ie, ne, Ce, oe, Me;
|
|
7152
7194
|
class la extends j {
|
|
7153
7195
|
constructor() {
|
|
7154
7196
|
super();
|
|
@@ -7171,7 +7213,7 @@ class la extends j {
|
|
|
7171
7213
|
/**
|
|
7172
7214
|
* @type boolean
|
|
7173
7215
|
*/
|
|
7174
|
-
A(this,
|
|
7216
|
+
A(this, Me);
|
|
7175
7217
|
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;
|
|
7176
7218
|
}
|
|
7177
7219
|
// Define properties with defaults and types
|
|
@@ -7206,20 +7248,20 @@ class la extends j {
|
|
|
7206
7248
|
* @type {boolean}
|
|
7207
7249
|
*/
|
|
7208
7250
|
set continuous(t) {
|
|
7209
|
-
|
|
7251
|
+
P(this, Me, t), t && (this.multipleFeatures = !0);
|
|
7210
7252
|
}
|
|
7211
7253
|
get continuous() {
|
|
7212
|
-
return
|
|
7254
|
+
return S(this, Me);
|
|
7213
7255
|
}
|
|
7214
7256
|
/**
|
|
7215
7257
|
* Enables selection mode for the passed layer
|
|
7216
7258
|
* @type {string}
|
|
7217
7259
|
*/
|
|
7218
7260
|
set layerId(t) {
|
|
7219
|
-
na(this, this.eoxMap, t,
|
|
7261
|
+
na(this, this.eoxMap, t, S(this, oe)), P(this, oe, t);
|
|
7220
7262
|
}
|
|
7221
7263
|
get layerId() {
|
|
7222
|
-
return
|
|
7264
|
+
return S(this, oe);
|
|
7223
7265
|
}
|
|
7224
7266
|
/**
|
|
7225
7267
|
* @onClick Event handler triggered to start drawing on the map.
|
|
@@ -7241,19 +7283,15 @@ class la extends j {
|
|
|
7241
7283
|
*/
|
|
7242
7284
|
handleFeatureChange(t, r = !1, n = !0) {
|
|
7243
7285
|
this.eoxMap.parseTextToFeature(
|
|
7244
|
-
t || JSON.stringify(
|
|
7286
|
+
t || JSON.stringify(rr),
|
|
7245
7287
|
this.drawLayer,
|
|
7246
7288
|
this.eoxMap,
|
|
7247
7289
|
r,
|
|
7248
|
-
{
|
|
7249
|
-
dataProjection: this.eoxMap.projection,
|
|
7250
|
-
featureProjection: this.projection
|
|
7251
|
-
},
|
|
7252
7290
|
n
|
|
7253
7291
|
);
|
|
7254
7292
|
}
|
|
7255
7293
|
/**
|
|
7256
|
-
* @param {DragEvent} evt - The event object from the file input interaction.
|
|
7294
|
+
* @param {DragEvent | InputEvent & { target: HTMLInputElement }} evt - The event object from the file input interaction.
|
|
7257
7295
|
*/
|
|
7258
7296
|
handleFilesChange(t) {
|
|
7259
7297
|
fi(t, this);
|
|
@@ -7268,8 +7306,8 @@ class la extends j {
|
|
|
7268
7306
|
* Update #geoJSON with stringify feature.
|
|
7269
7307
|
*/
|
|
7270
7308
|
updateGeoJSON() {
|
|
7271
|
-
|
|
7272
|
-
this.eoxMap.parseFeature(this.drawnFeatures) ||
|
|
7309
|
+
P(this, Ce, JSON.stringify(
|
|
7310
|
+
this.eoxMap.parseFeature(this.drawnFeatures) || rr,
|
|
7273
7311
|
void 0,
|
|
7274
7312
|
2
|
|
7275
7313
|
));
|
|
@@ -7294,25 +7332,34 @@ class la extends j {
|
|
|
7294
7332
|
* It then calls requestUpdate to trigger a re-render.
|
|
7295
7333
|
*/
|
|
7296
7334
|
firstUpdated() {
|
|
7297
|
-
const { EoxMap: t, OlMap: r } =
|
|
7298
|
-
|
|
7335
|
+
const { EoxMap: t, OlMap: r, reset: n } = at(
|
|
7336
|
+
this,
|
|
7337
|
+
this.multipleFeatures
|
|
7338
|
+
);
|
|
7339
|
+
this.resetLayer = n, this.eoxMap = t, P(this, ne, r), this.selectionEvents = ia(this), this.importFeatures && oa(this, this.eoxMap), this.updateGeoJSON(), this.requestUpdate();
|
|
7299
7340
|
}
|
|
7300
7341
|
updated(t) {
|
|
7301
7342
|
if (t.has("for")) {
|
|
7302
|
-
const { EoxMap: r, OlMap: n } =
|
|
7303
|
-
this.eoxMap = r,
|
|
7343
|
+
const { EoxMap: r, OlMap: n } = at(this, this.multipleFeatures);
|
|
7344
|
+
this.eoxMap = r, P(this, ne, n);
|
|
7304
7345
|
}
|
|
7305
7346
|
}
|
|
7306
7347
|
get eoxMap() {
|
|
7307
|
-
return
|
|
7348
|
+
return S(this, ie);
|
|
7308
7349
|
}
|
|
7309
7350
|
set eoxMap(t) {
|
|
7310
|
-
const r =
|
|
7311
|
-
|
|
7351
|
+
const r = S(this, ie);
|
|
7352
|
+
P(this, ie, t), this.requestUpdate("eoxMap", r);
|
|
7353
|
+
}
|
|
7354
|
+
connectedCallback() {
|
|
7355
|
+
if (super.connectedCallback(), this.drawLayer && this.eoxMap) {
|
|
7356
|
+
const { reset: t } = at(this, this.multipleFeatures);
|
|
7357
|
+
this.resetLayer = t;
|
|
7358
|
+
}
|
|
7312
7359
|
}
|
|
7313
7360
|
disconnectedCallback() {
|
|
7314
7361
|
var t;
|
|
7315
|
-
(t = this.
|
|
7362
|
+
super.disconnectedCallback(), (t = this.resetLayer) == null || t.call(this, this);
|
|
7316
7363
|
}
|
|
7317
7364
|
// Render method for UI display
|
|
7318
7365
|
render() {
|
|
@@ -7344,7 +7391,7 @@ class la extends j {
|
|
|
7344
7391
|
.multipleFeatures=${this.multipleFeatures}
|
|
7345
7392
|
.importFeatures=${this.importFeatures}
|
|
7346
7393
|
.showEditor=${this.showEditor}
|
|
7347
|
-
.geoJSON=${
|
|
7394
|
+
.geoJSON=${S(this, Ce)}
|
|
7348
7395
|
.type=${this.type}
|
|
7349
7396
|
></eox-drawtools-controller>
|
|
7350
7397
|
|
|
@@ -7352,7 +7399,7 @@ class la extends j {
|
|
|
7352
7399
|
${this.showList && ((t = this.drawnFeatures) != null && t.length) ? k`<eox-drawtools-list
|
|
7353
7400
|
.eoxDrawTools=${this}
|
|
7354
7401
|
.eoxMap=${this.eoxMap}
|
|
7355
|
-
.olMap=${
|
|
7402
|
+
.olMap=${S(this, ne)}
|
|
7356
7403
|
.draw=${this.draw}
|
|
7357
7404
|
.drawLayer=${this.drawLayer}
|
|
7358
7405
|
.drawnFeatures=${this.drawnFeatures}
|
|
@@ -7367,7 +7414,7 @@ class la extends j {
|
|
|
7367
7414
|
`;
|
|
7368
7415
|
}
|
|
7369
7416
|
}
|
|
7370
|
-
ie = new WeakMap(), ne = new WeakMap(), Ce = new WeakMap(), oe = new WeakMap(),
|
|
7417
|
+
ie = new WeakMap(), ne = new WeakMap(), Ce = new WeakMap(), oe = new WeakMap(), Me = new WeakMap();
|
|
7371
7418
|
customElements.define("eox-drawtools", la);
|
|
7372
7419
|
export {
|
|
7373
7420
|
la as EOxDrawTools
|