Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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