iphone - 如何在 iPhone 中滚动 map 时跟踪 map 区域

标签 iphone ios google-maps

我完成了在 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/

相关文章:

iphone - 在 Linphone iPhone 中调用失败

iphone - SearchDisplay Controller 没有显示我的搜索结果

iphone - 如何模糊除 2 个节点之外的所有内容。 Spritekit( swift )

ios - Quickblox 推送通知失败

ios - AVCapture 在 iOS 7 中以 60 fps 捕获和获取帧缓冲区

android - Google Maps v2 In fragment 在点击两次时兑现

swift - 如何在谷歌地图(swift)中的两个标记之间绘制路线?

ios - [NSBundle appStoreReceiptURL] 的收据在应用程序更新后是否仍然存在

iphone - 是否有适用于iOS的实时线性相位均衡器?

google-maps - Google Maps Coordinate OAuth 范围问题