您的位置:首页 > 移动开发 > IOS开发

iOS调用系统自带地图导航

2016-12-09 15:50 253 查看
CLLocationCoordinate2D endCoor = CLLocationCoordinate2DMake(startCoor.latitude, startCoor.longitude);

MKMapItem *currentLocation = [MKMapItem mapItemForCurrentLocation];

MKMapItem *toLocation = [[MKMapItem alloc] initWithPlacemark:[[MKPlacemark alloc] initWithCoordinate:endCoor addressDictionary:nil]];

toLocation.name = @"to name";

[MKMapItem openMapsWithItems:@[currentLocation, toLocation] launchOptions:@{MKLaunchOptionsDirectionsModeKey:
MKLaunchOptionsDirectionsModeDriving,MKLaunchOptionsShowsTrafficKey: [NSNumber numberWithBool:YES]}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