MKMapview の座標をビュー内の cgpoint に変換しようとしています。
これが私がやっていることです:
CGPoint point = [map convertCoordinate:coord toPointToView:self.view];
NSLog(@"lat = %f, lon = %f", coord.latitude, coord.longitude);
NSLog(@"x = %f, y = %f", point.x, point.y);
私が得ている出力は次のとおりです。
lat = 243568961.394369, lon = 165303343.177200
x = nan, y = nan
SOに関する他の質問を見てきましたが、これが正しい方法のようです。
お役に立てれば幸いです。
編集
ログに記録されている座標 (coord) が、意図した実際の座標ではないことに気付きました。
この座標を取得する方法は次のとおりです。
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(tileOverlay.mapRect.origin.x, tileOverlay.mapRect.origin.y);
そのため、MKTileOverlay の MKMapRect から座標を取得することに問題があると思います。