为什么 MKMapView 显示不正确的半径
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 公里的伦敦坐标。然后我将我的 iphone 地图与 http://www.freemaptools.com/radius-around 进行比较-point.htm。我发现 freemaptools 显示的位置比 iPhone 地图多得多。例如,我在 iPhone 上没有看到“White Stadt”,但我在 freemaptools 上看到了它。但为什么? 请看我的照片。
更新: 我添加了 span = 2*10 但这对我没有帮助。我们看到了更多的领域。请看河边。
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`
I set London coordinate with 10 km radius. Then I compare my iphone map with http://www.freemaptools.com/radius-around-point.htm. I found that freemaptools shows many more locations then iPhone map. For example, I didn't see "White Stadt" on the iPhone but I see it on freemaptools. But, why?
Please , see my pictures.
Update:
I added span = 2*10 but it's not helps me. We see much more areas. Please see on the river.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自文档: http://developer. apple.com/library/ios/#documentation/MapKit/Reference/MapKitFunctionsReference/Reference/reference.html
这更像是直径而不是半径。
尝试将两个参数分别设置为 2*10*1000。
From the documentation: http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MapKitFunctionsReference/Reference/reference.html
Which is more like a diameter than a radius.
Try setting the two parameters to 2*10*1000 each.