Skip to content

Commit 0177aad

Browse files
author
shengyonggen
committed
Release 1.18.1
1 parent be57e66 commit 0177aad

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# 新增经纬度公共属性
2+
3+
## 功能
4+
集成插件后,会自动获取经纬度坐标作为公共属性
5+
6+
## 集成
7+
```javascript
8+
import getLocation from '/dist/wechat/plugin/get-location/index.esm';
9+
sensors.usePlugin(getLocation);
10+
11+
// wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标
12+
getLocation.getLocation({type:'wgs84'});
13+
```
14+
15+
## 变动
16+
新增属性 `$geo_coordinate_system``$latitude``$longitude`
17+
18+
## ⚠ 注意
19+
* wx.getLocation 需要用户授权,用户授权后才能采集相关属性。
20+
* wx.getLocation 是异步采集,所以冷启动后首次打开页面,`$MPLaunch``$MPShow``$MPViewScreen` 有可能是采集不到经纬度属性。
21+
* 插件 getLocation() 方法需要在小程序应用授权的回调方法里面进行 API的调用,后续事件才会自动采集经纬度相关的属性。

0 commit comments

Comments
 (0)