tags:

views:

32

answers:

1

Hi!

I was wondering how I can open Google Maps from my 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];
+1  A: 

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"
Vladimir
Thank you very much, Vladimir!
Fernando Redondo
you're welcome :)
Vladimir