最近在搞地图方面的开发,想得知具体地点的经纬度,于是网上找了一下,发现在google与百度都要有提供这样的WebService服务
下面是一个具体的服务网址,使用的具体效果如下:
http://maps.googleapis.com/maps/api/geocode/json?address=中国广州白云宾馆&sensor=false
在浏览器地址栏回车后你就可以看到如下的内容:
{ "results" : [ { "address_components" : [ { "long_name" : "白云宾馆站", "short_name" : "白云宾馆站", "types" : [ "bus_station", "transit_station" ] }, { "long_name" : "越秀区", "short_name" : "越秀区", "types" : [ "sublocality", "political" ] }, { "long_name" : "广州", "short_name" : "广州", "types" : [ "locality", "political" ] }, { "long_name" : "中国", "short_name" : "CN", "types" : [ "country", "political" ] }, { "long_name" : "510060", "short_name" : "510060", "types" : [ "postal_code" ] } ], "formatted_address" : "中国广州市越秀区白云宾馆 邮政编码: 510060", "geometry" : { "location" : { "lat" : 23.136020, "lng" : 113.2880440 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 23.13736898029150, "lng" : 113.2893929802915 }, "southwest" : { "lat" : 23.13467101970850, "lng" : 113.2866950197085 } } }, "types" : [ "bus_station", "transit_station" ] } ], "status" : "OK" }
这样子我就可以知道具体位置的经纬度了!其中红色标记的就是经纬度!