Protocol

MKOverlay

An interface for associating content with a specific map region.

Declaration

@protocol MKOverlay

Overview

Overlay objects are data objects that define the geographic data to cover. MapKit defines several concrete classes that adopt this protocol and define standard shapes such as rectangles, circles, and polygons. You might use overlays to define the geographic boundaries of a national park or trace a bus route along city streets. You add an overlay to your map view by calling its addOverlay: method or any other map view method for adding overlays to the map. When the overlay's region intersects the visible portion of the map, the map view calls the mapView:rendererForOverlay: method of its delegate to obtain the renderer object responsible for drawing the overlay.

If you add an overlay to a map view as an annotation, instead of adding it as an overlay, the map view treats your overlay as an annotation. Specifically, it displays your overlay only when its coordinate is in the visible map region, rather than displaying the overlay when any portion of its covered area is visible.

Topics

Describing the Overlay Geometry

coordinate

The approximate center point of the overlay area.

Required.

boundingMapRect

The projected rectangle that encompasses the overlay.

Required.

Determining Map Intersections

- intersectsMapRect:

Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape.

Optimizing Map Rendering

- canReplaceMapContent

Returns a Boolean indicating whether the overlay content replaces the underlying map content.

See Also

Annotations and Overlays

MKPlacemark

A user-friendly description of a location on the map.

MKAnnotation

An interface for associating your content with a specific map location.

MKAnnotationView

The visual representation of one of your annotation objects.

MKOverlayRenderer

The shared infrastructure used to draw overlays on the map surface.

MapKit Annotations

Use these annotation objects as-is in your maps.

MapKit Overlays

Use these overlays as-is in your maps.