HERE iOS SDK Developer's Guide

NMAGeoPolygon

Class Summary

class NMAGeoPolygon

Derived from: NSObject

Object representing a Polygon, which consists of three or more points.

Include: NMAKit.framework/headers/NMAGeoPolygon.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAGeoPolygon

[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 polygon

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

Adds a list of points to the polygon

-(nonnull NSArray< NMAGeoCoordinates * > *) allPoints

Get an NSArray with all points of the polygon

-(void) clear

-(nonnull) init

Initialize an NMAGeoPolygon instance

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

Initializes an NMAGeoPolygon instance with the specified NMAGeoCoordinates

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

-(double) length

Return the geographical length of the polygon in meters

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

Gets the NMAGeoCoordinates along the path of the polygon that is closest to the specified point

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

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

-(int) numberOfPoints

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

Get the point coordinates from the specified index of this polygon

-(void) removePointAtIndex:(int) index

Class Details

Object representing a Polygon, which consists of three or more points. This class can be used to manipulate a polygon geometry along with NMAMapPolygon for map rendering. The minimum number of points in an NMAGeoPolygon must be three.

Instance Method Details

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

Add a new point to the polygon.

Parameters:

  • coordinate

    point to be added given as NMAGeoCoordinates

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

Adds a list of points to the polygon.

Parameters:

  • coordinates

    NSArray containing the list of NMAGeoCoordinates

-(nonnull NSArray< NMAGeoCoordinates * > *) allPoints

Get an NSArray with all points of the polygon.

-(void) clear

Remove all points from the polygon

-(nonnull) init

Initialize an NMAGeoPolygon instance.

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

Initializes an NMAGeoPolygon instance with the specified NMAGeoCoordinates.

Parameters:

  • coordinates

    An NSArray containing two or more NMAGeoCoordinates.

Returns:

The NMAGeoPolygon instance, or nil if initialization failed

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

Insert a point to the polygon at the specified index

Parameters:

  • coordinate

    point to be added given as NMAGeoCoordinates

  • index

    position of the point along the polygon

-(double) length

Return the geographical length of the polygon in meters.

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

Gets the NMAGeoCoordinates along the path of the polygon that is closest to the specified point.

Parameters:

  • coordinate

    the origin point to search from given in NMAGeoCoordinates.

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

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

Parameters:

  • coordinate

    the origin point to search from given in NMAGeoCoordinates.

-(int) numberOfPoints

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

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

Parameters:

  • index

    position of the point along the polygon

Returns:

The NMAGeoCoordinates instance, or nil if failed

-(void) removePointAtIndex:(int) index

Remove a point from the polygon with the specified index

Parameters:

  • index

    position of the point along the polygon

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.