HERE iOS SDK Developer's Guide

NMAMapPolygon

Class Summary

class NMAMapPolygon

Derived from: NMAMapObject

Represents a NMAMapObject in the shape of a polygon.

Include: NMAKit.framework/headers/NMAMapPolygon.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAMapPolygon

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, strong] UIColor *  fillColor

The fill color for the NMAMapPolygon

[readable, writable, strong] UIColor *  lineColor

The color for the NMAMapPolygon border line

[readable, writable, assign] NSUInteger  lineWidth

The line width, in pixels, for the NMAMapPolygon border

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

The NSArray of NMAGeoCoordinates objects comprising the path that defines the NMAMapPolygon shape

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 NMAMapPolygon path

-(void) appendVertex:( NMAGeoCoordinates *) vertex

Append a NMAGeoCoordinates path point to the end of the NMAMapPolygon

-(void) clearVertices

Removes all vertices from the NMAMapPolygon's path

-(BOOL) containsGeoCoordinates:( NMAGeoCoordinates *) coordinates

Determines if the NMAMapPolygon contains the input NMAGeoCoordinates

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

Initializes a NMAMapPolygon instance with the specified NSArray of NMAGeoCoordinates objects

-(BOOL) isValid

Determines whether the NMAMapPolygon object is valid

-(void) removeLastVertex

-(void) removeVertexAtIndex:(NSUInteger) index

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

Class Method Summary

Table 3. Class Methods
Class Methods

+(instancetype) mapPolygonWithVertices:(NSArray *) vertices

A convenience method for constructing an NMAMapPolygon

Class Details

Represents a NMAMapObject in the shape of a polygon. In comparison to a NMAMapPolyline, it is assumed that the last coordinates within the path is connected with the first coordinates, thereby constructing an enclosed geometry.

Note:

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

Public Property Details

[readable, writable, strong] UIColor * fillColor

The fill color for the NMAMapPolygon.

[readable, writable, strong] UIColor * lineColor

The color for the NMAMapPolygon border line.

Note:

Attempts to set this property to nil are ignored.

[readable, writable, assign] NSUInteger lineWidth

The line width, in pixels, for the NMAMapPolygon border.

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 objects comprising the path that defines the NMAMapPolygon shape.

Instance Method Details

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

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

Note:

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

Parameters:

  • vertex

    A NMAGeoCoordinates path point to add.

  • index

    Position to insert. Index starts with 0.

-(void) appendVertex:( NMAGeoCoordinates *) vertex

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

Parameters:

  • vertex

    A NMAGeoCoordinates path point to append

-(void) clearVertices

Removes all vertices from the NMAMapPolygon's path.

-(BOOL) containsGeoCoordinates:( NMAGeoCoordinates *) coordinates

Determines if the NMAMapPolygon contains the input NMAGeoCoordinates. Points at the peaks or corners of the polygon are considered outside the polygon.

Parameters:

  • coordinates

    NMAGeoCoordinates to test. The altitude is ignored.

Returns:

YES if the NMAGeoCoordinates is inside the NMAMapPolygon, NO otherwise

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

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

Parameters:

  • vertices

    A NSArray of NMAGeoCoordinates points defining the NMAMapPolygon shape

Returns:

The NMAMapPolygon

-(BOOL) isValid

Determines whether the NMAMapPolygon object is valid. A polygon is valid as long as it does not self-intersect.

Returns:

YES if the NMAMapPolygon is valid, NO otherwise

-(void) removeLastVertex

Remove the last NMAGeoCoordinates point of the NMAMapPolygon

-(void) removeVertexAtIndex:(NSUInteger) index

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

Parameters:

  • index

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

Class Method Details

+(instancetype) mapPolygonWithVertices:(NSArray *) vertices

A convenience method for constructing an NMAMapPolygon.

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.