HERE iOS SDK Developer's Guide

NMARouteManager

Class Summary

class NMARouteManager

Derived from: NSObject

Represents a manager responsible for calculating a NMARoute from a list of stops and (optionally) a NMARoutingMode.

Include: NMAKit.framework/headers/NMARouteManager.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMARouteManager

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, assign] BOOL  busy

Indicates whether or not the NMARouteManager is currently calculating a route

[readable, writable, weak] id< NMARouteManagerDelegate delegate

The NMARouteManagerDelegate that listens for messages from the NMARouteManager

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(BOOL) calculateRouteWithStops:(NSArray *) stops

Starts a route calculation with the given stop list and the default NMARoutingMode.

-(BOOL) calculateRouteWithStops:(NSArray *) stops routingMode:( NMARoutingMode *) mode

Starts a route calculation with the give stop list and routing mode

-(BOOL) cancel

Cancels the current route calculation.

Class Method Summary

Table 3. Class Methods
Class Methods

+( NMARouteManager *) sharedRouteManager

Returns the NMARouteManager singleton instance

Class Details

Represents a manager responsible for calculating a NMARoute from a list of stops and (optionally) a NMARoutingMode.

NMARouteManagerDelegate is used to monitor route calculation progress and route calculation completion. Set the NMARouteManager delegate property in order to receive callbacks through NMARouteManagerDelegate protocol.

The current status of the NMARouteManager can be checked via the busy property.

NMARouteManager only supports one routing request at a time. Attempts to make another request before the current request has finished will fail.

NMARouteManager requires valid authentication credentials to be set via NMAApplicationContext. If valid credentials are not present the API may not function correctly or may stop functioning correctly in the future when server side configurations change.

Routing within China is supported, but routes may not cross the Chinese border. Thus, any route calculation which begins, ends, or passes through China and involves one or more other countries will fail.

Public Property Details

[readable, assign] BOOL busy

Indicates whether or not the NMARouteManager is currently calculating a route.

Note:

Any requests made while the NMARouteManager is busy will fail.

[readable, writable, weak] id< NMARouteManagerDelegatedelegate

The NMARouteManagerDelegate that listens for messages from the NMARouteManager.

Instance Method Details

-(BOOL) calculateRouteWithStops:(NSArray *) stops

Starts a route calculation with the given stop list and the default NMARoutingMode.

The array of stops used to calculate the route must have at least two items. Any of the following may be included in any combination:
  1. NMAGeoCoordinates
  2. NMAPlace
  3. NMAPlaceLocation
  4. NMAWaypoint

If a request is made while a previous request is still in progress, this method will return NO and no callback will be sent to the delegate. If there is not another request in progress but the parameters of the current request are invalid, this method will return NO and a callback will be sent to the delegate.

Note:

See NMARoutingMode for the default routing mode properties.

Note:

NMARouteManagerDelegate routeManager:didCalculateRoutes:withError:violatedOptions: will be called upon success. The returned route will contain a list of NMAWayPoints based on the stop locations; the original stops will be not be returned.

Parameters:

  • stops

    A list of stops to route between

Returns:

YES if the route calculation request was made successfully, NO otherwise

-(BOOL) calculateRouteWithStops:(NSArray *) stops routingMode:( NMARoutingMode *) mode

Starts a route calculation with the give stop list and routing mode.

Note:

NMARouteManagerDelegate routeManager:didCalculateRoutes:withError:violatedOptions: will be called upon completion.

Parameters:

  • stops

    A list of stops to route between

  • mode

    The NMARoutingMode to use for route calculation

Returns:

YES if route calculation was successful, NO otherwise

See also:

calculateRouteWithStops:

-(BOOL) cancel

Cancels the current route calculation.

If route calculation has been started, calling this method cancels the calculation and then notifies the delegate by way of calling routeManager:didCalculateRoutes:withError:violatedOptions: with error code NMARouteManagerErrorRoutingCancelled. If routing calculation could not be cancelled (e.g. no existing calculation is being performed), the delegate will not be notified and NO will be returned from this method.

Returns:

YES if the cancellation can be processed, NO otherwise

Class Method Details

+( NMARouteManager *) sharedRouteManager

Returns the NMARouteManager singleton instance.

Note:

Use this method to obtain a NMARouteManager instance. Do not call init directly.

Returns:

shared NMARouteManager instance

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.