开发者

iOS. How to get an information about current map rect after each action with this map?

开发者 https://www.devze.com 2023-04-04 22:05 出处:网络
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 dra

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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消