nitesh meshram
nitesh meshram

Reputation: 281

MapKit - How can I implement directions from Source and Destination in my iphone app using MapKit?

How can i get the shortest distance from source A to Destination B using the MapKit in iphone. Is there any way to implement this? Thank you.

Upvotes: 1

Views: 1527

Answers (2)

Ved
Ved

Reputation: 612

Assuming that you are looking for routing, you need to fetch the routes from a routing server. Check Google directions API. CloudMade also has routing api. I don't think MapKit provides a way to fetch routes and find shortest distance.

If you are looking for straight line distance use:

CLLocation *aLocation = …
CLLocation *differentLocation = …
[aLocation distanceFromLocation:differentLocation];

Upvotes: 1

adam
adam

Reputation: 22587

For route mapping, I'm pretty sure the best option is still to fire up the maps application appropriately parameterised....

Try here http://mobile.tutsplus.com/tutorials/iphone/iphone-sdk-quick-tip-launching-maps-in-app/

Thanks

Upvotes: 0

Related Questions