Skip to content

Commit 82fa6c1

Browse files
authored
Update README.md
1 parent 1b22e6f commit 82fa6c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ AMapGeolocation.setLocatingWithReGeocode(true);
161161
// 开始定位
162162
AMapGeolocation.start();
163163
// 停止更新位置信息
164-
AMapGeolocation.start();
164+
AMapGeolocation.stop();
165165
// 是否已经开始持续定位了
166166
AMapGeolocation.isStarted();
167167
// 在某些情况获取不到数据,建议使用 `addLocationListener` 来实现
@@ -192,6 +192,9 @@ if (Platform.OS === 'android') {
192192
AMapGeolocation.setApiKey(apiKey);
193193
// 定位是否返回逆地理信息
194194
AMapGeolocation.setLocatingWithReGeocode(true);
195+
196+
// 必须,启动开始定位,addLocationListener 监听函数才有效
197+
AMapGeolocation.start();
195198
// 当设备可以正常联网时,还可以返回该定位点的对应的中国境内位置信息(包括:省、市、区/县以及详细地址)。
196199
const listener = AMapGeolocation.addLocationListener((location) => {
197200
console.log('返回定位信息', location);

0 commit comments

Comments
 (0)