合理的缩放级别
我的 MapKit 代码是:
MKCoordinateRegion region;
region.center = location;
MKCoordinateSpan span;
span.latitudeDelta = .005;
span.longitudeDelta = .005;
region.span = span;
[mapView setRegion:region animated:TRUE];
跨度级别是 .005 ,当我在 iPhone 上测试时,缩放非常高,这是不实用的,我想要一个合理的缩放级别,那么我应该给跨度设置什么值?提前谢谢:)
my code for MapKit is that :
MKCoordinateRegion region;
region.center = location;
MKCoordinateSpan span;
span.latitudeDelta = .005;
span.longitudeDelta = .005;
region.span = span;
[mapView setRegion:region animated:TRUE];
the span level is .005 , when i test this on iPhone the zoom is very high which is not practical, i want a reasonable zoom level, so what value should i give to span ?? thx in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
跨度值以度为单位。 MKCooperativeSpan 文档解释了哪些内容转换为英里/公里。跨度越大意味着可见区域越大。
例如,如果纬度靠近赤道,则 0.01 约为 1 公里。 1.00 约为赤道 111 公里。 0.005 约为赤道半公里。什么是“合理”取决于您的应用程序的要求。
值 0.01 显示大约从埃菲尔铁塔到 Boucicaut 医院的视图。
The span values are in degrees. The docs for MKCoordinateSpan explain what that translates to in miles/kilometers. A larger span means a greater area is visible.
For example, 0.01 is about 1 km if the latitude is near the equator. 1.00 is about 111 km at the equator. 0.005 is about half km at the equator. What's "reasonable" depends on your app's requirements.
A value of 0.01 shows a view approximately from the Eiffel Tower to the Boucicaut Hospital.