@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.
Files changed (118) hide show
  1. package/MapLibreBasedGeocodingControl.d.ts +3027 -27
  2. package/icons/10pin.svg +4 -1
  3. package/icons/9pin.svg +4 -1
  4. package/icons/alcohol.svg +1 -1
  5. package/icons/alpine_hut.svg +1 -1
  6. package/icons/apartment.svg +4 -1
  7. package/icons/area.svg +1 -5
  8. package/icons/artwork.svg +4 -1
  9. package/icons/beauty.svg +14 -1
  10. package/icons/bicycle_repair_station.svg +18 -1
  11. package/icons/biergarten.svg +4 -1
  12. package/icons/books.svg +14 -1
  13. package/icons/bowl.svg +4 -1
  14. package/icons/bowling_alley.svg +4 -1
  15. package/icons/bus_station.svg +1 -1
  16. package/icons/camping.svg +1 -1
  17. package/icons/car_repair.svg +14 -1
  18. package/icons/car_wash.svg +19 -1
  19. package/icons/cave_entrance.svg +15 -1
  20. package/icons/chalet.svg +1 -1
  21. package/icons/chemist.svg +14 -1
  22. package/icons/church.svg +4 -1
  23. package/icons/community_centre.svg +20 -1
  24. package/icons/firestation.svg +4 -1
  25. package/icons/guest_house.svg +29 -8
  26. package/icons/hotel.svg +1 -1
  27. package/icons/housenumber.svg +19 -14
  28. package/icons/hut.svg +1 -4
  29. package/icons/medical_supply.svg +20 -1
  30. package/icons/memorial.svg +14 -1
  31. package/icons/motel.svg +19 -1
  32. package/icons/post.svg +1 -1
  33. package/icons/post_office.svg +1 -1
  34. package/icons/postal_code.svg +1 -23
  35. package/icons/public_bookcase.svg +14 -1
  36. package/icons/public_building.svg +4 -1
  37. package/icons/shintoist.svg +1 -1
  38. package/icons/street.svg +11 -14
  39. package/icons/vehicle_inspection.svg +18 -1
  40. package/icons/wilderness_hut.svg +1 -1
  41. package/leaflet-controller.d.ts +1 -1
  42. package/leaflet-controller.js +113 -110
  43. package/leaflet-controller.js.map +1 -1
  44. package/leaflet-controller.umd.js +2 -2
  45. package/leaflet-controller.umd.js.map +1 -1
  46. package/leaflet.d.ts +58 -5
  47. package/leaflet.js +1438 -1265
  48. package/leaflet.js.map +1 -1
  49. package/leaflet.umd.js +3 -3
  50. package/leaflet.umd.js.map +1 -1
  51. package/maplibregl-controller.d.ts +1 -1
  52. package/maplibregl-controller.js +483 -469
  53. package/maplibregl-controller.js.map +1 -1
  54. package/maplibregl-controller.umd.js +3 -3
  55. package/maplibregl-controller.umd.js.map +1 -1
  56. package/maplibregl.d.ts +2499 -13
  57. package/maplibregl.js +2435 -2139
  58. package/maplibregl.js.map +1 -1
  59. package/maplibregl.umd.js +3 -3
  60. package/maplibregl.umd.js.map +1 -1
  61. package/maptilersdk.d.ts +2499 -13
  62. package/maptilersdk.js +2432 -2139
  63. package/maptilersdk.js.map +1 -1
  64. package/maptilersdk.umd.js +3 -3
  65. package/maptilersdk.umd.js.map +1 -1
  66. package/openlayers-controller.d.ts +1 -1
  67. package/openlayers-controller.js +66 -63
  68. package/openlayers-controller.js.map +1 -1
  69. package/openlayers-controller.umd.js +2 -2
  70. package/openlayers-controller.umd.js.map +1 -1
  71. package/openlayers.d.ts +53 -1
  72. package/openlayers.js +2046 -1902
  73. package/openlayers.js.map +1 -1
  74. package/openlayers.umd.js +3 -3
  75. package/openlayers.umd.js.map +1 -1
  76. package/package.json +28 -28
  77. package/react.d.ts +31 -5
  78. package/react.js +1252 -1096
  79. package/react.js.map +1 -1
  80. package/react.umd.js +1 -1
  81. package/react.umd.js.map +1 -1
  82. package/style.css +1 -1
  83. package/svelte/FeatureItem.svelte +60 -13
  84. package/svelte/FeatureItem.svelte.d.ts +4 -4
  85. package/svelte/GeocodingControl.svelte +166 -98
  86. package/svelte/GeocodingControl.svelte.d.ts +36 -16
  87. package/svelte/MapLibreBasedGeocodingControl.d.ts +3027 -27
  88. package/svelte/MapLibreBasedGeocodingControl.js +154 -21
  89. package/svelte/leaflet-controller.d.ts +1 -1
  90. package/svelte/leaflet-controller.js +6 -3
  91. package/svelte/leaflet.d.ts +58 -5
  92. package/svelte/leaflet.js +52 -21
  93. package/svelte/maplibregl-controller.d.ts +1 -1
  94. package/svelte/maplibregl-controller.js +47 -38
  95. package/svelte/maplibregl.d.ts +2499 -13
  96. package/svelte/maplibregl.js +11 -3
  97. package/svelte/maptilersdk.d.ts +2499 -13
  98. package/svelte/maptilersdk.js +11 -3
  99. package/svelte/openlayers-controller.d.ts +1 -1
  100. package/svelte/openlayers-controller.js +7 -4
  101. package/svelte/openlayers.d.ts +53 -1
  102. package/svelte/openlayers.js +66 -48
  103. package/svelte/react.d.ts +31 -5
  104. package/svelte/react.js +21 -9
  105. package/svelte/types.d.ts +106 -35
  106. package/svelte/vanilla.d.ts +46 -2
  107. package/svelte/vanilla.js +66 -10
  108. package/types.d.ts +106 -35
  109. package/vanilla.d.ts +46 -2
  110. package/vanilla.js +1260 -1057
  111. package/vanilla.js.map +1 -1
  112. package/vanilla.umd.js +1 -1
  113. package/vanilla.umd.js.map +1 -1
  114. package/icons/aerodrome.12.svg +0 -1
  115. package/icons/bus_stop.12.svg +0 -1
  116. package/icons/elevator.12.svg +0 -1
  117. /package/icons/{helipad.16.svg → helipad.svg} +0 -0
  118. /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
