我完成了在 iPhone 中以最大化缩放级别显示当前位置的 map View 。
但现在我想在 map View 中跟踪任何滚动以获得其可见区域。
是否有任何事件可以做到这一点,如果是,那么怎么做?
如果不是怎么可能?
最佳答案
是的,可以通过 mapView 的委托(delegate)实现。
- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated
{
// This method is called whenever the currently displayed map region changes.
// During scrolling, this method may be called many times to report updates to the map position.
// Therefore, your implementation of this method should be as lightweight as possible to avoid affecting scrolling performance.
// *Straight from Apple's documentation
MKMapRect visibleRect = [mapView visibleMapRect];
}
关于iphone - 如何在 iPhone 中滚动 map 时跟踪 map 区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9735728/