-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Geocode 地理编码/逆编码模块 | ||
|
||
|
||
```javascript | ||
import { Geocode } from 'react-native-baidumap-sdk' | ||
|
||
// 地理编码,也就是地址 -> 坐标 | ||
const searchResult = await Geocode.search('海龙大厦', '北京市') | ||
|
||
// 逆地理编码,也就是坐标 -> 地址 | ||
const reverseResult = await Geocode.reverse({ latitude: 39, longitude: 113 }) | ||
``` | ||
|
||
## Methods | ||
|
||
### `search(address: string, city: string = ''): Promise<SearchResult>` | ||
地理编码,地址 -> 坐标 | ||
|
||
#### `SearchResult` | ||
- `address`: 应该是与传进来的地址是一样的 | ||
- `latitude`: 转换之后的经度 | ||
- `longitude`: 转换之后的经度 | ||
|
||
### `reverse(coordinate: LatLng): Promise<ReverseResult>` | ||
逆地理编码,坐标 -> 地址 | ||
|
||
#### `ReverseResult` | ||
- `latitude`: 应该与传进来的经度是一样的 | ||
- `longitude`: 应该与传进来的纬度是一样的 | ||
- `country`: 国家 | ||
- `countryCode`: 国家代码 | ||
- `province`: 省/直辖市 | ||
- `city`: 城市 | ||
- `cityCode`: 城市代码 | ||
- `district`: 城区 | ||
- `street`: 街道 | ||
- `streetNumber`: 街道编号 | ||
- `businessCircle`: 商圈 | ||
- `adCode`: 邮政编码 | ||
- `address`: 完整地址 | ||
- `description`: 语义化描述 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"location", | ||
"baidumap" | ||
], | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"author": "7c00 <[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters