Posted By

espinallab on 04/19/10


google map MapKit

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Show Directions on Google Map in the iPhone.

 / Published in: Objective C


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

  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
Posted By: clearbrian on June 30, 2010

daddr== should be daddr=

Use local version of google maps to improve search change to to localise search to UK .fr for france etc

Posted By: clearbrian on June 30, 2010

other parameters us can pass in url to improve search

You need to login to post a comment.