当前位置:   article > 正文

微信小程序获取当前城市位置及再次授权地理位置_微信小程序地图map重新定位

微信小程序地图map重新定位

一.微信小程序手机预览请求不到数据
https://blog.csdn.net/z9061/article/details/87936935
二.vue.js 父组件主动获取子组件的数据和方法、子组件主动获取父组件的数据和方法
https://blog.csdn.net/zhongshijun521/article/details/80610971
三.微信小程序-获取当前城市位置及再次授权地理位置
https://www.cnblogs.com/Super-scarlett/p/9451635.html
代码中有的百度url存在错误,所以附上笔者的代码
app.json

"permission": {
        "scope.userLocation": {
            "desc": "你的位置信息将用于小程序位置接口的效果展示"
        }
    },
  • 1
  • 2
  • 3
  • 4
  • 5
//定位方法
    getUserLocation: function () {
        var _this = this;
        wx.getSetting({
        success: (res) => {
            // res.authSetting['scope.userLocation'] == undefined    表示 初始化进入该页面
            // res.authSetting['scope.userLocation'] == false    表示 非初始化进入该页面,且未授权
            // res.authSetting['scope.userLocation'] == true    表示 地理位置授权
            if (res.authSetting['scope.userLocation'] !&#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/889387
推荐阅读
相关标签
  

闽ICP备14008679号