使用mapkit显示地图上两点之间的路线:ios7 [英] Display route between two points on map with mapkit :ios7

查看:160
本文介绍了使用mapkit显示地图上两点之间的路线:ios7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用中显示地图上两点之间的点对点路线。我正在使用 MKDirectionsRequest 为此。我正在尝试在pune到mumbai之间找到路线。我收到错误作为回复。

I want to display point to point route between two points on map with in my app. I am using MKDirectionsRequest for this.I am trying to find route between pune to mumbai.I am getting an error as a response.

错误消息:

Error Domain=MKErrorDomain Code=5 "Directions Not Available" UserInfo=0x9d80dd0 {
NSLocalizedFailureReason=A route to the nearest road cannot be determined., NSLocalizedDescription=Directions Not Available, MKDirectionsErrorCode=6, MKErrorGEOError=-403
}

MKDirectionsRequest 仅用于在地图应用上显示路线?
如何在不使用Google API或任何路由应用程序的情况下在iOS7中的两个点之间找到点对点路线?

Is MKDirectionsRequest for showing route on Maps app only? How can I find point to point route between two points in iOS7 without using Google API or any routing app?

你可以帮我解决一下吗? 。
期待您最终的任何参考链接或示例代码。

Can you please help me out regarding the same. Looking forward for any reference link or sample code from your end.

谢谢

推荐答案

最后我找到了问题的解决方案。 MKDirectionsRequest是找到两点之间路线的正确api。苹果似乎尚未为印度增加路线功能。我为其他国家尝试过,它对我有用。

Finally i found solution of my question. MKDirectionsRequest is the right api to find route between two points. It seems Apple has not added route feature for India yet. I tried for other country and it worked for me.

这篇关于使用mapkit显示地图上两点之间的路线:ios7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