expo-gaode-map-web-api 1.1.1 → 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
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
|
|
36
36
|
安装本模块:
|
|
37
37
|
```bash
|
|
38
|
-
|
|
38
|
+
bun add expo-gaode-map-web-api
|
|
39
39
|
# 或
|
|
40
40
|
yarn add expo-gaode-map-web-api
|
|
41
41
|
# 或
|
|
42
|
-
|
|
42
|
+
npm install expo-gaode-map-web-api
|
|
43
43
|
```
|
|
44
44
|
注:若未安装上述基础包,安装时或运行时会给出明确提示。
|
|
45
45
|
|
|
@@ -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<
|
|
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
|
|
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.
|
|
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",
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
"build",
|
|
9
9
|
"README.md"
|
|
10
10
|
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"clean": "rm -rf build",
|
|
15
|
+
"test": "bun test",
|
|
16
|
+
"prepare": "npm run build",
|
|
17
|
+
"postinstall": "node -e \"try{require.resolve('expo-gaode-map');process.exit(0)}catch(e1){try{require.resolve('expo-gaode-map-navigation');process.exit(0)}catch(e2){console.error('[expo-gaode-map-web-api] 需要安装基础地图组件:expo-gaode-map 或 expo-gaode-map-navigation 中的任意一个。\\bun add expo-gaode-map 或 bun add expo-gaode-map-navigation');process.exit(1)}}\""
|
|
18
|
+
},
|
|
11
19
|
"keywords": [
|
|
12
20
|
"react-native",
|
|
13
21
|
"expo",
|
|
@@ -23,7 +31,7 @@
|
|
|
23
31
|
"bugs": {
|
|
24
32
|
"url": "https://github.com/TomWq/expo-gaode-map/issues"
|
|
25
33
|
},
|
|
26
|
-
"author": "
|
|
34
|
+
"author": "(https://github.com/TomWq)",
|
|
27
35
|
"license": "MIT",
|
|
28
36
|
"homepage": "https://github.com/TomWq/expo-gaode-map#readme",
|
|
29
37
|
"dependencies": {},
|
|
@@ -33,11 +41,5 @@
|
|
|
33
41
|
},
|
|
34
42
|
"peerDependencies": {
|
|
35
43
|
"react-native": "*"
|
|
36
|
-
},
|
|
37
|
-
"scripts": {
|
|
38
|
-
"build": "tsc",
|
|
39
|
-
"dev": "tsc --watch",
|
|
40
|
-
"clean": "rm -rf build",
|
|
41
|
-
"postinstall": "node -e \"try{require.resolve('expo-gaode-map');process.exit(0)}catch(e1){try{require.resolve('expo-gaode-map-navigation');process.exit(0)}catch(e2){console.error('[expo-gaode-map-web-api] 需要安装基础地图组件:expo-gaode-map 或 expo-gaode-map-navigation 中的任意一个。\\n请执行:pnpm add expo-gaode-map 或 pnpm add expo-gaode-map-navigation');process.exit(1)}}\""
|
|
42
44
|
}
|
|
43
|
-
}
|
|
45
|
+
}
|