MapKit CLLocationCoordinate2D把我放在了错误的位置

时间:2014-09-11 18:44:36

标签: ios mapkit mkannotation cllocation cllocationcoordinate2d

这应该是洛杉矶:

double latitude = 34.05;
double longitude = 118.25;

CLLocationCoordinate2D location = CLLocationCoordinate2DMake(latitude, longitude);

NSString *desc = @"hey there";
NSString *address = @"some address";

CLLocationCoordinate2D coordinate;
coordinate.latitude = location.latitude;
coordinate.longitude = location.longitude;
MyLocation *annotation = [[MyLocation alloc] initWithName:desc address:address coordinate:coordinate]; //implements <MKAnnotation>

NSArray *annotations = @[annotation];
[self.mapView showAnnotations:annotations animated:YES];

但是这个注释最终会在中国东部。我在转换中缺少什么?

1 个答案:

答案 0 :(得分:2)

我想你想要洛杉矶的-118.25度。