We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be57e66 commit 0177aadCopy full SHA for 0177aad
dist/wechat/plugin/get-location/readme.md
@@ -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