@maptiler/geocoding-control 2.0.0-rc.7 → 2.0.0-rc.8
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/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +1 -1
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +1 -1
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +817 -802
- 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 +16 -16
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +1 -1
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +1220 -1205
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +1196 -1181
- 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 +5 -5
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +2 -2
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.js +1405 -1391
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +4 -4
- package/react.js +860 -845
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/svelte/GeocodingControl.svelte +50 -25
- package/svelte/GeocodingControl.svelte.d.ts +1 -0
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +1 -1
- package/svelte/maplibregl-controller.d.ts +1 -1
- package/svelte/maplibregl-controller.js +1 -1
- package/svelte/openlayers-controller.d.ts +1 -1
- package/svelte/openlayers-controller.js +1 -1
- package/svelte/openlayers.js +2 -3
- package/svelte/types.d.ts +2 -1
- package/types.d.ts +2 -1
- package/vanilla.js +606 -591
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
|
@@ -13,7 +13,7 @@ export declare function createMapLibreGlMapController(map: Map, maplibregl?: Map
|
|
|
13
13
|
fitBounds(bbox: BBox, padding: number, maxZoom?: number): void;
|
|
14
14
|
indicateReverse(reverse: boolean): void;
|
|
15
15
|
setReverseMarker(coordinates?: Position): void;
|
|
16
|
-
|
|
16
|
+
setFeatures(markedFeatures: Feature[] | undefined, picked: Feature | undefined, showPolygonMarker: boolean): void;
|
|
17
17
|
setSelectedMarker(index: number): void;
|
|
18
18
|
getCenterAndZoom(): [number, number, number];
|
|
19
19
|
};
|
package/maplibregl-controller.js
CHANGED
|
@@ -451,8 +451,8 @@ function ge(i, t, e, n, r, o, f) {
|
|
|
451
451
|
let l, c, u, g, s, h, a, d, x, p, y, w, v, E, m, b, M, _;
|
|
452
452
|
const R = i - r, I = e - r, C = t - o, k = n - o;
|
|
453
453
|
E = R * k, h = S * R, a = h - (h - R), d = R - a, h = S * k, x = h - (h - k), p = k - x, m = d * p - (E - a * x - d * x - a * p), b = C * I, h = S * C, a = h - (h - C), d = C - a, h = S * I, x = h - (h - I), p = I - x, M = d * p - (b - a * x - d * x - a * p), y = m - M, s = m - y, U[0] = m - (y + s) + (s - M), w = E + y, s = w - E, v = E - (w - s) + (y - s), y = v - b, s = v - y, U[1] = v - (y + s) + (s - b), _ = w + y, s = _ - w, U[2] = w - (_ - s) + (y - s), U[3] = _;
|
|
454
|
-
let A = fe(4, U),
|
|
455
|
-
if (A >=
|
|
454
|
+
let A = fe(4, U), F = he * f;
|
|
455
|
+
if (A >= F || -A >= F || (s = i - R, l = i - (R + s) + (s - r), s = e - I, u = e - (I + s) + (s - r), s = t - C, c = t - (C + s) + (s - o), s = n - k, g = n - (k + s) + (s - o), l === 0 && c === 0 && u === 0 && g === 0) || (F = ae * f + ue * Math.abs(A), A += R * g + k * l - (C * u + I * c), A >= F || -A >= F)) return A;
|
|
456
456
|
E = l * k, h = S * l, a = h - (h - l), d = l - a, h = S * k, x = h - (h - k), p = k - x, m = d * p - (E - a * x - d * x - a * p), b = c * I, h = S * c, a = h - (h - c), d = c - a, h = S * I, x = h - (h - I), p = I - x, M = d * p - (b - a * x - d * x - a * p), y = m - M, s = m - y, P[0] = m - (y + s) + (s - M), w = E + y, s = w - E, v = E - (w - s) + (y - s), y = v - b, s = v - y, P[1] = v - (y + s) + (s - b), _ = w + y, s = _ - w, P[2] = w - (_ - s) + (y - s), P[3] = _;
|
|
457
457
|
const Jt = st(4, U, 4, P, mt);
|
|
458
458
|
E = R * g, h = S * R, a = h - (h - R), d = R - a, h = S * g, x = h - (h - g), p = g - x, m = d * p - (E - a * x - d * x - a * p), b = C * u, h = S * C, a = h - (h - C), d = C - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = m - M, s = m - y, P[0] = m - (y + s) + (s - M), w = E + y, s = w - E, v = E - (w - s) + (y - s), y = v - b, s = v - y, P[1] = v - (y + s) + (s - b), _ = w + y, s = _ - w, P[2] = w - (_ - s) + (y - s), P[3] = _;
|
|
@@ -465,7 +465,7 @@ function pe(i, t, e, n, r, o) {
|
|
|
465
465
|
const f = (t - o) * (e - r), l = (i - r) * (n - o), c = f - l, u = Math.abs(f + l);
|
|
466
466
|
return Math.abs(c) >= ce * u ? c : -ge(i, t, e, n, r, o, u);
|
|
467
467
|
}
|
|
468
|
-
const
|
|
468
|
+
const Q = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.ur.y, at = (i, t) => {
|
|
469
469
|
if (t.ur.x < i.ll.x || i.ur.x < t.ll.x || t.ur.y < i.ll.y || i.ur.y < t.ll.y) return null;
|
|
470
470
|
const e = i.ll.x < t.ll.x ? t.ll.x : i.ll.x, n = i.ur.x < t.ur.x ? i.ur.x : t.ur.x, r = i.ll.y < t.ll.y ? t.ll.y : i.ll.y, o = i.ur.y < t.ur.y ? i.ur.y : t.ur.y;
|
|
471
471
|
return {
|
|
@@ -778,7 +778,7 @@ 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 =
|
|
781
|
+
const o = this.leftSE.point, f = this.rightSE.point, l = t.leftSE.point, c = t.rightSE.point, u = Q(e, l) && this.comparePoint(l) === 0, g = Q(n, o) && t.comparePoint(o) === 0, s = Q(e, c) && this.comparePoint(c) === 0, h = Q(n, f) && t.comparePoint(f) === 0;
|
|
782
782
|
if (g && u)
|
|
783
783
|
return h && !s ? f : !h && s ? c : null;
|
|
784
784
|
if (g)
|
|
@@ -789,7 +789,7 @@ class z {
|
|
|
789
789
|
if (h) return f;
|
|
790
790
|
if (s) return c;
|
|
791
791
|
const a = Ee(o, this.vector(), l, t.vector());
|
|
792
|
-
return a === null || !
|
|
792
|
+
return a === null || !Q(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.
|
|
@@ -1292,13 +1292,13 @@ const $ = new Pe(), Me = function(i) {
|
|
|
1292
1292
|
e[n - 1] = arguments[n];
|
|
1293
1293
|
return $.run("difference", i, e);
|
|
1294
1294
|
};
|
|
1295
|
-
var
|
|
1295
|
+
var Ft = {
|
|
1296
1296
|
union: Me,
|
|
1297
1297
|
intersection: Le,
|
|
1298
1298
|
xor: Re,
|
|
1299
1299
|
difference: Ie
|
|
1300
1300
|
};
|
|
1301
|
-
function
|
|
1301
|
+
function Qt(i, t, e) {
|
|
1302
1302
|
if (i !== null)
|
|
1303
1303
|
for (var n, r, o, f, l, c, u, g = 0, s = 0, h, a = i.type, d = a === "FeatureCollection", x = a === "Feature", p = d ? i.features.length : 1, y = 0; y < p; y++) {
|
|
1304
1304
|
u = d ? i.features[y].geometry : x ? i.geometry : i, h = u ? u.type === "GeometryCollection" : !1, l = h ? u.geometries.length : 1;
|
|
@@ -1375,7 +1375,7 @@ function Ft(i, t, e) {
|
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "GeometryCollection":
|
|
1377
1377
|
for (n = 0; n < f.geometries.length; n++)
|
|
1378
|
-
if (
|
|
1378
|
+
if (Qt(f.geometries[n], t) === !1)
|
|
1379
1379
|
return !1;
|
|
1380
1380
|
break;
|
|
1381
1381
|
default:
|
|
@@ -1478,7 +1478,7 @@ function ke(i, t = {}) {
|
|
|
1478
1478
|
e.push(r.coordinates);
|
|
1479
1479
|
}), e.length < 2)
|
|
1480
1480
|
throw new Error("Must have at least 2 geometries");
|
|
1481
|
-
const n =
|
|
1481
|
+
const n = Ft.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
1484
|
var Dt = ke;
|
|
@@ -1585,11 +1585,11 @@ function Ye(i, t, e) {
|
|
|
1585
1585
|
i.$$.on_destroy ? i.$$.on_destroy.push(...o) : it(o), i.$$.on_mount = [];
|
|
1586
1586
|
}), r.forEach(pt);
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1588
|
+
function Fe(i, t) {
|
|
1589
1589
|
const e = i.$$;
|
|
1590
1590
|
e.fragment !== null && (Ue(e.after_update), it(e.on_destroy), e.fragment && e.fragment.d(t), e.on_destroy = e.fragment = null, e.ctx = []);
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1592
|
+
function Qe(i, t) {
|
|
1593
1593
|
i.$$.dirty[0] === -1 && (j.push(i), ze(), i.$$.dirty.fill(0)), i.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
1594
1594
|
}
|
|
1595
1595
|
function De(i, t, e, n, r, o, f = null, l = [-1]) {
|
|
@@ -1620,7 +1620,7 @@ function De(i, t, e, n, r, o, f = null, l = [-1]) {
|
|
|
1620
1620
|
let g = !1;
|
|
1621
1621
|
if (u.ctx = e ? e(i, t.props || {}, (s, h, ...a) => {
|
|
1622
1622
|
const d = a.length ? a[0] : h;
|
|
1623
|
-
return u.ctx && r(u.ctx[s], u.ctx[s] = d) && (!u.skip_bound && u.bound[s] && u.bound[s](d), g &&
|
|
1623
|
+
return u.ctx && r(u.ctx[s], u.ctx[s] = d) && (!u.skip_bound && u.bound[s] && u.bound[s](d), g && Qe(i, s)), h;
|
|
1624
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);
|
|
@@ -1652,7 +1652,7 @@ class Xe {
|
|
|
1652
1652
|
}
|
|
1653
1653
|
/** @returns {void} */
|
|
1654
1654
|
$destroy() {
|
|
1655
|
-
|
|
1655
|
+
Fe(this, 1), this.$destroy = W;
|
|
1656
1656
|
}
|
|
1657
1657
|
/**
|
|
1658
1658
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -1738,7 +1738,7 @@ function Ke(i, t = {}) {
|
|
|
1738
1738
|
if (i.bbox != null && t.recompute !== !0)
|
|
1739
1739
|
return i.bbox;
|
|
1740
1740
|
const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
1741
|
-
return
|
|
1741
|
+
return Qt(i, (n) => {
|
|
1742
1742
|
e[0] > n[0] && (e[0] = n[0]), e[1] > n[1] && (e[1] = n[1]), e[2] < n[0] && (e[2] = n[0]), e[3] < n[1] && (e[3] = n[1]);
|
|
1743
1743
|
}), e;
|
|
1744
1744
|
}
|
|
@@ -1749,7 +1749,7 @@ function He(i) {
|
|
|
1749
1749
|
t.push(r.coordinates);
|
|
1750
1750
|
}), t.length < 2)
|
|
1751
1751
|
throw new Error("Must have at least two features");
|
|
1752
|
-
const e = i.features[0].properties || {}, n =
|
|
1752
|
+
const e = i.features[0].properties || {}, n = Ft.difference(t[0], ...t.slice(1));
|
|
1753
1753
|
return n.length === 0 ? null : n.length === 1 ? yt(n[0], e) : jt(n, e);
|
|
1754
1754
|
}
|
|
1755
1755
|
var tn = He;
|
|
@@ -1903,7 +1903,7 @@ function on(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt) {
|
|
|
1903
1903
|
setReverseMarker(p) {
|
|
1904
1904
|
!t || !e || (g ? p ? g.setLngLat(p) : (g.remove(), g = void 0) : p && (e instanceof Function ? g = e(i) ?? void 0 : (g = (typeof e == "object" ? new t.Marker(e) : x()).setLngLat(p).addTo(i), g.getElement().classList.add("marker-reverse"))));
|
|
1905
1905
|
},
|
|
1906
|
-
|
|
1906
|
+
setFeatures(p, y, w) {
|
|
1907
1907
|
for (const v of c)
|
|
1908
1908
|
v.remove();
|
|
1909
1909
|
if (c.length = 0, a(void 0), !!t) {
|