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?
7
votes
3 Answers
14
votes
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]];
2
votes
Rob is right.
You can do something like below, just providing the Destination ( or start address )
http://maps.google.com/maps?daddr=-37.8218956215849,144.9599325656891
Or even
It's just replacing start & end with the lat/langs.