iOS Developer Library

Developer

MapKit Framework Reference MKPolygonView Class Reference

Options
Deployment Target:

On This Page
Language:

MKPolygonView

Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in iOS 4.0 and later

The MKPolygonView class provides the visual representation for an MKPolygon annotation object. This view fills and strokes the area represented by the annotation. You can change the color and other drawing attributes of the polygon by modifying the properties inherited from the MKOverlayPathView class. This class is typically used as is and not subclassed.

In iOS 7 and later, use the MKPolygonRenderer class to display polygon overlays instead.

  • Initializes and returns a new overlay view using the specified polygon overlay object.

    Deprecation Statement

    Use an MKPolygonRenderer object instead.

    Declaration

    Objective-C

    - (instancetype)initWithPolygon:(MKPolygon *)polygon

    Parameters

    polygon

    The polygon overlay containing the information about the area to be drawn. This object must have at least three points defining the polygon in order for this view to draw the corresponding path.

    Return Value

    A new polygon overlay view.

    Import Statement

    Objective-C

    @import MapKit;

    Availability

    Available in iOS 4.0 and later

    Deprecated in iOS 7.0

  • polygon polygon (iOS 7.0) Property

    The polygon overlay object that contains the information used to draw the overlay. (read-only)

    Deprecation Statement

    Use an MKPolygonRenderer object instead.

    Declaration

    Objective-C

    @property(nonatomic, readonly) MKPolygon *polygon

    Import Statement

    Objective-C

    @import MapKit;

    Availability

    Available in iOS 4.0 and later

    Deprecated in iOS 7.0