- setMarkers(markedFeatures: FeatureType[] | undefined, picked: FeatureType | undefined): void;
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
  };
@@ -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 m = 0; m < l; m++) {
47
- var v = 0, w = 0;
48
- if (u = h ? f.geometries[m] : f, u !== null) {
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
- v,
60
- w
59
+ w,
60
+ m
61
61
  ) === !1)
62
62
  return !1;
63
- s++, v++;
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
- v,
73
- w
72
+ w,
73
+ m
74
74
  ) === !1)
75
75
  return !1;
76
- s++, E === "MultiPoint" && v++;
76
+ s++, E === "MultiPoint" && w++;
77
77
  }
78
- E === "LineString" && v++;
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
- v,
89
- w
88
+ w,
89
+ m
90
90
  ) === !1)
91
91
  return !1;
92
92
  s++;
93
93
  }
94
- E === "MultiLineString" && v++, E === "Polygon" && w++;
94
+ E === "MultiLineString" && w++, E === "Polygon" && m++;
95
95
  }
96
- E === "Polygon" && v++;
96
+ E === "Polygon" && w++;
97
97
  break;
98
98
  case "MultiPolygon":
99
99
  for (n = 0; n < c.length; n++) {
100
- for (w = 0, r = 0; r < c[n].length; r++) {
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
- v,
107
- w
106
+ w,
107
+ m
108
108
  ) === !1)
109
109
  return !1;
110
110
  s++;
111
111
  }
112
- w++;
112
+ m++;
113
113
  }
