google map 应用学习网站

Google Maps API中文同步文档

http://www.codechina.org/doc/google/gmapapi/

 

Google 地图 API

主页 http://code.google.com/intl/zh-CN/apis/maps/

文档 http://code.google.com/intl/zh-CN/apis/maps/documentation/index.html

API  http://code.google.com/intl/zh-CN/apis/maps/documentation/reference.html 

 

 

 Google Map学习(一) 简单的Google Map,Google Map基础

http://www.cnblogs.com/psunny/archive/2009/08/26/1554476.html

 

Google 地图 API 示例 - 地理学习小游戏

http://code.google.com/intl/zh-CN/apis/maps/documentation/demos/geogame/geogame.html

 

 

贴一个自己测试的html上来:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
<html xmlns="http://www.w3.org/1999/xhtml">   
  <head>   
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>   
    <title>Google Maps JavaScript API Example</title>   
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA4ZZxnijCQhlZlf57igoGExTwM0brOpm-All5BF6PoaKBxRWWERR0mYEVnCnlZi8Qmoq3uoivZ9cIgQ"  
            type="text/javascript"></script>   
    <script type="text/javascript">   
    //<![CDATA[   
  
    function load() {   
      if (GBrowserIsCompatible()) {   
        var map = new GMap2(document.getElementById("map"));   
        map.setCenter(new GLatLng(39.917, 116.397), 14);   
      }   
  
      var map2 = new GMap2(document.getElementById("map2"));   
      map2.setCenter(new GLatLng(37.4419, -122.1419), 13);   
      window.setTimeout(function() {   
        //panTo后的大小和上面的setCenter不一样的   
        //map2.panTo(new GLatLng(39.917, 116.397),14);   
        map2.panTo(new GLatLng(39.917, 116.397));//后面一个参数无效的   
      }, 2000);   
  
      var map3 = new GMap2(document.getElementById("map3"));   
      map3.setCenter(new GLatLng(39.917, 116.397), 14);   
      map3.openInfoWindow(map.getCenter(),   
              document.createTextNode("Hello, world"));   
    } 
	//根据经纬度计算两点距离
  var distance = new GLatLng(39.917, 116.397).distanceFrom(new GLatLng(37.4419, -122.1419));
  alert(parseInt(distance/1000,10) + "公里");
    //]]>   
    </script>   
  </head>   
  <body οnlοad="load()" οnunlοad="GUnload()">   
    <div id="map" style="width: 500px; height: 200px"></div>   
    <div id="map2" style="width: 500px; height: 200px;margin-top:10px;"></div>   
    <div id="map3" style="width: 500px; height: 200px;margin-top:10px;"></div>   
  </body>   
</html>  

  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值