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?
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]];
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
http://maps.google.com/maps?saddr=-37.8218956215849,144.9599325656891&daddr=-37.8218956215849,144.9599325656891
It's just replacing start & end with the lat/langs.
http://maps.google.com/maps?saddr=start&daddr=end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With