HERE iOS SDK Developer's Guide

NMACoreRouter

Class Summary

class NMACoreRouter

Derived from: NMARouter

Route calculation executor handling core routing types (Car, Truck, Pedestrian, Bike).

Include: NMAKit.framework/headers/NMACoreRouter.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMACoreRouter

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, assign] NMACoreRouterConnectivity   connectivity

This determines whether route is calculated online or offline

[readable, writable, assign] NMADynamicPenalty dynamicPenalty

Indicate the dynamic penalty that should be applied to route calculations

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(nullable NSProgress *) calculateRouteWithStops:(nonnull NSArray *) stops routingMode:(nonnull NMARoutingMode *) mode completionBlock:(nullable NMACalculateResultBlock ) completion

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

-(nonnull) init

Default initializer that initializes a NMACoreRouter instance with NMACoreRouterConnectivityDefault for route calculation

Class Method Summary

Table 3. Class Methods
Class Methods

+(nonnull) new

Default initializer that initializes a NMACoreRouter instance with NMACoreRouterConnectivityDefault for route calculation

Class Details

Route calculation executor handling core routing types (Car, Truck, Pedestrian, Bike). Defines concrete calculation method and response listener for core routing types.

NMACoreRouter 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.

Note:

It is possible for an NMACoreRouter request to return a route that can't be followed; for example, a route that is blocked by a traffic accident or construction work. These conditions will likely be reported if the traffic feature is available and enabled for routing, but they may not be in all cases. Appropriate caution should always be exercised when using routes provided by NMACoreRouter.

Public Property Details

[readable, writable, assign] NMACoreRouterConnectivity  connectivity

This determines whether route is calculated online or offline. Default is NMACoreRouterConnectivityDefault.

If set to offline, it will attempt to calculate the route offline regardless of the routing type and regardless of whether there is enough map data for the route calculation, if fails, it will not make another attempt online.

If set to online, it will attempt to calculate the route online regardless of the routing type and regardless of the current device connectivity. If it fails, it will not make another attempt offline.

If this is changed after calling calculateRouteWithStops:routingMode:completionBlock, the change will not take effect for the current route calculation.

Note:

An example of the usage is as follows: e.g. An app wishes to try online first and falls back to offline if online fails. Such app will set connectivity to NMACoreRouterConnectivityOnline before calculating a route, if this fails, it will change connectivity to NMACoreRouterConnectivityOffline before another route calculation attempt.

[readable, writable, assign] NMADynamicPenaltydynamicPenalty

Indicate the dynamic penalty that should be applied to route calculations. Penalties can be applied in the form of restricting roads, areas and setting different traffic modes.

Note:

For the route calculation to consider traffic you must set an NMADynamicPenalty that specifies an NMATrafficPenaltyMode. Traffic-based routing requires an internet connection.

Instance Method Details

-(nullable NSProgress *) calculateRouteWithStops:(nonnull NSArray *) stops routingMode:(nonnull NMARoutingMode *) mode completionBlock:(nullable NMACalculateResultBlock ) completion

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

This method returns nil and a route will not be calculated if access to this operation is denied. Contact your HERE representative for more information.

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
Note:

Note: If the SDK/device becomes offline and you do not have offline permission for the transport mode being requested, this operation will be denied.

Note:

As of 3.2.2, This method returns nil, completes with NMARoutingErrorInvalidParameters, and a route will not be calculated if calculating a route with NMARoutingModeTrack since calculating a route in track mode is no longer supported.

Note:

This method returns nil, completes with NMARoutingErrorInvalidParameters, and a route will not be calculated if calculating a route with NMATransportModePublicTransport that contains more than 2 stops.

Parameters:

  • stops

    A list of stops to route between, maximum 128 stops. If the first stop or the last stop is of NMAWaypoint, their waypointType must be of NMAStopWaypoint type.

  • mode

    The NMARoutingMode to use for route calculation.

Returns:

NSProgress if route calculation is successfully started, nil otherwise.

-(nonnull) init

Default initializer that initializes a NMACoreRouter instance with NMACoreRouterConnectivityDefault for route calculation.

Returns:

The NMACoreRouter

Class Method Details

+(nonnull) new

Default initializer that initializes a NMACoreRouter instance with NMACoreRouterConnectivityDefault for route calculation.

Returns:

The NMACoreRouter

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.