Show Directions on Google Map in the iPhone.

/ Published in: Objective C
Save to your folder(s)

Here is a peace of code from one of my project to show you how you to show directions on the Google Map application.

Copy this code and paste it in your HTML
  1. - (void)showDirections {
  2. if ([self.address length] == 0) return;
  3. //We create our link to the appDelegate
  4. ClubPlanetControllerAppDelegate * appDelegate = (ClubPlanetControllerAppDelegate *)[UIApplication sharedApplication].delegate;
  7. NSURL *myURL = [NSURL URLWithString:[NSString stringWithFormat:@",%f", [self.address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [ floatValue], [appDelegate.lon floatValue]]];
  8. [[UIApplication sharedApplication] openURL:myURL];
  9. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.