@nextgis/geocoder 1.18.12 → 1.18.17

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/lib/index.d.ts CHANGED
@@ -9,6 +9,7 @@ import CancelablePromise from '@nextgis/cancelable-promise';
9
9
  import type { FeatureItem } from '@nextgis/ngw-connector';
10
10
  import type { FetchNgwItemsOptions } from '@nextgis/ngw-kit';
11
11
  import { GeoJsonObject } from 'geojson';
12
+ import { LngLatArray } from '@nextgis/utils';
12
13
  import { LngLatBoundsArray } from '@nextgis/utils';
13
14
  import NgwConnector from '@nextgis/ngw-connector';
14
15
  import type { NgwConnectorOptions } from '@nextgis/ngw-connector';
@@ -38,6 +39,15 @@ declare abstract class BaseGeocoder<O extends Record<string, any> = Record<strin
38
39
  * @returns {CancelablePromise<any>} - A promise that resolves to the detailed result.
39
40
  */
40
41
  abstract result(item: SearchItem): CancelablePromise<any>;
42
+ /**
43
+ * Method for reverse geocoding.
44
+ * Takes coordinates and returns the corresponding address or location information.
45
+ *
46
+ * @abstract
47
+ * @param {LngLatArray} coordinates - The longitude and latitude values.
48
+ * @returns {AsyncGenerator<SearchItem>} - An async generator that yields reverse geocoding results.
49
+ */
50
+ abstract reverse(coordinates: LngLatArray): AsyncGenerator<SearchItem>;
41
51
  /**
42
52
  * Optional method to abort any ongoing geocoding requests.
43
53
  *
@@ -88,6 +98,14 @@ export declare class Geocoder extends BaseGeocoder<GeocoderOptions> {
88
98
  abort(): void;
89
99
  search(query: string): AsyncGenerator<SearchItem, void, unknown>;
90
100
  result(item: SearchItem): CancelablePromise<any>;
101
+ reverse(coordinates: LngLatArray): AsyncGenerator<SearchItem, void, unknown>;
102
+ /**
103
+ * Returns the first reverse geocoding result for given coordinates from any provider.
104
+ *
105
+ * @param {LngLatArray} coordinates - The longitude and latitude values.
106
+ * @returns {Promise<SearchItem | undefined>} - A promise that resolves to the first reverse geocoding result, or undefined if no results are found.
107
+ */
108
+ reverseGeocodeFirstResult(coordinates: LngLatArray): Promise<SearchItem | undefined>;
91
109
  }
92
110
 
93
111
  /**
@@ -109,6 +127,7 @@ export declare class NgwProvider extends BaseProvider<NgwProviderOptions> {
109
127
  abort(): void;
110
128
  search(query: string): AsyncGenerator<NgwSearchItem, void, unknown>;
111
129
  result(item: NgwSearchItem): CancelablePromise<ResultItem>;
130
+ reverse(coordinates: LngLatArray): AsyncGenerator<SearchItem, void, unknown>;
112
131
  private _makeSignal;
113
132
  private _items;
114
133
  }
@@ -146,6 +165,7 @@ export declare class NominatimProvider extends BaseProvider {
146
165
  abort(): void;
147
166
  search(val: string): AsyncGenerator<SearchItem, void, unknown>;
148
167
  result(model: SearchItem): CancelablePromise<ResultItem>;
168
+ reverse(coordinates: LngLatArray): AsyncGenerator<SearchItem, void, unknown>;
149
169
  }
150
170
 
151
171
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextgis/geocoder",
3
- "version": "1.18.12",
3
+ "version": "1.18.17",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "lib/geocoder.esm-bundler.js",
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@nextgis/cancelable-promise": "^1.18.3",
12
12
  "@nextgis/ngw-connector": "^1.18.12",
13
- "@nextgis/ngw-kit": "^1.18.12",
13
+ "@nextgis/ngw-kit": "^1.18.15",
14
14
  "@nextgis/utils": "^1.18.12",
15
15
  "@types/events": "^3.0.0",
16
16
  "@types/geojson": "^7946.0.8",
@@ -53,5 +53,5 @@
53
53
  "bugs": {
54
54
  "url": "https://github.com/nextgis/nextgis_frontend/issues"
55
55
  },
56
- "gitHead": "ab0530144ecdb94222fdac520fad5b98d302ec6d"
56
+ "gitHead": "c35f8efdb73787faa15861cd664ef83ebddb09c0"
57
57
  }