(在Hbuilder环境下是能获取的,在android studio环境下只能获取city district)(地图是正常的 )
try {
plus.geolocation.getCurrentPosition(function(p) {
var address = p.address.city + p.address.district + p.address.street + (p.address.streetNum != undefined ? p.address.streetNum : "") + (p.address.poiName != undefined ? p.address.poiName : "");
jQuery("#city").text(p.address.city);
jQuery("#district").text(p.address.district);
jQuery("#street").text(p.address.street);
jQuery("#streetNum").text(p.address.streetNum);
jQuery("#poiName").text(p.address.poiName);
jQuery("#address").text(p.addresses);
drawMap(address, "map", p.addresses);
},
function(e) {
jQuery("#address").text(e.message);
}, {
enableHighAccuracy:true
});
} catch(e) {
jQuery("#address").text(e.message);
}
2 个回复
w***@21cn.com
可以根据经纬度单独调用百度的逆地址解析api
全村最帅的希望 (作者) - 18线移动前端小码农
用高德地图就正常了 定位百度没有高德好