Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link to Google Map directions from iPhone app

Tags:

cocoa-touch

I have been developing a location based application and would ideally like to link directly to the directions using the Google application.

I have seen a few applications such as AroundMe which already seem to do this but I can't work out how they have managed to implement it

like image 553
Anthony Main Avatar asked Dec 30 '22 05:12

Anthony Main


1 Answers

The question was about opening maps with the navigation directions displayed, not just the map. The iPhone's URL scheme supports a source & destination address - try, for example:

NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
like image 131
Jane Sales Avatar answered Feb 16 '23 23:02

Jane Sales