iOS。如何在使用此地图执行每个操作后获取有关当前地图矩形的信息?
例如,我想显示地图矩形当前的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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 MKMapViewDelegate 协议的文档。您有以下可用方法: http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.html
另外,
MKMapView
继承自UIScrollView
,因此通过将自己设置为委托,您也可以采用UIScrollViewDelegate
协议,并使用这些方法: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.htmlCheck the documentation for the
MKMapViewDelegate
protocol. You have these available methods: http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.htmlAlso,
MKMapView
inherits fromUIScrollView
, so by setting yourself as the delegate, you can also adopt theUIScrollViewDelegate
protocol, and use these methods: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html