MKPolyline Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/MapKit.framework
Availability
Available in iOS 4.0 and later.
Companion guide
Declared in
MKPolyline.h
Related sample code

Overview

The MKPolyline class represents a shape consisting of one or more points that define connecting line segments. The points are connected end-to-end in the order they are provided. The first and last points are not connected to each other.

Tasks

Creating a Polyline Overlay

Class Methods

polylineWithCoordinates:count:

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

+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count
Parameters
coords

The array of coordinates defining the shape. The data in this array is copied to the new object.

count

The number of items in the coords array.

Return Value

A new polyline object.

Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
MKPolyline.h

polylineWithPoints:count:

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

+ (instancetype)polylineWithPoints:(MKMapPoint *)points count:(NSUInteger)count
Parameters
points

The array of map points defining the shape. The data in this array is copied to the new object.

count

The number of items in the points array.

Return Value

A new polyline object.

Availability
  • Available in iOS 4.0 and later.
Declared In
MKPolyline.h