简体   繁体   English

如何找到覆盖两点之间距离的持续时间

[英]How to find time duration of covering a distance between two points

I have drawn a route between the source point to the destination point and I have also found the distance between them by using CoreLocation Framework method " distanceFromLocation ", but now I want to find time duration of covering a distance between these two points. 我在源点目的点之间绘制了一条路线,并且还使用CoreLocation Framework方法“ distanceFromLocation ”找到了它们之间的距离 ,但是现在我想找到覆盖这两个点之间距离的持续时间。

I have seen many guidelines but I have so far failed to get any solution. 我看过许多准则,但到目前为止,我没有找到任何解决方案。 Can anyone please guide me to a solution or help answer how to do this? 谁能指导我找到解决方案或帮助回答如何做?

Thanks in advance. 提前致谢。

You probably want to build a route from source to destination point. 您可能要构建一条从源到目的地的路由。 You can do it either using Apple Maps or google maps. 您可以使用Apple Maps或google maps进行操作。 If you choose apple maps then you need to construct MKDirectionsRequest object (see documentation ). 如果选择苹果地图,则需要构造MKDirectionsRequest对象(请参阅文档 )。 When you get a response you can check routes that Apple suggests you in MKDirectionsResponse object. 收到响应后,您可以在MKDirectionsResponse对象中检查Apple建议您的路由。 Each MKRoute object has an expectedTravelTime property 每个MKRoute对象有一个expectedTravelTime财产

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM