Maybe a dum question but I want to know how to set the latitude and longitude from a selected Annotation to a string so it will be useful for the Maps navigation. I've already found a way to use the UserLocation for the source address.
This is what I got so far:
myAnn = [[Annotations alloc]init];
location.latitude = 52.338847;
location.longitude = 4.937482;
myAnn.coordinate = location;
myAnn.title = @"My Title";
myAnn.subtitle = @"Rozenburglaan 1";
CarClicked is a method I use when the user touches the BlueCar Icon inside the selected Annotation:
- (void)carClicked {
myMapView.showsUserLocation = YES;
NSString *urlString = [NSString stringWithFormat:@"http://maps.apple.com/maps?saddr=%f,%f&daddr=cupertino", locationManager.location.coordinate.latitude, locationManager.location.coordinate.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
}
So the urlString certainly will be: @"http://maps.apple.com/maps?saddr=%f,%f&daddr=%f,%f"
What is the best way to set the daddr=%f,%f
with the selected annotation?
Many thanks