iOS Developer Library

Developer

MapKit Framework Reference MKPolylineView Class Reference

Options
Deployment Target:

On This Page
Language:

MKPolylineView

The MKPolylineView class provides the visual representation for an MKPolyline annotation object. This view strokes the path represented by the annotation. (This class does not fill the area enclosed by the path.) You can change the color and other drawing attributes of the path 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 MKPolylineRenderer class to display polyline overlays instead.

Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in iOS 4.0 and later.
  • Initializes and returns a new overlay view using the specified polyline overlay object

    Deprecation Statement

    Use an MKPolylineRenderer object instead.

    Declaration

    Objective-C

    - (instancetype)initWithPolyline:(MKPolyline *)polyline

    Parameters

    polyline

    The polyline overlay object containing the information about the path to be stroked. This object must have at least two points defined in order for this view to draw the corresponding path.

    Return Value

    A new polyline overlay view.

    Import Statement

    Objective-C

    @import MapKit;

    Availability

    Available in iOS 4.0 and later.

    Deprecated in iOS 7.0.

  • polyline polyline (iOS 7.0) Property

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

    Deprecation Statement

    Use an MKPolylineRenderer object instead.

    Declaration

    Objective-C

    @property(nonatomic, readonly) MKPolyline *polyline

    Import Statement

    Objective-C

    @import MapKit;

    Availability

    Available in iOS 4.0 and later.

    Deprecated in iOS 7.0.