0
У меня есть этот геокодера код:PhoneGap geocoder.geocode получить номер дома из результатов
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, как его получить? – foo
Спасибо! много! – foo