if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"baidumap://map/"]]){
NSString *urlString = [[NSString stringWithFormat:@"baidumap://map/direction?origin=latlng:%f,%f|name:我的位置&destination=latlng:%f,%f|name:终点&mode=driving",latitude, longitude, addrlati,addrlong] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString]];
}else{
if (!IS_OS_7_OR_LATER) {//6.0以下,调用googleMap
//注意经纬度不要写反了
NSString * loadString=[NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",_detailModel.salon.addrlati.floatValue,_detailModel.salon.addrlong.floatValue,_detailModel.salon.addr];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:loadString]];
}else{
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(addrlati, addrlong);
MKMapItem *currentLocation = [MKMapItem mapItemForCurrentLocation];//调用自带地图(定位)
//显示目的地坐标。画路线
MKMapItem *toLocation = [[MKMapItem alloc] initWithPlacemark:[[MKPlacemark alloc] initWithCoordinate:coord addressDictionary:nil]];
toLocation.name = _detailModel.salon.salonname;
[MKMapItem openMapsWithItems:[NSArray arrayWithObjects:currentLocation, toLocation, nil]
launchOptions:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:MKLaunchOptionsDirectionsModeDriving, [NSNumber numberWithBool:YES], nil]
forKeys:[NSArray arrayWithObjects:MKLaunchOptionsDirectionsModeKey, MKLaunchOptionsShowsTrafficKey, nil]]];
}