expo-gaode-map-web-api 1.1.2 → 1.1.3

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/README.md CHANGED
@@ -147,7 +147,9 @@ const result = await api.geocode.batchRegeocode([
147
147
  ]);
148
148
 
149
149
  // 处理多个结果
150
- // 注意:批量查询的结果格式与单个查询略有不同
150
+ result.regeocodes.forEach(item => {
151
+ console.log(item.formatted_address);
152
+ });
151
153
  ```
152
154
 
153
155
  ### 地理编码
@@ -2,7 +2,7 @@
2
2
  * 高德地图 Web API - 地理编码服务
3
3
  */
4
4
  import { GaodeWebAPIClient } from '../utils/client';
5
- import type { RegeocodeParams, RegeocodeResponse, GeocodeResponse } from '../types/geocode.types';
5
+ import type { RegeocodeParams, RegeocodeResponse, BatchRegeocodeResponse, GeocodeResponse } from '../types/geocode.types';
6
6
  /**
7
7
  * 地理编码服务
8
8
  */
@@ -77,7 +77,7 @@ export declare class GeocodeService {
77
77
  * ]);
78
78
  * ```
79
79
  */
80
- batchRegeocode(locations: string[], options?: Omit<RegeocodeParams, 'location' | 'batch'>): Promise<RegeocodeResponse>;
80
+ batchRegeocode(locations: string[], options?: Omit<RegeocodeParams, 'location' | 'batch'>): Promise<BatchRegeocodeResponse>;
81
81
  /**
82
82
  * 批量地理编码
83
83
  *
@@ -228,18 +228,30 @@ export interface Regeocode {
228
228
  aois?: AOI[];
229
229
  }
230
230
  /**
231
- * 逆地理编码响应结果
231
+ * 逆地理编码基础响应结果
232
232
  */
233
- export interface RegeocodeResponse {
233
+ export interface BaseRegeocodeResponse {
234
234
  /** 状态码:1-成功,0-失败 */
235
235
  status: string;
236
236
  /** 状态说明 */
237
237
  info: string;
238
238
  /** 状态码说明 */
239
239
  infocode: string;
240
+ }
241
+ /**
242
+ * 逆地理编码响应结果
243
+ */
244
+ export interface RegeocodeResponse extends BaseRegeocodeResponse {
240
245
  /** 逆地理编码结果 */
241
246
  regeocode: Regeocode;
242
247
  }
248
+ /**
249
+ * 批量逆地理编码响应结果
250
+ */
251
+ export interface BatchRegeocodeResponse extends BaseRegeocodeResponse {
252
+ /** 批量逆地理编码结果列表 */
253
+ regeocodes: Regeocode[];
254
+ }
243
255
  /**
244
256
  * 地理编码请求参数
245
257
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-gaode-map-web-api",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "高德地图 Web API 服务 - 搜索、路径规划、地理编码(纯 JavaScript 实现),配合 expo-gaode-map 使用",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",