expo-gaode-map-search 1.3.3 → 1.3.5

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
@@ -1,6 +1,6 @@
1
1
  # expo-gaode-map-search
2
2
 
3
- 高德地图搜索功能模块,提供 POI 搜索、周边搜索、沿途搜索、多边形搜索和输入提示功能。
3
+ 高德地图搜索功能模块,提供 POI 搜索、周边搜索、沿途搜索、多边形搜索、输入提示、逆地理编码和 POI 详情查询功能。
4
4
 
5
5
  ## 安装
6
6
 
@@ -22,6 +22,8 @@ npm install expo-gaode-map-search
22
22
  - ✅ 沿途搜索
23
23
  - ✅ 多边形区域搜索
24
24
  - ✅ 输入提示(自动补全)
25
+ - ✅ 逆地理编码(坐标转地址)
26
+ - ✅ POI 详情查询(评分、营业时间等)
25
27
  - ✅ 支持分页
26
28
  - ✅ 支持类型过滤
27
29
  - ✅ 完整的 TypeScript 类型定义
@@ -105,6 +107,35 @@ result.tips.forEach(tip => {
105
107
  });
106
108
  ```
107
109
 
110
+ ### 逆地理编码
111
+
112
+ ```typescript
113
+ import { reGeocode } from 'expo-gaode-map-search';
114
+
115
+ const result = await reGeocode({
116
+ location: { latitude: 39.9088, longitude: 116.3975 },
117
+ radius: 1000,
118
+ requireExtension: true,
119
+ });
120
+
121
+ console.log('地址:', result.formattedAddress);
122
+ console.log('兴趣点:', result.pois.length);
123
+ ```
124
+
125
+ ### POI 详情查询
126
+
127
+ ```typescript
128
+ import { getPoiDetail } from 'expo-gaode-map-search';
129
+
130
+ const poi = await getPoiDetail('B000A83M61');
131
+
132
+ console.log('名称:', poi.name);
133
+ if (poi.business) {
134
+ console.log('评分:', poi.business.rating);
135
+ console.log('营业时间:', poi.business.opentime);
136
+ }
137
+ ```
138
+
108
139
  ## API 文档
109
140
 
110
141
  ### searchPOI(options)
@@ -172,6 +203,26 @@ POI 关键词搜索。
172
203
 
173
204
  **返回:** `Promise<InputTipsResult>`
174
205
 
206
+ ### reGeocode(options)
207
+
208
+ 逆地理编码(坐标转地址)。
209
+
210
+ **参数:**
211
+ - `location` (Coordinates, 必需): 经纬度坐标
212
+ - `radius` (number, 可选): 搜索半径,默认 1000 米
213
+ - `requireExtension` (boolean, 可选): 是否返回扩展信息(道路、交叉口、POI等),默认 true
214
+
215
+ **返回:** `Promise<ReGeocodeResult>`
216
+
217
+ ### getPoiDetail(id)
218
+
219
+ 查询 POI 详细信息。
220
+
221
+ **参数:**
222
+ - `id` (string, 必需): POI ID
223
+
224
+ **返回:** `Promise<POI>`
225
+
175
226
  ## 类型定义
176
227
 
177
228
  ### Coordinates
@@ -187,19 +238,56 @@ interface Coordinates {
187
238
 
188
239
  ```typescript
189
240
  interface POI {
241
+ /** POI ID */
190
242
  id: string;
243
+ /** 名称 */
191
244
  name: string;
245
+ /** 地址 */
192
246
  address: string;
247
+ /** 坐标 */
193
248
  location: Coordinates;
249
+ /** 类型编码 */
194
250
  typeCode: string;
251
+ /** 类型描述 */
195
252
  typeDes: string;
253
+ /** 电话 */
196
254
  tel?: string;
255
+ /** 距离(米),仅周边搜索返回 */
197
256
  distance?: number;
257
+ /** 城市名称 */
198
258
  cityName?: string;
259
+ /** 城市编码 */
199
260
  cityCode?: string;
261
+ /** 省份名称 */
200
262
  provinceName?: string;
263
+ /** 区域名称 */
201
264
  adName?: string;
265
+ /** 区域编码 */
202
266
  adCode?: string;
267
+ /** 深度信息 (评分、营业时间等) */
268
+ business?: {
269
+ opentime?: string;
270
+ opentimeToday?: string;
271
+ rating?: string;
272
+ cost?: string;
273
+ parkingType?: string;
274
+ tag?: string;
275
+ tel?: string;
276
+ alias?: string;
277
+ businessArea?: string;
278
+ };
279
+ /** 图片信息 */
280
+ photos?: Array<{
281
+ title?: string;
282
+ url?: string;
283
+ }>;
284
+ /** 室内地图信息 */
285
+ indoor?: {
286
+ floor?: string;
287
+ floorName?: string;
288
+ poiId?: string;
289
+ hasIndoorMap?: boolean;
290
+ };
203
291
  }
204
292
  ```
205
293
 
@@ -229,11 +317,45 @@ interface InputTip {
229
317
  }
230
318
  ```
231
319
 
232
- ### InputTipsResult
320
+ ### ReGeocodeResult
233
321
 
234
322
  ```typescript
235
- interface InputTipsResult {
236
- tips: InputTip[];
323
+ interface ReGeocodeResult {
324
+ /** 格式化地址 */
325
+ formattedAddress: string;
326
+ /** 地址组成要素 */
327
+ addressComponent: AddressComponent;
328
+ /** 兴趣点列表 */
329
+ pois: POI[];
330
+ /** 道路列表 */
331
+ roads: Road[];
332
+ /** 道路交叉口列表 */
333
+ roadCrosses: RoadCross[];
334
+ /** 兴趣区域列表 */
335
+ aois: AOI[];
336
+ }
337
+ ```
338
+
339
+ ### AddressComponent
340
+
341
+ ```typescript
342
+ interface AddressComponent {
343
+ province: string;
344
+ city: string;
345
+ district: string;
346
+ township: string;
347
+ neighborhood: string;
348
+ building: string;
349
+ cityCode: string;
350
+ adCode: string;
351
+ streetNumber: {
352
+ street: string;
353
+ number: string;
354
+ location?: Coordinates;
355
+ direction: string;
356
+ distance: number;
357
+ };
358
+ businessAreas?: BusinessArea[];
237
359
  }
238
360
  ```
239
361
 
@@ -347,7 +469,11 @@ export default function SearchScreen() {
347
469
 
348
470
  MIT
349
471
 
350
- ## 相关链接
472
+ ## 📚 文档与资源
473
+
474
+ - [在线文档](https://tomwq.github.io/expo-gaode-map/api/search.html)
475
+ - [GitHub 仓库](https://github.com/TomWq/expo-gaode-map/tree/main/packages/search)
476
+ - [示例项目(导航)](https://github.com/TomWq/expo-gaode-map-example)
477
+ - [高德地图开放平台](https://lbs.amap.com/)
478
+ - [Expo Modules API](https://docs.expo.dev/modules/overview/)
351
479
 
352
- - [expo-gaode-map](https://github.com/TomWq/expo-gaode-map)
353
- - [高德地图搜索 API 文档](https://lbs.amap.com/api/android-sdk/guide/map-data/poi)