HERE Android SDK Developer's Guide

VenueNavigationManager

The class VenueNavigationManager is a member of com.here.android.mpa.venues3d .

Class Summary

public class VenueNavigationManager

extends java.lang.Object

A navigation manager class that provides guidance advice and information along an indoor route.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in VenueNavigationManager
Nested Classes

public static final enumeration VenueNavigationManager.NavigationState

The possible states of VenueNavigationManager .

public static final enumeration VenueNavigationManager.TrackingMode

The mode that is used when map tracking is enabled.

public static final enumeration VenueNavigationManager.TrackingTilt

The tilt that is used when map tracking is enabled.

public static abstract interface VenueNavigationManager.VenueNavigationManagerListener

An interface for responding to navigation events sent by the VenueNavigationManager .

Field Summary

Table 2. Fields in VenueNavigationManager
Fields

public static final float INVALID_DISTANCE_VALUE

Represents an invalid distance value.

public static final long INVALID_TIME_INTERVAL_VALUE

Represents an invalid time interval value.

Method Summary

Table 3. Methods in VenueNavigationManager
Methods

public void addListener (VenueNavigationManagerListener listener)

Adds a listener to the navigation manager.

public boolean areBeepsEnabled ()

public float getAverageSpeed ()

Returns the current average speed in the current navigation session.

public VenueManeuver getCurrentManeuver ()

Returns the current, upcoming VenueManeuver in the current navigation session.

public float getDistanceFromStart ()

Returns the current distance from the start point of navigation.

public float getDistanceToCurrentManeuver ()

Returns the remaining distance to the current VenueManeuver.

public float getDistanceToDestination ()

Returns the current distance to destination.

public float getDistanceToNextManeuver ()

Returns the remaining distance to the next VenueManeuver after the current one.

public float getManeuverZoomDistance ()

Gets the distance from the maneuver at which the maneuver zoom is active.

public float getManeuverZoomLevel ()

Gets the level to which to zoom in when the maneuver zoom is active.

public TrackingMode getMapTrackingMode ()

Returns map tracking mode.

public TrackingTilt getMapTrackingTilt ()

Returns how the map is tilted when map tracking is enabled.

public NavigationState getNavigationState ()

Gets the current state of the navigation related to the tracked route.

public VenueManeuver getNextManeuver ()

Returns the next VenueManeuver after the current VenueManeuver in the current navigation session.

public long getReroutingTimeout ()

Returns the time interval in seconds, after which the route will be recalculated in case the user moves far away from the current route.

public long getTimeToArrival ()

Returns the number of seconds that remain to travel to the destination, or INVALID_TIME_INTERVAL_VALUE on error.

public float getTravelledDistance ()

Returns the travelled distance in the current navigation session.

public VenueLayerAdapter getVenueLayer ()

public boolean isManeuverZoomEnabled ()

Returns wether zooming in on maneuvers is enabled during navigation.

public boolean isMapTrackingEnabled ()

Returns true , if @code VenueNavigationManager is allowed to automatically update map position as navigation progresses, false otherwise.

public boolean isPaused ()

Returns true , if current navigation is paused, false otherwise.

public boolean isVibrationEnabled ()

Returns whether device vibration is enabled during navigation.

public void pause (boolean value)

When set to true , the current navigation will be paused (if any).

public void removeListener (VenueNavigationManagerListener listener)

Removes a listener from the navigation manager.

public void setBeepsEnabled (boolean enabled)

Enables/disables device beep sounds during navigation.

public void setManeuverZoomDistance (float distance)

Sets the distance from the maneuver at which the maneuver zoom is active.

public void setManeuverZoomEnabled (boolean enabled)

Enables/disables zooming in on maneuvers during navigation.

public void setManeuverZoomLevel (float level)

Sets the level to which to zoom in when the maneuver zoom is active.

public void setMapTrackingEnabled (boolean value)

Allows the VenueNavigationManager to automatically update map position as navigation progresses.

public void setMapTrackingMode (TrackingMode value)

Controls how the map is moved and rotated when map tracking is enabled.

public void setMapTrackingTilt (TrackingTilt value)

Controls how the map is tilted when map tracking is enabled.

public void setReroutingTimeout (long timeoutInSeconds)

Sets the rerouting timeout in seconds.

public void setVibrationEnabled (boolean enabled)

Enables/disables device vibration during navigation.

