星期二, 10月 27, 2009

Create Google Maps


function CreatMap(address)
{
alert(address);
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map_canvas"));
var geocoder = new GClientGeocoder();

map.addControl(new GSmallMapControl());

geocoder.getLatLng(address, function(point) {
if (!point)
{
alert('Google Maps 可能發生問題或無法顯示該地區的地圖!'); //如果Google Maps無法顯示該地址的警示文字
}
else
{
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
});
}

}

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails