本文介绍了如何在Android的驾驶方向模式计算两点之间的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家...
我有话要问在Android中使用图形页面与谷歌地图API。

everyone...I have something to ask about using a MapView in Android with Google Maps API..

我读过有关如何制作的GeoPoint以上,并找到2点之间的距离。

I've read about how to make a Geopoint or more and find a distance between 2 points..

有一件事还是让我搞不清是关于计算2点之间的距离。我试过,找到的结果,但如果条件是,当我想使这些点之间的直线它的应用。但是,当我与maps.google.com交叉检查,结果(距离)与点的同一纬度和经度不同。我意识到,它是一种驱动方向的。

One thing that still makes me confuse is about calculating a distance between 2 points. I've tried and find the result but it's applied if the condition is when I want to make a straight line between those points. But, when I crosscheck with maps.google.com, the result (distance) is different with the same latitude and longitude of those points. And I realize that its a kind of a Driving Direction..

<一个href=\"http://maps.google.com/maps?f=d&source=s_d&saddr=-7.963292,%20112.608129&daddr=-7.96583,%20112.607633&hl=en&geo$c$c=FWR9hv8dgUO2Bg;FXpzhv8dkUG2Bg&mra=ls&sll=-7.963899,112.608469&sspn=0.002614,0.005284&ie=UTF8&ll=-7.964308,112.608774&spn=0.002614,0.005284&z=18\"相对=nofollow>例如谷歌地图的Web

如果您看到的画面,它不是一条直线所以当然的距离是不同的。所以,我怎么能计算这种情况下,Android的这个距离?并请告诉我code,使之...

If you see the picture, it's not a straight line so of course the distance is different. So how could I calculate this distance in Android in this case? And please show me the code to make it...

推荐答案

是的,它会回报你两点之间的直线距离..
您可以使用谷歌API的方向这...这里是链接这一点。

Yes it will return you the straight line distance between two point..you can use Google direction API for this ...Here is the link for this.http://code.google.com/apis/maps/documentation/directions/

这篇关于如何在Android的驾驶方向模式计算两点之间的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 06:06