开发者

Open Google Maps from iPhone and show route

开发者 https://www.devze.com 2023-01-17 04:23 出处:网络
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?

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

精彩评论

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