AI-generated Key Takeaways
-
NavInfo
provides real-time navigation state information like current step, remaining steps, distances, and time estimates. -
It includes methods to access details about the current and upcoming maneuver steps, distances to destinations, and overall navigation state.
-
This API is in beta and subject to change without guaranteeing backward compatibility.
-
Developers can utilize the
NavInfo.Builder
to create instances ofNavInfo
. -
Some methods, such as
getDistanceToDestinationMeters
andgetTimeToDestinationSeconds
, are deprecated and will be removed in the future, with alternatives available.
Contains information about the state of navigation, the current nav step if available, and remaining steps if available.
Nested Class Summary
class | NavInfo.Builder | Builder for NavInfo. |
Public Method Summary
static NavInfo.Builder |
builder()
Returns a builder for NavInfo.
|
StepInfo |
getCurrentStep()
Returns information about the upcoming maneuver step.
|
Integer |
getDistanceToCurrentStepMeters()
Returns the estimated remaining distance in meters along the route to the current step.
|
Integer |
getDistanceToDestinationMeters()
This method is deprecated.
This method is deprecated and will be removed in a future version of this library.
Please use
getDistanceToFinalDestinationMeters() instead.
|
Integer |
getDistanceToFinalDestinationMeters()
Returns the estimated remaining distance in meters to the final destination which is the last
destination in a multi-destination trip.
|
Integer |
getDistanceToNextDestinationMeters()
Returns the estimated remaining distance in meters to the next destination.
|
int |
getNavState()
Returns the current state of navigation.
|
StepInfo[] |
getRemainingSteps()
Returns the remaining steps after the current step.
|
boolean |
getRouteChanged()
Whether the route has changed since the last sent message.
|
Integer |
getTimeToCurrentStepSeconds()
Returns the estimated remaining time in seconds along the route to the current step.
|
Integer |
getTimeToDestinationSeconds()
This method is deprecated.
This method is deprecated and will be removed in a future version of this library.
Please use
getTimeToFinalDestinationSeconds() instead.
|
Integer |
getTimeToFinalDestinationSeconds()
Returns the estimated remaining time in seconds to the final destination which is the last
destination in a multi-destination trip.
|
Integer |
getTimeToNextDestinationSeconds()
Returns the estimated remaining time in seconds to the next destination.
|
NavInfo.Builder |
Inherited Method Summary
Public Methods
public static NavInfo.Builder builder ()
Returns a builder for NavInfo.
Returns
- a builder for NavInfo.
public StepInfo getCurrentStep ()
Returns information about the upcoming maneuver step. This is only set if the NavState is
ENROUTE and will be null
otherwise.
Returns
- the upcoming maneuver step if set, otherwise
null
.
public Integer getDistanceToCurrentStepMeters ()
Returns the estimated remaining distance in meters along the route to the current step.
Returns
- the estimated remaining distance in meters along the route to the current step if
available, otherwise
null
.
public Integer getDistanceToDestinationMeters ()
This method is deprecated.
This method is deprecated and will be removed in a future version of this library.
Please use getDistanceToFinalDestinationMeters()
instead.
Returns the estimated remaining distance in meters to the destination which is the last destination in a multi-destination trip.
Returns
- the estimated remaining distance in meters to the destination which is the last
destination in a multi-destination trip if available, otherwise
null
.
public Integer getDistanceToFinalDestinationMeters ()
Returns the estimated remaining distance in meters to the final destination which is the last destination in a multi-destination trip.
Returns
- the estimated remaining distance in meters to the final destination which is the last
destination in a multi-destination trip if available, otherwise
null
.
public Integer getDistanceToNextDestinationMeters ()
Returns the estimated remaining distance in meters to the next destination.
Returns
- the estimated remaining distance in meters to the next destination if available,
otherwise
null
.
public int getNavState ()
Returns the current state of navigation.
Returns
- the current state of navigation.
public StepInfo[] getRemainingSteps ()
Returns the remaining steps after the current step.
Returns
- remaining steps after the current step.
public boolean getRouteChanged ()
Whether the route has changed since the last sent message. A route change may be caused by a reroute, the addition/removal of a waypoint, the user selecting or driving onto an alternate route, or a traffic update.
Returns
- whether the route has changed since the last sent nav update.
public Integer getTimeToCurrentStepSeconds ()
Returns the estimated remaining time in seconds along the route to the current step.
Returns
- the estimated remaining time in seconds along the route to the current step if
available, otherwise
null
.
public Integer getTimeToDestinationSeconds ()
This method is deprecated.
This method is deprecated and will be removed in a future version of this library.
Please use getTimeToFinalDestinationSeconds()
instead.
Returns the estimated remaining time in seconds to the destination.
Returns
- the estimated remaining time in seconds to the destination if available, otherwise
null
.
public Integer getTimeToFinalDestinationSeconds ()
Returns the estimated remaining time in seconds to the final destination which is the last destination in a multi-destination trip.
Returns
- the estimated remaining time in seconds to the final destination which is the last
destination in a multi-destination trip if available, otherwise
null
.
public Integer getTimeToNextDestinationSeconds ()
Returns the estimated remaining time in seconds to the next destination.
Returns
- the estimated remaining time in seconds to the next destination if available, otherwise
null
.