开发者

Open Google Maps from iPhone and show route

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"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