step1:申请腾讯地图密钥(key),
申请地址:传送门
step2:
//获取当前位置经纬度
wx.getLocation({
type: 'wgs84',
success: function (res) {
//console.log("获取当前经纬度:" + JSON.stringify(res));
//发送请求通过经纬度反查地址信息
var getAddressUrl = "https://apis.map.qq.com/ws/geocoder/v1/?location=" + res.latitude + "," + res.longitude + "&key=你的key值&get_poi=1";
common.Request(getAddressUrl, "get", "", function (ops) {
//console.log(JSON.stringify(ops));
})
}
})