Iphone google maps - direction using latitude and longitude

I am working on an iphone application. I know my current location (latitude and longitude) and destination (latitude and longitude). How can I use Google Maps to find directions. The URL for Google Maps is something like http://maps.google.com/maps?daddr=San+Francisco,+CA&saddr=cupertino "
From the above URL, unlike sources and destinations, I I want to use latitude and longitude. How?

+5
source share
3 answers
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]];
+13
source

Have you tried just sticking to latitude and longitude as parameters? In my experience, the Google API is pretty free of what you can invest in them. The Google Local API can accept almost everything, including lat lng as a request, for example.

0
source

All Articles