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, assign] NSUInteger  dashPrimaryLength

The length, in pixels, for the primary dash of the NMAMapPolyline

[readable, writable, assign] NSUInteger  dashSecondaryLength

The length, in pixels, for the secondary dash of the NMAMapPolyline

[readable, writable, assign] BOOL  dashed

Indicates whether the NMAMapPolyline is dashed

[readable, writable, assign] BOOL  depthTestEnabled

Indicates whether to render the NMAMapPolyline with depth test

[readable, writable, strong] UIColor *  lineColor

The color for the NMAMapPolyline

[readable, writable, assign] NSUInteger  lineWidth

The width, in pixels, for the NMAMapPolyline

[readable, assign] NSArray *  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:(NSUInteger) index

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

-(void) appendVertex:( NMAGeoCoordinates *) vertex

Append a NMAGeoCoordinates point to the end of the NMAMapPolyline path

-(void) clearVertices

Removes all vertices from the NMAMapPolyline's path

-(NSInteger) indexOfNearestVertexToGeoCoordinates:( NMAGeoCoordinates *) coordinates

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

-(id) initWithPolyline:( NMAGeoPolyline *) geoPolyline

-(id) initWithVertices:(NSArray *) vertices

Initializes a NMAMapPolyline instance with the specified NSArray of NMAGeoCoordinates objects

-( NMAGeoCoordinates *) nearestVertexToGeoCoordinates:( NMAGeoCoordinates *) coordinates

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:(NSUInteger) index

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

Class Method Summary

Table 3. Class Methods
Class Methods

+(id) mapPolylineWithVertices:(NSArray *) vertices

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, assign] NSUInteger dashPrimaryLength

The length, in pixels, for the primary dash of the NMAMapPolyline.

[readable, writable, assign] NSUInteger dashSecondaryLength

The length, in pixels, for the secondary dash of the NMAMapPolyline.

[readable, writable, assign] BOOL dashed

Indicates whether the NMAMapPolyline is dashed.

Note:

The getter is isDashed.

[readable, writable, assign] BOOL depthTestEnabled

Indicates whether to render the NMAMapPolyline with depth test.

Note:

Rendering with depth test should be used if map object altitude is relevant in your application. Rendering objects with different heights while disabling depth test may cause object occlusion.

[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, assign] NSArray * vertices

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

Instance Method Details

-(void) addVertex:( NMAGeoCoordinates *) vertex atIndex:(NSUInteger) index

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:( NMAGeoCoordinates *) vertex

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:( NMAGeoCoordinates *) coordinates

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

-(id) initWithPolyline:( NMAGeoPolyline *) geoPolyline

Initializes a NMAMapPolyline instance with the specified NMAGeoPolyline

Parameters:

  • geoPolyline

    The NMAGeoPolyline defining the polyline.

Returns:

The NMAMapPolyline

-(id) initWithVertices:(NSArray *) 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:( NMAGeoCoordinates *) coordinates

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:(NSUInteger) index

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

+(id) mapPolylineWithVertices:(NSArray *) vertices

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.