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));
})
}
})
版权声明:本文为weixin_44671184原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。