Display route between two points on map with mapkit :ios7

杀马特。学长 韩版系。学妹 提交于 2019-12-04 21:35:54

问题


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 message :

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
}

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.

Thanks


回答1:


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.




回答2:


Apple map directions feature available countries list is in this link.

Please check the link before implement the directions.



来源:https://stackoverflow.com/questions/19035752/display-route-between-two-points-on-map-with-mapkit-ios7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!