[英]Find coordinates using the address of the place
我有一個地址列表(街道,城市,國家,郵編),我想找到lat和long在谷歌地圖上標記它們。 那可能嗎 ?
我認為地理編碼是你正在尋找的。
對了謝謝
這就是我要找的東西
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);
}
});
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.