@maptiler/geocoding-control 1.4.2-dev.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MapLibreBasedGeocodingControl.d.ts +70 -35
- package/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +407 -398
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +3 -3
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.d.ts +52 -16
- package/leaflet.js +888 -870
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +7 -7
- package/maplibregl-controller.js +421 -413
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +3 -3
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.d.ts +29 -5
- package/maplibregl.js +1244 -1236
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +29 -5
- package/maptilersdk.js +1194 -1180
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +694 -692
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +5 -5
- package/react.js +671 -669
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/svelte/GeocodingControl.svelte +4 -2
- package/svelte/GeocodingControl.svelte.d.ts +1 -0
- package/svelte/MapLibreBasedGeocodingControl.d.ts +70 -35
- package/svelte/MapLibreBasedGeocodingControl.js +69 -66
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +47 -24
- package/svelte/leaflet.d.ts +52 -16
- package/svelte/leaflet.js +14 -2
- package/svelte/maplibregl-controller.d.ts +7 -7
- package/svelte/maplibregl-controller.js +55 -34
- package/svelte/maplibregl.d.ts +29 -5
- package/svelte/maplibregl.js +3 -8
- package/svelte/maptilersdk.d.ts +29 -5
- package/svelte/maptilersdk.js +15 -18
- package/svelte/types.d.ts +6 -0
- package/types.d.ts +6 -0
- package/vanilla.js +392 -390
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
package/maplibregl-controller.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var it = (i, t, e) =>
|
|
4
|
-
function
|
|
1
|
+
var Kt = Object.defineProperty;
|
|
2
|
+
var Ht = (i, t, e) => t in i ? Kt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var it = (i, t, e) => Ht(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
function X(i, t, e = {}) {
|
|
5
5
|
const n = { type: "Feature" };
|
|
6
6
|
return (e.id === 0 || e.id) && (n.id = e.id), e.bbox && (n.bbox = e.bbox), n.properties = t || {}, n.geometry = i, n;
|
|
7
7
|
}
|
|
@@ -17,17 +17,17 @@ function pt(i, t, e = {}) {
|
|
|
17
17
|
if (r[r.length - 1][o] !== r[0][o])
|
|
18
18
|
throw new Error("First and last Position are not equivalent.");
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return X({
|
|
21
21
|
type: "Polygon",
|
|
22
22
|
coordinates: i
|
|
23
23
|
}, t, e);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function V(i, t = {}) {
|
|
26
26
|
const e = { type: "FeatureCollection" };
|
|
27
27
|
return t.id && (e.id = t.id), t.bbox && (e.bbox = t.bbox), e.features = i, e;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function jt(i, t, e = {}) {
|
|
30
|
+
return X({
|
|
31
31
|
type: "MultiPolygon",
|
|
32
32
|
coordinates: i
|
|
33
33
|
}, t, e);
|
|
@@ -54,67 +54,67 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
54
54
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
55
55
|
and limitations under the License.
|
|
56
56
|
***************************************************************************** */
|
|
57
|
-
function
|
|
57
|
+
function te(i, t) {
|
|
58
58
|
var e = { label: 0, sent: function() {
|
|
59
59
|
if (o[0] & 1) throw o[1];
|
|
60
60
|
return o[1];
|
|
61
|
-
}, trys: [], ops: [] }, n, r, o,
|
|
62
|
-
return
|
|
61
|
+
}, trys: [], ops: [] }, n, r, o, f;
|
|
62
|
+
return f = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
|
|
63
63
|
return this;
|
|
64
|
-
}),
|
|
65
|
-
function s(
|
|
64
|
+
}), f;
|
|
65
|
+
function s(u) {
|
|
66
66
|
return function(g) {
|
|
67
|
-
return c([
|
|
67
|
+
return c([u, g]);
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function c(
|
|
70
|
+
function c(u) {
|
|
71
71
|
if (n) throw new TypeError("Generator is already executing.");
|
|
72
72
|
for (; e; ) try {
|
|
73
|
-
if (n = 1, r && (o =
|
|
74
|
-
switch (r = 0, o && (
|
|
73
|
+
if (n = 1, r && (o = u[0] & 2 ? r.return : u[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, u[1])).done) return o;
|
|
74
|
+
switch (r = 0, o && (u = [u[0] & 2, o.value]), u[0]) {
|
|
75
75
|
case 0:
|
|
76
76
|
case 1:
|
|
77
|
-
o =
|
|
77
|
+
o = u;
|
|
78
78
|
break;
|
|
79
79
|
case 4:
|
|
80
|
-
return e.label++, { value:
|
|
80
|
+
return e.label++, { value: u[1], done: !1 };
|
|
81
81
|
case 5:
|
|
82
|
-
e.label++, r =
|
|
82
|
+
e.label++, r = u[1], u = [0];
|
|
83
83
|
continue;
|
|
84
84
|
case 7:
|
|
85
|
-
|
|
85
|
+
u = e.ops.pop(), e.trys.pop();
|
|
86
86
|
continue;
|
|
87
87
|
default:
|
|
88
|
-
if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (
|
|
88
|
+
if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) {
|
|
89
89
|
e = 0;
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
|
-
if (
|
|
93
|
-
e.label =
|
|
92
|
+
if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) {
|
|
93
|
+
e.label = u[1];
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
|
-
if (
|
|
97
|
-
e.label = o[1], o =
|
|
96
|
+
if (u[0] === 6 && e.label < o[1]) {
|
|
97
|
+
e.label = o[1], o = u;
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
if (o && e.label < o[2]) {
|
|
101
|
-
e.label = o[2], e.ops.push(
|
|
101
|
+
e.label = o[2], e.ops.push(u);
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
o[2] && e.ops.pop(), e.trys.pop();
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
u = t.call(i, e);
|
|
108
108
|
} catch (g) {
|
|
109
|
-
|
|
109
|
+
u = [6, g], r = 0;
|
|
110
110
|
} finally {
|
|
111
111
|
n = o = 0;
|
|
112
112
|
}
|
|
113
|
-
if (
|
|
114
|
-
return { value:
|
|
113
|
+
if (u[0] & 5) throw u[1];
|
|
114
|
+
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
var
|
|
117
|
+
var G = (
|
|
118
118
|
/** @class */
|
|
119
119
|
/* @__PURE__ */ function() {
|
|
120
120
|
function i(t, e) {
|
|
@@ -123,13 +123,13 @@ var F = (
|
|
|
123
123
|
return i;
|
|
124
124
|
}()
|
|
125
125
|
);
|
|
126
|
-
function
|
|
126
|
+
function ee(i, t) {
|
|
127
127
|
return i > t ? 1 : i < t ? -1 : 0;
|
|
128
128
|
}
|
|
129
129
|
function B(i, t, e) {
|
|
130
|
-
for (var n = new
|
|
131
|
-
var
|
|
132
|
-
if (
|
|
130
|
+
for (var n = new G(null, null), r = n, o = n; ; ) {
|
|
131
|
+
var f = e(i, t.key);
|
|
132
|
+
if (f < 0) {
|
|
133
133
|
if (t.left === null)
|
|
134
134
|
break;
|
|
135
135
|
if (e(i, t.left.key) < 0) {
|
|
@@ -138,7 +138,7 @@ function B(i, t, e) {
|
|
|
138
138
|
break;
|
|
139
139
|
}
|
|
140
140
|
o.left = t, o = t, t = t.left;
|
|
141
|
-
} else if (
|
|
141
|
+
} else if (f > 0) {
|
|
142
142
|
if (t.right === null)
|
|
143
143
|
break;
|
|
144
144
|
if (e(i, t.right.key) > 0) {
|
|
@@ -153,7 +153,7 @@ function B(i, t, e) {
|
|
|
153
153
|
return r.right = t.left, o.left = t.right, t.left = n.right, t.right = n.left, t;
|
|
154
154
|
}
|
|
155
155
|
function rt(i, t, e, n) {
|
|
156
|
-
var r = new
|
|
156
|
+
var r = new G(i, t);
|
|
157
157
|
if (e === null)
|
|
158
158
|
return r.left = r.right = null, r;
|
|
159
159
|
e = B(i, e, n);
|
|
@@ -169,7 +169,7 @@ function vt(i, t, e) {
|
|
|
169
169
|
}
|
|
170
170
|
return { left: n, right: r };
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function ne(i, t, e) {
|
|
173
173
|
return t === null ? i : (i === null || (t = B(i.key, t, e), t.left = i), t);
|
|
174
174
|
}
|
|
175
175
|
function lt(i, t, e, n, r) {
|
|
@@ -184,15 +184,15 @@ var yt = (
|
|
|
184
184
|
/** @class */
|
|
185
185
|
function() {
|
|
186
186
|
function i(t) {
|
|
187
|
-
t === void 0 && (t =
|
|
187
|
+
t === void 0 && (t = ee), this._root = null, this._size = 0, this._comparator = t;
|
|
188
188
|
}
|
|
189
189
|
return i.prototype.insert = function(t, e) {
|
|
190
190
|
return this._size++, this._root = rt(t, e, this._root, this._comparator);
|
|
191
191
|
}, i.prototype.add = function(t, e) {
|
|
192
|
-
var n = new
|
|
192
|
+
var n = new G(t, e);
|
|
193
193
|
this._root === null && (n.left = n.right = null, this._size++, this._root = n);
|
|
194
|
-
var r = this._comparator, o = B(t, this._root, r),
|
|
195
|
-
return
|
|
194
|
+
var r = this._comparator, o = B(t, this._root, r), f = r(t, o.key);
|
|
195
|
+
return f === 0 ? this._root = o : (f < 0 ? (n.left = o.left, n.right = o, o.left = null) : f > 0 && (n.right = o.right, n.left = o, o.right = null), this._size++, this._root = n), this._root;
|
|
196
196
|
}, i.prototype.remove = function(t) {
|
|
197
197
|
this._root = this._remove(t, this._root, this._comparator);
|
|
198
198
|
}, i.prototype._remove = function(t, e, n) {
|
|
@@ -233,13 +233,13 @@ var yt = (
|
|
|
233
233
|
n !== null ? (r.push(n), n = n.left) : r.length !== 0 ? (n = r.pop(), t.call(e, n), n = n.right) : o = !0;
|
|
234
234
|
return this;
|
|
235
235
|
}, i.prototype.range = function(t, e, n, r) {
|
|
236
|
-
for (var o = [],
|
|
236
|
+
for (var o = [], f = this._comparator, s = this._root, c; o.length !== 0 || s; )
|
|
237
237
|
if (s)
|
|
238
238
|
o.push(s), s = s.left;
|
|
239
239
|
else {
|
|
240
|
-
if (s = o.pop(), c =
|
|
240
|
+
if (s = o.pop(), c = f(s.key, e), c > 0)
|
|
241
241
|
break;
|
|
242
|
-
if (
|
|
242
|
+
if (f(s.key, t) >= 0 && n.call(r, s))
|
|
243
243
|
return this;
|
|
244
244
|
s = s.right;
|
|
245
245
|
}
|
|
@@ -312,15 +312,15 @@ var yt = (
|
|
|
312
312
|
}, i.prototype.clear = function() {
|
|
313
313
|
return this._root = null, this._size = 0, this;
|
|
314
314
|
}, i.prototype.toList = function() {
|
|
315
|
-
return
|
|
315
|
+
return re(this._root);
|
|
316
316
|
}, i.prototype.load = function(t, e, n) {
|
|
317
317
|
e === void 0 && (e = []), n === void 0 && (n = !1);
|
|
318
318
|
var r = t.length, o = this._comparator;
|
|
319
319
|
if (n && ct(t, e, 0, r - 1, o), this._root === null)
|
|
320
320
|
this._root = ut(t, e, 0, r), this._size = r;
|
|
321
321
|
else {
|
|
322
|
-
var
|
|
323
|
-
r = this._size + r, this._root = ft({ head:
|
|
322
|
+
var f = oe(this.toList(), ie(t, e), o);
|
|
323
|
+
r = this._size + r, this._root = ft({ head: f }, 0, r);
|
|
324
324
|
}
|
|
325
325
|
return this;
|
|
326
326
|
}, i.prototype.isEmpty = function() {
|
|
@@ -346,13 +346,13 @@ var yt = (
|
|
|
346
346
|
return e.push(n);
|
|
347
347
|
}, t), e.join("");
|
|
348
348
|
}, i.prototype.update = function(t, e, n) {
|
|
349
|
-
var r = this._comparator, o = vt(t, this._root, r),
|
|
350
|
-
r(t, e) < 0 ? s = rt(e, n, s, r) :
|
|
349
|
+
var r = this._comparator, o = vt(t, this._root, r), f = o.left, s = o.right;
|
|
350
|
+
r(t, e) < 0 ? s = rt(e, n, s, r) : f = rt(e, n, f, r), this._root = ne(f, s, r);
|
|
351
351
|
}, i.prototype.split = function(t) {
|
|
352
352
|
return vt(t, this._root, this._comparator);
|
|
353
353
|
}, i.prototype[Symbol.iterator] = function() {
|
|
354
354
|
var t, e, n;
|
|
355
|
-
return
|
|
355
|
+
return te(this, function(r) {
|
|
356
356
|
switch (r.label) {
|
|
357
357
|
case 0:
|
|
358
358
|
t = this._root, e = [], n = !1, r.label = 1;
|
|
@@ -379,66 +379,66 @@ var yt = (
|
|
|
379
379
|
function ut(i, t, e, n) {
|
|
380
380
|
var r = n - e;
|
|
381
381
|
if (r > 0) {
|
|
382
|
-
var o = e + Math.floor(r / 2),
|
|
382
|
+
var o = e + Math.floor(r / 2), f = i[o], s = t[o], c = new G(f, s);
|
|
383
383
|
return c.left = ut(i, t, e, o), c.right = ut(i, t, o + 1, n), c;
|
|
384
384
|
}
|
|
385
385
|
return null;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
for (var e = new
|
|
389
|
-
n = n.next = new
|
|
387
|
+
function ie(i, t) {
|
|
388
|
+
for (var e = new G(null, null), n = e, r = 0; r < i.length; r++)
|
|
389
|
+
n = n.next = new G(i[r], t[r]);
|
|
390
390
|
return n.next = null, e.next;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
for (var t = i, e = [], n = !1, r = new
|
|
392
|
+
function re(i) {
|
|
393
|
+
for (var t = i, e = [], n = !1, r = new G(null, null), o = r; !n; )
|
|
394
394
|
t ? (e.push(t), t = t.left) : e.length > 0 ? (t = o = o.next = e.pop(), t = t.right) : n = !0;
|
|
395
395
|
return o.next = null, r.next;
|
|
396
396
|
}
|
|
397
397
|
function ft(i, t, e) {
|
|
398
398
|
var n = e - t;
|
|
399
399
|
if (n > 0) {
|
|
400
|
-
var r = t + Math.floor(n / 2), o = ft(i, t, r),
|
|
401
|
-
return
|
|
400
|
+
var r = t + Math.floor(n / 2), o = ft(i, t, r), f = i.head;
|
|
401
|
+
return f.left = o, i.head = i.head.next, f.right = ft(i, r + 1, e), f;
|
|
402
402
|
}
|
|
403
403
|
return null;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
for (var n = new
|
|
407
|
-
e(o.key,
|
|
408
|
-
return o !== null ? r.next = o :
|
|
405
|
+
function oe(i, t, e) {
|
|
406
|
+
for (var n = new G(null, null), r = n, o = i, f = t; o !== null && f !== null; )
|
|
407
|
+
e(o.key, f.key) < 0 ? (r.next = o, o = o.next) : (r.next = f, f = f.next), r = r.next;
|
|
408
|
+
return o !== null ? r.next = o : f !== null && (r.next = f), n.next;
|
|
409
409
|
}
|
|
410
410
|
function ct(i, t, e, n, r) {
|
|
411
411
|
if (!(e >= n)) {
|
|
412
|
-
for (var o = i[e + n >> 1],
|
|
412
|
+
for (var o = i[e + n >> 1], f = e - 1, s = n + 1; ; ) {
|
|
413
413
|
do
|
|
414
|
-
|
|
415
|
-
while (r(i[
|
|
414
|
+
f++;
|
|
415
|
+
while (r(i[f], o) < 0);
|
|
416
416
|
do
|
|
417
417
|
s--;
|
|
418
418
|
while (r(i[s], o) > 0);
|
|
419
|
-
if (
|
|
419
|
+
if (f >= s)
|
|
420
420
|
break;
|
|
421
|
-
var c = i[
|
|
422
|
-
i[
|
|
421
|
+
var c = i[f];
|
|
422
|
+
i[f] = i[s], i[s] = c, c = t[f], t[f] = t[s], t[s] = c;
|
|
423
423
|
}
|
|
424
424
|
ct(i, t, e, s, r), ct(i, t, s + 1, n, r);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
const O = 11102230246251565e-32, S = 134217729,
|
|
427
|
+
const O = 11102230246251565e-32, S = 134217729, se = (3 + 8 * O) * O;
|
|
428
428
|
function ot(i, t, e, n, r) {
|
|
429
|
-
let o,
|
|
430
|
-
g >
|
|
429
|
+
let o, f, s, c, u = t[0], g = n[0], l = 0, h = 0;
|
|
430
|
+
g > u == g > -u ? (o = u, u = t[++l]) : (o = g, g = n[++h]);
|
|
431
431
|
let a = 0;
|
|
432
432
|
if (l < i && h < e)
|
|
433
|
-
for (g >
|
|
434
|
-
g >
|
|
433
|
+
for (g > u == g > -u ? (f = u + o, s = o - (f - u), u = t[++l]) : (f = g + o, s = o - (f - g), g = n[++h]), o = f, s !== 0 && (r[a++] = s); l < i && h < e; )
|
|
434
|
+
g > u == g > -u ? (f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l]) : (f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h]), o = f, s !== 0 && (r[a++] = s);
|
|
435
435
|
for (; l < i; )
|
|
436
|
-
|
|
436
|
+
f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l], o = f, s !== 0 && (r[a++] = s);
|
|
437
437
|
for (; h < e; )
|
|
438
|
-
|
|
438
|
+
f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h], o = f, s !== 0 && (r[a++] = s);
|
|
439
439
|
return (o !== 0 || a === 0) && (r[a++] = o), a;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function le(i, t) {
|
|
442
442
|
let e = t[0];
|
|
443
443
|
for (let n = 1; n < i; n++) e += t[n];
|
|
444
444
|
return e;
|
|
@@ -446,26 +446,26 @@ function se(i, t) {
|
|
|
446
446
|
function J(i) {
|
|
447
447
|
return new Float64Array(i);
|
|
448
448
|
}
|
|
449
|
-
const
|
|
450
|
-
function
|
|
451
|
-
let s, c,
|
|
449
|
+
const ue = (3 + 16 * O) * O, fe = (2 + 12 * O) * O, ce = (9 + 64 * O) * O * O, j = J(4), mt = J(8), Et = J(12), wt = J(16), P = J(4);
|
|
450
|
+
function he(i, t, e, n, r, o, f) {
|
|
451
|
+
let s, c, u, g, l, h, a, d, x, p, y, v, m, E, w, b, M, _;
|
|
452
452
|
const R = i - r, k = e - r, C = t - o, I = n - o;
|
|
453
|
-
|
|
454
|
-
let A =
|
|
455
|
-
if (A >= Y || -A >= Y || (l = i - R, s = i - (R + l) + (l - r), l = e - k,
|
|
456
|
-
|
|
457
|
-
const Zt = ot(4, j, 4, P,
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
const
|
|
462
|
-
return
|
|
463
|
-
}
|
|
464
|
-
function
|
|
465
|
-
const
|
|
466
|
-
return Math.abs(c) >=
|
|
467
|
-
}
|
|
468
|
-
const
|
|
453
|
+
E = R * I, h = S * R, a = h - (h - R), d = R - a, h = S * I, x = h - (h - I), p = I - x, w = d * p - (E - a * x - d * x - a * p), b = C * k, h = S * C, a = h - (h - C), d = C - a, h = S * k, x = h - (h - k), p = k - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, j[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, j[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, j[2] = v - (_ - l) + (y - l), j[3] = _;
|
|
454
|
+
let A = le(4, j), Y = fe * f;
|
|
455
|
+
if (A >= Y || -A >= Y || (l = i - R, s = i - (R + l) + (l - r), l = e - k, u = e - (k + l) + (l - r), l = t - C, c = t - (C + l) + (l - o), l = n - I, g = n - (I + l) + (l - o), s === 0 && c === 0 && u === 0 && g === 0) || (Y = ce * f + se * Math.abs(A), A += R * g + I * s - (C * u + k * c), A >= Y || -A >= Y)) return A;
|
|
456
|
+
E = s * I, h = S * s, a = h - (h - s), d = s - a, h = S * I, x = h - (h - I), p = I - x, w = d * p - (E - a * x - d * x - a * p), b = c * k, h = S * c, a = h - (h - c), d = c - a, h = S * k, x = h - (h - k), p = k - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
|
|
457
|
+
const Zt = ot(4, j, 4, P, mt);
|
|
458
|
+
E = R * g, h = S * R, a = h - (h - R), d = R - a, h = S * g, x = h - (h - g), p = g - x, w = d * p - (E - a * x - d * x - a * p), b = C * u, h = S * C, a = h - (h - C), d = C - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
|
|
459
|
+
const Wt = ot(Zt, mt, 4, P, Et);
|
|
460
|
+
E = s * g, h = S * s, a = h - (h - s), d = s - a, h = S * g, x = h - (h - g), p = g - x, w = d * p - (E - a * x - d * x - a * p), b = c * u, h = S * c, a = h - (h - c), d = c - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
|
|
461
|
+
const Jt = ot(Wt, Et, 4, P, wt);
|
|
462
|
+
return wt[Jt - 1];
|
|
463
|
+
}
|
|
464
|
+
function ae(i, t, e, n, r, o) {
|
|
465
|
+
const f = (t - o) * (e - r), s = (i - r) * (n - o), c = f - s, u = Math.abs(f + s);
|
|
466
|
+
return Math.abs(c) >= ue * u ? c : -he(i, t, e, n, r, o, u);
|
|
467
|
+
}
|
|
468
|
+
const F = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.ur.y, ht = (i, t) => {
|
|
469
469
|
if (t.ur.x < i.ll.x || i.ur.x < t.ll.x || t.ur.y < i.ll.y || i.ur.y < t.ll.y) return null;
|
|
470
470
|
const e = i.ll.x < t.ll.x ? t.ll.x : i.ll.x, n = i.ur.x < t.ur.x ? i.ur.x : t.ur.x, r = i.ll.y < t.ll.y ? t.ll.y : i.ll.y, o = i.ur.y < t.ur.y ? i.ur.y : t.ur.y;
|
|
471
471
|
return {
|
|
@@ -481,13 +481,13 @@ const D = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.
|
|
|
481
481
|
};
|
|
482
482
|
let z = Number.EPSILON;
|
|
483
483
|
z === void 0 && (z = Math.pow(2, -52));
|
|
484
|
-
const
|
|
484
|
+
const ge = z * z, bt = (i, t) => {
|
|
485
485
|
if (-z < i && i < z && -z < t && t < z)
|
|
486
486
|
return 0;
|
|
487
487
|
const e = i - t;
|
|
488
|
-
return e * e <
|
|
488
|
+
return e * e < ge * i * t ? 0 : i < t ? -1 : 1;
|
|
489
489
|
};
|
|
490
|
-
class
|
|
490
|
+
class pe {
|
|
491
491
|
constructor() {
|
|
492
492
|
this.reset();
|
|
493
493
|
}
|
|
@@ -520,10 +520,10 @@ class _t {
|
|
|
520
520
|
return r !== null && bt(e.key, r.key) === 0 ? (this.tree.remove(t), r.key) : t;
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
const
|
|
524
|
-
const n =
|
|
523
|
+
const Z = new pe(), H = (i, t) => i.x * t.y - i.y * t.x, qt = (i, t) => i.x * t.x + i.y * t.y, St = (i, t, e) => {
|
|
524
|
+
const n = ae(i.x, i.y, t.x, t.y, e.x, e.y);
|
|
525
525
|
return n > 0 ? -1 : n < 0 ? 1 : 0;
|
|
526
|
-
}, tt = (i) => Math.sqrt(
|
|
526
|
+
}, tt = (i) => Math.sqrt(qt(i, i)), ye = (i, t, e) => {
|
|
527
527
|
const n = {
|
|
528
528
|
x: t.x - i.x,
|
|
529
529
|
y: t.y - i.y
|
|
@@ -532,7 +532,7 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
|
|
|
532
532
|
y: e.y - i.y
|
|
533
533
|
};
|
|
534
534
|
return H(r, n) / tt(r) / tt(n);
|
|
535
|
-
},
|
|
535
|
+
}, de = (i, t, e) => {
|
|
536
536
|
const n = {
|
|
537
537
|
x: t.x - i.x,
|
|
538
538
|
y: t.y - i.y
|
|
@@ -540,14 +540,14 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
|
|
|
540
540
|
x: e.x - i.x,
|
|
541
541
|
y: e.y - i.y
|
|
542
542
|
};
|
|
543
|
-
return
|
|
543
|
+
return qt(r, n) / tt(r) / tt(n);
|
|
544
544
|
}, Pt = (i, t, e) => t.y === 0 ? null : {
|
|
545
545
|
x: i.x + t.x / t.y * (e - i.y),
|
|
546
546
|
y: e
|
|
547
547
|
}, Mt = (i, t, e) => t.x === 0 ? null : {
|
|
548
548
|
x: e,
|
|
549
549
|
y: i.y + t.y / t.x * (e - i.x)
|
|
550
|
-
},
|
|
550
|
+
}, xe = (i, t, e, n) => {
|
|
551
551
|
if (t.x === 0) return Mt(e, n, i.x);
|
|
552
552
|
if (n.x === 0) return Mt(i, t, e.x);
|
|
553
553
|
if (t.y === 0) return Pt(e, n, i.y);
|
|
@@ -557,7 +557,7 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
|
|
|
557
557
|
const o = {
|
|
558
558
|
x: e.x - i.x,
|
|
559
559
|
y: e.y - i.y
|
|
560
|
-
},
|
|
560
|
+
}, f = H(o, t) / r, s = H(o, n) / r, c = i.x + s * t.x, u = e.x + f * n.x, g = i.y + s * t.y, l = e.y + f * n.y, h = (c + u) / 2, a = (g + l) / 2;
|
|
561
561
|
return {
|
|
562
562
|
x: h,
|
|
563
563
|
y: a
|
|
@@ -622,24 +622,24 @@ class L {
|
|
|
622
622
|
const e = /* @__PURE__ */ new Map(), n = (r) => {
|
|
623
623
|
const o = r.otherSE;
|
|
624
624
|
e.set(r, {
|
|
625
|
-
sine:
|
|
626
|
-
cosine:
|
|
625
|
+
sine: ye(this.point, t.point, o.point),
|
|
626
|
+
cosine: de(this.point, t.point, o.point)
|
|
627
627
|
});
|
|
628
628
|
};
|
|
629
629
|
return (r, o) => {
|
|
630
630
|
e.has(r) || n(r), e.has(o) || n(o);
|
|
631
631
|
const {
|
|
632
|
-
sine:
|
|
632
|
+
sine: f,
|
|
633
633
|
cosine: s
|
|
634
634
|
} = e.get(r), {
|
|
635
635
|
sine: c,
|
|
636
|
-
cosine:
|
|
636
|
+
cosine: u
|
|
637
637
|
} = e.get(o);
|
|
638
|
-
return
|
|
638
|
+
return f >= 0 && c >= 0 ? s < u ? 1 : s > u ? -1 : 0 : f < 0 && c < 0 ? s < u ? -1 : s > u ? 1 : 0 : c < f ? -1 : c > f ? 1 : 0;
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
let
|
|
642
|
+
let ve = 0;
|
|
643
643
|
class T {
|
|
644
644
|
/* This compare() function is for ordering segments in the sweep
|
|
645
645
|
* line tree, and does so according to the following criteria:
|
|
@@ -655,13 +655,13 @@ class T {
|
|
|
655
655
|
* is directly on the right-more of the two left inputs.
|
|
656
656
|
*/
|
|
657
657
|
static compare(t, e) {
|
|
658
|
-
const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x,
|
|
659
|
-
if (
|
|
658
|
+
const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x, f = e.rightSE.point.x;
|
|
659
|
+
if (f < n) return 1;
|
|
660
660
|
if (o < r) return -1;
|
|
661
|
-
const s = t.leftSE.point.y, c = e.leftSE.point.y,
|
|
661
|
+
const s = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y, g = e.rightSE.point.y;
|
|
662
662
|
if (n < r) {
|
|
663
|
-
if (c < s && c <
|
|
664
|
-
if (c > s && c >
|
|
663
|
+
if (c < s && c < u) return 1;
|
|
664
|
+
if (c > s && c > u) return -1;
|
|
665
665
|
const l = t.comparePoint(e.leftSE.point);
|
|
666
666
|
if (l < 0) return 1;
|
|
667
667
|
if (l > 0) return -1;
|
|
@@ -678,37 +678,37 @@ class T {
|
|
|
678
678
|
}
|
|
679
679
|
if (s < c) return -1;
|
|
680
680
|
if (s > c) return 1;
|
|
681
|
-
if (o <
|
|
681
|
+
if (o < f) {
|
|
682
682
|
const l = e.comparePoint(t.rightSE.point);
|
|
683
683
|
if (l !== 0) return l;
|
|
684
684
|
}
|
|
685
|
-
if (o >
|
|
685
|
+
if (o > f) {
|
|
686
686
|
const l = t.comparePoint(e.rightSE.point);
|
|
687
687
|
if (l < 0) return 1;
|
|
688
688
|
if (l > 0) return -1;
|
|
689
689
|
}
|
|
690
|
-
if (o !==
|
|
691
|
-
const l =
|
|
690
|
+
if (o !== f) {
|
|
691
|
+
const l = u - s, h = o - n, a = g - c, d = f - r;
|
|
692
692
|
if (l > h && a < d) return 1;
|
|
693
693
|
if (l < h && a > d) return -1;
|
|
694
694
|
}
|
|
695
|
-
return o >
|
|
695
|
+
return o > f ? 1 : o < f || u < g ? -1 : u > g ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
|
|
696
696
|
}
|
|
697
697
|
/* Warning: a reference to ringWindings input will be stored,
|
|
698
698
|
* and possibly will be later modified */
|
|
699
699
|
constructor(t, e, n, r) {
|
|
700
|
-
this.id = ++
|
|
700
|
+
this.id = ++ve, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
|
|
701
701
|
}
|
|
702
702
|
static fromRing(t, e, n) {
|
|
703
|
-
let r, o,
|
|
703
|
+
let r, o, f;
|
|
704
704
|
const s = L.comparePoints(t, e);
|
|
705
705
|
if (s < 0)
|
|
706
|
-
r = t, o = e,
|
|
706
|
+
r = t, o = e, f = 1;
|
|
707
707
|
else if (s > 0)
|
|
708
|
-
r = e, o = t,
|
|
708
|
+
r = e, o = t, f = -1;
|
|
709
709
|
else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);
|
|
710
|
-
const c = new L(r, !0),
|
|
711
|
-
return new T(c,
|
|
710
|
+
const c = new L(r, !0), u = new L(o, !1);
|
|
711
|
+
return new T(c, u, [n], [f]);
|
|
712
712
|
}
|
|
713
713
|
/* When a segment is split, the rightSE is replaced with a new sweep event */
|
|
714
714
|
replaceRightSE(t) {
|
|
@@ -755,8 +755,8 @@ class T {
|
|
|
755
755
|
const e = this.leftSE.point, n = this.rightSE.point, r = this.vector();
|
|
756
756
|
if (e.x === n.x)
|
|
757
757
|
return t.x === e.x ? 0 : t.x < e.x ? 1 : -1;
|
|
758
|
-
const o = (t.y - e.y) / r.y,
|
|
759
|
-
if (t.x ===
|
|
758
|
+
const o = (t.y - e.y) / r.y, f = e.x + o * r.x;
|
|
759
|
+
if (t.x === f) return 0;
|
|
760
760
|
const s = (t.x - e.x) / r.x, c = e.y + s * r.y;
|
|
761
761
|
return t.y === c ? 0 : t.y < c ? -1 : 1;
|
|
762
762
|
}
|
|
@@ -778,18 +778,18 @@ class T {
|
|
|
778
778
|
getIntersection(t) {
|
|
779
779
|
const e = this.bbox(), n = t.bbox(), r = ht(e, n);
|
|
780
780
|
if (r === null) return null;
|
|
781
|
-
const o = this.leftSE.point,
|
|
782
|
-
if (g &&
|
|
783
|
-
return h && !l ?
|
|
781
|
+
const o = this.leftSE.point, f = this.rightSE.point, s = t.leftSE.point, c = t.rightSE.point, u = F(e, s) && this.comparePoint(s) === 0, g = F(n, o) && t.comparePoint(o) === 0, l = F(e, c) && this.comparePoint(c) === 0, h = F(n, f) && t.comparePoint(f) === 0;
|
|
782
|
+
if (g && u)
|
|
783
|
+
return h && !l ? f : !h && l ? c : null;
|
|
784
784
|
if (g)
|
|
785
785
|
return l && o.x === c.x && o.y === c.y ? null : o;
|
|
786
|
-
if (
|
|
787
|
-
return h &&
|
|
786
|
+
if (u)
|
|
787
|
+
return h && f.x === s.x && f.y === s.y ? null : s;
|
|
788
788
|
if (h && l) return null;
|
|
789
|
-
if (h) return
|
|
789
|
+
if (h) return f;
|
|
790
790
|
if (l) return c;
|
|
791
|
-
const a =
|
|
792
|
-
return a === null || !
|
|
791
|
+
const a = xe(o, this.vector(), s, t.vector());
|
|
792
|
+
return a === null || !F(r, a) ? null : Z.round(a.x, a.y);
|
|
793
793
|
}
|
|
794
794
|
/**
|
|
795
795
|
* Split the given segment into multiple segments on the given points.
|
|
@@ -804,9 +804,9 @@ class T {
|
|
|
804
804
|
* Warning: input array of points is modified
|
|
805
805
|
*/
|
|
806
806
|
split(t) {
|
|
807
|
-
const e = [], n = t.events !== void 0, r = new L(t, !0), o = new L(t, !1),
|
|
807
|
+
const e = [], n = t.events !== void 0, r = new L(t, !0), o = new L(t, !1), f = this.rightSE;
|
|
808
808
|
this.replaceRightSE(o), e.push(o), e.push(r);
|
|
809
|
-
const s = new T(r,
|
|
809
|
+
const s = new T(r, f, this.rings.slice(), this.windings.slice());
|
|
810
810
|
return L.comparePoints(s.leftSE.point, s.rightSE.point) > 0 && s.swapEvents(), L.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (r.checkForConsuming(), o.checkForConsuming()), e;
|
|
811
811
|
}
|
|
812
812
|
/* Swap which event is left and right */
|
|
@@ -832,9 +832,9 @@ class T {
|
|
|
832
832
|
const o = e;
|
|
833
833
|
e = n, n = o;
|
|
834
834
|
}
|
|
835
|
-
for (let o = 0,
|
|
836
|
-
const s = n.rings[o], c = n.windings[o],
|
|
837
|
-
|
|
835
|
+
for (let o = 0, f = n.rings.length; o < f; o++) {
|
|
836
|
+
const s = n.rings[o], c = n.windings[o], u = e.rings.indexOf(s);
|
|
837
|
+
u === -1 ? (e.rings.push(s), e.windings.push(c)) : e.windings[u] += c;
|
|
838
838
|
}
|
|
839
839
|
n.rings = null, n.windings = null, n.consumedBy = e, n.leftSE.consumedBy = e.leftSE, n.rightSE.consumedBy = e.rightSE;
|
|
840
840
|
}
|
|
@@ -866,24 +866,24 @@ class T {
|
|
|
866
866
|
};
|
|
867
867
|
const e = this._afterState.rings, n = this._afterState.windings, r = this._afterState.multiPolys;
|
|
868
868
|
for (let s = 0, c = this.rings.length; s < c; s++) {
|
|
869
|
-
const
|
|
870
|
-
l === -1 ? (e.push(
|
|
869
|
+
const u = this.rings[s], g = this.windings[s], l = e.indexOf(u);
|
|
870
|
+
l === -1 ? (e.push(u), n.push(g)) : n[l] += g;
|
|
871
871
|
}
|
|
872
|
-
const o = [],
|
|
872
|
+
const o = [], f = [];
|
|
873
873
|
for (let s = 0, c = e.length; s < c; s++) {
|
|
874
874
|
if (n[s] === 0) continue;
|
|
875
|
-
const
|
|
876
|
-
if (
|
|
877
|
-
if (
|
|
875
|
+
const u = e[s], g = u.poly;
|
|
876
|
+
if (f.indexOf(g) === -1)
|
|
877
|
+
if (u.isExterior) o.push(g);
|
|
878
878
|
else {
|
|
879
|
-
|
|
880
|
-
const l = o.indexOf(
|
|
879
|
+
f.indexOf(g) === -1 && f.push(g);
|
|
880
|
+
const l = o.indexOf(u.poly);
|
|
881
881
|
l !== -1 && o.splice(l, 1);
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
for (let s = 0, c = o.length; s < c; s++) {
|
|
885
|
-
const
|
|
886
|
-
r.indexOf(
|
|
885
|
+
const u = o[s].multiPoly;
|
|
886
|
+
r.indexOf(u) === -1 && r.push(u);
|
|
887
887
|
}
|
|
888
888
|
return this._afterState;
|
|
889
889
|
}
|
|
@@ -925,7 +925,7 @@ class Lt {
|
|
|
925
925
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
926
926
|
if (this.poly = e, this.isExterior = n, this.segments = [], typeof t[0][0] != "number" || typeof t[0][1] != "number")
|
|
927
927
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
928
|
-
const r =
|
|
928
|
+
const r = Z.round(t[0][0], t[0][1]);
|
|
929
929
|
this.bbox = {
|
|
930
930
|
ll: {
|
|
931
931
|
x: r.x,
|
|
@@ -937,10 +937,10 @@ class Lt {
|
|
|
937
937
|
}
|
|
938
938
|
};
|
|
939
939
|
let o = r;
|
|
940
|
-
for (let
|
|
941
|
-
if (typeof t[
|
|
940
|
+
for (let f = 1, s = t.length; f < s; f++) {
|
|
941
|
+
if (typeof t[f][0] != "number" || typeof t[f][1] != "number")
|
|
942
942
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
943
|
-
let c =
|
|
943
|
+
let c = Z.round(t[f][0], t[f][1]);
|
|
944
944
|
c.x === o.x && c.y === o.y || (this.segments.push(T.fromRing(o, c, this)), c.x < this.bbox.ll.x && (this.bbox.ll.x = c.x), c.y < this.bbox.ll.y && (this.bbox.ll.y = c.y), c.x > this.bbox.ur.x && (this.bbox.ur.x = c.x), c.y > this.bbox.ur.y && (this.bbox.ur.y = c.y), o = c);
|
|
945
945
|
}
|
|
946
946
|
(r.x !== o.x || r.y !== o.y) && this.segments.push(T.fromRing(o, r, this));
|
|
@@ -954,7 +954,7 @@ class Lt {
|
|
|
954
954
|
return t;
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
|
-
class
|
|
957
|
+
class me {
|
|
958
958
|
constructor(t, e) {
|
|
959
959
|
if (!Array.isArray(t))
|
|
960
960
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
@@ -978,7 +978,7 @@ class ve {
|
|
|
978
978
|
const t = this.exteriorRing.getSweepEvents();
|
|
979
979
|
for (let e = 0, n = this.interiorRings.length; e < n; e++) {
|
|
980
980
|
const r = this.interiorRings[e].getSweepEvents();
|
|
981
|
-
for (let o = 0,
|
|
981
|
+
for (let o = 0, f = r.length; o < f; o++)
|
|
982
982
|
t.push(r[o]);
|
|
983
983
|
}
|
|
984
984
|
return t;
|
|
@@ -1003,7 +1003,7 @@ class Rt {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
};
|
|
1005
1005
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1006
|
-
const o = new
|
|
1006
|
+
const o = new me(t[n], this);
|
|
1007
1007
|
o.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = o.bbox.ll.x), o.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = o.bbox.ll.y), o.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = o.bbox.ur.x), o.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = o.bbox.ur.y), this.polys.push(o);
|
|
1008
1008
|
}
|
|
1009
1009
|
this.isSubject = e;
|
|
@@ -1012,7 +1012,7 @@ class Rt {
|
|
|
1012
1012
|
const t = [];
|
|
1013
1013
|
for (let e = 0, n = this.polys.length; e < n; e++) {
|
|
1014
1014
|
const r = this.polys[e].getSweepEvents();
|
|
1015
|
-
for (let o = 0,
|
|
1015
|
+
for (let o = 0, f = r.length; o < f; o++)
|
|
1016
1016
|
t.push(r[o]);
|
|
1017
1017
|
}
|
|
1018
1018
|
return t;
|
|
@@ -1026,39 +1026,39 @@ class et {
|
|
|
1026
1026
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1027
1027
|
const o = t[n];
|
|
1028
1028
|
if (!o.isInResult() || o.ringOut) continue;
|
|
1029
|
-
let
|
|
1030
|
-
const
|
|
1031
|
-
for (;
|
|
1029
|
+
let f = null, s = o.leftSE, c = o.rightSE;
|
|
1030
|
+
const u = [s], g = s.point, l = [];
|
|
1031
|
+
for (; f = s, s = c, u.push(s), s.point !== g; )
|
|
1032
1032
|
for (; ; ) {
|
|
1033
1033
|
const h = s.getAvailableLinkedEvents();
|
|
1034
1034
|
if (h.length === 0) {
|
|
1035
|
-
const x =
|
|
1036
|
-
throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${
|
|
1035
|
+
const x = u[0].point, p = u[u.length - 1].point;
|
|
1036
|
+
throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${p.x}, ${p.y}].`);
|
|
1037
1037
|
}
|
|
1038
1038
|
if (h.length === 1) {
|
|
1039
1039
|
c = h[0].otherSE;
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
1042
|
let a = null;
|
|
1043
|
-
for (let x = 0,
|
|
1043
|
+
for (let x = 0, p = l.length; x < p; x++)
|
|
1044
1044
|
if (l[x].point === s.point) {
|
|
1045
1045
|
a = x;
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
1048
|
if (a !== null) {
|
|
1049
|
-
const x = l.splice(a)[0],
|
|
1050
|
-
|
|
1049
|
+
const x = l.splice(a)[0], p = u.splice(x.index);
|
|
1050
|
+
p.unshift(p[0].otherSE), e.push(new et(p.reverse()));
|
|
1051
1051
|
continue;
|
|
1052
1052
|
}
|
|
1053
1053
|
l.push({
|
|
1054
|
-
index:
|
|
1054
|
+
index: u.length,
|
|
1055
1055
|
point: s.point
|
|
1056
1056
|
});
|
|
1057
|
-
const d = s.getLeftmostComparator(
|
|
1057
|
+
const d = s.getLeftmostComparator(f);
|
|
1058
1058
|
c = h.sort(d)[0].otherSE;
|
|
1059
1059
|
break;
|
|
1060
1060
|
}
|
|
1061
|
-
e.push(new et(
|
|
1061
|
+
e.push(new et(u));
|
|
1062
1062
|
}
|
|
1063
1063
|
return e;
|
|
1064
1064
|
}
|
|
@@ -1071,15 +1071,15 @@ class et {
|
|
|
1071
1071
|
getGeom() {
|
|
1072
1072
|
let t = this.events[0].point;
|
|
1073
1073
|
const e = [t];
|
|
1074
|
-
for (let
|
|
1075
|
-
const l = this.events[
|
|
1074
|
+
for (let u = 1, g = this.events.length - 1; u < g; u++) {
|
|
1075
|
+
const l = this.events[u].point, h = this.events[u + 1].point;
|
|
1076
1076
|
St(l, t, h) !== 0 && (e.push(l), t = l);
|
|
1077
1077
|
}
|
|
1078
1078
|
if (e.length === 1) return null;
|
|
1079
1079
|
const n = e[0], r = e[1];
|
|
1080
1080
|
St(n, t, r) === 0 && e.shift(), e.push(e[0]);
|
|
1081
|
-
const o = this.isExteriorRing() ? 1 : -1,
|
|
1082
|
-
for (let
|
|
1081
|
+
const o = this.isExteriorRing() ? 1 : -1, f = this.isExteriorRing() ? 0 : e.length - 1, s = this.isExteriorRing() ? e.length : -1, c = [];
|
|
1082
|
+
for (let u = f; u != s; u += o) c.push([e[u].x, e[u].y]);
|
|
1083
1083
|
return c;
|
|
1084
1084
|
}
|
|
1085
1085
|
isExteriorRing() {
|
|
@@ -1096,8 +1096,8 @@ class et {
|
|
|
1096
1096
|
_calcEnclosingRing() {
|
|
1097
1097
|
let t = this.events[0];
|
|
1098
1098
|
for (let r = 1, o = this.events.length; r < o; r++) {
|
|
1099
|
-
const
|
|
1100
|
-
L.compare(t,
|
|
1099
|
+
const f = this.events[r];
|
|
1100
|
+
L.compare(t, f) > 0 && (t = f);
|
|
1101
1101
|
}
|
|
1102
1102
|
let e = t.segment.prevInResult(), n = e ? e.prevInResult() : null;
|
|
1103
1103
|
for (; ; ) {
|
|
@@ -1126,7 +1126,7 @@ class kt {
|
|
|
1126
1126
|
return t;
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
class
|
|
1129
|
+
class Ee {
|
|
1130
1130
|
constructor(t) {
|
|
1131
1131
|
this.rings = t, this.polys = this._composePolys(t);
|
|
1132
1132
|
}
|
|
@@ -1145,14 +1145,14 @@ class we {
|
|
|
1145
1145
|
if (!o.poly)
|
|
1146
1146
|
if (o.isExteriorRing()) e.push(new kt(o));
|
|
1147
1147
|
else {
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1148
|
+
const f = o.enclosingRing();
|
|
1149
|
+
f.poly || e.push(new kt(f)), f.poly.addInterior(o);
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
1152
|
return e;
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
|
-
class
|
|
1155
|
+
class we {
|
|
1156
1156
|
constructor(t) {
|
|
1157
1157
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : T.compare;
|
|
1158
1158
|
this.queue = t, this.tree = new yt(e), this.segments = [];
|
|
@@ -1163,16 +1163,16 @@ class Ee {
|
|
|
1163
1163
|
return t.isLeft ? this.queue.remove(t.otherSE) : this.tree.remove(e), n;
|
|
1164
1164
|
const r = t.isLeft ? this.tree.add(e) : this.tree.find(e);
|
|
1165
1165
|
if (!r) throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);
|
|
1166
|
-
let o = r,
|
|
1166
|
+
let o = r, f = r, s, c;
|
|
1167
1167
|
for (; s === void 0; )
|
|
1168
1168
|
o = this.tree.prev(o), o === null ? s = null : o.key.consumedBy === void 0 && (s = o.key);
|
|
1169
1169
|
for (; c === void 0; )
|
|
1170
|
-
|
|
1170
|
+
f = this.tree.next(f), f === null ? c = null : f.key.consumedBy === void 0 && (c = f.key);
|
|
1171
1171
|
if (t.isLeft) {
|
|
1172
|
-
let
|
|
1172
|
+
let u = null;
|
|
1173
1173
|
if (s) {
|
|
1174
1174
|
const l = s.getIntersection(e);
|
|
1175
|
-
if (l !== null && (e.isAnEndpoint(l) || (
|
|
1175
|
+
if (l !== null && (e.isAnEndpoint(l) || (u = l), !s.isAnEndpoint(l))) {
|
|
1176
1176
|
const h = this._splitSafely(s, l);
|
|
1177
1177
|
for (let a = 0, d = h.length; a < d; a++)
|
|
1178
1178
|
n.push(h[a]);
|
|
@@ -1187,9 +1187,9 @@ class Ee {
|
|
|
1187
1187
|
n.push(h[a]);
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
if (
|
|
1190
|
+
if (u !== null || g !== null) {
|
|
1191
1191
|
let l = null;
|
|
1192
|
-
|
|
1192
|
+
u === null ? l = g : g === null ? l = u : l = L.comparePoints(u, g) <= 0 ? u : g, this.queue.remove(e.rightSE), n.push(e.rightSE);
|
|
1193
1193
|
const h = e.split(l);
|
|
1194
1194
|
for (let a = 0, d = h.length; a < d; a++)
|
|
1195
1195
|
n.push(h[a]);
|
|
@@ -1197,15 +1197,15 @@ class Ee {
|
|
|
1197
1197
|
n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = s);
|
|
1198
1198
|
} else {
|
|
1199
1199
|
if (s && c) {
|
|
1200
|
-
const
|
|
1201
|
-
if (
|
|
1202
|
-
if (!s.isAnEndpoint(
|
|
1203
|
-
const g = this._splitSafely(s,
|
|
1200
|
+
const u = s.getIntersection(c);
|
|
1201
|
+
if (u !== null) {
|
|
1202
|
+
if (!s.isAnEndpoint(u)) {
|
|
1203
|
+
const g = this._splitSafely(s, u);
|
|
1204
1204
|
for (let l = 0, h = g.length; l < h; l++)
|
|
1205
1205
|
n.push(g[l]);
|
|
1206
1206
|
}
|
|
1207
|
-
if (!c.isAnEndpoint(
|
|
1208
|
-
const g = this._splitSafely(c,
|
|
1207
|
+
if (!c.isAnEndpoint(u)) {
|
|
1208
|
+
const g = this._splitSafely(c, u);
|
|
1209
1209
|
for (let l = 0, h = g.length; l < h; l++)
|
|
1210
1210
|
n.push(g[l]);
|
|
1211
1211
|
}
|
|
@@ -1225,10 +1225,10 @@ class Ee {
|
|
|
1225
1225
|
return r.push(n), t.consumedBy === void 0 && this.tree.add(t), r;
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
const Ct = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6,
|
|
1229
|
-
class
|
|
1228
|
+
const Ct = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, be = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
|
|
1229
|
+
class _e {
|
|
1230
1230
|
run(t, e, n) {
|
|
1231
|
-
$.type = t,
|
|
1231
|
+
$.type = t, Z.reset();
|
|
1232
1232
|
const r = [new Rt(e, !0)];
|
|
1233
1233
|
for (let l = 0, h = n.length; l < h; l++)
|
|
1234
1234
|
r.push(new Rt(n[l], !1));
|
|
@@ -1251,7 +1251,7 @@ class be {
|
|
|
1251
1251
|
if (o.insert(a[d]), o.size > Ct)
|
|
1252
1252
|
throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
|
|
1253
1253
|
}
|
|
1254
|
-
const
|
|
1254
|
+
const f = new we(o);
|
|
1255
1255
|
let s = o.size, c = o.pop();
|
|
1256
1256
|
for (; c; ) {
|
|
1257
1257
|
const l = c.key;
|
|
@@ -1261,65 +1261,65 @@ class be {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
if (o.size > Ct)
|
|
1263
1263
|
throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
|
|
1264
|
-
if (
|
|
1264
|
+
if (f.segments.length > be)
|
|
1265
1265
|
throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
|
|
1266
|
-
const h =
|
|
1266
|
+
const h = f.process(l);
|
|
1267
1267
|
for (let a = 0, d = h.length; a < d; a++) {
|
|
1268
1268
|
const x = h[a];
|
|
1269
1269
|
x.consumedBy === void 0 && o.insert(x);
|
|
1270
1270
|
}
|
|
1271
1271
|
s = o.size, c = o.pop();
|
|
1272
1272
|
}
|
|
1273
|
-
|
|
1274
|
-
const
|
|
1275
|
-
return new
|
|
1273
|
+
Z.reset();
|
|
1274
|
+
const u = et.factory(f.segments);
|
|
1275
|
+
return new Ee(u).getGeom();
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
-
const $ = new
|
|
1278
|
+
const $ = new _e(), Se = function(i) {
|
|
1279
1279
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1280
1280
|
e[n - 1] = arguments[n];
|
|
1281
1281
|
return $.run("union", i, e);
|
|
1282
|
-
},
|
|
1282
|
+
}, Pe = function(i) {
|
|
1283
1283
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1284
1284
|
e[n - 1] = arguments[n];
|
|
1285
1285
|
return $.run("intersection", i, e);
|
|
1286
|
-
},
|
|
1286
|
+
}, Me = function(i) {
|
|
1287
1287
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1288
1288
|
e[n - 1] = arguments[n];
|
|
1289
1289
|
return $.run("xor", i, e);
|
|
1290
|
-
},
|
|
1290
|
+
}, Le = function(i) {
|
|
1291
1291
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1292
1292
|
e[n - 1] = arguments[n];
|
|
1293
1293
|
return $.run("difference", i, e);
|
|
1294
1294
|
};
|
|
1295
|
-
var
|
|
1296
|
-
union:
|
|
1297
|
-
intersection:
|
|
1298
|
-
xor:
|
|
1299
|
-
difference:
|
|
1295
|
+
var Qt = {
|
|
1296
|
+
union: Se,
|
|
1297
|
+
intersection: Pe,
|
|
1298
|
+
xor: Me,
|
|
1299
|
+
difference: Le
|
|
1300
1300
|
};
|
|
1301
|
-
function
|
|
1301
|
+
function Ut(i, t, e) {
|
|
1302
1302
|
if (i !== null)
|
|
1303
|
-
for (var n, r, o,
|
|
1304
|
-
|
|
1303
|
+
for (var n, r, o, f, s, c, u, g = 0, l = 0, h, a = i.type, d = a === "FeatureCollection", x = a === "Feature", p = d ? i.features.length : 1, y = 0; y < p; y++) {
|
|
1304
|
+
u = d ? i.features[y].geometry : x ? i.geometry : i, h = u ? u.type === "GeometryCollection" : !1, s = h ? u.geometries.length : 1;
|
|
1305
1305
|
for (var v = 0; v < s; v++) {
|
|
1306
|
-
var
|
|
1307
|
-
if (
|
|
1308
|
-
c =
|
|
1309
|
-
var
|
|
1310
|
-
switch (g = 0,
|
|
1306
|
+
var m = 0, E = 0;
|
|
1307
|
+
if (f = h ? u.geometries[v] : u, f !== null) {
|
|
1308
|
+
c = f.coordinates;
|
|
1309
|
+
var w = f.type;
|
|
1310
|
+
switch (g = 0, w) {
|
|
1311
1311
|
case null:
|
|
1312
1312
|
break;
|
|
1313
1313
|
case "Point":
|
|
1314
1314
|
if (t(
|
|
1315
1315
|
c,
|
|
1316
1316
|
l,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1317
|
+
y,
|
|
1318
|
+
m,
|
|
1319
|
+
E
|
|
1320
1320
|
) === !1)
|
|
1321
1321
|
return !1;
|
|
1322
|
-
l++,
|
|
1322
|
+
l++, m++;
|
|
1323
1323
|
break;
|
|
1324
1324
|
case "LineString":
|
|
1325
1325
|
case "MultiPoint":
|
|
@@ -1327,14 +1327,14 @@ function Qt(i, t, e) {
|
|
|
1327
1327
|
if (t(
|
|
1328
1328
|
c[n],
|
|
1329
1329
|
l,
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1330
|
+
y,
|
|
1331
|
+
m,
|
|
1332
|
+
E
|
|
1333
1333
|
) === !1)
|
|
1334
1334
|
return !1;
|
|
1335
|
-
l++,
|
|
1335
|
+
l++, w === "MultiPoint" && m++;
|
|
1336
1336
|
}
|
|
1337
|
-
|
|
1337
|
+
w === "LineString" && m++;
|
|
1338
1338
|
break;
|
|
1339
1339
|
case "Polygon":
|
|
1340
1340
|
case "MultiLineString":
|
|
@@ -1343,39 +1343,39 @@ function Qt(i, t, e) {
|
|
|
1343
1343
|
if (t(
|
|
1344
1344
|
c[n][r],
|
|
1345
1345
|
l,
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1346
|
+
y,
|
|
1347
|
+
m,
|
|
1348
|
+
E
|
|
1349
1349
|
) === !1)
|
|
1350
1350
|
return !1;
|
|
1351
1351
|
l++;
|
|
1352
1352
|
}
|
|
1353
|
-
|
|
1353
|
+
w === "MultiLineString" && m++, w === "Polygon" && E++;
|
|
1354
1354
|
}
|
|
1355
|
-
|
|
1355
|
+
w === "Polygon" && m++;
|
|
1356
1356
|
break;
|
|
1357
1357
|
case "MultiPolygon":
|
|
1358
1358
|
for (n = 0; n < c.length; n++) {
|
|
1359
|
-
for (
|
|
1359
|
+
for (E = 0, r = 0; r < c[n].length; r++) {
|
|
1360
1360
|
for (o = 0; o < c[n][r].length - g; o++) {
|
|
1361
1361
|
if (t(
|
|
1362
1362
|
c[n][r][o],
|
|
1363
1363
|
l,
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1364
|
+
y,
|
|
1365
|
+
m,
|
|
1366
|
+
E
|
|
1367
1367
|
) === !1)
|
|
1368
1368
|
return !1;
|
|
1369
1369
|
l++;
|
|
1370
1370
|
}
|
|
1371
|
-
|
|
1371
|
+
E++;
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1373
|
+
m++;
|
|
1374
1374
|
}
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "GeometryCollection":
|
|
1377
|
-
for (n = 0; n <
|
|
1378
|
-
if (
|
|
1377
|
+
for (n = 0; n < f.geometries.length; n++)
|
|
1378
|
+
if (Ut(f.geometries[n], t) === !1)
|
|
1379
1379
|
return !1;
|
|
1380
1380
|
break;
|
|
1381
1381
|
default:
|
|
@@ -1386,14 +1386,14 @@ function Qt(i, t, e) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
}
|
|
1388
1388
|
function dt(i, t) {
|
|
1389
|
-
var e, n, r, o,
|
|
1389
|
+
var e, n, r, o, f, s, c, u, g, l, h = 0, a = i.type === "FeatureCollection", d = i.type === "Feature", x = a ? i.features.length : 1;
|
|
1390
1390
|
for (e = 0; e < x; e++) {
|
|
1391
|
-
for (s = a ? i.features[e].geometry : d ? i.geometry : i,
|
|
1391
|
+
for (s = a ? i.features[e].geometry : d ? i.geometry : i, u = a ? i.features[e].properties : d ? i.properties : {}, g = a ? i.features[e].bbox : d ? i.bbox : void 0, l = a ? i.features[e].id : d ? i.id : void 0, c = s ? s.type === "GeometryCollection" : !1, f = c ? s.geometries.length : 1, r = 0; r < f; r++) {
|
|
1392
1392
|
if (o = c ? s.geometries[r] : s, o === null) {
|
|
1393
1393
|
if (t(
|
|
1394
1394
|
null,
|
|
1395
1395
|
h,
|
|
1396
|
-
|
|
1396
|
+
u,
|
|
1397
1397
|
g,
|
|
1398
1398
|
l
|
|
1399
1399
|
) === !1)
|
|
@@ -1410,7 +1410,7 @@ function dt(i, t) {
|
|
|
1410
1410
|
if (t(
|
|
1411
1411
|
o,
|
|
1412
1412
|
h,
|
|
1413
|
-
|
|
1413
|
+
u,
|
|
1414
1414
|
g,
|
|
1415
1415
|
l
|
|
1416
1416
|
) === !1)
|
|
@@ -1422,7 +1422,7 @@ function dt(i, t) {
|
|
|
1422
1422
|
if (t(
|
|
1423
1423
|
o.geometries[n],
|
|
1424
1424
|
h,
|
|
1425
|
-
|
|
1425
|
+
u,
|
|
1426
1426
|
g,
|
|
1427
1427
|
l
|
|
1428
1428
|
) === !1)
|
|
@@ -1436,8 +1436,8 @@ function dt(i, t) {
|
|
|
1436
1436
|
h++;
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1440
|
-
dt(i, function(e, n, r, o,
|
|
1439
|
+
function Re(i, t) {
|
|
1440
|
+
dt(i, function(e, n, r, o, f) {
|
|
1441
1441
|
var s = e === null ? null : e.type;
|
|
1442
1442
|
switch (s) {
|
|
1443
1443
|
case null:
|
|
@@ -1445,7 +1445,7 @@ function Le(i, t) {
|
|
|
1445
1445
|
case "LineString":
|
|
1446
1446
|
case "Polygon":
|
|
1447
1447
|
return t(
|
|
1448
|
-
|
|
1448
|
+
X(e, r, { bbox: o, id: f }),
|
|
1449
1449
|
n,
|
|
1450
1450
|
0
|
|
1451
1451
|
) === !1 ? !1 : void 0;
|
|
@@ -1462,50 +1462,50 @@ function Le(i, t) {
|
|
|
1462
1462
|
c = "Polygon";
|
|
1463
1463
|
break;
|
|
1464
1464
|
}
|
|
1465
|
-
for (var
|
|
1466
|
-
var g = e.coordinates[
|
|
1465
|
+
for (var u = 0; u < e.coordinates.length; u++) {
|
|
1466
|
+
var g = e.coordinates[u], l = {
|
|
1467
1467
|
type: c,
|
|
1468
1468
|
coordinates: g
|
|
1469
1469
|
};
|
|
1470
|
-
if (t(
|
|
1470
|
+
if (t(X(l, r), n, u) === !1)
|
|
1471
1471
|
return !1;
|
|
1472
1472
|
}
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function ke(i, t = {}) {
|
|
1476
1476
|
const e = [];
|
|
1477
1477
|
if (dt(i, (r) => {
|
|
1478
1478
|
e.push(r.coordinates);
|
|
1479
1479
|
}), e.length < 2)
|
|
1480
1480
|
throw new Error("Must have at least 2 geometries");
|
|
1481
|
-
const n =
|
|
1482
|
-
return n.length === 0 ? null : n.length === 1 ? pt(n[0], t.properties) :
|
|
1481
|
+
const n = Qt.union(e[0], ...e.slice(1));
|
|
1482
|
+
return n.length === 0 ? null : n.length === 1 ? pt(n[0], t.properties) : jt(n, t.properties);
|
|
1483
1483
|
}
|
|
1484
|
-
var
|
|
1484
|
+
var Yt = ke;
|
|
1485
1485
|
function W() {
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function Ft(i) {
|
|
1488
1488
|
return i();
|
|
1489
1489
|
}
|
|
1490
1490
|
function It() {
|
|
1491
1491
|
return /* @__PURE__ */ Object.create(null);
|
|
1492
1492
|
}
|
|
1493
1493
|
function nt(i) {
|
|
1494
|
-
i.forEach(
|
|
1494
|
+
i.forEach(Ft);
|
|
1495
1495
|
}
|
|
1496
1496
|
function Dt(i) {
|
|
1497
1497
|
return typeof i == "function";
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function Ce(i, t) {
|
|
1500
1500
|
return i != i ? t == t : i !== t || i && typeof i == "object" || typeof i == "function";
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1502
|
+
function Ie(i) {
|
|
1503
1503
|
return Object.keys(i).length === 0;
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function $e(i, t) {
|
|
1506
1506
|
i.appendChild(t);
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function Ae(i, t, e) {
|
|
1509
1509
|
i.insertBefore(t, e || null);
|
|
1510
1510
|
}
|
|
1511
1511
|
function Xt(i) {
|
|
@@ -1517,22 +1517,22 @@ function $t(i) {
|
|
|
1517
1517
|
function N(i, t, e) {
|
|
1518
1518
|
e == null ? i.removeAttribute(t) : i.getAttribute(t) !== e && i.setAttribute(t, e);
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function Oe(i) {
|
|
1521
1521
|
return Array.from(i.childNodes);
|
|
1522
1522
|
}
|
|
1523
1523
|
function K(i, t, e) {
|
|
1524
1524
|
i.classList.toggle(t, !!e);
|
|
1525
1525
|
}
|
|
1526
1526
|
let xt;
|
|
1527
|
-
function
|
|
1527
|
+
function D(i) {
|
|
1528
1528
|
xt = i;
|
|
1529
1529
|
}
|
|
1530
1530
|
const Q = [], At = [];
|
|
1531
1531
|
let U = [];
|
|
1532
|
-
const Ot = [],
|
|
1532
|
+
const Ot = [], Ne = /* @__PURE__ */ Promise.resolve();
|
|
1533
1533
|
let at = !1;
|
|
1534
|
-
function
|
|
1535
|
-
at || (at = !0,
|
|
1534
|
+
function Be() {
|
|
1535
|
+
at || (at = !0, Ne.then(Vt));
|
|
1536
1536
|
}
|
|
1537
1537
|
function gt(i) {
|
|
1538
1538
|
U.push(i);
|
|
@@ -1547,12 +1547,12 @@ function Vt() {
|
|
|
1547
1547
|
try {
|
|
1548
1548
|
for (; q < Q.length; ) {
|
|
1549
1549
|
const t = Q[q];
|
|
1550
|
-
q++,
|
|
1550
|
+
q++, D(t), ze(t.$$);
|
|
1551
1551
|
}
|
|
1552
1552
|
} catch (t) {
|
|
1553
1553
|
throw Q.length = 0, q = 0, t;
|
|
1554
1554
|
}
|
|
1555
|
-
for (
|
|
1555
|
+
for (D(null), Q.length = 0, q = 0; At.length; ) At.pop()();
|
|
1556
1556
|
for (let t = 0; t < U.length; t += 1) {
|
|
1557
1557
|
const e = U[t];
|
|
1558
1558
|
st.has(e) || (st.add(e), e());
|
|
@@ -1561,41 +1561,41 @@ function Vt() {
|
|
|
1561
1561
|
} while (Q.length);
|
|
1562
1562
|
for (; Ot.length; )
|
|
1563
1563
|
Ot.pop()();
|
|
1564
|
-
at = !1, st.clear(),
|
|
1564
|
+
at = !1, st.clear(), D(i);
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function ze(i) {
|
|
1567
1567
|
if (i.fragment !== null) {
|
|
1568
1568
|
i.update(), nt(i.before_update);
|
|
1569
1569
|
const t = i.dirty;
|
|
1570
1570
|
i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, t), i.after_update.forEach(gt);
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function Te(i) {
|
|
1574
1574
|
const t = [], e = [];
|
|
1575
1575
|
U.forEach((n) => i.indexOf(n) === -1 ? t.push(n) : e.push(n)), e.forEach((n) => n()), U = t;
|
|
1576
1576
|
}
|
|
1577
|
-
const
|
|
1578
|
-
function
|
|
1579
|
-
i && i.i && (
|
|
1577
|
+
const Ge = /* @__PURE__ */ new Set();
|
|
1578
|
+
function je(i, t) {
|
|
1579
|
+
i && i.i && (Ge.delete(i), i.i(t));
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1581
|
+
function qe(i, t, e) {
|
|
1582
1582
|
const { fragment: n, after_update: r } = i.$$;
|
|
1583
1583
|
n && n.m(t, e), gt(() => {
|
|
1584
|
-
const o = i.$$.on_mount.map(
|
|
1584
|
+
const o = i.$$.on_mount.map(Ft).filter(Dt);
|
|
1585
1585
|
i.$$.on_destroy ? i.$$.on_destroy.push(...o) : nt(o), i.$$.on_mount = [];
|
|
1586
1586
|
}), r.forEach(gt);
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1588
|
+
function Qe(i, t) {
|
|
1589
1589
|
const e = i.$$;
|
|
1590
|
-
e.fragment !== null && (
|
|
1590
|
+
e.fragment !== null && (Te(e.after_update), nt(e.on_destroy), e.fragment && e.fragment.d(t), e.on_destroy = e.fragment = null, e.ctx = []);
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1593
|
-
i.$$.dirty[0] === -1 && (Q.push(i),
|
|
1592
|
+
function Ue(i, t) {
|
|
1593
|
+
i.$$.dirty[0] === -1 && (Q.push(i), Be(), i.$$.dirty.fill(0)), i.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1595
|
+
function Ye(i, t, e, n, r, o, f = null, s = [-1]) {
|
|
1596
1596
|
const c = xt;
|
|
1597
|
-
|
|
1598
|
-
const
|
|
1597
|
+
D(i);
|
|
1598
|
+
const u = i.$$ = {
|
|
1599
1599
|
fragment: null,
|
|
1600
1600
|
ctx: [],
|
|
1601
1601
|
// state
|
|
@@ -1616,22 +1616,22 @@ function Ue(i, t, e, n, r, o, u = null, s = [-1]) {
|
|
|
1616
1616
|
skip_bound: !1,
|
|
1617
1617
|
root: t.target || c.$$.root
|
|
1618
1618
|
};
|
|
1619
|
-
|
|
1619
|
+
f && f(u.root);
|
|
1620
1620
|
let g = !1;
|
|
1621
|
-
if (
|
|
1621
|
+
if (u.ctx = e ? e(i, t.props || {}, (l, h, ...a) => {
|
|
1622
1622
|
const d = a.length ? a[0] : h;
|
|
1623
|
-
return
|
|
1624
|
-
}) : [],
|
|
1623
|
+
return u.ctx && r(u.ctx[l], u.ctx[l] = d) && (!u.skip_bound && u.bound[l] && u.bound[l](d), g && Ue(i, l)), h;
|
|
1624
|
+
}) : [], u.update(), g = !0, nt(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
|
|
1625
1625
|
if (t.hydrate) {
|
|
1626
|
-
const l =
|
|
1627
|
-
|
|
1626
|
+
const l = Oe(t.target);
|
|
1627
|
+
u.fragment && u.fragment.l(l), l.forEach(Xt);
|
|
1628
1628
|
} else
|
|
1629
|
-
|
|
1630
|
-
t.intro &&
|
|
1629
|
+
u.fragment && u.fragment.c();
|
|
1630
|
+
t.intro && je(i.$$.fragment), qe(i, t.target, t.anchor), Vt();
|
|
1631
1631
|
}
|
|
1632
|
-
|
|
1632
|
+
D(c);
|
|
1633
1633
|
}
|
|
1634
|
-
class
|
|
1634
|
+
class Fe {
|
|
1635
1635
|
constructor() {
|
|
1636
1636
|
/**
|
|
1637
1637
|
* ### PRIVATE API
|
|
@@ -1652,7 +1652,7 @@ class Ye {
|
|
|
1652
1652
|
}
|
|
1653
1653
|
/** @returns {void} */
|
|
1654
1654
|
$destroy() {
|
|
1655
|
-
|
|
1655
|
+
Qe(this, 1), this.$destroy = W;
|
|
1656
1656
|
}
|
|
1657
1657
|
/**
|
|
1658
1658
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -1674,7 +1674,7 @@ class Ye {
|
|
|
1674
1674
|
* @returns {void}
|
|
1675
1675
|
*/
|
|
1676
1676
|
$set(t) {
|
|
1677
|
-
this.$$set && !
|
|
1677
|
+
this.$$set && !Ie(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
1680
|
const De = "4";
|
|
@@ -1697,7 +1697,7 @@ function Xe(i) {
|
|
|
1697
1697
|
);
|
|
1698
1698
|
},
|
|
1699
1699
|
m(r, o) {
|
|
1700
|
-
|
|
1700
|
+
Ae(r, t, o), $e(t, e);
|
|
1701
1701
|
},
|
|
1702
1702
|
p(r, [o]) {
|
|
1703
1703
|
o & /*displayIn*/
|
|
@@ -1729,46 +1729,46 @@ function Ve(i, t, e) {
|
|
|
1729
1729
|
"displayIn" in r && e(0, n = r.displayIn);
|
|
1730
1730
|
}, [n];
|
|
1731
1731
|
}
|
|
1732
|
-
class Ze extends
|
|
1732
|
+
class Ze extends Fe {
|
|
1733
1733
|
constructor(t) {
|
|
1734
|
-
super(),
|
|
1734
|
+
super(), Ye(this, t, Ve, Xe, Ce, { displayIn: 0 });
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
|
-
function
|
|
1737
|
+
function We(i, t = {}) {
|
|
1738
1738
|
if (i.bbox != null && t.recompute !== !0)
|
|
1739
1739
|
return i.bbox;
|
|
1740
1740
|
const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
1741
|
-
return
|
|
1741
|
+
return Ut(i, (n) => {
|
|
1742
1742
|
e[0] > n[0] && (e[0] = n[0]), e[1] > n[1] && (e[1] = n[1]), e[2] < n[0] && (e[2] = n[0]), e[3] < n[1] && (e[3] = n[1]);
|
|
1743
1743
|
}), e;
|
|
1744
1744
|
}
|
|
1745
|
-
var Nt =
|
|
1746
|
-
function
|
|
1745
|
+
var Nt = We;
|
|
1746
|
+
function Je(i) {
|
|
1747
1747
|
const t = [];
|
|
1748
1748
|
if (dt(i, (r) => {
|
|
1749
1749
|
t.push(r.coordinates);
|
|
1750
1750
|
}), t.length < 2)
|
|
1751
1751
|
throw new Error("Must have at least two features");
|
|
1752
|
-
const e = i.features[0].properties || {}, n =
|
|
1753
|
-
return n.length === 0 ? null : n.length === 1 ? pt(n[0], e) :
|
|
1752
|
+
const e = i.features[0].properties || {}, n = Qt.difference(t[0], ...t.slice(1));
|
|
1753
|
+
return n.length === 0 ? null : n.length === 1 ? pt(n[0], e) : jt(n, e);
|
|
1754
1754
|
}
|
|
1755
|
-
var
|
|
1756
|
-
function
|
|
1755
|
+
var Ke = Je;
|
|
1756
|
+
function He(i) {
|
|
1757
1757
|
if (!i)
|
|
1758
1758
|
throw new Error("geojson is required");
|
|
1759
1759
|
var t = [];
|
|
1760
|
-
return
|
|
1760
|
+
return Re(i, function(e) {
|
|
1761
1761
|
t.push(e);
|
|
1762
|
-
}),
|
|
1762
|
+
}), V(t);
|
|
1763
1763
|
}
|
|
1764
|
-
var
|
|
1764
|
+
var tn = He;
|
|
1765
1765
|
function Bt(i) {
|
|
1766
1766
|
const t = [...i];
|
|
1767
1767
|
return t[2] < t[0] && (Math.abs((t[0] + t[2] + 360) / 2) > Math.abs((t[0] - 360 + t[2]) / 2) ? t[0] -= 360 : t[2] += 360), t;
|
|
1768
1768
|
}
|
|
1769
1769
|
function zt(i, t) {
|
|
1770
|
-
const e =
|
|
1771
|
-
|
|
1770
|
+
const e = Ke(
|
|
1771
|
+
V([
|
|
1772
1772
|
pt([
|
|
1773
1773
|
[
|
|
1774
1774
|
[180, 90],
|
|
@@ -1784,28 +1784,27 @@ function zt(i, t) {
|
|
|
1784
1784
|
if (!e)
|
|
1785
1785
|
return;
|
|
1786
1786
|
e.properties = { isMask: !0 };
|
|
1787
|
-
const n = Bt(Nt(i)), r = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180,
|
|
1788
|
-
if (s.features.length > 1 && (o ||
|
|
1787
|
+
const n = Bt(Nt(i)), r = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, f = n[2] > 180, s = tn(i);
|
|
1788
|
+
if (s.features.length > 1 && (o || f))
|
|
1789
1789
|
for (const c of s.features) {
|
|
1790
|
-
const
|
|
1791
|
-
if (
|
|
1790
|
+
const u = Bt(Nt(c));
|
|
1791
|
+
if (f && u[0] < -180 + r)
|
|
1792
1792
|
for (const g of c.geometry.coordinates)
|
|
1793
1793
|
for (const l of g)
|
|
1794
1794
|
l[0] += 360 - r;
|
|
1795
|
-
if (o &&
|
|
1795
|
+
if (o && u[2] > 180 - r)
|
|
1796
1796
|
for (const g of c.geometry.coordinates)
|
|
1797
1797
|
for (const l of g)
|
|
1798
1798
|
l[0] -= 360 - r;
|
|
1799
1799
|
}
|
|
1800
1800
|
t(
|
|
1801
|
-
|
|
1802
|
-
s.features.length < 2 ? i :
|
|
1801
|
+
V([
|
|
1802
|
+
s.features.length < 2 ? i : Yt(s) ?? i,
|
|
1803
1803
|
e
|
|
1804
1804
|
])
|
|
1805
1805
|
);
|
|
1806
1806
|
}
|
|
1807
|
-
const Tt =
|
|
1808
|
-
function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
|
|
1807
|
+
const Tt = V([]), Gt = {
|
|
1809
1808
|
fill: {
|
|
1810
1809
|
paint: {
|
|
1811
1810
|
"fill-color": "#000",
|
|
@@ -1824,21 +1823,23 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
|
|
|
1824
1823
|
},
|
|
1825
1824
|
filter: ["!", ["has", "isMask"]]
|
|
1826
1825
|
}
|
|
1827
|
-
}
|
|
1826
|
+
};
|
|
1827
|
+
function nn(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt) {
|
|
1828
1828
|
let s;
|
|
1829
1829
|
const c = [];
|
|
1830
|
-
let
|
|
1830
|
+
let u, g, l;
|
|
1831
1831
|
function h() {
|
|
1832
|
-
|
|
1832
|
+
const p = f ? f === !0 ? Gt : f : void 0;
|
|
1833
|
+
!i.getSource("full-geom") && (p != null && p.fill || p != null && p.line) && i.addSource("full-geom", {
|
|
1833
1834
|
type: "geojson",
|
|
1834
1835
|
data: Tt
|
|
1835
|
-
}), !i.getLayer("full-geom-fill") && (
|
|
1836
|
-
...
|
|
1836
|
+
}), !i.getLayer("full-geom-fill") && (p != null && p.fill) && i.addLayer({
|
|
1837
|
+
...p == null ? void 0 : p.fill,
|
|
1837
1838
|
id: "full-geom-fill",
|
|
1838
1839
|
type: "fill",
|
|
1839
1840
|
source: "full-geom"
|
|
1840
|
-
}), !i.getLayer("full-geom-line") && (
|
|
1841
|
-
...
|
|
1841
|
+
}), !i.getLayer("full-geom-line") && (p != null && p.line) && i.addLayer({
|
|
1842
|
+
...p == null ? void 0 : p.line,
|
|
1842
1843
|
id: "full-geom-line",
|
|
1843
1844
|
type: "line",
|
|
1844
1845
|
source: "full-geom"
|
|
@@ -1849,98 +1850,105 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
|
|
|
1849
1850
|
}), i.on("styledata", () => {
|
|
1850
1851
|
h();
|
|
1851
1852
|
});
|
|
1852
|
-
const a = (
|
|
1853
|
+
const a = (p) => {
|
|
1853
1854
|
s == null || s({
|
|
1854
1855
|
type: "mapClick",
|
|
1855
|
-
coordinates: [
|
|
1856
|
+
coordinates: [p.lngLat.lng, p.lngLat.lat]
|
|
1856
1857
|
});
|
|
1857
1858
|
};
|
|
1858
|
-
function d(
|
|
1859
|
+
function d(p = !1) {
|
|
1859
1860
|
if (!t)
|
|
1860
1861
|
throw new Error();
|
|
1861
|
-
const
|
|
1862
|
-
return
|
|
1862
|
+
const y = document.createElement("div");
|
|
1863
|
+
return p && y.classList.add("marker-interactive"), new Ze({
|
|
1863
1864
|
props: { displayIn: "maplibre" },
|
|
1864
|
-
target:
|
|
1865
|
-
}), new t.Marker({ element:
|
|
1865
|
+
target: y
|
|
1866
|
+
}), new t.Marker({ element: y, offset: [1, -13] });
|
|
1866
1867
|
}
|
|
1867
|
-
function x(
|
|
1868
|
-
var
|
|
1869
|
-
l =
|
|
1868
|
+
function x(p) {
|
|
1869
|
+
var y;
|
|
1870
|
+
l = p, p && ((y = i.getSource("full-geom")) == null || y.setData(p));
|
|
1870
1871
|
}
|
|
1871
1872
|
return {
|
|
1872
|
-
setEventHandler(
|
|
1873
|
-
|
|
1873
|
+
setEventHandler(p) {
|
|
1874
|
+
p ? (s = p, i.on("click", a)) : (s = void 0, i.off("click", a));
|
|
1874
1875
|
},
|
|
1875
|
-
flyTo(
|
|
1876
|
-
i.flyTo({ center:
|
|
1876
|
+
flyTo(p, y) {
|
|
1877
|
+
i.flyTo({ center: p, ...y ? { zoom: y } : {}, ...r });
|
|
1877
1878
|
},
|
|
1878
|
-
fitBounds(
|
|
1879
|
+
fitBounds(p, y, v) {
|
|
1879
1880
|
i.fitBounds(
|
|
1880
1881
|
[
|
|
1881
|
-
[
|
|
1882
|
-
[
|
|
1882
|
+
[p[0], p[1]],
|
|
1883
|
+
[p[2], p[3]]
|
|
1883
1884
|
],
|
|
1884
|
-
{ padding:
|
|
1885
|
+
{ padding: y, ...v ? { maxZoom: v } : {}, ...o }
|
|
1885
1886
|
);
|
|
1886
1887
|
},
|
|
1887
|
-
indicateReverse(
|
|
1888
|
-
i.getCanvasContainer().style.cursor =
|
|
1888
|
+
indicateReverse(p) {
|
|
1889
|
+
i.getCanvasContainer().style.cursor = p ? "crosshair" : "";
|
|
1889
1890
|
},
|
|
1890
|
-
setReverseMarker(
|
|
1891
|
-
!t || !e || (g ?
|
|
1891
|
+
setReverseMarker(p) {
|
|
1892
|
+
!t || !e || (g ? p ? g.setLngLat(p) : (g.remove(), g = void 0) : p && (e instanceof Function ? g = e(i) ?? void 0 : (g = (typeof e == "object" ? new t.Marker(e) : d()).setLngLat(p).addTo(i), g.getElement().classList.add("marker-reverse"))));
|
|
1892
1893
|
},
|
|
1893
|
-
setMarkers(
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
if (
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1894
|
+
setMarkers(p, y) {
|
|
1895
|
+
for (const v of c)
|
|
1896
|
+
v.remove();
|
|
1897
|
+
if (c.length = 0, x(Tt), !!t) {
|
|
1898
|
+
if (y) {
|
|
1899
|
+
let v = !1;
|
|
1900
|
+
if (y.geometry.type === "GeometryCollection") {
|
|
1901
|
+
const m = y.geometry.geometries.filter(
|
|
1902
|
+
(E) => E.type === "Polygon" || E.type === "MultiPolygon"
|
|
1903
|
+
);
|
|
1904
|
+
t: if (m.length > 0) {
|
|
1905
|
+
const E = Yt(
|
|
1906
|
+
V(m.map((w) => X(w)))
|
|
1903
1907
|
);
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
w.length > 0 && (x({
|
|
1922
|
-
...p,
|
|
1923
|
-
geometry: { type: "GeometryCollection", geometries: w }
|
|
1924
|
-
}), v = !0);
|
|
1925
|
-
}
|
|
1908
|
+
if (!E)
|
|
1909
|
+
break t;
|
|
1910
|
+
zt(
|
|
1911
|
+
{
|
|
1912
|
+
...y,
|
|
1913
|
+
geometry: E.geometry
|
|
1914
|
+
},
|
|
1915
|
+
x
|
|
1916
|
+
), v = !0;
|
|
1917
|
+
} else {
|
|
1918
|
+
const E = y.geometry.geometries.filter(
|
|
1919
|
+
(w) => w.type === "LineString" || w.type === "MultiLineString"
|
|
1920
|
+
);
|
|
1921
|
+
E.length > 0 && (x({
|
|
1922
|
+
...y,
|
|
1923
|
+
geometry: { type: "GeometryCollection", geometries: E }
|
|
1924
|
+
}), v = !0);
|
|
1926
1925
|
}
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1926
|
+
}
|
|
1927
|
+
if (!v) {
|
|
1928
|
+
if (y.geometry.type === "Polygon" || y.geometry.type === "MultiPolygon")
|
|
1929
|
+
zt(y, x);
|
|
1930
|
+
else if (y.geometry.type === "LineString" || y.geometry.type === "MultiLineString") {
|
|
1931
|
+
x(y);
|
|
1932
|
+
return;
|
|
1934
1933
|
}
|
|
1935
|
-
e && c.push(
|
|
1936
|
-
(typeof e == "object" ? new t.Marker(e) : d()).setLngLat(p.center).addTo(i)
|
|
1937
|
-
);
|
|
1938
1934
|
}
|
|
1939
|
-
if (
|
|
1940
|
-
|
|
1941
|
-
|
|
1935
|
+
if (e instanceof Function) {
|
|
1936
|
+
const m = e(i, y);
|
|
1937
|
+
m && c.push(m);
|
|
1938
|
+
} else e && c.push(
|
|
1939
|
+
typeof e == "object" ? new t.Marker(e) : d().setLngLat(y.center).addTo(i)
|
|
1940
|
+
);
|
|
1941
|
+
}
|
|
1942
|
+
if (n)
|
|
1943
|
+
for (const v of p ?? []) {
|
|
1944
|
+
if (v === y)
|
|
1945
|
+
continue;
|
|
1946
|
+
let m;
|
|
1947
|
+
if (n instanceof Function) {
|
|
1948
|
+
if (m = n(i, v), !m)
|
|
1942
1949
|
continue;
|
|
1943
|
-
|
|
1950
|
+
} else
|
|
1951
|
+
m = (typeof n == "object" ? new t.Marker(n) : d(!0)).setLngLat(v.center).setPopup(
|
|
1944
1952
|
new t.Popup({
|
|
1945
1953
|
offset: [1, -27],
|
|
1946
1954
|
closeButton: !1,
|
|
@@ -1949,28 +1957,28 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
|
|
|
1949
1957
|
}).setText(
|
|
1950
1958
|
v.place_type[0] === "reverse" ? v.place_name : v.place_name.replace(/,.*/, "")
|
|
1951
1959
|
)
|
|
1952
|
-
).addTo(i)
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
}),
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1960
|
+
).addTo(i);
|
|
1961
|
+
const E = m.getElement();
|
|
1962
|
+
E.addEventListener("click", (w) => {
|
|
1963
|
+
w.stopPropagation(), s == null || s({ type: "markerClick", id: v.id });
|
|
1964
|
+
}), E.addEventListener("mouseenter", () => {
|
|
1965
|
+
s == null || s({ type: "markerMouseEnter", id: v.id }), m.togglePopup();
|
|
1966
|
+
}), E.addEventListener("mouseleave", () => {
|
|
1967
|
+
s == null || s({ type: "markerMouseLeave", id: v.id }), m.togglePopup();
|
|
1968
|
+
}), c.push(m);
|
|
1969
|
+
}
|
|
1962
1970
|
}
|
|
1963
1971
|
},
|
|
1964
|
-
setSelectedMarker(
|
|
1965
|
-
|
|
1972
|
+
setSelectedMarker(p) {
|
|
1973
|
+
u && u.getElement().classList.toggle("marker-selected", !1), u = p > -1 ? c[p] : void 0, u == null || u.getElement().classList.toggle("marker-selected", !0);
|
|
1966
1974
|
},
|
|
1967
1975
|
getCenterAndZoom() {
|
|
1968
|
-
const
|
|
1969
|
-
return [i.getZoom(),
|
|
1976
|
+
const p = i.getCenter();
|
|
1977
|
+
return [i.getZoom(), p.lng, p.lat];
|
|
1970
1978
|
}
|
|
1971
1979
|
};
|
|
1972
1980
|
}
|
|
1973
1981
|
export {
|
|
1974
|
-
|
|
1982
|
+
nn as createMapLibreGlMapController
|
|
1975
1983
|
};
|
|
1976
1984
|
//# sourceMappingURL=maplibregl-controller.js.map
|