【发布时间】:2012-03-16 10:37:36
【问题描述】:
我已完成以最大化缩放级别在 iPhone 中显示当前位置的地图视图。
但现在我想在地图视图中跟踪 任何滚动 以获取其可见区域。
如果是的话,是否有任何事件可以做到这一点??
如果没有怎么可能?
【问题讨论】:
标签: iphone ios google-maps
我已完成以最大化缩放级别在 iPhone 中显示当前位置的地图视图。
但现在我想在地图视图中跟踪 任何滚动 以获取其可见区域。
如果是的话,是否有任何事件可以做到这一点??
如果没有怎么可能?
【问题讨论】:
标签: iphone ios google-maps
是的,可以通过 mapView 的委托来实现。
- (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];
}
【讨论】:
delegate。 :)