2010-04-14 67 views

回答

3

是的,請點擊鏈接。每個不同的域都需要自己的API密鑰。

0

這通常爲我工作

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Google Maps</title> 
    <style> 
     #map-canvas { 
     width: 700px; 
     height: 600px; 
     position: absolute; 
     top: 40px; 
     left: 360px; 
     } 
    </style> 
    <script src="https://maps.googleapis.com/maps/api/js"></script> 
    <script> 
     function initialize() { 
     var mapCanvas = document.getElementById('map-canvas'); 
     var mapOptions = { 
      center: new google.maps.LatLng(44.5403, -78.5463), 
      zoom: 8, 
      mapTypeId: google.maps.MapTypeId.ROADMAP 
     } 
     var map = new google.maps.Map(mapCanvas, mapOptions) 
     } 
     google.maps.event.addDomListener(window, 'load', initialize); 
    </script> 
    </head> 
    <body> 
    <div id="map-canvas"></div> 
    </body> 
</html>