Chinaunix首页 | 论坛 | 博客
  • 博客访问: 533746
  • 博文数量: 78
  • 博客积分: 1913
  • 博客等级: 上尉
  • 技术积分: 829
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-14 21:29
文章分类

全部博文(78)

文章存档

2011年(27)

2010年(26)

2009年(20)

2008年(5)

我的朋友

分类: 系统运维

2011-03-02 11:01:54

1. 查询地区经纬度, 返回JSON格式数据包

  1. {
  2.   "name": "shenzhen",
  3.   "Status": {
  4.     "code": 200,
  5.     "request": "geocode"
  6.   },
  7.   "Placemark": [ {
  8.     "id": "p1",
  9.     "address": "Shenzhen, Guangdong, China",
  10.     "AddressDetails": {
  11.    "Accuracy" : 4,
  12.    "Country" : {
  13.       "AdministrativeArea" : {
  14.          "AdministrativeAreaName" : "广东省",
  15.          "Locality" : {
  16.             "LocalityName" : "深圳市"
  17.          }
  18.       },
  19.       "CountryName" : "中国",
  20.       "CountryNameCode" : "CN"
  21.    }
  22. },
  23.     "ExtendedData": {
  24.       "LatLonBox": {
  25.         "north": 22.7809313,
  26.         "south": 22.3293893,
  27.         "east": 114.3553162,
  28.         "west": 113.7524414
  29.       }
  30.     },
  31.     "Point": {
  32.       "coordinates": [ 114.0578680, 22.5430990, 0 ]
  33.     }
  34.   } ]
  35. }
2. 显示行车路线(比如从深圳到南昌)



3. 显示一张静态图(比如从深圳到香港)
|label:
S|22.5430990,114.0578680&markers=color:green|label:H|22.2828305,114.1576130&sensor=false

当然我们也可以在后面加上output=参数,

output=
 Output format (blank (default) is a standard webpage for user)
  • output=html Uses the old style Google Local page format from before it merged with Google Maps, with the small map and large sidebar although this appears to display the standard format since June 2010. Use output=mobile for a similar effect.
  • output=js Outputs JavaScript object literals and function calls used by Google Maps, including encoded polyline data for driving directions, and stage information in HTML format.
  • output=kml Outputs a KML file containing information representing the current map. (works with Normal Searches, Directions and MyMaps)
  • output=mobile Uses a similar style to the old style Google Local page format from before it merged with Google Maps. Displays a single red pushpin in the centre of map image. All movements are performed by links rather than mouse movements.
  • output=nl Outputs a small KML file containing a NetworkLink wrapper linking to a URL from which Google Earth and Google Maps can obtain the information (only known to work with MyMaps).
  • output=embed Outputs HTML suitable for embedding in third party sites, only works with the presence of the encrypted s= param, presumably to stop arbitrary content being included.
  • output=dragdir returns a JSON object that contains the reverse geocode and a an encoded polyline for a given saddr (start point of the route) and daddr (endpoint of the route)
  • output=georss (Geo)RSS output for the current map - probably only MyMaps




详见:
阅读(1339) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~