Protocol: MKOverlay
Overview
The MKOverlay protocol defines a specific type of annotation that represents both a point and an area on a map. Overlay objects are essentially data objects that contain the geographic data needed to represent the map area. For example, overlays can take the form of common shapes such as rectangles and circles. They can also describe polygons and other complex shapes. The projected rectangle that encompasses the overlay. (required) (read-only)The approximate center point of the overlay area. (required) (read-only)Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape.
Instance Attribute Summary (collapse)
-
- boundingMapRect
readonly
The projected rectangle that encompasses the overlay.
-
- coordinate
readonly
The approximate center point of the overlay area.
Instance Method Summary (collapse)
-
- intersectsMapRect:
Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape.
Instance Attribute Details
- (MKMapRect) boundingMapRect (readonly)
The projected rectangle that encompasses the overlay. (required) (read-only) This property contains the smallest rectangle that completely encompasses the overlay area. Implementers of this protocol must set this area when implementing their overlay class. The rectangle should be specified using projected coordinates—that is, coordinates obtained by projecting the globe onto a two-dimensional surface.
- (CLLocationCoordinate2D) coordinate (readonly)
The approximate center point of the overlay area. (required) (read-only) This point is typically set to the center point of the map’s bounding rectangle. It is used as the anchor point for any callouts displayed for the annotation.
Instance Method Details
- (Boolean) intersectsMapRect(mapRect)
Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape. You can implement this method to provide more specific bounds checking for an overlay. If you do not implement it, the bounding rectangle is used to detect intersections.