@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/maplibregl-controller.js
CHANGED
|
@@ -63,8 +63,8 @@ function ne(i, t) {
|
|
|
63
63
|
return this;
|
|
64
64
|
}), f;
|
|
65
65
|
function l(u) {
|
|
66
|
-
return function(
|
|
67
|
-
return c([u,
|
|
66
|
+
return function(g) {
|
|
67
|
+
return c([u, g]);
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
function c(u) {
|
|
@@ -105,8 +105,8 @@ function ne(i, t) {
|
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
107
|
u = t.call(i, e);
|
|
108
|
-
} catch (
|
|
109
|
-
u = [6,
|
|
108
|
+
} catch (g) {
|
|
109
|
+
u = [6, g], r = 0;
|
|
110
110
|
} finally {
|
|
111
111
|
n = o = 0;
|
|
112
112
|
}
|
|
@@ -424,19 +424,19 @@ function ht(i, t, e, n, r) {
|
|
|
424
424
|
ht(i, t, e, l, r), ht(i, t, l + 1, n, r);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
const O = 11102230246251565e-32,
|
|
427
|
+
const O = 11102230246251565e-32, P = 134217729, ue = (3 + 8 * O) * O;
|
|
428
428
|
function st(i, t, e, n, r) {
|
|
429
|
-
let o, f, l, c, u = t[0],
|
|
430
|
-
|
|
431
|
-
let
|
|
429
|
+
let o, f, l, c, u = t[0], g = n[0], s = 0, h = 0;
|
|
430
|
+
g > u == g > -u ? (o = u, u = t[++s]) : (o = g, g = n[++h]);
|
|
431
|
+
let a = 0;
|
|
432
432
|
if (s < i && h < e)
|
|
433
|
-
for (
|
|
434
|
-
|
|
433
|
+
for (g > u == g > -u ? (f = u + o, l = o - (f - u), u = t[++s]) : (f = g + o, l = o - (f - g), g = n[++h]), o = f, l !== 0 && (r[a++] = l); s < i && h < e; )
|
|
434
|
+
g > u == g > -u ? (f = o + u, c = f - o, l = o - (f - c) + (u - c), u = t[++s]) : (f = o + g, c = f - o, l = o - (f - c) + (g - c), g = n[++h]), o = f, l !== 0 && (r[a++] = l);
|
|
435
435
|
for (; s < i; )
|
|
436
|
-
f = o + u, c = f - o, l = o - (f - c) + (u - c), u = t[++s], o = f, l !== 0 && (r[
|
|
436
|
+
f = o + u, c = f - o, l = o - (f - c) + (u - c), u = t[++s], o = f, l !== 0 && (r[a++] = l);
|
|
437
437
|
for (; h < e; )
|
|
438
|
-
f = o +
|
|
439
|
-
return (o !== 0 ||
|
|
438
|
+
f = o + g, c = f - o, l = o - (f - c) + (g - c), g = n[++h], o = f, l !== 0 && (r[a++] = l);
|
|
439
|
+
return (o !== 0 || a === 0) && (r[a++] = o), a;
|
|
440
440
|
}
|
|
441
441
|
function fe(i, t) {
|
|
442
442
|
let e = t[0];
|
|
@@ -446,19 +446,19 @@ function fe(i, t) {
|
|
|
446
446
|
function J(i) {
|
|
447
447
|
return new Float64Array(i);
|
|
448
448
|
}
|
|
449
|
-
const ce = (3 + 16 * O) * O, he = (2 + 12 * O) * O, ae = (9 + 64 * O) * O * O, U = J(4), mt = J(8), wt = J(12), bt = J(16),
|
|
449
|
+
const ce = (3 + 16 * O) * O, he = (2 + 12 * O) * O, ae = (9 + 64 * O) * O * O, U = J(4), mt = J(8), wt = J(12), bt = J(16), M = J(4);
|
|
450
450
|
function ge(i, t, e, n, r, o, f) {
|
|
451
|
-
let l, c, u,
|
|
452
|
-
const R = i - r, I = e - r,
|
|
453
|
-
E = R *
|
|
451
|
+
let l, c, u, g, s, h, a, y, d, m, v, p, x, E, w, b, _, S;
|
|
452
|
+
const R = i - r, I = e - r, k = t - o, C = n - o;
|
|
453
|
+
E = R * C, h = P * R, a = h - (h - R), y = R - a, h = P * C, d = h - (h - C), m = C - d, w = y * m - (E - a * d - y * d - a * m), b = k * I, h = P * k, a = h - (h - k), y = k - a, h = P * I, d = h - (h - I), m = I - d, _ = y * m - (b - a * d - y * d - a * m), v = w - _, s = w - v, U[0] = w - (v + s) + (s - _), p = E + v, s = p - E, x = E - (p - s) + (v - s), v = x - b, s = x - v, U[1] = x - (v + s) + (s - b), S = p + v, s = S - p, U[2] = p - (S - s) + (v - s), U[3] = S;
|
|
454
454
|
let A = fe(4, U), Q = he * f;
|
|
455
|
-
if (A >= Q || -A >= Q || (s = i - R, l = i - (R + s) + (s - r), s = e - I, u = e - (I + s) + (s - r), s = t -
|
|
456
|
-
E = l *
|
|
457
|
-
const Jt = st(4, U, 4,
|
|
458
|
-
E = R *
|
|
459
|
-
const Kt = st(Jt, mt, 4,
|
|
460
|
-
E = l *
|
|
461
|
-
const Ht = st(Kt, wt, 4,
|
|
455
|
+
if (A >= Q || -A >= Q || (s = i - R, l = i - (R + s) + (s - r), s = e - I, u = e - (I + s) + (s - r), s = t - k, c = t - (k + s) + (s - o), s = n - C, g = n - (C + s) + (s - o), l === 0 && c === 0 && u === 0 && g === 0) || (Q = ae * f + ue * Math.abs(A), A += R * g + C * l - (k * u + I * c), A >= Q || -A >= Q)) return A;
|
|
456
|
+
E = l * C, h = P * l, a = h - (h - l), y = l - a, h = P * C, d = h - (h - C), m = C - d, w = y * m - (E - a * d - y * d - a * m), b = c * I, h = P * c, a = h - (h - c), y = c - a, h = P * I, d = h - (h - I), m = I - d, _ = y * m - (b - a * d - y * d - a * m), v = w - _, s = w - v, M[0] = w - (v + s) + (s - _), p = E + v, s = p - E, x = E - (p - s) + (v - s), v = x - b, s = x - v, M[1] = x - (v + s) + (s - b), S = p + v, s = S - p, M[2] = p - (S - s) + (v - s), M[3] = S;
|
|
457
|
+
const Jt = st(4, U, 4, M, mt);
|
|
458
|
+
E = R * g, h = P * R, a = h - (h - R), y = R - a, h = P * g, d = h - (h - g), m = g - d, w = y * m - (E - a * d - y * d - a * m), b = k * u, h = P * k, a = h - (h - k), y = k - a, h = P * u, d = h - (h - u), m = u - d, _ = y * m - (b - a * d - y * d - a * m), v = w - _, s = w - v, M[0] = w - (v + s) + (s - _), p = E + v, s = p - E, x = E - (p - s) + (v - s), v = x - b, s = x - v, M[1] = x - (v + s) + (s - b), S = p + v, s = S - p, M[2] = p - (S - s) + (v - s), M[3] = S;
|
|
459
|
+
const Kt = st(Jt, mt, 4, M, wt);
|
|
460
|
+
E = l * g, h = P * l, a = h - (h - l), y = l - a, h = P * g, d = h - (h - g), m = g - d, w = y * m - (E - a * d - y * d - a * m), b = c * u, h = P * c, a = h - (h - c), y = c - a, h = P * u, d = h - (h - u), m = u - d, _ = y * m - (b - a * d - y * d - a * m), v = w - _, s = w - v, M[0] = w - (v + s) + (s - _), p = E + v, s = p - E, x = E - (p - s) + (v - s), v = x - b, s = x - v, M[1] = x - (v + s) + (s - b), S = p + v, s = S - p, M[2] = p - (S - s) + (v - s), M[3] = S;
|
|
461
|
+
const Ht = st(Kt, wt, 4, M, bt);
|
|
462
462
|
return bt[Ht - 1];
|
|
463
463
|
}
|
|
464
464
|
function pe(i, t, e, n, r, o) {
|
|
@@ -557,10 +557,10 @@ const Z = new de(), tt = (i, t) => i.x * t.y - i.y * t.x, Yt = (i, t) => i.x * t
|
|
|
557
557
|
const o = {
|
|
558
558
|
x: e.x - i.x,
|
|
559
559
|
y: e.y - i.y
|
|
560
|
-
}, f = tt(o, t) / r, l = tt(o, n) / r, c = i.x + l * t.x, u = e.x + f * n.x,
|
|
560
|
+
}, f = tt(o, t) / r, l = tt(o, n) / r, c = i.x + l * t.x, u = e.x + f * n.x, g = i.y + l * t.y, s = e.y + f * n.y, h = (c + u) / 2, a = (g + s) / 2;
|
|
561
561
|
return {
|
|
562
562
|
x: h,
|
|
563
|
-
y:
|
|
563
|
+
y: a
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
566
|
class L {
|
|
@@ -658,7 +658,7 @@ class z {
|
|
|
658
658
|
const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x, f = e.rightSE.point.x;
|
|
659
659
|
if (f < n) return 1;
|
|
660
660
|
if (o < r) return -1;
|
|
661
|
-
const l = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y,
|
|
661
|
+
const l = 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
663
|
if (c < l && c < u) return 1;
|
|
664
664
|
if (c > l && c > u) return -1;
|
|
@@ -669,8 +669,8 @@ class z {
|
|
|
669
669
|
return h !== 0 ? h : -1;
|
|
670
670
|
}
|
|
671
671
|
if (n > r) {
|
|
672
|
-
if (l < c && l <
|
|
673
|
-
if (l > c && l >
|
|
672
|
+
if (l < c && l < g) return -1;
|
|
673
|
+
if (l > c && l > g) return 1;
|
|
674
674
|
const s = e.comparePoint(t.leftSE.point);
|
|
675
675
|
if (s !== 0) return s;
|
|
676
676
|
const h = t.comparePoint(e.rightSE.point);
|
|
@@ -688,11 +688,11 @@ class z {
|
|
|
688
688
|
if (s > 0) return -1;
|
|
689
689
|
}
|
|
690
690
|
if (o !== f) {
|
|
691
|
-
const s = u - l, h = o - n,
|
|
692
|
-
if (s > h &&
|
|
693
|
-
if (s < h &&
|
|
691
|
+
const s = u - l, h = o - n, a = g - c, y = f - r;
|
|
692
|
+
if (s > h && a < y) return 1;
|
|
693
|
+
if (s < h && a > y) return -1;
|
|
694
694
|
}
|
|
695
|
-
return o > f ? 1 : o < f || u <
|
|
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 */
|
|
@@ -778,18 +778,18 @@ class z {
|
|
|
778
778
|
getIntersection(t) {
|
|
779
779
|
const e = this.bbox(), n = t.bbox(), r = at(e, n);
|
|
780
780
|
if (r === null) return null;
|
|
781
|
-
const o = this.leftSE.point, f = this.rightSE.point, l = t.leftSE.point, c = t.rightSE.point, u = F(e, l) && this.comparePoint(l) === 0,
|
|
782
|
-
if (
|
|
781
|
+
const o = this.leftSE.point, f = this.rightSE.point, l = t.leftSE.point, c = t.rightSE.point, u = F(e, l) && this.comparePoint(l) === 0, g = F(n, o) && t.comparePoint(o) === 0, s = F(e, c) && this.comparePoint(c) === 0, h = F(n, f) && t.comparePoint(f) === 0;
|
|
782
|
+
if (g && u)
|
|
783
783
|
return h && !s ? f : !h && s ? c : null;
|
|
784
|
-
if (
|
|
784
|
+
if (g)
|
|
785
785
|
return s && o.x === c.x && o.y === c.y ? null : o;
|
|
786
786
|
if (u)
|
|
787
787
|
return h && f.x === l.x && f.y === l.y ? null : l;
|
|
788
788
|
if (h && s) return null;
|
|
789
789
|
if (h) return f;
|
|
790
790
|
if (s) return c;
|
|
791
|
-
const
|
|
792
|
-
return
|
|
791
|
+
const a = Ee(o, this.vector(), l, 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.
|
|
@@ -866,17 +866,17 @@ class z {
|
|
|
866
866
|
};
|
|
867
867
|
const e = this._afterState.rings, n = this._afterState.windings, r = this._afterState.multiPolys;
|
|
868
868
|
for (let l = 0, c = this.rings.length; l < c; l++) {
|
|
869
|
-
const u = this.rings[l],
|
|
870
|
-
s === -1 ? (e.push(u), n.push(
|
|
869
|
+
const u = this.rings[l], g = this.windings[l], s = e.indexOf(u);
|
|
870
|
+
s === -1 ? (e.push(u), n.push(g)) : n[s] += g;
|
|
871
871
|
}
|
|
872
872
|
const o = [], f = [];
|
|
873
873
|
for (let l = 0, c = e.length; l < c; l++) {
|
|
874
874
|
if (n[l] === 0) continue;
|
|
875
|
-
const u = e[l],
|
|
876
|
-
if (f.indexOf(
|
|
877
|
-
if (u.isExterior) o.push(
|
|
875
|
+
const u = e[l], g = u.poly;
|
|
876
|
+
if (f.indexOf(g) === -1)
|
|
877
|
+
if (u.isExterior) o.push(g);
|
|
878
878
|
else {
|
|
879
|
-
f.indexOf(
|
|
879
|
+
f.indexOf(g) === -1 && f.push(g);
|
|
880
880
|
const s = o.indexOf(u.poly);
|
|
881
881
|
s !== -1 && o.splice(s, 1);
|
|
882
882
|
}
|
|
@@ -1027,26 +1027,26 @@ class nt {
|
|
|
1027
1027
|
const o = t[n];
|
|
1028
1028
|
if (!o.isInResult() || o.ringOut) continue;
|
|
1029
1029
|
let f = null, l = o.leftSE, c = o.rightSE;
|
|
1030
|
-
const u = [l],
|
|
1031
|
-
for (; f = l, l = c, u.push(l), l.point !==
|
|
1030
|
+
const u = [l], g = l.point, s = [];
|
|
1031
|
+
for (; f = l, l = c, u.push(l), l.point !== g; )
|
|
1032
1032
|
for (; ; ) {
|
|
1033
1033
|
const h = l.getAvailableLinkedEvents();
|
|
1034
1034
|
if (h.length === 0) {
|
|
1035
|
-
const
|
|
1036
|
-
throw new Error(`Unable to complete output ring starting at [${
|
|
1035
|
+
const d = u[0].point, m = u[u.length - 1].point;
|
|
1036
|
+
throw new Error(`Unable to complete output ring starting at [${d.x}, ${d.y}]. Last matching segment found ends at [${m.x}, ${m.y}].`);
|
|
1037
1037
|
}
|
|
1038
1038
|
if (h.length === 1) {
|
|
1039
1039
|
c = h[0].otherSE;
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
|
-
let
|
|
1043
|
-
for (let
|
|
1044
|
-
if (s[
|
|
1045
|
-
|
|
1042
|
+
let a = null;
|
|
1043
|
+
for (let d = 0, m = s.length; d < m; d++)
|
|
1044
|
+
if (s[d].point === l.point) {
|
|
1045
|
+
a = d;
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
|
-
if (
|
|
1049
|
-
const
|
|
1048
|
+
if (a !== null) {
|
|
1049
|
+
const d = s.splice(a)[0], m = u.splice(d.index);
|
|
1050
1050
|
m.unshift(m[0].otherSE), e.push(new nt(m.reverse()));
|
|
1051
1051
|
continue;
|
|
1052
1052
|
}
|
|
@@ -1071,7 +1071,7 @@ class nt {
|
|
|
1071
1071
|
getGeom() {
|
|
1072
1072
|
let t = this.events[0].point;
|
|
1073
1073
|
const e = [t];
|
|
1074
|
-
for (let u = 1,
|
|
1074
|
+
for (let u = 1, g = this.events.length - 1; u < g; u++) {
|
|
1075
1075
|
const s = this.events[u].point, h = this.events[u + 1].point;
|
|
1076
1076
|
Pt(s, t, h) !== 0 && (e.push(s), t = s);
|
|
1077
1077
|
}
|
|
@@ -1109,7 +1109,7 @@ class nt {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
|
-
class
|
|
1112
|
+
class kt {
|
|
1113
1113
|
constructor(t) {
|
|
1114
1114
|
this.exteriorRing = t, t.poly = this, this.interiorRings = [];
|
|
1115
1115
|
}
|
|
@@ -1143,10 +1143,10 @@ class be {
|
|
|
1143
1143
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1144
1144
|
const o = t[n];
|
|
1145
1145
|
if (!o.poly)
|
|
1146
|
-
if (o.isExteriorRing()) e.push(new
|
|
1146
|
+
if (o.isExteriorRing()) e.push(new kt(o));
|
|
1147
1147
|
else {
|
|
1148
1148
|
const f = o.enclosingRing();
|
|
1149
|
-
f.poly || e.push(new
|
|
1149
|
+
f.poly || e.push(new kt(f)), f.poly.addInterior(o);
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
1152
|
return e;
|
|
@@ -1174,25 +1174,25 @@ class _e {
|
|
|
1174
1174
|
const s = l.getIntersection(e);
|
|
1175
1175
|
if (s !== null && (e.isAnEndpoint(s) || (u = s), !l.isAnEndpoint(s))) {
|
|
1176
1176
|
const h = this._splitSafely(l, s);
|
|
1177
|
-
for (let
|
|
1178
|
-
n.push(h[
|
|
1177
|
+
for (let a = 0, y = h.length; a < y; a++)
|
|
1178
|
+
n.push(h[a]);
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
|
-
let
|
|
1181
|
+
let g = null;
|
|
1182
1182
|
if (c) {
|
|
1183
1183
|
const s = c.getIntersection(e);
|
|
1184
|
-
if (s !== null && (e.isAnEndpoint(s) || (
|
|
1184
|
+
if (s !== null && (e.isAnEndpoint(s) || (g = s), !c.isAnEndpoint(s))) {
|
|
1185
1185
|
const h = this._splitSafely(c, s);
|
|
1186
|
-
for (let
|
|
1187
|
-
n.push(h[
|
|
1186
|
+
for (let a = 0, y = h.length; a < y; a++)
|
|
1187
|
+
n.push(h[a]);
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
if (u !== null ||
|
|
1190
|
+
if (u !== null || g !== null) {
|
|
1191
1191
|
let s = null;
|
|
1192
|
-
u === null ? s =
|
|
1192
|
+
u === null ? s = g : g === null ? s = u : s = L.comparePoints(u, g) <= 0 ? u : g, this.queue.remove(e.rightSE), n.push(e.rightSE);
|
|
1193
1193
|
const h = e.split(s);
|
|
1194
|
-
for (let
|
|
1195
|
-
n.push(h[
|
|
1194
|
+
for (let a = 0, y = h.length; a < y; a++)
|
|
1195
|
+
n.push(h[a]);
|
|
1196
1196
|
}
|
|
1197
1197
|
n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = l);
|
|
1198
1198
|
} else {
|
|
@@ -1200,14 +1200,14 @@ class _e {
|
|
|
1200
1200
|
const u = l.getIntersection(c);
|
|
1201
1201
|
if (u !== null) {
|
|
1202
1202
|
if (!l.isAnEndpoint(u)) {
|
|
1203
|
-
const
|
|
1204
|
-
for (let s = 0, h =
|
|
1205
|
-
n.push(
|
|
1203
|
+
const g = this._splitSafely(l, u);
|
|
1204
|
+
for (let s = 0, h = g.length; s < h; s++)
|
|
1205
|
+
n.push(g[s]);
|
|
1206
1206
|
}
|
|
1207
1207
|
if (!c.isAnEndpoint(u)) {
|
|
1208
|
-
const
|
|
1209
|
-
for (let s = 0, h =
|
|
1210
|
-
n.push(
|
|
1208
|
+
const g = this._splitSafely(c, u);
|
|
1209
|
+
for (let s = 0, h = g.length; s < h; s++)
|
|
1210
|
+
n.push(g[s]);
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
1213
|
}
|
|
@@ -1225,7 +1225,7 @@ class _e {
|
|
|
1225
1225
|
return r.push(n), t.consumedBy === void 0 && this.tree.add(t), r;
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
const
|
|
1228
|
+
const Ct = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, Se = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
|
|
1229
1229
|
class Pe {
|
|
1230
1230
|
run(t, e, n) {
|
|
1231
1231
|
$.type = t, Z.reset();
|
|
@@ -1240,15 +1240,15 @@ class Pe {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
if ($.type === "intersection")
|
|
1242
1242
|
for (let s = 0, h = r.length; s < h; s++) {
|
|
1243
|
-
const
|
|
1244
|
-
for (let y = s + 1,
|
|
1245
|
-
if (at(
|
|
1243
|
+
const a = r[s];
|
|
1244
|
+
for (let y = s + 1, d = r.length; y < d; y++)
|
|
1245
|
+
if (at(a.bbox, r[y].bbox) === null) return [];
|
|
1246
1246
|
}
|
|
1247
1247
|
const o = new dt(L.compare);
|
|
1248
1248
|
for (let s = 0, h = r.length; s < h; s++) {
|
|
1249
|
-
const
|
|
1250
|
-
for (let y = 0,
|
|
1251
|
-
if (o.insert(
|
|
1249
|
+
const a = r[s].getSweepEvents();
|
|
1250
|
+
for (let y = 0, d = a.length; y < d; y++)
|
|
1251
|
+
if (o.insert(a[y]), 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
1254
|
const f = new _e(o);
|
|
@@ -1256,17 +1256,17 @@ class Pe {
|
|
|
1256
1256
|
for (; c; ) {
|
|
1257
1257
|
const s = c.key;
|
|
1258
1258
|
if (o.size === l) {
|
|
1259
|
-
const
|
|
1260
|
-
throw new Error(`Unable to pop() ${s.isLeft ? "left" : "right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${
|
|
1259
|
+
const a = s.segment;
|
|
1260
|
+
throw new Error(`Unable to pop() ${s.isLeft ? "left" : "right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${a.id} [${a.leftSE.point.x}, ${a.leftSE.point.y}] -> [${a.rightSE.point.x}, ${a.rightSE.point.y}] from queue.`);
|
|
1261
1261
|
}
|
|
1262
|
-
if (o.size >
|
|
1262
|
+
if (o.size > Ct)
|
|
1263
1263
|
throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
|
|
1264
1264
|
if (f.segments.length > Se)
|
|
1265
1265
|
throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
|
|
1266
1266
|
const h = f.process(s);
|
|
1267
|
-
for (let
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1267
|
+
for (let a = 0, y = h.length; a < y; a++) {
|
|
1268
|
+
const d = h[a];
|
|
1269
|
+
d.consumedBy === void 0 && o.insert(d);
|
|
1270
1270
|
}
|
|
1271
1271
|
l = o.size, c = o.pop();
|
|
1272
1272
|
}
|
|
@@ -1300,26 +1300,26 @@ var Qt = {
|
|
|
1300
1300
|
};
|
|
1301
1301
|
function Ft(i, t, e) {
|
|
1302
1302
|
if (i !== null)
|
|
1303
|
-
for (var n, r, o, f, l, c, u,
|
|
1304
|
-
u = y ? i.features[
|
|
1305
|
-
for (var
|
|
1306
|
-
var
|
|
1307
|
-
if (f = h ? u.geometries[
|
|
1303
|
+
for (var n, r, o, f, l, c, u, g = 0, s = 0, h, a = i.type, y = a === "FeatureCollection", d = a === "Feature", m = y ? i.features.length : 1, v = 0; v < m; v++) {
|
|
1304
|
+
u = y ? i.features[v].geometry : d ? i.geometry : i, h = u ? u.type === "GeometryCollection" : !1, l = h ? u.geometries.length : 1;
|
|
1305
|
+
for (var p = 0; p < l; p++) {
|
|
1306
|
+
var x = 0, E = 0;
|
|
1307
|
+
if (f = h ? u.geometries[p] : u, f !== null) {
|
|
1308
1308
|
c = f.coordinates;
|
|
1309
1309
|
var w = f.type;
|
|
1310
|
-
switch (
|
|
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
|
s,
|
|
1317
|
-
a,
|
|
1318
1317
|
v,
|
|
1318
|
+
x,
|
|
1319
1319
|
E
|
|
1320
1320
|
) === !1)
|
|
1321
1321
|
return !1;
|
|
1322
|
-
s++,
|
|
1322
|
+
s++, x++;
|
|
1323
1323
|
break;
|
|
1324
1324
|
case "LineString":
|
|
1325
1325
|
case "MultiPoint":
|
|
@@ -1327,42 +1327,42 @@ function Ft(i, t, e) {
|
|
|
1327
1327
|
if (t(
|
|
1328
1328
|
c[n],
|
|
1329
1329
|
s,
|
|
1330
|
-
a,
|
|
1331
1330
|
v,
|
|
1331
|
+
x,
|
|
1332
1332
|
E
|
|
1333
1333
|
) === !1)
|
|
1334
1334
|
return !1;
|
|
1335
|
-
s++, w === "MultiPoint" &&
|
|
1335
|
+
s++, w === "MultiPoint" && x++;
|
|
1336
1336
|
}
|
|
1337
|
-
w === "LineString" &&
|
|
1337
|
+
w === "LineString" && x++;
|
|
1338
1338
|
break;
|
|
1339
1339
|
case "Polygon":
|
|
1340
1340
|
case "MultiLineString":
|
|
1341
1341
|
for (n = 0; n < c.length; n++) {
|
|
1342
|
-
for (r = 0; r < c[n].length -
|
|
1342
|
+
for (r = 0; r < c[n].length - g; r++) {
|
|
1343
1343
|
if (t(
|
|
1344
1344
|
c[n][r],
|
|
1345
1345
|
s,
|
|
1346
|
-
a,
|
|
1347
1346
|
v,
|
|
1347
|
+
x,
|
|
1348
1348
|
E
|
|
1349
1349
|
) === !1)
|
|
1350
1350
|
return !1;
|
|
1351
1351
|
s++;
|
|
1352
1352
|
}
|
|
1353
|
-
w === "MultiLineString" &&
|
|
1353
|
+
w === "MultiLineString" && x++, w === "Polygon" && E++;
|
|
1354
1354
|
}
|
|
1355
|
-
w === "Polygon" &&
|
|
1355
|
+
w === "Polygon" && x++;
|
|
1356
1356
|
break;
|
|
1357
1357
|
case "MultiPolygon":
|
|
1358
1358
|
for (n = 0; n < c.length; n++) {
|
|
1359
1359
|
for (E = 0, r = 0; r < c[n].length; r++) {
|
|
1360
|
-
for (o = 0; o < c[n][r].length -
|
|
1360
|
+
for (o = 0; o < c[n][r].length - g; o++) {
|
|
1361
1361
|
if (t(
|
|
1362
1362
|
c[n][r][o],
|
|
1363
1363
|
s,
|
|
1364
|
-
a,
|
|
1365
1364
|
v,
|
|
1365
|
+
x,
|
|
1366
1366
|
E
|
|
1367
1367
|
) === !1)
|
|
1368
1368
|
return !1;
|
|
@@ -1370,7 +1370,7 @@ function Ft(i, t, e) {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
E++;
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1373
|
+
x++;
|
|
1374
1374
|
}
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "GeometryCollection":
|
|
@@ -1386,15 +1386,15 @@ function Ft(i, t, e) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
}
|
|
1388
1388
|
function xt(i, t) {
|
|
1389
|
-
var e, n, r, o, f, l, c, u,
|
|
1390
|
-
for (e = 0; e <
|
|
1391
|
-
for (l =
|
|
1389
|
+
var e, n, r, o, f, l, c, u, g, s, h = 0, a = i.type === "FeatureCollection", y = i.type === "Feature", d = a ? i.features.length : 1;
|
|
1390
|
+
for (e = 0; e < d; e++) {
|
|
1391
|
+
for (l = a ? i.features[e].geometry : y ? i.geometry : i, u = a ? i.features[e].properties : y ? i.properties : {}, g = a ? i.features[e].bbox : y ? i.bbox : void 0, s = a ? i.features[e].id : y ? i.id : void 0, c = l ? l.type === "GeometryCollection" : !1, f = c ? l.geometries.length : 1, r = 0; r < f; r++) {
|
|
1392
1392
|
if (o = c ? l.geometries[r] : l, o === null) {
|
|
1393
1393
|
if (t(
|
|
1394
1394
|
null,
|
|
1395
1395
|
h,
|
|
1396
1396
|
u,
|
|
1397
|
-
|
|
1397
|
+
g,
|
|
1398
1398
|
s
|
|
1399
1399
|
) === !1)
|
|
1400
1400
|
return !1;
|
|
@@ -1411,7 +1411,7 @@ function xt(i, t) {
|
|
|
1411
1411
|
o,
|
|
1412
1412
|
h,
|
|
1413
1413
|
u,
|
|
1414
|
-
|
|
1414
|
+
g,
|
|
1415
1415
|
s
|
|
1416
1416
|
) === !1)
|
|
1417
1417
|
return !1;
|
|
@@ -1423,7 +1423,7 @@ function xt(i, t) {
|
|
|
1423
1423
|
o.geometries[n],
|
|
1424
1424
|
h,
|
|
1425
1425
|
u,
|
|
1426
|
-
|
|
1426
|
+
g,
|
|
1427
1427
|
s
|
|
1428
1428
|
) === !1)
|
|
1429
1429
|
return !1;
|
|
@@ -1436,7 +1436,7 @@ function xt(i, t) {
|
|
|
1436
1436
|
h++;
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function ke(i, t) {
|
|
1440
1440
|
xt(i, function(e, n, r, o, f) {
|
|
1441
1441
|
var l = e === null ? null : e.type;
|
|
1442
1442
|
switch (l) {
|
|
@@ -1463,16 +1463,16 @@ function Ce(i, t) {
|
|
|
1463
1463
|
break;
|
|
1464
1464
|
}
|
|
1465
1465
|
for (var u = 0; u < e.coordinates.length; u++) {
|
|
1466
|
-
var
|
|
1466
|
+
var g = e.coordinates[u], s = {
|
|
1467
1467
|
type: c,
|
|
1468
|
-
coordinates:
|
|
1468
|
+
coordinates: g
|
|
1469
1469
|
};
|
|
1470
1470
|
if (t(X(s, r), n, u) === !1)
|
|
1471
1471
|
return !1;
|
|
1472
1472
|
}
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Ce(i, t = {}) {
|
|
1476
1476
|
const e = [];
|
|
1477
1477
|
if (xt(i, (r) => {
|
|
1478
1478
|
e.push(r.coordinates);
|
|
@@ -1481,7 +1481,7 @@ function ke(i, t = {}) {
|
|
|
1481
1481
|
const n = Qt.union(e[0], ...e.slice(1));
|
|
1482
1482
|
return n.length === 0 ? null : n.length === 1 ? yt(n[0], t.properties) : jt(n, t.properties);
|
|
1483
1483
|
}
|
|
1484
|
-
var Dt =
|
|
1484
|
+
var Dt = Ce;
|
|
1485
1485
|
function W() {
|
|
1486
1486
|
}
|
|
1487
1487
|
function Xt(i) {
|
|
@@ -1617,11 +1617,11 @@ function De(i, t, e, n, r, o, f = null, l = [-1]) {
|
|
|
1617
1617
|
root: t.target || c.$$.root
|
|
1618
1618
|
};
|
|
1619
1619
|
f && f(u.root);
|
|
1620
|
-
let
|
|
1621
|
-
if (u.ctx = e ? e(i, t.props || {}, (s, h, ...
|
|
1622
|
-
const y =
|
|
1623
|
-
return u.ctx && r(u.ctx[s], u.ctx[s] = y) && (!u.skip_bound && u.bound[s] && u.bound[s](y),
|
|
1624
|
-
}) : [], u.update(),
|
|
1620
|
+
let g = !1;
|
|
1621
|
+
if (u.ctx = e ? e(i, t.props || {}, (s, h, ...a) => {
|
|
1622
|
+
const y = a.length ? a[0] : h;
|
|
1623
|
+
return u.ctx && r(u.ctx[s], u.ctx[s] = y) && (!u.skip_bound && u.bound[s] && u.bound[s](y), g && Fe(i, s)), h;
|
|
1624
|
+
}) : [], u.update(), g = !0, it(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
|
|
1625
1625
|
if (t.hydrate) {
|
|
1626
1626
|
const s = Be(t.target);
|
|
1627
1627
|
u.fragment && u.fragment.l(s), s.forEach(Zt);
|
|
@@ -1757,7 +1757,7 @@ function en(i) {
|
|
|
1757
1757
|
if (!i)
|
|
1758
1758
|
throw new Error("geojson is required");
|
|
1759
1759
|
var t = [];
|
|
1760
|
-
return
|
|
1760
|
+
return ke(i, function(e) {
|
|
1761
1761
|
t.push(e);
|
|
1762
1762
|
}), V(t);
|
|
1763
1763
|
}
|
|
@@ -1789,12 +1789,12 @@ function zt(i, t) {
|
|
|
1789
1789
|
for (const c of l.features) {
|
|
1790
1790
|
const u = Tt(Bt(c));
|
|
1791
1791
|
if (f && u[0] < -180 + r)
|
|
1792
|
-
for (const
|
|
1793
|
-
for (const s of
|
|
1792
|
+
for (const g of c.geometry.coordinates)
|
|
1793
|
+
for (const s of g)
|
|
1794
1794
|
s[0] += 360 - r;
|
|
1795
1795
|
if (o && u[2] > 180 - r)
|
|
1796
|
-
for (const
|
|
1797
|
-
for (const s of
|
|
1796
|
+
for (const g of c.geometry.coordinates)
|
|
1797
|
+
for (const s of g)
|
|
1798
1798
|
s[0] -= 360 - r;
|
|
1799
1799
|
}
|
|
1800
1800
|
t(
|
|
@@ -1827,18 +1827,18 @@ const Gt = {
|
|
|
1827
1827
|
function on(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt, l = !1) {
|
|
1828
1828
|
let c;
|
|
1829
1829
|
const u = [];
|
|
1830
|
-
let
|
|
1831
|
-
function
|
|
1830
|
+
let g, s, h, a = l;
|
|
1831
|
+
function y() {
|
|
1832
1832
|
if (!i.loaded) {
|
|
1833
|
-
i.once("load",
|
|
1833
|
+
i.once("load", y);
|
|
1834
1834
|
return;
|
|
1835
1835
|
}
|
|
1836
|
-
const
|
|
1837
|
-
if (!(
|
|
1836
|
+
const p = f ? f === !0 ? Gt : f : void 0;
|
|
1837
|
+
if (!(p != null && p.fill) && !(p != null && p.line))
|
|
1838
1838
|
return;
|
|
1839
|
-
const
|
|
1840
|
-
if (
|
|
1841
|
-
|
|
1839
|
+
const x = i.getSource(H);
|
|
1840
|
+
if (x)
|
|
1841
|
+
x.setData(h ?? V([]));
|
|
1842
1842
|
else if (h)
|
|
1843
1843
|
i.addSource(H, {
|
|
1844
1844
|
type: "geojson",
|
|
@@ -1846,149 +1846,152 @@ function on(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt, l = !1) {
|
|
|
1846
1846
|
});
|
|
1847
1847
|
else
|
|
1848
1848
|
return;
|
|
1849
|
-
!i.getLayer(Ut) && (
|
|
1850
|
-
...
|
|
1849
|
+
!i.getLayer(Ut) && (p != null && p.fill) && i.addLayer({
|
|
1850
|
+
...p == null ? void 0 : p.fill,
|
|
1851
1851
|
id: Ut,
|
|
1852
1852
|
type: "fill",
|
|
1853
1853
|
source: H
|
|
1854
|
-
}), !i.getLayer(qt) && (
|
|
1855
|
-
...
|
|
1854
|
+
}), !i.getLayer(qt) && (p != null && p.line) && i.addLayer({
|
|
1855
|
+
...p == null ? void 0 : p.line,
|
|
1856
1856
|
id: qt,
|
|
1857
1857
|
type: "line",
|
|
1858
1858
|
source: H
|
|
1859
1859
|
});
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1862
|
-
h =
|
|
1861
|
+
function d(p) {
|
|
1862
|
+
h = p, y();
|
|
1863
1863
|
}
|
|
1864
1864
|
i.on("styledata", () => {
|
|
1865
1865
|
setTimeout(() => {
|
|
1866
|
-
h &&
|
|
1866
|
+
h && y();
|
|
1867
1867
|
});
|
|
1868
1868
|
});
|
|
1869
|
-
const
|
|
1869
|
+
const m = (p) => {
|
|
1870
1870
|
c == null || c({
|
|
1871
1871
|
type: "mapClick",
|
|
1872
|
-
coordinates: [
|
|
1872
|
+
coordinates: [p.lngLat.lng, p.lngLat.lat]
|
|
1873
1873
|
});
|
|
1874
1874
|
};
|
|
1875
|
-
function
|
|
1875
|
+
function v(p = !1) {
|
|
1876
1876
|
if (!t)
|
|
1877
1877
|
throw new Error();
|
|
1878
|
-
const
|
|
1879
|
-
return
|
|
1878
|
+
const x = document.createElement("div");
|
|
1879
|
+
return p && x.classList.add("marker-interactive"), new Je({
|
|
1880
1880
|
props: { displayIn: "maplibre" },
|
|
1881
|
-
target:
|
|
1882
|
-
}), new t.Marker({ element:
|
|
1881
|
+
target: x
|
|
1882
|
+
}), new t.Marker({ element: x, offset: [1, -13] });
|
|
1883
1883
|
}
|
|
1884
1884
|
return {
|
|
1885
|
-
setEventHandler(
|
|
1886
|
-
|
|
1885
|
+
setEventHandler(p) {
|
|
1886
|
+
p ? (c = p, i.on("click", m)) : (c = void 0, i.off("click", m));
|
|
1887
1887
|
},
|
|
1888
|
-
flyTo(
|
|
1889
|
-
i.flyTo({ center:
|
|
1888
|
+
flyTo(p, x) {
|
|
1889
|
+
i.flyTo({ center: p, ...x ? { zoom: x } : {}, ...r });
|
|
1890
1890
|
},
|
|
1891
|
-
fitBounds(
|
|
1891
|
+
fitBounds(p, x, E) {
|
|
1892
1892
|
i.fitBounds(
|
|
1893
1893
|
[
|
|
1894
|
-
[
|
|
1895
|
-
[
|
|
1894
|
+
[p[0], p[1]],
|
|
1895
|
+
[p[2], p[3]]
|
|
1896
1896
|
],
|
|
1897
|
-
{ padding:
|
|
1897
|
+
{ padding: x, ...E ? { maxZoom: E } : {}, ...o }
|
|
1898
1898
|
);
|
|
1899
1899
|
},
|
|
1900
|
-
indicateReverse(
|
|
1901
|
-
i.getCanvasContainer().style.cursor =
|
|
1900
|
+
indicateReverse(p) {
|
|
1901
|
+
i.getCanvasContainer().style.cursor = p ? "crosshair" : "";
|
|
1902
1902
|
},
|
|
1903
|
-
setReverseMarker(
|
|
1904
|
-
!t || !e || (s ?
|
|
1903
|
+
setReverseMarker(p) {
|
|
1904
|
+
!t || !e || (s ? p ? s.setLngLat(p) : (s.remove(), s = void 0) : p && (e instanceof Function ? s = e(i) ?? void 0 : (s = (typeof e == "object" ? new t.Marker(e) : v()).setLngLat(p).addTo(i), s.getElement().classList.add("marker-reverse"))));
|
|
1905
1905
|
},
|
|
1906
|
-
setMarkers(
|
|
1907
|
-
for (const
|
|
1908
|
-
|
|
1909
|
-
if (u.length = 0,
|
|
1910
|
-
if (
|
|
1911
|
-
let
|
|
1912
|
-
if (
|
|
1913
|
-
const
|
|
1914
|
-
(
|
|
1906
|
+
setMarkers(p, x) {
|
|
1907
|
+
for (const E of u)
|
|
1908
|
+
E.remove();
|
|
1909
|
+
if (u.length = 0, d(void 0), !!t) {
|
|
1910
|
+
if (x) {
|
|
1911
|
+
let E = !1;
|
|
1912
|
+
if (x.geometry.type === "GeometryCollection") {
|
|
1913
|
+
const w = x.geometry.geometries.filter(
|
|
1914
|
+
(b) => b.type === "Polygon" || b.type === "MultiPolygon"
|
|
1915
1915
|
);
|
|
1916
|
-
t: if (
|
|
1917
|
-
const
|
|
1918
|
-
V(
|
|
1916
|
+
t: if (w.length > 0) {
|
|
1917
|
+
const b = Dt(
|
|
1918
|
+
V(w.map((_) => X(_)))
|
|
1919
1919
|
);
|
|
1920
|
-
if (!
|
|
1920
|
+
if (!b)
|
|
1921
1921
|
break t;
|
|
1922
1922
|
zt(
|
|
1923
1923
|
{
|
|
1924
|
-
...
|
|
1925
|
-
geometry:
|
|
1924
|
+
...x,
|
|
1925
|
+
geometry: b.geometry
|
|
1926
1926
|
},
|
|
1927
|
-
|
|
1928
|
-
),
|
|
1927
|
+
d
|
|
1928
|
+
), E = !0;
|
|
1929
1929
|
} else {
|
|
1930
|
-
const
|
|
1931
|
-
(
|
|
1930
|
+
const b = x.geometry.geometries.filter(
|
|
1931
|
+
(_) => _.type === "LineString" || _.type === "MultiLineString"
|
|
1932
1932
|
);
|
|
1933
|
-
|
|
1934
|
-
...
|
|
1935
|
-
geometry: { type: "GeometryCollection", geometries:
|
|
1936
|
-
}),
|
|
1933
|
+
b.length > 0 && (d({
|
|
1934
|
+
...x,
|
|
1935
|
+
geometry: { type: "GeometryCollection", geometries: b }
|
|
1936
|
+
}), E = !0);
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
|
-
if (!
|
|
1940
|
-
if (
|
|
1941
|
-
zt(
|
|
1942
|
-
else if (
|
|
1943
|
-
|
|
1939
|
+
if (!E) {
|
|
1940
|
+
if (x.geometry.type === "Polygon" || x.geometry.type === "MultiPolygon")
|
|
1941
|
+
zt(x, d);
|
|
1942
|
+
else if (x.geometry.type === "LineString" || x.geometry.type === "MultiLineString") {
|
|
1943
|
+
d(x);
|
|
1944
1944
|
return;
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
if (!
|
|
1947
|
+
if (!a && x.geometry.type !== "Point")
|
|
1948
1948
|
return;
|
|
1949
1949
|
if (e instanceof Function) {
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1950
|
+
const w = e(i, x);
|
|
1951
|
+
w && u.push(w);
|
|
1952
1952
|
} else e && u.push(
|
|
1953
|
-
typeof e == "object" ? new t.Marker(e) :
|
|
1953
|
+
typeof e == "object" ? new t.Marker(e) : v().setLngLat(x.center).addTo(i)
|
|
1954
1954
|
);
|
|
1955
1955
|
}
|
|
1956
1956
|
if (n)
|
|
1957
|
-
for (const
|
|
1958
|
-
if (
|
|
1957
|
+
for (const E of p ?? []) {
|
|
1958
|
+
if (E === x)
|
|
1959
1959
|
continue;
|
|
1960
|
-
let
|
|
1960
|
+
let w;
|
|
1961
1961
|
if (n instanceof Function) {
|
|
1962
|
-
if (
|
|
1962
|
+
if (w = n(i, E), !w)
|
|
1963
1963
|
continue;
|
|
1964
1964
|
} else
|
|
1965
|
-
|
|
1965
|
+
w = (typeof n == "object" ? new t.Marker(n) : v(!0)).setLngLat(E.center).setPopup(
|
|
1966
1966
|
new t.Popup({
|
|
1967
1967
|
offset: [1, -27],
|
|
1968
1968
|
closeButton: !1,
|
|
1969
1969
|
closeOnMove: !0,
|
|
1970
1970
|
className: "maptiler-gc-popup"
|
|
1971
1971
|
}).setText(
|
|
1972
|
-
|
|
1972
|
+
E.place_type[0] === "reverse" ? E.place_name : E.place_name.replace(/,.*/, "")
|
|
1973
1973
|
)
|
|
1974
1974
|
).addTo(i);
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
}),
|
|
1979
|
-
c == null || c({ type: "markerMouseEnter", id:
|
|
1980
|
-
}),
|
|
1981
|
-
c == null || c({ type: "markerMouseLeave", id:
|
|
1982
|
-
}), u.push(
|
|
1975
|
+
const b = w.getElement();
|
|
1976
|
+
b.addEventListener("click", (_) => {
|
|
1977
|
+
_.stopPropagation(), c == null || c({ type: "markerClick", id: E.id });
|
|
1978
|
+
}), b.addEventListener("mouseenter", () => {
|
|
1979
|
+
c == null || c({ type: "markerMouseEnter", id: E.id }), w.togglePopup();
|
|
1980
|
+
}), b.addEventListener("mouseleave", () => {
|
|
1981
|
+
c == null || c({ type: "markerMouseLeave", id: E.id }), w.togglePopup();
|
|
1982
|
+
}), u.push(w);
|
|
1983
1983
|
}
|
|
1984
1984
|
}
|
|
1985
1985
|
},
|
|
1986
|
-
setSelectedMarker(
|
|
1987
|
-
|
|
1986
|
+
setSelectedMarker(p) {
|
|
1987
|
+
g && g.getElement().classList.toggle("marker-selected", !1), g = p > -1 ? u[p] : void 0, g == null || g.getElement().classList.toggle("marker-selected", !0);
|
|
1988
1988
|
},
|
|
1989
1989
|
getCenterAndZoom() {
|
|
1990
|
-
const
|
|
1991
|
-
return [i.getZoom(),
|
|
1990
|
+
const p = i.getCenter();
|
|
1991
|
+
return [i.getZoom(), p.lng, p.lat];
|
|
1992
|
+
},
|
|
1993
|
+
setShowPolygonMarker(p) {
|
|
1994
|
+
a = p;
|
|
1992
1995
|
}
|
|
1993
1996
|
};
|
|
1994
1997
|
}
|