expo-gaode-map 0.1.0 → 0.1.1
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 +9 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,23 +56,15 @@ npx react-native run-android
|
|
|
56
56
|
|
|
57
57
|
前往 [高德开放平台](https://lbs.amap.com/) 注册并创建应用,获取 API Key。
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
> ⚠️ **原生配置说明**
|
|
60
|
+
>
|
|
61
|
+
> 高德地图 SDK 需要在原生项目中进行配置(如在 AndroidManifest.xml 中配置 Key、添加权限等)。具体的原生配置步骤请参考:
|
|
62
|
+
> - **Android**: [高德地图 Android SDK 配置指南](https://lbs.amap.com/api/android-sdk/guide/create-project/android-studio-create-project)
|
|
63
|
+
> - **iOS**: [高德地图 iOS SDK 配置指南](https://lbs.amap.com/api/ios-sdk/guide/create-project/cocoapods)
|
|
64
|
+
>
|
|
65
|
+
> 对于 Expo 项目,建议使用 `npx expo prebuild` 生成原生代码后,按照高德官网文档进行配置。
|
|
60
66
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"expo": {
|
|
66
|
-
"android": {
|
|
67
|
-
"config": {
|
|
68
|
-
"gaodeMapApiKey": "your-android-api-key"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### 3. 初始化 SDK
|
|
67
|
+
### 2. 初始化 SDK
|
|
76
68
|
|
|
77
69
|
```tsx
|
|
78
70
|
import { useEffect } from 'react';
|
|
@@ -92,7 +84,7 @@ export default function App() {
|
|
|
92
84
|
}
|
|
93
85
|
```
|
|
94
86
|
|
|
95
|
-
###
|
|
87
|
+
### 3. 使用地图组件
|
|
96
88
|
|
|
97
89
|
```tsx
|
|
98
90
|
import { MapView } from 'expo-gaode-map';
|