I am trying to launch the maps app from my iPhone SDK app. Right now I can launch the maps app with directions but it goes to an overview of the directions and doesn’t use Siri and the voice navigation to give turn by turn directions.
currently I have a button that launches this code…
NSString *address = viewedObject.addressFull;
NSString *url = [NSString stringWithFormat: @"http://maps.apple.com/maps?saddr=%f,%f&daddr=%@", here.latitude, here.longitude, [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
With iOS 6 there’s a new way to launch maps, using
openMapsWithItems:inMKMapItem. Here’s a snippet that I use that provides walking or driving directions from current location to the provided coordinates:The way you are doing it, which you still have to do if running on pre-iOS 6 devices, you need to include the
dirflgin the URL to request walking or driving directions: