Skip to content

Instantly share code, notes, and snippets.

@mayooresan
Created July 18, 2015 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayooresan/6be63604a19413e309eb to your computer and use it in GitHub Desktop.
Save mayooresan/6be63604a19413e309eb to your computer and use it in GitHub Desktop.
invoke Apple Maps
//new navigation code for apple navigation
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(self.m_lattitutef,self.m_longitutef);
NSLog(@"%f - %f", self.m_longitutef, self.m_lattitutef);
MKPlacemark *place = [[MKPlacemark alloc]
initWithCoordinate:coords addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
//current location
MKMapItem *mapItem2 = [MKMapItem mapItemForCurrentLocation];
NSArray *mapItems = @[mapItem2,mapItem];
NSDictionary *options = @{
MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving,
MKLaunchOptionsMapTypeKey:
[NSNumber numberWithInteger:MKMapTypeStandard],
MKLaunchOptionsShowsTrafficKey:@YES
};
[MKMapItem openMapsWithItems:mapItems launchOptions:options];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment