Mac Developer Library

Developer

MapKit Framework Reference MKPolygonRenderer Class Reference

Options
Deployment Target:

On This Page
Language:

MKPolygonRenderer

The MKPolygonRenderer class provides the visual representation for an MKPolygon overlay object. This renderer fills and strokes the polygon represented by first filling the shape and then stroking its outline. You can change the color and other drawing attributes of the polygon by modifying the properties inherited from the parent class. You typically use this class as is and do not subclass it.

Conforms To


Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in OS X v10.9 and later.
  • Initializes and returns a new renderer that handles drawing for the specified polygon overlay object.

    Declaration

    Swift

    init!(polygon polygon: MKPolygon!)

    Objective-C

    - (instancetype)initWithPolygon:(MKPolygon *)polygon

    Parameters

    polygon

    The polygon overlay containing information about the area to be drawn. This object must have at least three points defining the polygon to draw. This parameter must not be nil.

    Return Value

    An initialized polygon renderer object.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in OS X v10.9 and later.

  • polygon polygon Property

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

    Declaration

    Swift

    var polygon: MKPolygon! { get }

    Objective-C

    @property(nonatomic, readonly) MKPolygon *polygon

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in OS X v10.9 and later.