http://steven.427.blog.163.com/blog/static/1023673802013914643403/
调用系统地图
-(void)iosNavigation
{
CLLocationCoordinate2D endCoor = CLLocationCoordinate2DMake([_shopLatitude floatValue],[_shopLongitude floatValue]);
MKMapItem *currentAction = [MKMapItem mapItemForCurrentLocation];
MKMapItem *toLocation = [[MKMapItem alloc] initWithPlacemark:[[MKPlacemark alloc] initWithCoordinate:endCoor addressDictionary:nil]];
toLocation.name = _titleName;
[MKMapItem openMapsWithItems:@[currentAction, toLocation]
launchOptions:@{MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving,MKLaunchOptionsShowsTrafficKey: [NSNumber numberWithBool:YES]}];
}shopLatitude 和 shoplongitude 是导航终点经纬度 titleName 是终点显示的文字标题
本文详细介绍了如何使用iOS地图API实现从当前位置到指定坐标点的路径导航,包括地图项创建、路线规划以及启动地图应用的过程。通过设置终点经纬度和文字标题,实现了灵活的导航功能。
833

被折叠的 条评论
为什么被折叠?



