HERE iOS SDK Developer's Guide

NMAGeoPolyline

Class Summary

class NMAGeoPolyline

Derived from: NSObject

Object representing a Polyline geometry, which consists of two or more points.

Include: NMAKit.framework/headers/NMAGeoPolyline.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAGeoPolyline

[For complete information, see the section Class Details]

Instance Method Summary

Table 1. Instance Methods
Instance Method Summary

-(void) addPoint:(nonnull NMAGeoCoordinates *) coordinate

Add a new point to the polyline

-(void) addPoints:(nonnull NSArray< NMAGeoCoordinates * > *) coordinates

Adds a list of points to the polyline

-(void) clear

-(nonnull NSArray< NMAGeoCoordinates * > *) getAllPoints

Get an NSArray with all points of the polyline

-(double) getLength

-(nullable NMAGeoCoordinates *) getNearestCoordinateFrom:(nonnull NMAGeoCoordinates *) coordinate

Gets the NMAGeoCoordinates (point) along the path of the polyline that is closest to the specified point

-(NSUInteger) getNearestIndexFromCoordinate:(nonnull NMAGeoCoordinates *) coordinate

Gets the point index along the path of the polyline that is closest to the specified point

-(int) getNumberOfPoints

-(nullable NMAGeoCoordinates *) getPointAtIndex:(int) index

Get the point from the specified index of this polyline

-(nonnull instancetype) init

Initialize an NMAGeoPolyline instance

-(nonnull instancetype) initWithCoordinates:(nonnull NSArray< NMAGeoCoordinates * > *) coordinates

Initializes an NMAGeoPolyline instance with the specified NMAGeoCoordinates

-(void) insertPoint:(nonnull NMAGeoCoordinates *) coordinate atIndex:(int) index

-(void) removePointAtIndex:(int) index

Class Details

Object representing a Polyline geometry, which consists of two or more points. This class can be used to manipulate a polyline geometry along with NMAMapPolyline for map rendering.

Instance Method Details

-(void) addPoint:(nonnull NMAGeoCoordinates *) coordinate

Add a new point to the polyline.

Parameters:

  • coordinate

    point to be added given as NMAGeoCoordinates

-(void) addPoints:(nonnull NSArray< NMAGeoCoordinates * > *) coordinates

Adds a list of points to the polyline.

Parameters:

  • coordinates

    NSArray containing the list of NMAGeoCoordinates

-(void) clear

Remove all points from the polyline

-(nonnull NSArray< NMAGeoCoordinates * > *) getAllPoints

Get an NSArray with all points of the polyline.

-(double) getLength

Return the geographical length of the polyline

-(nullable NMAGeoCoordinates *) getNearestCoordinateFrom:(nonnull NMAGeoCoordinates *) coordinate

Gets the NMAGeoCoordinates (point) along the path of the polyline that is closest to the specified point.

Parameters:

  • coordinate

    the origin point to search from given in NMAGeoCoordinates.

-(NSUInteger) getNearestIndexFromCoordinate:(nonnull NMAGeoCoordinates *) coordinate

Gets the point index along the path of the polyline that is closest to the specified point.

Parameters:

  • coordinate

    the origin point to search from given in NMAGeoCoordinates.

-(int) getNumberOfPoints

Get the total number of points that currently exists in the polyline

-(nullable NMAGeoCoordinates *) getPointAtIndex:(int) index

Parameters:

  • index

    position of the point along the polyline

Returns:

The NMAGeoCoordinates instance, or nil if failed

-(nonnull instancetype) init

Initialize an NMAGeoPolyline instance.

-(nonnull instancetype) initWithCoordinates:(nonnull NSArray< NMAGeoCoordinates * > *) coordinates

Initializes an NMAGeoPolyline instance with the specified NMAGeoCoordinates.

Parameters:

  • coordinates

    An NSArray containing two or more NMAGeoCoordinates.

Returns:

The NMAGeoPolyline instance, or nil if initialization failed

-(void) insertPoint:(nonnull NMAGeoCoordinates *) coordinate atIndex:(int) index

Insert a point to the polyline at the specified index

Parameters:

  • coordinate

    point to be added given as NMAGeoCoordinates

  • index

    position of the point along the polyline

-(void) removePointAtIndex:(int) index

Remove a point from the polyline with the specified index

Parameters:

  • index

    position of the point along the polyline