Package globus.glroute
Class GLRouteTracker
java.lang.Object
globus.glmap.GLNativeObject
globus.glroute.GLRouteTracker
GLMapRouteTracker
tracks user location on route and returns statistics and maneuver
info-
Constructor Summary
ConstructorDescriptionGLRouteTracker
(GLRoute data) Initializes new trackerGLRouteTracker
(GLRoute[] routes, int currentRoute) Initializes a tracker with array of routes. -
Method Summary
Modifier and TypeMethodDescriptionbboxForSegment
(double length) Calculates the bounding box of a route segment from the last location.boolean
didPassPoint
(MapGeoPoint point, double maxDistance) Checks if user pass the pointboolean
didPassRoute
(int routeIndex) Checks if user pass the routedouble
Returns bearing angle of current route segmentint
Returns index of current routeint
Index of current target pointdouble
Returns distance from route to user locationdouble
Returns distance to the last point of routedouble
Returns distance to the next maneuverReturns location of user at routedouble
Returns progress index of routedouble
Returns remaining distance of the routedouble
Returns remaining time to the end of the routeboolean
Returns true if user on routevoid
setCurrentRoute
(int index) Sets index of current routevoid
setCurrentTargetPointIndex
(int index) Sets index of current target pointupdateLocation
(double lat, double lon, float bearing) Finds next maneuver and update information about itMethods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
GLRouteTracker
Initializes new tracker- Parameters:
data
- route data
-
GLRouteTracker
Initializes a tracker with array of routes. Tracker will automatically switch to other routes if possible.- Parameters:
routes
- array of routes to trackcurrentRoute
- index of current route
-
-
Method Details
-
updateLocation
Finds next maneuver and update information about it- Parameters:
lat
- Latitude of current user locationlon
- Longitude of current user locationbearing
- Direction where user is moving- Returns:
- next maneuver of the route
-
getDistanceToNextManeuver
public double getDistanceToNextManeuver()Returns distance to the next maneuver- Returns:
- distance to the next maneuver in meters
-
getDistanceToLastPoint
public double getDistanceToLastPoint()Returns distance to the last point of route- Returns:
- distance to the last point of route in meters
-
getRemainingDistance
public double getRemainingDistance()Returns remaining distance of the route- Returns:
- distance to the target location in meters
-
getDistanceFromRoute
public double getDistanceFromRoute()Returns distance from route to user location- Returns:
- distance in meters
-
isOnRoute
public boolean isOnRoute()Returns true if user on route- Returns:
- true if user on route
-
getRemainingDuration
public double getRemainingDuration()Returns remaining time to the end of the route- Returns:
- estimated time to the end of the route
-
getBearingAngleOnRoute
public double getBearingAngleOnRoute()Returns bearing angle of current route segment- Returns:
- bearing angel of current route segment
-
getLocationOnRoute
Returns location of user at route- Returns:
- location of user at route
-
getProgressIndex
public double getProgressIndex()Returns progress index of route- Returns:
- progress index of route
-
getCurrentTargetPointIndex
public int getCurrentTargetPointIndex()Index of current target point- Returns:
- index of current target point
-
setCurrentTargetPointIndex
public void setCurrentTargetPointIndex(int index) Sets index of current target point- Parameters:
index
- index of current target point
-
setCurrentRoute
public void setCurrentRoute(int index) Sets index of current route- Parameters:
index
- index of current route
-
getCurrentRoute
public int getCurrentRoute()Returns index of current route- Returns:
- index of current route
-
didPassPoint
Checks if user pass the point- Parameters:
point
- Point to checkmaxDistance
- Max distance from route to point in meters- Returns:
- true if user pass the point.
-
didPassRoute
public boolean didPassRoute(int routeIndex) Checks if user pass the route- Parameters:
routeIndex
- Index of route to check- Returns:
- true if user pass the route.
-
bboxForSegment
Calculates the bounding box of a route segment from the last location.- Parameters:
length
- The length in meters of the segment.- Returns:
- The bounding box of the segment.
-