2012-11-14 77 views

回答

1

看到這個例子。你可以得到一個想法。

谷歌地圖API樣品

function initialize() { 
    if (GBrowserIsCompatible()) { 
    var map = new GMap2(document.getElementById("map_canvas")); 
    map.setCenter(new GLatLng(37.4419, -122.1419), 13); 
    GEvent.addListener(map, "click", function() { 
     alert("You clicked the map."); 
    }); 
    } 
} 

</script> 

你可以在這個環節更多的例子。 http://code.google.com/apis/ajax/playground

+0

+1很好,很清楚。 – Rushi