SKPolyline Class Reference

Inherits from SKOverlay : NSObject
Declared in SKPolyline.h

Overview

SKPolyline stores the information related to a map polyline overlay. This object is used as an input parameter.

  locations

An array of CLLocation objects. Each location represents a vertex of the polyline. This array will be used only if the polyline is instantiated with [SKPolyline polyline].

@property (nonatomic, strong, readonly) NSArray<CLLocation*> *locations

Discussion

An array of CLLocation objects. Each location represents a vertex of the polyline. This array will be used only if the polyline is instantiated with [SKPolyline polyline].

Declared In

SKPolyline.h

  lineWidth

The width of the polyline. Should be a value in [0, 10] interval. If using dotted lines, use 0.

@property (nonatomic, assign) NSInteger lineWidth

Discussion

The width of the polyline. Should be a value in [0, 10] interval. If using dotted lines, use 0.

Declared In

SKPolyline.h

  backgroundLineWidth

The width of the backgrund line. Should be a value in [0, 10] interval. If using dotted lines, this controls the dotted line’s width.

@property (nonatomic, assign) NSInteger backgroundLineWidth

Discussion

The width of the backgrund line. Should be a value in [0, 10] interval. If using dotted lines, this controls the dotted line’s width.

Declared In

SKPolyline.h

– addLocation:

Add a CLLocation object to the existing array of locations for this polyline.

- (BOOL)addLocation:(CLLocation *)location

Parameters

location

The CLLocation object that needs to be added.

Return Value

Success / failure of adding the CLLocation object.

Discussion

Add a CLLocation object to the existing array of locations for this polyline.

Declared In

SKPolyline.h

– addLocations:

Replace the existing array of locations.

- (BOOL)addLocations:(NSArray<CLLocation*> *)locations

Parameters

locations

An array of CLLocations objects.

Return Value

Success / failure of replacing the existing array of locations with the new one given as parameter.

Discussion

Replace the existing array of locations.

Declared In

SKPolyline.h

– addCoordinateWithLatitude:longitude:

Add a CLLocationCoordinate2D object to the existing array of coordinates for this polyline.

- (BOOL)addCoordinateWithLatitude:(CLLocationDegrees)latitude longitude:(CLLocationDegrees)longitude

Parameters

latitude

The latitude of the coordinate that needs to be added.

longitude

The longitude of the coordinate that needs to be added.

Return Value

Success / failure of adding the CLLocationCoordinate2D pointer.

Discussion

Add a CLLocationCoordinate2D object to the existing array of coordinates for this polyline.

Declared In

SKPolyline.h

– enumeratePolylineCoordinatesUsingBlock:

Use this block to get the polyline coordinates as float (lat, lon).

- (void)enumeratePolylineCoordinatesUsingBlock:(void ( ^ ) ( CLLocationDegrees latitude , CLLocationDegrees longitude ))enumerationBlock

Parameters

enumerationBlock

The block to execute for each coordinate in the array.

Discussion

Use this block to get the polyline coordinates as float (lat, lon).

Declared In

SKPolyline.h

+ polyline

Creates a newly initialized SKPolyline. Using this initializer, each vertex of this polyline must be of type CLLocation.

+ (instancetype)polyline

Return Value

A newly initialized SKPolyline.

Discussion

Creates a newly initialized SKPolyline. Using this initializer, each vertex of this polyline must be of type CLLocation.

Declared In

SKPolyline.h

+ polylineCoordinate2D

Creates a newly initialized SKPolyline. Using this initializer, each vertex of this polyline must be of type CLLocationCoordinate2D.

+ (instancetype)polylineCoordinate2D

Return Value

A newly initialized SKPolyline.

Discussion

Creates a newly initialized SKPolyline. Using this initializer, each vertex of this polyline must be of type CLLocationCoordinate2D.

Declared In

SKPolyline.h