current location from CoreLocation
- by Christian
I have an App which launches the google Map App. The code is:
UIApplication *app = [UIApplication sharedApplication];
[app openURL:[[NSURL alloc] initWithString: @"http://maps.google.com/maps?daddr=Obere+Laube,+Konstanz,+Germany&saddr="]];
The saddr= should be the current location. I get the current location with
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
NSLog(@"%f,%f", [newLocation coordinate]);
The Log displays the correct coordinates like
2010-04-05 15:33:25.436 deBordeaux[60657:207] 37.331689,-122.030731
I didn't find the right way to transmit the coordinates to the url-string. Does someone can give me a hint how-to?