2012-05-31 110 views

回答

1

只要確保沒有調用「setUIToDefault」方法。

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
    <meta charset="utf-8" /> 
    <title>Google Maps JavaScript API Example: Simple Map</title> 
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI" 
      type="text/javascript"></script> 
    <script type="text/javascript"> 

    function initialize() { 
     if (GBrowserIsCompatible()) { 
     var map = new GMap2(document.getElementById("map_canvas")); 
     map.setCenter(new GLatLng(37.4419, -122.1419), 13); 
     //map.setUIToDefault(); 
     } 
    } 

    </script> 
    </head> 
    <body onload="initialize()" onunload="GUnload()"> 
    <div id="map_canvas" style="width: 500px; height: 300px"></div> 
    </body> 
</html>