Android中行车路线模式下如何计算两点之间的距离
每个人... 我有一些关于在 Android 中使用 Google Maps API 的 MapView 的问题要问。
我读过有关如何创建一个或更多地理点并找到 2 点之间的距离的内容。
仍然让我感到困惑的一件事是计算距离2点之间。我已经尝试找到结果,但如果条件是当我想在这些点之间画一条直线时,它就会被应用。但是,当我与maps.google.com交叉检查时,结果(距离)与这些点的相同纬度和经度不同。我意识到这是一种驾驶方向..
如果您看到图片,它不是一条直线,所以距离当然是不同的。那么在这种情况下,我如何在 Android 中计算这个距离呢?请告诉我制作它的代码......
everyone...
I have something to ask about using a MapView in Android with Google Maps API..
I've read about how to make a Geopoint or more and find a distance between 2 points..
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..
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,它会返回两点之间的直线距离。
您可以为此使用 Google Direction API ...这是此链接。
http://code.google.com/apis/maps/documentation/directions/
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/