api介绍在http://code.google.com/apis/maps/documentation/directions/
用经纬度查询格式如下
http://maps.googleapis.com/maps/api/directions/xml?origin=32.045333,118.885803&destination=31.229243,121.451111&sensor=false
用地名查询格式如下,目前还不支持中文,只能用拼音。这是查询从南京到上海的距离
http://maps.googleapis.com/maps/api/directions/xml?origin=nanjing&destination=shanghai&sensor=false
还可以指定途中要经过的地点,这里是指定必须经过无锡和苏州,多个地名用|分隔
http://maps.googleapis.com/maps/api/directions/xml?origin=nanjing&destination=shanghai&waypoints=wuxi|suzhou&sensor=false
如果想获得json格式的输出,将xml替换为json
xml格式的返回结果中
/DirectionsResponse/route/leg/duration里面是时间
/DirectionsResponse/route/leg/distance里面是距离
用经纬度查询格式如下
http://maps.googleapis.com/maps/api/directions/xml?origin=32.045333,118.885803&destination=31.229243,121.451111&sensor=false
用地名查询格式如下,目前还不支持中文,只能用拼音。这是查询从南京到上海的距离
http://maps.googleapis.com/maps/api/directions/xml?origin=nanjing&destination=shanghai&sensor=false
还可以指定途中要经过的地点,这里是指定必须经过无锡和苏州,多个地名用|分隔
http://maps.googleapis.com/maps/api/directions/xml?origin=nanjing&destination=shanghai&waypoints=wuxi|suzhou&sensor=false
如果想获得json格式的输出,将xml替换为json
xml格式的返回结果中
/DirectionsResponse/route/leg/duration里面是时间
/DirectionsResponse/route/leg/distance里面是距离