Created
July 18, 2015 08:34
-
-
Save mayooresan/6be63604a19413e309eb to your computer and use it in GitHub Desktop.
invoke Apple Maps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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