font


Your key is:
ABQIAAAAdYLK_lYoKp8jQ4_HgIwcHxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSrgeFLmlNqJPs1xT4rnzEV8SGDjg



JavaScript Maps API Example

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true_or_false&amp;key=ABQIAAAAdYLK_lYoKp8jQ4_HgIwcHxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSrgeFLmlNqJPs1xT4rnzEV8SGDjg" type="text/javascript"></script>



HTTP Service Example

http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=json&oe=utf8\
&sensor=true_or_false&key=ABQIAAAAdYLK_lYoKp8jQ4_HgIwcHxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSrgeFLmlNqJPs1xT4rnzEV8SGDjg


http://code.google.com/apis/maps/documentation/geocoding/

 

 1       /// <summary>
 2       /// 获取两点(经纬度表示)间的距离
 3       /// </summary>
 4       /// <param name="p1Lat">第一点纬度值</param>
 5       /// <param name="p1Lng">第一点经度值</param>
 6       /// <param name="p2Lat">第二点纬度值</param>
 7       /// <param name="p2Lng">第二点经度值</param>
 8       /// <returns>返回两点间距离</returns>
 9       public double GetDistance(double p1Lat, double p1Lng, double p2Lat, double p2Lng)
10       {
11          double dLat1InRad = p1Lat * (Math.PI / 180);
12          double dLong1InRad = p1Lng * (Math.PI / 180);
13          double dLat2InRad = p2Lat * (Math.PI / 180);
14          double dLong2InRad = p2Lng * (Math.PI / 180);
15          double dLongitude = dLong2InRad - dLong1InRad;
16          double dLatitude = dLat2InRad - dLat1InRad;
17          double a = Math.Pow(Math.Sin(dLatitude / 2), 2+ Math.Cos(dLat1InRad) * Math.Cos(dLat2InRad) * Math.Pow(Math.Sin(dLongitude / 2), 2);
18          double c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
19          double dDistance = EarthRadiusKm * c;
20          return dDistance;
21       }
22 
23       /// <summary>
24       /// Radius of the Earth
25       /// </summary>
26       public double EarthRadiusKm = 6378.137// WGS-84 

 

 

posted @ 2010-02-09 11:38  风轻如梦  阅读(221)  评论(0编辑  收藏  举报