expo-gaode-map 0.1.2 → 0.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 +17 -5
- package/docs/API.md +16 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -56,13 +56,25 @@ npx react-native run-android
|
|
|
56
56
|
|
|
57
57
|
前往 [高德开放平台](https://lbs.amap.com/) 注册并创建应用,获取 API Key。
|
|
58
58
|
|
|
59
|
-
> ⚠️
|
|
60
|
-
>
|
|
61
|
-
> 高德地图 SDK
|
|
59
|
+
> ⚠️ **重要:原生配置和权限**
|
|
60
|
+
>
|
|
61
|
+
> 高德地图 SDK 需要在原生项目中进行配置:
|
|
62
|
+
>
|
|
63
|
+
> **Android 必需配置:**
|
|
64
|
+
> 1. 在 `AndroidManifest.xml` 中配置 API Key
|
|
65
|
+
> 2. 添加必需权限(网络、定位等)
|
|
66
|
+
> 3. 配置隐私合规(必需)
|
|
67
|
+
>
|
|
68
|
+
> **iOS 必需配置:**
|
|
69
|
+
> 1. 在 `Info.plist` 中配置 API Key
|
|
70
|
+
> 2. 添加定位权限描述(NSLocationWhenInUseUsageDescription 等)
|
|
71
|
+
> 3. 配置隐私合规(必需)
|
|
72
|
+
>
|
|
73
|
+
> **详细配置指南:**
|
|
62
74
|
> - **Android**: [高德地图 Android SDK 配置指南](https://lbs.amap.com/api/android-sdk/guide/create-project/android-studio-create-project)
|
|
63
75
|
> - **iOS**: [高德地图 iOS SDK 配置指南](https://lbs.amap.com/api/ios-sdk/guide/create-project/cocoapods)
|
|
64
|
-
>
|
|
65
|
-
> 对于 Expo
|
|
76
|
+
>
|
|
77
|
+
> 对于 Expo 项目,使用 `npx expo prebuild` 生成原生代码后进行配置。
|
|
66
78
|
|
|
67
79
|
### 2. 初始化 SDK
|
|
68
80
|
|
package/docs/API.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
完整的 API 参考文档。
|
|
4
4
|
|
|
5
|
+
> ⚠️ **权限和隐私合规警告**
|
|
6
|
+
>
|
|
7
|
+
> 使用地图和定位功能前,请确保:
|
|
8
|
+
> 1. ✅ 已在原生项目中配置必需的权限声明
|
|
9
|
+
> 2. ✅ 在运行时请求用户授权
|
|
10
|
+
> 3. ✅ 遵守《个人信息保护法》等隐私法规
|
|
11
|
+
> 4. ✅ 配置高德 SDK 隐私合规接口
|
|
12
|
+
>
|
|
13
|
+
> 详细配置请参考 [README.md](../README.md#权限配置)
|
|
14
|
+
|
|
5
15
|
## 目录
|
|
6
16
|
|
|
7
17
|
- [MapView Props](#mapview-props)
|
|
@@ -21,6 +31,10 @@
|
|
|
21
31
|
|
|
22
32
|
### 定位相关
|
|
23
33
|
|
|
34
|
+
> ⚠️ **权限要求**:使用定位功能需要用户授权
|
|
35
|
+
> - Android: `ACCESS_FINE_LOCATION` + `ACCESS_COARSE_LOCATION`
|
|
36
|
+
> - iOS: `NSLocationWhenInUseUsageDescription` (Info.plist)
|
|
37
|
+
|
|
24
38
|
| 属性 | 类型 | 默认值 | 说明 |
|
|
25
39
|
|------|------|--------|------|
|
|
26
40
|
| `myLocationEnabled` | `boolean` | `false` | 是否显示定位点 |
|
|
@@ -120,6 +134,8 @@ interface MapViewRef {
|
|
|
120
134
|
|
|
121
135
|
## 定位 API
|
|
122
136
|
|
|
137
|
+
> ⚠️ **权限要求**:所有定位 API 都需要定位权限,请确保已配置并获得用户授权
|
|
138
|
+
|
|
123
139
|
### 定位控制
|
|
124
140
|
|
|
125
141
|
| 方法 | 参数 | 返回值 | 说明 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gaode-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "一个功能完整的高德地图 React Native 组件库,基于 Expo Modules 开发,提供地图显示、定位、覆盖物等功能。",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
14
14
|
"expo-module": "expo-module",
|
|
15
15
|
"open:ios": "xed example/ios",
|
|
16
|
+
"npm:publish": "npm publish",
|
|
16
17
|
"open:android": "open -a \"Android Studio\" example/android"
|
|
17
18
|
},
|
|
18
19
|
"keywords": [
|