天地图 javascript api 调用测试一例

<!DOCTYPE html>  
 <html>  
 <head> 
 <meta charset=GB2312"/>  
 <title>HELLO WORLD</title> 
 <script language="javascript" src="http://api.tianditu.com/js/maps.js"></script>  
 <script language="javascript">  
     var map,zoom = 12;  
     function onLoad()  
     {  

         //初始化地图对象  

         map=new TMap("mapDiv");  

         //设置显示地图的中心点和级别  

         map.centerAndZoom(new TLngLat(116.40969,39.89945),zoom);  

     }  

 </script>  

 </head>  

 <body onLoad="onLoad()">  

     <DIV style="POSITION: absolute; WIDTH: 500px; HEIGHT: 400px" id=mapDiv></DIV>  

 </body>  

 </html>  

你可能感兴趣的:(天地图 javascript api 调用测试一例)