Protocol

MKMapViewDelegate

Optional methods that you use to receive map-related update messages.

Overview

Because many map operations require the MKMapView class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. The map view also uses these methods to request annotation and overlay views and to manage interactions with those views.

Before releasing an MKMapView object for which you have set a delegate, remember to set that object’s delegate property to nil.

Topics

Responding to Map Position Changes

mapView:regionWillChangeAnimated:

Tells the delegate that the region displayed by the map view is about to change.

mapView:regionDidChangeAnimated:

Tells the delegate that the region displayed by the map view just changed.

Loading the Map Data

mapViewWillStartLoadingMap:

Tells the delegate that the specified map view is about to retrieve some map data.

mapViewDidFinishLoadingMap:

Tells the delegate that the specified map view successfully loaded the needed map data.

mapViewDidFailLoadingMap:withError:

Tells the delegate that the specified view was unable to load the map data.

mapViewWillStartRenderingMap:

Tells the delegate that the map view is about to start rendering some of its tiles.

mapViewDidFinishRenderingMap:fullyRendered:

Tells the delegate that the map view has finished rendering all visible tiles.

Tracking the User Location

mapViewWillStartLocatingUser:

Tells the delegate that the map view will start tracking the user’s position.

mapViewDidStopLocatingUser:

Tells the delegate that the map view stopped tracking the user’s location.

mapView:didUpdateUserLocation:

Tells the delegate that the location of the user was updated.

mapView:didFailToLocateUserWithError:

Tells the delegate that an attempt to locate the user’s position failed.

mapView:didChangeUserTrackingMode:animated:

Tells the delegate that the user tracking mode changed.

Managing Annotation Views

mapView:viewForAnnotation:

Returns the view associated with the specified annotation object.

mapView:didAddAnnotationViews:

Tells the delegate that one or more annotation views were added to the map.

mapView:annotationView:calloutAccessoryControlTapped:

Tells the delegate that the user tapped one of the annotation view’s accessory buttons.

Dragging an Annotation View

mapView:annotationView:didChangeDragState:fromOldState:

Tells the delegate that the drag state of one of its annotation views changed.

Selecting Annotation Views

mapView:didSelectAnnotationView:

Tells the delegate that one of its annotation views was selected.

mapView:didDeselectAnnotationView:

Tells the delegate that one of its annotation views was deselected.

Managing the Display of Overlays

mapView:rendererForOverlay:

Asks the delegate for a renderer object to use when drawing the specified overlay.

mapView:didAddOverlayRenderers:

Tells the delegate that one or more renderer objects were added to the map.

mapView:viewForOverlay:

Asks the delegate for the overlay view to use when displaying the specified overlay object.

Deprecated
mapView:didAddOverlayViews:

Tells the delegate that one or more overlay views were added to the map.

Deprecated

Relationships

Inherits From

See Also

Customizing the Map View Behavior

delegate

The receiver’s delegate.