Turn-by-turn Navigation in iOS 7

I am working on a navigation application to show turn by turn. In iOS 6, we need to transfer data to the ios map application, but I want to show it without leaving the application.

Apple introduced the new directions API in iOS 7, so now in iOS 7 you can show Turn By Turn Navigation in the application (in MKMapView)?

+7
ios iphone ios7 mapkit mkmapview
source share
2 answers

In iOS 7, you can use something like this to display the direction of movement in your application:

MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init]; [request setSource:[MKMapItem mapItemForCurrentLocation]]; [request setDestination:myMapItem]; [request setTransportType:MKDirectionsTransportTypeAny]; [request setRequestsAlternateRoutes:YES]; MKDirections *directions = [[MKDirections alloc] initWithRequest:request]; [directions calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse *response, NSError *error) { if (!error) { for (MKRoute *route in [response routes]) { [myMapView addOverlay:[route polyline] level:MKOverlayLevelAboveRoads]; } } }]; 
+2
source share

This page may be useful for you if you want to display paths between two locations. Alternatively, you can also use the Googles API, which is accepted by the apple.

http://iosguy.com/tag/directions-api/

https://developers.google.com/maps/documentation/directions/

0
source share

All Articles