@maptiler/geocoding-control 2.0.0-rc.4 → 2.0.0-rc.6
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 +18 -1
- package/leaflet-controller.d.ts +2 -1
- package/leaflet-controller.js +222 -219
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +2 -2
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +1013 -1022
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +2 -1
- package/maplibregl-controller.js +213 -210
- 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 +17 -0
- package/maplibregl.js +1459 -1466
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +17 -0
- package/maptilersdk.js +1461 -1468
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.d.ts +2 -1
- package/openlayers-controller.js +298 -295
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +3 -3
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.js +1301 -1310
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +1 -1
- package/react.js +680 -695
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/svelte/GeocodingControl.svelte +22 -47
- package/svelte/GeocodingControl.svelte.d.ts +0 -1
- package/svelte/MapLibreBasedGeocodingControl.d.ts +18 -1
- package/svelte/MapLibreBasedGeocodingControl.js +5 -1
- package/svelte/leaflet-controller.d.ts +2 -1
- package/svelte/leaflet-controller.js +6 -2
- package/svelte/leaflet.js +5 -1
- package/svelte/maplibregl-controller.d.ts +2 -1
- package/svelte/maplibregl-controller.js +6 -2
- package/svelte/maplibregl.d.ts +17 -0
- package/svelte/maptilersdk.d.ts +17 -0
- package/svelte/openlayers-controller.d.ts +2 -1
- package/svelte/openlayers-controller.js +6 -2
- package/svelte/openlayers.js +6 -3
- package/svelte/types.d.ts +1 -1
- package/types.d.ts +1 -1
- package/vanilla.js +610 -625
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
package/leaflet-controller.js
CHANGED
|
@@ -35,14 +35,14 @@ function Ut(r, t, e = {}) {
|
|
|
35
35
|
}
|
|
36
36
|
function Yt(r, t, e) {
|
|
37
37
|
if (r !== null)
|
|
38
|
-
for (var n, i, o, f, s, c, u,
|
|
39
|
-
u =
|
|
40
|
-
for (var
|
|
41
|
-
var
|
|
42
|
-
if (f = h ? u.geometries[
|
|
38
|
+
for (var n, i, o, f, s, c, u, g = 0, l = 0, h, a = r.type, x = a === "FeatureCollection", p = a === "Feature", y = x ? r.features.length : 1, d = 0; d < y; d++) {
|
|
39
|
+
u = x ? r.features[d].geometry : p ? r.geometry : r, h = u ? u.type === "GeometryCollection" : !1, s = h ? u.geometries.length : 1;
|
|
40
|
+
for (var v = 0; v < s; v++) {
|
|
41
|
+
var w = 0, m = 0;
|
|
42
|
+
if (f = h ? u.geometries[v] : u, f !== null) {
|
|
43
43
|
c = f.coordinates;
|
|
44
44
|
var E = f.type;
|
|
45
|
-
switch (
|
|
45
|
+
switch (g = 0, E) {
|
|
46
46
|
case null:
|
|
47
47
|
break;
|
|
48
48
|
case "Point":
|
|
@@ -50,11 +50,11 @@ function Yt(r, t, e) {
|
|
|
50
50
|
c,
|
|
51
51
|
l,
|
|
52
52
|
d,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
w,
|
|
54
|
+
m
|
|
55
55
|
) === !1)
|
|
56
56
|
return !1;
|
|
57
|
-
l++,
|
|
57
|
+
l++, w++;
|
|
58
58
|
break;
|
|
59
59
|
case "LineString":
|
|
60
60
|
case "MultiPoint":
|
|
@@ -63,49 +63,49 @@ function Yt(r, t, e) {
|
|
|
63
63
|
c[n],
|
|
64
64
|
l,
|
|
65
65
|
d,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
w,
|
|
67
|
+
m
|
|
68
68
|
) === !1)
|
|
69
69
|
return !1;
|
|
70
|
-
l++, E === "MultiPoint" &&
|
|
70
|
+
l++, E === "MultiPoint" && w++;
|
|
71
71
|
}
|
|
72
|
-
E === "LineString" &&
|
|
72
|
+
E === "LineString" && w++;
|
|
73
73
|
break;
|
|
74
74
|
case "Polygon":
|
|
75
75
|
case "MultiLineString":
|
|
76
76
|
for (n = 0; n < c.length; n++) {
|
|
77
|
-
for (i = 0; i < c[n].length -
|
|
77
|
+
for (i = 0; i < c[n].length - g; i++) {
|
|
78
78
|
if (t(
|
|
79
79
|
c[n][i],
|
|
80
80
|
l,
|
|
81
81
|
d,
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
w,
|
|
83
|
+
m
|
|
84
84
|
) === !1)
|
|
85
85
|
return !1;
|
|
86
86
|
l++;
|
|
87
87
|
}
|
|
88
|
-
E === "MultiLineString" &&
|
|
88
|
+
E === "MultiLineString" && w++, E === "Polygon" && m++;
|
|
89
89
|
}
|
|
90
|
-
E === "Polygon" &&
|
|
90
|
+
E === "Polygon" && w++;
|
|
91
91
|
break;
|
|
92
92
|
case "MultiPolygon":
|
|
93
93
|
for (n = 0; n < c.length; n++) {
|
|
94
|
-
for (
|
|
95
|
-
for (o = 0; o < c[n][i].length -
|
|
94
|
+
for (m = 0, i = 0; i < c[n].length; i++) {
|
|
95
|
+
for (o = 0; o < c[n][i].length - g; o++) {
|
|
96
96
|
if (t(
|
|
97
97
|
c[n][i][o],
|
|
98
98
|
l,
|
|
99
99
|
d,
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
w,
|
|
101
|
+
m
|
|
102
102
|
) === !1)
|
|
103
103
|
return !1;
|
|
104
104
|
l++;
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
m++;
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
w++;
|
|
109
109
|
}
|
|
110
110
|
break;
|
|
111
111
|
case "GeometryCollection":
|
|
@@ -121,15 +121,15 @@ function Yt(r, t, e) {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
function vt(r, t) {
|
|
124
|
-
var e, n, i, o, f, s, c, u,
|
|
125
|
-
for (e = 0; e <
|
|
126
|
-
for (s = a ? r.features[e].geometry :
|
|
124
|
+
var e, n, i, o, f, s, c, u, g, l, h = 0, a = r.type === "FeatureCollection", x = r.type === "Feature", p = a ? r.features.length : 1;
|
|
125
|
+
for (e = 0; e < p; e++) {
|
|
126
|
+
for (s = a ? r.features[e].geometry : x ? r.geometry : r, u = a ? r.features[e].properties : x ? r.properties : {}, g = a ? r.features[e].bbox : x ? r.bbox : void 0, l = a ? r.features[e].id : x ? r.id : void 0, c = s ? s.type === "GeometryCollection" : !1, f = c ? s.geometries.length : 1, i = 0; i < f; i++) {
|
|
127
127
|
if (o = c ? s.geometries[i] : s, o === null) {
|
|
128
128
|
if (t(
|
|
129
129
|
null,
|
|
130
130
|
h,
|
|
131
131
|
u,
|
|
132
|
-
|
|
132
|
+
g,
|
|
133
133
|
l
|
|
134
134
|
) === !1)
|
|
135
135
|
return !1;
|
|
@@ -146,7 +146,7 @@ function vt(r, t) {
|
|
|
146
146
|
o,
|
|
147
147
|
h,
|
|
148
148
|
u,
|
|
149
|
-
|
|
149
|
+
g,
|
|
150
150
|
l
|
|
151
151
|
) === !1)
|
|
152
152
|
return !1;
|
|
@@ -158,7 +158,7 @@ function vt(r, t) {
|
|
|
158
158
|
o.geometries[n],
|
|
159
159
|
h,
|
|
160
160
|
u,
|
|
161
|
-
|
|
161
|
+
g,
|
|
162
162
|
l
|
|
163
163
|
) === !1)
|
|
164
164
|
return !1;
|
|
@@ -198,9 +198,9 @@ function se(r, t) {
|
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
200
|
for (var u = 0; u < e.coordinates.length; u++) {
|
|
201
|
-
var
|
|
201
|
+
var g = e.coordinates[u], l = {
|
|
202
202
|
type: c,
|
|
203
|
-
coordinates:
|
|
203
|
+
coordinates: g
|
|
204
204
|
};
|
|
205
205
|
if (t(V(l, i), n, u) === !1)
|
|
206
206
|
return !1;
|
|
@@ -308,8 +308,8 @@ function he(r, t) {
|
|
|
308
308
|
return this;
|
|
309
309
|
}), f;
|
|
310
310
|
function s(u) {
|
|
311
|
-
return function(
|
|
312
|
-
return c([u,
|
|
311
|
+
return function(g) {
|
|
312
|
+
return c([u, g]);
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
function c(u) {
|
|
@@ -350,8 +350,8 @@ function he(r, t) {
|
|
|
350
350
|
continue;
|
|
351
351
|
}
|
|
352
352
|
u = t.call(r, e);
|
|
353
|
-
} catch (
|
|
354
|
-
u = [6,
|
|
353
|
+
} catch (g) {
|
|
354
|
+
u = [6, g], i = 0;
|
|
355
355
|
} finally {
|
|
356
356
|
n = o = 0;
|
|
357
357
|
}
|
|
@@ -414,7 +414,7 @@ function bt(r, t, e) {
|
|
|
414
414
|
}
|
|
415
415
|
return { left: n, right: i };
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function ge(r, t, e) {
|
|
418
418
|
return t === null ? r : (r === null || (t = B(r.key, t, e), t.left = r), t);
|
|
419
419
|
}
|
|
420
420
|
function ft(r, t, e, n, i) {
|
|
@@ -564,7 +564,7 @@ var wt = (
|
|
|
564
564
|
if (n && at(t, e, 0, i - 1, o), this._root === null)
|
|
565
565
|
this._root = ct(t, e, 0, i), this._size = i;
|
|
566
566
|
else {
|
|
567
|
-
var f = de(this.toList(),
|
|
567
|
+
var f = de(this.toList(), pe(t, e), o);
|
|
568
568
|
i = this._size + i, this._root = ht({ head: f }, 0, i);
|
|
569
569
|
}
|
|
570
570
|
return this;
|
|
@@ -592,7 +592,7 @@ var wt = (
|
|
|
592
592
|
}, t), e.join("");
|
|
593
593
|
}, r.prototype.update = function(t, e, n) {
|
|
594
594
|
var i = this._comparator, o = bt(t, this._root, i), f = o.left, s = o.right;
|
|
595
|
-
i(t, e) < 0 ? s = ot(e, n, s, i) : f = ot(e, n, f, i), this._root =
|
|
595
|
+
i(t, e) < 0 ? s = ot(e, n, s, i) : f = ot(e, n, f, i), this._root = ge(f, s, i);
|
|
596
596
|
}, r.prototype.split = function(t) {
|
|
597
597
|
return bt(t, this._root, this._comparator);
|
|
598
598
|
}, r.prototype[Symbol.iterator] = function() {
|
|
@@ -629,7 +629,7 @@ function ct(r, t, e, n) {
|
|
|
629
629
|
}
|
|
630
630
|
return null;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function pe(r, t) {
|
|
633
633
|
for (var e = new F(null, null), n = e, i = 0; i < r.length; i++)
|
|
634
634
|
n = n.next = new F(r[i], t[i]);
|
|
635
635
|
return n.next = null, e.next;
|
|
@@ -671,16 +671,16 @@ function at(r, t, e, n, i) {
|
|
|
671
671
|
}
|
|
672
672
|
const O = 11102230246251565e-32, S = 134217729, xe = (3 + 8 * O) * O;
|
|
673
673
|
function st(r, t, e, n, i) {
|
|
674
|
-
let o, f, s, c, u = t[0],
|
|
675
|
-
|
|
674
|
+
let o, f, s, c, u = t[0], g = n[0], l = 0, h = 0;
|
|
675
|
+
g > u == g > -u ? (o = u, u = t[++l]) : (o = g, g = n[++h]);
|
|
676
676
|
let a = 0;
|
|
677
677
|
if (l < r && h < e)
|
|
678
|
-
for (
|
|
679
|
-
|
|
678
|
+
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 && (i[a++] = s); l < r && h < e; )
|
|
679
|
+
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 && (i[a++] = s);
|
|
680
680
|
for (; l < r; )
|
|
681
681
|
f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l], o = f, s !== 0 && (i[a++] = s);
|
|
682
682
|
for (; h < e; )
|
|
683
|
-
f = o +
|
|
683
|
+
f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h], o = f, s !== 0 && (i[a++] = s);
|
|
684
684
|
return (o !== 0 || a === 0) && (i[a++] = o), a;
|
|
685
685
|
}
|
|
686
686
|
function ve(r, t) {
|
|
@@ -693,16 +693,16 @@ function K(r) {
|
|
|
693
693
|
}
|
|
694
694
|
const me = (3 + 16 * O) * O, we = (2 + 12 * O) * O, Ee = (9 + 64 * O) * O * O, q = K(4), _t = K(8), St = K(12), Pt = K(16), P = K(4);
|
|
695
695
|
function be(r, t, e, n, i, o, f) {
|
|
696
|
-
let s, c, u,
|
|
697
|
-
const C = r - i, R = e - i, I = t - o,
|
|
698
|
-
|
|
696
|
+
let s, c, u, g, l, h, a, x, p, y, d, v, w, m, E, b, M, _;
|
|
697
|
+
const C = r - i, R = e - i, I = t - o, k = n - o;
|
|
698
|
+
m = C * k, h = S * C, a = h - (h - C), x = C - a, h = S * k, p = h - (h - k), y = k - p, E = x * y - (m - a * p - x * p - a * y), b = I * R, h = S * I, a = h - (h - I), x = I - a, h = S * R, p = h - (h - R), y = R - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, q[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, q[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, q[2] = v - (_ - l) + (d - l), q[3] = _;
|
|
699
699
|
let A = ve(4, q), D = we * f;
|
|
700
|
-
if (A >= D || -A >= D || (l = r - C, s = r - (C + l) + (l - i), l = e - R, u = e - (R + l) + (l - i), l = t - I, c = t - (I + l) + (l - o), l = n -
|
|
701
|
-
|
|
700
|
+
if (A >= D || -A >= D || (l = r - C, s = r - (C + l) + (l - i), l = e - R, u = e - (R + l) + (l - i), l = t - I, c = t - (I + l) + (l - o), l = n - k, g = n - (k + l) + (l - o), s === 0 && c === 0 && u === 0 && g === 0) || (D = Ee * f + xe * Math.abs(A), A += C * g + k * s - (I * u + R * c), A >= D || -A >= D)) return A;
|
|
701
|
+
m = s * k, h = S * s, a = h - (h - s), x = s - a, h = S * k, p = h - (h - k), y = k - p, E = x * y - (m - a * p - x * p - a * y), b = c * R, h = S * c, a = h - (h - c), x = c - a, h = S * R, p = h - (h - R), y = R - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, P[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, P[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, P[2] = v - (_ - l) + (d - l), P[3] = _;
|
|
702
702
|
const ee = st(4, q, 4, P, _t);
|
|
703
|
-
|
|
703
|
+
m = C * g, h = S * C, a = h - (h - C), x = C - a, h = S * g, p = h - (h - g), y = g - p, E = x * y - (m - a * p - x * p - a * y), b = I * u, h = S * I, a = h - (h - I), x = I - a, h = S * u, p = h - (h - u), y = u - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, P[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, P[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, P[2] = v - (_ - l) + (d - l), P[3] = _;
|
|
704
704
|
const ne = st(ee, _t, 4, P, St);
|
|
705
|
-
|
|
705
|
+
m = s * g, h = S * s, a = h - (h - s), x = s - a, h = S * g, p = h - (h - g), y = g - p, E = x * y - (m - a * p - x * p - a * y), b = c * u, h = S * c, a = h - (h - c), x = c - a, h = S * u, p = h - (h - u), y = u - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, P[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, P[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, P[2] = v - (_ - l) + (d - l), P[3] = _;
|
|
706
706
|
const re = st(ne, St, 4, P, Pt);
|
|
707
707
|
return Pt[re - 1];
|
|
708
708
|
}
|
|
@@ -710,7 +710,7 @@ function _e(r, t, e, n, i, o) {
|
|
|
710
710
|
const f = (t - o) * (e - i), s = (r - i) * (n - o), c = f - s, u = Math.abs(f + s);
|
|
711
711
|
return Math.abs(c) >= me * u ? c : -be(r, t, e, n, i, o, u);
|
|
712
712
|
}
|
|
713
|
-
const j = (r, t) => r.ll.x <= t.x && t.x <= r.ur.x && r.ll.y <= t.y && t.y <= r.ur.y,
|
|
713
|
+
const j = (r, t) => r.ll.x <= t.x && t.x <= r.ur.x && r.ll.y <= t.y && t.y <= r.ur.y, gt = (r, t) => {
|
|
714
714
|
if (t.ur.x < r.ll.x || r.ur.x < t.ll.x || t.ur.y < r.ll.y || r.ur.y < t.ll.y) return null;
|
|
715
715
|
const e = r.ll.x < t.ll.x ? t.ll.x : r.ll.x, n = r.ur.x < t.ur.x ? r.ur.x : t.ur.x, i = r.ll.y < t.ll.y ? t.ll.y : r.ll.y, o = r.ur.y < t.ur.y ? r.ur.y : t.ur.y;
|
|
716
716
|
return {
|
|
@@ -802,7 +802,7 @@ const J = new Pe(), tt = (r, t) => r.x * t.y - r.y * t.x, Vt = (r, t) => r.x * t
|
|
|
802
802
|
const o = {
|
|
803
803
|
x: e.x - r.x,
|
|
804
804
|
y: e.y - r.y
|
|
805
|
-
}, f = tt(o, t) / i, s = tt(o, n) / i, c = r.x + s * t.x, u = e.x + f * n.x,
|
|
805
|
+
}, f = tt(o, t) / i, s = tt(o, n) / i, c = r.x + s * t.x, u = e.x + f * n.x, g = r.y + s * t.y, l = e.y + f * n.y, h = (c + u) / 2, a = (g + l) / 2;
|
|
806
806
|
return {
|
|
807
807
|
x: h,
|
|
808
808
|
y: a
|
|
@@ -903,7 +903,7 @@ class z {
|
|
|
903
903
|
const n = t.leftSE.point.x, i = e.leftSE.point.x, o = t.rightSE.point.x, f = e.rightSE.point.x;
|
|
904
904
|
if (f < n) return 1;
|
|
905
905
|
if (o < i) return -1;
|
|
906
|
-
const s = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y,
|
|
906
|
+
const s = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y, g = e.rightSE.point.y;
|
|
907
907
|
if (n < i) {
|
|
908
908
|
if (c < s && c < u) return 1;
|
|
909
909
|
if (c > s && c > u) return -1;
|
|
@@ -914,8 +914,8 @@ class z {
|
|
|
914
914
|
return h !== 0 ? h : -1;
|
|
915
915
|
}
|
|
916
916
|
if (n > i) {
|
|
917
|
-
if (s < c && s <
|
|
918
|
-
if (s > c && s >
|
|
917
|
+
if (s < c && s < g) return -1;
|
|
918
|
+
if (s > c && s > g) return 1;
|
|
919
919
|
const l = e.comparePoint(t.leftSE.point);
|
|
920
920
|
if (l !== 0) return l;
|
|
921
921
|
const h = t.comparePoint(e.rightSE.point);
|
|
@@ -933,11 +933,11 @@ class z {
|
|
|
933
933
|
if (l > 0) return -1;
|
|
934
934
|
}
|
|
935
935
|
if (o !== f) {
|
|
936
|
-
const l = u - s, h = o - n, a =
|
|
937
|
-
if (l > h && a <
|
|
938
|
-
if (l < h && a >
|
|
936
|
+
const l = u - s, h = o - n, a = g - c, x = f - i;
|
|
937
|
+
if (l > h && a < x) return 1;
|
|
938
|
+
if (l < h && a > x) return -1;
|
|
939
939
|
}
|
|
940
|
-
return o > f ? 1 : o < f || u <
|
|
940
|
+
return o > f ? 1 : o < f || u < g ? -1 : u > g ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
|
|
941
941
|
}
|
|
942
942
|
/* Warning: a reference to ringWindings input will be stored,
|
|
943
943
|
* and possibly will be later modified */
|
|
@@ -1021,12 +1021,12 @@ class z {
|
|
|
1021
1021
|
* Else, return null.
|
|
1022
1022
|
*/
|
|
1023
1023
|
getIntersection(t) {
|
|
1024
|
-
const e = this.bbox(), n = t.bbox(), i =
|
|
1024
|
+
const e = this.bbox(), n = t.bbox(), i = gt(e, n);
|
|
1025
1025
|
if (i === null) return null;
|
|
1026
|
-
const o = this.leftSE.point, f = this.rightSE.point, s = t.leftSE.point, c = t.rightSE.point, u = j(e, s) && this.comparePoint(s) === 0,
|
|
1027
|
-
if (
|
|
1026
|
+
const o = this.leftSE.point, f = this.rightSE.point, s = t.leftSE.point, c = t.rightSE.point, u = j(e, s) && this.comparePoint(s) === 0, g = j(n, o) && t.comparePoint(o) === 0, l = j(e, c) && this.comparePoint(c) === 0, h = j(n, f) && t.comparePoint(f) === 0;
|
|
1027
|
+
if (g && u)
|
|
1028
1028
|
return h && !l ? f : !h && l ? c : null;
|
|
1029
|
-
if (
|
|
1029
|
+
if (g)
|
|
1030
1030
|
return l && o.x === c.x && o.y === c.y ? null : o;
|
|
1031
1031
|
if (u)
|
|
1032
1032
|
return h && f.x === s.x && f.y === s.y ? null : s;
|
|
@@ -1111,17 +1111,17 @@ class z {
|
|
|
1111
1111
|
};
|
|
1112
1112
|
const e = this._afterState.rings, n = this._afterState.windings, i = this._afterState.multiPolys;
|
|
1113
1113
|
for (let s = 0, c = this.rings.length; s < c; s++) {
|
|
1114
|
-
const u = this.rings[s],
|
|
1115
|
-
l === -1 ? (e.push(u), n.push(
|
|
1114
|
+
const u = this.rings[s], g = this.windings[s], l = e.indexOf(u);
|
|
1115
|
+
l === -1 ? (e.push(u), n.push(g)) : n[l] += g;
|
|
1116
1116
|
}
|
|
1117
1117
|
const o = [], f = [];
|
|
1118
1118
|
for (let s = 0, c = e.length; s < c; s++) {
|
|
1119
1119
|
if (n[s] === 0) continue;
|
|
1120
|
-
const u = e[s],
|
|
1121
|
-
if (f.indexOf(
|
|
1122
|
-
if (u.isExterior) o.push(
|
|
1120
|
+
const u = e[s], g = u.poly;
|
|
1121
|
+
if (f.indexOf(g) === -1)
|
|
1122
|
+
if (u.isExterior) o.push(g);
|
|
1123
1123
|
else {
|
|
1124
|
-
f.indexOf(
|
|
1124
|
+
f.indexOf(g) === -1 && f.push(g);
|
|
1125
1125
|
const l = o.indexOf(u.poly);
|
|
1126
1126
|
l !== -1 && o.splice(l, 1);
|
|
1127
1127
|
}
|
|
@@ -1137,7 +1137,7 @@ class z {
|
|
|
1137
1137
|
if (this.consumedBy) return !1;
|
|
1138
1138
|
if (this._isInResult !== void 0) return this._isInResult;
|
|
1139
1139
|
const t = this.beforeState().multiPolys, e = this.afterState().multiPolys;
|
|
1140
|
-
switch (
|
|
1140
|
+
switch ($.type) {
|
|
1141
1141
|
case "union": {
|
|
1142
1142
|
const n = t.length === 0, i = e.length === 0;
|
|
1143
1143
|
this._isInResult = n !== i;
|
|
@@ -1145,7 +1145,7 @@ class z {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
case "intersection": {
|
|
1147
1147
|
let n, i;
|
|
1148
|
-
t.length < e.length ? (n = t.length, i = e.length) : (n = e.length, i = t.length), this._isInResult = i ===
|
|
1148
|
+
t.length < e.length ? (n = t.length, i = e.length) : (n = e.length, i = t.length), this._isInResult = i === $.numMultiPolys && n < i;
|
|
1149
1149
|
break;
|
|
1150
1150
|
}
|
|
1151
1151
|
case "xor": {
|
|
@@ -1159,12 +1159,12 @@ class z {
|
|
|
1159
1159
|
break;
|
|
1160
1160
|
}
|
|
1161
1161
|
default:
|
|
1162
|
-
throw new Error(`Unrecognized operation type found ${
|
|
1162
|
+
throw new Error(`Unrecognized operation type found ${$.type}`);
|
|
1163
1163
|
}
|
|
1164
1164
|
return this._isInResult;
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
|
-
class
|
|
1167
|
+
class kt {
|
|
1168
1168
|
constructor(t, e, n) {
|
|
1169
1169
|
if (!Array.isArray(t) || t.length === 0)
|
|
1170
1170
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
@@ -1203,7 +1203,7 @@ class Ie {
|
|
|
1203
1203
|
constructor(t, e) {
|
|
1204
1204
|
if (!Array.isArray(t))
|
|
1205
1205
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
1206
|
-
this.exteriorRing = new
|
|
1206
|
+
this.exteriorRing = new kt(t[0], this, !0), this.bbox = {
|
|
1207
1207
|
ll: {
|
|
1208
1208
|
x: this.exteriorRing.bbox.ll.x,
|
|
1209
1209
|
y: this.exteriorRing.bbox.ll.y
|
|
@@ -1214,7 +1214,7 @@ class Ie {
|
|
|
1214
1214
|
}
|
|
1215
1215
|
}, this.interiorRings = [];
|
|
1216
1216
|
for (let n = 1, i = t.length; n < i; n++) {
|
|
1217
|
-
const o = new
|
|
1217
|
+
const o = new kt(t[n], this, !1);
|
|
1218
1218
|
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.interiorRings.push(o);
|
|
1219
1219
|
}
|
|
1220
1220
|
this.multiPoly = e;
|
|
@@ -1229,7 +1229,7 @@ class Ie {
|
|
|
1229
1229
|
return t;
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
|
-
class
|
|
1232
|
+
class $t {
|
|
1233
1233
|
constructor(t, e) {
|
|
1234
1234
|
if (!Array.isArray(t))
|
|
1235
1235
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
@@ -1272,35 +1272,35 @@ class nt {
|
|
|
1272
1272
|
const o = t[n];
|
|
1273
1273
|
if (!o.isInResult() || o.ringOut) continue;
|
|
1274
1274
|
let f = null, s = o.leftSE, c = o.rightSE;
|
|
1275
|
-
const u = [s],
|
|
1276
|
-
for (; f = s, s = c, u.push(s), s.point !==
|
|
1275
|
+
const u = [s], g = s.point, l = [];
|
|
1276
|
+
for (; f = s, s = c, u.push(s), s.point !== g; )
|
|
1277
1277
|
for (; ; ) {
|
|
1278
1278
|
const h = s.getAvailableLinkedEvents();
|
|
1279
1279
|
if (h.length === 0) {
|
|
1280
|
-
const
|
|
1281
|
-
throw new Error(`Unable to complete output ring starting at [${
|
|
1280
|
+
const p = u[0].point, y = u[u.length - 1].point;
|
|
1281
|
+
throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${y.x}, ${y.y}].`);
|
|
1282
1282
|
}
|
|
1283
1283
|
if (h.length === 1) {
|
|
1284
1284
|
c = h[0].otherSE;
|
|
1285
1285
|
break;
|
|
1286
1286
|
}
|
|
1287
1287
|
let a = null;
|
|
1288
|
-
for (let
|
|
1289
|
-
if (l[
|
|
1290
|
-
a =
|
|
1288
|
+
for (let p = 0, y = l.length; p < y; p++)
|
|
1289
|
+
if (l[p].point === s.point) {
|
|
1290
|
+
a = p;
|
|
1291
1291
|
break;
|
|
1292
1292
|
}
|
|
1293
1293
|
if (a !== null) {
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1294
|
+
const p = l.splice(a)[0], y = u.splice(p.index);
|
|
1295
|
+
y.unshift(y[0].otherSE), e.push(new nt(y.reverse()));
|
|
1296
1296
|
continue;
|
|
1297
1297
|
}
|
|
1298
1298
|
l.push({
|
|
1299
1299
|
index: u.length,
|
|
1300
1300
|
point: s.point
|
|
1301
1301
|
});
|
|
1302
|
-
const
|
|
1303
|
-
c = h.sort(
|
|
1302
|
+
const x = s.getLeftmostComparator(f);
|
|
1303
|
+
c = h.sort(x)[0].otherSE;
|
|
1304
1304
|
break;
|
|
1305
1305
|
}
|
|
1306
1306
|
e.push(new nt(u));
|
|
@@ -1316,7 +1316,7 @@ class nt {
|
|
|
1316
1316
|
getGeom() {
|
|
1317
1317
|
let t = this.events[0].point;
|
|
1318
1318
|
const e = [t];
|
|
1319
|
-
for (let u = 1,
|
|
1319
|
+
for (let u = 1, g = this.events.length - 1; u < g; u++) {
|
|
1320
1320
|
const l = this.events[u].point, h = this.events[u + 1].point;
|
|
1321
1321
|
Ct(l, t, h) !== 0 && (e.push(l), t = l);
|
|
1322
1322
|
}
|
|
@@ -1371,7 +1371,7 @@ class At {
|
|
|
1371
1371
|
return t;
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
class
|
|
1374
|
+
class ke {
|
|
1375
1375
|
constructor(t) {
|
|
1376
1376
|
this.rings = t, this.polys = this._composePolys(t);
|
|
1377
1377
|
}
|
|
@@ -1397,7 +1397,7 @@ class $e {
|
|
|
1397
1397
|
return e;
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
|
-
class
|
|
1400
|
+
class $e {
|
|
1401
1401
|
constructor(t) {
|
|
1402
1402
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : z.compare;
|
|
1403
1403
|
this.queue = t, this.tree = new wt(e), this.segments = [];
|
|
@@ -1419,24 +1419,24 @@ class ke {
|
|
|
1419
1419
|
const l = s.getIntersection(e);
|
|
1420
1420
|
if (l !== null && (e.isAnEndpoint(l) || (u = l), !s.isAnEndpoint(l))) {
|
|
1421
1421
|
const h = this._splitSafely(s, l);
|
|
1422
|
-
for (let a = 0,
|
|
1422
|
+
for (let a = 0, x = h.length; a < x; a++)
|
|
1423
1423
|
n.push(h[a]);
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
let
|
|
1426
|
+
let g = null;
|
|
1427
1427
|
if (c) {
|
|
1428
1428
|
const l = c.getIntersection(e);
|
|
1429
|
-
if (l !== null && (e.isAnEndpoint(l) || (
|
|
1429
|
+
if (l !== null && (e.isAnEndpoint(l) || (g = l), !c.isAnEndpoint(l))) {
|
|
1430
1430
|
const h = this._splitSafely(c, l);
|
|
1431
|
-
for (let a = 0,
|
|
1431
|
+
for (let a = 0, x = h.length; a < x; a++)
|
|
1432
1432
|
n.push(h[a]);
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
|
-
if (u !== null ||
|
|
1435
|
+
if (u !== null || g !== null) {
|
|
1436
1436
|
let l = null;
|
|
1437
|
-
u === null ? l =
|
|
1437
|
+
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);
|
|
1438
1438
|
const h = e.split(l);
|
|
1439
|
-
for (let a = 0,
|
|
1439
|
+
for (let a = 0, x = h.length; a < x; a++)
|
|
1440
1440
|
n.push(h[a]);
|
|
1441
1441
|
}
|
|
1442
1442
|
n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = s);
|
|
@@ -1445,14 +1445,14 @@ class ke {
|
|
|
1445
1445
|
const u = s.getIntersection(c);
|
|
1446
1446
|
if (u !== null) {
|
|
1447
1447
|
if (!s.isAnEndpoint(u)) {
|
|
1448
|
-
const
|
|
1449
|
-
for (let l = 0, h =
|
|
1450
|
-
n.push(
|
|
1448
|
+
const g = this._splitSafely(s, u);
|
|
1449
|
+
for (let l = 0, h = g.length; l < h; l++)
|
|
1450
|
+
n.push(g[l]);
|
|
1451
1451
|
}
|
|
1452
1452
|
if (!c.isAnEndpoint(u)) {
|
|
1453
|
-
const
|
|
1454
|
-
for (let l = 0, h =
|
|
1455
|
-
n.push(
|
|
1453
|
+
const g = this._splitSafely(c, u);
|
|
1454
|
+
for (let l = 0, h = g.length; l < h; l++)
|
|
1455
|
+
n.push(g[l]);
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
@@ -1473,30 +1473,30 @@ class ke {
|
|
|
1473
1473
|
const Ot = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, Ae = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
|
|
1474
1474
|
class Oe {
|
|
1475
1475
|
run(t, e, n) {
|
|
1476
|
-
|
|
1477
|
-
const i = [new
|
|
1476
|
+
$.type = t, J.reset();
|
|
1477
|
+
const i = [new $t(e, !0)];
|
|
1478
1478
|
for (let l = 0, h = n.length; l < h; l++)
|
|
1479
|
-
i.push(new
|
|
1480
|
-
if (
|
|
1479
|
+
i.push(new $t(n[l], !1));
|
|
1480
|
+
if ($.numMultiPolys = i.length, $.type === "difference") {
|
|
1481
1481
|
const l = i[0];
|
|
1482
1482
|
let h = 1;
|
|
1483
1483
|
for (; h < i.length; )
|
|
1484
|
-
|
|
1484
|
+
gt(i[h].bbox, l.bbox) !== null ? h++ : i.splice(h, 1);
|
|
1485
1485
|
}
|
|
1486
|
-
if (
|
|
1486
|
+
if ($.type === "intersection")
|
|
1487
1487
|
for (let l = 0, h = i.length; l < h; l++) {
|
|
1488
1488
|
const a = i[l];
|
|
1489
|
-
for (let
|
|
1490
|
-
if (
|
|
1489
|
+
for (let x = l + 1, p = i.length; x < p; x++)
|
|
1490
|
+
if (gt(a.bbox, i[x].bbox) === null) return [];
|
|
1491
1491
|
}
|
|
1492
1492
|
const o = new wt(L.compare);
|
|
1493
1493
|
for (let l = 0, h = i.length; l < h; l++) {
|
|
1494
1494
|
const a = i[l].getSweepEvents();
|
|
1495
|
-
for (let
|
|
1496
|
-
if (o.insert(a[
|
|
1495
|
+
for (let x = 0, p = a.length; x < p; x++)
|
|
1496
|
+
if (o.insert(a[x]), o.size > Ot)
|
|
1497
1497
|
throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
|
|
1498
1498
|
}
|
|
1499
|
-
const f = new
|
|
1499
|
+
const f = new $e(o);
|
|
1500
1500
|
let s = o.size, c = o.pop();
|
|
1501
1501
|
for (; c; ) {
|
|
1502
1502
|
const l = c.key;
|
|
@@ -1509,33 +1509,33 @@ class Oe {
|
|
|
1509
1509
|
if (f.segments.length > Ae)
|
|
1510
1510
|
throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
|
|
1511
1511
|
const h = f.process(l);
|
|
1512
|
-
for (let a = 0,
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1512
|
+
for (let a = 0, x = h.length; a < x; a++) {
|
|
1513
|
+
const p = h[a];
|
|
1514
|
+
p.consumedBy === void 0 && o.insert(p);
|
|
1515
1515
|
}
|
|
1516
1516
|
s = o.size, c = o.pop();
|
|
1517
1517
|
}
|
|
1518
1518
|
J.reset();
|
|
1519
1519
|
const u = nt.factory(f.segments);
|
|
1520
|
-
return new
|
|
1520
|
+
return new ke(u).getGeom();
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
|
-
const
|
|
1523
|
+
const $ = new Oe(), Ne = function(r) {
|
|
1524
1524
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1525
1525
|
e[n - 1] = arguments[n];
|
|
1526
|
-
return
|
|
1526
|
+
return $.run("union", r, e);
|
|
1527
1527
|
}, Be = function(r) {
|
|
1528
1528
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1529
1529
|
e[n - 1] = arguments[n];
|
|
1530
|
-
return
|
|
1530
|
+
return $.run("intersection", r, e);
|
|
1531
1531
|
}, Ge = function(r) {
|
|
1532
1532
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1533
1533
|
e[n - 1] = arguments[n];
|
|
1534
|
-
return
|
|
1534
|
+
return $.run("xor", r, e);
|
|
1535
1535
|
}, ze = function(r) {
|
|
1536
1536
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1537
1537
|
e[n - 1] = arguments[n];
|
|
1538
|
-
return
|
|
1538
|
+
return $.run("difference", r, e);
|
|
1539
1539
|
};
|
|
1540
1540
|
var Zt = {
|
|
1541
1541
|
union: Ne,
|
|
@@ -1553,7 +1553,7 @@ function Fe(r, t = {}) {
|
|
|
1553
1553
|
return n.length === 0 ? null : n.length === 1 ? xt(n[0], t.properties) : Ut(n, t.properties);
|
|
1554
1554
|
}
|
|
1555
1555
|
var Jt = Fe;
|
|
1556
|
-
function
|
|
1556
|
+
function pt(r) {
|
|
1557
1557
|
const t = [...r];
|
|
1558
1558
|
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;
|
|
1559
1559
|
}
|
|
@@ -1692,11 +1692,11 @@ function tn(r, t, e, n, i, o, f = null, s = [-1]) {
|
|
|
1692
1692
|
root: t.target || c.$$.root
|
|
1693
1693
|
};
|
|
1694
1694
|
f && f(u.root);
|
|
1695
|
-
let
|
|
1695
|
+
let g = !1;
|
|
1696
1696
|
if (u.ctx = e ? e(r, t.props || {}, (l, h, ...a) => {
|
|
1697
|
-
const
|
|
1698
|
-
return u.ctx && i(u.ctx[l], u.ctx[l] =
|
|
1699
|
-
}) : [], u.update(),
|
|
1697
|
+
const x = a.length ? a[0] : h;
|
|
1698
|
+
return u.ctx && i(u.ctx[l], u.ctx[l] = x) && (!u.skip_bound && u.bound[l] && u.bound[l](x), g && He(r, l)), h;
|
|
1699
|
+
}) : [], u.update(), g = !0, rt(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
|
|
1700
1700
|
if (t.hydrate) {
|
|
1701
1701
|
const l = Ye(t.target);
|
|
1702
1702
|
u.fragment && u.fragment.l(l), l.forEach(Ht);
|
|
@@ -1846,17 +1846,17 @@ function Ft(r, t) {
|
|
|
1846
1846
|
if (!e)
|
|
1847
1847
|
return;
|
|
1848
1848
|
e.properties = { isMask: !0 };
|
|
1849
|
-
const n =
|
|
1849
|
+
const n = pt(ut(r)), i = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, f = n[2] > 180, s = cn(r);
|
|
1850
1850
|
if (s.features.length > 1 && (o || f))
|
|
1851
1851
|
for (const c of s.features) {
|
|
1852
|
-
const u =
|
|
1852
|
+
const u = pt(ut(c));
|
|
1853
1853
|
if (f && u[0] < -180 + i)
|
|
1854
|
-
for (const
|
|
1855
|
-
for (const l of
|
|
1854
|
+
for (const g of c.geometry.coordinates)
|
|
1855
|
+
for (const l of g)
|
|
1856
1856
|
l[0] += 360 - i;
|
|
1857
1857
|
if (o && u[2] > 180 - i)
|
|
1858
|
-
for (const
|
|
1859
|
-
for (const l of
|
|
1858
|
+
for (const g of c.geometry.coordinates)
|
|
1859
|
+
for (const l of g)
|
|
1860
1860
|
l[0] -= 360 - i;
|
|
1861
1861
|
}
|
|
1862
1862
|
t(
|
|
@@ -1881,22 +1881,22 @@ const Tt = (r) => {
|
|
|
1881
1881
|
function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt, f = !1) {
|
|
1882
1882
|
let s;
|
|
1883
1883
|
const c = [];
|
|
1884
|
-
let u,
|
|
1885
|
-
const
|
|
1884
|
+
let u, g, l = f;
|
|
1885
|
+
const h = T.geoJSON(void 0, {
|
|
1886
1886
|
style: o === !0 ? Tt : o === !1 ? void 0 : o ?? void 0,
|
|
1887
1887
|
interactive: !1
|
|
1888
|
-
}).addTo(r),
|
|
1888
|
+
}).addTo(r), a = (p) => {
|
|
1889
1889
|
s == null || s({
|
|
1890
1890
|
type: "mapClick",
|
|
1891
|
-
coordinates: [
|
|
1891
|
+
coordinates: [p.latlng.lng, p.latlng.lat]
|
|
1892
1892
|
});
|
|
1893
1893
|
};
|
|
1894
|
-
function
|
|
1895
|
-
const
|
|
1896
|
-
return new sn({ props: { displayIn: "leaflet" }, target:
|
|
1897
|
-
interactive:
|
|
1894
|
+
function x(p, y = !1) {
|
|
1895
|
+
const d = document.createElement("div");
|
|
1896
|
+
return new sn({ props: { displayIn: "leaflet" }, target: d }), new T.Marker(p, {
|
|
1897
|
+
interactive: y,
|
|
1898
1898
|
icon: new T.DivIcon({
|
|
1899
|
-
html:
|
|
1899
|
+
html: d,
|
|
1900
1900
|
className: "",
|
|
1901
1901
|
iconAnchor: [12, 26],
|
|
1902
1902
|
iconSize: [25, 30],
|
|
@@ -1905,132 +1905,135 @@ function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt, f = !1) {
|
|
|
1905
1905
|
});
|
|
1906
1906
|
}
|
|
1907
1907
|
return {
|
|
1908
|
-
setEventHandler(
|
|
1909
|
-
|
|
1908
|
+
setEventHandler(p) {
|
|
1909
|
+
p ? (s = p, r.on("click", a)) : (s = void 0, r.off("click", a));
|
|
1910
1910
|
},
|
|
1911
|
-
flyTo(
|
|
1912
|
-
r.flyTo([
|
|
1911
|
+
flyTo(p, y) {
|
|
1912
|
+
r.flyTo([p[1], p[0]], y, { duration: 2, ...n });
|
|
1913
1913
|
},
|
|
1914
|
-
fitBounds(
|
|
1914
|
+
fitBounds(p, y, d) {
|
|
1915
1915
|
r.flyToBounds(
|
|
1916
1916
|
[
|
|
1917
|
-
[
|
|
1918
|
-
[
|
|
1917
|
+
[p[1], p[0]],
|
|
1918
|
+
[p[3], p[2]]
|
|
1919
1919
|
],
|
|
1920
1920
|
{
|
|
1921
|
-
padding: [
|
|
1921
|
+
padding: [y, y],
|
|
1922
1922
|
duration: 2,
|
|
1923
|
-
...
|
|
1923
|
+
...d ? { maxZoom: d } : {},
|
|
1924
1924
|
...i
|
|
1925
1925
|
}
|
|
1926
1926
|
);
|
|
1927
1927
|
},
|
|
1928
|
-
indicateReverse(
|
|
1929
|
-
r.getContainer().style.cursor =
|
|
1928
|
+
indicateReverse(p) {
|
|
1929
|
+
r.getContainer().style.cursor = p ? "crosshair" : "";
|
|
1930
1930
|
},
|
|
1931
|
-
setReverseMarker(
|
|
1932
|
-
var
|
|
1931
|
+
setReverseMarker(p) {
|
|
1932
|
+
var d;
|
|
1933
1933
|
if (!t)
|
|
1934
1934
|
return;
|
|
1935
|
-
const
|
|
1936
|
-
|
|
1935
|
+
const y = p && [p[1], p[0]];
|
|
1936
|
+
g ? y ? g.setLatLng(y) : (g.remove(), g = void 0) : y && (t instanceof Function ? g = t(r) ?? void 0 : (g = (typeof t == "object" ? new T.Marker(y, t) : x(y)).addTo(r), (d = g.getElement()) == null || d.classList.add("marker-reverse")));
|
|
1937
1937
|
},
|
|
1938
|
-
setMarkers(
|
|
1939
|
-
function
|
|
1940
|
-
|
|
1938
|
+
setMarkers(p, y) {
|
|
1939
|
+
function d(v) {
|
|
1940
|
+
h.clearLayers(), v && h.addData(v);
|
|
1941
1941
|
}
|
|
1942
|
-
for (const
|
|
1943
|
-
|
|
1944
|
-
if (c.length = 0,
|
|
1945
|
-
let
|
|
1946
|
-
if (
|
|
1947
|
-
const
|
|
1948
|
-
(
|
|
1942
|
+
for (const v of c)
|
|
1943
|
+
v.remove();
|
|
1944
|
+
if (c.length = 0, d(), y) {
|
|
1945
|
+
let v = !1;
|
|
1946
|
+
if (y.geometry.type === "GeometryCollection") {
|
|
1947
|
+
const w = y.geometry.geometries.filter(
|
|
1948
|
+
(m) => m.type === "Polygon" || m.type === "MultiPolygon"
|
|
1949
1949
|
);
|
|
1950
|
-
t: if (
|
|
1951
|
-
const
|
|
1952
|
-
Z(
|
|
1950
|
+
t: if (w.length > 0) {
|
|
1951
|
+
const m = Jt(
|
|
1952
|
+
Z(w.map((E) => V(E)))
|
|
1953
1953
|
);
|
|
1954
|
-
if (!
|
|
1954
|
+
if (!m)
|
|
1955
1955
|
break t;
|
|
1956
1956
|
Ft(
|
|
1957
1957
|
{
|
|
1958
|
-
...
|
|
1959
|
-
geometry:
|
|
1958
|
+
...y,
|
|
1959
|
+
geometry: m.geometry
|
|
1960
1960
|
},
|
|
1961
|
-
|
|
1962
|
-
),
|
|
1961
|
+
d
|
|
1962
|
+
), v = !0;
|
|
1963
1963
|
} else {
|
|
1964
|
-
const
|
|
1965
|
-
(
|
|
1964
|
+
const m = y.geometry.geometries.filter(
|
|
1965
|
+
(E) => E.type === "LineString" || E.type === "MultiLineString"
|
|
1966
1966
|
);
|
|
1967
|
-
|
|
1968
|
-
...
|
|
1969
|
-
geometry: { type: "GeometryCollection", geometries:
|
|
1970
|
-
}),
|
|
1967
|
+
m.length > 0 && (d({
|
|
1968
|
+
...y,
|
|
1969
|
+
geometry: { type: "GeometryCollection", geometries: m }
|
|
1970
|
+
}), v = !0);
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
if (!
|
|
1974
|
-
if (
|
|
1975
|
-
Ft(
|
|
1976
|
-
if (!
|
|
1973
|
+
if (!v) {
|
|
1974
|
+
if (y.geometry.type === "Polygon" || y.geometry.type === "MultiPolygon")
|
|
1975
|
+
Ft(y, (w) => {
|
|
1976
|
+
if (!w)
|
|
1977
1977
|
return;
|
|
1978
|
-
const
|
|
1979
|
-
|
|
1978
|
+
const m = [...w.features], E = pt(ut(y)), b = E[2] - E[0];
|
|
1979
|
+
E[0] - b / 4 < -180 && m.push(...qt(w, -360).features), E[2] + b / 4 > 180 && m.push(...qt(w, 360).features), d(Z(m));
|
|
1980
1980
|
});
|
|
1981
|
-
else if (
|
|
1982
|
-
|
|
1981
|
+
else if (y.geometry.type === "LineString" || y.geometry.type === "MultiLineString") {
|
|
1982
|
+
d(y);
|
|
1983
1983
|
return;
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
|
-
if (!
|
|
1986
|
+
if (!l && y.geometry.type !== "Point")
|
|
1987
1987
|
return;
|
|
1988
1988
|
if (t instanceof Function) {
|
|
1989
|
-
const
|
|
1990
|
-
|
|
1989
|
+
const w = t(r, y);
|
|
1990
|
+
w && c.push(w.addTo(r));
|
|
1991
1991
|
} else if (t) {
|
|
1992
|
-
const
|
|
1992
|
+
const w = [y.center[1], y.center[0]];
|
|
1993
1993
|
c.push(
|
|
1994
|
-
typeof t == "object" ? new T.Marker(
|
|
1994
|
+
typeof t == "object" ? new T.Marker(w, t) : x(w).addTo(r)
|
|
1995
1995
|
);
|
|
1996
1996
|
}
|
|
1997
1997
|
}
|
|
1998
1998
|
if (e)
|
|
1999
|
-
for (const
|
|
2000
|
-
if (
|
|
1999
|
+
for (const v of p ?? []) {
|
|
2000
|
+
if (v === y)
|
|
2001
2001
|
continue;
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2004
|
-
|
|
2002
|
+
const w = [
|
|
2003
|
+
v.center[1],
|
|
2004
|
+
v.center[0]
|
|
2005
2005
|
];
|
|
2006
|
-
let
|
|
2006
|
+
let m;
|
|
2007
2007
|
if (e instanceof Function) {
|
|
2008
|
-
if (
|
|
2008
|
+
if (m = e(r, v), !m)
|
|
2009
2009
|
continue;
|
|
2010
2010
|
} else
|
|
2011
|
-
|
|
2012
|
-
|
|
2011
|
+
m = (typeof e == "object" ? new T.Marker(w, e) : x(w, !0)).addTo(r).bindTooltip(
|
|
2012
|
+
v.place_type[0] === "reverse" ? v.place_name : v.place_name.replace(/,.*/, ""),
|
|
2013
2013
|
{
|
|
2014
2014
|
direction: "top"
|
|
2015
2015
|
}
|
|
2016
2016
|
);
|
|
2017
|
-
const
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
}),
|
|
2021
|
-
s == null || s({ type: "markerMouseEnter", id:
|
|
2022
|
-
}),
|
|
2023
|
-
s == null || s({ type: "markerMouseLeave", id:
|
|
2024
|
-
}),
|
|
2017
|
+
const E = m.getElement();
|
|
2018
|
+
E && (E.addEventListener("click", (b) => {
|
|
2019
|
+
b.stopPropagation(), s == null || s({ type: "markerClick", id: v.id });
|
|
2020
|
+
}), E.addEventListener("mouseenter", () => {
|
|
2021
|
+
s == null || s({ type: "markerMouseEnter", id: v.id });
|
|
2022
|
+
}), E.addEventListener("mouseleave", () => {
|
|
2023
|
+
s == null || s({ type: "markerMouseLeave", id: v.id });
|
|
2024
|
+
}), E.classList.toggle("marker-fuzzy", !!v.matching_text)), c.push(m);
|
|
2025
2025
|
}
|
|
2026
2026
|
},
|
|
2027
|
-
setSelectedMarker(
|
|
2028
|
-
var
|
|
2029
|
-
u && ((
|
|
2027
|
+
setSelectedMarker(p) {
|
|
2028
|
+
var y, d;
|
|
2029
|
+
u && ((y = u.getElement()) == null || y.classList.toggle("marker-selected", !1)), u = p > -1 ? c[p] : void 0, (d = u == null ? void 0 : u.getElement()) == null || d.classList.toggle("marker-selected", !0);
|
|
2030
2030
|
},
|
|
2031
2031
|
getCenterAndZoom() {
|
|
2032
|
-
const
|
|
2033
|
-
return [r.getZoom(),
|
|
2032
|
+
const p = r.getCenter();
|
|
2033
|
+
return [r.getZoom(), p.lng, p.lat];
|
|
2034
|
+
},
|
|
2035
|
+
setShowPolygonMarker(p) {
|
|
2036
|
+
l = p;
|
|
2034
2037
|
}
|
|
2035
2038
|
};
|
|
2036
2039
|
}
|