Tag Archive for 'route'

Drawing polyines or routes on a map view in iOS4

Drawing routes on MKMapView is dramatically simplified in iOS4. There are predefined helper classes, which make it much more easier than in iOS3. Although little C coding required, the whole process can be done in a few lines of code.
Here is a great tutorial with downloadable sample project: The Reluctant Blogger

Displaying route with iOS Maps application

To easily display a route between two locations with the built-in Maps app (iOS 4 is recommended for multitasking), insert the following code into your app:
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=Current\%20Location&daddr=%f,%f", destCoordinate.latitude, destCoordinate.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];

Source: Stackoverflow.com