开发者

Get driving distance betwwen two points

hi all need help on this. I am using below link to get direction: http://maps.google.com/maps/api/directions/xml?origin=49.75332,6.50322&destination=49.71482,6.49944&mode=walking&sensor=false

wheb i hit above url in browser then i get开发者_如何学Go xml response, can anyone tell me how to fetch shortest distance from that response(XML). i need distance only, not direction. plz suggest.


Looking at response, I see that every step element has got

<distance>
<value>490</value>
<text>0.5 km</text>
</distance>

distance element, which gives you value and text, 490 seems to me 490 meters, So you can just sum up all the distance value to get you distance in meters and convert them to whichever scale you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