事实上,谷歌地图并不总是在iframed区域排队好吗?

时间:2010-03-03 12:49:01

标签: javascript jquery google-maps

嵌入Google地图有哪些其他方式?

1 个答案:

答案 0 :(得分:1)

您可能想要使用Google Maps API。它将以<div>呈现,如下例所示:

<!DOCTYPE html>
<html> 
<head> 
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
   <title>Google Maps Basic Demo</title> 
   <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false" 
           type="text/javascript"></script> 
</head> 
<body onunload="GUnload()"> 

   <div id="map" style="width: 400px; height: 300px"></div> 

   <script type="text/javascript"> 

   if (GBrowserIsCompatible()) {
      var map = new GMap2(document.getElementById("map"));

      map.setUIToDefault();
      map.setCenter(new GLatLng(39.00, -77.00), 5);
   }
   </script> 
</body> 
</html>

Basig Map example