Created
February 2, 2012 16:07
-
-
Save jagbolanos/1724258 to your computer and use it in GitHub Desktop.
Get Directions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delegate method from the CLLocationManagerDelegate protocol. | |
- (void)locationManager:(CLLocationManager *)manager | |
didUpdateToLocation:(CLLocation *)newLocation | |
fromLocation:(CLLocation *)oldLocation | |
{ | |
[self.locationManager stopUpdatingLocation]; | |
NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%0.6f,%0.6f&daddr=%@,%@", | |
newLocation.coordinate.latitude, | |
newLocation.coordinate.longitude, | |
[[self.bar objectForKey:@"location"] objectForKey:@"lat"], | |
[[self.bar objectForKey:@"location"] objectForKey:@"lng"]]; | |
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: urlString]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment