2013-04-12 47 views

回答

-4

更新答案.......

CGPoint newCenter = [self.mapView convertCoordinate:coordinates toPointToView:self.mapView]; 
+4

給出OP a -1,因爲接受的答案沒有采用他們想要轉換的類型。對於我們這些人尋找原始問題的答案毫無幫助。 – bobsmells

+3

請不要複製他人的答案。 – Matt

+0

@Matt是的,但我之前發佈的答案不是。它不復制我只修改它。 –

13

接受的答案覆羽CLLocationCoordinate2D到CGPoint,這是不是被要求在實際的問題。對於那些在這裏尋找完整答案的人:

MKMapPoint mapPoint = MKMapPointMake(22.1, 34.4);//example 

//first convert MKMapPoint to CLLocationCoordinate2D 
CLLocationCoordinate2D mapPointCoordinate = MKCoordinateForMapPoint(mapPoint); 

//second convert CLLocationCoordinate2D to CGPoint 
CGPoint pointAsCGPoint = [self.mapView convertCoordinate: mapPointCoordinate toPointToView: self.mapView]; 
+0

之前任何人downvotes:接受的答案在我的文章後編輯,所以現在看起來像我的文章是副本。相信upvotes :) – pnizzle

相關問題