【发布时间】:2016-11-07 13:16:05
【问题描述】:
我有这个地理编码器代码:
function codeLatLng(lat, lng) {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(lat, lng);
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
console.log(results)
if (results[1]) {
//formatted address
alert(results[0].formatted_address)//this is a string of all location
} else {
alert("No results found");
}
} else {
alert("Geocoder failed due to: " + status);
}
});
}
我想将街道和门牌号保存在不同的变量中,我该怎么做?
【问题讨论】:
标签: javascript android cordova google-maps