Class

MKPolygon

A closed polygon shape.

Declaration

class MKPolygon : MKMultiPoint

Overview

The points you add to this overlay are connected end-to-end in the order you provide them. The first and last points are connected to each other to create a closed shape.

When creating a polygon, you can mask out portions of the polygon by specifying one or more interior polygons. For the polygons you specify, this class uses the even-odd fill rule to determine the final occupied area. When applied to overlapping polygons, this rule can cause specific regions to be masked out (and thereby removed) from the total occupied area. For more information about how fill rules are applied to paths, see Paths in Quartz 2D Programming Guide.

Topics

Creating a Polygon Overlay

init(points: UnsafePointer<MKMapPoint>, count: Int)

Creates and returns an MKPolygon object from the specified set of map points.

init(points: UnsafePointer<MKMapPoint>, count: Int, interiorPolygons: [MKPolygon]?)

Creates and returns an MKPolygon object from the specified set of map points and interior polygons.

init(coordinates: UnsafePointer<CLLocationCoordinate2D>, count: Int)

Creates and returns an MKPolygon object from the specified set of coordinates.

init(coordinates: UnsafePointer<CLLocationCoordinate2D>, count: Int, interiorPolygons: [MKPolygon]?)

Creates and returns an MKPolygon object from the specified set of coordinates and interior polygons.

Accessing the Interior Polygons

var interiorPolygons: [MKPolygon]?

The array of polygons nested inside the receiver.

Relationships

Inherits From

See Also

Polygon

class MKPolygonRenderer

The visual representation for a polygon overlay.