Class ManeuverNotificationTimingOptions

java.lang.Object
com.here.sdk.navigation.ManeuverNotificationTimingOptions

public final class ManeuverNotificationTimingOptions extends Object

A class defining timing and distance thresholds for maneuver notifications.

Setting custom values will impact the time when the notification for each supported ManeuverNotificationType is sent - dependent on the TimingProfile.

Note: By default, notification thresholds depend on TimingProfile. When custom values are set, then these rules will still apply. The following rules apply for all transport modes:

The timings follow a strict order:

  1. ManeuverNotificationType.RANGE: The first notification, it may be very far away (use 0 for farthest or earliest possible notification).
  2. ManeuverNotificationType.REMINDER: The second notification.
  3. ManeuverNotificationType.DISTANCE: A second reminder notification to take action.
  4. ManeuverNotificationType.ACTION: Final notification, specifying the required action to be taken.

Therefore, it is crucial that the set values do not violate the order: range > reminder > distance > action. For example, the following values are valid: range = 4000, reminder = 2500, distance = 1000, action = 400. If rangeNotificationDistanceInMeters is smaller than reminderNotificationDistanceInMeters the new options will be silently ignored and the previous values are kept.

You always have the choice to specify the thresholds for time or distance. For each ManeuverNotificationType a notification is only sent once, so the value that is reached first, wins. However, it is recommended to always update both, time and distance values. A configuration value of 0 is only allowed for rangeNotificationDistanceInMeters and rangeNotificationTimeInSeconds. It means that the maneuver notifications of type ManeuverNotificationType.RANGE should be generated as soon as the maneuver location is known - no matter how far away it may be. It's impossible for the other types to have 0 as value due to the descending ordering rule mentioned above.

You can also specify the doubleNotificationDistanceInMeters threshold that determines the distance between two maneuvers that should be merged into a single maneuver notification, for example, when they are very close to each other. Maneuvers below this threshold will be merged like in this example: "After 300 meters turn right and then turn left.".

Tip: To set the timings to the HERE SDK, you can first call getManeuverNotificationTimingOptions() to get the default values for the desired combination of transport mode and timing profile. Then configure the timings, then set it back by calling the setManeuverNotificationTimingOptions().

Note: In the comment of each attribute, the term Others refers to non-pedestrian transport modes such as TransportMode.CAR, TransportMode.BICYCLE, TransportMode.TRUCK.

Attention: The default values for TransportMode.PEDESTRIAN on TimingProfile.FAST_SPEED are theoretical, as such routes cannot be calculated with the HERE SDK as highways are forbidden for pedestrians.

Usage example:


 // Get current values or default values, if no values have been set before.
 ManeuverNotificationTimingOptions car_highway_timings = Navigator.getManeuverNotificationTimingOptions(TransportMode.CAR, TimingProfile.FAST_SPEED);
 // Set a new value for a specific option and keep the previous or default values for the others.
 car_highway_timings.distanceNotificationDistanceInMeters = 1500;
 // Apply the changes to Navigator (or VisualNavigator).
 Navigator.setManeuverNotificationTimingOptions(TransportMode.CAR, TimingProfile.FAST_SPEED, car_fast_speed_timings);