pni*_*zle 15
接受的答案将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];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4528 次 |
| 最近记录: |