iOS。如何在使用此地图执行每个操作后获取有关当前地图矩形的信息?

发布于 2024-12-05 01:39:42 字数 60 浏览 1 评论 0原文

例如,我想显示地图矩形当前的x、y、宽度和高度,但我不知道应该处理哪些事件。至少我想捕捉双击、缩放和拖动。

For example, I want to display the current x, y, width and height of the map rect, but I don't know what events should I handle. At least I want to catch the double click, zoom and dragging.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁把谁当真 2024-12-12 01:39:42

查看 MKMapViewDelegate 协议的文档。您有以下可用方法: http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.html

– mapView:regionWillChangeAnimated:
– mapView:regionDidChangeAnimated:
– mapViewWillStartLoadingMap:
– mapViewDidFinishLoadingMap:
– mapViewDidFailLoadingMap:withError:
– mapViewWillStartLocatingUser:
– mapViewDidStopLocatingUser:
– mapView:didUpdateUserLocation:
– mapView:didFailToLocateUserWithError:
– mapView:viewForAnnotation:
– mapView:didAddAnnotationViews:
– mapView:annotationView:calloutAccessoryControlTapped:
– mapView:annotationView:didChangeDragState:fromOldState:
– mapView:didSelectAnnotationView:
– mapView:didDeselectAnnotationView:
– mapView:viewForOverlay:
– mapView:didAddOverlayViews:

另外, MKMapView 继承自UIScrollView,因此通过将自己设置为委托,您也可以采用UIScrollViewDelegate协议,并使用这些方法: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html

Check the documentation for the MKMapViewDelegate protocol. You have these available methods: http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.html

– mapView:regionWillChangeAnimated:
– mapView:regionDidChangeAnimated:
– mapViewWillStartLoadingMap:
– mapViewDidFinishLoadingMap:
– mapViewDidFailLoadingMap:withError:
– mapViewWillStartLocatingUser:
– mapViewDidStopLocatingUser:
– mapView:didUpdateUserLocation:
– mapView:didFailToLocateUserWithError:
– mapView:viewForAnnotation:
– mapView:didAddAnnotationViews:
– mapView:annotationView:calloutAccessoryControlTapped:
– mapView:annotationView:didChangeDragState:fromOldState:
– mapView:didSelectAnnotationView:
– mapView:didDeselectAnnotationView:
– mapView:viewForOverlay:
– mapView:didAddOverlayViews:

Also, MKMapView inherits from UIScrollView, so by setting yourself as the delegate, you can also adopt the UIScrollViewDelegate protocol, and use these methods: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文