I was wondering how I can open Google Maps from m开发者_StackOverflow社区y iphone app so that Google Maps shows the route when you arrive at the web page?
Today I use code that only shows the coordinate.
NSString *latlong = [NSString stringWithString: @"59.33267,18.07361"];
NSURL *url = [[[NSURL alloc] initWithString:[NSString stringWithFormat: @"http://maps.google.com/maps?ll=%@", [latlong stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ]] autorelease];
[[UIApplication sharedApplication] openURL:url];
Use the following format for url (you must specify both route start and endpoint):
"http://maps.google.com/maps?daddr=%f,%f&saddr=%f,%f"
精彩评论