@maptiler/geocoding-control 0.0.56 → 0.0.58

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "0.0.56",
3
+ "version": "0.0.58",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Martin Ždila",
@@ -16,14 +16,15 @@
16
16
  },
17
17
  "keywords": [
18
18
  "geocoding",
19
- "forward geocoding",
20
- "reverse geocoding",
19
+ "forward-geocoding",
20
+ "reverse-geocoding",
21
21
  "maptiler",
22
22
  "leaflet",
23
23
  "maplibre",
24
24
  "map",
25
25
  "search",
26
- "component",
26
+ "leaflet-control",
27
+ "maplibre-control",
27
28
  "control"
28
29
  ],
29
30
  "scripts": {
@@ -67,10 +68,10 @@
67
68
  "prettier": "^2.8.3",
68
69
  "prettier-plugin-svelte": "^2.9.0",
69
70
  "svelte": "^3.55.1",
70
- "svelte-check": "^3.0.2",
71
+ "svelte-check": "^3.0.3",
71
72
  "svelte-preprocess": "^5.0.1",
72
- "tslib": "^2.4.1",
73
- "typescript": "^4.9.4",
73
+ "tslib": "^2.5.0",
74
+ "typescript": "^4.9.5",
74
75
  "vite": "^4.0.4"
75
76
  },
76
77
  "peerDependencies": {
@@ -325,10 +325,6 @@
325
325
  );
326
326
  }
327
327
 
328
- if (country) {
329
- sp.set("country", Array.isArray(country) ? country.join(",") : country);
330
- }
331
-
332
328
  if (types) {
333
329
  sp.set("types", types.join(","));
334
330
  }
@@ -338,17 +334,21 @@
338
334
  sp.set("bbox", bbox.map((c) => c.toFixed(6)).join(","));
339
335
  }
340
336
 
341
- if (!byId) {
342
- if (proximity) {
343
- sp.set("proximity", proximity.map((c) => c.toFixed(6)).join(","));
344
- }
337
+ if (country) {
338
+ sp.set("country", Array.isArray(country) ? country.join(",") : country);
339
+ }
340
+ }
345
341
 
346
- if (exact || !showResultsWhileTyping) {
347
- sp.set("autocomplete", "false");
348
- }
342
+ if (!byId) {
343
+ if (proximity) {
344
+ sp.set("proximity", proximity.map((c) => c.toFixed(6)).join(","));
345
+ }
349
346
 
350
- sp.set("fuzzyMatch", String(fuzzyMatch));
347
+ if (exact || !showResultsWhileTyping) {
348
+ sp.set("autocomplete", "false");
351
349
  }
350
+
351
+ sp.set("fuzzyMatch", String(fuzzyMatch));
352
352
  }
353
353
 
354
354
  if (limit !== undefined) {
@@ -380,13 +380,19 @@
380
380
 
381
381
  abortController?.abort();
382
382
 
383
- abortController = new AbortController();
383
+ const ac = new AbortController();
384
+
385
+ abortController = ac;
384
386
 
385
387
  let res: Response;
386
388
 
387
389
  try {
388
- res = await fetch(url, { signal: abortController.signal }).finally(() => {
389
- abortController = undefined;
390
+ console.log("fetch");
391
+
392
+ res = await fetch(url, { signal: ac.signal }).finally(() => {
393
+ if (ac === abortController) {
394
+ abortController = undefined;
395
+ }
390
396
  });
391
397
  } catch (e) {
392
398
  if (e && typeof e === "object" && (e as any).name === "AbortError") {