public boolean start (VenueRoute routeSection, CombinedRoute route)

Starts a turn-by-turn navigation session using the specified venue route section.

public boolean start (LinkingRoute routeSection, CombinedRoute route)

Starts a turn-by-turn navigation session using the specified linking route section.

public void stop ()

Stops a turn-by-turn navigation session started via start(VenueRoute, CombinedRoute).

Class Details

A navigation manager class that provides guidance advice and information along an indoor route.

IMPORTANT: Venue Navigation Manager is a Beta feature. The related classes are subject to change without notice.

Field Details

public static final float INVALID_DISTANCE_VALUE

Represents an invalid distance value.

See also:

getDistanceFromStart()

getDistanceToCurrentManeuver()

getDistanceToDestination()

getDistanceToNextManeuver()

public static final long INVALID_TIME_INTERVAL_VALUE

Represents an invalid time interval value.

See also:

getTimeToArrival()

Method Details

public void addListener (VenueNavigationManagerListener listener)

Adds a listener to the navigation manager. The listener must implement the VenueNavigationManager.VenueNavigationManagerListener interface. The listener receives event callbacks containing information about the current navigation session.

Parameters:

public boolean areBeepsEnabled ()

Returns:

Whether beep sounds are enabled during navigation.

See also:

setBeepsEnabled(boolean)

public float getAverageSpeed ()

Returns the current average speed in the current navigation session.

Returns:

average speed in m/s.

public VenueManeuver getCurrentManeuver ()

Returns the current, upcoming VenueManeuver in the current navigation session.

Returns:

The upcoming VenueManeuver. Can be null, if navigation hasn't been started.

public float getDistanceFromStart ()

Returns the current distance from the start point of navigation.

Returns:

the distance from the start point in meters. Returns INVALID_DISTANCE_VALUE if an error occurred or navigation hasn't been started.

public float getDistanceToCurrentManeuver ()

Returns the remaining distance to the current VenueManeuver.

Returns:

the distance to the current VenueManeuver in meters. Returns INVALID_DISTANCE_VALUE if an error occured or if the upcoming maneuver is not available yet.

See also:

getCurrentManeuver()

public float getDistanceToDestination ()

Returns the current distance to destination.

Returns:

the distance to destination in meters. Returns INVALID_DISTANCE_VALUE if an error occurred or navigation hasn't been started.

public float getDistanceToNextManeuver ()

Returns the remaining distance to the next VenueManeuver after the current one.

Returns:

the distance to the next VenueManeuver in meters. Returns INVALID_DISTANCE_VALUE if an error occurred or if the next maneuver is not available yet.

See also:

getNextManeuver()

public float getManeuverZoomDistance ()

Gets the distance from the maneuver at which the maneuver zoom is active.

Returns:

The distance to the maneuver in meters.

public float getManeuverZoomLevel ()

Gets the level to which to zoom in when the maneuver zoom is active.

Returns:

The zoom level.

public TrackingMode getMapTrackingMode ()

Returns map tracking mode. The default value is FOLLOW.

Returns:

How the map is moved and rotated when map tracking is enabled.

public TrackingTilt getMapTrackingTilt ()

Returns how the map is tilted when map tracking is enabled. The default value is TILT3D.

Returns:

How the map is tilted when map tracking is enabled.

public NavigationState getNavigationState ()

Gets the current state of the navigation related to the tracked route.

Returns:

The current state of the navigation related to the tracked route.

public VenueManeuver getNextManeuver ()

Returns the next VenueManeuver after the current VenueManeuver in the current navigation session.

Returns:

The next VenueManeuver after the current one. Can be null, if navigation hasn't been started or when the current VenueManeuver is the last one.

See also:

getCurrentManeuver()

public long getReroutingTimeout ()

Returns the time interval in seconds, after which the route will be recalculated in case the user moves far away from the current route. When the user significantly deviates from the specified route, a new route will be calculated starting from the user's current position after this timeout expires.

Returns:

The time interval in seconds, after which the route will be recalculated in case the user moves far away from the current route.

See also:

setReroutingTimeout(long)

onRerouteBegin()

public long getTimeToArrival ()

Returns the number of seconds that remain to travel to the destination, or INVALID_TIME_INTERVAL_VALUE on error.

Returns:

The number of seconds that remain to travel to the destination.

public float getTravelledDistance ()

Returns the travelled distance in the current navigation session.

Returns:

travelled distance in meters.

