自己做网站需要服务器,建网站公司成都,广告联盟推广,做社交网站的预算开通时需详细描述业务#xff0c;否则可能审核不通过 可能需要绑定腾讯位置服务#xff0c;新建应该#xff0c;绑定到小程序 配置
权限声明#xff1a;在使用wx.getLocation前#xff0c;需要在app.json的permission字段中声明对用户位置信息的使用权限#xff0c;并提…开通时需详细描述业务否则可能审核不通过 可能需要绑定腾讯位置服务新建应该绑定到小程序 配置
权限声明在使用wx.getLocation前需要在app.json的permission字段中声明对用户位置信息的使用权限并提供一个合适的理由让用户明白为何需要这些权限。 permission: {scope.userLocation: {desc: 你的位置信息将用于...}},requiredPrivateInfos: [chooseLocation, getLocation],使用 wx.getLocation({type: wgs84, // 默认为wgs84的GPS坐标gcj02则返回可用于微信地图的坐标success: function (res) {const latitude res.latitude; // 纬度浮点数范围为90 ~ -90const longitude res.longitude; // 经度浮点数范围为180 ~ -180。const speed res.speed; // 速度以米/每秒计const accuracy res.accuracy; // 位置精度console.log(当前位置纬度 latitude , 经度 longitude, speed, accuracy);},fail: function (err) {console.log(获取位置失败, err);},complete: function () {// 成功或失败都会执行的回调}})