Iphone google maps – direction using latitude and longitude

google mapsiphone

I'm working on iphone app.
I know my current location (latitude and longitude) and destination's (latitude and longitude).
How can I use "Google maps" to find the directions. URL for google maps is something like "http://maps.google.com/maps?daddr=San+Francisco,+CA&saddr=cupertino"

From above URL, inspite of source and destination places i want to use latitude and longitude. how?

Best Answer

NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",
                                            currentLocation.coordinate.latitude, currentLocation.coordinate.longitude, 
                                            destLocation.coordinate.latitude, destLocation.coordinate.longitude];

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];
Related Topic