我想知道是否可以在应用程序本身中实现转弯导航。目前我正在使用这段代码。
-(void)viewWillAppear:(BOOL)animated{
//home location
CLLocationCoordinate2D coords =
CLLocationCoordinate2DMake(51.044242,5.621653);
MKPlacemark *place = [[MKPlacemark alloc]
initWithCoordinate:coords addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
//current location
MKMapItem *mapItem2 = [MKMapItem mapItemForCurrentLocation];
NSArray *mapItems = @[mapItem, mapItem2];
NSDictionary *options = @{
MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving,
MKLaunchOptionsMapTypeKey:
[NSNumber numberWithInteger:MKMapTypeStandard],
MKLaunchOptionsShowsTrafficKey:@YES
};
[MKMapItem openMapsWithItems:mapItems launchOptions:options];
}
这很好用,但它会打开本机应用程序。是否可以在不离开应用程序的情况下在应用程序本身中显示这一点?
亲切的问候