@eox/drawtools 0.13.3 → 0.13.5
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 +1265 -1269
- package/dist/eox-drawtools.umd.cjs +32 -32
- package/package.json +8 -6
- package/src/components/controller.js +4 -1
- package/src/components/list.js +3 -3
- package/src/helpers/generate-upload-events.js +5 -3
- package/src/main.js +36 -8
- package/src/methods/draw/handle-layer-id.js +1 -1
- package/src/methods/draw/init-layer.js +6 -7
- package/src/methods/draw/init-selection.js +6 -8
- package/src/methods/draw/on-draw-end.js +14 -0
- package/types/drawtools/src/components/controller.d.ts.map +1 -1
- package/types/drawtools/src/components/list.d.ts +6 -6
- package/types/drawtools/src/components/list.d.ts.map +1 -1
- package/types/drawtools/src/enums/stories.d.ts.map +1 -1
- package/types/drawtools/src/helpers/features-to-geojson.d.ts +2 -1
- package/types/drawtools/src/helpers/features-to-geojson.d.ts.map +1 -1
- package/types/drawtools/src/helpers/generate-upload-events.d.ts +4 -4
- package/types/drawtools/src/helpers/generate-upload-events.d.ts.map +1 -1
- package/types/drawtools/src/main.d.ts +36 -11
- package/types/drawtools/src/main.d.ts.map +1 -1
- package/types/drawtools/src/methods/controller/update-button-states.d.ts.map +1 -1
- package/types/drawtools/src/methods/draw/emit-drawn-features.d.ts.map +1 -1
- package/types/drawtools/src/methods/draw/handle-layer-id.d.ts +2 -2
- package/types/drawtools/src/methods/draw/handle-layer-id.d.ts.map +1 -1
- package/types/drawtools/src/methods/draw/init-layer.d.ts +2 -2
- package/types/drawtools/src/methods/draw/init-layer.d.ts.map +1 -1
- package/types/drawtools/src/methods/draw/init-selection.d.ts +2 -2
- package/types/drawtools/src/methods/draw/init-selection.d.ts.map +1 -1
- package/types/drawtools/src/methods/draw/on-draw-end.d.ts.map +1 -1
- package/types/map/src/components/tooltip.d.ts +1 -1
- package/types/map/src/controls/controls.d.ts +2 -2
- package/types/map/src/controls/controls.d.ts.map +1 -1
- package/types/map/src/controls/geo-location.d.ts +2 -2
- package/types/map/src/controls/geo-location.d.ts.map +1 -1
- package/types/map/src/controls/loading-indicator.d.ts +2 -2
- package/types/map/src/controls/loading-indicator.d.ts.map +1 -1
- package/types/map/src/helpers/add-new-feature.d.ts.map +1 -1
- package/types/map/src/helpers/center.d.ts.map +1 -1
- package/types/map/src/helpers/coordinates-roughly-equals.d.ts.map +1 -1
- package/types/map/src/helpers/draw.d.ts +6 -6
- package/types/map/src/helpers/draw.d.ts.map +1 -1
- package/types/map/src/helpers/generate.d.ts +9 -8
- package/types/map/src/helpers/generate.d.ts.map +1 -1
- package/types/map/src/helpers/layer.d.ts +5 -5
- package/types/map/src/helpers/layer.d.ts.map +1 -1
- package/types/map/src/helpers/parse-feature.d.ts.map +1 -1
- package/types/map/src/helpers/register-projection-from-code.d.ts.map +1 -1
- package/types/map/src/helpers/register-projection.d.ts.map +1 -1
- package/types/map/src/helpers/select.d.ts +11 -11
- package/types/map/src/helpers/select.d.ts.map +1 -1
- package/types/map/src/helpers/tile-grid.d.ts +2 -2
- package/types/map/src/helpers/tile-grid.d.ts.map +1 -1
- package/types/map/src/helpers/transform.d.ts +2 -2
- package/types/map/src/helpers/transform.d.ts.map +1 -1
- package/types/map/src/main.d.ts +26 -26
- package/types/map/src/main.d.ts.map +1 -1
- package/types/map/src/methods/map/add-update-layer.d.ts +2 -2
- package/types/map/src/methods/map/add-update-layer.d.ts.map +1 -1
- package/types/map/src/methods/map/getters.d.ts.map +1 -1
- package/types/map/src/methods/map/setters.d.ts +12 -12
- package/types/map/src/methods/map/setters.d.ts.map +1 -1
- package/types/map/{types.d.ts → src/types.d.ts} +13 -2
- package/types/map/src/types.d.ts.map +1 -0
- package/types/map/types.d.ts.map +0 -1
package/dist/eox-drawtools.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var _n = Object.defineProperty;
|
|
2
|
+
var je = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var R = (n, t, e) =>
|
|
7
|
-
var
|
|
5
|
+
var vn = (n, t, e) => t in n ? _n(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
6
|
+
var R = (n, t, e) => vn(n, typeof t != "symbol" ? t + "" : t, e), Xe = (n, t, e) => t.has(n) || je("Cannot " + e);
|
|
7
|
+
var M = (n, t, e) => (Xe(n, t, "read from private field"), e ? e.call(n) : t.get(n)), F = (n, t, e) => t.has(n) ? je("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), $ = (n, t, e, i) => (Xe(n, t, "write to private field"), i ? i.call(n, e) : t.set(n, e), e);
|
|
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 It = globalThis, fe = It.ShadowRoot && (It.ShadyCSS === void 0 || It.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, bi = Symbol(), Ye = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
let Cn = class {
|
|
15
15
|
constructor(t, e, i) {
|
|
16
|
-
if (this._$cssResult$ = !0, i !==
|
|
16
|
+
if (this._$cssResult$ = !0, i !== bi) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
17
17
|
this.cssText = t, this.t = e;
|
|
18
18
|
}
|
|
19
19
|
get styleSheet() {
|
|
20
20
|
let t = this.o;
|
|
21
21
|
const e = this.t;
|
|
22
|
-
if (
|
|
22
|
+
if (fe && t === void 0) {
|
|
23
23
|
const i = e !== void 0 && e.length === 1;
|
|
24
|
-
i && (t =
|
|
24
|
+
i && (t = Ye.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Ye.set(e, t));
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
27
|
}
|
|
@@ -29,23 +29,23 @@ let vn = class {
|
|
|
29
29
|
return this.cssText;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
32
|
+
const wn = (n) => new Cn(typeof n == "string" ? n : n + "", void 0, bi), bn = (n, t) => {
|
|
33
|
+
if (fe) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
34
34
|
else for (const e of t) {
|
|
35
|
-
const i = document.createElement("style"), r =
|
|
35
|
+
const i = document.createElement("style"), r = It.litNonce;
|
|
36
36
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, n.appendChild(i);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, Be = fe ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let e = "";
|
|
40
40
|
for (const i of t.cssRules) e += i.cssText;
|
|
41
|
-
return
|
|
41
|
+
return wn(e);
|
|
42
42
|
})(n) : n;
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: En, defineProperty:
|
|
48
|
+
const { is: En, defineProperty: xn, getOwnPropertyDescriptor: Pn, getOwnPropertyNames: Mn, getOwnPropertySymbols: Sn, getPrototypeOf: $n } = Object, L = globalThis, Ve = L.trustedTypes, An = Ve ? Ve.emptyScript : "", Dt = L.reactiveElementPolyfillSupport, dt = (n, t) => n, se = { toAttribute(n, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
n = n ? An : null;
|
|
@@ -73,8 +73,8 @@ const { is: En, defineProperty: bn, getOwnPropertyDescriptor: xn, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return e;
|
|
76
|
-
} }, Ei = (n, t) => !En(n, t),
|
|
77
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
76
|
+
} }, Ei = (n, t) => !En(n, t), ze = { attribute: !0, type: String, converter: se, reflect: !1, hasChanged: Ei };
|
|
77
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), L.litPropertyMetadata ?? (L.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
78
|
class tt extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
@@ -82,14 +82,14 @@ class tt extends HTMLElement {
|
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(t, e =
|
|
85
|
+
static createProperty(t, e = ze) {
|
|
86
86
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
87
87
|
const i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
|
88
|
-
r !== void 0 &&
|
|
88
|
+
r !== void 0 && xn(this.prototype, t, r);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
static getPropertyDescriptor(t, e, i) {
|
|
92
|
-
const { get: r, set: s } =
|
|
92
|
+
const { get: r, set: s } = Pn(this.prototype, t) ?? { get() {
|
|
93
93
|
return this[e];
|
|
94
94
|
}, set(o) {
|
|
95
95
|
this[e] = o;
|
|
@@ -102,7 +102,7 @@ class tt extends HTMLElement {
|
|
|
102
102
|
}, configurable: !0, enumerable: !0 };
|
|
103
103
|
}
|
|
104
104
|
static getPropertyOptions(t) {
|
|
105
|
-
return this.elementProperties.get(t) ??
|
|
105
|
+
return this.elementProperties.get(t) ?? ze;
|
|
106
106
|
}
|
|
107
107
|
static _$Ei() {
|
|
108
108
|
if (this.hasOwnProperty(dt("elementProperties"))) return;
|
|
@@ -112,7 +112,7 @@ class tt extends HTMLElement {
|
|
|
112
112
|
static finalize() {
|
|
113
113
|
if (this.hasOwnProperty(dt("finalized"))) return;
|
|
114
114
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(dt("properties"))) {
|
|
115
|
-
const e = this.properties, i = [...
|
|
115
|
+
const e = this.properties, i = [...Mn(e), ...Sn(e)];
|
|
116
116
|
for (const r of i) this.createProperty(r, e[r]);
|
|
117
117
|
}
|
|
118
118
|
const t = this[Symbol.metadata];
|
|
@@ -131,8 +131,8 @@ class tt extends HTMLElement {
|
|
|
131
131
|
const e = [];
|
|
132
132
|
if (Array.isArray(t)) {
|
|
133
133
|
const i = new Set(t.flat(1 / 0).reverse());
|
|
134
|
-
for (const r of i) e.unshift(
|
|
135
|
-
} else t !== void 0 && e.push(
|
|
134
|
+
for (const r of i) e.unshift(Be(r));
|
|
135
|
+
} else t !== void 0 && e.push(Be(t));
|
|
136
136
|
return e;
|
|
137
137
|
}
|
|
138
138
|
static _$Eu(t, e) {
|
|
@@ -161,7 +161,7 @@ class tt extends HTMLElement {
|
|
|
161
161
|
}
|
|
162
162
|
createRenderRoot() {
|
|
163
163
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
164
|
-
return
|
|
164
|
+
return bn(t, this.constructor.elementStyles), t;
|
|
165
165
|
}
|
|
166
166
|
connectedCallback() {
|
|
167
167
|
var t;
|
|
@@ -186,7 +186,7 @@ class tt extends HTMLElement {
|
|
|
186
186
|
var s;
|
|
187
187
|
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
|
|
188
188
|
if (r !== void 0 && i.reflect === !0) {
|
|
189
|
-
const o = (((s = i.converter) == null ? void 0 : s.toAttribute) !== void 0 ? i.converter :
|
|
189
|
+
const o = (((s = i.converter) == null ? void 0 : s.toAttribute) !== void 0 ? i.converter : se).toAttribute(e, i.type);
|
|
190
190
|
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -194,7 +194,7 @@ class tt extends HTMLElement {
|
|
|
194
194
|
var s;
|
|
195
195
|
const i = this.constructor, r = i._$Eh.get(t);
|
|
196
196
|
if (r !== void 0 && this._$Em !== r) {
|
|
197
|
-
const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((s = o.converter) == null ? void 0 : s.fromAttribute) !== void 0 ? o.converter :
|
|
197
|
+
const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((s = o.converter) == null ? void 0 : s.fromAttribute) !== void 0 ? o.converter : se;
|
|
198
198
|
this._$Em = r, this[r] = a.fromAttribute(e, o.type), this._$Em = null;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
@@ -273,59 +273,59 @@ class tt extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
tt.elementStyles = [], tt.shadowRootOptions = { mode: "open" }, tt[dt("elementProperties")] = /* @__PURE__ */ new Map(), tt[dt("finalized")] = /* @__PURE__ */ new Map(),
|
|
276
|
+
tt.elementStyles = [], tt.shadowRootOptions = { mode: "open" }, tt[dt("elementProperties")] = /* @__PURE__ */ new Map(), tt[dt("finalized")] = /* @__PURE__ */ new Map(), Dt == null || Dt({ ReactiveElement: tt }), (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 gt = globalThis,
|
|
283
|
-
\f\r]`, ut = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
285
|
-
function
|
|
286
|
-
if (!
|
|
287
|
-
return
|
|
288
|
-
}
|
|
289
|
-
const
|
|
282
|
+
const gt = globalThis, Tt = gt.trustedTypes, Je = Tt ? Tt.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, xi = "$lit$", G = `lit$${Math.random().toFixed(9).slice(2)}$`, Pi = "?" + G, Fn = `<${Pi}>`, Y = document, ft = () => Y.createComment(""), pt = (n) => n === null || typeof n != "object" && typeof n != "function", pe = Array.isArray, Gn = (n) => pe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Qt = `[
|
|
283
|
+
\f\r]`, ut = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, We = /-->/g, qe = />/g, T = RegExp(`>|${Qt}(?:([^\\s"'>=/]+)(${Qt}*=${Qt}*(?:[^
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ze = /'/g, Ke = /"/g, Mi = /^(?:script|style|textarea|title)$/i, Ln = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), U = Ln(1), ot = Symbol.for("lit-noChange"), C = Symbol.for("lit-nothing"), De = /* @__PURE__ */ new WeakMap(), O = Y.createTreeWalker(Y, 129);
|
|
285
|
+
function Si(n, t) {
|
|
286
|
+
if (!pe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
|
+
return Je !== void 0 ? Je.createHTML(t) : t;
|
|
288
|
+
}
|
|
289
|
+
const In = (n, t) => {
|
|
290
290
|
const e = n.length - 1, i = [];
|
|
291
291
|
let r, s = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = ut;
|
|
292
292
|
for (let a = 0; a < e; a++) {
|
|
293
293
|
const l = n[a];
|
|
294
294
|
let h, c, u = -1, d = 0;
|
|
295
|
-
for (; d < l.length && (o.lastIndex = d, c = o.exec(l), c !== null); ) d = o.lastIndex, o === ut ? c[1] === "!--" ? o =
|
|
296
|
-
const g = o ===
|
|
297
|
-
s += o === ut ? l +
|
|
295
|
+
for (; d < l.length && (o.lastIndex = d, c = o.exec(l), c !== null); ) d = o.lastIndex, o === ut ? c[1] === "!--" ? o = We : c[1] !== void 0 ? o = qe : c[2] !== void 0 ? (Mi.test(c[2]) && (r = RegExp("</" + c[2], "g")), o = T) : c[3] !== void 0 && (o = T) : o === T ? c[0] === ">" ? (o = r ?? ut, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, h = c[1], o = c[3] === void 0 ? T : c[3] === '"' ? Ke : Ze) : o === Ke || o === Ze ? o = T : o === We || o === qe ? o = ut : (o = T, r = void 0);
|
|
296
|
+
const g = o === T && n[a + 1].startsWith("/>") ? " " : "";
|
|
297
|
+
s += o === ut ? l + Fn : u >= 0 ? (i.push(h), l.slice(0, u) + xi + l.slice(u) + G + g) : l + G + (u === -2 ? a : g);
|
|
298
298
|
}
|
|
299
|
-
return [
|
|
299
|
+
return [Si(n, s + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
300
300
|
};
|
|
301
301
|
class yt {
|
|
302
302
|
constructor({ strings: t, _$litType$: e }, i) {
|
|
303
303
|
let r;
|
|
304
304
|
this.parts = [];
|
|
305
305
|
let s = 0, o = 0;
|
|
306
|
-
const a = t.length - 1, l = this.parts, [h, c] =
|
|
306
|
+
const a = t.length - 1, l = this.parts, [h, c] = In(t, e);
|
|
307
307
|
if (this.el = yt.createElement(h, i), O.currentNode = this.el.content, e === 2 || e === 3) {
|
|
308
308
|
const u = this.el.content.firstChild;
|
|
309
309
|
u.replaceWith(...u.childNodes);
|
|
310
310
|
}
|
|
311
311
|
for (; (r = O.nextNode()) !== null && l.length < a; ) {
|
|
312
312
|
if (r.nodeType === 1) {
|
|
313
|
-
if (r.hasAttributes()) for (const u of r.getAttributeNames()) if (u.endsWith(
|
|
314
|
-
const d = c[o++], g = r.getAttribute(u).split(
|
|
315
|
-
l.push({ type: 1, index: s, name: f[2], strings: g, ctor: f[1] === "." ?
|
|
316
|
-
} else u.startsWith(
|
|
317
|
-
if (
|
|
318
|
-
const u = r.textContent.split(
|
|
313
|
+
if (r.hasAttributes()) for (const u of r.getAttributeNames()) if (u.endsWith(xi)) {
|
|
314
|
+
const d = c[o++], g = r.getAttribute(u).split(G), f = /([.?@])?(.*)/.exec(d);
|
|
315
|
+
l.push({ type: 1, index: s, name: f[2], strings: g, ctor: f[1] === "." ? Tn : f[1] === "?" ? Nn : f[1] === "@" ? On : Xt }), r.removeAttribute(u);
|
|
316
|
+
} else u.startsWith(G) && (l.push({ type: 6, index: s }), r.removeAttribute(u));
|
|
317
|
+
if (Mi.test(r.tagName)) {
|
|
318
|
+
const u = r.textContent.split(G), d = u.length - 1;
|
|
319
319
|
if (d > 0) {
|
|
320
|
-
r.textContent =
|
|
320
|
+
r.textContent = Tt ? Tt.emptyScript : "";
|
|
321
321
|
for (let g = 0; g < d; g++) r.append(u[g], ft()), O.nextNode(), l.push({ type: 2, index: ++s });
|
|
322
322
|
r.append(u[d], ft());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
325
|
+
} else if (r.nodeType === 8) if (r.data === Pi) l.push({ type: 2, index: s });
|
|
326
326
|
else {
|
|
327
327
|
let u = -1;
|
|
328
|
-
for (; (u = r.data.indexOf(
|
|
328
|
+
for (; (u = r.data.indexOf(G, u + 1)) !== -1; ) l.push({ type: 7, index: s }), u += G.length - 1;
|
|
329
329
|
}
|
|
330
330
|
s++;
|
|
331
331
|
}
|
|
@@ -359,7 +359,7 @@ let Rn = class {
|
|
|
359
359
|
for (; l !== void 0; ) {
|
|
360
360
|
if (o === l.index) {
|
|
361
361
|
let h;
|
|
362
|
-
l.type === 2 ? h = new
|
|
362
|
+
l.type === 2 ? h = new ye(s, s.nextSibling, this, t) : l.type === 1 ? h = new l.ctor(s, l.name, l.strings, this, t) : l.type === 6 && (h = new kn(s, this, t)), this._$AV.push(h), l = i[++a];
|
|
363
363
|
}
|
|
364
364
|
o !== (l == null ? void 0 : l.index) && (s = O.nextNode(), o++);
|
|
365
365
|
}
|
|
@@ -369,7 +369,7 @@ let Rn = class {
|
|
|
369
369
|
let e = 0;
|
|
370
370
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
371
371
|
}
|
|
372
|
-
},
|
|
372
|
+
}, ye = class $i {
|
|
373
373
|
get _$AU() {
|
|
374
374
|
var t;
|
|
375
375
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
@@ -389,7 +389,7 @@ let Rn = class {
|
|
|
389
389
|
return this._$AB;
|
|
390
390
|
}
|
|
391
391
|
_$AI(t, e = this) {
|
|
392
|
-
t = at(this, t, e), pt(t) ? t === C || t == null || t === "" ? (this._$AH !== C && this._$AR(), this._$AH = C) : t !== this._$AH && t !== ot && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
392
|
+
t = at(this, t, e), pt(t) ? t === C || t == null || t === "" ? (this._$AH !== C && this._$AR(), this._$AH = C) : t !== this._$AH && t !== ot && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Gn(t) ? this.k(t) : this._(t);
|
|
393
393
|
}
|
|
394
394
|
O(t) {
|
|
395
395
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -402,7 +402,7 @@ let Rn = class {
|
|
|
402
402
|
}
|
|
403
403
|
$(t) {
|
|
404
404
|
var s;
|
|
405
|
-
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = yt.createElement(
|
|
405
|
+
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = yt.createElement(Si(i.h, i.h[0]), this.options)), i);
|
|
406
406
|
if (((s = this._$AH) == null ? void 0 : s._$AD) === r) this._$AH.p(e);
|
|
407
407
|
else {
|
|
408
408
|
const o = new Rn(r, this), a = o.u(this.options);
|
|
@@ -410,11 +410,11 @@ let Rn = class {
|
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
_$AC(t) {
|
|
413
|
-
let e =
|
|
414
|
-
return e === void 0 &&
|
|
413
|
+
let e = De.get(t.strings);
|
|
414
|
+
return e === void 0 && De.set(t.strings, e = new yt(t)), e;
|
|
415
415
|
}
|
|
416
416
|
k(t) {
|
|
417
|
-
|
|
417
|
+
pe(this._$AH) || (this._$AH = [], this._$AR());
|
|
418
418
|
const e = this._$AH;
|
|
419
419
|
let i, r = 0;
|
|
420
420
|
for (const s of t) r === e.length ? e.push(i = new $i(this.O(ft()), this.O(ft()), this, this.options)) : i = e[r], i._$AI(s), r++;
|
|
@@ -432,7 +432,7 @@ let Rn = class {
|
|
|
432
432
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
|
-
class
|
|
435
|
+
class Xt {
|
|
436
436
|
get tagName() {
|
|
437
437
|
return this.element.tagName;
|
|
438
438
|
}
|
|
@@ -457,7 +457,7 @@ class jt {
|
|
|
457
457
|
t === C ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
class
|
|
460
|
+
class Tn extends Xt {
|
|
461
461
|
constructor() {
|
|
462
462
|
super(...arguments), this.type = 3;
|
|
463
463
|
}
|
|
@@ -465,7 +465,7 @@ class Ln extends jt {
|
|
|
465
465
|
this.element[this.name] = t === C ? void 0 : t;
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
class
|
|
468
|
+
class Nn extends Xt {
|
|
469
469
|
constructor() {
|
|
470
470
|
super(...arguments), this.type = 4;
|
|
471
471
|
}
|
|
@@ -473,7 +473,7 @@ class In extends jt {
|
|
|
473
473
|
this.element.toggleAttribute(this.name, !!t && t !== C);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
class
|
|
476
|
+
class On extends Xt {
|
|
477
477
|
constructor(t, e, i, r, s) {
|
|
478
478
|
super(t, e, i, r, s), this.type = 5;
|
|
479
479
|
}
|
|
@@ -487,7 +487,7 @@ class Nn extends jt {
|
|
|
487
487
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
class
|
|
490
|
+
class kn {
|
|
491
491
|
constructor(t, e, i) {
|
|
492
492
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
493
493
|
}
|
|
@@ -498,14 +498,14 @@ class On {
|
|
|
498
498
|
at(this, t);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
const
|
|
501
|
+
const te = gt.litHtmlPolyfillSupport;
|
|
502
|
+
te == null || te(yt, ye), (gt.litHtmlVersions ?? (gt.litHtmlVersions = [])).push("3.2.1");
|
|
503
|
+
const Hn = (n, t, e) => {
|
|
504
504
|
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
505
505
|
let r = i._$litPart$;
|
|
506
506
|
if (r === void 0) {
|
|
507
507
|
const s = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
508
|
-
i._$litPart$ = r = new
|
|
508
|
+
i._$litPart$ = r = new ye(t.insertBefore(ft(), s), s, void 0, e ?? {});
|
|
509
509
|
}
|
|
510
510
|
return r._$AI(n), r;
|
|
511
511
|
};
|
|
@@ -525,7 +525,7 @@ class j extends tt {
|
|
|
525
525
|
}
|
|
526
526
|
update(t) {
|
|
527
527
|
const e = this.render();
|
|
528
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
528
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Hn(e, this.renderRoot, this.renderOptions);
|
|
529
529
|
}
|
|
530
530
|
connectedCallback() {
|
|
531
531
|
var t;
|
|
@@ -539,18 +539,18 @@ class j extends tt {
|
|
|
539
539
|
return ot;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
var
|
|
543
|
-
j._$litElement$ = !0, j.finalized = !0, (
|
|
544
|
-
const
|
|
545
|
-
|
|
542
|
+
var wi;
|
|
543
|
+
j._$litElement$ = !0, j.finalized = !0, (wi = globalThis.litElementHydrateSupport) == null || wi.call(globalThis, { LitElement: j });
|
|
544
|
+
const ee = globalThis.litElementPolyfillSupport;
|
|
545
|
+
ee == null || ee({ LitElement: j });
|
|
546
546
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
547
547
|
/**
|
|
548
548
|
* @license
|
|
549
549
|
* Copyright 2017 Google LLC
|
|
550
550
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
551
551
|
*/
|
|
552
|
-
const
|
|
553
|
-
let
|
|
552
|
+
const Un = (n) => (...t) => ({ _$litDirective$: n, values: t });
|
|
553
|
+
let jn = class {
|
|
554
554
|
constructor(t) {
|
|
555
555
|
}
|
|
556
556
|
get _$AU() {
|
|
@@ -571,13 +571,13 @@ let Un = class {
|
|
|
571
571
|
* Copyright 2020 Google LLC
|
|
572
572
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
573
573
|
*/
|
|
574
|
-
const
|
|
574
|
+
const Xn = {}, Yn = (n, t = Xn) => n._$AH = t;
|
|
575
575
|
/**
|
|
576
576
|
* @license
|
|
577
577
|
* Copyright 2021 Google LLC
|
|
578
578
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
579
579
|
*/
|
|
580
|
-
const
|
|
580
|
+
const Bn = Un(class extends jn {
|
|
581
581
|
constructor() {
|
|
582
582
|
super(...arguments), this.key = C;
|
|
583
583
|
}
|
|
@@ -585,9 +585,9 @@ const Yn = Hn(class extends Un {
|
|
|
585
585
|
return this.key = n, t;
|
|
586
586
|
}
|
|
587
587
|
update(n, [t, e]) {
|
|
588
|
-
return t !== this.key && (
|
|
588
|
+
return t !== this.key && (Yn(n), this.key = t), e;
|
|
589
589
|
}
|
|
590
|
-
}),
|
|
590
|
+
}), Vn = (n) => {
|
|
591
591
|
n.hoverInteraction = n.eoxMap.selectInteractions.selectHover, n.clickInteraction = n.eoxMap.selectInteractions.selectClick;
|
|
592
592
|
const t = () => {
|
|
593
593
|
n.requestUpdate();
|
|
@@ -599,37 +599,37 @@ const Yn = Hn(class extends Un {
|
|
|
599
599
|
"change",
|
|
600
600
|
t
|
|
601
601
|
);
|
|
602
|
-
},
|
|
602
|
+
}, zn = (n, t, e) => {
|
|
603
603
|
if (n.clickId === t) return;
|
|
604
604
|
const i = e ? [] : [t];
|
|
605
605
|
n.hoverInteraction.highlightById(i);
|
|
606
|
-
},
|
|
606
|
+
}, Jn = (n, t) => {
|
|
607
607
|
n.stopPropagation();
|
|
608
608
|
const e = Number(n.target.getAttribute("index")), i = t.drawnFeatures[e];
|
|
609
609
|
t.drawLayer.getSource().removeFeature(i), t.drawnFeatures.splice(e, 1), t.requestUpdate();
|
|
610
|
-
},
|
|
610
|
+
}, Qe = { duration: 750 }, ti = {
|
|
611
611
|
type: "FeatureCollection",
|
|
612
612
|
features: []
|
|
613
|
-
},
|
|
613
|
+
}, Wn = (n, t) => {
|
|
614
614
|
const e = n.getId(), { clickId: i, drawLayer: r, olMap: s, clickInteraction: o } = t, a = i === e, l = n.getGeometry();
|
|
615
615
|
if (a) {
|
|
616
616
|
const h = r.getSource().getExtent();
|
|
617
|
-
s.getView().fit(h,
|
|
617
|
+
s.getView().fit(h, Qe), o.highlightById([]);
|
|
618
618
|
} else {
|
|
619
619
|
const h = l.getExtent();
|
|
620
|
-
o.highlightById([e]), s.getView().fit(h,
|
|
620
|
+
o.highlightById([e]), s.getView().fit(h, Qe);
|
|
621
621
|
}
|
|
622
622
|
t.requestUpdate();
|
|
623
|
-
},
|
|
623
|
+
}, qn = "ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";
|
|
624
624
|
class Ai extends j {
|
|
625
625
|
constructor() {
|
|
626
626
|
super();
|
|
627
627
|
/**
|
|
628
|
-
* @type import("
|
|
628
|
+
* @type {import("@eox/map").EOxMap["selectInteractions"][string]}
|
|
629
629
|
*/
|
|
630
630
|
R(this, "hoverInteraction");
|
|
631
631
|
/**
|
|
632
|
-
* @type import("
|
|
632
|
+
* @type {import("@eox/map").EOxMap["selectInteractions"][string]}
|
|
633
633
|
*/
|
|
634
634
|
R(this, "clickInteraction");
|
|
635
635
|
/**
|
|
@@ -648,7 +648,7 @@ class Ai extends j {
|
|
|
648
648
|
* @param {Event & { target: HTMLButtonElement }} evt - Event object containing button target.
|
|
649
649
|
*/
|
|
650
650
|
_handleDelete(e) {
|
|
651
|
-
|
|
651
|
+
Jn(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
|
|
652
652
|
}
|
|
653
653
|
/**
|
|
654
654
|
* Handles the selection and deselection of a feature from the list.
|
|
@@ -656,7 +656,7 @@ class Ai extends j {
|
|
|
656
656
|
* @param {import("ol").Feature} feature - The selected feature.
|
|
657
657
|
*/
|
|
658
658
|
_handleFeatureSelectAndDeselect(e) {
|
|
659
|
-
|
|
659
|
+
Wn(e, this);
|
|
660
660
|
}
|
|
661
661
|
/**
|
|
662
662
|
*
|
|
@@ -664,13 +664,13 @@ class Ai extends j {
|
|
|
664
664
|
* @param {Boolean} mouseOut - Flag indicating mouse out event.
|
|
665
665
|
*/
|
|
666
666
|
_handleHoverFeature(e, i = !1) {
|
|
667
|
-
|
|
667
|
+
zn(this, e, i);
|
|
668
668
|
}
|
|
669
669
|
/**
|
|
670
670
|
* Initiates initial settings and event triggers upon the component's first update.
|
|
671
671
|
*/
|
|
672
672
|
firstUpdated() {
|
|
673
|
-
|
|
673
|
+
Vn(this);
|
|
674
674
|
}
|
|
675
675
|
/**
|
|
676
676
|
* Overrides createRenderRoot to handle shadow DOM.
|
|
@@ -682,12 +682,12 @@ class Ai extends j {
|
|
|
682
682
|
var e, i;
|
|
683
683
|
return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (i = this.clickInteraction) == null ? void 0 : i.selectedFids[0], U`
|
|
684
684
|
<style>
|
|
685
|
-
${!this.unstyled &&
|
|
685
|
+
${!this.unstyled && qn}
|
|
686
686
|
</style>
|
|
687
687
|
<ul class="list-wrap">
|
|
688
688
|
${this.drawnFeatures.map((r, s) => {
|
|
689
689
|
const o = s + 1, a = r.getId(), l = this.hoverId === a, h = this.clickId === a;
|
|
690
|
-
return
|
|
690
|
+
return Bn(
|
|
691
691
|
o,
|
|
692
692
|
U`
|
|
693
693
|
<li
|
|
@@ -726,11 +726,11 @@ R(Ai, "properties", {
|
|
|
726
726
|
unstyled: { type: Boolean }
|
|
727
727
|
});
|
|
728
728
|
customElements.define("eox-drawtools-list", Ai);
|
|
729
|
-
const
|
|
729
|
+
const Zn = (n) => {
|
|
730
730
|
const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing: i } = n, r = !t && (e == null ? void 0 : e.length) > 0 || i, s = !(e != null && e.length) && !i;
|
|
731
731
|
return { drawDisabled: r, discardDisabled: s };
|
|
732
|
-
},
|
|
733
|
-
function
|
|
732
|
+
}, Kn = "button,.button { /* TODO: why does this only work here and not from :root? */ --primary-color: #004170; --primary-color-hover: #004170cc; --error-color: #ff5252; display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0px;}", Dn = 'textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input,input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004; background-color: var(--background-color);}';
|
|
733
|
+
function Qn(n) {
|
|
734
734
|
navigator.clipboard.writeText(n).then(
|
|
735
735
|
function() {
|
|
736
736
|
},
|
|
@@ -739,38 +739,22 @@ function Kn(n) {
|
|
|
739
739
|
}
|
|
740
740
|
);
|
|
741
741
|
}
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* @param {string} type Type.
|
|
745
|
-
*/
|
|
746
|
-
constructor(t) {
|
|
747
|
-
this.propagationStopped, this.defaultPrevented, this.type = t, this.target = null;
|
|
748
|
-
}
|
|
749
|
-
/**
|
|
750
|
-
* Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events
|
|
751
|
-
* will be fired.
|
|
752
|
-
* @api
|
|
753
|
-
*/
|
|
754
|
-
preventDefault() {
|
|
755
|
-
this.defaultPrevented = !0;
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* Stop event propagation.
|
|
759
|
-
* @api
|
|
760
|
-
*/
|
|
761
|
-
stopPropagation() {
|
|
762
|
-
this.propagationStopped = !0;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
const Qn = {
|
|
742
|
+
const tr = {
|
|
766
743
|
/**
|
|
767
744
|
* Triggered when a property is changed.
|
|
768
745
|
* @event module:ol/Object.ObjectEvent#propertychange
|
|
769
746
|
* @api
|
|
770
747
|
*/
|
|
771
748
|
PROPERTYCHANGE: "propertychange"
|
|
749
|
+
}, me = {
|
|
750
|
+
/**
|
|
751
|
+
* Generic change event. Triggered when the revision counter is increased.
|
|
752
|
+
* @event module:ol/events/Event~BaseEvent#change
|
|
753
|
+
* @api
|
|
754
|
+
*/
|
|
755
|
+
CHANGE: "change"
|
|
772
756
|
};
|
|
773
|
-
class
|
|
757
|
+
class er {
|
|
774
758
|
constructor() {
|
|
775
759
|
this.disposed = !1;
|
|
776
760
|
}
|
|
@@ -787,7 +771,7 @@ class tr {
|
|
|
787
771
|
disposeInternal() {
|
|
788
772
|
}
|
|
789
773
|
}
|
|
790
|
-
function
|
|
774
|
+
function ir(n, t, e) {
|
|
791
775
|
let i, r;
|
|
792
776
|
e = e || Fi;
|
|
793
777
|
let s = 0, o = n.length, a = !1;
|
|
@@ -803,7 +787,7 @@ function A(n, t) {
|
|
|
803
787
|
for (let r = 0; r < i; r++)
|
|
804
788
|
n[n.length] = e[r];
|
|
805
789
|
}
|
|
806
|
-
function
|
|
790
|
+
function nr(n, t) {
|
|
807
791
|
const e = n.length;
|
|
808
792
|
if (e !== t.length)
|
|
809
793
|
return !1;
|
|
@@ -812,26 +796,49 @@ function ir(n, t) {
|
|
|
812
796
|
return !1;
|
|
813
797
|
return !0;
|
|
814
798
|
}
|
|
815
|
-
function
|
|
799
|
+
function ei() {
|
|
816
800
|
}
|
|
817
801
|
function Gi(n) {
|
|
818
802
|
let t, e, i;
|
|
819
803
|
return function() {
|
|
820
804
|
const r = Array.prototype.slice.call(arguments);
|
|
821
|
-
return (!e || this !== i || !
|
|
805
|
+
return (!e || this !== i || !nr(r, e)) && (i = this, e = r, t = n.apply(this, arguments)), t;
|
|
822
806
|
};
|
|
823
807
|
}
|
|
824
|
-
function
|
|
808
|
+
function Li(n) {
|
|
825
809
|
for (const t in n)
|
|
826
810
|
delete n[t];
|
|
827
811
|
}
|
|
828
|
-
function
|
|
812
|
+
function Ii(n) {
|
|
829
813
|
let t;
|
|
830
814
|
for (t in n)
|
|
831
815
|
return !1;
|
|
832
816
|
return !t;
|
|
833
817
|
}
|
|
834
|
-
class
|
|
818
|
+
class Ri {
|
|
819
|
+
/**
|
|
820
|
+
* @param {string} type Type.
|
|
821
|
+
*/
|
|
822
|
+
constructor(t) {
|
|
823
|
+
this.propagationStopped, this.defaultPrevented, this.type = t, this.target = null;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events
|
|
827
|
+
* will be fired.
|
|
828
|
+
* @api
|
|
829
|
+
*/
|
|
830
|
+
preventDefault() {
|
|
831
|
+
this.defaultPrevented = !0;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Stop event propagation.
|
|
835
|
+
* @api
|
|
836
|
+
*/
|
|
837
|
+
stopPropagation() {
|
|
838
|
+
this.propagationStopped = !0;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
class rr extends er {
|
|
835
842
|
/**
|
|
836
843
|
* @param {*} [target] Default event target for dispatched events.
|
|
837
844
|
*/
|
|
@@ -862,7 +869,7 @@ class nr extends tr {
|
|
|
862
869
|
const e = typeof t == "string", i = e ? t : t.type, r = this.listeners_ && this.listeners_[i];
|
|
863
870
|
if (!r)
|
|
864
871
|
return;
|
|
865
|
-
const s = e ? new
|
|
872
|
+
const s = e ? new Ri(t) : (
|
|
866
873
|
/** @type {Event} */
|
|
867
874
|
t
|
|
868
875
|
);
|
|
@@ -880,7 +887,7 @@ class nr extends tr {
|
|
|
880
887
|
if (--o[i] === 0) {
|
|
881
888
|
let h = a[i];
|
|
882
889
|
for (delete a[i]; h--; )
|
|
883
|
-
this.removeEventListener(i,
|
|
890
|
+
this.removeEventListener(i, ei);
|
|
884
891
|
delete o[i];
|
|
885
892
|
}
|
|
886
893
|
return l;
|
|
@@ -890,7 +897,7 @@ class nr extends tr {
|
|
|
890
897
|
* @override
|
|
891
898
|
*/
|
|
892
899
|
disposeInternal() {
|
|
893
|
-
this.listeners_ &&
|
|
900
|
+
this.listeners_ && Li(this.listeners_);
|
|
894
901
|
}
|
|
895
902
|
/**
|
|
896
903
|
* Get the listeners for a specified event type. Listeners are returned in the
|
|
@@ -921,43 +928,14 @@ class nr extends tr {
|
|
|
921
928
|
if (!i)
|
|
922
929
|
return;
|
|
923
930
|
const r = i.indexOf(e);
|
|
924
|
-
r !== -1 && (this.pendingRemovals_ && t in this.pendingRemovals_ ? (i[r] =
|
|
931
|
+
r !== -1 && (this.pendingRemovals_ && t in this.pendingRemovals_ ? (i[r] = ei, ++this.pendingRemovals_[t]) : (i.splice(r, 1), i.length === 0 && delete this.listeners_[t]));
|
|
925
932
|
}
|
|
926
933
|
}
|
|
927
|
-
const ye = {
|
|
928
|
-
/**
|
|
929
|
-
* Generic change event. Triggered when the revision counter is increased.
|
|
930
|
-
* @event module:ol/events/Event~BaseEvent#change
|
|
931
|
-
* @api
|
|
932
|
-
*/
|
|
933
|
-
CHANGE: "change",
|
|
934
|
-
/**
|
|
935
|
-
* Generic error event. Triggered when an error occurs.
|
|
936
|
-
* @event module:ol/events/Event~BaseEvent#error
|
|
937
|
-
* @api
|
|
938
|
-
*/
|
|
939
|
-
ERROR: "error",
|
|
940
|
-
BLUR: "blur",
|
|
941
|
-
CLEAR: "clear",
|
|
942
|
-
CONTEXTMENU: "contextmenu",
|
|
943
|
-
CLICK: "click",
|
|
944
|
-
DBLCLICK: "dblclick",
|
|
945
|
-
DRAGENTER: "dragenter",
|
|
946
|
-
DRAGOVER: "dragover",
|
|
947
|
-
DROP: "drop",
|
|
948
|
-
FOCUS: "focus",
|
|
949
|
-
KEYDOWN: "keydown",
|
|
950
|
-
KEYPRESS: "keypress",
|
|
951
|
-
LOAD: "load",
|
|
952
|
-
RESIZE: "resize",
|
|
953
|
-
TOUCHMOVE: "touchmove",
|
|
954
|
-
WHEEL: "wheel"
|
|
955
|
-
};
|
|
956
934
|
function mt(n, t, e, i, r) {
|
|
957
935
|
if (r) {
|
|
958
936
|
const o = e;
|
|
959
|
-
e = function() {
|
|
960
|
-
n.removeEventListener(t, e), o.
|
|
937
|
+
e = function(a) {
|
|
938
|
+
return n.removeEventListener(t, e), o.call(i ?? this, a);
|
|
961
939
|
};
|
|
962
940
|
} else i && i !== n && (e = e.bind(i));
|
|
963
941
|
const s = {
|
|
@@ -967,13 +945,13 @@ function mt(n, t, e, i, r) {
|
|
|
967
945
|
};
|
|
968
946
|
return n.addEventListener(t, e), s;
|
|
969
947
|
}
|
|
970
|
-
function
|
|
948
|
+
function ii(n, t, e, i) {
|
|
971
949
|
return mt(n, t, e, i, !0);
|
|
972
950
|
}
|
|
973
|
-
function
|
|
974
|
-
n && n.target && (n.target.removeEventListener(n.type, n.listener),
|
|
951
|
+
function Nt(n) {
|
|
952
|
+
n && n.target && (n.target.removeEventListener(n.type, n.listener), Li(n));
|
|
975
953
|
}
|
|
976
|
-
class
|
|
954
|
+
class Yt extends rr {
|
|
977
955
|
constructor() {
|
|
978
956
|
super(), this.on = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
|
|
979
957
|
this.onInternal, this.once = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
|
|
@@ -985,7 +963,7 @@ class Xt extends nr {
|
|
|
985
963
|
* @api
|
|
986
964
|
*/
|
|
987
965
|
changed() {
|
|
988
|
-
++this.revision_, this.dispatchEvent(
|
|
966
|
+
++this.revision_, this.dispatchEvent(me.CHANGE);
|
|
989
967
|
}
|
|
990
968
|
/**
|
|
991
969
|
* Get the version number for this object. Each time the object is modified,
|
|
@@ -1028,9 +1006,9 @@ class Xt extends nr {
|
|
|
1028
1006
|
const r = t.length;
|
|
1029
1007
|
i = new Array(r);
|
|
1030
1008
|
for (let s = 0; s < r; ++s)
|
|
1031
|
-
i[s] =
|
|
1009
|
+
i[s] = ii(this, t[s], e);
|
|
1032
1010
|
} else
|
|
1033
|
-
i =
|
|
1011
|
+
i = ii(
|
|
1034
1012
|
this,
|
|
1035
1013
|
/** @type {string} */
|
|
1036
1014
|
t,
|
|
@@ -1050,7 +1028,7 @@ class Xt extends nr {
|
|
|
1050
1028
|
e.ol_key
|
|
1051
1029
|
);
|
|
1052
1030
|
if (i)
|
|
1053
|
-
|
|
1031
|
+
sr(i);
|
|
1054
1032
|
else if (Array.isArray(t))
|
|
1055
1033
|
for (let r = 0, s = t.length; r < s; ++r)
|
|
1056
1034
|
this.removeEventListener(t[r], e);
|
|
@@ -1058,15 +1036,15 @@ class Xt extends nr {
|
|
|
1058
1036
|
this.removeEventListener(t, e);
|
|
1059
1037
|
}
|
|
1060
1038
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
function
|
|
1039
|
+
Yt.prototype.on;
|
|
1040
|
+
Yt.prototype.once;
|
|
1041
|
+
Yt.prototype.un;
|
|
1042
|
+
function sr(n) {
|
|
1065
1043
|
if (Array.isArray(n))
|
|
1066
1044
|
for (let t = 0, e = n.length; t < e; ++t)
|
|
1067
|
-
|
|
1045
|
+
Nt(n[t]);
|
|
1068
1046
|
else
|
|
1069
|
-
|
|
1047
|
+
Nt(
|
|
1070
1048
|
/** @type {import("./events.js").EventsKey} */
|
|
1071
1049
|
n
|
|
1072
1050
|
);
|
|
@@ -1074,11 +1052,11 @@ function rr(n) {
|
|
|
1074
1052
|
function y() {
|
|
1075
1053
|
throw new Error("Unimplemented abstract method.");
|
|
1076
1054
|
}
|
|
1077
|
-
let
|
|
1078
|
-
function
|
|
1079
|
-
return n.ol_uid || (n.ol_uid = String(++
|
|
1055
|
+
let or = 0;
|
|
1056
|
+
function ar(n) {
|
|
1057
|
+
return n.ol_uid || (n.ol_uid = String(++or));
|
|
1080
1058
|
}
|
|
1081
|
-
class
|
|
1059
|
+
class ni extends Ri {
|
|
1082
1060
|
/**
|
|
1083
1061
|
* @param {string} type The event type.
|
|
1084
1062
|
* @param {string} key The property name.
|
|
@@ -1088,12 +1066,12 @@ class ii extends Si {
|
|
|
1088
1066
|
super(t), this.key = e, this.oldValue = i;
|
|
1089
1067
|
}
|
|
1090
1068
|
}
|
|
1091
|
-
class
|
|
1069
|
+
class Ti extends Yt {
|
|
1092
1070
|
/**
|
|
1093
1071
|
* @param {Object<string, *>} [values] An object with key-value pairs.
|
|
1094
1072
|
*/
|
|
1095
1073
|
constructor(t) {
|
|
1096
|
-
super(), this.on, this.once, this.un,
|
|
1074
|
+
super(), this.on, this.once, this.un, ar(this), this.values_ = null, t !== void 0 && this.setProperties(t);
|
|
1097
1075
|
}
|
|
1098
1076
|
/**
|
|
1099
1077
|
* Gets a value.
|
|
@@ -1140,7 +1118,7 @@ class Li extends Xt {
|
|
|
1140
1118
|
*/
|
|
1141
1119
|
notify(t, e) {
|
|
1142
1120
|
let i;
|
|
1143
|
-
i = `change:${t}`, this.hasListener(i) && this.dispatchEvent(new
|
|
1121
|
+
i = `change:${t}`, this.hasListener(i) && this.dispatchEvent(new ni(i, t, e)), i = tr.PROPERTYCHANGE, this.hasListener(i) && this.dispatchEvent(new ni(i, t, e));
|
|
1144
1122
|
}
|
|
1145
1123
|
/**
|
|
1146
1124
|
* @param {string} key Key name.
|
|
@@ -1200,15 +1178,15 @@ class Li extends Xt {
|
|
|
1200
1178
|
unset(t, e) {
|
|
1201
1179
|
if (this.values_ && t in this.values_) {
|
|
1202
1180
|
const i = this.values_[t];
|
|
1203
|
-
delete this.values_[t],
|
|
1181
|
+
delete this.values_[t], Ii(this.values_) && (this.values_ = null), e || this.notify(t, i);
|
|
1204
1182
|
}
|
|
1205
1183
|
}
|
|
1206
1184
|
}
|
|
1207
|
-
function
|
|
1185
|
+
function lr(n, t) {
|
|
1208
1186
|
if (!n)
|
|
1209
1187
|
throw new Error(t);
|
|
1210
1188
|
}
|
|
1211
|
-
class lt extends
|
|
1189
|
+
class lt extends Ti {
|
|
1212
1190
|
/**
|
|
1213
1191
|
* @param {Geometry|ObjectWithGeometry<Geometry>} [geometryOrProperties]
|
|
1214
1192
|
* You may pass a Geometry object directly, or an object literal containing
|
|
@@ -1311,11 +1289,11 @@ class lt extends Li {
|
|
|
1311
1289
|
* @private
|
|
1312
1290
|
*/
|
|
1313
1291
|
handleGeometryChanged_() {
|
|
1314
|
-
this.geometryChangeKey_ && (
|
|
1292
|
+
this.geometryChangeKey_ && (Nt(this.geometryChangeKey_), this.geometryChangeKey_ = null);
|
|
1315
1293
|
const t = this.getGeometry();
|
|
1316
1294
|
t && (this.geometryChangeKey_ = mt(
|
|
1317
1295
|
t,
|
|
1318
|
-
|
|
1296
|
+
me.CHANGE,
|
|
1319
1297
|
this.handleGeometryChange_,
|
|
1320
1298
|
this
|
|
1321
1299
|
)), this.changed();
|
|
@@ -1340,7 +1318,7 @@ class lt extends Li {
|
|
|
1340
1318
|
* @fires module:ol/events/Event~BaseEvent#event:change
|
|
1341
1319
|
*/
|
|
1342
1320
|
setStyle(t) {
|
|
1343
|
-
this.style_ = t, this.styleFunction_ = t ?
|
|
1321
|
+
this.style_ = t, this.styleFunction_ = t ? hr(t) : void 0, this.changed();
|
|
1344
1322
|
}
|
|
1345
1323
|
/**
|
|
1346
1324
|
* Set the feature id. The feature id is considered stable and may be used when
|
|
@@ -1365,11 +1343,11 @@ class lt extends Li {
|
|
|
1365
1343
|
this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_), this.geometryName_ = t, this.addChangeListener(this.geometryName_, this.handleGeometryChanged_), this.handleGeometryChanged_();
|
|
1366
1344
|
}
|
|
1367
1345
|
}
|
|
1368
|
-
function
|
|
1346
|
+
function hr(n) {
|
|
1369
1347
|
if (typeof n == "function")
|
|
1370
1348
|
return n;
|
|
1371
1349
|
let t;
|
|
1372
|
-
return Array.isArray(n) ? t = n : (
|
|
1350
|
+
return Array.isArray(n) ? t = n : (lr(
|
|
1373
1351
|
typeof /** @type {?} */
|
|
1374
1352
|
n.getZIndex == "function",
|
|
1375
1353
|
"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"
|
|
@@ -1380,14 +1358,6 @@ function lr(n) {
|
|
|
1380
1358
|
return t;
|
|
1381
1359
|
};
|
|
1382
1360
|
}
|
|
1383
|
-
new Array(6);
|
|
1384
|
-
function Ii() {
|
|
1385
|
-
return [1, 0, 0, 1, 0, 0];
|
|
1386
|
-
}
|
|
1387
|
-
function Ni(n, t, e, i, r, s, o, a) {
|
|
1388
|
-
const l = Math.sin(s), h = Math.cos(s);
|
|
1389
|
-
return n[0] = i * h, n[1] = r * l, n[2] = -i * l, n[3] = r * h, n[4] = o * i * h - a * i * l + t, n[5] = o * r * l + a * r * h + e, n;
|
|
1390
|
-
}
|
|
1391
1361
|
const w = {
|
|
1392
1362
|
UNKNOWN: 0,
|
|
1393
1363
|
INTERSECTING: 1,
|
|
@@ -1396,42 +1366,39 @@ const w = {
|
|
|
1396
1366
|
BELOW: 8,
|
|
1397
1367
|
LEFT: 16
|
|
1398
1368
|
};
|
|
1399
|
-
function
|
|
1369
|
+
function q(n, t, e) {
|
|
1400
1370
|
let i, r;
|
|
1401
1371
|
return t < n[0] ? i = n[0] - t : n[2] < t ? i = t - n[2] : i = 0, e < n[1] ? r = n[1] - e : n[3] < e ? r = e - n[3] : r = 0, i * i + r * r;
|
|
1402
1372
|
}
|
|
1403
|
-
function
|
|
1404
|
-
return n[0] <= t[0] && t[2] <= n[2] && n[1] <= t[1] && t[3] <= n[3];
|
|
1405
|
-
}
|
|
1406
|
-
function Oi(n, t, e) {
|
|
1373
|
+
function Ni(n, t, e) {
|
|
1407
1374
|
return n[0] <= t && t <= n[2] && n[1] <= e && e <= n[3];
|
|
1408
1375
|
}
|
|
1409
|
-
function
|
|
1376
|
+
function ri(n, t) {
|
|
1410
1377
|
const e = n[0], i = n[1], r = n[2], s = n[3], o = t[0], a = t[1];
|
|
1411
1378
|
let l = w.UNKNOWN;
|
|
1412
1379
|
return o < e ? l = l | w.LEFT : o > r && (l = l | w.RIGHT), a < i ? l = l | w.BELOW : a > s && (l = l | w.ABOVE), l === w.UNKNOWN && (l = w.INTERSECTING), l;
|
|
1413
1380
|
}
|
|
1414
|
-
function
|
|
1381
|
+
function _e() {
|
|
1415
1382
|
return [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
1416
1383
|
}
|
|
1417
|
-
function
|
|
1384
|
+
function Oi(n, t, e, i, r) {
|
|
1418
1385
|
return r ? (r[0] = n, r[1] = t, r[2] = e, r[3] = i, r) : [n, t, e, i];
|
|
1419
1386
|
}
|
|
1420
|
-
function
|
|
1421
|
-
return
|
|
1387
|
+
function ve(n) {
|
|
1388
|
+
return Oi(1 / 0, 1 / 0, -1 / 0, -1 / 0, n);
|
|
1422
1389
|
}
|
|
1423
|
-
function
|
|
1390
|
+
function ki(n, t) {
|
|
1424
1391
|
const e = n[0], i = n[1];
|
|
1425
|
-
return
|
|
1392
|
+
return Oi(e, i, e, i, t);
|
|
1426
1393
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const s =
|
|
1429
|
-
return
|
|
1394
|
+
function Ce(n, t, e, i, r) {
|
|
1395
|
+
const s = ve(r);
|
|
1396
|
+
return Hi(s, n, t, e, i);
|
|
1430
1397
|
}
|
|
1431
1398
|
function cr(n, t) {
|
|
1432
1399
|
return t[0] < n[0] && (n[0] = t[0]), t[2] > n[2] && (n[2] = t[2]), t[1] < n[1] && (n[1] = t[1]), t[3] > n[3] && (n[3] = t[3]), n;
|
|
1433
1400
|
}
|
|
1434
|
-
function
|
|
1401
|
+
function Hi(n, t, e, i, r) {
|
|
1435
1402
|
for (; e < i; e += r)
|
|
1436
1403
|
ur(n, t[e], t[e + 1]);
|
|
1437
1404
|
return n;
|
|
@@ -1449,10 +1416,10 @@ function gr(n) {
|
|
|
1449
1416
|
function fr(n) {
|
|
1450
1417
|
return [n[2], n[1]];
|
|
1451
1418
|
}
|
|
1452
|
-
function
|
|
1419
|
+
function Bt(n) {
|
|
1453
1420
|
return [(n[0] + n[2]) / 2, (n[1] + n[3]) / 2];
|
|
1454
1421
|
}
|
|
1455
|
-
function
|
|
1422
|
+
function Ot(n) {
|
|
1456
1423
|
return n[3] - n[1];
|
|
1457
1424
|
}
|
|
1458
1425
|
function pr(n) {
|
|
@@ -1469,7 +1436,7 @@ function _r(n, t) {
|
|
|
1469
1436
|
}
|
|
1470
1437
|
function vr(n, t, e) {
|
|
1471
1438
|
let i = !1;
|
|
1472
|
-
const r =
|
|
1439
|
+
const r = ri(n, t), s = ri(n, e);
|
|
1473
1440
|
if (r === w.INTERSECTING || s === w.INTERSECTING)
|
|
1474
1441
|
i = !0;
|
|
1475
1442
|
else {
|
|
@@ -1479,7 +1446,34 @@ function vr(n, t, e) {
|
|
|
1479
1446
|
}
|
|
1480
1447
|
return i;
|
|
1481
1448
|
}
|
|
1482
|
-
|
|
1449
|
+
function Cr(n, t, e, i, r, s) {
|
|
1450
|
+
const o = r - e, a = s - i;
|
|
1451
|
+
if (o !== 0 || a !== 0) {
|
|
1452
|
+
const l = ((n - e) * o + (t - i) * a) / (o * o + a * a);
|
|
1453
|
+
l > 1 ? (e = r, i = s) : l > 0 && (e += o * l, i += a * l);
|
|
1454
|
+
}
|
|
1455
|
+
return X(n, t, e, i);
|
|
1456
|
+
}
|
|
1457
|
+
function X(n, t, e, i) {
|
|
1458
|
+
const r = e - n, s = i - t;
|
|
1459
|
+
return r * r + s * s;
|
|
1460
|
+
}
|
|
1461
|
+
function si(n) {
|
|
1462
|
+
return n * 180 / Math.PI;
|
|
1463
|
+
}
|
|
1464
|
+
function Rt(n) {
|
|
1465
|
+
return n * Math.PI / 180;
|
|
1466
|
+
}
|
|
1467
|
+
function we(n, t, e) {
|
|
1468
|
+
return n + e * (t - n);
|
|
1469
|
+
}
|
|
1470
|
+
function oe(n, t, e) {
|
|
1471
|
+
if (n >= t && n < e)
|
|
1472
|
+
return n;
|
|
1473
|
+
const i = e - t;
|
|
1474
|
+
return ((n - t) % i + i) % i + t;
|
|
1475
|
+
}
|
|
1476
|
+
const wr = {
|
|
1483
1477
|
// use the radius of the Normal sphere
|
|
1484
1478
|
radians: 6370997 / (2 * Math.PI),
|
|
1485
1479
|
degrees: 2 * Math.PI * 6370997 / 360,
|
|
@@ -1487,7 +1481,7 @@ const Cr = {
|
|
|
1487
1481
|
m: 1,
|
|
1488
1482
|
"us-ft": 1200 / 3937
|
|
1489
1483
|
};
|
|
1490
|
-
class
|
|
1484
|
+
class be {
|
|
1491
1485
|
/**
|
|
1492
1486
|
* @param {Options} options Projection options.
|
|
1493
1487
|
*/
|
|
@@ -1533,7 +1527,7 @@ class Ce {
|
|
|
1533
1527
|
* @api
|
|
1534
1528
|
*/
|
|
1535
1529
|
getMetersPerUnit() {
|
|
1536
|
-
return this.metersPerUnit_ ||
|
|
1530
|
+
return this.metersPerUnit_ || wr[this.units_];
|
|
1537
1531
|
}
|
|
1538
1532
|
/**
|
|
1539
1533
|
* Get the world extent for this projection.
|
|
@@ -1613,15 +1607,15 @@ class Ce {
|
|
|
1613
1607
|
}
|
|
1614
1608
|
/**
|
|
1615
1609
|
* Get the custom point resolution function for this projection (if set).
|
|
1616
|
-
* @return {
|
|
1610
|
+
* @return {GetPointResolution|undefined} The custom point
|
|
1617
1611
|
* resolution function (if set).
|
|
1618
1612
|
*/
|
|
1619
1613
|
getPointResolutionFunc() {
|
|
1620
1614
|
return this.getPointResolutionFunc_;
|
|
1621
1615
|
}
|
|
1622
1616
|
}
|
|
1623
|
-
const
|
|
1624
|
-
class
|
|
1617
|
+
const St = 6378137, et = Math.PI * St, br = [-et, -et, et, et], Er = [-180, -85, 180, 85], Ft = St * Math.log(Math.tan(Math.PI / 2));
|
|
1618
|
+
class D extends be {
|
|
1625
1619
|
/**
|
|
1626
1620
|
* @param {string} code Code.
|
|
1627
1621
|
*/
|
|
@@ -1629,42 +1623,42 @@ class K extends Ce {
|
|
|
1629
1623
|
super({
|
|
1630
1624
|
code: t,
|
|
1631
1625
|
units: "m",
|
|
1632
|
-
extent:
|
|
1626
|
+
extent: br,
|
|
1633
1627
|
global: !0,
|
|
1634
1628
|
worldExtent: Er,
|
|
1635
1629
|
getPointResolution: function(e, i) {
|
|
1636
|
-
return e / Math.cosh(i[1] /
|
|
1630
|
+
return e / Math.cosh(i[1] / St);
|
|
1637
1631
|
}
|
|
1638
1632
|
});
|
|
1639
1633
|
}
|
|
1640
1634
|
}
|
|
1641
|
-
const
|
|
1642
|
-
new
|
|
1643
|
-
new
|
|
1644
|
-
new
|
|
1645
|
-
new
|
|
1646
|
-
new
|
|
1647
|
-
new
|
|
1635
|
+
const oi = [
|
|
1636
|
+
new D("EPSG:3857"),
|
|
1637
|
+
new D("EPSG:102100"),
|
|
1638
|
+
new D("EPSG:102113"),
|
|
1639
|
+
new D("EPSG:900913"),
|
|
1640
|
+
new D("http://www.opengis.net/def/crs/EPSG/0/3857"),
|
|
1641
|
+
new D("http://www.opengis.net/gml/srs/epsg.xml#3857")
|
|
1648
1642
|
];
|
|
1649
|
-
function
|
|
1643
|
+
function xr(n, t, e, i) {
|
|
1650
1644
|
const r = n.length;
|
|
1651
1645
|
e = e > 1 ? e : 2, i = i ?? e, t === void 0 && (e > 2 ? t = n.slice() : t = new Array(r));
|
|
1652
1646
|
for (let s = 0; s < r; s += i) {
|
|
1653
1647
|
t[s] = et * n[s] / 180;
|
|
1654
|
-
let o =
|
|
1655
|
-
o >
|
|
1648
|
+
let o = St * Math.log(Math.tan(Math.PI * (+n[s + 1] + 90) / 360));
|
|
1649
|
+
o > Ft ? o = Ft : o < -Ft && (o = -Ft), t[s + 1] = o;
|
|
1656
1650
|
}
|
|
1657
1651
|
return t;
|
|
1658
1652
|
}
|
|
1659
|
-
function
|
|
1653
|
+
function Pr(n, t, e, i) {
|
|
1660
1654
|
const r = n.length;
|
|
1661
1655
|
e = e > 1 ? e : 2, i = i ?? e, t === void 0 && (e > 2 ? t = n.slice() : t = new Array(r));
|
|
1662
1656
|
for (let s = 0; s < r; s += i)
|
|
1663
|
-
t[s] = 180 * n[s] / et, t[s + 1] = 360 * Math.atan(Math.exp(n[s + 1] /
|
|
1657
|
+
t[s] = 180 * n[s] / et, t[s + 1] = 360 * Math.atan(Math.exp(n[s + 1] / St)) / Math.PI - 90;
|
|
1664
1658
|
return t;
|
|
1665
1659
|
}
|
|
1666
|
-
const
|
|
1667
|
-
class N extends
|
|
1660
|
+
const Mr = 6378137, ai = [-180, -90, 180, 90], Sr = Math.PI * Mr / 180;
|
|
1661
|
+
class N extends be {
|
|
1668
1662
|
/**
|
|
1669
1663
|
* @param {string} code Code.
|
|
1670
1664
|
* @param {string} [axisOrientation] Axis orientation.
|
|
@@ -1673,15 +1667,15 @@ class N extends Ce {
|
|
|
1673
1667
|
super({
|
|
1674
1668
|
code: t,
|
|
1675
1669
|
units: "degrees",
|
|
1676
|
-
extent:
|
|
1670
|
+
extent: ai,
|
|
1677
1671
|
axisOrientation: e,
|
|
1678
1672
|
global: !0,
|
|
1679
|
-
metersPerUnit:
|
|
1680
|
-
worldExtent:
|
|
1673
|
+
metersPerUnit: Sr,
|
|
1674
|
+
worldExtent: ai
|
|
1681
1675
|
});
|
|
1682
1676
|
}
|
|
1683
1677
|
}
|
|
1684
|
-
const
|
|
1678
|
+
const li = [
|
|
1685
1679
|
new N("CRS:84"),
|
|
1686
1680
|
new N("EPSG:4326", "neu"),
|
|
1687
1681
|
new N("urn:ogc:def:crs:OGC:1.3:CRS84"),
|
|
@@ -1690,66 +1684,39 @@ const oi = [
|
|
|
1690
1684
|
new N("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu"),
|
|
1691
1685
|
new N("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
|
|
1692
1686
|
];
|
|
1693
|
-
let
|
|
1687
|
+
let ae = {};
|
|
1694
1688
|
function $r(n) {
|
|
1695
|
-
return
|
|
1689
|
+
return ae[n] || ae[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
|
|
1696
1690
|
}
|
|
1697
1691
|
function Ar(n, t) {
|
|
1698
|
-
|
|
1692
|
+
ae[n] = t;
|
|
1699
1693
|
}
|
|
1700
1694
|
let it = {};
|
|
1701
1695
|
function _t(n, t, e) {
|
|
1702
1696
|
const i = n.getCode(), r = t.getCode();
|
|
1703
1697
|
i in it || (it[i] = {}), it[i][r] = e;
|
|
1704
1698
|
}
|
|
1705
|
-
function
|
|
1699
|
+
function ie(n, t) {
|
|
1706
1700
|
return n in it && t in it[n] ? it[n][t] : null;
|
|
1707
1701
|
}
|
|
1708
|
-
|
|
1709
|
-
const o = r - e, a = s - i;
|
|
1710
|
-
if (o !== 0 || a !== 0) {
|
|
1711
|
-
const l = ((n - e) * o + (t - i) * a) / (o * o + a * a);
|
|
1712
|
-
l > 1 ? (e = r, i = s) : l > 0 && (e += o * l, i += a * l);
|
|
1713
|
-
}
|
|
1714
|
-
return X(n, t, e, i);
|
|
1715
|
-
}
|
|
1716
|
-
function X(n, t, e, i) {
|
|
1717
|
-
const r = e - n, s = i - t;
|
|
1718
|
-
return r * r + s * s;
|
|
1719
|
-
}
|
|
1720
|
-
function ai(n) {
|
|
1721
|
-
return n * 180 / Math.PI;
|
|
1722
|
-
}
|
|
1723
|
-
function Rt(n) {
|
|
1724
|
-
return n * Math.PI / 180;
|
|
1725
|
-
}
|
|
1726
|
-
function we(n, t, e) {
|
|
1727
|
-
return n + e * (t - n);
|
|
1728
|
-
}
|
|
1729
|
-
function oe(n, t, e) {
|
|
1730
|
-
if (n >= t && n < e)
|
|
1731
|
-
return n;
|
|
1732
|
-
const i = e - t;
|
|
1733
|
-
return ((n - t) % i + i) % i + t;
|
|
1734
|
-
}
|
|
1735
|
-
const Ot = 0.9996, P = 669438e-8, Bt = P * P, Vt = Bt * P, k = P / (1 - P), li = Math.sqrt(1 - P), ht = (1 - li) / (1 + li), ji = ht * ht, Ee = ji * ht, be = Ee * ht, Xi = be * ht, Yi = 1 - P / 4 - 3 * Bt / 64 - 5 * Vt / 256, Fr = 3 * P / 8 + 3 * Bt / 32 + 45 * Vt / 1024, Gr = 15 * Bt / 256 + 45 * Vt / 1024, Tr = 35 * Vt / 3072, Rr = 3 / 2 * ht - 27 / 32 * Ee + 269 / 512 * Xi, Lr = 21 / 16 * ji - 55 / 32 * be, Ir = 151 / 96 * Ee - 417 / 128 * Xi, Nr = 1097 / 512 * be, kt = 6378137;
|
|
1702
|
+
const kt = 0.9996, P = 669438e-8, Vt = P * P, zt = Vt * P, k = P / (1 - P), hi = Math.sqrt(1 - P), ht = (1 - hi) / (1 + hi), Ui = ht * ht, Ee = Ui * ht, xe = Ee * ht, ji = xe * ht, Xi = 1 - P / 4 - 3 * Vt / 64 - 5 * zt / 256, Fr = 3 * P / 8 + 3 * Vt / 32 + 45 * zt / 1024, Gr = 15 * Vt / 256 + 45 * zt / 1024, Lr = 35 * zt / 3072, Ir = 3 / 2 * ht - 27 / 32 * Ee + 269 / 512 * ji, Rr = 21 / 16 * Ui - 55 / 32 * xe, Tr = 151 / 96 * Ee - 417 / 128 * ji, Nr = 1097 / 512 * xe, Ht = 6378137;
|
|
1736
1703
|
function Or(n, t, e) {
|
|
1737
|
-
const i = n - 5e5, o = (e.north ? t : t - 1e7) /
|
|
1738
|
-
let
|
|
1739
|
-
return
|
|
1740
|
-
|
|
1704
|
+
const i = n - 5e5, o = (e.north ? t : t - 1e7) / kt / (Ht * Xi), a = o + Ir * Math.sin(2 * o) + Rr * Math.sin(4 * o) + Tr * Math.sin(6 * o) + Nr * Math.sin(8 * o), l = Math.sin(a), h = l * l, c = Math.cos(a), u = l / c, d = u * u, g = d * d, f = 1 - P * h, p = Math.sqrt(1 - P * h), _ = Ht / p, b = (1 - P) / f, v = k * c ** 2, S = v * v, E = i / (_ * kt), I = E * E, ct = I * E, He = ct * E, Ue = He * E, yn = Ue * E, mn = a - u / b * (I / 2 - He / 24 * (5 + 3 * d + 10 * v - 4 * S - 9 * k)) + yn / 720 * (61 + 90 * d + 298 * v + 45 * g - 252 * k - 3 * S);
|
|
1705
|
+
let Kt = (E - ct / 6 * (1 + 2 * d + v) + Ue / 120 * (5 - 2 * v + 28 * d - 3 * S + 8 * k + 24 * g)) / c;
|
|
1706
|
+
return Kt = oe(
|
|
1707
|
+
Kt + Rt(Yi(e.number)),
|
|
1741
1708
|
-Math.PI,
|
|
1742
1709
|
Math.PI
|
|
1743
|
-
), [
|
|
1710
|
+
), [si(Kt), si(mn)];
|
|
1744
1711
|
}
|
|
1745
|
-
const
|
|
1712
|
+
const ci = -80, ui = 84, kr = -180, Hr = 180;
|
|
1746
1713
|
function Ur(n, t, e) {
|
|
1747
|
-
n = oe(n, kr, Hr), t <
|
|
1748
|
-
const i = Rt(t), r = Math.sin(i), s = Math.cos(i), o = r / s, a = o * o, l = a * a, h = Rt(n), c =
|
|
1749
|
-
let ct =
|
|
1750
|
-
return e.north || (ct += 1e7), [
|
|
1714
|
+
n = oe(n, kr, Hr), t < ci ? t = ci : t > ui && (t = ui);
|
|
1715
|
+
const i = Rt(t), r = Math.sin(i), s = Math.cos(i), o = r / s, a = o * o, l = a * a, h = Rt(n), c = Yi(e.number), u = Rt(c), d = Ht / Math.sqrt(1 - P * r ** 2), g = k * s ** 2, f = s * oe(h - u, -Math.PI, Math.PI), p = f * f, _ = p * f, b = _ * f, v = b * f, S = v * f, E = Ht * (Xi * i - Fr * Math.sin(2 * i) + Gr * Math.sin(4 * i) - Lr * Math.sin(6 * i)), I = kt * d * (f + _ / 6 * (1 - a + g) + v / 120 * (5 - 18 * a + l + 72 * g - 58 * k)) + 5e5;
|
|
1716
|
+
let ct = kt * (E + d * o * (p / 2 + b / 24 * (5 - a + 9 * g + 4 * g ** 2) + S / 720 * (61 - 58 * a + l + 600 * g - 330 * k)));
|
|
1717
|
+
return e.north || (ct += 1e7), [I, ct];
|
|
1751
1718
|
}
|
|
1752
|
-
function
|
|
1719
|
+
function Yi(n) {
|
|
1753
1720
|
return (n - 1) * 6 - 180 + 3;
|
|
1754
1721
|
}
|
|
1755
1722
|
const jr = [
|
|
@@ -1757,7 +1724,7 @@ const jr = [
|
|
|
1757
1724
|
/^urn:ogc:def:crs:EPSG::(\d+)$/,
|
|
1758
1725
|
/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/
|
|
1759
1726
|
];
|
|
1760
|
-
function
|
|
1727
|
+
function Bi(n) {
|
|
1761
1728
|
let t = 0;
|
|
1762
1729
|
for (const r of jr) {
|
|
1763
1730
|
const s = n.match(r);
|
|
@@ -1771,7 +1738,7 @@ function Vi(n) {
|
|
|
1771
1738
|
let e = 0, i = !1;
|
|
1772
1739
|
return t > 32700 && t < 32761 ? e = t - 32700 : t > 32600 && t < 32661 && (i = !0, e = t - 32600), e ? { number: e, north: i } : null;
|
|
1773
1740
|
}
|
|
1774
|
-
function
|
|
1741
|
+
function di(n, t) {
|
|
1775
1742
|
return function(e, i, r, s) {
|
|
1776
1743
|
const o = e.length;
|
|
1777
1744
|
r = r > 1 ? r : 2, s = s ?? r, i || (r > 2 ? i = e.slice() : i = new Array(o));
|
|
@@ -1783,17 +1750,17 @@ function ui(n, t) {
|
|
|
1783
1750
|
};
|
|
1784
1751
|
}
|
|
1785
1752
|
function Xr(n) {
|
|
1786
|
-
return
|
|
1753
|
+
return Bi(n) ? new be({ code: n, units: "m" }) : null;
|
|
1787
1754
|
}
|
|
1788
1755
|
function Yr(n) {
|
|
1789
|
-
const t =
|
|
1756
|
+
const t = Bi(n.getCode());
|
|
1790
1757
|
return t ? {
|
|
1791
|
-
forward:
|
|
1792
|
-
inverse:
|
|
1758
|
+
forward: di(Ur, t),
|
|
1759
|
+
inverse: di(Or, t)
|
|
1793
1760
|
} : null;
|
|
1794
1761
|
}
|
|
1795
1762
|
const Br = [Yr], Vr = [Xr];
|
|
1796
|
-
function
|
|
1763
|
+
function Pe(n, t) {
|
|
1797
1764
|
if (t !== void 0) {
|
|
1798
1765
|
for (let e = 0, i = n.length; e < i; ++e)
|
|
1799
1766
|
t[e] = n[e];
|
|
@@ -1802,11 +1769,11 @@ function xe(n, t) {
|
|
|
1802
1769
|
t = n.slice();
|
|
1803
1770
|
return t;
|
|
1804
1771
|
}
|
|
1805
|
-
function
|
|
1806
|
-
Ar(n.getCode(), n), _t(n, n,
|
|
1772
|
+
function le(n) {
|
|
1773
|
+
Ar(n.getCode(), n), _t(n, n, Pe);
|
|
1807
1774
|
}
|
|
1808
1775
|
function zr(n) {
|
|
1809
|
-
n.forEach(
|
|
1776
|
+
n.forEach(le);
|
|
1810
1777
|
}
|
|
1811
1778
|
function x(n) {
|
|
1812
1779
|
if (typeof n != "string")
|
|
@@ -1821,29 +1788,29 @@ function x(n) {
|
|
|
1821
1788
|
}
|
|
1822
1789
|
return null;
|
|
1823
1790
|
}
|
|
1824
|
-
function
|
|
1791
|
+
function gi(n) {
|
|
1825
1792
|
zr(n), n.forEach(function(t) {
|
|
1826
1793
|
n.forEach(function(e) {
|
|
1827
|
-
t !== e && _t(t, e,
|
|
1794
|
+
t !== e && _t(t, e, Pe);
|
|
1828
1795
|
});
|
|
1829
1796
|
});
|
|
1830
1797
|
}
|
|
1831
|
-
function
|
|
1798
|
+
function Jr(n, t, e, i) {
|
|
1832
1799
|
n.forEach(function(r) {
|
|
1833
1800
|
t.forEach(function(s) {
|
|
1834
1801
|
_t(r, s, e), _t(s, r, i);
|
|
1835
1802
|
});
|
|
1836
1803
|
});
|
|
1837
1804
|
}
|
|
1838
|
-
function
|
|
1805
|
+
function Wr(n, t) {
|
|
1839
1806
|
if (n === t)
|
|
1840
1807
|
return !0;
|
|
1841
1808
|
const e = n.getUnits() === t.getUnits();
|
|
1842
|
-
return (n.getCode() === t.getCode() ||
|
|
1809
|
+
return (n.getCode() === t.getCode() || Vi(n, t) === Pe) && e;
|
|
1843
1810
|
}
|
|
1844
|
-
function
|
|
1811
|
+
function Vi(n, t) {
|
|
1845
1812
|
const e = n.getCode(), i = t.getCode();
|
|
1846
|
-
let r =
|
|
1813
|
+
let r = ie(e, i);
|
|
1847
1814
|
if (r)
|
|
1848
1815
|
return r;
|
|
1849
1816
|
let s = null, o = null;
|
|
@@ -1854,45 +1821,53 @@ function zi(n, t) {
|
|
|
1854
1821
|
const a = "EPSG:4326";
|
|
1855
1822
|
if (o)
|
|
1856
1823
|
if (s)
|
|
1857
|
-
r =
|
|
1824
|
+
r = ne(
|
|
1858
1825
|
s.inverse,
|
|
1859
1826
|
o.forward
|
|
1860
1827
|
);
|
|
1861
1828
|
else {
|
|
1862
|
-
const l =
|
|
1863
|
-
l && (r =
|
|
1829
|
+
const l = ie(e, a);
|
|
1830
|
+
l && (r = ne(
|
|
1864
1831
|
l,
|
|
1865
1832
|
o.forward
|
|
1866
1833
|
));
|
|
1867
1834
|
}
|
|
1868
1835
|
else {
|
|
1869
|
-
const l =
|
|
1870
|
-
l && (r =
|
|
1836
|
+
const l = ie(a, i);
|
|
1837
|
+
l && (r = ne(
|
|
1871
1838
|
s.inverse,
|
|
1872
1839
|
l
|
|
1873
1840
|
));
|
|
1874
1841
|
}
|
|
1875
|
-
return r && (
|
|
1842
|
+
return r && (le(n), le(t), _t(n, t, r)), r;
|
|
1876
1843
|
}
|
|
1877
|
-
function
|
|
1844
|
+
function ne(n, t) {
|
|
1878
1845
|
return function(e, i, r, s) {
|
|
1879
1846
|
return i = n(e, i, r, s), t(i, i, r, s);
|
|
1880
1847
|
};
|
|
1881
1848
|
}
|
|
1882
|
-
function
|
|
1849
|
+
function he(n, t) {
|
|
1883
1850
|
const e = x(n), i = x(t);
|
|
1884
|
-
return
|
|
1851
|
+
return Vi(e, i);
|
|
1885
1852
|
}
|
|
1886
|
-
function
|
|
1887
|
-
|
|
1853
|
+
function qr() {
|
|
1854
|
+
gi(oi), gi(li), Jr(
|
|
1855
|
+
li,
|
|
1888
1856
|
oi,
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
xr
|
|
1857
|
+
xr,
|
|
1858
|
+
Pr
|
|
1892
1859
|
);
|
|
1893
1860
|
}
|
|
1894
|
-
|
|
1895
|
-
|
|
1861
|
+
qr();
|
|
1862
|
+
new Array(6);
|
|
1863
|
+
function zi() {
|
|
1864
|
+
return [1, 0, 0, 1, 0, 0];
|
|
1865
|
+
}
|
|
1866
|
+
function Ji(n, t, e, i, r, s, o, a) {
|
|
1867
|
+
const l = Math.sin(s), h = Math.cos(s);
|
|
1868
|
+
return n[0] = i * h, n[1] = r * l, n[2] = -i * l, n[3] = r * h, n[4] = o * i * h - a * i * l + t, n[5] = o * r * l + a * r * h + e, n;
|
|
1869
|
+
}
|
|
1870
|
+
function Wi(n, t, e, i, r, s, o) {
|
|
1896
1871
|
s = s || [], o = o || 2;
|
|
1897
1872
|
let a = 0;
|
|
1898
1873
|
for (let l = t; l < e; l += i) {
|
|
@@ -1903,7 +1878,7 @@ function Di(n, t, e, i, r, s, o) {
|
|
|
1903
1878
|
}
|
|
1904
1879
|
return s && s.length != a && (s.length = a), s;
|
|
1905
1880
|
}
|
|
1906
|
-
function
|
|
1881
|
+
function Zr(n, t, e, i, r, s, o) {
|
|
1907
1882
|
o = o || [];
|
|
1908
1883
|
const a = Math.cos(r), l = Math.sin(r), h = s[0], c = s[1];
|
|
1909
1884
|
let u = 0;
|
|
@@ -1915,7 +1890,7 @@ function qr(n, t, e, i, r, s, o) {
|
|
|
1915
1890
|
}
|
|
1916
1891
|
return o && o.length != u && (o.length = u), o;
|
|
1917
1892
|
}
|
|
1918
|
-
function
|
|
1893
|
+
function Kr(n, t, e, i, r, s, o, a) {
|
|
1919
1894
|
a = a || [];
|
|
1920
1895
|
const l = o[0], h = o[1];
|
|
1921
1896
|
let c = 0;
|
|
@@ -1927,7 +1902,7 @@ function Zr(n, t, e, i, r, s, o, a) {
|
|
|
1927
1902
|
}
|
|
1928
1903
|
return a && a.length != c && (a.length = c), a;
|
|
1929
1904
|
}
|
|
1930
|
-
function
|
|
1905
|
+
function Dr(n, t, e, i, r, s, o) {
|
|
1931
1906
|
o = o || [];
|
|
1932
1907
|
let a = 0;
|
|
1933
1908
|
for (let l = t; l < e; l += i) {
|
|
@@ -1937,10 +1912,10 @@ function Kr(n, t, e, i, r, s, o) {
|
|
|
1937
1912
|
}
|
|
1938
1913
|
return o && o.length != a && (o.length = a), o;
|
|
1939
1914
|
}
|
|
1940
|
-
const
|
|
1941
|
-
class
|
|
1915
|
+
const fi = zi(), Qr = [NaN, NaN];
|
|
1916
|
+
class qi extends Ti {
|
|
1942
1917
|
constructor() {
|
|
1943
|
-
super(), this.extent_ =
|
|
1918
|
+
super(), this.extent_ = _e(), this.extentRevision_ = -1, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0, this.simplifyTransformedInternal = Gi(
|
|
1944
1919
|
(t, e, i) => {
|
|
1945
1920
|
if (!i)
|
|
1946
1921
|
return this.getSimplifiedGeometry(e);
|
|
@@ -1988,8 +1963,7 @@ class Ji extends Li {
|
|
|
1988
1963
|
* @return {boolean} Contains (x, y).
|
|
1989
1964
|
*/
|
|
1990
1965
|
containsXY(t, e) {
|
|
1991
|
-
|
|
1992
|
-
return i[0] === t && i[1] === e;
|
|
1966
|
+
return this.closestPointXY(t, e, Qr, Number.MIN_VALUE) === 0;
|
|
1993
1967
|
}
|
|
1994
1968
|
/**
|
|
1995
1969
|
* Return the closest point of the geometry to the passed point as
|
|
@@ -2030,7 +2004,7 @@ class Ji extends Li {
|
|
|
2030
2004
|
getExtent(t) {
|
|
2031
2005
|
if (this.extentRevision_ != this.getRevision()) {
|
|
2032
2006
|
const e = this.computeExtent(this.extent_);
|
|
2033
|
-
(isNaN(e[0]) || isNaN(e[1])) &&
|
|
2007
|
+
(isNaN(e[0]) || isNaN(e[1])) && ve(e), this.extentRevision_ = this.getRevision();
|
|
2034
2008
|
}
|
|
2035
2009
|
return _r(this.extent_, t);
|
|
2036
2010
|
}
|
|
@@ -2138,9 +2112,9 @@ class Ji extends Li {
|
|
|
2138
2112
|
*/
|
|
2139
2113
|
transform(t, e) {
|
|
2140
2114
|
const i = x(t), r = i.getUnits() == "tile-pixels" ? function(s, o, a) {
|
|
2141
|
-
const l = i.getExtent(), h = i.getWorldExtent(), c =
|
|
2142
|
-
|
|
2143
|
-
|
|
2115
|
+
const l = i.getExtent(), h = i.getWorldExtent(), c = Ot(h) / Ot(l);
|
|
2116
|
+
Ji(
|
|
2117
|
+
fi,
|
|
2144
2118
|
h[0],
|
|
2145
2119
|
h[3],
|
|
2146
2120
|
c,
|
|
@@ -2149,20 +2123,20 @@ class Ji extends Li {
|
|
|
2149
2123
|
0,
|
|
2150
2124
|
0
|
|
2151
2125
|
);
|
|
2152
|
-
const u =
|
|
2126
|
+
const u = Wi(
|
|
2153
2127
|
s,
|
|
2154
2128
|
0,
|
|
2155
2129
|
s.length,
|
|
2156
2130
|
a,
|
|
2157
|
-
|
|
2131
|
+
fi,
|
|
2158
2132
|
o
|
|
2159
|
-
), d =
|
|
2133
|
+
), d = he(i, e);
|
|
2160
2134
|
return d ? d(u, u, a) : u;
|
|
2161
|
-
} :
|
|
2135
|
+
} : he(i, e);
|
|
2162
2136
|
return this.applyTransform(r), this;
|
|
2163
2137
|
}
|
|
2164
2138
|
}
|
|
2165
|
-
class
|
|
2139
|
+
class Z extends qi {
|
|
2166
2140
|
constructor() {
|
|
2167
2141
|
super(), this.layout = "XY", this.stride = 2, this.flatCoordinates;
|
|
2168
2142
|
}
|
|
@@ -2173,7 +2147,7 @@ class q extends Ji {
|
|
|
2173
2147
|
* @override
|
|
2174
2148
|
*/
|
|
2175
2149
|
computeExtent(t) {
|
|
2176
|
-
return
|
|
2150
|
+
return Ce(
|
|
2177
2151
|
this.flatCoordinates,
|
|
2178
2152
|
0,
|
|
2179
2153
|
this.flatCoordinates.length,
|
|
@@ -2251,7 +2225,7 @@ class q extends Ji {
|
|
|
2251
2225
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
|
2252
2226
|
*/
|
|
2253
2227
|
setFlatCoordinates(t, e) {
|
|
2254
|
-
this.stride =
|
|
2228
|
+
this.stride = pi(t), this.layout = t, this.flatCoordinates = e;
|
|
2255
2229
|
}
|
|
2256
2230
|
/**
|
|
2257
2231
|
* @abstract
|
|
@@ -2270,7 +2244,7 @@ class q extends Ji {
|
|
|
2270
2244
|
setLayout(t, e, i) {
|
|
2271
2245
|
let r;
|
|
2272
2246
|
if (t)
|
|
2273
|
-
r =
|
|
2247
|
+
r = pi(t);
|
|
2274
2248
|
else {
|
|
2275
2249
|
for (let s = 0; s < i; ++s) {
|
|
2276
2250
|
if (e.length === 0) {
|
|
@@ -2280,7 +2254,7 @@ class q extends Ji {
|
|
|
2280
2254
|
e = /** @type {Array<unknown>} */
|
|
2281
2255
|
e[0];
|
|
2282
2256
|
}
|
|
2283
|
-
r = e.length, t =
|
|
2257
|
+
r = e.length, t = K(r);
|
|
2284
2258
|
}
|
|
2285
2259
|
this.layout = t, this.stride = r;
|
|
2286
2260
|
}
|
|
@@ -2314,7 +2288,7 @@ class q extends Ji {
|
|
|
2314
2288
|
const i = this.getFlatCoordinates();
|
|
2315
2289
|
if (i) {
|
|
2316
2290
|
const r = this.getStride();
|
|
2317
|
-
|
|
2291
|
+
Zr(
|
|
2318
2292
|
i,
|
|
2319
2293
|
0,
|
|
2320
2294
|
i.length,
|
|
@@ -2336,11 +2310,11 @@ class q extends Ji {
|
|
|
2336
2310
|
* @override
|
|
2337
2311
|
*/
|
|
2338
2312
|
scale(t, e, i) {
|
|
2339
|
-
e === void 0 && (e = t), i || (i =
|
|
2313
|
+
e === void 0 && (e = t), i || (i = Bt(this.getExtent()));
|
|
2340
2314
|
const r = this.getFlatCoordinates();
|
|
2341
2315
|
if (r) {
|
|
2342
2316
|
const s = this.getStride();
|
|
2343
|
-
|
|
2317
|
+
Kr(
|
|
2344
2318
|
r,
|
|
2345
2319
|
0,
|
|
2346
2320
|
r.length,
|
|
@@ -2364,7 +2338,7 @@ class q extends Ji {
|
|
|
2364
2338
|
const i = this.getFlatCoordinates();
|
|
2365
2339
|
if (i) {
|
|
2366
2340
|
const r = this.getStride();
|
|
2367
|
-
|
|
2341
|
+
Dr(
|
|
2368
2342
|
i,
|
|
2369
2343
|
0,
|
|
2370
2344
|
i.length,
|
|
@@ -2376,22 +2350,22 @@ class q extends Ji {
|
|
|
2376
2350
|
}
|
|
2377
2351
|
}
|
|
2378
2352
|
}
|
|
2379
|
-
function
|
|
2353
|
+
function K(n) {
|
|
2380
2354
|
let t;
|
|
2381
2355
|
return n == 2 ? t = "XY" : n == 3 ? t = "XYZ" : n == 4 && (t = "XYZM"), /** @type {import("./Geometry.js").GeometryLayout} */
|
|
2382
2356
|
t;
|
|
2383
2357
|
}
|
|
2384
|
-
function
|
|
2358
|
+
function pi(n) {
|
|
2385
2359
|
let t;
|
|
2386
2360
|
return n == "XY" ? t = 2 : n == "XYZ" || n == "XYM" ? t = 3 : n == "XYZM" && (t = 4), /** @type {number} */
|
|
2387
2361
|
t;
|
|
2388
2362
|
}
|
|
2389
|
-
function
|
|
2363
|
+
function ts(n, t, e, i) {
|
|
2390
2364
|
for (let r = 0, s = e.length; r < s; ++r)
|
|
2391
2365
|
n[t++] = e[r];
|
|
2392
2366
|
return t;
|
|
2393
2367
|
}
|
|
2394
|
-
function
|
|
2368
|
+
function Jt(n, t, e, i) {
|
|
2395
2369
|
for (let r = 0, s = e.length; r < s; ++r) {
|
|
2396
2370
|
const o = e[r];
|
|
2397
2371
|
for (let a = 0; a < i; ++a)
|
|
@@ -2403,7 +2377,7 @@ function $t(n, t, e, i, r) {
|
|
|
2403
2377
|
r = r || [];
|
|
2404
2378
|
let s = 0;
|
|
2405
2379
|
for (let o = 0, a = e.length; o < a; ++o) {
|
|
2406
|
-
const l =
|
|
2380
|
+
const l = Jt(
|
|
2407
2381
|
n,
|
|
2408
2382
|
t,
|
|
2409
2383
|
e[o],
|
|
@@ -2413,7 +2387,7 @@ function $t(n, t, e, i, r) {
|
|
|
2413
2387
|
}
|
|
2414
2388
|
return r.length = s, r;
|
|
2415
2389
|
}
|
|
2416
|
-
function
|
|
2390
|
+
function Zi(n, t, e, i, r) {
|
|
2417
2391
|
r = r || [];
|
|
2418
2392
|
let s = 0;
|
|
2419
2393
|
for (let o = 0, a = e.length; o < a; ++o) {
|
|
@@ -2428,95 +2402,454 @@ function Wi(n, t, e, i, r) {
|
|
|
2428
2402
|
}
|
|
2429
2403
|
return r.length = s, r;
|
|
2430
2404
|
}
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
this.changeEventsKeys_.forEach(It), this.changeEventsKeys_.length = 0;
|
|
2443
|
-
}
|
|
2444
|
-
/**
|
|
2445
|
-
* @private
|
|
2446
|
-
*/
|
|
2447
|
-
listenGeometriesChange_() {
|
|
2448
|
-
const t = this.geometries_;
|
|
2449
|
-
for (let e = 0, i = t.length; e < i; ++e)
|
|
2450
|
-
this.changeEventsKeys_.push(
|
|
2451
|
-
mt(t[e], ye.CHANGE, this.changed, this)
|
|
2452
|
-
);
|
|
2453
|
-
}
|
|
2454
|
-
/**
|
|
2455
|
-
* Make a complete copy of the geometry.
|
|
2456
|
-
* @return {!GeometryCollection} Clone.
|
|
2457
|
-
* @api
|
|
2458
|
-
* @override
|
|
2459
|
-
*/
|
|
2460
|
-
clone() {
|
|
2461
|
-
const t = new B(
|
|
2462
|
-
ne(this.geometries_)
|
|
2463
|
-
);
|
|
2464
|
-
return t.applyProperties(this), t;
|
|
2405
|
+
function Ki(n, t, e, i) {
|
|
2406
|
+
const r = [];
|
|
2407
|
+
let s = _e();
|
|
2408
|
+
for (let o = 0, a = e.length; o < a; ++o) {
|
|
2409
|
+
const l = e[o];
|
|
2410
|
+
s = Ce(
|
|
2411
|
+
n,
|
|
2412
|
+
t,
|
|
2413
|
+
l[0],
|
|
2414
|
+
i
|
|
2415
|
+
), r.push((s[0] + s[2]) / 2, (s[1] + s[3]) / 2), t = l[l.length - 1];
|
|
2465
2416
|
}
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
return
|
|
2477
|
-
|
|
2478
|
-
for (let o = 0, a = s.length; o < a; ++o)
|
|
2479
|
-
r = s[o].closestPointXY(
|
|
2417
|
+
return r;
|
|
2418
|
+
}
|
|
2419
|
+
function es(n, t, e, i, r) {
|
|
2420
|
+
return !dr(
|
|
2421
|
+
r,
|
|
2422
|
+
/**
|
|
2423
|
+
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
|
2424
|
+
* @return {boolean} Contains (x, y).
|
|
2425
|
+
*/
|
|
2426
|
+
function(o) {
|
|
2427
|
+
return !H(
|
|
2428
|
+
n,
|
|
2480
2429
|
t,
|
|
2481
2430
|
e,
|
|
2482
2431
|
i,
|
|
2483
|
-
|
|
2432
|
+
o[0],
|
|
2433
|
+
o[1]
|
|
2484
2434
|
);
|
|
2485
|
-
|
|
2435
|
+
}
|
|
2436
|
+
);
|
|
2437
|
+
}
|
|
2438
|
+
function H(n, t, e, i, r, s) {
|
|
2439
|
+
let o = 0, a = n[e - i], l = n[e - i + 1];
|
|
2440
|
+
for (; t < e; t += i) {
|
|
2441
|
+
const h = n[t], c = n[t + 1];
|
|
2442
|
+
l <= s ? c > s && (h - a) * (s - l) - (r - a) * (c - l) > 0 && o++ : c <= s && (h - a) * (s - l) - (r - a) * (c - l) < 0 && o--, a = h, l = c;
|
|
2486
2443
|
}
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
* @override
|
|
2492
|
-
*/
|
|
2493
|
-
containsXY(t, e) {
|
|
2494
|
-
const i = this.geometries_;
|
|
2495
|
-
for (let r = 0, s = i.length; r < s; ++r)
|
|
2496
|
-
if (i[r].containsXY(t, e))
|
|
2497
|
-
return !0;
|
|
2444
|
+
return o !== 0;
|
|
2445
|
+
}
|
|
2446
|
+
function Me(n, t, e, i, r, s) {
|
|
2447
|
+
if (e.length === 0 || !H(n, t, e[0], i, r, s))
|
|
2498
2448
|
return !1;
|
|
2449
|
+
for (let o = 1, a = e.length; o < a; ++o)
|
|
2450
|
+
if (H(n, e[o - 1], e[o], i, r, s))
|
|
2451
|
+
return !1;
|
|
2452
|
+
return !0;
|
|
2453
|
+
}
|
|
2454
|
+
function is(n, t, e, i, r, s) {
|
|
2455
|
+
if (e.length === 0)
|
|
2456
|
+
return !1;
|
|
2457
|
+
for (let o = 0, a = e.length; o < a; ++o) {
|
|
2458
|
+
const l = e[o];
|
|
2459
|
+
if (Me(n, t, l, i, r, s))
|
|
2460
|
+
return !0;
|
|
2461
|
+
t = l[l.length - 1];
|
|
2499
2462
|
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2463
|
+
return !1;
|
|
2464
|
+
}
|
|
2465
|
+
function Se(n, t, e, i, r, s, o) {
|
|
2466
|
+
let a, l, h, c, u, d, g;
|
|
2467
|
+
const f = r[s + 1], p = [];
|
|
2468
|
+
for (let v = 0, S = e.length; v < S; ++v) {
|
|
2469
|
+
const E = e[v];
|
|
2470
|
+
for (c = n[E - i], d = n[E - i + 1], a = t; a < E; a += i)
|
|
2471
|
+
u = n[a], g = n[a + 1], (f <= d && g <= f || d <= f && f <= g) && (h = (f - d) / (g - d) * (u - c) + c, p.push(h)), c = u, d = g;
|
|
2472
|
+
}
|
|
2473
|
+
let _ = NaN, b = -1 / 0;
|
|
2474
|
+
for (p.sort(Fi), c = p[0], a = 1, l = p.length; a < l; ++a) {
|
|
2475
|
+
u = p[a];
|
|
2476
|
+
const v = Math.abs(u - c);
|
|
2477
|
+
v > b && (h = (c + u) / 2, Me(n, t, e, i, h, f) && (_ = h, b = v)), c = u;
|
|
2478
|
+
}
|
|
2479
|
+
return isNaN(_) && (_ = r[s]), o ? (o.push(_, f, b), o) : [_, f, b];
|
|
2480
|
+
}
|
|
2481
|
+
function Di(n, t, e, i, r) {
|
|
2482
|
+
let s = [];
|
|
2483
|
+
for (let o = 0, a = e.length; o < a; ++o) {
|
|
2484
|
+
const l = e[o];
|
|
2485
|
+
s = Se(
|
|
2486
|
+
n,
|
|
2487
|
+
t,
|
|
2488
|
+
l,
|
|
2489
|
+
i,
|
|
2490
|
+
r,
|
|
2491
|
+
2 * o,
|
|
2492
|
+
s
|
|
2493
|
+
), t = l[l.length - 1];
|
|
2494
|
+
}
|
|
2495
|
+
return s;
|
|
2496
|
+
}
|
|
2497
|
+
function Ut(n, t, e, i, r, s, o) {
|
|
2498
|
+
let a, l;
|
|
2499
|
+
const h = (e - t) / i;
|
|
2500
|
+
if (h === 1)
|
|
2501
|
+
a = t;
|
|
2502
|
+
else if (h === 2)
|
|
2503
|
+
a = t, l = r;
|
|
2504
|
+
else if (h !== 0) {
|
|
2505
|
+
let c = n[t], u = n[t + 1], d = 0;
|
|
2506
|
+
const g = [0];
|
|
2507
|
+
for (let _ = t + i; _ < e; _ += i) {
|
|
2508
|
+
const b = n[_], v = n[_ + 1];
|
|
2509
|
+
d += Math.sqrt((b - c) * (b - c) + (v - u) * (v - u)), g.push(d), c = b, u = v;
|
|
2510
|
+
}
|
|
2511
|
+
const f = r * d, p = ir(g, f);
|
|
2512
|
+
p < 0 ? (l = (f - g[-p - 2]) / (g[-p - 1] - g[-p - 2]), a = t + (-p - 2) * i) : a = t + p * i;
|
|
2513
|
+
}
|
|
2514
|
+
o = o > 1 ? o : 2, s = s || new Array(o);
|
|
2515
|
+
for (let c = 0; c < o; ++c)
|
|
2516
|
+
s[c] = a === void 0 ? NaN : l === void 0 ? n[a + c] : we(n[a + c], n[a + i + c], l);
|
|
2517
|
+
return s;
|
|
2518
|
+
}
|
|
2519
|
+
function ce(n, t, e, i, r, s) {
|
|
2520
|
+
if (e == t)
|
|
2521
|
+
return null;
|
|
2522
|
+
let o;
|
|
2523
|
+
if (r < n[t + i - 1])
|
|
2524
|
+
return s ? (o = n.slice(t, t + i), o[i - 1] = r, o) : null;
|
|
2525
|
+
if (n[e - 1] < r)
|
|
2526
|
+
return s ? (o = n.slice(e - i, e), o[i - 1] = r, o) : null;
|
|
2527
|
+
if (r == n[t + i - 1])
|
|
2528
|
+
return n.slice(t, t + i);
|
|
2529
|
+
let a = t / i, l = e / i;
|
|
2530
|
+
for (; a < l; ) {
|
|
2531
|
+
const d = a + l >> 1;
|
|
2532
|
+
r < n[(d + 1) * i - 1] ? l = d : a = d + 1;
|
|
2533
|
+
}
|
|
2534
|
+
const h = n[a * i - 1];
|
|
2535
|
+
if (r == h)
|
|
2536
|
+
return n.slice((a - 1) * i, (a - 1) * i + i);
|
|
2537
|
+
const c = n[(a + 1) * i - 1], u = (r - h) / (c - h);
|
|
2538
|
+
o = [];
|
|
2539
|
+
for (let d = 0; d < i - 1; ++d)
|
|
2540
|
+
o.push(
|
|
2541
|
+
we(
|
|
2542
|
+
n[(a - 1) * i + d],
|
|
2543
|
+
n[a * i + d],
|
|
2544
|
+
u
|
|
2545
|
+
)
|
|
2546
|
+
);
|
|
2547
|
+
return o.push(r), o;
|
|
2548
|
+
}
|
|
2549
|
+
function ns(n, t, e, i, r, s, o) {
|
|
2550
|
+
if (o)
|
|
2551
|
+
return ce(
|
|
2552
|
+
n,
|
|
2553
|
+
t,
|
|
2554
|
+
e[e.length - 1],
|
|
2555
|
+
i,
|
|
2556
|
+
r,
|
|
2557
|
+
s
|
|
2558
|
+
);
|
|
2559
|
+
let a;
|
|
2560
|
+
if (r < n[i - 1])
|
|
2561
|
+
return s ? (a = n.slice(0, i), a[i - 1] = r, a) : null;
|
|
2562
|
+
if (n[n.length - 1] < r)
|
|
2563
|
+
return s ? (a = n.slice(n.length - i), a[i - 1] = r, a) : null;
|
|
2564
|
+
for (let l = 0, h = e.length; l < h; ++l) {
|
|
2565
|
+
const c = e[l];
|
|
2566
|
+
if (t != c) {
|
|
2567
|
+
if (r < n[t + i - 1])
|
|
2568
|
+
return null;
|
|
2569
|
+
if (r <= n[c - 1])
|
|
2570
|
+
return ce(
|
|
2571
|
+
n,
|
|
2572
|
+
t,
|
|
2573
|
+
c,
|
|
2574
|
+
i,
|
|
2575
|
+
r,
|
|
2576
|
+
!1
|
|
2577
|
+
);
|
|
2578
|
+
t = c;
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
return null;
|
|
2582
|
+
}
|
|
2583
|
+
function rs(n, t, e, i) {
|
|
2584
|
+
for (; t < e - i; ) {
|
|
2585
|
+
for (let r = 0; r < i; ++r) {
|
|
2586
|
+
const s = n[t + r];
|
|
2587
|
+
n[t + r] = n[e - i + r], n[e - i + r] = s;
|
|
2588
|
+
}
|
|
2589
|
+
t += i, e -= i;
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
function $e(n, t, e, i) {
|
|
2593
|
+
let r = 0, s = n[e - i], o = n[e - i + 1];
|
|
2594
|
+
for (; t < e; t += i) {
|
|
2595
|
+
const a = n[t], l = n[t + 1];
|
|
2596
|
+
r += (a - s) * (l + o), s = a, o = l;
|
|
2597
|
+
}
|
|
2598
|
+
return r === 0 ? void 0 : r > 0;
|
|
2599
|
+
}
|
|
2600
|
+
function Ae(n, t, e, i, r) {
|
|
2601
|
+
r = r !== void 0 ? r : !1;
|
|
2602
|
+
for (let s = 0, o = e.length; s < o; ++s) {
|
|
2603
|
+
const a = e[s], l = $e(
|
|
2604
|
+
n,
|
|
2605
|
+
t,
|
|
2606
|
+
a,
|
|
2607
|
+
i
|
|
2608
|
+
);
|
|
2609
|
+
if (s === 0) {
|
|
2610
|
+
if (r && l || !r && !l)
|
|
2611
|
+
return !1;
|
|
2612
|
+
} else if (r && !l || !r && l)
|
|
2613
|
+
return !1;
|
|
2614
|
+
t = a;
|
|
2615
|
+
}
|
|
2616
|
+
return !0;
|
|
2617
|
+
}
|
|
2618
|
+
function Qi(n, t, e, i, r) {
|
|
2619
|
+
for (let s = 0, o = e.length; s < o; ++s) {
|
|
2620
|
+
const a = e[s];
|
|
2621
|
+
if (!Ae(n, t, a, i, r))
|
|
2622
|
+
return !1;
|
|
2623
|
+
a.length && (t = a[a.length - 1]);
|
|
2624
|
+
}
|
|
2625
|
+
return !0;
|
|
2626
|
+
}
|
|
2627
|
+
function jt(n, t, e, i, r) {
|
|
2628
|
+
r = r !== void 0 ? r : !1;
|
|
2629
|
+
for (let s = 0, o = e.length; s < o; ++s) {
|
|
2630
|
+
const a = e[s], l = $e(
|
|
2631
|
+
n,
|
|
2632
|
+
t,
|
|
2633
|
+
a,
|
|
2634
|
+
i
|
|
2635
|
+
);
|
|
2636
|
+
(s === 0 ? r && l || !r && !l : r && !l || !r && l) && rs(n, t, a, i), t = a;
|
|
2637
|
+
}
|
|
2638
|
+
return t;
|
|
2639
|
+
}
|
|
2640
|
+
function ue(n, t, e, i, r) {
|
|
2641
|
+
for (let s = 0, o = e.length; s < o; ++s)
|
|
2642
|
+
t = jt(
|
|
2643
|
+
n,
|
|
2644
|
+
t,
|
|
2645
|
+
e[s],
|
|
2646
|
+
i,
|
|
2647
|
+
r
|
|
2648
|
+
);
|
|
2649
|
+
return t;
|
|
2650
|
+
}
|
|
2651
|
+
function ss(n, t) {
|
|
2652
|
+
const e = [];
|
|
2653
|
+
let i = 0, r = 0, s;
|
|
2654
|
+
for (let o = 0, a = t.length; o < a; ++o) {
|
|
2655
|
+
const l = t[o], h = $e(n, i, l, 2);
|
|
2656
|
+
if (s === void 0 && (s = h), h === s)
|
|
2657
|
+
e.push(t.slice(r, o + 1));
|
|
2658
|
+
else {
|
|
2659
|
+
if (e.length === 0)
|
|
2660
|
+
continue;
|
|
2661
|
+
e[e.length - 1].push(t[r]);
|
|
2662
|
+
}
|
|
2663
|
+
r = o + 1, i = l;
|
|
2664
|
+
}
|
|
2665
|
+
return e;
|
|
2666
|
+
}
|
|
2667
|
+
function Wt(n, t, e, i, r, s, o) {
|
|
2668
|
+
const a = (e - t) / i;
|
|
2669
|
+
if (a < 3) {
|
|
2670
|
+
for (; t < e; t += i)
|
|
2671
|
+
s[o++] = n[t], s[o++] = n[t + 1];
|
|
2672
|
+
return o;
|
|
2673
|
+
}
|
|
2674
|
+
const l = new Array(a);
|
|
2675
|
+
l[0] = 1, l[a - 1] = 1;
|
|
2676
|
+
const h = [t, e - i];
|
|
2677
|
+
let c = 0;
|
|
2678
|
+
for (; h.length > 0; ) {
|
|
2679
|
+
const u = h.pop(), d = h.pop();
|
|
2680
|
+
let g = 0;
|
|
2681
|
+
const f = n[d], p = n[d + 1], _ = n[u], b = n[u + 1];
|
|
2682
|
+
for (let v = d + i; v < u; v += i) {
|
|
2683
|
+
const S = n[v], E = n[v + 1], I = Cr(S, E, f, p, _, b);
|
|
2684
|
+
I > g && (c = v, g = I);
|
|
2685
|
+
}
|
|
2686
|
+
g > r && (l[(c - t) / i] = 1, d + i < c && h.push(d, c), c + i < u && h.push(c, u));
|
|
2687
|
+
}
|
|
2688
|
+
for (let u = 0; u < a; ++u)
|
|
2689
|
+
l[u] && (s[o++] = n[t + u * i], s[o++] = n[t + u * i + 1]);
|
|
2690
|
+
return o;
|
|
2691
|
+
}
|
|
2692
|
+
function tn(n, t, e, i, r, s, o, a) {
|
|
2693
|
+
for (let l = 0, h = e.length; l < h; ++l) {
|
|
2694
|
+
const c = e[l];
|
|
2695
|
+
o = Wt(
|
|
2696
|
+
n,
|
|
2697
|
+
t,
|
|
2698
|
+
c,
|
|
2699
|
+
i,
|
|
2700
|
+
r,
|
|
2701
|
+
s,
|
|
2702
|
+
o
|
|
2703
|
+
), a.push(o), t = c;
|
|
2704
|
+
}
|
|
2705
|
+
return o;
|
|
2706
|
+
}
|
|
2707
|
+
function Q(n, t) {
|
|
2708
|
+
return t * Math.round(n / t);
|
|
2709
|
+
}
|
|
2710
|
+
function os(n, t, e, i, r, s, o) {
|
|
2711
|
+
if (t == e)
|
|
2712
|
+
return o;
|
|
2713
|
+
let a = Q(n[t], r), l = Q(n[t + 1], r);
|
|
2714
|
+
t += i, s[o++] = a, s[o++] = l;
|
|
2715
|
+
let h, c;
|
|
2716
|
+
do
|
|
2717
|
+
if (h = Q(n[t], r), c = Q(n[t + 1], r), t += i, t == e)
|
|
2718
|
+
return s[o++] = h, s[o++] = c, o;
|
|
2719
|
+
while (h == a && c == l);
|
|
2720
|
+
for (; t < e; ) {
|
|
2721
|
+
const u = Q(n[t], r), d = Q(n[t + 1], r);
|
|
2722
|
+
if (t += i, u == h && d == c)
|
|
2723
|
+
continue;
|
|
2724
|
+
const g = h - a, f = c - l, p = u - a, _ = d - l;
|
|
2725
|
+
if (g * _ == f * p && (g < 0 && p < g || g == p || g > 0 && p > g) && (f < 0 && _ < f || f == _ || f > 0 && _ > f)) {
|
|
2726
|
+
h = u, c = d;
|
|
2727
|
+
continue;
|
|
2728
|
+
}
|
|
2729
|
+
s[o++] = h, s[o++] = c, a = h, l = c, h = u, c = d;
|
|
2730
|
+
}
|
|
2731
|
+
return s[o++] = h, s[o++] = c, o;
|
|
2732
|
+
}
|
|
2733
|
+
function Fe(n, t, e, i, r, s, o, a) {
|
|
2734
|
+
for (let l = 0, h = e.length; l < h; ++l) {
|
|
2735
|
+
const c = e[l];
|
|
2736
|
+
o = os(
|
|
2737
|
+
n,
|
|
2738
|
+
t,
|
|
2739
|
+
c,
|
|
2740
|
+
i,
|
|
2741
|
+
r,
|
|
2742
|
+
s,
|
|
2743
|
+
o
|
|
2744
|
+
), a.push(o), t = c;
|
|
2745
|
+
}
|
|
2746
|
+
return o;
|
|
2747
|
+
}
|
|
2748
|
+
function as(n, t, e, i, r, s, o, a) {
|
|
2749
|
+
for (let l = 0, h = e.length; l < h; ++l) {
|
|
2750
|
+
const c = e[l], u = [];
|
|
2751
|
+
o = Fe(
|
|
2752
|
+
n,
|
|
2753
|
+
t,
|
|
2754
|
+
c,
|
|
2755
|
+
i,
|
|
2756
|
+
r,
|
|
2757
|
+
s,
|
|
2758
|
+
o,
|
|
2759
|
+
u
|
|
2760
|
+
), a.push(u), t = c[c.length - 1];
|
|
2761
|
+
}
|
|
2762
|
+
return o;
|
|
2763
|
+
}
|
|
2764
|
+
class B extends qi {
|
|
2765
|
+
/**
|
|
2766
|
+
* @param {Array<Geometry>} geometries Geometries.
|
|
2767
|
+
*/
|
|
2768
|
+
constructor(t) {
|
|
2769
|
+
super(), this.geometries_ = t, this.changeEventsKeys_ = [], this.listenGeometriesChange_();
|
|
2770
|
+
}
|
|
2771
|
+
/**
|
|
2772
|
+
* @private
|
|
2773
|
+
*/
|
|
2774
|
+
unlistenGeometriesChange_() {
|
|
2775
|
+
this.changeEventsKeys_.forEach(Nt), this.changeEventsKeys_.length = 0;
|
|
2776
|
+
}
|
|
2777
|
+
/**
|
|
2778
|
+
* @private
|
|
2779
|
+
*/
|
|
2780
|
+
listenGeometriesChange_() {
|
|
2781
|
+
const t = this.geometries_;
|
|
2782
|
+
for (let e = 0, i = t.length; e < i; ++e)
|
|
2783
|
+
this.changeEventsKeys_.push(
|
|
2784
|
+
mt(t[e], me.CHANGE, this.changed, this)
|
|
2785
|
+
);
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Make a complete copy of the geometry.
|
|
2789
|
+
* @return {!GeometryCollection} Clone.
|
|
2790
|
+
* @api
|
|
2791
|
+
* @override
|
|
2792
|
+
*/
|
|
2793
|
+
clone() {
|
|
2794
|
+
const t = new B(
|
|
2795
|
+
re(this.geometries_)
|
|
2796
|
+
);
|
|
2797
|
+
return t.applyProperties(this), t;
|
|
2798
|
+
}
|
|
2799
|
+
/**
|
|
2800
|
+
* @param {number} x X.
|
|
2801
|
+
* @param {number} y Y.
|
|
2802
|
+
* @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
|
|
2803
|
+
* @param {number} minSquaredDistance Minimum squared distance.
|
|
2804
|
+
* @return {number} Minimum squared distance.
|
|
2805
|
+
* @override
|
|
2806
|
+
*/
|
|
2807
|
+
closestPointXY(t, e, i, r) {
|
|
2808
|
+
if (r < q(this.getExtent(), t, e))
|
|
2809
|
+
return r;
|
|
2810
|
+
const s = this.geometries_;
|
|
2811
|
+
for (let o = 0, a = s.length; o < a; ++o)
|
|
2812
|
+
r = s[o].closestPointXY(
|
|
2813
|
+
t,
|
|
2814
|
+
e,
|
|
2815
|
+
i,
|
|
2816
|
+
r
|
|
2817
|
+
);
|
|
2818
|
+
return r;
|
|
2819
|
+
}
|
|
2820
|
+
/**
|
|
2821
|
+
* @param {number} x X.
|
|
2822
|
+
* @param {number} y Y.
|
|
2823
|
+
* @return {boolean} Contains (x, y).
|
|
2824
|
+
* @override
|
|
2825
|
+
*/
|
|
2826
|
+
containsXY(t, e) {
|
|
2827
|
+
const i = this.geometries_;
|
|
2828
|
+
for (let r = 0, s = i.length; r < s; ++r)
|
|
2829
|
+
if (i[r].containsXY(t, e))
|
|
2830
|
+
return !0;
|
|
2831
|
+
return !1;
|
|
2832
|
+
}
|
|
2833
|
+
/**
|
|
2834
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
2835
|
+
* @protected
|
|
2836
|
+
* @return {import("../extent.js").Extent} extent Extent.
|
|
2837
|
+
* @override
|
|
2838
|
+
*/
|
|
2839
|
+
computeExtent(t) {
|
|
2840
|
+
ve(t);
|
|
2841
|
+
const e = this.geometries_;
|
|
2842
|
+
for (let i = 0, r = e.length; i < r; ++i)
|
|
2843
|
+
cr(t, e[i].getExtent());
|
|
2844
|
+
return t;
|
|
2845
|
+
}
|
|
2846
|
+
/**
|
|
2847
|
+
* Return the geometries that make up this geometry collection.
|
|
2848
|
+
* @return {Array<Geometry>} Geometries.
|
|
2849
|
+
* @api
|
|
2850
|
+
*/
|
|
2851
|
+
getGeometries() {
|
|
2852
|
+
return re(this.geometries_);
|
|
2520
2853
|
}
|
|
2521
2854
|
/**
|
|
2522
2855
|
* @return {Array<Geometry>} Geometries.
|
|
@@ -2611,7 +2944,7 @@ class B extends Ji {
|
|
|
2611
2944
|
* @override
|
|
2612
2945
|
*/
|
|
2613
2946
|
scale(t, e, i) {
|
|
2614
|
-
i || (i =
|
|
2947
|
+
i || (i = Bt(this.getExtent()));
|
|
2615
2948
|
const r = this.geometries_;
|
|
2616
2949
|
for (let s = 0, o = r.length; s < o; ++s)
|
|
2617
2950
|
r[s].scale(t, e, i);
|
|
@@ -2623,7 +2956,7 @@ class B extends Ji {
|
|
|
2623
2956
|
* @api
|
|
2624
2957
|
*/
|
|
2625
2958
|
setGeometries(t) {
|
|
2626
|
-
this.setGeometriesArray(
|
|
2959
|
+
this.setGeometriesArray(re(t));
|
|
2627
2960
|
}
|
|
2628
2961
|
/**
|
|
2629
2962
|
* @param {Array<Geometry>} geometries Geometries.
|
|
@@ -2669,10 +3002,36 @@ class B extends Ji {
|
|
|
2669
3002
|
this.unlistenGeometriesChange_(), super.disposeInternal();
|
|
2670
3003
|
}
|
|
2671
3004
|
}
|
|
2672
|
-
function
|
|
3005
|
+
function re(n) {
|
|
2673
3006
|
return n.map((t) => t.clone());
|
|
2674
3007
|
}
|
|
2675
|
-
function
|
|
3008
|
+
function en(n, t, e, i) {
|
|
3009
|
+
let r = 0;
|
|
3010
|
+
const s = n[e - i], o = n[e - i + 1];
|
|
3011
|
+
let a = 0, l = 0;
|
|
3012
|
+
for (; t < e; t += i) {
|
|
3013
|
+
const h = n[t] - s, c = n[t + 1] - o;
|
|
3014
|
+
r += l * h - a * c, a = h, l = c;
|
|
3015
|
+
}
|
|
3016
|
+
return r / 2;
|
|
3017
|
+
}
|
|
3018
|
+
function nn(n, t, e, i) {
|
|
3019
|
+
let r = 0;
|
|
3020
|
+
for (let s = 0, o = e.length; s < o; ++s) {
|
|
3021
|
+
const a = e[s];
|
|
3022
|
+
r += en(n, t, a, i), t = a;
|
|
3023
|
+
}
|
|
3024
|
+
return r;
|
|
3025
|
+
}
|
|
3026
|
+
function ls(n, t, e, i) {
|
|
3027
|
+
let r = 0;
|
|
3028
|
+
for (let s = 0, o = e.length; s < o; ++s) {
|
|
3029
|
+
const a = e[s];
|
|
3030
|
+
r += nn(n, t, a, i), t = a[a.length - 1];
|
|
3031
|
+
}
|
|
3032
|
+
return r;
|
|
3033
|
+
}
|
|
3034
|
+
function yi(n, t, e, i, r, s, o) {
|
|
2676
3035
|
const a = n[t], l = n[t + 1], h = n[e] - a, c = n[e + 1] - l;
|
|
2677
3036
|
let u;
|
|
2678
3037
|
if (h === 0 && c === 0)
|
|
@@ -2697,7 +3056,7 @@ function pi(n, t, e, i, r, s, o) {
|
|
|
2697
3056
|
o[d] = n[u + d];
|
|
2698
3057
|
o.length = i;
|
|
2699
3058
|
}
|
|
2700
|
-
function
|
|
3059
|
+
function Ge(n, t, e, i, r) {
|
|
2701
3060
|
let s = n[t], o = n[t + 1];
|
|
2702
3061
|
for (t += i; t < e; t += i) {
|
|
2703
3062
|
const a = n[t], l = n[t + 1], h = X(s, o, a, l);
|
|
@@ -2705,222 +3064,125 @@ function Pe(n, t, e, i, r) {
|
|
|
2705
3064
|
}
|
|
2706
3065
|
return r;
|
|
2707
3066
|
}
|
|
2708
|
-
function
|
|
3067
|
+
function Le(n, t, e, i, r) {
|
|
2709
3068
|
for (let s = 0, o = e.length; s < o; ++s) {
|
|
2710
3069
|
const a = e[s];
|
|
2711
|
-
r =
|
|
3070
|
+
r = Ge(n, t, a, i, r), t = a;
|
|
2712
3071
|
}
|
|
2713
3072
|
return r;
|
|
2714
3073
|
}
|
|
2715
|
-
function
|
|
3074
|
+
function hs(n, t, e, i, r) {
|
|
2716
3075
|
for (let s = 0, o = e.length; s < o; ++s) {
|
|
2717
3076
|
const a = e[s];
|
|
2718
|
-
r =
|
|
3077
|
+
r = Le(n, t, a, i, r), t = a[a.length - 1];
|
|
2719
3078
|
}
|
|
2720
3079
|
return r;
|
|
2721
3080
|
}
|
|
2722
|
-
function
|
|
3081
|
+
function Ie(n, t, e, i, r, s, o, a, l, h, c) {
|
|
2723
3082
|
if (t == e)
|
|
2724
3083
|
return h;
|
|
2725
3084
|
let u, d;
|
|
2726
3085
|
if (r === 0) {
|
|
2727
3086
|
if (d = X(
|
|
2728
3087
|
o,
|
|
2729
|
-
a,
|
|
2730
|
-
n[t],
|
|
2731
|
-
n[t + 1]
|
|
2732
|
-
), d < h) {
|
|
2733
|
-
for (u = 0; u < i; ++u)
|
|
2734
|
-
l[u] = n[t + u];
|
|
2735
|
-
return l.length = i, d;
|
|
2736
|
-
}
|
|
2737
|
-
return h;
|
|
2738
|
-
}
|
|
2739
|
-
c = c || [NaN, NaN];
|
|
2740
|
-
let g = t + i;
|
|
2741
|
-
for (; g < e; )
|
|
2742
|
-
if (pi(
|
|
2743
|
-
n,
|
|
2744
|
-
g - i,
|
|
2745
|
-
g,
|
|
2746
|
-
i,
|
|
2747
|
-
o,
|
|
2748
|
-
a,
|
|
2749
|
-
c
|
|
2750
|
-
), d = X(o, a, c[0], c[1]), d < h) {
|
|
2751
|
-
for (h = d, u = 0; u < i; ++u)
|
|
2752
|
-
l[u] = c[u];
|
|
2753
|
-
l.length = i, g += i;
|
|
2754
|
-
} else
|
|
2755
|
-
g += i * Math.max(
|
|
2756
|
-
(Math.sqrt(d) - Math.sqrt(h)) / r | 0,
|
|
2757
|
-
1
|
|
2758
|
-
);
|
|
2759
|
-
if (s && (pi(
|
|
2760
|
-
n,
|
|
2761
|
-
e - i,
|
|
2762
|
-
t,
|
|
2763
|
-
i,
|
|
2764
|
-
o,
|
|
2765
|
-
a,
|
|
2766
|
-
c
|
|
2767
|
-
), d = X(o, a, c[0], c[1]), d < h)) {
|
|
2768
|
-
for (h = d, u = 0; u < i; ++u)
|
|
2769
|
-
l[u] = c[u];
|
|
2770
|
-
l.length = i;
|
|
2771
|
-
}
|
|
2772
|
-
return h;
|
|
2773
|
-
}
|
|
2774
|
-
function Ae(n, t, e, i, r, s, o, a, l, h, c) {
|
|
2775
|
-
c = c || [NaN, NaN];
|
|
2776
|
-
for (let u = 0, d = e.length; u < d; ++u) {
|
|
2777
|
-
const g = e[u];
|
|
2778
|
-
h = $e(
|
|
2779
|
-
n,
|
|
2780
|
-
t,
|
|
2781
|
-
g,
|
|
2782
|
-
i,
|
|
2783
|
-
r,
|
|
2784
|
-
s,
|
|
2785
|
-
o,
|
|
2786
|
-
a,
|
|
2787
|
-
l,
|
|
2788
|
-
h,
|
|
2789
|
-
c
|
|
2790
|
-
), t = g;
|
|
2791
|
-
}
|
|
2792
|
-
return h;
|
|
2793
|
-
}
|
|
2794
|
-
function es(n, t, e, i, r, s, o, a, l, h, c) {
|
|
2795
|
-
c = c || [NaN, NaN];
|
|
2796
|
-
for (let u = 0, d = e.length; u < d; ++u) {
|
|
2797
|
-
const g = e[u];
|
|
2798
|
-
h = Ae(
|
|
2799
|
-
n,
|
|
2800
|
-
t,
|
|
2801
|
-
g,
|
|
2802
|
-
i,
|
|
2803
|
-
r,
|
|
2804
|
-
s,
|
|
2805
|
-
o,
|
|
2806
|
-
a,
|
|
2807
|
-
l,
|
|
2808
|
-
h,
|
|
2809
|
-
c
|
|
2810
|
-
), t = g[g.length - 1];
|
|
2811
|
-
}
|
|
2812
|
-
return h;
|
|
2813
|
-
}
|
|
2814
|
-
function Dt(n, t, e, i, r, s, o) {
|
|
2815
|
-
const a = (e - t) / i;
|
|
2816
|
-
if (a < 3) {
|
|
2817
|
-
for (; t < e; t += i)
|
|
2818
|
-
s[o++] = n[t], s[o++] = n[t + 1];
|
|
2819
|
-
return o;
|
|
2820
|
-
}
|
|
2821
|
-
const l = new Array(a);
|
|
2822
|
-
l[0] = 1, l[a - 1] = 1;
|
|
2823
|
-
const h = [t, e - i];
|
|
2824
|
-
let c = 0;
|
|
2825
|
-
for (; h.length > 0; ) {
|
|
2826
|
-
const u = h.pop(), d = h.pop();
|
|
2827
|
-
let g = 0;
|
|
2828
|
-
const f = n[d], p = n[d + 1], _ = n[u], E = n[u + 1];
|
|
2829
|
-
for (let v = d + i; v < u; v += i) {
|
|
2830
|
-
const M = n[v], b = n[v + 1], T = Sr(M, b, f, p, _, E);
|
|
2831
|
-
T > g && (c = v, g = T);
|
|
2832
|
-
}
|
|
2833
|
-
g > r && (l[(c - t) / i] = 1, d + i < c && h.push(d, c), c + i < u && h.push(c, u));
|
|
2834
|
-
}
|
|
2835
|
-
for (let u = 0; u < a; ++u)
|
|
2836
|
-
l[u] && (s[o++] = n[t + u * i], s[o++] = n[t + u * i + 1]);
|
|
2837
|
-
return o;
|
|
2838
|
-
}
|
|
2839
|
-
function qi(n, t, e, i, r, s, o, a) {
|
|
2840
|
-
for (let l = 0, h = e.length; l < h; ++l) {
|
|
2841
|
-
const c = e[l];
|
|
2842
|
-
o = Dt(
|
|
2843
|
-
n,
|
|
2844
|
-
t,
|
|
2845
|
-
c,
|
|
2846
|
-
i,
|
|
2847
|
-
r,
|
|
2848
|
-
s,
|
|
2849
|
-
o
|
|
2850
|
-
), a.push(o), t = c;
|
|
2851
|
-
}
|
|
2852
|
-
return o;
|
|
2853
|
-
}
|
|
2854
|
-
function Q(n, t) {
|
|
2855
|
-
return t * Math.round(n / t);
|
|
2856
|
-
}
|
|
2857
|
-
function is(n, t, e, i, r, s, o) {
|
|
2858
|
-
if (t == e)
|
|
2859
|
-
return o;
|
|
2860
|
-
let a = Q(n[t], r), l = Q(n[t + 1], r);
|
|
2861
|
-
t += i, s[o++] = a, s[o++] = l;
|
|
2862
|
-
let h, c;
|
|
2863
|
-
do
|
|
2864
|
-
if (h = Q(n[t], r), c = Q(n[t + 1], r), t += i, t == e)
|
|
2865
|
-
return s[o++] = h, s[o++] = c, o;
|
|
2866
|
-
while (h == a && c == l);
|
|
2867
|
-
for (; t < e; ) {
|
|
2868
|
-
const u = Q(n[t], r), d = Q(n[t + 1], r);
|
|
2869
|
-
if (t += i, u == h && d == c)
|
|
2870
|
-
continue;
|
|
2871
|
-
const g = h - a, f = c - l, p = u - a, _ = d - l;
|
|
2872
|
-
if (g * _ == f * p && (g < 0 && p < g || g == p || g > 0 && p > g) && (f < 0 && _ < f || f == _ || f > 0 && _ > f)) {
|
|
2873
|
-
h = u, c = d;
|
|
2874
|
-
continue;
|
|
3088
|
+
a,
|
|
3089
|
+
n[t],
|
|
3090
|
+
n[t + 1]
|
|
3091
|
+
), d < h) {
|
|
3092
|
+
for (u = 0; u < i; ++u)
|
|
3093
|
+
l[u] = n[t + u];
|
|
3094
|
+
return l.length = i, d;
|
|
2875
3095
|
}
|
|
2876
|
-
|
|
3096
|
+
return h;
|
|
2877
3097
|
}
|
|
2878
|
-
|
|
3098
|
+
c = c || [NaN, NaN];
|
|
3099
|
+
let g = t + i;
|
|
3100
|
+
for (; g < e; )
|
|
3101
|
+
if (yi(
|
|
3102
|
+
n,
|
|
3103
|
+
g - i,
|
|
3104
|
+
g,
|
|
3105
|
+
i,
|
|
3106
|
+
o,
|
|
3107
|
+
a,
|
|
3108
|
+
c
|
|
3109
|
+
), d = X(o, a, c[0], c[1]), d < h) {
|
|
3110
|
+
for (h = d, u = 0; u < i; ++u)
|
|
3111
|
+
l[u] = c[u];
|
|
3112
|
+
l.length = i, g += i;
|
|
3113
|
+
} else
|
|
3114
|
+
g += i * Math.max(
|
|
3115
|
+
(Math.sqrt(d) - Math.sqrt(h)) / r | 0,
|
|
3116
|
+
1
|
|
3117
|
+
);
|
|
3118
|
+
if (s && (yi(
|
|
3119
|
+
n,
|
|
3120
|
+
e - i,
|
|
3121
|
+
t,
|
|
3122
|
+
i,
|
|
3123
|
+
o,
|
|
3124
|
+
a,
|
|
3125
|
+
c
|
|
3126
|
+
), d = X(o, a, c[0], c[1]), d < h)) {
|
|
3127
|
+
for (h = d, u = 0; u < i; ++u)
|
|
3128
|
+
l[u] = c[u];
|
|
3129
|
+
l.length = i;
|
|
3130
|
+
}
|
|
3131
|
+
return h;
|
|
2879
3132
|
}
|
|
2880
|
-
function
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
3133
|
+
function Re(n, t, e, i, r, s, o, a, l, h, c) {
|
|
3134
|
+
c = c || [NaN, NaN];
|
|
3135
|
+
for (let u = 0, d = e.length; u < d; ++u) {
|
|
3136
|
+
const g = e[u];
|
|
3137
|
+
h = Ie(
|
|
2884
3138
|
n,
|
|
2885
3139
|
t,
|
|
2886
|
-
|
|
3140
|
+
g,
|
|
2887
3141
|
i,
|
|
2888
3142
|
r,
|
|
2889
3143
|
s,
|
|
2890
|
-
o
|
|
2891
|
-
|
|
3144
|
+
o,
|
|
3145
|
+
a,
|
|
3146
|
+
l,
|
|
3147
|
+
h,
|
|
3148
|
+
c
|
|
3149
|
+
), t = g;
|
|
2892
3150
|
}
|
|
2893
|
-
return
|
|
3151
|
+
return h;
|
|
2894
3152
|
}
|
|
2895
|
-
function
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
3153
|
+
function cs(n, t, e, i, r, s, o, a, l, h, c) {
|
|
3154
|
+
c = c || [NaN, NaN];
|
|
3155
|
+
for (let u = 0, d = e.length; u < d; ++u) {
|
|
3156
|
+
const g = e[u];
|
|
3157
|
+
h = Re(
|
|
2899
3158
|
n,
|
|
2900
3159
|
t,
|
|
2901
|
-
|
|
3160
|
+
g,
|
|
2902
3161
|
i,
|
|
2903
3162
|
r,
|
|
2904
3163
|
s,
|
|
2905
3164
|
o,
|
|
2906
|
-
|
|
2907
|
-
|
|
3165
|
+
a,
|
|
3166
|
+
l,
|
|
3167
|
+
h,
|
|
3168
|
+
c
|
|
3169
|
+
), t = g[g.length - 1];
|
|
2908
3170
|
}
|
|
2909
|
-
return
|
|
3171
|
+
return h;
|
|
2910
3172
|
}
|
|
2911
|
-
function
|
|
3173
|
+
function qt(n, t, e, i, r) {
|
|
2912
3174
|
r = r !== void 0 ? r : [];
|
|
2913
3175
|
let s = 0;
|
|
2914
3176
|
for (let o = t; o < e; o += i)
|
|
2915
3177
|
r[s++] = n.slice(o, o + i);
|
|
2916
3178
|
return r.length = s, r;
|
|
2917
3179
|
}
|
|
2918
|
-
function
|
|
3180
|
+
function Te(n, t, e, i, r) {
|
|
2919
3181
|
r = r !== void 0 ? r : [];
|
|
2920
3182
|
let s = 0;
|
|
2921
3183
|
for (let o = 0, a = e.length; o < a; ++o) {
|
|
2922
3184
|
const l = e[o];
|
|
2923
|
-
r[s++] =
|
|
3185
|
+
r[s++] = qt(
|
|
2924
3186
|
n,
|
|
2925
3187
|
t,
|
|
2926
3188
|
l,
|
|
@@ -2930,12 +3192,12 @@ function Fe(n, t, e, i, r) {
|
|
|
2930
3192
|
}
|
|
2931
3193
|
return r.length = s, r;
|
|
2932
3194
|
}
|
|
2933
|
-
function
|
|
3195
|
+
function us(n, t, e, i, r) {
|
|
2934
3196
|
r = r !== void 0 ? r : [];
|
|
2935
3197
|
let s = 0;
|
|
2936
3198
|
for (let o = 0, a = e.length; o < a; ++o) {
|
|
2937
3199
|
const l = e[o];
|
|
2938
|
-
r[s++] = l.length === 1 && l[0] === t ? [] :
|
|
3200
|
+
r[s++] = l.length === 1 && l[0] === t ? [] : Te(
|
|
2939
3201
|
n,
|
|
2940
3202
|
t,
|
|
2941
3203
|
l,
|
|
@@ -2945,33 +3207,7 @@ function rs(n, t, e, i, r) {
|
|
|
2945
3207
|
}
|
|
2946
3208
|
return r.length = s, r;
|
|
2947
3209
|
}
|
|
2948
|
-
|
|
2949
|
-
let r = 0;
|
|
2950
|
-
const s = n[e - i], o = n[e - i + 1];
|
|
2951
|
-
let a = 0, l = 0;
|
|
2952
|
-
for (; t < e; t += i) {
|
|
2953
|
-
const h = n[t] - s, c = n[t + 1] - o;
|
|
2954
|
-
r += l * h - a * c, a = h, l = c;
|
|
2955
|
-
}
|
|
2956
|
-
return r / 2;
|
|
2957
|
-
}
|
|
2958
|
-
function Ki(n, t, e, i) {
|
|
2959
|
-
let r = 0;
|
|
2960
|
-
for (let s = 0, o = e.length; s < o; ++s) {
|
|
2961
|
-
const a = e[s];
|
|
2962
|
-
r += Zi(n, t, a, i), t = a;
|
|
2963
|
-
}
|
|
2964
|
-
return r;
|
|
2965
|
-
}
|
|
2966
|
-
function ss(n, t, e, i) {
|
|
2967
|
-
let r = 0;
|
|
2968
|
-
for (let s = 0, o = e.length; s < o; ++s) {
|
|
2969
|
-
const a = e[s];
|
|
2970
|
-
r += Ki(n, t, a, i), t = a[a.length - 1];
|
|
2971
|
-
}
|
|
2972
|
-
return r;
|
|
2973
|
-
}
|
|
2974
|
-
class vt extends q {
|
|
3210
|
+
class vt extends Z {
|
|
2975
3211
|
/**
|
|
2976
3212
|
* @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
|
|
2977
3213
|
* For internal use, flat coordinates in combination with `layout` are also accepted.
|
|
@@ -3006,15 +3242,15 @@ class vt extends q {
|
|
|
3006
3242
|
* @override
|
|
3007
3243
|
*/
|
|
3008
3244
|
closestPointXY(t, e, i, r) {
|
|
3009
|
-
return r <
|
|
3010
|
-
|
|
3245
|
+
return r < q(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
3246
|
+
Ge(
|
|
3011
3247
|
this.flatCoordinates,
|
|
3012
3248
|
0,
|
|
3013
3249
|
this.flatCoordinates.length,
|
|
3014
3250
|
this.stride,
|
|
3015
3251
|
0
|
|
3016
3252
|
)
|
|
3017
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
3253
|
+
), this.maxDeltaRevision_ = this.getRevision()), Ie(
|
|
3018
3254
|
this.flatCoordinates,
|
|
3019
3255
|
0,
|
|
3020
3256
|
this.flatCoordinates.length,
|
|
@@ -3033,7 +3269,7 @@ class vt extends q {
|
|
|
3033
3269
|
* @api
|
|
3034
3270
|
*/
|
|
3035
3271
|
getArea() {
|
|
3036
|
-
return
|
|
3272
|
+
return en(
|
|
3037
3273
|
this.flatCoordinates,
|
|
3038
3274
|
0,
|
|
3039
3275
|
this.flatCoordinates.length,
|
|
@@ -3047,7 +3283,7 @@ class vt extends q {
|
|
|
3047
3283
|
* @override
|
|
3048
3284
|
*/
|
|
3049
3285
|
getCoordinates() {
|
|
3050
|
-
return
|
|
3286
|
+
return qt(
|
|
3051
3287
|
this.flatCoordinates,
|
|
3052
3288
|
0,
|
|
3053
3289
|
this.flatCoordinates.length,
|
|
@@ -3059,205 +3295,66 @@ class vt extends q {
|
|
|
3059
3295
|
* @return {LinearRing} Simplified LinearRing.
|
|
3060
3296
|
* @protected
|
|
3061
3297
|
* @override
|
|
3062
|
-
*/
|
|
3063
|
-
getSimplifiedGeometryInternal(t) {
|
|
3064
|
-
const e = [];
|
|
3065
|
-
return e.length =
|
|
3066
|
-
this.flatCoordinates,
|
|
3067
|
-
0,
|
|
3068
|
-
this.flatCoordinates.length,
|
|
3069
|
-
this.stride,
|
|
3070
|
-
t,
|
|
3071
|
-
e,
|
|
3072
|
-
0
|
|
3073
|
-
), new vt(e, "XY");
|
|
3074
|
-
}
|
|
3075
|
-
/**
|
|
3076
|
-
* Get the type of this geometry.
|
|
3077
|
-
* @return {import("./Geometry.js").Type} Geometry type.
|
|
3078
|
-
* @api
|
|
3079
|
-
* @override
|
|
3080
|
-
*/
|
|
3081
|
-
getType() {
|
|
3082
|
-
return "LinearRing";
|
|
3083
|
-
}
|
|
3084
|
-
/**
|
|
3085
|
-
* Test if the geometry and the passed extent intersect.
|
|
3086
|
-
* @param {import("../extent.js").Extent} extent Extent.
|
|
3087
|
-
* @return {boolean} `true` if the geometry and the extent intersect.
|
|
3088
|
-
* @api
|
|
3089
|
-
* @override
|
|
3090
|
-
*/
|
|
3091
|
-
intersectsExtent(t) {
|
|
3092
|
-
return !1;
|
|
3093
|
-
}
|
|
3094
|
-
/**
|
|
3095
|
-
* Set the coordinates of the linear ring.
|
|
3096
|
-
* @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
|
3097
|
-
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
3098
|
-
* @api
|
|
3099
|
-
* @override
|
|
3100
|
-
*/
|
|
3101
|
-
setCoordinates(t, e) {
|
|
3102
|
-
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = zt(
|
|
3103
|
-
this.flatCoordinates,
|
|
3104
|
-
0,
|
|
3105
|
-
t,
|
|
3106
|
-
this.stride
|
|
3107
|
-
), this.changed();
|
|
3108
|
-
}
|
|
3109
|
-
}
|
|
3110
|
-
function Qi(n, t, e, i, r) {
|
|
3111
|
-
let s;
|
|
3112
|
-
for (t += i; t < e; t += i)
|
|
3113
|
-
if (s = r(
|
|
3114
|
-
n.slice(t - i, t),
|
|
3115
|
-
n.slice(t, t + i)
|
|
3116
|
-
), s)
|
|
3117
|
-
return s;
|
|
3118
|
-
return !1;
|
|
3119
|
-
}
|
|
3120
|
-
function Ht(n, t, e, i, r, s, o) {
|
|
3121
|
-
let a, l;
|
|
3122
|
-
const h = (e - t) / i;
|
|
3123
|
-
if (h === 1)
|
|
3124
|
-
a = t;
|
|
3125
|
-
else if (h === 2)
|
|
3126
|
-
a = t, l = r;
|
|
3127
|
-
else if (h !== 0) {
|
|
3128
|
-
let c = n[t], u = n[t + 1], d = 0;
|
|
3129
|
-
const g = [0];
|
|
3130
|
-
for (let _ = t + i; _ < e; _ += i) {
|
|
3131
|
-
const E = n[_], v = n[_ + 1];
|
|
3132
|
-
d += Math.sqrt((E - c) * (E - c) + (v - u) * (v - u)), g.push(d), c = E, u = v;
|
|
3133
|
-
}
|
|
3134
|
-
const f = r * d, p = er(g, f);
|
|
3135
|
-
p < 0 ? (l = (f - g[-p - 2]) / (g[-p - 1] - g[-p - 2]), a = t + (-p - 2) * i) : a = t + p * i;
|
|
3136
|
-
}
|
|
3137
|
-
o = o > 1 ? o : 2, s = s || new Array(o);
|
|
3138
|
-
for (let c = 0; c < o; ++c)
|
|
3139
|
-
s[c] = a === void 0 ? NaN : l === void 0 ? n[a + c] : we(n[a + c], n[a + i + c], l);
|
|
3140
|
-
return s;
|
|
3141
|
-
}
|
|
3142
|
-
function he(n, t, e, i, r, s) {
|
|
3143
|
-
if (e == t)
|
|
3144
|
-
return null;
|
|
3145
|
-
let o;
|
|
3146
|
-
if (r < n[t + i - 1])
|
|
3147
|
-
return s ? (o = n.slice(t, t + i), o[i - 1] = r, o) : null;
|
|
3148
|
-
if (n[e - 1] < r)
|
|
3149
|
-
return s ? (o = n.slice(e - i, e), o[i - 1] = r, o) : null;
|
|
3150
|
-
if (r == n[t + i - 1])
|
|
3151
|
-
return n.slice(t, t + i);
|
|
3152
|
-
let a = t / i, l = e / i;
|
|
3153
|
-
for (; a < l; ) {
|
|
3154
|
-
const d = a + l >> 1;
|
|
3155
|
-
r < n[(d + 1) * i - 1] ? l = d : a = d + 1;
|
|
3156
|
-
}
|
|
3157
|
-
const h = n[a * i - 1];
|
|
3158
|
-
if (r == h)
|
|
3159
|
-
return n.slice((a - 1) * i, (a - 1) * i + i);
|
|
3160
|
-
const c = n[(a + 1) * i - 1], u = (r - h) / (c - h);
|
|
3161
|
-
o = [];
|
|
3162
|
-
for (let d = 0; d < i - 1; ++d)
|
|
3163
|
-
o.push(
|
|
3164
|
-
we(
|
|
3165
|
-
n[(a - 1) * i + d],
|
|
3166
|
-
n[a * i + d],
|
|
3167
|
-
u
|
|
3168
|
-
)
|
|
3169
|
-
);
|
|
3170
|
-
return o.push(r), o;
|
|
3171
|
-
}
|
|
3172
|
-
function os(n, t, e, i, r, s, o) {
|
|
3173
|
-
if (o)
|
|
3174
|
-
return he(
|
|
3175
|
-
n,
|
|
3176
|
-
t,
|
|
3177
|
-
e[e.length - 1],
|
|
3178
|
-
i,
|
|
3179
|
-
r,
|
|
3180
|
-
s
|
|
3181
|
-
);
|
|
3182
|
-
let a;
|
|
3183
|
-
if (r < n[i - 1])
|
|
3184
|
-
return s ? (a = n.slice(0, i), a[i - 1] = r, a) : null;
|
|
3185
|
-
if (n[n.length - 1] < r)
|
|
3186
|
-
return s ? (a = n.slice(n.length - i), a[i - 1] = r, a) : null;
|
|
3187
|
-
for (let l = 0, h = e.length; l < h; ++l) {
|
|
3188
|
-
const c = e[l];
|
|
3189
|
-
if (t != c) {
|
|
3190
|
-
if (r < n[t + i - 1])
|
|
3191
|
-
return null;
|
|
3192
|
-
if (r <= n[c - 1])
|
|
3193
|
-
return he(
|
|
3194
|
-
n,
|
|
3195
|
-
t,
|
|
3196
|
-
c,
|
|
3197
|
-
i,
|
|
3198
|
-
r,
|
|
3199
|
-
!1
|
|
3200
|
-
);
|
|
3201
|
-
t = c;
|
|
3202
|
-
}
|
|
3203
|
-
}
|
|
3204
|
-
return null;
|
|
3205
|
-
}
|
|
3206
|
-
function as(n, t, e, i, r) {
|
|
3207
|
-
return !dr(
|
|
3208
|
-
r,
|
|
3209
|
-
/**
|
|
3210
|
-
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
|
3211
|
-
* @return {boolean} Contains (x, y).
|
|
3212
|
-
*/
|
|
3213
|
-
function(o) {
|
|
3214
|
-
return !H(
|
|
3215
|
-
n,
|
|
3216
|
-
t,
|
|
3217
|
-
e,
|
|
3218
|
-
i,
|
|
3219
|
-
o[0],
|
|
3220
|
-
o[1]
|
|
3221
|
-
);
|
|
3222
|
-
}
|
|
3223
|
-
);
|
|
3224
|
-
}
|
|
3225
|
-
function H(n, t, e, i, r, s) {
|
|
3226
|
-
let o = 0, a = n[e - i], l = n[e - i + 1];
|
|
3227
|
-
for (; t < e; t += i) {
|
|
3228
|
-
const h = n[t], c = n[t + 1];
|
|
3229
|
-
l <= s ? c > s && (h - a) * (s - l) - (r - a) * (c - l) > 0 && o++ : c <= s && (h - a) * (s - l) - (r - a) * (c - l) < 0 && o--, a = h, l = c;
|
|
3298
|
+
*/
|
|
3299
|
+
getSimplifiedGeometryInternal(t) {
|
|
3300
|
+
const e = [];
|
|
3301
|
+
return e.length = Wt(
|
|
3302
|
+
this.flatCoordinates,
|
|
3303
|
+
0,
|
|
3304
|
+
this.flatCoordinates.length,
|
|
3305
|
+
this.stride,
|
|
3306
|
+
t,
|
|
3307
|
+
e,
|
|
3308
|
+
0
|
|
3309
|
+
), new vt(e, "XY");
|
|
3230
3310
|
}
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3311
|
+
/**
|
|
3312
|
+
* Get the type of this geometry.
|
|
3313
|
+
* @return {import("./Geometry.js").Type} Geometry type.
|
|
3314
|
+
* @api
|
|
3315
|
+
* @override
|
|
3316
|
+
*/
|
|
3317
|
+
getType() {
|
|
3318
|
+
return "LinearRing";
|
|
3319
|
+
}
|
|
3320
|
+
/**
|
|
3321
|
+
* Test if the geometry and the passed extent intersect.
|
|
3322
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
3323
|
+
* @return {boolean} `true` if the geometry and the extent intersect.
|
|
3324
|
+
* @api
|
|
3325
|
+
* @override
|
|
3326
|
+
*/
|
|
3327
|
+
intersectsExtent(t) {
|
|
3243
3328
|
return !1;
|
|
3244
|
-
for (let o = 0, a = e.length; o < a; ++o) {
|
|
3245
|
-
const l = e[o];
|
|
3246
|
-
if (Ge(n, t, l, i, r, s))
|
|
3247
|
-
return !0;
|
|
3248
|
-
t = l[l.length - 1];
|
|
3249
3329
|
}
|
|
3330
|
+
/**
|
|
3331
|
+
* Set the coordinates of the linear ring.
|
|
3332
|
+
* @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
|
3333
|
+
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
3334
|
+
* @api
|
|
3335
|
+
* @override
|
|
3336
|
+
*/
|
|
3337
|
+
setCoordinates(t, e) {
|
|
3338
|
+
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = Jt(
|
|
3339
|
+
this.flatCoordinates,
|
|
3340
|
+
0,
|
|
3341
|
+
t,
|
|
3342
|
+
this.stride
|
|
3343
|
+
), this.changed();
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
function rn(n, t, e, i, r) {
|
|
3347
|
+
let s;
|
|
3348
|
+
for (t += i; t < e; t += i)
|
|
3349
|
+
if (s = r(
|
|
3350
|
+
n.slice(t - i, t),
|
|
3351
|
+
n.slice(t, t + i)
|
|
3352
|
+
), s)
|
|
3353
|
+
return s;
|
|
3250
3354
|
return !1;
|
|
3251
3355
|
}
|
|
3252
|
-
function
|
|
3253
|
-
|
|
3254
|
-
me(),
|
|
3255
|
-
n,
|
|
3256
|
-
t,
|
|
3257
|
-
e,
|
|
3258
|
-
i
|
|
3259
|
-
);
|
|
3260
|
-
return mr(r, s) ? hr(r, s) || s[0] >= r[0] && s[2] <= r[2] || s[1] >= r[1] && s[3] <= r[3] ? !0 : Qi(
|
|
3356
|
+
function Zt(n, t, e, i, r, s) {
|
|
3357
|
+
return s = s ?? Hi(_e(), n, t, e, i), mr(r, s) ? s[0] >= r[0] && s[2] <= r[2] || s[1] >= r[1] && s[3] <= r[3] ? !0 : rn(
|
|
3261
3358
|
n,
|
|
3262
3359
|
t,
|
|
3263
3360
|
e,
|
|
@@ -3273,16 +3370,16 @@ function Wt(n, t, e, i, r) {
|
|
|
3273
3370
|
}
|
|
3274
3371
|
) : !1;
|
|
3275
3372
|
}
|
|
3276
|
-
function
|
|
3373
|
+
function ds(n, t, e, i, r) {
|
|
3277
3374
|
for (let s = 0, o = e.length; s < o; ++s) {
|
|
3278
|
-
if (
|
|
3375
|
+
if (Zt(n, t, e[s], i, r))
|
|
3279
3376
|
return !0;
|
|
3280
3377
|
t = e[s];
|
|
3281
3378
|
}
|
|
3282
3379
|
return !1;
|
|
3283
3380
|
}
|
|
3284
|
-
function
|
|
3285
|
-
return !!(
|
|
3381
|
+
function gs(n, t, e, i, r) {
|
|
3382
|
+
return !!(Zt(n, t, e, i, r) || H(
|
|
3286
3383
|
n,
|
|
3287
3384
|
t,
|
|
3288
3385
|
e,
|
|
@@ -3312,19 +3409,19 @@ function cs(n, t, e, i, r) {
|
|
|
3312
3409
|
r[3]
|
|
3313
3410
|
));
|
|
3314
3411
|
}
|
|
3315
|
-
function
|
|
3316
|
-
if (!
|
|
3412
|
+
function sn(n, t, e, i, r) {
|
|
3413
|
+
if (!gs(n, t, e[0], i, r))
|
|
3317
3414
|
return !1;
|
|
3318
3415
|
if (e.length === 1)
|
|
3319
3416
|
return !0;
|
|
3320
3417
|
for (let s = 1, o = e.length; s < o; ++s)
|
|
3321
|
-
if (
|
|
3418
|
+
if (es(
|
|
3322
3419
|
n,
|
|
3323
3420
|
e[s - 1],
|
|
3324
3421
|
e[s],
|
|
3325
3422
|
i,
|
|
3326
3423
|
r
|
|
3327
|
-
) && !
|
|
3424
|
+
) && !Zt(
|
|
3328
3425
|
n,
|
|
3329
3426
|
e[s - 1],
|
|
3330
3427
|
e[s],
|
|
@@ -3334,16 +3431,16 @@ function tn(n, t, e, i, r) {
|
|
|
3334
3431
|
return !1;
|
|
3335
3432
|
return !0;
|
|
3336
3433
|
}
|
|
3337
|
-
function
|
|
3434
|
+
function fs(n, t, e, i, r) {
|
|
3338
3435
|
for (let s = 0, o = e.length; s < o; ++s) {
|
|
3339
3436
|
const a = e[s];
|
|
3340
|
-
if (
|
|
3437
|
+
if (sn(n, t, a, i, r))
|
|
3341
3438
|
return !0;
|
|
3342
3439
|
t = a[a.length - 1];
|
|
3343
3440
|
}
|
|
3344
3441
|
return !1;
|
|
3345
3442
|
}
|
|
3346
|
-
function
|
|
3443
|
+
function ps(n, t, e, i) {
|
|
3347
3444
|
let r = n[t], s = n[t + 1], o = 0;
|
|
3348
3445
|
for (let a = t + i; a < e; a += i) {
|
|
3349
3446
|
const l = n[a], h = n[a + 1];
|
|
@@ -3351,7 +3448,7 @@ function ds(n, t, e, i) {
|
|
|
3351
3448
|
}
|
|
3352
3449
|
return o;
|
|
3353
3450
|
}
|
|
3354
|
-
class V extends
|
|
3451
|
+
class V extends Z {
|
|
3355
3452
|
/**
|
|
3356
3453
|
* @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
|
|
3357
3454
|
* For internal use, flat coordinates in combination with `layout` are also accepted.
|
|
@@ -3398,15 +3495,15 @@ class V extends q {
|
|
|
3398
3495
|
* @override
|
|
3399
3496
|
*/
|
|
3400
3497
|
closestPointXY(t, e, i, r) {
|
|
3401
|
-
return r <
|
|
3402
|
-
|
|
3498
|
+
return r < q(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
3499
|
+
Ge(
|
|
3403
3500
|
this.flatCoordinates,
|
|
3404
3501
|
0,
|
|
3405
3502
|
this.flatCoordinates.length,
|
|
3406
3503
|
this.stride,
|
|
3407
3504
|
0
|
|
3408
3505
|
)
|
|
3409
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
3506
|
+
), this.maxDeltaRevision_ = this.getRevision()), Ie(
|
|
3410
3507
|
this.flatCoordinates,
|
|
3411
3508
|
0,
|
|
3412
3509
|
this.flatCoordinates.length,
|
|
@@ -3431,7 +3528,7 @@ class V extends q {
|
|
|
3431
3528
|
* @api
|
|
3432
3529
|
*/
|
|
3433
3530
|
forEachSegment(t) {
|
|
3434
|
-
return
|
|
3531
|
+
return rn(
|
|
3435
3532
|
this.flatCoordinates,
|
|
3436
3533
|
0,
|
|
3437
3534
|
this.flatCoordinates.length,
|
|
@@ -3454,7 +3551,7 @@ class V extends q {
|
|
|
3454
3551
|
* @api
|
|
3455
3552
|
*/
|
|
3456
3553
|
getCoordinateAtM(t, e) {
|
|
3457
|
-
return this.layout != "XYM" && this.layout != "XYZM" ? null : (e = e !== void 0 ? e : !1,
|
|
3554
|
+
return this.layout != "XYM" && this.layout != "XYZM" ? null : (e = e !== void 0 ? e : !1, ce(
|
|
3458
3555
|
this.flatCoordinates,
|
|
3459
3556
|
0,
|
|
3460
3557
|
this.flatCoordinates.length,
|
|
@@ -3470,7 +3567,7 @@ class V extends q {
|
|
|
3470
3567
|
* @override
|
|
3471
3568
|
*/
|
|
3472
3569
|
getCoordinates() {
|
|
3473
|
-
return
|
|
3570
|
+
return qt(
|
|
3474
3571
|
this.flatCoordinates,
|
|
3475
3572
|
0,
|
|
3476
3573
|
this.flatCoordinates.length,
|
|
@@ -3488,7 +3585,7 @@ class V extends q {
|
|
|
3488
3585
|
* @api
|
|
3489
3586
|
*/
|
|
3490
3587
|
getCoordinateAt(t, e) {
|
|
3491
|
-
return
|
|
3588
|
+
return Ut(
|
|
3492
3589
|
this.flatCoordinates,
|
|
3493
3590
|
0,
|
|
3494
3591
|
this.flatCoordinates.length,
|
|
@@ -3504,7 +3601,7 @@ class V extends q {
|
|
|
3504
3601
|
* @api
|
|
3505
3602
|
*/
|
|
3506
3603
|
getLength() {
|
|
3507
|
-
return
|
|
3604
|
+
return ps(
|
|
3508
3605
|
this.flatCoordinates,
|
|
3509
3606
|
0,
|
|
3510
3607
|
this.flatCoordinates.length,
|
|
@@ -3529,7 +3626,7 @@ class V extends q {
|
|
|
3529
3626
|
*/
|
|
3530
3627
|
getSimplifiedGeometryInternal(t) {
|
|
3531
3628
|
const e = [];
|
|
3532
|
-
return e.length =
|
|
3629
|
+
return e.length = Wt(
|
|
3533
3630
|
this.flatCoordinates,
|
|
3534
3631
|
0,
|
|
3535
3632
|
this.flatCoordinates.length,
|
|
@@ -3556,12 +3653,13 @@ class V extends q {
|
|
|
3556
3653
|
* @override
|
|
3557
3654
|
*/
|
|
3558
3655
|
intersectsExtent(t) {
|
|
3559
|
-
return
|
|
3656
|
+
return Zt(
|
|
3560
3657
|
this.flatCoordinates,
|
|
3561
3658
|
0,
|
|
3562
3659
|
this.flatCoordinates.length,
|
|
3563
3660
|
this.stride,
|
|
3564
|
-
t
|
|
3661
|
+
t,
|
|
3662
|
+
this.getExtent()
|
|
3565
3663
|
);
|
|
3566
3664
|
}
|
|
3567
3665
|
/**
|
|
@@ -3572,7 +3670,7 @@ class V extends q {
|
|
|
3572
3670
|
* @override
|
|
3573
3671
|
*/
|
|
3574
3672
|
setCoordinates(t, e) {
|
|
3575
|
-
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length =
|
|
3673
|
+
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = Jt(
|
|
3576
3674
|
this.flatCoordinates,
|
|
3577
3675
|
0,
|
|
3578
3676
|
t,
|
|
@@ -3580,7 +3678,7 @@ class V extends q {
|
|
|
3580
3678
|
), this.changed();
|
|
3581
3679
|
}
|
|
3582
3680
|
}
|
|
3583
|
-
class Ct extends
|
|
3681
|
+
class Ct extends Z {
|
|
3584
3682
|
/**
|
|
3585
3683
|
* @param {Array<Array<import("../coordinate.js").Coordinate>|LineString>|Array<number>} coordinates
|
|
3586
3684
|
* Coordinates or LineString geometries. (For internal use, flat coordinates in
|
|
@@ -3645,15 +3743,15 @@ class Ct extends q {
|
|
|
3645
3743
|
* @override
|
|
3646
3744
|
*/
|
|
3647
3745
|
closestPointXY(t, e, i, r) {
|
|
3648
|
-
return r <
|
|
3649
|
-
|
|
3746
|
+
return r < q(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
3747
|
+
Le(
|
|
3650
3748
|
this.flatCoordinates,
|
|
3651
3749
|
0,
|
|
3652
3750
|
this.ends_,
|
|
3653
3751
|
this.stride,
|
|
3654
3752
|
0
|
|
3655
3753
|
)
|
|
3656
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
3754
|
+
), this.maxDeltaRevision_ = this.getRevision()), Re(
|
|
3657
3755
|
this.flatCoordinates,
|
|
3658
3756
|
0,
|
|
3659
3757
|
this.ends_,
|
|
@@ -3689,7 +3787,7 @@ class Ct extends q {
|
|
|
3689
3787
|
* @api
|
|
3690
3788
|
*/
|
|
3691
3789
|
getCoordinateAtM(t, e, i) {
|
|
3692
|
-
return this.layout != "XYM" && this.layout != "XYZM" || this.flatCoordinates.length === 0 ? null : (e = e !== void 0 ? e : !1, i = i !== void 0 ? i : !1,
|
|
3790
|
+
return this.layout != "XYM" && this.layout != "XYZM" || this.flatCoordinates.length === 0 ? null : (e = e !== void 0 ? e : !1, i = i !== void 0 ? i : !1, ns(
|
|
3693
3791
|
this.flatCoordinates,
|
|
3694
3792
|
0,
|
|
3695
3793
|
this.ends_,
|
|
@@ -3706,7 +3804,7 @@ class Ct extends q {
|
|
|
3706
3804
|
* @override
|
|
3707
3805
|
*/
|
|
3708
3806
|
getCoordinates() {
|
|
3709
|
-
return
|
|
3807
|
+
return Te(
|
|
3710
3808
|
this.flatCoordinates,
|
|
3711
3809
|
0,
|
|
3712
3810
|
this.ends_,
|
|
@@ -3759,7 +3857,7 @@ class Ct extends q {
|
|
|
3759
3857
|
let i = 0;
|
|
3760
3858
|
const r = this.ends_, s = this.stride;
|
|
3761
3859
|
for (let o = 0, a = r.length; o < a; ++o) {
|
|
3762
|
-
const l = r[o], h =
|
|
3860
|
+
const l = r[o], h = Ut(
|
|
3763
3861
|
e,
|
|
3764
3862
|
i,
|
|
3765
3863
|
l,
|
|
@@ -3778,7 +3876,7 @@ class Ct extends q {
|
|
|
3778
3876
|
*/
|
|
3779
3877
|
getSimplifiedGeometryInternal(t) {
|
|
3780
3878
|
const e = [], i = [];
|
|
3781
|
-
return e.length =
|
|
3879
|
+
return e.length = tn(
|
|
3782
3880
|
this.flatCoordinates,
|
|
3783
3881
|
0,
|
|
3784
3882
|
this.ends_,
|
|
@@ -3806,7 +3904,7 @@ class Ct extends q {
|
|
|
3806
3904
|
* @override
|
|
3807
3905
|
*/
|
|
3808
3906
|
intersectsExtent(t) {
|
|
3809
|
-
return
|
|
3907
|
+
return ds(
|
|
3810
3908
|
this.flatCoordinates,
|
|
3811
3909
|
0,
|
|
3812
3910
|
this.ends_,
|
|
@@ -3833,7 +3931,7 @@ class Ct extends q {
|
|
|
3833
3931
|
this.flatCoordinates.length = i.length === 0 ? 0 : i[i.length - 1], this.changed();
|
|
3834
3932
|
}
|
|
3835
3933
|
}
|
|
3836
|
-
class z extends
|
|
3934
|
+
class z extends Z {
|
|
3837
3935
|
/**
|
|
3838
3936
|
* @param {import("../coordinate.js").Coordinate} coordinates Coordinates.
|
|
3839
3937
|
* @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
|
|
@@ -3890,7 +3988,7 @@ class z extends q {
|
|
|
3890
3988
|
* @override
|
|
3891
3989
|
*/
|
|
3892
3990
|
computeExtent(t) {
|
|
3893
|
-
return
|
|
3991
|
+
return ki(this.flatCoordinates, t);
|
|
3894
3992
|
}
|
|
3895
3993
|
/**
|
|
3896
3994
|
* Get the type of this geometry.
|
|
@@ -3909,7 +4007,7 @@ class z extends q {
|
|
|
3909
4007
|
* @override
|
|
3910
4008
|
*/
|
|
3911
4009
|
intersectsExtent(t) {
|
|
3912
|
-
return
|
|
4010
|
+
return Ni(t, this.flatCoordinates[0], this.flatCoordinates[1]);
|
|
3913
4011
|
}
|
|
3914
4012
|
/**
|
|
3915
4013
|
* @param {!Array<*>} coordinates Coordinates.
|
|
@@ -3918,7 +4016,7 @@ class z extends q {
|
|
|
3918
4016
|
* @override
|
|
3919
4017
|
*/
|
|
3920
4018
|
setCoordinates(t, e) {
|
|
3921
|
-
this.setLayout(e, t, 0), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length =
|
|
4019
|
+
this.setLayout(e, t, 0), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = ts(
|
|
3922
4020
|
this.flatCoordinates,
|
|
3923
4021
|
0,
|
|
3924
4022
|
t,
|
|
@@ -3926,7 +4024,7 @@ class z extends q {
|
|
|
3926
4024
|
), this.changed();
|
|
3927
4025
|
}
|
|
3928
4026
|
}
|
|
3929
|
-
class At extends
|
|
4027
|
+
class At extends Z {
|
|
3930
4028
|
/**
|
|
3931
4029
|
* @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
|
|
3932
4030
|
* For internal use, flat coordinates in combination with `layout` are also accepted.
|
|
@@ -3973,7 +4071,7 @@ class At extends q {
|
|
|
3973
4071
|
* @override
|
|
3974
4072
|
*/
|
|
3975
4073
|
closestPointXY(t, e, i, r) {
|
|
3976
|
-
if (r <
|
|
4074
|
+
if (r < q(this.getExtent(), t, e))
|
|
3977
4075
|
return r;
|
|
3978
4076
|
const s = this.flatCoordinates, o = this.stride;
|
|
3979
4077
|
for (let a = 0, l = s.length; a < l; a += o) {
|
|
@@ -3999,7 +4097,7 @@ class At extends q {
|
|
|
3999
4097
|
* @override
|
|
4000
4098
|
*/
|
|
4001
4099
|
getCoordinates() {
|
|
4002
|
-
return
|
|
4100
|
+
return qt(
|
|
4003
4101
|
this.flatCoordinates,
|
|
4004
4102
|
0,
|
|
4005
4103
|
this.flatCoordinates.length,
|
|
@@ -4055,7 +4153,7 @@ class At extends q {
|
|
|
4055
4153
|
const e = this.flatCoordinates, i = this.stride;
|
|
4056
4154
|
for (let r = 0, s = e.length; r < s; r += i) {
|
|
4057
4155
|
const o = e[r], a = e[r + 1];
|
|
4058
|
-
if (
|
|
4156
|
+
if (Ni(t, o, a))
|
|
4059
4157
|
return !0;
|
|
4060
4158
|
}
|
|
4061
4159
|
return !1;
|
|
@@ -4068,7 +4166,7 @@ class At extends q {
|
|
|
4068
4166
|
* @override
|
|
4069
4167
|
*/
|
|
4070
4168
|
setCoordinates(t, e) {
|
|
4071
|
-
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length =
|
|
4169
|
+
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = Jt(
|
|
4072
4170
|
this.flatCoordinates,
|
|
4073
4171
|
0,
|
|
4074
4172
|
t,
|
|
@@ -4076,123 +4174,7 @@ class At extends q {
|
|
|
4076
4174
|
), this.changed();
|
|
4077
4175
|
}
|
|
4078
4176
|
}
|
|
4079
|
-
|
|
4080
|
-
let a, l, h, c, u, d, g;
|
|
4081
|
-
const f = r[s + 1], p = [];
|
|
4082
|
-
for (let v = 0, M = e.length; v < M; ++v) {
|
|
4083
|
-
const b = e[v];
|
|
4084
|
-
for (c = n[b - i], d = n[b - i + 1], a = t; a < b; a += i)
|
|
4085
|
-
u = n[a], g = n[a + 1], (f <= d && g <= f || d <= f && f <= g) && (h = (f - d) / (g - d) * (u - c) + c, p.push(h)), c = u, d = g;
|
|
4086
|
-
}
|
|
4087
|
-
let _ = NaN, E = -1 / 0;
|
|
4088
|
-
for (p.sort(Fi), c = p[0], a = 1, l = p.length; a < l; ++a) {
|
|
4089
|
-
u = p[a];
|
|
4090
|
-
const v = Math.abs(u - c);
|
|
4091
|
-
v > E && (h = (c + u) / 2, Ge(n, t, e, i, h, f) && (_ = h, E = v)), c = u;
|
|
4092
|
-
}
|
|
4093
|
-
return isNaN(_) && (_ = r[s]), o ? (o.push(_, f, E), o) : [_, f, E];
|
|
4094
|
-
}
|
|
4095
|
-
function en(n, t, e, i, r) {
|
|
4096
|
-
let s = [];
|
|
4097
|
-
for (let o = 0, a = e.length; o < a; ++o) {
|
|
4098
|
-
const l = e[o];
|
|
4099
|
-
s = Te(
|
|
4100
|
-
n,
|
|
4101
|
-
t,
|
|
4102
|
-
l,
|
|
4103
|
-
i,
|
|
4104
|
-
r,
|
|
4105
|
-
2 * o,
|
|
4106
|
-
s
|
|
4107
|
-
), t = l[l.length - 1];
|
|
4108
|
-
}
|
|
4109
|
-
return s;
|
|
4110
|
-
}
|
|
4111
|
-
function gs(n, t, e, i) {
|
|
4112
|
-
for (; t < e - i; ) {
|
|
4113
|
-
for (let r = 0; r < i; ++r) {
|
|
4114
|
-
const s = n[t + r];
|
|
4115
|
-
n[t + r] = n[e - i + r], n[e - i + r] = s;
|
|
4116
|
-
}
|
|
4117
|
-
t += i, e -= i;
|
|
4118
|
-
}
|
|
4119
|
-
}
|
|
4120
|
-
function Re(n, t, e, i) {
|
|
4121
|
-
let r = 0, s = n[e - i], o = n[e - i + 1];
|
|
4122
|
-
for (; t < e; t += i) {
|
|
4123
|
-
const a = n[t], l = n[t + 1];
|
|
4124
|
-
r += (a - s) * (l + o), s = a, o = l;
|
|
4125
|
-
}
|
|
4126
|
-
return r === 0 ? void 0 : r > 0;
|
|
4127
|
-
}
|
|
4128
|
-
function Le(n, t, e, i, r) {
|
|
4129
|
-
r = r !== void 0 ? r : !1;
|
|
4130
|
-
for (let s = 0, o = e.length; s < o; ++s) {
|
|
4131
|
-
const a = e[s], l = Re(
|
|
4132
|
-
n,
|
|
4133
|
-
t,
|
|
4134
|
-
a,
|
|
4135
|
-
i
|
|
4136
|
-
);
|
|
4137
|
-
if (s === 0) {
|
|
4138
|
-
if (r && l || !r && !l)
|
|
4139
|
-
return !1;
|
|
4140
|
-
} else if (r && !l || !r && l)
|
|
4141
|
-
return !1;
|
|
4142
|
-
t = a;
|
|
4143
|
-
}
|
|
4144
|
-
return !0;
|
|
4145
|
-
}
|
|
4146
|
-
function nn(n, t, e, i, r) {
|
|
4147
|
-
for (let s = 0, o = e.length; s < o; ++s) {
|
|
4148
|
-
const a = e[s];
|
|
4149
|
-
if (!Le(n, t, a, i, r))
|
|
4150
|
-
return !1;
|
|
4151
|
-
a.length && (t = a[a.length - 1]);
|
|
4152
|
-
}
|
|
4153
|
-
return !0;
|
|
4154
|
-
}
|
|
4155
|
-
function Ut(n, t, e, i, r) {
|
|
4156
|
-
r = r !== void 0 ? r : !1;
|
|
4157
|
-
for (let s = 0, o = e.length; s < o; ++s) {
|
|
4158
|
-
const a = e[s], l = Re(
|
|
4159
|
-
n,
|
|
4160
|
-
t,
|
|
4161
|
-
a,
|
|
4162
|
-
i
|
|
4163
|
-
);
|
|
4164
|
-
(s === 0 ? r && l || !r && !l : r && !l || !r && l) && gs(n, t, a, i), t = a;
|
|
4165
|
-
}
|
|
4166
|
-
return t;
|
|
4167
|
-
}
|
|
4168
|
-
function ce(n, t, e, i, r) {
|
|
4169
|
-
for (let s = 0, o = e.length; s < o; ++s)
|
|
4170
|
-
t = Ut(
|
|
4171
|
-
n,
|
|
4172
|
-
t,
|
|
4173
|
-
e[s],
|
|
4174
|
-
i,
|
|
4175
|
-
r
|
|
4176
|
-
);
|
|
4177
|
-
return t;
|
|
4178
|
-
}
|
|
4179
|
-
function fs(n, t) {
|
|
4180
|
-
const e = [];
|
|
4181
|
-
let i = 0, r = 0, s;
|
|
4182
|
-
for (let o = 0, a = t.length; o < a; ++o) {
|
|
4183
|
-
const l = t[o], h = Re(n, i, l, 2);
|
|
4184
|
-
if (s === void 0 && (s = h), h === s)
|
|
4185
|
-
e.push(t.slice(r, o + 1));
|
|
4186
|
-
else {
|
|
4187
|
-
if (e.length === 0)
|
|
4188
|
-
continue;
|
|
4189
|
-
e[e.length - 1].push(t[r]);
|
|
4190
|
-
}
|
|
4191
|
-
r = o + 1, i = l;
|
|
4192
|
-
}
|
|
4193
|
-
return e;
|
|
4194
|
-
}
|
|
4195
|
-
class D extends q {
|
|
4177
|
+
class J extends Z {
|
|
4196
4178
|
/**
|
|
4197
4179
|
* @param {!Array<Array<import("../coordinate.js").Coordinate>>|!Array<number>} coordinates
|
|
4198
4180
|
* Array of linear rings that define the polygon. The first linear ring of the
|
|
@@ -4230,7 +4212,7 @@ class D extends q {
|
|
|
4230
4212
|
* @override
|
|
4231
4213
|
*/
|
|
4232
4214
|
clone() {
|
|
4233
|
-
const t = new
|
|
4215
|
+
const t = new J(
|
|
4234
4216
|
this.flatCoordinates.slice(),
|
|
4235
4217
|
this.layout,
|
|
4236
4218
|
this.ends_.slice()
|
|
@@ -4246,15 +4228,15 @@ class D extends q {
|
|
|
4246
4228
|
* @override
|
|
4247
4229
|
*/
|
|
4248
4230
|
closestPointXY(t, e, i, r) {
|
|
4249
|
-
return r <
|
|
4250
|
-
|
|
4231
|
+
return r < q(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
4232
|
+
Le(
|
|
4251
4233
|
this.flatCoordinates,
|
|
4252
4234
|
0,
|
|
4253
4235
|
this.ends_,
|
|
4254
4236
|
this.stride,
|
|
4255
4237
|
0
|
|
4256
4238
|
)
|
|
4257
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
4239
|
+
), this.maxDeltaRevision_ = this.getRevision()), Re(
|
|
4258
4240
|
this.flatCoordinates,
|
|
4259
4241
|
0,
|
|
4260
4242
|
this.ends_,
|
|
@@ -4274,7 +4256,7 @@ class D extends q {
|
|
|
4274
4256
|
* @override
|
|
4275
4257
|
*/
|
|
4276
4258
|
containsXY(t, e) {
|
|
4277
|
-
return
|
|
4259
|
+
return Me(
|
|
4278
4260
|
this.getOrientedFlatCoordinates(),
|
|
4279
4261
|
0,
|
|
4280
4262
|
this.ends_,
|
|
@@ -4289,7 +4271,7 @@ class D extends q {
|
|
|
4289
4271
|
* @api
|
|
4290
4272
|
*/
|
|
4291
4273
|
getArea() {
|
|
4292
|
-
return
|
|
4274
|
+
return nn(
|
|
4293
4275
|
this.getOrientedFlatCoordinates(),
|
|
4294
4276
|
0,
|
|
4295
4277
|
this.ends_,
|
|
@@ -4312,7 +4294,7 @@ class D extends q {
|
|
|
4312
4294
|
*/
|
|
4313
4295
|
getCoordinates(t) {
|
|
4314
4296
|
let e;
|
|
4315
|
-
return t !== void 0 ? (e = this.getOrientedFlatCoordinates().slice(),
|
|
4297
|
+
return t !== void 0 ? (e = this.getOrientedFlatCoordinates().slice(), jt(e, 0, this.ends_, this.stride, t)) : e = this.flatCoordinates, Te(e, 0, this.ends_, this.stride);
|
|
4316
4298
|
}
|
|
4317
4299
|
/**
|
|
4318
4300
|
* @return {Array<number>} Ends.
|
|
@@ -4325,8 +4307,8 @@ class D extends q {
|
|
|
4325
4307
|
*/
|
|
4326
4308
|
getFlatInteriorPoint() {
|
|
4327
4309
|
if (this.flatInteriorPointRevision_ != this.getRevision()) {
|
|
4328
|
-
const t =
|
|
4329
|
-
this.flatInteriorPoint_ =
|
|
4310
|
+
const t = Bt(this.getExtent());
|
|
4311
|
+
this.flatInteriorPoint_ = Se(
|
|
4330
4312
|
this.getOrientedFlatCoordinates(),
|
|
4331
4313
|
0,
|
|
4332
4314
|
this.ends_,
|
|
@@ -4401,7 +4383,7 @@ class D extends q {
|
|
|
4401
4383
|
getOrientedFlatCoordinates() {
|
|
4402
4384
|
if (this.orientedRevision_ != this.getRevision()) {
|
|
4403
4385
|
const t = this.flatCoordinates;
|
|
4404
|
-
|
|
4386
|
+
Ae(t, 0, this.ends_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = jt(
|
|
4405
4387
|
this.orientedFlatCoordinates_,
|
|
4406
4388
|
0,
|
|
4407
4389
|
this.ends_,
|
|
@@ -4421,7 +4403,7 @@ class D extends q {
|
|
|
4421
4403
|
*/
|
|
4422
4404
|
getSimplifiedGeometryInternal(t) {
|
|
4423
4405
|
const e = [], i = [];
|
|
4424
|
-
return e.length =
|
|
4406
|
+
return e.length = Fe(
|
|
4425
4407
|
this.flatCoordinates,
|
|
4426
4408
|
0,
|
|
4427
4409
|
this.ends_,
|
|
@@ -4430,7 +4412,7 @@ class D extends q {
|
|
|
4430
4412
|
e,
|
|
4431
4413
|
0,
|
|
4432
4414
|
i
|
|
4433
|
-
), new
|
|
4415
|
+
), new J(e, "XY", i);
|
|
4434
4416
|
}
|
|
4435
4417
|
/**
|
|
4436
4418
|
* Get the type of this geometry.
|
|
@@ -4449,7 +4431,7 @@ class D extends q {
|
|
|
4449
4431
|
* @override
|
|
4450
4432
|
*/
|
|
4451
4433
|
intersectsExtent(t) {
|
|
4452
|
-
return
|
|
4434
|
+
return sn(
|
|
4453
4435
|
this.getOrientedFlatCoordinates(),
|
|
4454
4436
|
0,
|
|
4455
4437
|
this.ends_,
|
|
@@ -4476,21 +4458,7 @@ class D extends q {
|
|
|
4476
4458
|
this.flatCoordinates.length = i.length === 0 ? 0 : i[i.length - 1], this.changed();
|
|
4477
4459
|
}
|
|
4478
4460
|
}
|
|
4479
|
-
|
|
4480
|
-
const r = [];
|
|
4481
|
-
let s = me();
|
|
4482
|
-
for (let o = 0, a = e.length; o < a; ++o) {
|
|
4483
|
-
const l = e[o];
|
|
4484
|
-
s = ve(
|
|
4485
|
-
n,
|
|
4486
|
-
t,
|
|
4487
|
-
l[0],
|
|
4488
|
-
i
|
|
4489
|
-
), r.push((s[0] + s[2]) / 2, (s[1] + s[3]) / 2), t = l[l.length - 1];
|
|
4490
|
-
}
|
|
4491
|
-
return r;
|
|
4492
|
-
}
|
|
4493
|
-
class wt extends q {
|
|
4461
|
+
class wt extends Z {
|
|
4494
4462
|
/**
|
|
4495
4463
|
* @param {Array<Array<Array<import("../coordinate.js").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates.
|
|
4496
4464
|
* For internal use, flat coordinates in combination with `layout` and `endss` are also accepted.
|
|
@@ -4564,15 +4532,15 @@ class wt extends q {
|
|
|
4564
4532
|
* @override
|
|
4565
4533
|
*/
|
|
4566
4534
|
closestPointXY(t, e, i, r) {
|
|
4567
|
-
return r <
|
|
4568
|
-
|
|
4535
|
+
return r < q(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
|
|
4536
|
+
hs(
|
|
4569
4537
|
this.flatCoordinates,
|
|
4570
4538
|
0,
|
|
4571
4539
|
this.endss_,
|
|
4572
4540
|
this.stride,
|
|
4573
4541
|
0
|
|
4574
4542
|
)
|
|
4575
|
-
), this.maxDeltaRevision_ = this.getRevision()),
|
|
4543
|
+
), this.maxDeltaRevision_ = this.getRevision()), cs(
|
|
4576
4544
|
this.getOrientedFlatCoordinates(),
|
|
4577
4545
|
0,
|
|
4578
4546
|
this.endss_,
|
|
@@ -4592,7 +4560,7 @@ class wt extends q {
|
|
|
4592
4560
|
* @override
|
|
4593
4561
|
*/
|
|
4594
4562
|
containsXY(t, e) {
|
|
4595
|
-
return
|
|
4563
|
+
return is(
|
|
4596
4564
|
this.getOrientedFlatCoordinates(),
|
|
4597
4565
|
0,
|
|
4598
4566
|
this.endss_,
|
|
@@ -4607,7 +4575,7 @@ class wt extends q {
|
|
|
4607
4575
|
* @api
|
|
4608
4576
|
*/
|
|
4609
4577
|
getArea() {
|
|
4610
|
-
return
|
|
4578
|
+
return ls(
|
|
4611
4579
|
this.getOrientedFlatCoordinates(),
|
|
4612
4580
|
0,
|
|
4613
4581
|
this.endss_,
|
|
@@ -4630,13 +4598,13 @@ class wt extends q {
|
|
|
4630
4598
|
*/
|
|
4631
4599
|
getCoordinates(t) {
|
|
4632
4600
|
let e;
|
|
4633
|
-
return t !== void 0 ? (e = this.getOrientedFlatCoordinates().slice(),
|
|
4601
|
+
return t !== void 0 ? (e = this.getOrientedFlatCoordinates().slice(), ue(
|
|
4634
4602
|
e,
|
|
4635
4603
|
0,
|
|
4636
4604
|
this.endss_,
|
|
4637
4605
|
this.stride,
|
|
4638
4606
|
t
|
|
4639
|
-
)) : e = this.flatCoordinates,
|
|
4607
|
+
)) : e = this.flatCoordinates, us(
|
|
4640
4608
|
e,
|
|
4641
4609
|
0,
|
|
4642
4610
|
this.endss_,
|
|
@@ -4654,13 +4622,13 @@ class wt extends q {
|
|
|
4654
4622
|
*/
|
|
4655
4623
|
getFlatInteriorPoints() {
|
|
4656
4624
|
if (this.flatInteriorPointsRevision_ != this.getRevision()) {
|
|
4657
|
-
const t =
|
|
4625
|
+
const t = Ki(
|
|
4658
4626
|
this.flatCoordinates,
|
|
4659
4627
|
0,
|
|
4660
4628
|
this.endss_,
|
|
4661
4629
|
this.stride
|
|
4662
4630
|
);
|
|
4663
|
-
this.flatInteriorPoints_ =
|
|
4631
|
+
this.flatInteriorPoints_ = Di(
|
|
4664
4632
|
this.getOrientedFlatCoordinates(),
|
|
4665
4633
|
0,
|
|
4666
4634
|
this.endss_,
|
|
@@ -4688,7 +4656,7 @@ class wt extends q {
|
|
|
4688
4656
|
getOrientedFlatCoordinates() {
|
|
4689
4657
|
if (this.orientedRevision_ != this.getRevision()) {
|
|
4690
4658
|
const t = this.flatCoordinates;
|
|
4691
|
-
|
|
4659
|
+
Qi(t, 0, this.endss_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = ue(
|
|
4692
4660
|
this.orientedFlatCoordinates_,
|
|
4693
4661
|
0,
|
|
4694
4662
|
this.endss_,
|
|
@@ -4708,7 +4676,7 @@ class wt extends q {
|
|
|
4708
4676
|
*/
|
|
4709
4677
|
getSimplifiedGeometryInternal(t) {
|
|
4710
4678
|
const e = [], i = [];
|
|
4711
|
-
return e.length =
|
|
4679
|
+
return e.length = as(
|
|
4712
4680
|
this.flatCoordinates,
|
|
4713
4681
|
0,
|
|
4714
4682
|
this.endss_,
|
|
@@ -4739,7 +4707,7 @@ class wt extends q {
|
|
|
4739
4707
|
if (e !== 0)
|
|
4740
4708
|
for (let s = 0, o = i.length; s < o; ++s)
|
|
4741
4709
|
i[s] -= e;
|
|
4742
|
-
return new
|
|
4710
|
+
return new J(
|
|
4743
4711
|
this.flatCoordinates.slice(e, r),
|
|
4744
4712
|
this.layout,
|
|
4745
4713
|
i
|
|
@@ -4758,7 +4726,7 @@ class wt extends q {
|
|
|
4758
4726
|
if (s !== 0)
|
|
4759
4727
|
for (let u = 0, d = l.length; u < d; ++u)
|
|
4760
4728
|
l[u] -= s;
|
|
4761
|
-
const c = new
|
|
4729
|
+
const c = new J(
|
|
4762
4730
|
e.slice(s, h),
|
|
4763
4731
|
t,
|
|
4764
4732
|
l
|
|
@@ -4784,7 +4752,7 @@ class wt extends q {
|
|
|
4784
4752
|
* @override
|
|
4785
4753
|
*/
|
|
4786
4754
|
intersectsExtent(t) {
|
|
4787
|
-
return
|
|
4755
|
+
return fs(
|
|
4788
4756
|
this.getOrientedFlatCoordinates(),
|
|
4789
4757
|
0,
|
|
4790
4758
|
this.endss_,
|
|
@@ -4801,7 +4769,7 @@ class wt extends q {
|
|
|
4801
4769
|
*/
|
|
4802
4770
|
setCoordinates(t, e) {
|
|
4803
4771
|
this.setLayout(e, t, 3), this.flatCoordinates || (this.flatCoordinates = []);
|
|
4804
|
-
const i =
|
|
4772
|
+
const i = Zi(
|
|
4805
4773
|
this.flatCoordinates,
|
|
4806
4774
|
0,
|
|
4807
4775
|
t,
|
|
@@ -4817,8 +4785,8 @@ class wt extends q {
|
|
|
4817
4785
|
this.changed();
|
|
4818
4786
|
}
|
|
4819
4787
|
}
|
|
4820
|
-
const
|
|
4821
|
-
class
|
|
4788
|
+
const mi = zi();
|
|
4789
|
+
class W {
|
|
4822
4790
|
/**
|
|
4823
4791
|
* @param {Type} type Geometry type.
|
|
4824
4792
|
* @param {Array<number>} flatCoordinates Flat coordinates. These always need
|
|
@@ -4846,7 +4814,7 @@ class J {
|
|
|
4846
4814
|
* @api
|
|
4847
4815
|
*/
|
|
4848
4816
|
getExtent() {
|
|
4849
|
-
return this.extent_ || (this.extent_ = this.type_ === "Point" ?
|
|
4817
|
+
return this.extent_ || (this.extent_ = this.type_ === "Point" ? ki(this.flatCoordinates_) : Ce(
|
|
4850
4818
|
this.flatCoordinates_,
|
|
4851
4819
|
0,
|
|
4852
4820
|
this.flatCoordinates_.length,
|
|
@@ -4858,8 +4826,8 @@ class J {
|
|
|
4858
4826
|
*/
|
|
4859
4827
|
getFlatInteriorPoint() {
|
|
4860
4828
|
if (!this.flatInteriorPoints_) {
|
|
4861
|
-
const t =
|
|
4862
|
-
this.flatInteriorPoints_ =
|
|
4829
|
+
const t = Bt(this.getExtent());
|
|
4830
|
+
this.flatInteriorPoints_ = Se(
|
|
4863
4831
|
this.flatCoordinates_,
|
|
4864
4832
|
0,
|
|
4865
4833
|
this.ends_,
|
|
@@ -4875,8 +4843,8 @@ class J {
|
|
|
4875
4843
|
*/
|
|
4876
4844
|
getFlatInteriorPoints() {
|
|
4877
4845
|
if (!this.flatInteriorPoints_) {
|
|
4878
|
-
const t =
|
|
4879
|
-
this.flatInteriorPoints_ =
|
|
4846
|
+
const t = ss(this.flatCoordinates_, this.ends_), e = Ki(this.flatCoordinates_, 0, t, 2);
|
|
4847
|
+
this.flatInteriorPoints_ = Di(
|
|
4880
4848
|
this.flatCoordinates_,
|
|
4881
4849
|
0,
|
|
4882
4850
|
t,
|
|
@@ -4890,7 +4858,7 @@ class J {
|
|
|
4890
4858
|
* @return {Array<number>} Flat midpoint.
|
|
4891
4859
|
*/
|
|
4892
4860
|
getFlatMidpoint() {
|
|
4893
|
-
return this.flatMidpoints_ || (this.flatMidpoints_ =
|
|
4861
|
+
return this.flatMidpoints_ || (this.flatMidpoints_ = Ut(
|
|
4894
4862
|
this.flatCoordinates_,
|
|
4895
4863
|
0,
|
|
4896
4864
|
this.flatCoordinates_.length,
|
|
@@ -4911,7 +4879,7 @@ class J {
|
|
|
4911
4879
|
this.ends_
|
|
4912
4880
|
);
|
|
4913
4881
|
for (let r = 0, s = i.length; r < s; ++r) {
|
|
4914
|
-
const o = i[r], a =
|
|
4882
|
+
const o = i[r], a = Ut(t, e, o, 2, 0.5);
|
|
4915
4883
|
A(this.flatMidpoints_, a), e = o;
|
|
4916
4884
|
}
|
|
4917
4885
|
}
|
|
@@ -5002,9 +4970,9 @@ class J {
|
|
|
5002
4970
|
t = x(t);
|
|
5003
4971
|
const e = t.getExtent(), i = t.getWorldExtent();
|
|
5004
4972
|
if (e && i) {
|
|
5005
|
-
const r =
|
|
5006
|
-
|
|
5007
|
-
|
|
4973
|
+
const r = Ot(i) / Ot(e);
|
|
4974
|
+
Ji(
|
|
4975
|
+
mi,
|
|
5008
4976
|
i[0],
|
|
5009
4977
|
i[3],
|
|
5010
4978
|
r,
|
|
@@ -5012,12 +4980,12 @@ class J {
|
|
|
5012
4980
|
0,
|
|
5013
4981
|
0,
|
|
5014
4982
|
0
|
|
5015
|
-
),
|
|
4983
|
+
), Wi(
|
|
5016
4984
|
this.flatCoordinates_,
|
|
5017
4985
|
0,
|
|
5018
4986
|
this.flatCoordinates_.length,
|
|
5019
4987
|
2,
|
|
5020
|
-
|
|
4988
|
+
mi,
|
|
5021
4989
|
this.flatCoordinates_
|
|
5022
4990
|
);
|
|
5023
4991
|
}
|
|
@@ -5037,7 +5005,7 @@ class J {
|
|
|
5037
5005
|
*/
|
|
5038
5006
|
clone() {
|
|
5039
5007
|
var t;
|
|
5040
|
-
return new
|
|
5008
|
+
return new W(
|
|
5041
5009
|
this.type_,
|
|
5042
5010
|
this.flatCoordinates_.slice(),
|
|
5043
5011
|
(t = this.ends_) == null ? void 0 : t.slice(),
|
|
@@ -5065,7 +5033,7 @@ class J {
|
|
|
5065
5033
|
let r;
|
|
5066
5034
|
switch (this.type_) {
|
|
5067
5035
|
case "LineString":
|
|
5068
|
-
i.length =
|
|
5036
|
+
i.length = Wt(
|
|
5069
5037
|
i,
|
|
5070
5038
|
0,
|
|
5071
5039
|
this.simplifiedGeometry_.flatCoordinates_.length,
|
|
@@ -5076,7 +5044,7 @@ class J {
|
|
|
5076
5044
|
), r = [i.length];
|
|
5077
5045
|
break;
|
|
5078
5046
|
case "MultiLineString":
|
|
5079
|
-
r = [], i.length =
|
|
5047
|
+
r = [], i.length = tn(
|
|
5080
5048
|
i,
|
|
5081
5049
|
0,
|
|
5082
5050
|
this.simplifiedGeometry_.ends_,
|
|
@@ -5088,7 +5056,7 @@ class J {
|
|
|
5088
5056
|
);
|
|
5089
5057
|
break;
|
|
5090
5058
|
case "Polygon":
|
|
5091
|
-
r = [], i.length =
|
|
5059
|
+
r = [], i.length = Fe(
|
|
5092
5060
|
i,
|
|
5093
5061
|
0,
|
|
5094
5062
|
this.simplifiedGeometry_.ends_,
|
|
@@ -5100,7 +5068,7 @@ class J {
|
|
|
5100
5068
|
);
|
|
5101
5069
|
break;
|
|
5102
5070
|
}
|
|
5103
|
-
return r && (this.simplifiedGeometry_ = new
|
|
5071
|
+
return r && (this.simplifiedGeometry_ = new W(
|
|
5104
5072
|
this.type_,
|
|
5105
5073
|
i,
|
|
5106
5074
|
r,
|
|
@@ -5111,8 +5079,8 @@ class J {
|
|
|
5111
5079
|
}), this;
|
|
5112
5080
|
}
|
|
5113
5081
|
}
|
|
5114
|
-
|
|
5115
|
-
class
|
|
5082
|
+
W.prototype.getFlatCoordinates = W.prototype.getOrientedFlatCoordinates;
|
|
5083
|
+
class on {
|
|
5116
5084
|
constructor() {
|
|
5117
5085
|
this.dataProjection = void 0, this.defaultFeatureProjection = void 0, this.featureClass = /** @type {FeatureToFeatureClass<FeatureType>} */
|
|
5118
5086
|
lt, this.supportedMediaTypes = null;
|
|
@@ -5237,14 +5205,14 @@ class sn {
|
|
|
5237
5205
|
return y();
|
|
5238
5206
|
}
|
|
5239
5207
|
}
|
|
5240
|
-
function
|
|
5208
|
+
function bt(n, t, e) {
|
|
5241
5209
|
const i = e ? x(e.featureProjection) : null, r = e ? x(e.dataProjection) : null;
|
|
5242
5210
|
let s = n;
|
|
5243
|
-
if (i && r && !
|
|
5211
|
+
if (i && r && !Wr(i, r)) {
|
|
5244
5212
|
t && (s = /** @type {T} */
|
|
5245
5213
|
n.clone());
|
|
5246
5214
|
const o = t ? i : r, a = t ? r : i;
|
|
5247
|
-
o.getUnits() === "tile-pixels" ? s.transform(o, a) : s.applyTransform(
|
|
5215
|
+
o.getUnits() === "tile-pixels" ? s.transform(o, a) : s.applyTransform(he(o, a));
|
|
5248
5216
|
}
|
|
5249
5217
|
if (t && e && /** @type {WriteOptions} */
|
|
5250
5218
|
e.decimals !== void 0) {
|
|
@@ -5262,32 +5230,32 @@ function Et(n, t, e) {
|
|
|
5262
5230
|
}
|
|
5263
5231
|
return s;
|
|
5264
5232
|
}
|
|
5265
|
-
const
|
|
5233
|
+
const ys = {
|
|
5266
5234
|
Point: z,
|
|
5267
5235
|
LineString: V,
|
|
5268
|
-
Polygon:
|
|
5236
|
+
Polygon: J,
|
|
5269
5237
|
MultiPoint: At,
|
|
5270
5238
|
MultiLineString: Ct,
|
|
5271
5239
|
MultiPolygon: wt
|
|
5272
5240
|
};
|
|
5273
|
-
function
|
|
5274
|
-
return Array.isArray(t[0]) ? (
|
|
5241
|
+
function ms(n, t, e) {
|
|
5242
|
+
return Array.isArray(t[0]) ? (Qi(n, 0, t, e) || (n = n.slice(), ue(n, 0, t, e)), n) : (Ae(n, 0, t, e) || (n = n.slice(), jt(n, 0, t, e)), n);
|
|
5275
5243
|
}
|
|
5276
|
-
function
|
|
5244
|
+
function an(n, t) {
|
|
5277
5245
|
var s;
|
|
5278
5246
|
const e = n.geometry;
|
|
5279
5247
|
if (!e)
|
|
5280
5248
|
return [];
|
|
5281
5249
|
if (Array.isArray(e))
|
|
5282
|
-
return e.map((o) =>
|
|
5250
|
+
return e.map((o) => an({ ...n, geometry: o })).flat();
|
|
5283
5251
|
const i = e.type === "MultiPolygon" ? "Polygon" : e.type;
|
|
5284
5252
|
if (i === "GeometryCollection" || i === "Circle")
|
|
5285
5253
|
throw new Error("Unsupported geometry type: " + i);
|
|
5286
5254
|
const r = e.layout.length;
|
|
5287
|
-
return
|
|
5288
|
-
new
|
|
5255
|
+
return bt(
|
|
5256
|
+
new W(
|
|
5289
5257
|
i,
|
|
5290
|
-
i === "Polygon" ?
|
|
5258
|
+
i === "Polygon" ? ms(e.flatCoordinates, e.ends, r) : e.flatCoordinates,
|
|
5291
5259
|
(s = e.ends) == null ? void 0 : s.flat(),
|
|
5292
5260
|
r,
|
|
5293
5261
|
n.properties || {},
|
|
@@ -5297,23 +5265,23 @@ function on(n, t) {
|
|
|
5297
5265
|
t
|
|
5298
5266
|
);
|
|
5299
5267
|
}
|
|
5300
|
-
function
|
|
5268
|
+
function Ne(n, t) {
|
|
5301
5269
|
if (!n)
|
|
5302
5270
|
return null;
|
|
5303
5271
|
if (Array.isArray(n)) {
|
|
5304
5272
|
const i = n.map(
|
|
5305
|
-
(r) =>
|
|
5273
|
+
(r) => Ne(r, t)
|
|
5306
5274
|
);
|
|
5307
5275
|
return new B(i);
|
|
5308
5276
|
}
|
|
5309
|
-
const e =
|
|
5310
|
-
return
|
|
5311
|
-
new e(n.flatCoordinates, n.layout, n.ends),
|
|
5277
|
+
const e = ys[n.type];
|
|
5278
|
+
return bt(
|
|
5279
|
+
new e(n.flatCoordinates, n.layout || "XY", n.ends),
|
|
5312
5280
|
!1,
|
|
5313
5281
|
t
|
|
5314
5282
|
);
|
|
5315
5283
|
}
|
|
5316
|
-
class
|
|
5284
|
+
class _s extends on {
|
|
5317
5285
|
constructor() {
|
|
5318
5286
|
super();
|
|
5319
5287
|
}
|
|
@@ -5336,7 +5304,7 @@ class ms extends sn {
|
|
|
5336
5304
|
*/
|
|
5337
5305
|
readFeature(t, e) {
|
|
5338
5306
|
return this.readFeatureFromObject(
|
|
5339
|
-
|
|
5307
|
+
Gt(t),
|
|
5340
5308
|
this.getReadOptions(t, e)
|
|
5341
5309
|
);
|
|
5342
5310
|
}
|
|
@@ -5352,7 +5320,7 @@ class ms extends sn {
|
|
|
5352
5320
|
*/
|
|
5353
5321
|
readFeatures(t, e) {
|
|
5354
5322
|
return this.readFeaturesFromObject(
|
|
5355
|
-
|
|
5323
|
+
Gt(t),
|
|
5356
5324
|
this.getReadOptions(t, e)
|
|
5357
5325
|
);
|
|
5358
5326
|
}
|
|
@@ -5387,7 +5355,7 @@ class ms extends sn {
|
|
|
5387
5355
|
*/
|
|
5388
5356
|
readGeometry(t, e) {
|
|
5389
5357
|
return this.readGeometryFromObject(
|
|
5390
|
-
|
|
5358
|
+
Gt(t),
|
|
5391
5359
|
this.getReadOptions(t, e)
|
|
5392
5360
|
);
|
|
5393
5361
|
}
|
|
@@ -5410,7 +5378,7 @@ class ms extends sn {
|
|
|
5410
5378
|
* @override
|
|
5411
5379
|
*/
|
|
5412
5380
|
readProjection(t) {
|
|
5413
|
-
return this.readProjectionFromObject(
|
|
5381
|
+
return this.readProjectionFromObject(Gt(t));
|
|
5414
5382
|
}
|
|
5415
5383
|
/**
|
|
5416
5384
|
* @abstract
|
|
@@ -5485,14 +5453,14 @@ class ms extends sn {
|
|
|
5485
5453
|
return y();
|
|
5486
5454
|
}
|
|
5487
5455
|
}
|
|
5488
|
-
function
|
|
5456
|
+
function Gt(n) {
|
|
5489
5457
|
if (typeof n == "string") {
|
|
5490
5458
|
const t = JSON.parse(n);
|
|
5491
5459
|
return t || null;
|
|
5492
5460
|
}
|
|
5493
5461
|
return n !== null ? n : null;
|
|
5494
5462
|
}
|
|
5495
|
-
class
|
|
5463
|
+
class vs extends _s {
|
|
5496
5464
|
/**
|
|
5497
5465
|
* @param {Options<FeatureType>} [options] Options.
|
|
5498
5466
|
*/
|
|
@@ -5522,11 +5490,11 @@ class _s extends ms {
|
|
|
5522
5490
|
),
|
|
5523
5491
|
properties: null
|
|
5524
5492
|
};
|
|
5525
|
-
const r =
|
|
5526
|
-
if (this.featureClass ===
|
|
5493
|
+
const r = Oe(i.geometry);
|
|
5494
|
+
if (this.featureClass === W)
|
|
5527
5495
|
return (
|
|
5528
5496
|
/** @type {FeatureType|Array<FeatureType>} */
|
|
5529
|
-
|
|
5497
|
+
an(
|
|
5530
5498
|
{
|
|
5531
5499
|
geometry: r,
|
|
5532
5500
|
id: i.id,
|
|
@@ -5536,7 +5504,7 @@ class _s extends ms {
|
|
|
5536
5504
|
)
|
|
5537
5505
|
);
|
|
5538
5506
|
const s = new lt();
|
|
5539
|
-
return this.geometryName_ ? s.setGeometryName(this.geometryName_) : this.extractGeometryName_ && i.geometry_name && s.setGeometryName(i.geometry_name), s.setGeometry(
|
|
5507
|
+
return this.geometryName_ ? s.setGeometryName(this.geometryName_) : this.extractGeometryName_ && i.geometry_name && s.setGeometryName(i.geometry_name), s.setGeometry(Ne(r, e)), "id" in i && s.setId(i.id), i.properties && s.setProperties(i.properties, !0), /** @type {FeatureType|Array<FeatureType>} */
|
|
5540
5508
|
s;
|
|
5541
5509
|
}
|
|
5542
5510
|
/**
|
|
@@ -5581,7 +5549,7 @@ class _s extends ms {
|
|
|
5581
5549
|
* @override
|
|
5582
5550
|
*/
|
|
5583
5551
|
readGeometryFromObject(t, e) {
|
|
5584
|
-
return
|
|
5552
|
+
return Cs(t, e);
|
|
5585
5553
|
}
|
|
5586
5554
|
/**
|
|
5587
5555
|
* @param {Object} object Object.
|
|
@@ -5625,7 +5593,7 @@ class _s extends ms {
|
|
|
5625
5593
|
if (r !== void 0 && (i.id = r), !t.hasProperties())
|
|
5626
5594
|
return i;
|
|
5627
5595
|
const s = t.getProperties(), o = t.getGeometry();
|
|
5628
|
-
return o && (i.geometry =
|
|
5596
|
+
return o && (i.geometry = de(o, e), delete s[t.getGeometryName()]), Ii(s) || (i.properties = s), i;
|
|
5629
5597
|
}
|
|
5630
5598
|
/**
|
|
5631
5599
|
* Encode an array of features as a GeoJSON object.
|
|
@@ -5656,16 +5624,16 @@ class _s extends ms {
|
|
|
5656
5624
|
* @override
|
|
5657
5625
|
*/
|
|
5658
5626
|
writeGeometryObject(t, e) {
|
|
5659
|
-
return
|
|
5627
|
+
return de(t, this.adaptOptions(e));
|
|
5660
5628
|
}
|
|
5661
5629
|
}
|
|
5662
|
-
function
|
|
5630
|
+
function Oe(n, t) {
|
|
5663
5631
|
if (!n)
|
|
5664
5632
|
return null;
|
|
5665
5633
|
let e;
|
|
5666
5634
|
switch (n.type) {
|
|
5667
5635
|
case "Point": {
|
|
5668
|
-
e =
|
|
5636
|
+
e = bs(
|
|
5669
5637
|
/** @type {GeoJSONPoint} */
|
|
5670
5638
|
n
|
|
5671
5639
|
);
|
|
@@ -5679,35 +5647,35 @@ function Ne(n, t) {
|
|
|
5679
5647
|
break;
|
|
5680
5648
|
}
|
|
5681
5649
|
case "Polygon": {
|
|
5682
|
-
e =
|
|
5650
|
+
e = Ss(
|
|
5683
5651
|
/** @type {GeoJSONPolygon} */
|
|
5684
5652
|
n
|
|
5685
5653
|
);
|
|
5686
5654
|
break;
|
|
5687
5655
|
}
|
|
5688
5656
|
case "MultiPoint": {
|
|
5689
|
-
e =
|
|
5657
|
+
e = Ps(
|
|
5690
5658
|
/** @type {GeoJSONMultiPoint} */
|
|
5691
5659
|
n
|
|
5692
5660
|
);
|
|
5693
5661
|
break;
|
|
5694
5662
|
}
|
|
5695
5663
|
case "MultiLineString": {
|
|
5696
|
-
e =
|
|
5664
|
+
e = xs(
|
|
5697
5665
|
/** @type {GeoJSONMultiLineString} */
|
|
5698
5666
|
n
|
|
5699
5667
|
);
|
|
5700
5668
|
break;
|
|
5701
5669
|
}
|
|
5702
5670
|
case "MultiPolygon": {
|
|
5703
|
-
e =
|
|
5671
|
+
e = Ms(
|
|
5704
5672
|
/** @type {GeoJSONMultiPolygon} */
|
|
5705
5673
|
n
|
|
5706
5674
|
);
|
|
5707
5675
|
break;
|
|
5708
5676
|
}
|
|
5709
5677
|
case "GeometryCollection": {
|
|
5710
|
-
e =
|
|
5678
|
+
e = ws(
|
|
5711
5679
|
/** @type {GeoJSONGeometryCollection} */
|
|
5712
5680
|
n
|
|
5713
5681
|
);
|
|
@@ -5718,27 +5686,27 @@ function Ne(n, t) {
|
|
|
5718
5686
|
}
|
|
5719
5687
|
return e;
|
|
5720
5688
|
}
|
|
5721
|
-
function vs(n, t) {
|
|
5722
|
-
const e = Ne(n);
|
|
5723
|
-
return Ie(e, t);
|
|
5724
|
-
}
|
|
5725
5689
|
function Cs(n, t) {
|
|
5690
|
+
const e = Oe(n);
|
|
5691
|
+
return Ne(e, t);
|
|
5692
|
+
}
|
|
5693
|
+
function ws(n, t) {
|
|
5726
5694
|
return n.geometries.map(
|
|
5727
5695
|
/**
|
|
5728
5696
|
* @param {GeoJSONGeometry} geometry Geometry.
|
|
5729
5697
|
* @return {import("./Feature.js").GeometryObject} geometry Geometry.
|
|
5730
5698
|
*/
|
|
5731
5699
|
function(i) {
|
|
5732
|
-
return
|
|
5700
|
+
return Oe(i);
|
|
5733
5701
|
}
|
|
5734
5702
|
);
|
|
5735
5703
|
}
|
|
5736
|
-
function
|
|
5704
|
+
function bs(n) {
|
|
5737
5705
|
const t = n.coordinates;
|
|
5738
5706
|
return {
|
|
5739
5707
|
type: "Point",
|
|
5740
5708
|
flatCoordinates: t,
|
|
5741
|
-
layout:
|
|
5709
|
+
layout: K(t.length)
|
|
5742
5710
|
};
|
|
5743
5711
|
}
|
|
5744
5712
|
function Es(n) {
|
|
@@ -5748,31 +5716,31 @@ function Es(n) {
|
|
|
5748
5716
|
type: "LineString",
|
|
5749
5717
|
flatCoordinates: e,
|
|
5750
5718
|
ends: [e.length],
|
|
5751
|
-
layout:
|
|
5719
|
+
layout: K(((i = t[0]) == null ? void 0 : i.length) || 2)
|
|
5752
5720
|
};
|
|
5753
5721
|
}
|
|
5754
|
-
function
|
|
5722
|
+
function xs(n) {
|
|
5755
5723
|
var s, o;
|
|
5756
5724
|
const t = n.coordinates, e = ((o = (s = t[0]) == null ? void 0 : s[0]) == null ? void 0 : o.length) || 2, i = [], r = $t(i, 0, t, e);
|
|
5757
5725
|
return {
|
|
5758
5726
|
type: "MultiLineString",
|
|
5759
5727
|
flatCoordinates: i,
|
|
5760
5728
|
ends: r,
|
|
5761
|
-
layout:
|
|
5729
|
+
layout: K(e)
|
|
5762
5730
|
};
|
|
5763
5731
|
}
|
|
5764
|
-
function
|
|
5732
|
+
function Ps(n) {
|
|
5765
5733
|
var e;
|
|
5766
5734
|
const t = n.coordinates;
|
|
5767
5735
|
return {
|
|
5768
5736
|
type: "MultiPoint",
|
|
5769
5737
|
flatCoordinates: t.flat(),
|
|
5770
|
-
layout:
|
|
5738
|
+
layout: K(((e = t[0]) == null ? void 0 : e.length) || 2)
|
|
5771
5739
|
};
|
|
5772
5740
|
}
|
|
5773
|
-
function
|
|
5741
|
+
function Ms(n) {
|
|
5774
5742
|
var s, o;
|
|
5775
|
-
const t = n.coordinates, e = [], i = ((o = (s = t[0]) == null ? void 0 : s[0]) == null ? void 0 : o[0].length) || 2, r =
|
|
5743
|
+
const t = n.coordinates, e = [], i = ((o = (s = t[0]) == null ? void 0 : s[0]) == null ? void 0 : o[0].length) || 2, r = Zi(
|
|
5776
5744
|
e,
|
|
5777
5745
|
0,
|
|
5778
5746
|
t,
|
|
@@ -5782,26 +5750,26 @@ function Ps(n) {
|
|
|
5782
5750
|
type: "MultiPolygon",
|
|
5783
5751
|
flatCoordinates: e,
|
|
5784
5752
|
ends: r,
|
|
5785
|
-
layout:
|
|
5753
|
+
layout: K(i)
|
|
5786
5754
|
};
|
|
5787
5755
|
}
|
|
5788
|
-
function
|
|
5756
|
+
function Ss(n) {
|
|
5789
5757
|
var s, o;
|
|
5790
5758
|
const t = n.coordinates, e = [], i = (o = (s = t[0]) == null ? void 0 : s[0]) == null ? void 0 : o.length, r = $t(e, 0, t, i);
|
|
5791
5759
|
return {
|
|
5792
5760
|
type: "Polygon",
|
|
5793
5761
|
flatCoordinates: e,
|
|
5794
5762
|
ends: r,
|
|
5795
|
-
layout:
|
|
5763
|
+
layout: K(i)
|
|
5796
5764
|
};
|
|
5797
5765
|
}
|
|
5798
|
-
function
|
|
5799
|
-
n =
|
|
5766
|
+
function de(n, t) {
|
|
5767
|
+
n = bt(n, !0, t);
|
|
5800
5768
|
const e = n.getType();
|
|
5801
5769
|
let i;
|
|
5802
5770
|
switch (e) {
|
|
5803
5771
|
case "Point": {
|
|
5804
|
-
i =
|
|
5772
|
+
i = Is(
|
|
5805
5773
|
/** @type {import("../geom/Point.js").default} */
|
|
5806
5774
|
n
|
|
5807
5775
|
);
|
|
@@ -5823,21 +5791,21 @@ function ue(n, t) {
|
|
|
5823
5791
|
break;
|
|
5824
5792
|
}
|
|
5825
5793
|
case "MultiPoint": {
|
|
5826
|
-
i =
|
|
5794
|
+
i = Gs(
|
|
5827
5795
|
/** @type {import("../geom/MultiPoint.js").default} */
|
|
5828
5796
|
n
|
|
5829
5797
|
);
|
|
5830
5798
|
break;
|
|
5831
5799
|
}
|
|
5832
5800
|
case "MultiLineString": {
|
|
5833
|
-
i =
|
|
5801
|
+
i = Fs(
|
|
5834
5802
|
/** @type {import("../geom/MultiLineString.js").default} */
|
|
5835
5803
|
n
|
|
5836
5804
|
);
|
|
5837
5805
|
break;
|
|
5838
5806
|
}
|
|
5839
5807
|
case "MultiPolygon": {
|
|
5840
|
-
i =
|
|
5808
|
+
i = Ls(
|
|
5841
5809
|
/** @type {import("../geom/MultiPolygon.js").default} */
|
|
5842
5810
|
n,
|
|
5843
5811
|
t
|
|
@@ -5868,7 +5836,7 @@ function $s(n, t) {
|
|
|
5868
5836
|
return t = Object.assign({}, t), delete t.featureProjection, {
|
|
5869
5837
|
type: "GeometryCollection",
|
|
5870
5838
|
geometries: n.getGeometriesArray().map(function(i) {
|
|
5871
|
-
return
|
|
5839
|
+
return de(i, t);
|
|
5872
5840
|
})
|
|
5873
5841
|
};
|
|
5874
5842
|
}
|
|
@@ -5878,26 +5846,26 @@ function As(n, t) {
|
|
|
5878
5846
|
coordinates: n.getCoordinates()
|
|
5879
5847
|
};
|
|
5880
5848
|
}
|
|
5881
|
-
function
|
|
5849
|
+
function Fs(n, t) {
|
|
5882
5850
|
return {
|
|
5883
5851
|
type: "MultiLineString",
|
|
5884
5852
|
coordinates: n.getCoordinates()
|
|
5885
5853
|
};
|
|
5886
5854
|
}
|
|
5887
|
-
function
|
|
5855
|
+
function Gs(n, t) {
|
|
5888
5856
|
return {
|
|
5889
5857
|
type: "MultiPoint",
|
|
5890
5858
|
coordinates: n.getCoordinates()
|
|
5891
5859
|
};
|
|
5892
5860
|
}
|
|
5893
|
-
function
|
|
5861
|
+
function Ls(n, t) {
|
|
5894
5862
|
let e;
|
|
5895
5863
|
return t && (e = t.rightHanded), {
|
|
5896
5864
|
type: "MultiPolygon",
|
|
5897
5865
|
coordinates: n.getCoordinates(e)
|
|
5898
5866
|
};
|
|
5899
5867
|
}
|
|
5900
|
-
function
|
|
5868
|
+
function Is(n, t) {
|
|
5901
5869
|
return {
|
|
5902
5870
|
type: "Point",
|
|
5903
5871
|
coordinates: n.getCoordinates()
|
|
@@ -5910,8 +5878,8 @@ function Rs(n, t) {
|
|
|
5910
5878
|
coordinates: n.getCoordinates(e)
|
|
5911
5879
|
};
|
|
5912
5880
|
}
|
|
5913
|
-
const
|
|
5914
|
-
class
|
|
5881
|
+
const Ts = (n, t) => new vs().writeFeaturesObject(n, t);
|
|
5882
|
+
class Ns extends on {
|
|
5915
5883
|
constructor() {
|
|
5916
5884
|
super();
|
|
5917
5885
|
}
|
|
@@ -5933,7 +5901,7 @@ class Is extends sn {
|
|
|
5933
5901
|
*/
|
|
5934
5902
|
readFeature(t, e) {
|
|
5935
5903
|
return this.readFeatureFromText(
|
|
5936
|
-
|
|
5904
|
+
Lt(t),
|
|
5937
5905
|
this.adaptOptions(e)
|
|
5938
5906
|
);
|
|
5939
5907
|
}
|
|
@@ -5958,7 +5926,7 @@ class Is extends sn {
|
|
|
5958
5926
|
*/
|
|
5959
5927
|
readFeatures(t, e) {
|
|
5960
5928
|
return this.readFeaturesFromText(
|
|
5961
|
-
|
|
5929
|
+
Lt(t),
|
|
5962
5930
|
this.adaptOptions(e)
|
|
5963
5931
|
);
|
|
5964
5932
|
}
|
|
@@ -5983,7 +5951,7 @@ class Is extends sn {
|
|
|
5983
5951
|
*/
|
|
5984
5952
|
readGeometry(t, e) {
|
|
5985
5953
|
return this.readGeometryFromText(
|
|
5986
|
-
|
|
5954
|
+
Lt(t),
|
|
5987
5955
|
this.adaptOptions(e)
|
|
5988
5956
|
);
|
|
5989
5957
|
}
|
|
@@ -6006,7 +5974,7 @@ class Is extends sn {
|
|
|
6006
5974
|
* @override
|
|
6007
5975
|
*/
|
|
6008
5976
|
readProjection(t) {
|
|
6009
|
-
return this.readProjectionFromText(
|
|
5977
|
+
return this.readProjectionFromText(Lt(t));
|
|
6010
5978
|
}
|
|
6011
5979
|
/**
|
|
6012
5980
|
* @param {string} text Text.
|
|
@@ -6083,17 +6051,17 @@ class Is extends sn {
|
|
|
6083
6051
|
return y();
|
|
6084
6052
|
}
|
|
6085
6053
|
}
|
|
6086
|
-
function
|
|
6054
|
+
function Lt(n) {
|
|
6087
6055
|
return typeof n == "string" ? n : "";
|
|
6088
6056
|
}
|
|
6089
|
-
const
|
|
6057
|
+
const Os = {
|
|
6090
6058
|
POINT: z,
|
|
6091
6059
|
LINESTRING: V,
|
|
6092
|
-
POLYGON:
|
|
6060
|
+
POLYGON: J,
|
|
6093
6061
|
MULTIPOINT: At,
|
|
6094
6062
|
MULTILINESTRING: Ct,
|
|
6095
6063
|
MULTIPOLYGON: wt
|
|
6096
|
-
},
|
|
6064
|
+
}, ln = "EMPTY", hn = "Z", cn = "M", ks = "ZM", m = {
|
|
6097
6065
|
START: 0,
|
|
6098
6066
|
TEXT: 1,
|
|
6099
6067
|
LEFT_PAREN: 2,
|
|
@@ -6101,7 +6069,7 @@ const Ns = {
|
|
|
6101
6069
|
NUMBER: 4,
|
|
6102
6070
|
COMMA: 5,
|
|
6103
6071
|
EOF: 6
|
|
6104
|
-
},
|
|
6072
|
+
}, Hs = {
|
|
6105
6073
|
Point: "POINT",
|
|
6106
6074
|
LineString: "LINESTRING",
|
|
6107
6075
|
Polygon: "POLYGON",
|
|
@@ -6111,7 +6079,7 @@ const Ns = {
|
|
|
6111
6079
|
GeometryCollection: "GEOMETRYCOLLECTION",
|
|
6112
6080
|
Circle: "CIRCLE"
|
|
6113
6081
|
};
|
|
6114
|
-
class
|
|
6082
|
+
class Us {
|
|
6115
6083
|
/**
|
|
6116
6084
|
* @param {string} wkt WKT string.
|
|
6117
6085
|
*/
|
|
@@ -6209,7 +6177,7 @@ class Hs {
|
|
|
6209
6177
|
return this.wkt.substring(e, this.index_--).toUpperCase();
|
|
6210
6178
|
}
|
|
6211
6179
|
}
|
|
6212
|
-
class
|
|
6180
|
+
class js {
|
|
6213
6181
|
/**
|
|
6214
6182
|
* @param {Lexer} lexer The lexer.
|
|
6215
6183
|
*/
|
|
@@ -6260,7 +6228,7 @@ class Us {
|
|
|
6260
6228
|
const e = this.token_;
|
|
6261
6229
|
if (this.isTokenType(m.TEXT)) {
|
|
6262
6230
|
const i = e.value;
|
|
6263
|
-
i ===
|
|
6231
|
+
i === hn ? t = "XYZ" : i === cn ? t = "XYM" : i === ks && (t = "XYZM"), t !== "XY" && this.consume_();
|
|
6264
6232
|
}
|
|
6265
6233
|
return t;
|
|
6266
6234
|
}
|
|
@@ -6417,7 +6385,7 @@ class Us {
|
|
|
6417
6385
|
* @private
|
|
6418
6386
|
*/
|
|
6419
6387
|
isEmptyGeometry_() {
|
|
6420
|
-
const t = this.isTokenType(m.TEXT) && this.token_.value ==
|
|
6388
|
+
const t = this.isTokenType(m.TEXT) && this.token_.value == ln;
|
|
6421
6389
|
return t && this.consume_(), t;
|
|
6422
6390
|
}
|
|
6423
6391
|
/**
|
|
@@ -6447,7 +6415,7 @@ class Us {
|
|
|
6447
6415
|
const o = this.parseGeometryCollectionText_();
|
|
6448
6416
|
return new B(o);
|
|
6449
6417
|
}
|
|
6450
|
-
const r =
|
|
6418
|
+
const r = Os[e];
|
|
6451
6419
|
if (!r)
|
|
6452
6420
|
throw new Error("Invalid geometry type: " + e);
|
|
6453
6421
|
let s;
|
|
@@ -6485,7 +6453,7 @@ class Us {
|
|
|
6485
6453
|
throw new Error(this.formatErrorMessage_());
|
|
6486
6454
|
}
|
|
6487
6455
|
}
|
|
6488
|
-
class
|
|
6456
|
+
class Xs extends Ns {
|
|
6489
6457
|
/**
|
|
6490
6458
|
* @param {Options} [options] Options.
|
|
6491
6459
|
*/
|
|
@@ -6500,8 +6468,8 @@ class js extends Is {
|
|
|
6500
6468
|
* @private
|
|
6501
6469
|
*/
|
|
6502
6470
|
parse_(t) {
|
|
6503
|
-
const e = new
|
|
6504
|
-
return new
|
|
6471
|
+
const e = new Us(t);
|
|
6472
|
+
return new js(e).parse();
|
|
6505
6473
|
}
|
|
6506
6474
|
/**
|
|
6507
6475
|
* @protected
|
|
@@ -6542,7 +6510,7 @@ class js extends Is {
|
|
|
6542
6510
|
*/
|
|
6543
6511
|
readGeometryFromText(t, e) {
|
|
6544
6512
|
const i = this.parse_(t);
|
|
6545
|
-
return
|
|
6513
|
+
return bt(i, !1, e);
|
|
6546
6514
|
}
|
|
6547
6515
|
/**
|
|
6548
6516
|
* @param {import("../Feature.js").default} feature Features.
|
|
@@ -6579,105 +6547,105 @@ class js extends Is {
|
|
|
6579
6547
|
* @override
|
|
6580
6548
|
*/
|
|
6581
6549
|
writeGeometryText(t, e) {
|
|
6582
|
-
return
|
|
6550
|
+
return gn(bt(t, !0, e));
|
|
6583
6551
|
}
|
|
6584
6552
|
}
|
|
6585
|
-
function
|
|
6553
|
+
function un(n) {
|
|
6586
6554
|
const t = n.getCoordinates();
|
|
6587
6555
|
return t.length === 0 ? "" : t.join(" ");
|
|
6588
6556
|
}
|
|
6589
|
-
function
|
|
6557
|
+
function Ys(n) {
|
|
6590
6558
|
const t = [], e = n.getPoints();
|
|
6591
6559
|
for (let i = 0, r = e.length; i < r; ++i)
|
|
6592
|
-
t.push("(" +
|
|
6560
|
+
t.push("(" + un(e[i]) + ")");
|
|
6593
6561
|
return t.join(",");
|
|
6594
6562
|
}
|
|
6595
|
-
function
|
|
6563
|
+
function Bs(n) {
|
|
6596
6564
|
const t = [], e = n.getGeometries();
|
|
6597
6565
|
for (let i = 0, r = e.length; i < r; ++i)
|
|
6598
|
-
t.push(
|
|
6566
|
+
t.push(gn(e[i]));
|
|
6599
6567
|
return t.join(",");
|
|
6600
6568
|
}
|
|
6601
|
-
function
|
|
6569
|
+
function ke(n) {
|
|
6602
6570
|
const t = n.getCoordinates(), e = [];
|
|
6603
6571
|
for (let i = 0, r = t.length; i < r; ++i)
|
|
6604
6572
|
e.push(t[i].join(" "));
|
|
6605
6573
|
return e.join(",");
|
|
6606
6574
|
}
|
|
6607
|
-
function
|
|
6575
|
+
function Vs(n) {
|
|
6608
6576
|
const t = [], e = n.getLineStrings();
|
|
6609
6577
|
for (let i = 0, r = e.length; i < r; ++i)
|
|
6610
|
-
t.push("(" +
|
|
6578
|
+
t.push("(" + ke(e[i]) + ")");
|
|
6611
6579
|
return t.join(",");
|
|
6612
6580
|
}
|
|
6613
|
-
function
|
|
6581
|
+
function dn(n) {
|
|
6614
6582
|
const t = [], e = n.getLinearRings();
|
|
6615
6583
|
for (let i = 0, r = e.length; i < r; ++i)
|
|
6616
|
-
t.push("(" +
|
|
6584
|
+
t.push("(" + ke(e[i]) + ")");
|
|
6617
6585
|
return t.join(",");
|
|
6618
6586
|
}
|
|
6619
|
-
function
|
|
6587
|
+
function zs(n) {
|
|
6620
6588
|
const t = [], e = n.getPolygons();
|
|
6621
6589
|
for (let i = 0, r = e.length; i < r; ++i)
|
|
6622
|
-
t.push("(" +
|
|
6590
|
+
t.push("(" + dn(e[i]) + ")");
|
|
6623
6591
|
return t.join(",");
|
|
6624
6592
|
}
|
|
6625
|
-
function
|
|
6593
|
+
function Js(n) {
|
|
6626
6594
|
const t = n.getLayout();
|
|
6627
6595
|
let e = "";
|
|
6628
|
-
return (t === "XYZ" || t === "XYZM") && (e +=
|
|
6629
|
-
}
|
|
6630
|
-
const
|
|
6631
|
-
Point:
|
|
6632
|
-
LineString:
|
|
6633
|
-
Polygon:
|
|
6634
|
-
MultiPoint:
|
|
6635
|
-
MultiLineString:
|
|
6636
|
-
MultiPolygon:
|
|
6637
|
-
GeometryCollection:
|
|
6596
|
+
return (t === "XYZ" || t === "XYZM") && (e += hn), (t === "XYM" || t === "XYZM") && (e += cn), e;
|
|
6597
|
+
}
|
|
6598
|
+
const Ws = {
|
|
6599
|
+
Point: un,
|
|
6600
|
+
LineString: ke,
|
|
6601
|
+
Polygon: dn,
|
|
6602
|
+
MultiPoint: Ys,
|
|
6603
|
+
MultiLineString: Vs,
|
|
6604
|
+
MultiPolygon: zs,
|
|
6605
|
+
GeometryCollection: Bs
|
|
6638
6606
|
};
|
|
6639
|
-
function
|
|
6640
|
-
const t = n.getType(), e =
|
|
6641
|
-
let r =
|
|
6607
|
+
function gn(n) {
|
|
6608
|
+
const t = n.getType(), e = Ws[t], i = e(n);
|
|
6609
|
+
let r = Hs[t];
|
|
6642
6610
|
if (typeof /** @type {?} */
|
|
6643
6611
|
n.getFlatCoordinates == "function") {
|
|
6644
|
-
const s =
|
|
6612
|
+
const s = Js(
|
|
6645
6613
|
/** @type {import("../geom/SimpleGeometry.js").default} */
|
|
6646
6614
|
n
|
|
6647
6615
|
);
|
|
6648
6616
|
s.length > 0 && (r += " " + s);
|
|
6649
6617
|
}
|
|
6650
|
-
return i.length === 0 ? r + " " +
|
|
6618
|
+
return i.length === 0 ? r + " " + ln : r + "(" + i + ")";
|
|
6651
6619
|
}
|
|
6652
|
-
const
|
|
6620
|
+
const qs = (n, t) => new Xs().writeFeatures(n, t);
|
|
6653
6621
|
/**
|
|
6654
6622
|
* @license
|
|
6655
6623
|
* Copyright 2021 Google LLC
|
|
6656
6624
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6657
6625
|
*/
|
|
6658
|
-
function
|
|
6626
|
+
function _i(n, t, e) {
|
|
6659
6627
|
return n ? t(n) : e == null ? void 0 : e(n);
|
|
6660
6628
|
}
|
|
6661
|
-
var
|
|
6662
|
-
class
|
|
6629
|
+
var Et, xt;
|
|
6630
|
+
class fn extends j {
|
|
6663
6631
|
constructor() {
|
|
6664
6632
|
super();
|
|
6665
6633
|
/**
|
|
6666
6634
|
* @type boolean | import("lit").nothing
|
|
6667
6635
|
*/
|
|
6668
|
-
|
|
6636
|
+
F(this, Et, !0);
|
|
6669
6637
|
/**
|
|
6670
6638
|
* @type boolean | import("lit").nothing
|
|
6671
6639
|
*/
|
|
6672
|
-
|
|
6640
|
+
F(this, xt, !0);
|
|
6673
6641
|
this.multipleFeatures = !1, this.drawnFeatures = [], this.importFeatures = !1, this.showEditor = !1, this.currentlyDrawing = !1, this.drawFunc = null, this.geoJSON = "", this.unstyled = !1, this.select = !1;
|
|
6674
6642
|
}
|
|
6675
6643
|
/**
|
|
6676
6644
|
* Updates button states based on conditions
|
|
6677
6645
|
*/
|
|
6678
6646
|
updateButtonStates() {
|
|
6679
|
-
const { drawDisabled: e, discardDisabled: i } =
|
|
6680
|
-
|
|
6647
|
+
const { drawDisabled: e, discardDisabled: i } = Zn(this);
|
|
6648
|
+
$(this, Et, e), $(this, xt, i);
|
|
6681
6649
|
}
|
|
6682
6650
|
/**
|
|
6683
6651
|
* Overrides createRenderRoot to handle shadow DOM
|
|
@@ -6690,8 +6658,8 @@ class gn extends j {
|
|
|
6690
6658
|
const e = this.currentlyDrawing ? "drawing" : "draw";
|
|
6691
6659
|
return U`
|
|
6692
6660
|
<style>
|
|
6693
|
-
${!this.unstyled &&
|
|
6694
|
-
${!this.unstyled &&
|
|
6661
|
+
${!this.unstyled && Kn}
|
|
6662
|
+
${!this.unstyled && Dn}
|
|
6695
6663
|
</style>
|
|
6696
6664
|
<div class="wrap-btn">
|
|
6697
6665
|
<slot></slot>
|
|
@@ -6700,7 +6668,7 @@ class gn extends j {
|
|
|
6700
6668
|
<button
|
|
6701
6669
|
data-cy="drawBtn"
|
|
6702
6670
|
class="${this.select ? "pointer" : "polygon"} icon"
|
|
6703
|
-
?disabled="${
|
|
6671
|
+
?disabled="${M(this, Et) || C}"
|
|
6704
6672
|
@click="${() => this.drawFunc.start()}"
|
|
6705
6673
|
>
|
|
6706
6674
|
${e}
|
|
@@ -6710,7 +6678,7 @@ class gn extends j {
|
|
|
6710
6678
|
<button
|
|
6711
6679
|
data-cy="discardBtn"
|
|
6712
6680
|
class="discard icon"
|
|
6713
|
-
?disabled="${
|
|
6681
|
+
?disabled="${M(this, xt) || C}"
|
|
6714
6682
|
@click="${() => this.drawFunc.discard()}"
|
|
6715
6683
|
>
|
|
6716
6684
|
discard
|
|
@@ -6718,7 +6686,7 @@ class gn extends j {
|
|
|
6718
6686
|
</div>
|
|
6719
6687
|
|
|
6720
6688
|
<!-- Import Button -->
|
|
6721
|
-
${
|
|
6689
|
+
${_i(
|
|
6722
6690
|
this.importFeatures,
|
|
6723
6691
|
() => U`
|
|
6724
6692
|
<!-- Import Input Field : Hidden -->
|
|
@@ -6733,7 +6701,10 @@ class gn extends j {
|
|
|
6733
6701
|
<button
|
|
6734
6702
|
data-cy="importBtn"
|
|
6735
6703
|
class="import icon"
|
|
6736
|
-
@click=${() =>
|
|
6704
|
+
@click=${() => (
|
|
6705
|
+
/**@type {HTMLElement}*/
|
|
6706
|
+
this.querySelector("#import-file").click()
|
|
6707
|
+
)}
|
|
6737
6708
|
>
|
|
6738
6709
|
import
|
|
6739
6710
|
</button>
|
|
@@ -6742,7 +6713,7 @@ class gn extends j {
|
|
|
6742
6713
|
</div>
|
|
6743
6714
|
|
|
6744
6715
|
<!-- Geo JSON Wrapper -->
|
|
6745
|
-
${
|
|
6716
|
+
${_i(
|
|
6746
6717
|
this.showEditor,
|
|
6747
6718
|
() => U`
|
|
6748
6719
|
<div class="json-wrapper">
|
|
@@ -6757,7 +6728,7 @@ class gn extends j {
|
|
|
6757
6728
|
<button
|
|
6758
6729
|
data-cy="copyBtn"
|
|
6759
6730
|
class="icon-copy"
|
|
6760
|
-
@click=${() =>
|
|
6731
|
+
@click=${() => Qn(this.geoJSON)}
|
|
6761
6732
|
>
|
|
6762
6733
|
${this.unstyled ? "copy" : C}
|
|
6763
6734
|
</button>
|
|
@@ -6767,8 +6738,8 @@ class gn extends j {
|
|
|
6767
6738
|
`;
|
|
6768
6739
|
}
|
|
6769
6740
|
}
|
|
6770
|
-
|
|
6771
|
-
R(
|
|
6741
|
+
Et = new WeakMap(), xt = new WeakMap(), // Define properties with default values and types
|
|
6742
|
+
R(fn, "properties", {
|
|
6772
6743
|
multipleFeatures: { attribute: !1, type: Boolean },
|
|
6773
6744
|
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
6774
6745
|
currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
|
|
@@ -6779,8 +6750,8 @@ R(gn, "properties", {
|
|
|
6779
6750
|
geoJSON: { attribute: "geo-json", type: String },
|
|
6780
6751
|
unstyled: { type: Boolean }
|
|
6781
6752
|
});
|
|
6782
|
-
customElements.define("eox-drawtools-controller",
|
|
6783
|
-
const
|
|
6753
|
+
customElements.define("eox-drawtools-controller", fn);
|
|
6754
|
+
const Zs = `
|
|
6784
6755
|
button.discard:before {
|
|
6785
6756
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
|
|
6786
6757
|
}
|
|
@@ -6825,30 +6796,37 @@ const Ws = `
|
|
|
6825
6796
|
color: white;
|
|
6826
6797
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Econtent-copy%3C/title%3E%3Cpath d='M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z' fill='white' /%3E%3C/svg%3E")
|
|
6827
6798
|
}
|
|
6828
|
-
`,
|
|
6799
|
+
`, Ks = (n) => {
|
|
6829
6800
|
(() => {
|
|
6830
|
-
n.emitDrawnFeatures(), n.multipleFeatures
|
|
6801
|
+
if (n.emitDrawnFeatures(), !n.multipleFeatures)
|
|
6802
|
+
n.draw.setActive(!1), n.selectionEvents.removeSelectionEvent(), n.currentlyDrawing = !1;
|
|
6803
|
+
else if (n.continuous)
|
|
6804
|
+
if (!n.layerId)
|
|
6805
|
+
n.drawLayer.getSource().clear(!0), n.drawnFeatures = [];
|
|
6806
|
+
else {
|
|
6807
|
+
const i = n.drawLayer.getSource().getFeatures().at(-1);
|
|
6808
|
+
n.drawLayer.getSource().clear(!0), n.drawLayer.getSource().addFeature(i), n.drawnFeatures = [i];
|
|
6809
|
+
}
|
|
6831
6810
|
})(), n.requestUpdate();
|
|
6832
|
-
},
|
|
6811
|
+
}, Ds = (n) => {
|
|
6833
6812
|
const t = () => {
|
|
6834
6813
|
n.drawLayer.set("isDrawingEnabled", !0), n.draw.setActive(!0), n.selectionEvents.addSelectionEvent();
|
|
6835
6814
|
}, e = () => {
|
|
6836
6815
|
n.currentlyDrawing = !0, n.requestUpdate();
|
|
6837
6816
|
};
|
|
6838
6817
|
t(), e();
|
|
6839
|
-
},
|
|
6818
|
+
}, Qs = (n) => {
|
|
6840
6819
|
let t;
|
|
6841
6820
|
return typeof n == "string" ? t = /** @type {HTMLElement} */
|
|
6842
6821
|
document.querySelector(n) : t = n, t;
|
|
6843
|
-
},
|
|
6844
|
-
var s;
|
|
6845
|
-
const i =
|
|
6822
|
+
}, vi = (n, t) => {
|
|
6823
|
+
var s, o, a, l, h;
|
|
6824
|
+
const i = Qs(n.for), r = i.map;
|
|
6846
6825
|
return n.drawLayer = i.addOrUpdateLayer({
|
|
6847
6826
|
zIndex: 100,
|
|
6848
6827
|
type: "Vector",
|
|
6849
6828
|
properties: {
|
|
6850
6829
|
id: "drawLayer",
|
|
6851
|
-
// @ts-expect-error TODO
|
|
6852
6830
|
layerControlHide: !0,
|
|
6853
6831
|
isDrawingEnabled: !1,
|
|
6854
6832
|
multipleFeatures: t
|
|
@@ -6856,6 +6834,7 @@ const Ws = `
|
|
|
6856
6834
|
source: {
|
|
6857
6835
|
type: "Vector"
|
|
6858
6836
|
},
|
|
6837
|
+
style: (s = n.featureStyles) == null ? void 0 : s.layer,
|
|
6859
6838
|
interactions: [
|
|
6860
6839
|
{
|
|
6861
6840
|
type: "draw",
|
|
@@ -6864,16 +6843,16 @@ const Ws = `
|
|
|
6864
6843
|
id: "drawInteraction",
|
|
6865
6844
|
type: n.type,
|
|
6866
6845
|
modify: n.allowModify,
|
|
6867
|
-
stopClick: !0
|
|
6846
|
+
stopClick: !0,
|
|
6847
|
+
style: (o = n.featureStyles) == null ? void 0 : o.layer
|
|
6868
6848
|
}
|
|
6869
6849
|
},
|
|
6870
6850
|
{
|
|
6871
6851
|
type: "select",
|
|
6872
|
-
//@ts-expect-error TODO
|
|
6873
6852
|
options: {
|
|
6874
6853
|
id: "selectHover",
|
|
6875
6854
|
condition: "pointermove",
|
|
6876
|
-
style: {
|
|
6855
|
+
style: ((a = n.featureStyles) == null ? void 0 : a.hover) || {
|
|
6877
6856
|
"fill-color": "rgba(51, 153, 204,0.5)",
|
|
6878
6857
|
"stroke-color": "#3399CC",
|
|
6879
6858
|
"stroke-width": 2.5
|
|
@@ -6883,12 +6862,11 @@ const Ws = `
|
|
|
6883
6862
|
},
|
|
6884
6863
|
{
|
|
6885
6864
|
type: "select",
|
|
6886
|
-
//@ts-expect-error TODO
|
|
6887
6865
|
options: {
|
|
6888
6866
|
id: "selectClick",
|
|
6889
6867
|
condition: "click",
|
|
6890
6868
|
panIn: !0,
|
|
6891
|
-
style: {
|
|
6869
|
+
style: ((l = n.featureStyles) == null ? void 0 : l.click) || {
|
|
6892
6870
|
"fill-color": "rgba(51, 153, 204,0.5)",
|
|
6893
6871
|
"stroke-color": "#3399CC",
|
|
6894
6872
|
"stroke-width": 2.5
|
|
@@ -6900,15 +6878,15 @@ const Ws = `
|
|
|
6900
6878
|
/** @type {unknown} */
|
|
6901
6879
|
i.interactions.drawInteraction, n.modify = /** @type {import("ol/interaction").Modify} */
|
|
6902
6880
|
/** @type {unknown} */
|
|
6903
|
-
i.interactions.drawInteractionmodify,
|
|
6904
|
-
},
|
|
6881
|
+
i.interactions.drawInteractionmodify, ge(n, i, n.layerId), (h = n.modify) == null || h.on("modifyend", () => n.onModifyEnd()), i.addEventListener("addfeatures", () => Ks(n)), { EoxMap: i, OlMap: r };
|
|
6882
|
+
}, to = (n) => {
|
|
6905
6883
|
const t = () => {
|
|
6906
6884
|
n.drawnFeatures = [], n.draw.setActive(!1), n.selectionEvents.removeSelectionEvent(), n.drawLayer.getSource().clear(), n.geoJSON = null;
|
|
6907
6885
|
}, e = () => {
|
|
6908
6886
|
n.emitDrawnFeatures(), n.currentlyDrawing = !1, n.requestUpdate();
|
|
6909
6887
|
};
|
|
6910
6888
|
t(), e();
|
|
6911
|
-
},
|
|
6889
|
+
}, eo = (n, t) => {
|
|
6912
6890
|
setTimeout(() => {
|
|
6913
6891
|
const i = n.drawLayer.getSource().getFeatures(), r = n.eoxMap.projection || "EPSG:3857", s = n.projection;
|
|
6914
6892
|
n.drawnFeatures = s ? i.map((a) => {
|
|
@@ -6919,10 +6897,10 @@ const Ws = `
|
|
|
6919
6897
|
let o;
|
|
6920
6898
|
switch (n.format) {
|
|
6921
6899
|
case "geojson":
|
|
6922
|
-
o =
|
|
6900
|
+
o = Ts(n.drawnFeatures);
|
|
6923
6901
|
break;
|
|
6924
6902
|
case "wkt":
|
|
6925
|
-
o =
|
|
6903
|
+
o = qs(n.drawnFeatures);
|
|
6926
6904
|
break;
|
|
6927
6905
|
case "feature":
|
|
6928
6906
|
o = n.drawnFeatures;
|
|
@@ -6933,7 +6911,7 @@ const Ws = `
|
|
|
6933
6911
|
}
|
|
6934
6912
|
n.updateGeoJSON(), n.requestUpdate(), t(o);
|
|
6935
6913
|
}, 0);
|
|
6936
|
-
},
|
|
6914
|
+
}, io = (n) => {
|
|
6937
6915
|
const t = (r) => {
|
|
6938
6916
|
(r == null ? void 0 : r.detail.id) !== "SelectLayerClickInteraction" || !r.detail.feature || (n.drawLayer.getSource().addFeature(r.detail.feature), n.eoxMap.dispatchEvent(
|
|
6939
6917
|
new CustomEvent("addfeatures", { detail: r.detail })
|
|
@@ -6946,12 +6924,13 @@ const Ws = `
|
|
|
6946
6924
|
const r = (s = n.eoxMap.selectInteractions) == null ? void 0 : s.SelectLayerHoverInteraction;
|
|
6947
6925
|
r && (r.selectedFids = [], r.setActive(!1)), n.eoxMap.removeEventListener("select", t);
|
|
6948
6926
|
} };
|
|
6949
|
-
},
|
|
6927
|
+
}, ge = (n, t, e) => {
|
|
6928
|
+
var a, l;
|
|
6950
6929
|
if (!e || !t)
|
|
6951
6930
|
return;
|
|
6952
6931
|
const i = JSON.parse(
|
|
6953
6932
|
JSON.stringify(
|
|
6954
|
-
/** @type {import("
|
|
6933
|
+
/** @type {import("@eox/map").EoxLayer} */
|
|
6955
6934
|
t.getLayerById(e).get("_jsonDefinition")
|
|
6956
6935
|
)
|
|
6957
6936
|
) || null;
|
|
@@ -6962,12 +6941,11 @@ const Ws = `
|
|
|
6962
6941
|
const r = {
|
|
6963
6942
|
type: "select",
|
|
6964
6943
|
active: !1,
|
|
6965
|
-
//@ts-expect-error TODO
|
|
6966
6944
|
options: {
|
|
6967
6945
|
id: "SelectLayerHoverInteraction",
|
|
6968
6946
|
condition: "pointermove",
|
|
6969
6947
|
active: !1,
|
|
6970
|
-
style: {
|
|
6948
|
+
style: ((a = n.featureStyles) == null ? void 0 : a.hover) || {
|
|
6971
6949
|
"fill-color": "rgba(0, 0, 0,0.0)",
|
|
6972
6950
|
"stroke-color": "#3399CC",
|
|
6973
6951
|
"stroke-width": 2.5
|
|
@@ -6975,14 +6953,13 @@ const Ws = `
|
|
|
6975
6953
|
}
|
|
6976
6954
|
}, s = {
|
|
6977
6955
|
type: "select",
|
|
6978
|
-
//@ts-expect-error TODO
|
|
6979
6956
|
options: {
|
|
6980
6957
|
id: "SelectLayerClickInteraction",
|
|
6981
6958
|
condition: "click",
|
|
6982
6959
|
multi: n.multipleFeatures,
|
|
6983
6960
|
modify: n.allowModify,
|
|
6984
6961
|
active: !1,
|
|
6985
|
-
style: {
|
|
6962
|
+
style: ((l = n.featureStyles) == null ? void 0 : l.click) || {
|
|
6986
6963
|
"fill-color": "rgba(0, 0, 0,0.0)",
|
|
6987
6964
|
"stroke-color": "rgba(0, 0, 0,0.0)"
|
|
6988
6965
|
}
|
|
@@ -6991,24 +6968,24 @@ const Ws = `
|
|
|
6991
6968
|
i.interactions = [r, s], t.addOrUpdateLayer(i);
|
|
6992
6969
|
const o = n.draw;
|
|
6993
6970
|
n.draw = t.selectInteractions.SelectLayerClickInteraction, o.setActive(!1), t.selectInteractions.SelectLayerClickInteraction.setActive(!1), t.selectInteractions.SelectLayerHoverInteraction.setActive(!1);
|
|
6994
|
-
},
|
|
6971
|
+
}, no = (n, t, e, i) => {
|
|
6995
6972
|
if (t) {
|
|
6996
6973
|
if (e) {
|
|
6997
|
-
i && e !== i &&
|
|
6974
|
+
i && e !== i && Ci(n, t), ge(n, t, e);
|
|
6998
6975
|
return;
|
|
6999
6976
|
}
|
|
7000
6977
|
if (!e && i) {
|
|
7001
|
-
|
|
6978
|
+
Ci(n, t);
|
|
7002
6979
|
return;
|
|
7003
6980
|
}
|
|
7004
6981
|
}
|
|
7005
6982
|
};
|
|
7006
|
-
function
|
|
6983
|
+
function Ci(n, t) {
|
|
7007
6984
|
t && (n.discardDrawing(), n.selectionEvents.removeSelectionEvent(), n.draw = /** @type {import("ol/interaction").Draw} */
|
|
7008
6985
|
t.interactions.drawInteraction, t.selectInteractions.SelectLayerClickInteraction.remove(), t.selectInteractions.SelectLayerHoverInteraction.remove());
|
|
7009
6986
|
}
|
|
7010
|
-
const
|
|
7011
|
-
function
|
|
6987
|
+
const ro = ':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, transparent); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}pre { position: relative; border-radius: 4px; z-index: 1; margin: 0; padding: 20px 0; background: transparent; background: var(--code-bg-color, #8e96aa24); overflow: auto;}code { display: block; padding: 0 24px; width: fit-content; min-width: 100%; line-height: var(--code-line-height, 1.7); font-family: var(--code-font-family, monospace); font-size: var(--code-font-size, var(--font-size)); color: var(--code-color, #004170);}:not(pre) > code { display: inline; border-radius: 4px; background: var(--code-bg-color, #8e96aa24); padding: var(--code-padding, 3px 6px);}';
|
|
6988
|
+
function so(n, t) {
|
|
7012
6989
|
function e(s) {
|
|
7013
6990
|
s.preventDefault(), s.stopPropagation();
|
|
7014
6991
|
}
|
|
@@ -7020,43 +6997,50 @@ function ro(n, t) {
|
|
|
7020
6997
|
}
|
|
7021
6998
|
["dragenter", "dragover", "dragleave", "drop"].forEach((s) => {
|
|
7022
6999
|
t.addEventListener(s, e, !1), ["dragenter", "dragover"].includes(s) ? t.addEventListener(s, i, !1) : t.addEventListener(s, r, !1);
|
|
7023
|
-
}), t.addEventListener("drop", (s) =>
|
|
7000
|
+
}), t.addEventListener("drop", (s) => pn(s, n), !1);
|
|
7024
7001
|
}
|
|
7025
|
-
function
|
|
7002
|
+
function oo(n) {
|
|
7026
7003
|
n.preventDefault(), n.stopPropagation();
|
|
7027
7004
|
}
|
|
7028
|
-
function
|
|
7029
|
-
|
|
7030
|
-
const e = n.dataTransfer ? n.dataTransfer.files :
|
|
7031
|
-
|
|
7005
|
+
function pn(n, t) {
|
|
7006
|
+
oo(n);
|
|
7007
|
+
const e = n.dataTransfer ? n.dataTransfer.files : (
|
|
7008
|
+
/**@type {HTMLInputElement}*/
|
|
7009
|
+
n.target.files
|
|
7010
|
+
);
|
|
7011
|
+
Array.from(e).forEach((i) => ao(i, t));
|
|
7032
7012
|
}
|
|
7033
|
-
function
|
|
7013
|
+
function ao(n, t) {
|
|
7034
7014
|
const e = new FileReader();
|
|
7035
7015
|
e.readAsText(n), e.onloadend = function() {
|
|
7036
7016
|
typeof e.result == "string" && t.handleFeatureChange(e.result);
|
|
7037
7017
|
};
|
|
7038
7018
|
}
|
|
7039
|
-
var nt, rt, Pt, st;
|
|
7040
|
-
class
|
|
7019
|
+
var nt, rt, Pt, st, Mt;
|
|
7020
|
+
class lo extends j {
|
|
7041
7021
|
constructor() {
|
|
7042
7022
|
super();
|
|
7043
7023
|
/**
|
|
7044
|
-
* @type import("
|
|
7024
|
+
* @type import("@eox/map").EOxMap
|
|
7045
7025
|
*/
|
|
7046
|
-
|
|
7026
|
+
F(this, nt);
|
|
7047
7027
|
/**
|
|
7048
7028
|
* @type import("ol").Map
|
|
7049
7029
|
*/
|
|
7050
|
-
|
|
7030
|
+
F(this, rt);
|
|
7051
7031
|
/**
|
|
7052
7032
|
* @type string
|
|
7053
7033
|
*/
|
|
7054
|
-
|
|
7034
|
+
F(this, Pt);
|
|
7055
7035
|
/**
|
|
7056
7036
|
* @type string
|
|
7057
7037
|
*/
|
|
7058
|
-
|
|
7059
|
-
|
|
7038
|
+
F(this, st);
|
|
7039
|
+
/**
|
|
7040
|
+
* @type boolean
|
|
7041
|
+
*/
|
|
7042
|
+
F(this, Mt);
|
|
7043
|
+
this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.layerId = "", this.drawnFeatures = [], 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;
|
|
7060
7044
|
}
|
|
7061
7045
|
// Define properties with defaults and types
|
|
7062
7046
|
static get properties() {
|
|
@@ -7064,10 +7048,12 @@ class ao extends j {
|
|
|
7064
7048
|
allowModify: { attribute: "allow-modify", type: Boolean },
|
|
7065
7049
|
for: { type: String },
|
|
7066
7050
|
currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
|
|
7051
|
+
continuous: { type: Boolean },
|
|
7067
7052
|
draw: { attribute: !1, state: !0 },
|
|
7068
7053
|
drawLayer: { attribute: !1, state: !0 },
|
|
7069
|
-
layerId: { attribute: "layer-id", type: String },
|
|
7070
7054
|
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
7055
|
+
layerId: { attribute: "layer-id", type: String },
|
|
7056
|
+
featureStyles: { attribute: !1 },
|
|
7071
7057
|
modify: { attribute: !1, state: !0 },
|
|
7072
7058
|
multipleFeatures: { attribute: "multiple-features", type: Boolean },
|
|
7073
7059
|
importFeatures: { attribute: "import-features", type: Boolean },
|
|
@@ -7081,28 +7067,38 @@ class ao extends j {
|
|
|
7081
7067
|
};
|
|
7082
7068
|
}
|
|
7083
7069
|
/**
|
|
7084
|
-
*
|
|
7085
|
-
*
|
|
7070
|
+
* Enables the user to draw continuously one feature after another
|
|
7071
|
+
* without having to discard previous ones manually
|
|
7072
|
+
* @type {boolean}
|
|
7073
|
+
*/
|
|
7074
|
+
set continuous(e) {
|
|
7075
|
+
$(this, Mt, e), e && (this.multipleFeatures = !0);
|
|
7076
|
+
}
|
|
7077
|
+
get continuous() {
|
|
7078
|
+
return M(this, Mt);
|
|
7079
|
+
}
|
|
7080
|
+
/**
|
|
7081
|
+
* Enables selection mode for the passed layer
|
|
7086
7082
|
* @type {string}
|
|
7087
7083
|
*/
|
|
7088
7084
|
set layerId(e) {
|
|
7089
|
-
|
|
7085
|
+
no(this, this.eoxMap, e, M(this, st)), $(this, st, e);
|
|
7090
7086
|
}
|
|
7091
7087
|
get layerId() {
|
|
7092
|
-
return
|
|
7088
|
+
return M(this, st);
|
|
7093
7089
|
}
|
|
7094
7090
|
/**
|
|
7095
7091
|
* @onClick Event handler triggered to start drawing on the map.
|
|
7096
7092
|
*/
|
|
7097
7093
|
startDrawing() {
|
|
7098
|
-
|
|
7094
|
+
Ds(this);
|
|
7099
7095
|
}
|
|
7100
7096
|
/**
|
|
7101
7097
|
* @onClick Event handler triggered to discard/stop drawing
|
|
7102
7098
|
* on the map and delete the drawn shapes.
|
|
7103
7099
|
*/
|
|
7104
7100
|
discardDrawing() {
|
|
7105
|
-
|
|
7101
|
+
to(this);
|
|
7106
7102
|
}
|
|
7107
7103
|
/**
|
|
7108
7104
|
* @param {string} text - The string representation of the features to be parsed.
|
|
@@ -7110,17 +7106,17 @@ class ao extends j {
|
|
|
7110
7106
|
*/
|
|
7111
7107
|
handleFeatureChange(e, i = !1) {
|
|
7112
7108
|
this.eoxMap.parseTextToFeature(
|
|
7113
|
-
e || JSON.stringify(
|
|
7109
|
+
e || JSON.stringify(ti),
|
|
7114
7110
|
this.drawLayer,
|
|
7115
7111
|
this.eoxMap,
|
|
7116
7112
|
i
|
|
7117
7113
|
);
|
|
7118
7114
|
}
|
|
7119
7115
|
/**
|
|
7120
|
-
* @param {DragEvent
|
|
7116
|
+
* @param {DragEvent} evt - The event object from the file input interaction.
|
|
7121
7117
|
*/
|
|
7122
7118
|
handleFilesChange(e) {
|
|
7123
|
-
|
|
7119
|
+
pn(e, this);
|
|
7124
7120
|
}
|
|
7125
7121
|
/**
|
|
7126
7122
|
* @event onModifyEnd triggered when the modification of a shape is completed.
|
|
@@ -7132,8 +7128,8 @@ class ao extends j {
|
|
|
7132
7128
|
* Update #geoJSON with stringify feature.
|
|
7133
7129
|
*/
|
|
7134
7130
|
updateGeoJSON() {
|
|
7135
|
-
|
|
7136
|
-
this.eoxMap.parseFeature(this.drawnFeatures) ||
|
|
7131
|
+
$(this, Pt, JSON.stringify(
|
|
7132
|
+
this.eoxMap.parseFeature(this.drawnFeatures) || ti,
|
|
7137
7133
|
void 0,
|
|
7138
7134
|
2
|
|
7139
7135
|
));
|
|
@@ -7142,7 +7138,7 @@ class ao extends j {
|
|
|
7142
7138
|
* Triggers different events when the drawing of a shape is completed.
|
|
7143
7139
|
*/
|
|
7144
7140
|
emitDrawnFeatures() {
|
|
7145
|
-
|
|
7141
|
+
eo(this, (i) => {
|
|
7146
7142
|
this.dispatchEvent(new CustomEvent("drawupdate", { detail: i }));
|
|
7147
7143
|
});
|
|
7148
7144
|
}
|
|
@@ -7158,21 +7154,21 @@ class ao extends j {
|
|
|
7158
7154
|
* It then calls requestUpdate to trigger a re-render.
|
|
7159
7155
|
*/
|
|
7160
7156
|
firstUpdated() {
|
|
7161
|
-
const { EoxMap: e, OlMap: i } =
|
|
7162
|
-
this.eoxMap = e,
|
|
7157
|
+
const { EoxMap: e, OlMap: i } = vi(this, this.multipleFeatures);
|
|
7158
|
+
this.eoxMap = e, $(this, rt, i), this.selectionEvents = io(this), this.importFeatures && so(this, this.eoxMap), this.updateGeoJSON(), this.requestUpdate();
|
|
7163
7159
|
}
|
|
7164
7160
|
updated(e) {
|
|
7165
7161
|
if (e.has("for")) {
|
|
7166
|
-
const { EoxMap: i, OlMap: r } =
|
|
7167
|
-
this.eoxMap = i,
|
|
7162
|
+
const { EoxMap: i, OlMap: r } = vi(this, this.multipleFeatures);
|
|
7163
|
+
this.eoxMap = i, $(this, rt, r);
|
|
7168
7164
|
}
|
|
7169
7165
|
}
|
|
7170
7166
|
get eoxMap() {
|
|
7171
|
-
return
|
|
7167
|
+
return M(this, nt);
|
|
7172
7168
|
}
|
|
7173
7169
|
set eoxMap(e) {
|
|
7174
|
-
const i =
|
|
7175
|
-
|
|
7170
|
+
const i = M(this, nt);
|
|
7171
|
+
$(this, nt, e), this.requestUpdate("eoxMap", i);
|
|
7176
7172
|
}
|
|
7177
7173
|
disconnectedCallback() {
|
|
7178
7174
|
var e;
|
|
@@ -7184,8 +7180,8 @@ class ao extends j {
|
|
|
7184
7180
|
return U`
|
|
7185
7181
|
<style>
|
|
7186
7182
|
:host { display: block; }
|
|
7187
|
-
${!this.unstyled &&
|
|
7188
|
-
${!this.unstyled &&
|
|
7183
|
+
${!this.unstyled && ro}
|
|
7184
|
+
${!this.unstyled && Zs}
|
|
7189
7185
|
</style>
|
|
7190
7186
|
|
|
7191
7187
|
<!-- Controller Component -->
|
|
@@ -7203,13 +7199,13 @@ class ao extends j {
|
|
|
7203
7199
|
.multipleFeatures=${this.multipleFeatures}
|
|
7204
7200
|
.importFeatures=${this.importFeatures}
|
|
7205
7201
|
.showEditor=${this.showEditor}
|
|
7206
|
-
.geoJSON=${
|
|
7202
|
+
.geoJSON=${M(this, Pt)}
|
|
7207
7203
|
></eox-drawtools-controller>
|
|
7208
7204
|
|
|
7209
7205
|
<!-- List Component -->
|
|
7210
7206
|
${this.showList && ((e = this.drawnFeatures) != null && e.length) ? U`<eox-drawtools-list
|
|
7211
7207
|
.eoxMap=${this.eoxMap}
|
|
7212
|
-
.olMap=${
|
|
7208
|
+
.olMap=${M(this, rt)}
|
|
7213
7209
|
.draw=${this.draw}
|
|
7214
7210
|
.drawLayer=${this.drawLayer}
|
|
7215
7211
|
.drawnFeatures=${this.drawnFeatures}
|
|
@@ -7222,8 +7218,8 @@ class ao extends j {
|
|
|
7222
7218
|
`;
|
|
7223
7219
|
}
|
|
7224
7220
|
}
|
|
7225
|
-
nt = new WeakMap(), rt = new WeakMap(), Pt = new WeakMap(), st = new WeakMap();
|
|
7226
|
-
customElements.define("eox-drawtools",
|
|
7221
|
+
nt = new WeakMap(), rt = new WeakMap(), Pt = new WeakMap(), st = new WeakMap(), Mt = new WeakMap();
|
|
7222
|
+
customElements.define("eox-drawtools", lo);
|
|
7227
7223
|
export {
|
|
7228
|
-
|
|
7224
|
+
lo as EOxDrawTools
|
|
7229
7225
|
};
|