没有加载缩放的MKMapView图块 [英] MKMapView tiles not loaded with zoom
问题描述
我有一个问题。我正在使用 MKMapView
来显示一些注释。我使用默认缩放初始化地图视图。并显示一些地图。
I've got an issue. I'm using a MKMapView
for displaying some annotations. I initialize a map view with default zoom. And it displays some map.
但是当我尝试缩放时,瓷砖未加载,并且地图变空。喜欢这个。
but when i try zooming, tiles not loaded, and map becomes empty. Like this.
我通过界面构建器创建我的Map View。
I create my Map View via interface builder.
@property (nonatomic, weak) IBOutlet MKMapView* mapView;
我做错了什么?是否有任何强制实施方法,会影响这一功能?是的,我的设备上有互联网连接。
What am I doing wrong? Is there any mandatory methods for implementation, that affect on this functional? And yes, there is an internet connection on my device.
推荐答案
通常这可能是由于互联网连接造成的。如果您的互联网连接速度慢于加载地图图块所需的时间。
Generally this can happens due to internet connection. If you have slow internet connection than it takes time to load map tiles.
关于我建议覆盖以下方法的方法。
About methods i recommended to override below method.
覆盖 MKMapView
委托方法 -
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
每次放大时都会调用/ out和load map tiles。
Will call every time you zoom in/out and load map tiles.
PS - 向视图控制器提供 MKMapViewDelegate
。
PS - provide MKMapViewDelegate
to your view controller.
这篇关于没有加载缩放的MKMapView图块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!