Class RefreshRouteParameters
This class provides the necessary information for refreshing a route from a specific location on it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe route handle holding the route to be refreshed.Identify the new starting point of the route.Indicates the index of the last traveled route section.Provides an indication on how much of the starting section is already traveled. -
Constructor Summary
ConstructorsConstructorDescriptionRefreshRouteParameters(RouteHandle routeHandle, int startingSectionIndex, int traveledDistanceOnStartingSectionInMeters) Create a new instance ofRefreshRouteParameterswith the point on the section of the route as a new starting point.RefreshRouteParameters(RouteHandle routeHandle, Waypoint startingPoint) Create a new instance ofRefreshRouteParameterswith the new starting point on the route.RefreshRouteParameters(RouteHandle routeHandle, Waypoint startingPoint, int startingSectionIndex, int traveledDistanceOnStartingSectionInMeters) Create a new instance ofRefreshRouteParameterswith the new starting point and the section position on the route. -
Method Summary
-
Field Details
-
routeHandle
The route handle holding the route to be refreshed.
-
startingPoint
Identify the new starting point of the route. It should be of type
WaypointType.STOPOVER. Otherwise, anRoutingError.INVALID_PARAMETERerror is generated. Moreover, it should be very close to the original route specified with theRouteHandle. The location of this waypoint may by provided, for example, by aRouteProgressevent. Since the new starting point is expected to be along the original route, the original route geometry is used to reach the remaining waypoints. The new route will not include theWaypointitems that lie behind the new starting point (i.e. the path that was already traveled). Plus,Route.getLengthInMeters(),Route.getDuration(), and similar values are from the new starting point to the destination. If the new waypoint is too far off the original route, the route refresh may fail and anRoutingError.COULD_NOT_MATCH_ORIGINerror is triggered. In that case, an application may decide to calculate a new route from scratch. -
startingSectionIndex
Indicates the index of the last traveled route section. When it is provided, the previous sections are discarded from the refreshed route and the starting point is searched in the provided section. If the starting point is not found in that section an
RoutingError.COULD_NOT_MATCH_ORIGINerror is triggered. -
traveledDistanceOnStartingSectionInMeters
Provides an indication on how much of the starting section is already traveled. The refresh route function would ignore the first part of the section. If it is provided with an invalid starting section index, an
RoutingError.INVALID_PARAMETERerror is generated.
-
-
Constructor Details
-
RefreshRouteParameters
Create a new instance of
RefreshRouteParameterswith the new starting point on the route.- Parameters:
routeHandle-The route handle holding the route to be refreshed.
startingPoint-Identify the new starting point of the route.
-
RefreshRouteParameters
public RefreshRouteParameters(@NonNull RouteHandle routeHandle, int startingSectionIndex, int traveledDistanceOnStartingSectionInMeters) Create a new instance of
RefreshRouteParameterswith the point on the section of the route as a new starting point.- Parameters:
routeHandle-The route handle holding the route to be refreshed.
startingSectionIndex-Indicates the index of the last traveled route section.
traveledDistanceOnStartingSectionInMeters-Provides an indication on how much of the starting section is already traveled.
-
RefreshRouteParameters
public RefreshRouteParameters(@NonNull RouteHandle routeHandle, @NonNull Waypoint startingPoint, int startingSectionIndex, int traveledDistanceOnStartingSectionInMeters) Create a new instance of
RefreshRouteParameterswith the new starting point and the section position on the route.- Parameters:
routeHandle-The route handle holding the route to be refreshed.
startingPoint-Identify the new starting point of the route.
startingSectionIndex-Indicates the index of the last traveled route section.
traveledDistanceOnStartingSectionInMeters-Provides an indication on how much of the starting section is already traveled.
-
-
Method Details