Wechat applet can not use wx.getlocation solution

If the wx.getlocation API cannot be used, there may be the following problems:

1. Did not apply for wx.getlocation API on the Mini Program Development Platform;

2. No configuration is declared in the app.json file;

"permission": {
    "scope.userLocation": {
      "desc": "你的位置信息将用于小程序位置接口的效果展示"
     }
 },
 "requiredPrivateInfos" : [ "getLocation" ]

3. The development version library is relatively high, try to adjust to 2.25.3;

4. Open the three dots in the upper right corner of the WeChat Mini Program page, open the Mini Program Settings, and check whether the use of location information is allowed.

Guess you like

Origin blog.csdn.net/weixin_50836184/article/details/130031352