简单谷歌demo示例

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="description" content=" " />
<title>谷歌地图 api测试</title>
<style>
.map {

width: 205px;
height: 192px;
text-align: center;
margin: 0 auto;

}
</style>
</head>
<body>   
<div id="res_map" class="map"></div>
<script src="http://ditu.google.cn/maps?file=api&amp;v=2&amp;&amp;key=ABQIAAAAHDyarwhqc8qoi6Hi4Fw2ABS7hG4ulivpH-Zy5ZAv91XflKVwfhRT3BrS_8CE9kMWp7UXsEngXSYF3A" type="text/javascript" charset="utf-8"></script> 
<script type="text/javascript" charset="utf-8">     
function show_small_map() 
{ 
if (GBrowserIsCompatible()) 
{  
var map = new GMap2(document.getElementById("res_map"));
function createMarker(latlng) 
{
       var marker = new GMarker(latlng);
       return marker;
}
map.setCenter(new GLatLng(23.1150614,113.4082905), 16);
var smc = new GSmallZoomControl3D;
map.addControl(smc);
var latlng = new GLatLng(23.1150614,113.4082905);
map.addOverlay(createMarker(latlng));  
 
}  
}
show_small_map();
</script>
</body>
</html>


你可能感兴趣的:(简单谷歌demo示例)