700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 微信小程序获取当前经纬度

微信小程序获取当前经纬度

时间:2022-12-12 15:32:00

相关推荐

微信小程序获取当前经纬度

//预约到店 获取当前经纬度getLocation() {const that = this;uni.authorize({scope: 'scope.userLocation',geocode: true,success() { // 允许授权// that.getLocationInfo();uni.getLocation({ //获取经纬度信息type: 'wgs84',success(res) {let latitude, longitude;latitude = res.latitude.toString();longitude = res.longitude.toString();}});},fail() { // 拒绝授权// that.openConfirm();console.log("你拒绝了授权,无法获得周边信息")}})},

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。