114
- v++;
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, m, v, w, E, b, M, S;
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
- w = L * C, h = _ * L, g = h - (h - L), y = L - g, h = _ * C, p = h - (h - C), d = C - p, E = y * d - (w - 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), m = w + x, s = m - w, v = w - (m - s) + (x - s), x = v - b, s = v - x, T[1] = v - (x + s) + (s - b), S = m + x, s = S - m, T[2] = m - (S - s) + (x - s), T[3] = S;
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
- w = l * C, h = _ * l, g = h - (h - l), y = l - g, h = _ * C, p = h - (h - C), d = C - p, E = y * d - (w - 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), m = w + x, s = m - w, v = w - (m - s) + (x - s), x = v - b, s = v - x, P[1] = v - (x + s) + (s - b), S = m + x, s = S - m, P[2] = m - (S - s) + (x - s), P[3] = S;
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
- w = L * a, h = _ * L, g = h - (h - L), y = L - g, h = _ * a, p = h - (h - a), d = a - p, E = y * d - (w - 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), m = w + x, s = m - w, v = w - (m - s) + (x - s), x = v - b, s = v - x, P[1] = v - (x + s) + (s - b), S = m + x, s = S - m, P[2] = m - (S - s) + (x - s), P[3] = S;
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
- w = l * a, h = _ * l, g = h - (h - l), y = l - g, h = _ * a, p = h - (h - a), d = a - p, E = y * d - (w - 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), m = w + x, s = m - w, v = w - (m - s) + (x - s), x = v - b, s = v - x, P[1] = v - (x + s) + (s - b), S = m + x, s = S - m, P[2] = m - (S - s) + (x - s), P[3] = S;
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
- setMarkers(y, p) {
1660
- function d(x) {
1661
- var m;
1662
- if (x)
1663
- for (const v of x.features) {
1664
- const w = v.geometry.type === "Polygon" ? new ut(v.geometry.coordinates) : v.geometry.type === "MultiPolygon" ? new ft(v.geometry.coordinates) : null;
1665
- w && a.addFeature(
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: !!((m = v.properties) != null && m.isMask),
1668
- geometry: h(w)
1667
+ isMask: !!((w = m.properties) != null && w.isMask),
1668
+ geometry: h(E)
1669
1669
  })
1670
1670
  );
1671
1671
  }
1672
1672
  }
1673
- if (a.clear(), l && a.addFeature(l), p) {
1674
- let x = !1;
1673
+ a.clear(), l && a.addFeature(l);
1674
+ t: if (p) {
1675
+ let v = !1;
1675
1676
  if (p.geometry.type === "GeometryCollection") {
1676
- const m = p.geometry.geometries.map(
1677
- (v) => v.type === "Polygon" ? new ut(v.coordinates) : v.type === "MultiPolygon" ? new ft(v.coordinates) : null
1678
- ).filter((v) => !!v);
1679
- if (m.length > 0)
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(m)))
1682
- ), x = !0;
1682
+ new N(h(new $t(w)))
1683
+ ), v = !0;
1683
1684
  else
1684
- for (const v of p.geometry.geometries)
1685
- v.type === "LineString" ? (a.addFeature(
1685
+ for (const m of p.geometry.geometries)
1686
+ m.type === "LineString" ? (a.addFeature(
1686
1687
  new N(
1687
- h(new ct(v.coordinates))
1688
+ h(new ct(m.coordinates))
1688
1689
  )
1689
- ), x = !0) : v.type === "MultiLineString" && a.addFeature(
1690
+ ), v = !0) : m.type === "MultiLineString" && a.addFeature(
1690
1691
  new N(
1691
- h(new ht(v.coordinates))
1692
+ h(new ht(m.coordinates))
1692
1693
  )
1693
- ), x = !0;
1694
+ ), v = !0;
1694
1695
  }
1695
- if (!x) {
1696
+ if (!v) {
1696
1697
  if (p.geometry.type === "Polygon")
1697
- kt(p, d);
1698
+ kt(p, x);
1698
1699
  else if (p.geometry.type === "MultiPolygon")
1699
- kt(p, d);
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
- return;
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
- return;
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 x of y ?? []) {
1719
- if (x === p)
1721
+ for (const v of y ?? []) {
1722
+ if (v === p)
1720
1723
  continue;
1721
- const m = new N(
1722
- new Z(V(x.center, s()))
1724
+ const w = new N(
1725
+ new Z(V(v.center, s()))
1723
1726
  );
1724
- m.setId(x.id), m.setProperties({
1725
- fuzzy: !!x.matching_text,
1726
- tooltip: x.place_type[0] === "reverse" ? x.place_name : x.place_name.replace(/,.*/, "")
1727
- }), a.addFeature(m);
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, m, v;
1734
+ var x, v, w;
1732
1735
  const p = a.getFeatures(), d = (x = p[0]) != null && x.getProperties().isReverse ? 1 : 0;
1733
- r > -1 && ((m = p[r + d]) == null || m.setProperties({
1736
+ r > -1 && ((v = p[r + d]) == null || v.setProperties({
1734
1737
  isSelected: !1
1735
- })), y > -1 && ((v = p[y + d]) == null || v.setProperties({
1738
+ })), y > -1 && ((w = p[y + d]) == null || w.setProperties({
1736
1739
  isSelected: !0
1737
1740
  })), r = y;
1738
1741
  },