@maptiler/geocoding-control 2.0.0 → 2.1.0-rc1
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 +3027 -27
- package/icons/10pin.svg +4 -1
- package/icons/9pin.svg +4 -1
- package/icons/alcohol.svg +1 -1
- package/icons/alpine_hut.svg +1 -1
- package/icons/apartment.svg +4 -1
- package/icons/area.svg +1 -5
- package/icons/artwork.svg +4 -1
- package/icons/beauty.svg +14 -1
- package/icons/bicycle_repair_station.svg +18 -1
- package/icons/biergarten.svg +4 -1
- package/icons/books.svg +14 -1
- package/icons/bowl.svg +4 -1
- package/icons/bowling_alley.svg +4 -1
- package/icons/bus_station.svg +1 -1
- package/icons/camping.svg +1 -1
- package/icons/car_repair.svg +14 -1
- package/icons/car_wash.svg +19 -1
- package/icons/cave_entrance.svg +15 -1
- package/icons/chalet.svg +1 -1
- package/icons/chemist.svg +14 -1
- package/icons/church.svg +4 -1
- package/icons/community_centre.svg +20 -1
- package/icons/firestation.svg +4 -1
- package/icons/guest_house.svg +29 -8
- package/icons/hotel.svg +1 -1
- package/icons/housenumber.svg +19 -14
- package/icons/hut.svg +1 -4
- package/icons/medical_supply.svg +20 -1
- package/icons/memorial.svg +14 -1
- package/icons/motel.svg +19 -1
- package/icons/post.svg +1 -1
- package/icons/post_office.svg +1 -1
- package/icons/postal_code.svg +1 -23
- package/icons/public_bookcase.svg +14 -1
- package/icons/public_building.svg +4 -1
- package/icons/shintoist.svg +1 -1
- package/icons/street.svg +11 -14
- package/icons/vehicle_inspection.svg +18 -1
- package/icons/wilderness_hut.svg +1 -1
- package/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +113 -110
- 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 +58 -5
- package/leaflet.js +1438 -1265
- 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 +483 -469
- 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 +2499 -13
- package/maplibregl.js +2435 -2139
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +2499 -13
- package/maptilersdk.js +2432 -2139
- 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 +66 -63
- 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 +53 -1
- package/openlayers.js +2046 -1902
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +28 -28
- package/react.d.ts +31 -5
- package/react.js +1252 -1096
- 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 +60 -13
- package/svelte/FeatureItem.svelte.d.ts +4 -4
- package/svelte/GeocodingControl.svelte +166 -98
- package/svelte/GeocodingControl.svelte.d.ts +36 -16
- package/svelte/MapLibreBasedGeocodingControl.d.ts +3027 -27
- package/svelte/MapLibreBasedGeocodingControl.js +154 -21
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +6 -3
- package/svelte/leaflet.d.ts +58 -5
- package/svelte/leaflet.js +52 -21
- package/svelte/maplibregl-controller.d.ts +1 -1
- package/svelte/maplibregl-controller.js +47 -38
- package/svelte/maplibregl.d.ts +2499 -13
- package/svelte/maplibregl.js +11 -3
- package/svelte/maptilersdk.d.ts +2499 -13
- package/svelte/maptilersdk.js +11 -3
- package/svelte/openlayers-controller.d.ts +1 -1
- package/svelte/openlayers-controller.js +7 -4
- package/svelte/openlayers.d.ts +53 -1
- package/svelte/openlayers.js +66 -48
- package/svelte/react.d.ts +31 -5
- package/svelte/react.js +21 -9
- package/svelte/types.d.ts +106 -35
- package/svelte/vanilla.d.ts +46 -2
- package/svelte/vanilla.js +66 -10
- package/types.d.ts +106 -35
- package/vanilla.d.ts +46 -2
- package/vanilla.js +1260 -1057
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/icons/aerodrome.12.svg +0 -1
- package/icons/bus_stop.12.svg +0 -1
- package/icons/elevator.12.svg +0 -1
- /package/icons/{helipad.16.svg → helipad.svg} +0 -0
- /package/icons/{traffic_light.13.svg → traffic_light.svg} +0 -0
|
@@ -9,7 +9,7 @@ export declare function createOpenLayersMapController(map: Map, flyToOptions?: A
|
|
|
9
9
|
fitBounds(bbox: BBox, padding: number, maxZoom: number): void;
|
|
10
10
|
indicateReverse(reverse: boolean): void;
|
|
11
11
|
setReverseMarker(coordinates?: Position): void;
|
|
12
|
-
|
|
12
|
+
setFeatures(markedFeatures: FeatureType[] | undefined, picked: FeatureType | undefined, showPolygonMarker: boolean): void;
|
|
13
13
|
setSelectedMarker(index: number): void;
|
|
14
14
|
getCenterAndZoom(): [number, x: number, y: number] | undefined;
|
|
15
15
|
};
|
package/openlayers-controller.js
CHANGED
|
@@ -43,9 +43,9 @@ function Ot(o, t, e) {
|
|
|
43
43
|
if (o !== null)
|
|
44
44
|
for (var n, r, i, u, l, c, f, a = 0, s = 0, h, g = o.type, y = g === "FeatureCollection", p = g === "Feature", d = y ? o.features.length : 1, x = 0; x < d; x++) {
|
|
45
45
|
f = y ? o.features[x].geometry : p ? o.geometry : o, h = f ? f.type === "GeometryCollection" : !1, l = h ? f.geometries.length : 1;
|
|
46
|
-
for (var
|
|
47
|
-
var
|
|
48
|
-
if (u = h ? f.geometries[
|
|
46
|
+
for (var v = 0; v < l; v++) {
|
|
47
|
+
var w = 0, m = 0;
|
|
48
|
+
if (u = h ? f.geometries[v] : f, u !== null) {
|
|
49
49
|
c = u.coordinates;
|
|
50
50
|
var E = u.type;
|
|
51
51
|
switch (a = 0, E) {
|
|
@@ -56,11 +56,11 @@ function Ot(o, t, e) {
|
|
|
56
56
|
c,
|
|
57
57
|
s,
|
|
58
58
|
x,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
w,
|
|
60
|
+
m
|
|
61
61
|
) === !1)
|
|
62
62
|
return !1;
|
|
63
|
-
s++,
|
|
63
|
+
s++, w++;
|
|
64
64
|
break;
|
|
65
65
|
case "LineString":
|
|
66
66
|
case "MultiPoint":
|
|
@@ -69,13 +69,13 @@ function Ot(o, t, e) {
|
|
|
69
69
|
c[n],
|
|
70
70
|
s,
|
|
71
71
|
x,
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
w,
|
|
73
|
+
m
|
|
74
74
|
) === !1)
|
|
75
75
|
return !1;
|
|
76
|
-
s++, E === "MultiPoint" &&
|
|
76
|
+
s++, E === "MultiPoint" && w++;
|
|
77
77
|
}
|
|
78
|
-
E === "LineString" &&
|
|
78
|
+
E === "LineString" && w++;
|
|
79
79
|
break;
|
|
80
80
|
case "Polygon":
|
|
81
81
|
case "MultiLineString":
|
|
@@ -85,33 +85,33 @@ function Ot(o, t, e) {
|
|
|
85
85
|
c[n][r],
|
|
86
86
|
s,
|
|
87
87
|
x,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
w,
|
|
89
|
+
m
|
|
90
90
|
) === !1)
|
|
91
91
|
return !1;
|
|
92
92
|
s++;
|
|
93
93
|
}
|
|
94
|
-
E === "MultiLineString" &&
|
|
94
|
+
E === "MultiLineString" && w++, E === "Polygon" && m++;
|
|
95
95
|
}
|
|
96
|
-
E === "Polygon" &&
|
|
96
|
+
E === "Polygon" && w++;
|
|
97
97
|
break;
|
|
98
98
|
case "MultiPolygon":
|
|
99
99
|
for (n = 0; n < c.length; n++) {
|
|
100
|
-
for (
|
|
100
|
+
for (m = 0, r = 0; r < c[n].length; r++) {
|
|
101
101
|
for (i = 0; i < c[n][r].length - a; i++) {
|
|
102
102
|
if (t(
|
|
103
103
|
c[n][r][i],
|
|
104
104
|
s,
|
|
105
105
|
x,
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
w,
|
|
107
|
+
m
|
|
108
108
|
) === !1)
|
|
109
109
|
return !1;
|
|
110
110
|
s++;
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
m++;
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
w++;
|
|
115
115
|
}
|
|
116
116
|
break;
|
|
117
117
|
case "GeometryCollection":
|
|
@@ -638,16 +638,16 @@ function Y(o) {
|
|
|
638
638
|
}
|
|
639
639
|
const re = (3 + 16 * F) * F, ie = (2 + 12 * F) * F, oe = (9 + 64 * F) * F * F, T = Y(4), dt = Y(8), vt = Y(12), mt = Y(16), P = Y(4);
|
|
640
640
|
function se(o, t, e, n, r, i, u) {
|
|
641
|
-
let l, c, f, a, s, h, g, y, p, d, x,
|
|
641
|
+
let l, c, f, a, s, h, g, y, p, d, x, v, w, m, E, b, M, S;
|
|
642
642
|
const L = o - r, I = e - r, k = t - i, C = n - i;
|
|
643
|
-
|
|
643
|
+
m = L * C, h = _ * L, g = h - (h - L), y = L - g, h = _ * C, p = h - (h - C), d = C - p, E = y * d - (m - g * p - y * p - g * d), b = k * I, h = _ * k, g = h - (h - k), y = k - g, h = _ * I, p = h - (h - I), d = I - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, T[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, T[1] = w - (x + s) + (s - b), S = v + x, s = S - v, T[2] = v - (S - s) + (x - s), T[3] = S;
|
|
644
644
|
let O = ne(4, T), q = ie * u;
|
|
645
645
|
if (O >= q || -O >= q || (s = o - L, l = o - (L + s) + (s - r), s = e - I, f = e - (I + s) + (s - r), s = t - k, c = t - (k + s) + (s - i), s = n - C, a = n - (C + s) + (s - i), l === 0 && c === 0 && f === 0 && a === 0) || (q = oe * u + ee * Math.abs(O), O += L * a + C * l - (k * f + I * c), O >= q || -O >= q)) return O;
|
|
646
|
-
|
|
646
|
+
m = l * C, h = _ * l, g = h - (h - l), y = l - g, h = _ * C, p = h - (h - C), d = C - p, E = y * d - (m - g * p - y * p - g * d), b = c * I, h = _ * c, g = h - (h - c), y = c - g, h = _ * I, p = h - (h - I), d = I - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, P[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, P[1] = w - (x + s) + (s - b), S = v + x, s = S - v, P[2] = v - (S - s) + (x - s), P[3] = S;
|
|
647
647
|
const Gt = K(4, T, 4, P, dt);
|
|
648
|
-
|
|
648
|
+
m = L * a, h = _ * L, g = h - (h - L), y = L - g, h = _ * a, p = h - (h - a), d = a - p, E = y * d - (m - g * p - y * p - g * d), b = k * f, h = _ * k, g = h - (h - k), y = k - g, h = _ * f, p = h - (h - f), d = f - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, P[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, P[1] = w - (x + s) + (s - b), S = v + x, s = S - v, P[2] = v - (S - s) + (x - s), P[3] = S;
|
|
649
649
|
const Bt = K(Gt, dt, 4, P, vt);
|
|
650
|
-
|
|
650
|
+
m = l * a, h = _ * l, g = h - (h - l), y = l - g, h = _ * a, p = h - (h - a), d = a - p, E = y * d - (m - g * p - y * p - g * d), b = c * f, h = _ * c, g = h - (h - c), y = c - g, h = _ * f, p = h - (h - f), d = f - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, P[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, P[1] = w - (x + s) + (s - b), S = v + x, s = S - v, P[2] = v - (S - s) + (x - s), P[3] = S;
|
|
651
651
|
const zt = K(Bt, vt, 4, P, mt);
|
|
652
652
|
return mt[zt - 1];
|
|
653
653
|
}
|
|
@@ -1656,83 +1656,86 @@ function Te(o, t = {}, e = {}, n = Ie) {
|
|
|
1656
1656
|
new Z(V(y, s()))
|
|
1657
1657
|
), l.setProperties({ isReverse: !0 }), a.addFeature(l));
|
|
1658
1658
|
},
|
|
1659
|
-
|
|
1660
|
-
function
|
|
1661
|
-
var
|
|
1662
|
-
if (
|
|
1663
|
-
for (const
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1659
|
+
setFeatures(y, p, d) {
|
|
1660
|
+
function x(v) {
|
|
1661
|
+
var w;
|
|
1662
|
+
if (v)
|
|
1663
|
+
for (const m of v.features) {
|
|
1664
|
+
const E = m.geometry.type === "Polygon" ? new ut(m.geometry.coordinates) : m.geometry.type === "MultiPolygon" ? new ft(m.geometry.coordinates) : null;
|
|
1665
|
+
E && a.addFeature(
|
|
1666
1666
|
new N({
|
|
1667
|
-
isMask: !!((
|
|
1668
|
-
geometry: h(
|
|
1667
|
+
isMask: !!((w = m.properties) != null && w.isMask),
|
|
1668
|
+
geometry: h(E)
|
|
1669
1669
|
})
|
|
1670
1670
|
);
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1673
|
+
a.clear(), l && a.addFeature(l);
|
|
1674
|
+
t: if (p) {
|
|
1675
|
+
let v = !1;
|
|
1675
1676
|
if (p.geometry.type === "GeometryCollection") {
|
|
1676
|
-
const
|
|
1677
|
-
(
|
|
1678
|
-
).filter((
|
|
1679
|
-
if (
|
|
1677
|
+
const w = p.geometry.geometries.map(
|
|
1678
|
+
(m) => m.type === "Polygon" ? new ut(m.coordinates) : m.type === "MultiPolygon" ? new ft(m.coordinates) : null
|
|
1679
|
+
).filter((m) => !!m);
|
|
1680
|
+
if (w.length > 0)
|
|
1680
1681
|
a.addFeature(
|
|
1681
|
-
new N(h(new $t(
|
|
1682
|
-
),
|
|
1682
|
+
new N(h(new $t(w)))
|
|
1683
|
+
), v = !0;
|
|
1683
1684
|
else
|
|
1684
|
-
for (const
|
|
1685
|
-
|
|
1685
|
+
for (const m of p.geometry.geometries)
|
|
1686
|
+
m.type === "LineString" ? (a.addFeature(
|
|
1686
1687
|
new N(
|
|
1687
|
-
h(new ct(
|
|
1688
|
+
h(new ct(m.coordinates))
|
|
1688
1689
|
)
|
|
1689
|
-
),
|
|
1690
|
+
), v = !0) : m.type === "MultiLineString" && a.addFeature(
|
|
1690
1691
|
new N(
|
|
1691
|
-
h(new ht(
|
|
1692
|
+
h(new ht(m.coordinates))
|
|
1692
1693
|
)
|
|
1693
|
-
),
|
|
1694
|
+
), v = !0;
|
|
1694
1695
|
}
|
|
1695
|
-
if (!
|
|
1696
|
+
if (!v) {
|
|
1696
1697
|
if (p.geometry.type === "Polygon")
|
|
1697
|
-
kt(p,
|
|
1698
|
+
kt(p, x);
|
|
1698
1699
|
else if (p.geometry.type === "MultiPolygon")
|
|
1699
|
-
kt(p,
|
|
1700
|
+
kt(p, x);
|
|
1700
1701
|
else if (p.geometry.type === "LineString") {
|
|
1701
1702
|
a.addFeature(
|
|
1702
1703
|
new N(
|
|
1703
1704
|
h(new ct(p.geometry.coordinates))
|
|
1704
1705
|
)
|
|
1705
1706
|
);
|
|
1706
|
-
|
|
1707
|
+
break t;
|
|
1707
1708
|
} else if (p.geometry.type === "MultiLineString") {
|
|
1708
1709
|
a.addFeature(
|
|
1709
1710
|
new N(
|
|
1710
1711
|
h(new ht(p.geometry.coordinates))
|
|
1711
1712
|
)
|
|
1712
1713
|
);
|
|
1713
|
-
|
|
1714
|
+
break t;
|
|
1714
1715
|
}
|
|
1715
1716
|
}
|
|
1717
|
+
if (!d && p.geometry.type !== "Point")
|
|
1718
|
+
break t;
|
|
1716
1719
|
a.addFeature(new N(h(new Z(p.center))));
|
|
1717
1720
|
}
|
|
1718
|
-
for (const
|
|
1719
|
-
if (
|
|
1721
|
+
for (const v of y ?? []) {
|
|
1722
|
+
if (v === p)
|
|
1720
1723
|
continue;
|
|
1721
|
-
const
|
|
1722
|
-
new Z(V(
|
|
1724
|
+
const w = new N(
|
|
1725
|
+
new Z(V(v.center, s()))
|
|
1723
1726
|
);
|
|
1724
|
-
|
|
1725
|
-
fuzzy: !!
|
|
1726
|
-
tooltip:
|
|
1727
|
-
}), a.addFeature(
|
|
1727
|
+
w.setId(v.id), w.setProperties({
|
|
1728
|
+
fuzzy: !!v.matching_text,
|
|
1729
|
+
tooltip: v.place_type[0] === "reverse" ? v.place_name : v.place_name.replace(/,.*/, "")
|
|
1730
|
+
}), a.addFeature(w);
|
|
1728
1731
|
}
|
|
1729
1732
|
},
|
|
1730
1733
|
setSelectedMarker(y) {
|
|
1731
|
-
var x,
|
|
1734
|
+
var x, v, w;
|
|
1732
1735
|
const p = a.getFeatures(), d = (x = p[0]) != null && x.getProperties().isReverse ? 1 : 0;
|
|
1733
|
-
r > -1 && ((
|
|
1736
|
+
r > -1 && ((v = p[r + d]) == null || v.setProperties({
|
|
1734
1737
|
isSelected: !1
|
|
1735
|
-
})), y > -1 && ((
|
|
1738
|
+
})), y > -1 && ((w = p[y + d]) == null || w.setProperties({
|
|
1736
1739
|
isSelected: !0
|
|
1737
1740
|
})), r = y;
|
|
1738
1741
|
},
|