Return to Snippet

Revision: 26180
at April 19, 2010 19:44 by espinallab


Initial Code
- (void)showDirections {
	if ([self.address length] == 0) return;
	//We create our link to the appDelegate
	ClubPlanetControllerAppDelegate * appDelegate = (ClubPlanetControllerAppDelegate *)[UIApplication sharedApplication].delegate;

	
	NSURL *myURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://maps.google.com/maps?daddr==%@&saddr=%f,%f", [self.address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [appDelegate.lat floatValue], [appDelegate.lon floatValue]]];
	[[UIApplication sharedApplication] openURL:myURL];
}

Initial URL
http://www.espinallab.com

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

Initial Title
Show Directions on Google Map in the iPhone.

Initial Tags
google

Initial Language
Objective C