HERE iOS SDK Developer's Guide

NMAMapPolyline

Class Summary

class NMAMapPolyline

Derived from: NMAMapObject

Represents a NMAMapObject in the shape of a polyline.

Include: NMAKit.framework/headers/NMAMapPolyline.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAMapPolyline

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, strong] UIColor *  lineColor

The color for the NMAMapPolyline

[readable, writable, assign] NSUInteger  lineWidth

The width, in pixels, for the NMAMapPolyline

[readable, copy] NSArray< NMAGeoCoordinates * > *  vertices

The NSArray of NMAGeoCoordinates that comprise the path of the NMAMapPolyline

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(void) addVertex:( NMAGeoCoordinates *) vertex atIndex:(add(_:at:)) NS_SWIFT_NAME

Insert a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path

-(void) appendVertex:(append(_:)) NS_SWIFT_NAME

Append a NMAGeoCoordinates point to the end of the NMAMapPolyline path

-(void) clearVertices

Removes all vertices from the NMAMapPolyline's path

-(NSInteger) indexOfNearestVertexToGeoCoordinates:(indexOfNearestVertex(to:)) NS_SWIFT_NAME

Determines the index of the NMAMapPolyline path array that is closest to the specified NMAGeoCoordinates object

-(instancetype) initWithVertices:(NSArray< NMAGeoCoordinates * > *) vertices

Initializes a NMAMapPolyline instance with the specified NSArray of NMAGeoCoordinates objects

-( NMAGeoCoordinates *) nearestVertexToGeoCoordinates:(nearestVertex(to:)) NS_SWIFT_NAME

Determines the NMAGeoCoordinates along the NMAMapPolyline path that is closest to the specified NMAGeoCoordinates object

-(void) removeLastVertex

Remove the last NMAGeoCoordinates point of the NMAMapPolyline path

-(void) removeVertexAtIndex:(remove(at:)) NS_SWIFT_NAME

Remove a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path

Class Method Summary

Table 3. Class Methods
Class Methods

+(instancetype) mapPolylineWithVertices:("duplicate with instance initializer") NS_SWIFT_UNAVAILABLE

A convenience method for constructing an NMAMapPolyline

Class Details

Represents a NMAMapObject in the shape of a polyline.

A NMAMapPolyline has multiple points that combine to create its path and which are traversed in order. The line between two consecutive points is always straight and is defined by the shortest navigable way to move between them.

Note:

The NMAViewObject location property for an NMAMapPolyline returns the coordinates of the first vertex (if available).

Public Property Details

[readable, writable, strong] UIColor * lineColor

The color for the NMAMapPolyline.

Note:

Attempts to set this property to nil are ignored.

[readable, writable, assign] NSUInteger lineWidth

The width, in pixels, for the NMAMapPolyline.

The line width must be in the range [0, 100]. The default width is 1 pixel.

[readable, copy] NSArray< NMAGeoCoordinates * > * vertices

The NSArray of NMAGeoCoordinates that comprise the path of the NMAMapPolyline.

Instance Method Details

-(void) addVertex:( NMAGeoCoordinates *) vertex atIndex:(add(_:at:)) NS_SWIFT_NAME

Insert a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path.

Note:

If index is equal or greater than the total number of vertices, the vertex will be appended to the end of the polyline path.

Parameters:

  • vertex

    A NMAGeoCoordinates path point to add.

  • index

    Position to insert. Index starts with 0.

-(void) appendVertex:(append(_:)) NS_SWIFT_NAME

Append a NMAGeoCoordinates point to the end of the NMAMapPolyline path.

Parameters:

  • vertex

    A NMAGeoCoordinates path point to append

-(void) clearVertices

Removes all vertices from the NMAMapPolyline's path.

-(NSInteger) indexOfNearestVertexToGeoCoordinates:(indexOfNearestVertex(to:)) NS_SWIFT_NAME

Determines the index of the NMAMapPolyline path array that is closest to the specified NMAGeoCoordinates object.

Parameters:

  • coordinates

    A NMAGeoCoordinates to test for nearness to the NMAMapPolyline

Returns:

The index of the NMAGeoCoordinates vertex

-(instancetype) initWithVertices:(NSArray< NMAGeoCoordinates * > *) vertices

Initializes a NMAMapPolyline instance with the specified NSArray of NMAGeoCoordinates objects.

Parameters:

  • vertices

    A NSArray of NMAGeoCoordinates points defining the NMAMapPolyline

Returns:

The NMAMapPolyline

-( NMAGeoCoordinates *) nearestVertexToGeoCoordinates:(nearestVertex(to:)) NS_SWIFT_NAME

Determines the NMAGeoCoordinates along the NMAMapPolyline path that is closest to the specified NMAGeoCoordinates object.

Parameters:

  • coordinates

    A NMAGeoCoordinates to test for nearness to the NMAMapPolyline

Returns:

The NMAGeoCoordinates vertex along the NMAMapPolyline path

-(void) removeLastVertex

Remove the last NMAGeoCoordinates point of the NMAMapPolyline path.

-(void) removeVertexAtIndex:(remove(at:)) NS_SWIFT_NAME

Remove a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path.

Parameters:

  • index

    Position to remove. Index starts with 0 and must be smaller than the total number of vertices.

Class Method Details

+(instancetype) mapPolylineWithVertices:("duplicate with instance initializer") NS_SWIFT_UNAVAILABLE

A convenience method for constructing an NMAMapPolyline.

Parameters:

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.