之前做專案的時候有找過相關的資訊,不知道是不是你要的效果
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