try it,
NSString *urlstring=[NSString stringWithFormat:@"http://maps.google.com/?saddr=%f,%f&daddr=%f,%f",sourcelocation.latitude,sourcelocation.longitude,destinationlocation.latitude,destinationlocation.longitude]; [[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlstring]];
What the code does is it will show the route between your source and destination on the google map.
If you do not have longitude, you can do this: -
NSString * source=@ "NorthCarolina"; NSString * destination=@ "SouthCarolina"; NSString *urlstring=[NSString stringWithFormat:@"http://maps.google.com/?saddr=%@&daddr=%@",source,destination]; [[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlstring]];
Hope this helps you. Good coding :)
source share