Mac Developer Library

Developer

MapKit Framework Reference MKPolylineRenderer Class Reference

Options
Deployment Target:

On This Page
Language:

MKPolylineRenderer

Conforms To


Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in OS X v10.9 and later.

The MKPolylineRenderer class provides the visual representation for an MKPolyline overlay object. This renderer strokes the line only; it does not fill it. 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.

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

    Declaration

    Swift

    init!(polyline polyline: MKPolyline!)

    Objective-C

    - (instancetype)initWithPolyline:(MKPolyline *)polyline

    Parameters

    polyline

    The polyline overlay containing information about the area to be drawn. This object must have at least two points defining the line segment to draw. This parameter must not be nil.

    Return Value

    An initialized polyline renderer object.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in OS X v10.9 and later.

  • polyline polyline Property

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

    Declaration

    Swift

    var polyline: MKPolyline! { get }

    Objective-C

    @property(nonatomic, readonly) MKPolyline *polyline

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in OS X v10.9 and later.