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