获取位置信息
发布于 5 年前 作者 dcui 3880 次浏览 来自 问答

wx.getLocation({

    type: “gcj02”,

    success: function (res) {

        console.log(res.longitude);

        console.log(res.latitude);

    },

    fail: function (res) {

        console.log(res)

    }

});

在获取位置时,微信获取位置权限和小程序获取位置权限是打开的,手机定位 位置也是开启状态,是因为什么情况一直走fail错误的返回,是因为手机GPS信号弱还是因为网速慢

2 回复

我也遇到一样的问题,楼主有好的方法解决么

看代码没什么问题啊,你把res转成字符串打印出来看看

回到顶部