问题描述
我需要找到2个位置之间的行驶距离.我不需要在地图上显示方向,只需计算距离,我就需要在应用程序中使用该距离.
I need to find the driving distance between 2 locations. I do not need to display the directions in a map, just need to calculate the distance, which I need to use in my application.
MapKit允许吗?有没有可以使用的替代方法?
Does MapKit allow this? Is there an alternative that can be used?
我能够使用CloudMade进行地理编码,但是似乎没有选择来获得行驶距离的方法.
I am able to get forward geo-coding using CloudMade, but there doesn't seem to be an option to obtain driving distance.
感谢任何帮助.
推荐答案
CloudMade还提供了行车路线.如果您仅对距离感兴趣,只需忽略说明.
CloudMade also offers driving directions. If you are only interested in the distance, simply ignore the instructions.
API调用看起来像这样:
An API-Call looks like this:
并且JSON包含
....
route_summary: {
total_distance: Distance in meters,...
这篇关于在iPhone中计算行驶距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!