@maptiler/geocoding-control 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MapLibreBasedGeocodingControl.d.ts +2616 -27
- package/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +97 -95
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +2 -2
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.d.ts +26 -4
- package/leaflet.js +906 -909
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +1 -1
- package/maplibregl-controller.js +480 -466
- 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 +2594 -9
- package/maplibregl.js +2094 -1969
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +2594 -9
- package/maptilersdk.js +2086 -1964
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.d.ts +1 -1
- package/openlayers-controller.js +62 -60
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +2 -2
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.d.ts +21 -0
- package/openlayers.js +754 -786
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +18 -18
- package/react.d.ts +4 -4
- package/react.js +619 -619
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/FeatureItem.svelte +1 -1
- package/svelte/FeatureItem.svelte.d.ts +2 -2
- package/svelte/GeocodingControl.svelte +31 -32
- package/svelte/GeocodingControl.svelte.d.ts +26 -13
- package/svelte/MapLibreBasedGeocodingControl.d.ts +2616 -27
- package/svelte/MapLibreBasedGeocodingControl.js +120 -17
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +4 -1
- package/svelte/leaflet.d.ts +26 -4
- package/svelte/leaflet.js +17 -19
- package/svelte/maplibregl-controller.d.ts +1 -1
- package/svelte/maplibregl-controller.js +45 -36
- package/svelte/maplibregl.d.ts +2594 -9
- package/svelte/maplibregl.js +11 -3
- package/svelte/maptilersdk.d.ts +2594 -9
- package/svelte/maptilersdk.js +11 -3
- package/svelte/openlayers-controller.d.ts +1 -1
- package/svelte/openlayers-controller.js +4 -1
- package/svelte/openlayers.d.ts +21 -0
- package/svelte/openlayers.js +30 -45
- package/svelte/react.d.ts +4 -4
- package/svelte/react.js +5 -5
- package/svelte/types.d.ts +84 -35
- package/svelte/vanilla.d.ts +14 -1
- package/svelte/vanilla.js +31 -8
- package/types.d.ts +84 -35
- package/vanilla.d.ts +14 -1
- package/vanilla.js +929 -901
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
package/leaflet-controller.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare function createLeafletMapController(map: L.Map, marker?: boolean
|
|
|
6
6
|
fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
|
|
7
7
|
indicateReverse(reverse: boolean): void;
|
|
8
8
|
setReverseMarker(coordinates?: Position): void;
|
|
9
|
-
|
|
9
|
+
setFeatures(markedFeatures: Feature[] | undefined, picked: Feature | undefined, showPolygonMarker: boolean): void;
|
|
10
10
|
setSelectedMarker(index: number): void;
|
|
11
11
|
getCenterAndZoom(): [number, number, number];
|
|
12
12
|
};
|
package/leaflet-controller.js
CHANGED
|
@@ -35,10 +35,10 @@ 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, u, l, c, f, p = 0, s = 0, a, h = r.type, g = h === "FeatureCollection",
|
|
39
|
-
f = g ? r.features[
|
|
38
|
+
for (var n, i, o, u, l, c, f, p = 0, s = 0, a, h = r.type, g = h === "FeatureCollection", d = h === "Feature", w = g ? r.features.length : 1, y = 0; y < w; y++) {
|
|
39
|
+
f = g ? r.features[y].geometry : d ? r.geometry : r, a = f ? f.type === "GeometryCollection" : !1, l = a ? f.geometries.length : 1;
|
|
40
40
|
for (var v = 0; v < l; v++) {
|
|
41
|
-
var
|
|
41
|
+
var x = 0, m = 0;
|
|
42
42
|
if (u = a ? f.geometries[v] : f, u !== null) {
|
|
43
43
|
c = u.coordinates;
|
|
44
44
|
var E = u.type;
|
|
@@ -49,12 +49,12 @@ function Yt(r, t, e) {
|
|
|
49
49
|
if (t(
|
|
50
50
|
c,
|
|
51
51
|
s,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
y,
|
|
53
|
+
x,
|
|
54
|
+
m
|
|
55
55
|
) === !1)
|
|
56
56
|
return !1;
|
|
57
|
-
s++,
|
|
57
|
+
s++, x++;
|
|
58
58
|
break;
|
|
59
59
|
case "LineString":
|
|
60
60
|
case "MultiPoint":
|
|
@@ -62,14 +62,14 @@ function Yt(r, t, e) {
|
|
|
62
62
|
if (t(
|
|
63
63
|
c[n],
|
|
64
64
|
s,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
y,
|
|
66
|
+
x,
|
|
67
|
+
m
|
|
68
68
|
) === !1)
|
|
69
69
|
return !1;
|
|
70
|
-
s++, E === "MultiPoint" &&
|
|
70
|
+
s++, E === "MultiPoint" && x++;
|
|
71
71
|
}
|
|
72
|
-
E === "LineString" &&
|
|
72
|
+
E === "LineString" && x++;
|
|
73
73
|
break;
|
|
74
74
|
case "Polygon":
|
|
75
75
|
case "MultiLineString":
|
|
@@ -78,34 +78,34 @@ function Yt(r, t, e) {
|
|
|
78
78
|
if (t(
|
|
79
79
|
c[n][i],
|
|
80
80
|
s,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
y,
|
|
82
|
+
x,
|
|
83
|
+
m
|
|
84
84
|
) === !1)
|
|
85
85
|
return !1;
|
|
86
86
|
s++;
|
|
87
87
|
}
|
|
88
|
-
E === "MultiLineString" &&
|
|
88
|
+
E === "MultiLineString" && x++, E === "Polygon" && m++;
|
|
89
89
|
}
|
|
90
|
-
E === "Polygon" &&
|
|
90
|
+
E === "Polygon" && x++;
|
|
91
91
|
break;
|
|
92
92
|
case "MultiPolygon":
|
|
93
93
|
for (n = 0; n < c.length; n++) {
|
|
94
|
-
for (
|
|
94
|
+
for (m = 0, i = 0; i < c[n].length; i++) {
|
|
95
95
|
for (o = 0; o < c[n][i].length - p; o++) {
|
|
96
96
|
if (t(
|
|
97
97
|
c[n][i][o],
|
|
98
98
|
s,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
y,
|
|
100
|
+
x,
|
|
101
|
+
m
|
|
102
102
|
) === !1)
|
|
103
103
|
return !1;
|
|
104
104
|
s++;
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
m++;
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
x++;
|
|
109
109
|
}
|
|
110
110
|
break;
|
|
111
111
|
case "GeometryCollection":
|
|
@@ -121,8 +121,8 @@ function Yt(r, t, e) {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
function vt(r, t) {
|
|
124
|
-
var e, n, i, o, u, l, c, f, p, s, a = 0, h = r.type === "FeatureCollection", g = r.type === "Feature",
|
|
125
|
-
for (e = 0; e <
|
|
124
|
+
var e, n, i, o, u, l, c, f, p, s, a = 0, h = r.type === "FeatureCollection", g = r.type === "Feature", d = h ? r.features.length : 1;
|
|
125
|
+
for (e = 0; e < d; e++) {
|
|
126
126
|
for (l = h ? r.features[e].geometry : g ? r.geometry : r, f = h ? r.features[e].properties : g ? r.properties : {}, p = h ? r.features[e].bbox : g ? r.bbox : void 0, s = h ? r.features[e].id : g ? r.id : void 0, c = l ? l.type === "GeometryCollection" : !1, u = c ? l.geometries.length : 1, i = 0; i < u; i++) {
|
|
127
127
|
if (o = c ? l.geometries[i] : l, o === null) {
|
|
128
128
|
if (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, u) {
|
|
696
|
-
let l, c, f, p, s, a, h, g,
|
|
696
|
+
let l, c, f, p, s, a, h, g, d, w, y, v, x, m, E, b, M, _;
|
|
697
697
|
const C = r - i, R = e - i, I = t - o, $ = n - o;
|
|
698
|
-
|
|
698
|
+
m = C * $, a = S * C, h = a - (a - C), g = C - h, a = S * $, d = a - (a - $), w = $ - d, E = g * w - (m - h * d - g * d - h * w), b = I * R, a = S * I, h = a - (a - I), g = I - h, a = S * R, d = a - (a - R), w = R - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, q[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, q[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, q[2] = v - (_ - s) + (y - s), q[3] = _;
|
|
699
699
|
let A = ve(4, q), D = we * u;
|
|
700
700
|
if (A >= D || -A >= D || (s = r - C, l = r - (C + s) + (s - i), s = e - R, f = e - (R + s) + (s - i), s = t - I, c = t - (I + s) + (s - o), s = n - $, p = n - ($ + s) + (s - o), l === 0 && c === 0 && f === 0 && p === 0) || (D = Ee * u + xe * Math.abs(A), A += C * p + $ * l - (I * f + R * c), A >= D || -A >= D)) return A;
|
|
701
|
-
|
|
701
|
+
m = l * $, a = S * l, h = a - (a - l), g = l - h, a = S * $, d = a - (a - $), w = $ - d, E = g * w - (m - h * d - g * d - h * w), b = c * R, a = S * c, h = a - (a - c), g = c - h, a = S * R, d = a - (a - R), w = R - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, P[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, P[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, P[2] = v - (_ - s) + (y - s), P[3] = _;
|
|
702
702
|
const ee = st(4, q, 4, P, _t);
|
|
703
|
-
|
|
703
|
+
m = C * p, a = S * C, h = a - (a - C), g = C - h, a = S * p, d = a - (a - p), w = p - d, E = g * w - (m - h * d - g * d - h * w), b = I * f, a = S * I, h = a - (a - I), g = I - h, a = S * f, d = a - (a - f), w = f - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, P[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, P[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, P[2] = v - (_ - s) + (y - s), P[3] = _;
|
|
704
704
|
const ne = st(ee, _t, 4, P, St);
|
|
705
|
-
|
|
705
|
+
m = l * p, a = S * l, h = a - (a - l), g = l - h, a = S * p, d = a - (a - p), w = p - d, E = g * w - (m - h * d - g * d - h * w), b = c * f, a = S * c, h = a - (a - c), g = c - h, a = S * f, d = a - (a - f), w = f - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, P[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, P[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, P[2] = v - (_ - s) + (y - s), P[3] = _;
|
|
706
706
|
const re = st(ne, St, 4, P, Pt);
|
|
707
707
|
return Pt[re - 1];
|
|
708
708
|
}
|
|
@@ -1277,22 +1277,22 @@ class nt {
|
|
|
1277
1277
|
for (; ; ) {
|
|
1278
1278
|
const a = l.getAvailableLinkedEvents();
|
|
1279
1279
|
if (a.length === 0) {
|
|
1280
|
-
const
|
|
1281
|
-
throw new Error(`Unable to complete output ring starting at [${
|
|
1280
|
+
const d = f[0].point, w = f[f.length - 1].point;
|
|
1281
|
+
throw new Error(`Unable to complete output ring starting at [${d.x}, ${d.y}]. Last matching segment found ends at [${w.x}, ${w.y}].`);
|
|
1282
1282
|
}
|
|
1283
1283
|
if (a.length === 1) {
|
|
1284
1284
|
c = a[0].otherSE;
|
|
1285
1285
|
break;
|
|
1286
1286
|
}
|
|
1287
1287
|
let h = null;
|
|
1288
|
-
for (let
|
|
1289
|
-
if (s[
|
|
1290
|
-
h =
|
|
1288
|
+
for (let d = 0, w = s.length; d < w; d++)
|
|
1289
|
+
if (s[d].point === l.point) {
|
|
1290
|
+
h = d;
|
|
1291
1291
|
break;
|
|
1292
1292
|
}
|
|
1293
1293
|
if (h !== null) {
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1294
|
+
const d = s.splice(h)[0], w = f.splice(d.index);
|
|
1295
|
+
w.unshift(w[0].otherSE), e.push(new nt(w.reverse()));
|
|
1296
1296
|
continue;
|
|
1297
1297
|
}
|
|
1298
1298
|
s.push({
|
|
@@ -1486,13 +1486,13 @@ class Oe {
|
|
|
1486
1486
|
if (k.type === "intersection")
|
|
1487
1487
|
for (let s = 0, a = i.length; s < a; s++) {
|
|
1488
1488
|
const h = i[s];
|
|
1489
|
-
for (let g = s + 1,
|
|
1489
|
+
for (let g = s + 1, d = i.length; g < d; g++)
|
|
1490
1490
|
if (pt(h.bbox, i[g].bbox) === null) return [];
|
|
1491
1491
|
}
|
|
1492
1492
|
const o = new wt(L.compare);
|
|
1493
1493
|
for (let s = 0, a = i.length; s < a; s++) {
|
|
1494
1494
|
const h = i[s].getSweepEvents();
|
|
1495
|
-
for (let g = 0,
|
|
1495
|
+
for (let g = 0, d = h.length; g < d; g++)
|
|
1496
1496
|
if (o.insert(h[g]), o.size > Ot)
|
|
1497
1497
|
throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
|
|
1498
1498
|
}
|
|
@@ -1510,8 +1510,8 @@ class Oe {
|
|
|
1510
1510
|
throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
|
|
1511
1511
|
const a = u.process(s);
|
|
1512
1512
|
for (let h = 0, g = a.length; h < g; h++) {
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1513
|
+
const d = a[h];
|
|
1514
|
+
d.consumedBy === void 0 && o.insert(d);
|
|
1515
1515
|
}
|
|
1516
1516
|
l = o.size, c = o.pop();
|
|
1517
1517
|
}
|
|
@@ -1892,11 +1892,11 @@ function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt) {
|
|
|
1892
1892
|
});
|
|
1893
1893
|
};
|
|
1894
1894
|
function a(h, g = !1) {
|
|
1895
|
-
const
|
|
1896
|
-
return new sn({ props: { displayIn: "leaflet" }, target:
|
|
1895
|
+
const d = document.createElement("div");
|
|
1896
|
+
return new sn({ props: { displayIn: "leaflet" }, target: d }), new T.Marker(h, {
|
|
1897
1897
|
interactive: g,
|
|
1898
1898
|
icon: new T.DivIcon({
|
|
1899
|
-
html:
|
|
1899
|
+
html: d,
|
|
1900
1900
|
className: "",
|
|
1901
1901
|
iconAnchor: [12, 26],
|
|
1902
1902
|
iconSize: [25, 30],
|
|
@@ -1911,7 +1911,7 @@ function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt) {
|
|
|
1911
1911
|
flyTo(h, g) {
|
|
1912
1912
|
r.flyTo([h[1], h[0]], g, { duration: 2, ...n });
|
|
1913
1913
|
},
|
|
1914
|
-
fitBounds(h, g,
|
|
1914
|
+
fitBounds(h, g, d) {
|
|
1915
1915
|
r.flyToBounds(
|
|
1916
1916
|
[
|
|
1917
1917
|
[h[1], h[0]],
|
|
@@ -1920,7 +1920,7 @@ function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt) {
|
|
|
1920
1920
|
{
|
|
1921
1921
|
padding: [g, g],
|
|
1922
1922
|
duration: 2,
|
|
1923
|
-
...
|
|
1923
|
+
...d ? { maxZoom: d } : {},
|
|
1924
1924
|
...i
|
|
1925
1925
|
}
|
|
1926
1926
|
);
|
|
@@ -1929,102 +1929,104 @@ function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt) {
|
|
|
1929
1929
|
r.getContainer().style.cursor = h ? "crosshair" : "";
|
|
1930
1930
|
},
|
|
1931
1931
|
setReverseMarker(h) {
|
|
1932
|
-
var
|
|
1932
|
+
var d;
|
|
1933
1933
|
if (!t)
|
|
1934
1934
|
return;
|
|
1935
1935
|
const g = h && [h[1], h[0]];
|
|
1936
|
-
f ? g ? f.setLatLng(g) : (f.remove(), f = void 0) : g && (t instanceof Function ? f = t(r) ?? void 0 : (f = (typeof t == "object" ? new T.Marker(g, t) : a(g)).addTo(r), (
|
|
1936
|
+
f ? g ? f.setLatLng(g) : (f.remove(), f = void 0) : g && (t instanceof Function ? f = t(r) ?? void 0 : (f = (typeof t == "object" ? new T.Marker(g, t) : a(g)).addTo(r), (d = f.getElement()) == null || d.classList.add("marker-reverse")));
|
|
1937
1937
|
},
|
|
1938
|
-
|
|
1939
|
-
function y
|
|
1940
|
-
p.clearLayers(),
|
|
1938
|
+
setFeatures(h, g, d) {
|
|
1939
|
+
function w(y) {
|
|
1940
|
+
p.clearLayers(), y && p.addData(y);
|
|
1941
1941
|
}
|
|
1942
|
-
for (const
|
|
1943
|
-
|
|
1944
|
-
if (l.length = 0,
|
|
1945
|
-
let
|
|
1942
|
+
for (const y of l)
|
|
1943
|
+
y.remove();
|
|
1944
|
+
if (l.length = 0, w(), g) {
|
|
1945
|
+
let y = !1;
|
|
1946
1946
|
if (g.geometry.type === "GeometryCollection") {
|
|
1947
|
-
const
|
|
1948
|
-
(
|
|
1947
|
+
const v = g.geometry.geometries.filter(
|
|
1948
|
+
(x) => x.type === "Polygon" || x.type === "MultiPolygon"
|
|
1949
1949
|
);
|
|
1950
|
-
t: if (
|
|
1951
|
-
const
|
|
1952
|
-
Z(
|
|
1950
|
+
t: if (v.length > 0) {
|
|
1951
|
+
const x = Jt(
|
|
1952
|
+
Z(v.map((m) => V(m)))
|
|
1953
1953
|
);
|
|
1954
|
-
if (!
|
|
1954
|
+
if (!x)
|
|
1955
1955
|
break t;
|
|
1956
1956
|
Ft(
|
|
1957
1957
|
{
|
|
1958
1958
|
...g,
|
|
1959
|
-
geometry:
|
|
1959
|
+
geometry: x.geometry
|
|
1960
1960
|
},
|
|
1961
|
-
|
|
1962
|
-
),
|
|
1961
|
+
w
|
|
1962
|
+
), y = !0;
|
|
1963
1963
|
} else {
|
|
1964
|
-
const
|
|
1964
|
+
const x = g.geometry.geometries.filter(
|
|
1965
1965
|
(m) => m.type === "LineString" || m.type === "MultiLineString"
|
|
1966
1966
|
);
|
|
1967
|
-
|
|
1967
|
+
x.length > 0 && (w({
|
|
1968
1968
|
...g,
|
|
1969
|
-
geometry: { type: "GeometryCollection", geometries:
|
|
1970
|
-
}),
|
|
1969
|
+
geometry: { type: "GeometryCollection", geometries: x }
|
|
1970
|
+
}), y = !0);
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
if (!
|
|
1973
|
+
if (!y) {
|
|
1974
1974
|
if (g.geometry.type === "Polygon" || g.geometry.type === "MultiPolygon")
|
|
1975
|
-
Ft(g, (
|
|
1976
|
-
if (!
|
|
1975
|
+
Ft(g, (v) => {
|
|
1976
|
+
if (!v)
|
|
1977
1977
|
return;
|
|
1978
|
-
const
|
|
1979
|
-
m[0] -
|
|
1978
|
+
const x = [...v.features], m = gt(ut(g)), E = m[2] - m[0];
|
|
1979
|
+
m[0] - E / 4 < -180 && x.push(...qt(v, -360).features), m[2] + E / 4 > 180 && x.push(...qt(v, 360).features), w(Z(x));
|
|
1980
1980
|
});
|
|
1981
1981
|
else if (g.geometry.type === "LineString" || g.geometry.type === "MultiLineString") {
|
|
1982
|
-
|
|
1982
|
+
w(g);
|
|
1983
1983
|
return;
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
|
+
if (!d && g.geometry.type !== "Point")
|
|
1987
|
+
return;
|
|
1986
1988
|
if (t instanceof Function) {
|
|
1987
|
-
const
|
|
1988
|
-
|
|
1989
|
+
const v = t(r, g);
|
|
1990
|
+
v && l.push(v.addTo(r));
|
|
1989
1991
|
} else if (t) {
|
|
1990
|
-
const
|
|
1992
|
+
const v = [g.center[1], g.center[0]];
|
|
1991
1993
|
l.push(
|
|
1992
|
-
typeof t == "object" ? new T.Marker(
|
|
1994
|
+
typeof t == "object" ? new T.Marker(v, t) : a(v).addTo(r)
|
|
1993
1995
|
);
|
|
1994
1996
|
}
|
|
1995
1997
|
}
|
|
1996
1998
|
if (e)
|
|
1997
|
-
for (const
|
|
1998
|
-
if (
|
|
1999
|
+
for (const y of h ?? []) {
|
|
2000
|
+
if (y === g)
|
|
1999
2001
|
continue;
|
|
2000
|
-
const
|
|
2001
|
-
|
|
2002
|
-
|
|
2002
|
+
const v = [
|
|
2003
|
+
y.center[1],
|
|
2004
|
+
y.center[0]
|
|
2003
2005
|
];
|
|
2004
|
-
let
|
|
2006
|
+
let x;
|
|
2005
2007
|
if (e instanceof Function) {
|
|
2006
|
-
if (
|
|
2008
|
+
if (x = e(r, y), !x)
|
|
2007
2009
|
continue;
|
|
2008
2010
|
} else
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
+
x = (typeof e == "object" ? new T.Marker(v, e) : a(v, !0)).addTo(r).bindTooltip(
|
|
2012
|
+
y.place_type[0] === "reverse" ? y.place_name : y.place_name.replace(/,.*/, ""),
|
|
2011
2013
|
{
|
|
2012
2014
|
direction: "top"
|
|
2013
2015
|
}
|
|
2014
2016
|
);
|
|
2015
|
-
const m =
|
|
2016
|
-
m && (m.addEventListener("click", (
|
|
2017
|
-
|
|
2017
|
+
const m = x.getElement();
|
|
2018
|
+
m && (m.addEventListener("click", (E) => {
|
|
2019
|
+
E.stopPropagation(), u == null || u({ type: "markerClick", id: y.id });
|
|
2018
2020
|
}), m.addEventListener("mouseenter", () => {
|
|
2019
|
-
u == null || u({ type: "markerMouseEnter", id:
|
|
2021
|
+
u == null || u({ type: "markerMouseEnter", id: y.id });
|
|
2020
2022
|
}), m.addEventListener("mouseleave", () => {
|
|
2021
|
-
u == null || u({ type: "markerMouseLeave", id:
|
|
2022
|
-
}), m.classList.toggle("marker-fuzzy", !!
|
|
2023
|
+
u == null || u({ type: "markerMouseLeave", id: y.id });
|
|
2024
|
+
}), m.classList.toggle("marker-fuzzy", !!y.matching_text)), l.push(x);
|
|
2023
2025
|
}
|
|
2024
2026
|
},
|
|
2025
2027
|
setSelectedMarker(h) {
|
|
2026
|
-
var g,
|
|
2027
|
-
c && ((g = c.getElement()) == null || g.classList.toggle("marker-selected", !1)), c = h > -1 ? l[h] : void 0, (
|
|
2028
|
+
var g, d;
|
|
2029
|
+
c && ((g = c.getElement()) == null || g.classList.toggle("marker-selected", !1)), c = h > -1 ? l[h] : void 0, (d = c == null ? void 0 : c.getElement()) == null || d.classList.toggle("marker-selected", !0);
|
|
2028
2030
|
},
|
|
2029
2031
|
getCenterAndZoom() {
|
|
2030
2032
|
const h = r.getCenter();
|