getLocation

发布于 7 年前作者 likong16588 次浏览最后编辑 7 年前来自 ask

wx.ready(function() {        wx.getLocation({            type: ‘gcj02’,            success: function (res) {              let lated = res.latitude; // 纬度,浮点数,范围为90 ~ -90              let lnged = res.longitude; // 经度,浮点数,范围为180 ~ -180。              var speed = res.speed; // 速度,以米/每秒计              var accuracy = res.accuracy; // 位置精度            },            cancel: function (res) {                          },            fail: function (res) {              _this.showToast(‘请前往设置界面,检查是否开启定位!’);            }        });      })

您好,我是公众号开发,想问一下,这个fail事件是判断手机是否开启定位的功能吗?如果是的话,是根据什么result判断的,如果不是的话,微信有api提供我判断嘛?

0 回复
暂无回复