public VenueLayerAdapter getVenueLayer ()

Returns:

The VenueLayerAdapter object for this instance of navigation manager.

public boolean isManeuverZoomEnabled ()

Returns wether zooming in on maneuvers is enabled during navigation.

Returns:

true if zooming in on maneuvers is enabled during navigation, and false otherwise.

public boolean isMapTrackingEnabled ()

Returns true , if @code VenueNavigationManager is allowed to automatically update map position as navigation progresses, false otherwise. By default returns true .

Returns:

true, if @code VenueNavigationManager is allowed to automatically update map position as navigation progresses, false otherwise.

public boolean isPaused ()

Returns true , if current navigation is paused, false otherwise.

Returns:

true, if current navigation is paused, false otherwise.

public boolean isVibrationEnabled ()

Returns whether device vibration is enabled during navigation.

Returns:

true if device vibration is enabled during navigation.

See also:

setVibrationEnabled(boolean)

public void pause (boolean value)

When set to true , the current navigation will be paused (if any). When set to false , the current navigation will resume if previously paused. This has no effect if there is no navigation currently in progress.

Parameters:

  • value

    When set to true, the current navigation will be paused (if any).

public void removeListener (VenueNavigationManagerListener listener)

Removes a listener from the navigation manager. The listener must implement the VenueNavigationManager.VenueNavigationManagerListener interface. The listener receives event callbacks containing information about the current navigation session.

Parameters:

public void setBeepsEnabled (boolean enabled)

Enables/disables device beep sounds during navigation. If enabled, these will be triggered on specific navigation events, like maneuver change, rerouting, reaching destination, etc.

Parameters:

  • enabled

    Flag to indicate the enable state of device beep sounds.

See also:

areBeepsEnabled()

public void setManeuverZoomDistance (float distance)

Sets the distance from the maneuver at which the maneuver zoom is active.

Parameters:

  • distance

    The distance to the maneuver in meters.

public void setManeuverZoomEnabled (boolean enabled)

Enables/disables zooming in on maneuvers during navigation.

Parameters:

  • enabled

    Flag to indicate the enable state of maneuver zooming.

public void setManeuverZoomLevel (float level)

Sets the level to which to zoom in when the maneuver zoom is active.

Parameters:

  • level

    The zoom level.

public void setMapTrackingEnabled (boolean value)

Allows the VenueNavigationManager to automatically update map position as navigation progresses.

Parameters:

  • value

    true to enable map tracking, false otherwise.

public void setMapTrackingMode (TrackingMode value)

Controls how the map is moved and rotated when map tracking is enabled.

Parameters:

public void setMapTrackingTilt (TrackingTilt value)

Controls how the map is tilted when map tracking is enabled. In 2D and 3D modes, the map will automatically be tilted back appropriately when the tilt value is changed. In Custom mode, the tilt will not be changed. Use custom mode to allow the map to be manually tilted during navigation or to set the tilt to a fixed custom value.

Parameters:

public void setReroutingTimeout (long timeoutInSeconds)

Sets the rerouting timeout in seconds. This is the time interval in seconds, after which the route will be recalculated in case the user moves far away from the current route

Parameters:

  • timeoutInSeconds

    Time interval in seconds.

See also:

getReroutingTimeout()

public void setVibrationEnabled (boolean enabled)

Enables/disables device vibration during navigation. If enabled, vibration will be triggered on specific navigation events, like maneuver change, rerouting, reaching destination, etc.

Parameters:

  • enabled

    Flag to indicate the enable state of device vibration.

Throws:

  • AccessControlException

    in case when there are no android.permission.VIBRATE permission granted.

public boolean start (VenueRoute routeSection, CombinedRoute route)

Starts a turn-by-turn navigation session using the specified venue route section.

Parameters:

  • routeSection

    The venue route section to navigate.

  • route

    The route used to navigate.

Returns:

True if started successfully and false otherwise, indicating that the venue route section is invalid or the navigation is already running.

public boolean start (LinkingRoute routeSection, CombinedRoute route)

Starts a turn-by-turn navigation session using the specified linking route section.

Parameters:

  • routeSection

    The linking route section to navigate.

  • route

    The route used to navigate.

Returns:

True if started successfully and false otherwise, indicating that the venue route section is invalid or the navigation is already running.

public void stop ()

Stops a turn-by-turn navigation session started via start(VenueRoute, CombinedRoute).