@maptiler/geocoding-control 0.0.100-rc.2 → 1.0.0-rc.2

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.
@@ -25,7 +25,9 @@ export let mapController = undefined;
25
25
  export let minLength = 2;
26
26
  export let noResultsMessage = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!";
27
27
  export let placeholder = "Search";
28
- export let proximity = undefined;
28
+ export let proximity = [
29
+ { type: "server-geolocation" },
30
+ ];
29
31
  export let reverseActive = enableReverse === "always";
30
32
  export let reverseButtonTitle = "toggle reverse geocoding";
31
33
  export let searchValue = "";
@@ -38,7 +40,7 @@ export let maxZoom = 18;
38
40
  export let apiUrl = "https://api.maptiler.com/geocoding";
39
41
  export let fetchParameters = {};
40
42
  export let iconsBaseUrl = "https://cdn.maptiler.com/maptiler-geocoding-control/v" +
41
- "0.0.100-rc.2" +
43
+ "1.0.0-rc.2" +
42
44
  "/icons/";
43
45
  export const adjustQuery = (sp) => { };
44
46
  export function focus() {
@@ -213,7 +215,7 @@ async function search(searchValue, { byId = false, exact = false, } = {}) {
213
215
  const isReverse = isQuerReverse();
214
216
  const sp = new URLSearchParams();
215
217
  if (language != undefined) {
216
- sp.set("language", Array.isArray(language) ? language.join(",") : language);
218
+ sp.set("language", Array.isArray(language) ? language.join(",") : language ?? "");
217
219
  }
218
220
  if (types) {
219
221
  sp.set("types", types.join(","));
@@ -15,13 +15,13 @@ declare const __propDef: {
15
15
  filter?: ((feature: Feature) => boolean) | undefined;
16
16
  flyTo?: boolean | undefined;
17
17
  fuzzyMatch?: boolean | undefined;
18
- language?: string | string[] | undefined;
18
+ language?: string | string[] | null | undefined;
19
19
  limit?: number | undefined;
20
20
  mapController?: MapController | undefined;
21
21
  minLength?: number | undefined;
22
22
  noResultsMessage?: string | undefined;
23
23
  placeholder?: string | undefined;
24
- proximity?: ProximityRule[] | undefined;
24
+ proximity?: ProximityRule[] | null | undefined;
25
25
  reverseActive?: boolean | undefined;
26
26
  reverseButtonTitle?: string | undefined;
27
27
  searchValue?: string | undefined;
package/svelte/types.d.ts CHANGED
@@ -72,10 +72,11 @@ export type ControlOptions = {
72
72
  debounceSearch?: number;
73
73
  /**
74
74
  * Search results closer to the proximity point will be given higher priority. First matching rule from the array will be used.
75
+ * Set to `null` to disable proximity.
75
76
  *
76
- * @default undefined
77
+ * @default [{ type: "server-geolocation" }]
77
78
  */
78
- proximity?: ProximityRule[];
79
+ proximity?: ProximityRule[] | null;
79
80
  /**
80
81
  * Override the default placeholder attribute value.
81
82
  *
@@ -117,11 +118,12 @@ export type ControlOptions = {
117
118
  * Specify the language to use for response text and query result weighting.
118
119
  * Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script.
119
120
  * More than one value can also be specified, separated by commas.
121
+ * Set to `null` or empty string for disabling language-specific searching.
120
122
  * Defaults to the browser's language settings.
121
123
  *
122
124
  * @default undefined
123
125
  */
124
- language?: string | string[];
126
+ language?: string | string[] | null;
125
127
  /**
126
128
  * If `false`, indicates that search will only occur on enter key press.
127
129
  * If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option.
package/types.d.ts CHANGED
@@ -72,10 +72,11 @@ export type ControlOptions = {
72
72
  debounceSearch?: number;
73
73
  /**
74
74
  * Search results closer to the proximity point will be given higher priority. First matching rule from the array will be used.
75
+ * Set to `null` to disable proximity.
75
76
  *
76
- * @default undefined
77
+ * @default [{ type: "server-geolocation" }]
77
78
  */
78
- proximity?: ProximityRule[];
79
+ proximity?: ProximityRule[] | null;
79
80
  /**
80
81
  * Override the default placeholder attribute value.
81
82
  *
@@ -117,11 +118,12 @@ export type ControlOptions = {
117
118
  * Specify the language to use for response text and query result weighting.
118
119
  * Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script.
119
120
  * More than one value can also be specified, separated by commas.
121
+ * Set to `null` or empty string for disabling language-specific searching.
120
122
  * Defaults to the browser's language settings.
121
123
  *
122
124
  * @default undefined
123
125
  */
124
- language?: string | string[];
126
+ language?: string | string[] | null;
125
127
  /**
126
128
  * If `false`, indicates that search will only occur on enter key press.
127
129
  * If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option.
package/vanilla.js CHANGED
@@ -1419,7 +1419,7 @@ function kt(n) {
1419
1419
  return e[2] < e[0] && (e[2] += 360), e;
1420
1420
  }
1421
1421
  function Dn(n, e, t) {
1422
- let r, { $$slots: l = {}, $$scope: a } = e, { class: o = void 0 } = e, { apiKey: f } = e, { bbox: h = void 0 } = e, { clearButtonTitle: c = "clear" } = e, { clearOnBlur: m = !1 } = e, { collapsed: v = !1 } = e, { country: g = void 0 } = e, { debounceSearch: L = 200 } = e, { enableReverse: I = !1 } = e, { errorMessage: T = "Something went wrong…" } = e, { filter: M = () => !0 } = e, { flyTo: U = !0 } = e, { fuzzyMatch: y = !0 } = e, { language: O = void 0 } = e, { limit: F = void 0 } = e, { mapController: d = void 0 } = e, { minLength: b = 2 } = e, { noResultsMessage: B = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!" } = e, { placeholder: C = "Search" } = e, { proximity: _ = void 0 } = e, { reverseActive: w = I === "always" } = e, { reverseButtonTitle: X = "toggle reverse geocoding" } = e, { searchValue: u = "" } = e, { showFullGeometry: P = !0 } = e, { showPlaceType: te = "ifNeeded" } = e, { showResultsWhileTyping: ae = !0 } = e, { types: de = void 0 } = e, { zoom: Ie = 16 } = e, { maxZoom: Le = 18 } = e, { apiUrl: We = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: Oe = {} } = e, { iconsBaseUrl: xe = "https://cdn.maptiler.com/maptiler-geocoding-control/v0.0.100-rc.2/icons/" } = e;
1422
+ let r, { $$slots: l = {}, $$scope: a } = e, { class: o = void 0 } = e, { apiKey: f } = e, { bbox: h = void 0 } = e, { clearButtonTitle: c = "clear" } = e, { clearOnBlur: m = !1 } = e, { collapsed: v = !1 } = e, { country: g = void 0 } = e, { debounceSearch: L = 200 } = e, { enableReverse: I = !1 } = e, { errorMessage: T = "Something went wrong…" } = e, { filter: M = () => !0 } = e, { flyTo: U = !0 } = e, { fuzzyMatch: y = !0 } = e, { language: O = void 0 } = e, { limit: F = void 0 } = e, { mapController: d = void 0 } = e, { minLength: b = 2 } = e, { noResultsMessage: B = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!" } = e, { placeholder: C = "Search" } = e, { proximity: _ = [{ type: "server-geolocation" }] } = e, { reverseActive: w = I === "always" } = e, { reverseButtonTitle: X = "toggle reverse geocoding" } = e, { searchValue: u = "" } = e, { showFullGeometry: P = !0 } = e, { showPlaceType: te = "ifNeeded" } = e, { showResultsWhileTyping: ae = !0 } = e, { types: de = void 0 } = e, { zoom: Ie = 16 } = e, { maxZoom: Le = 18 } = e, { apiUrl: We = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: Oe = {} } = e, { iconsBaseUrl: xe = "https://cdn.maptiler.com/maptiler-geocoding-control/v1.0.0-rc.2/icons/" } = e;
1423
1423
  const $e = (i) => {
1424
1424
  };
1425
1425
  function Rt() {
@@ -1457,7 +1457,7 @@ function Dn(n, e, t) {
1457
1457
  t(18, he = se);
1458
1458
  try {
1459
1459
  const H = rt(), q = new URLSearchParams();
1460
- if (O != null && q.set("language", Array.isArray(O) ? O.join(",") : O), de && q.set("types", de.join(",")), h && q.set("bbox", h.map((qe) => qe.toFixed(6)).join(",")), g && q.set("country", Array.isArray(g) ? g.join(",") : g), !j && !H) {
1460
+ if (O != null && q.set("language", Array.isArray(O) ? O.join(",") : O ?? ""), de && q.set("types", de.join(",")), h && q.set("bbox", h.map((qe) => qe.toFixed(6)).join(",")), g && q.set("country", Array.isArray(g) ? g.join(",") : g), !j && !H) {
1461
1461
  async function qe() {
1462
1462
  const ke = d == null ? void 0 : d.getCenterAndZoom();
1463
1463
  for (const K of _ ?? [])