HERE Android SDK Developer's Guide

RoutePlan

The class RoutePlan is a member of com.here.android.mpa.routing .

Class Summary

public final class RoutePlan

extends java.lang.Object

RoutePlan contains all information needed to calculate a Route.

[For complete information, see the section Class Details]

See also:

RouteWaypoint

RouteManager

Constructor Summary

Table 1. Constructors in RoutePlan
Constructors

RoutePlan ()

Public Constructor

RoutePlan (RoutePlan other)

Copy Constructor

Method Summary

Table 2. Methods in RoutePlan
Methods

public RoutePlan addWaypoint (GeoCoordinate point)

Deprecated: As of SDK 3.2.

Adds a waypoint to the plan.

public RoutePlan addWaypoint (RouteWaypoint point)

Adds a waypoint to the plan.

public boolean equals (Object obj)

public RouteOptions getRouteOptions ()

Gets a copy of the current route options used with this RoutePlan .

public RouteWaypoint getWaypoint (int index)

Gets a waypoint at a specified index.

public GeoCoordinate getWaypointAt (int index)

Deprecated: As of SDK 3.2.

Gets geo-coordinates of the waypoint at a specified index.

public int getWaypointCount ()

Gets the number of waypoints of the route plan.

public int hashCode ()

public RoutePlan insertWaypoint (GeoCoordinate point, int index)

Deprecated: As of SDK 3.2.

Inserts a waypoint into a list of existing waypoints.

public RoutePlan insertWaypoint (RouteWaypoint point, int index)

Inserts a waypoint into a list of existing waypoints.

public RoutePlan removeAllWaypoints ()

Removes all waypoints of the route plan.

public RoutePlan removeWaypoint (int index)

Removes a waypoint at a specified index.

public RoutePlan setRouteOptions (RouteOptions options)

Sets the route options.

Class Details

RoutePlan contains all information needed to calculate a Route. It can carry up to 128 waypoints, each of which is represented by a RouteWaypoint.

However, the first and last waypoints used for route calculation must be of RouteWaypoint.Type.STOP_WAYPOINT type, otherwise, the error INVALID_PARAMETERS will be returned.

See also:

RouteWaypoint

RouteManager

Constructor Details

RoutePlan ()

Public Constructor

RoutePlan (RoutePlan other)

Copy Constructor

Parameters:

  • other

Method Details

public RoutePlan addWaypoint (GeoCoordinate point)

Deprecated: As of SDK 3.2.

Use addWaypoint(RouteWaypoint) instead.

Adds a waypoint to the plan. Maximum 128 waypoints on a route.

NOTE: Urban Mobility supports only 2 waypoints. If UMRouter is used, then adding more than 2 waypoints will result in getting an estimated Public Transport routes.

Parameters:

  • point

    The GeoCoordinate waypoint to add.

Returns:

This RoutePlan object

public RoutePlan addWaypoint (RouteWaypoint point)

Adds a waypoint to the plan. A maximum of 128 waypoints is allowed for a route.

The first and last waypoints used for route calculation must be of RouteWaypoint.Type.STOP_WAYPOINT type.

NOTE: Urban Mobility supports only 2 waypoints. If UMRouter is used, then adding more than 2 waypoints will result in getting an estimated Public Transport routes.

Parameters:

  • point

    The RouteWaypoint representing the waypoint to add.

Returns:

This RoutePlan object

public boolean equals (Object obj)

Parameters:

  • obj

public RouteOptions getRouteOptions ()

Gets a copy of the current route options used with this RoutePlan . Any changes made to the RouteOptions object returned by this method must be used to call setRouteOptions(RouteOptions) again for the changes to be in effect.

Returns:

RouteOptions options associated with this plan.

public RouteWaypoint getWaypoint (int index)

Gets a waypoint at a specified index.

Parameters:

  • index

    The zero-based index.

Returns:

the waypoint, null if the index submitted is out of bounds.

public GeoCoordinate getWaypointAt (int index)

Deprecated: As of SDK 3.2.

Use getWaypoint(int) instead.

Gets geo-coordinates of the waypoint at a specified index.

Parameters:

  • index

    The zero-based index.

Returns:

the waypoint, null if the index submitted is out of bounds.

public int getWaypointCount ()

Gets the number of waypoints of the route plan.

Returns:

the number of waypoints.

public int hashCode ()

public RoutePlan insertWaypoint (GeoCoordinate point, int index)

Deprecated: As of SDK 3.2.

Use insertWaypoint(RouteWaypoint, int) instead.

Inserts a waypoint into a list of existing waypoints. The position of the new waypoint is according to the specified index. Maximum 128 waypoints on a route.

NOTE: Urban Mobility supports only 2 waypoints. If UMRouter is used, then adding more than 2 waypoints will result in getting an estimated Public Transport routes.

Parameters:

  • point

    The waypoint to insert

  • index

    The index in the range from 0 to the number of already existing waypoints.

Returns:

This RoutePlan object

public RoutePlan insertWaypoint (RouteWaypoint point, int index)

Inserts a waypoint into a list of existing waypoints. The position of the new waypoint is according to the specified index. A maximum of 128 waypoints is allowed for a route.

The first and last waypoints used for route calculation must be of RouteWaypoint.Type.STOP_WAYPOINT type.

NOTE: Urban Mobility supports only 2 waypoints. If UMRouter is used, then adding more than 2 waypoints will result in getting an estimated Public Transport routes.

Parameters:

  • point

    The waypoint to insert

  • index

    The index in the range from 0 to the number of already existing waypoints.

Returns:

This RoutePlan object

public RoutePlan removeAllWaypoints ()

Removes all waypoints of the route plan.

Returns:

This RoutePlan object

public RoutePlan removeWaypoint (int index)

Removes a waypoint at a specified index.

The first and last waypoints used for route calculation must of be RouteWaypoint.Type.STOP_WAYPOINT type.

Parameters:

  • index

    The zero-based index.

Returns:

This RoutePlan object

public RoutePlan setRouteOptions (RouteOptions options)

Sets the route options. This method does not retain a reference to options . If the options object is updated, then this method must be called again for the changes to be in effect.

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.