if (SYSTEM_VERSION_LESS_THAN(@"6.0")) {//6.0以下,調用googleMap
NSLog(@"6.0以下,調用googleMap");
//注意經緯度不要寫反了
NSString * loadString=[NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%@,%@&daddr=%@,%@",self.myPositionWeiduString,self.myPositionJinduString,yweiduString,xjinduString];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:loadString]];
}else{
CLLocationCoordinate2D to;
//要去的目標經緯度
to.latitude = [yweiduString floatValue];
to.longitude = [xjinduString floatValue];
MKMapItem *currentLocation = [MKMapItem mapItemForCurrentLocation];//調用自帶地圖(定位)
//顯示目的地座標。畫路線
MKMapItem *toLocation = [[MKMapItem alloc] initWithPlacemark:[[[MKPlacemark alloc] initWithCoordinate:toaddressDictionary:nil] autorelease]];
toLocation.name = self.shopNameStirng;
[MKMapItem openMapsWithItems:[NSArray arrayWithObjects:currentLocation, toLocation, nil]
launchOptions:[NSDictionary dictionaryWithObjects:[NSArrayarrayWithObjects:MKLaunchOptionsDirectionsModeDriving, [NSNumber numberWithBool:YES], nil]
forKeys:[NSArrayarrayWithObjects:MKLaunchOptionsDirectionsModeKey, MKLaunchOptionsShowsTrafficKey, nil]]];
[toLocation release];
}