Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display route between two points on map with mapkit :ios7

Tags:

ios7

mapkit

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

like image 911
Chaya Avatar asked Sep 26 '13 18:09

Chaya


1 Answers

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.

like image 68
Chaya Avatar answered Oct 21 '22 03:10

Chaya