2011-07-12 6 views
3
enter code hereMKCoordinateRegion viewRegion; 
viewRegion = MKCoordinateRegionMakeWithDistance(CLLocationCoordinate2DMake(51.4998844,-0.1261814), 10*1000, 10*1000); 
[mapView setRegion:viewRegion animated:YES]; 

MapLocation *annotation; 
annotation = [[MapLocation alloc] init]; 
annotation.coordinate =CLLocationCoordinate2DMake(51.4998844, -0.1261814); 
annotation.placeTitle = [NSString stringWithString:@"London"]; 
[mapView addAnnotation:annotation]; 
[annotation release];`enter code here` 

半径10 kmのロンドン座標を設定しました。それから私はhttp://www.freemaptools.com/radius-around-point.htmと私のiPhoneのマップを比較します。私はfreemaptoolsが多くの場所とiPhoneマップを表示していることがわかりました。例えば、私はiPhone上で "White Stadt"を見たことはありませんでしたが、私はそれをfreemaptoolsで見ています。しかし、なぜ? 私の写真を見てください。MKMapViewの半径が正しくない理由

enter image description hereenter image description here

アップデート: 私は= 2 * 10スパンを追加しましたが、それは私を助けていないのです。我々はもっと多くの分野を見る。川で見てください。ドキュメントから enter image description here

+0

[この質問とネバンの回答](http://stackoverflow.com/questions/4724176/slight-zoom-on-mkcoordinateregion)を参照してください。あなたが(あなたのアップデートで)リクエストしたsetRegionがあなたが実際に得るものではない理由を説明するかもしれません。 – Anna

答えて

1

http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MapKitFunctionsReference/Reference/reference.html

latitudinalMeters( メートルで測定)北から南距離の量は、スパンに使用します。

longitudinalMetersスパンに使用するeast-to-west距離( で測定)の量。

これは、半径よりも直径に似ています。

2つのパラメータをそれぞれ2 * 10 * 1000に設定してみてください。

+1

それは私を助けません。 – Voloda2

関連する問題