Is it possible to get the turn by turn navigation using iOS Map Kit / Google Maps API or by launching iOS Maps /Google Maps with start and destination provided ?
The following code opens the native maps app with directions from the current location to a specified location. (Using Latitude & Longitude)
double latitude = **>>Your latitude<<**;
double longitude = **>>Your longitude<<**;
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:CLLocationCoordinate2DMake(latitude, longitude) addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark];
[mapItem setName:**>>Title of your desitnation<<**];
NSDictionary *options = @{
MKLaunchOptionsDirectionsModeKey:
MKLaunchOptionsDirectionsModeDriving,
MKLaunchOptionsMapTypeKey:
[NSNumber numberWithInteger:MKMapTypeStandard],
MKLaunchOptionsShowsTrafficKey:@NO
};
[mapItem openInMapsWithLaunchOptions:options];
If you want it to happen within your app you have to obtain the directions list (http://www.techotopia.com/index.php/Using_MKDirections_to_get_iOS_7_Map_Directions_and_Routes) and implement the turn-by-turn directions process yourself .
I am sure that Google Maps SDK prohibits such use by its license terms. I think however that you can do it with MapKit. There also many other online routing services.
You can always simply redirect the user to the Maps app. It's very simple but the user gets away from your app. See here: Programmatically open Maps app in iOS 6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With