我已将地图视图上的经度和纬度转换为MKMapPoint。然后,我想使用imageView的中心属性将imageView移动到该点。但是,似乎我需要将MKMapPoint转换为CGPoint,以便我可以更改中心位置,但数字似乎完全不对。以下是我正在使用的代码:
// Convert to MKMapPoint
CLLocationCoordinate2D coord;
coord.latitude = [loc.latitude doubleValue];
coord.longitude = [loc.longitude doubleValue];
MKMapPoint point = MKMapPointForCoordinate(coord);
// Move our image
CGFloat newXPos = point.x;
CGFloat newYPos = point.y;
CGPoint newCenter = {newXPos, newYPos};
self.movingMarker.center = newCenter;
//self.movingMarker.frame.origin.x = point.x;
//self.movingMarker.frame.origin.y = point.y;
如何使我的MKMapPoint成为可用于图像中心属性的有效值?