public class RouteAlert extends Object
Modifier and Type | Method and Description |
---|---|
void |
enableAlternateRouteAlerts(boolean enabled)
Enable or disable alternate route alerts.
|
void |
enableBetterRouteAlerts(boolean enabled)
Enable or disable better route alerts.
|
SimpleArrayMap<DangerousSlowdown,Double> |
getDSlowdownsOnRouteWithDistance() |
SimpleArrayMap<Incident,Double> |
getIncidentsOnRouteWithDistance()
Gets a map of the incidents on the tracker route and their distances from the origin.
|
double |
getProgress()
Get the route progress as a percentage of the route completed/driven.
|
double |
getRemainingDistance()
Get the distance remaining on the route.
|
double |
getTotalRouteDistance()
Get the total route distance.
|
int |
getTotalRouteDistanceMeters()
Get the total route distance in meters.
|
Route |
getTrackedRoute()
Get the route that is currently being tracked.
|
boolean |
isAlertActive()
Get whether or not alert is active.
|
void |
setFilter(IFilter<Incident> filter)
Set the filter to filter incidents.
|
void |
setRoutesToUpdate(List<Route> routesToUpdate)
Set an array of
Route to update. |
void |
setRouteToTrack(Route route)
Set a particular route to track.
|
void |
setUserDriving(boolean isUserDriving)
Set a default value to user driving state.
|
void |
start(Location currentLocation)
This method is used to start the route incident alert.
|
void |
stop()
This method is used to stop the route incident alert.
|
void |
updateCurrentLocation(Location currentLocation)
Updates the current location for route requests.
|
public void updateCurrentLocation(@NonNull Location currentLocation)
currentLocation
- The current location.InrixException
- when currentLocation us null.public void start(Location currentLocation)
currentLocation
- The current location.public void stop()
public boolean isAlertActive()
true
if active, false
otherwise.public void setFilter(IFilter<Incident> filter)
filter
- A new filter.public void setRouteToTrack(Route route)
route
- The new route to track.public void setRoutesToUpdate(List<Route> routesToUpdate)
Route
to update.routesToUpdate
- The routes to update.public Route getTrackedRoute()
public double getTotalRouteDistance()
UserPreferences.getSettingUnits()
.public int getTotalRouteDistanceMeters()
public SimpleArrayMap<Incident,Double> getIncidentsOnRouteWithDistance()
public SimpleArrayMap<DangerousSlowdown,Double> getDSlowdownsOnRouteWithDistance()
public double getRemainingDistance()
UserPreferences.getSettingUnits()
.-1
if unknown.public double getProgress()
0.25
represents that 25% of the route has been driven, and 75% of the total
route distance is remaining.-1
if unknown.public void enableBetterRouteAlerts(boolean enabled)
enabled
- true
to enabled better route alerts, false
otherwise.public void enableAlternateRouteAlerts(boolean enabled)
enabled
- true
to enabled alternate route alerts, false
otherwise.public void setUserDriving(boolean isUserDriving)
isUserDriving
- Flag to pre select if a user is in a driving state.Copyright © 2013-2018 INRIX, Inc. All Rights Reserved.