How to associate Google Map routes with an iPhone app

I am developing a location-based application, and ideally would like to directly associate it with directions using the Google application.

I have seen several applications, such as AroundMe, that already seem to be doing this, but I cannot figure out how they managed to implement it.

+4
source share
2 answers

The question was to open maps with displayed navigation directions, and not just with the map. The iPhone URL scheme supports source and destination addresses - try, for example:

NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK"; [[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]]; 
+10
source

Use OpenURL to run Google maps with the correct location, as described in fooobar.com/questions/82031 / ....

Remove from there: use

 [someUIApplication openURL:[[NSURL alloc] initWithString: @"http://maps.google.com/maps?g=London"]] 

instead of g=London you can also use more for the URL format to remove pins or move to a GPS location (perhaps the current location that you previously received from your application by requesting the main location)

Unrelated:

Please comment if anyone has a suggestion on how to handle duplicates and / or related stack overflow issues. I'm still a beginner :-)

0
source

All Articles