Google map輸入住址後直接show map的應用 - Google

Table of Contents


之前做專案的時候有找過相關的資訊,不知道是不是你要的效果


function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert("很抱歉,我們找不到"" + address + ""這個地址。");
} else {
map.setCenter(point, 15);
var marker = new GMarker(point);
}
}
);
}
}


--

<form action="#" onsubmit="showAddress(this.address_sreach.value); return fal
se">
<input type="text" name="address_sreach" value=""/>
<input type="submit" value="Go!"/>
</form>


--

All Comments

Ingrid avatarIngrid2009-09-13
謝謝您的回答,但這是在已經有google map的網頁中使用的
Selena avatarSelena2009-09-17
小弟要的是,在店家註冊資訊中填寫店家的住址之後,系統
會自動找到此店家地址在google map上的位置,也就是HTML
Jessica avatarJessica2009-09-22
的語法<iFrame>....</iFrame>,會這麼做的需求是讓使用者
Daniel avatarDaniel2009-09-26
不用自行到google map上找尋自己位置的HTML語法,來減輕
使用者的負擔,謝謝。