我有一个地址列表(街道,城市,国家,邮编),我想找到lat和long来在谷歌地图上标记它们。 那可能吗?
答案 0 :(得分:2)
我认为Geocoding正是您所寻找的。 p>
答案 1 :(得分:0)
function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}