Reputation: 658
I want to call the maps application from my app, and sent it a url with latitude and longitude on source address and destination address (for navigation)
How do I construct the link?
Upvotes: 1
Views: 1015
Reputation: 119041
You should create an instance of MKMapItem
and use the openMapsWithItems:launchOptions:
method to open the maps app.
Check this reference.
For iOS 5 (which you should think about dropping support for) I think the format was:
[NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",
currentLocation.latitude, currentLocation.longitude,
destinationLocation.latitude, destinationLocation.longitude];
Upvotes: 2