Class GLRouteTracker


  • public class GLRouteTracker
    extends com.getyourmap.glmap.GLNativeObject
    GLMapRouteTracker tracks user location on route and returns statistics and maneuver info
    • Constructor Summary

      Constructors 
      Constructor Description
      GLRouteTracker​(GLRoute data)
      Initializes new tracker
    • Method Summary

      Modifier and Type Method Description
      boolean didPassPoint​(com.getyourmap.glmap.MapGeoPoint point, double maxDistance)
      Checks if user pass the point
      double getBearingAngleOnRoute()
      Returns bearing angle of current route segment
      double getDistanceFromRoute()
      Returns distance from route to user location
      double getDistanceToLastPoint()
      Returns distance to the last point of route
      double getDistanceToNextManeuver()
      Returns distance to the next maneuver
      com.getyourmap.glmap.MapPoint getLocationOnRoute()
      Returns location of user at route
      double getRemainingDistance()
      Returns remaining distance of the route
      double getRemainingDuration()
      Returns remaining time to the end of the route
      boolean isOnRoute()
      Returns true if user on route
      GLRouteManeuver updateLocation​(double lat, double lon, float bearing)
      Finds next maneuver and update information about it
      • Methods inherited from class com.getyourmap.glmap.GLNativeObject

        dispose
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GLRouteTracker

        public GLRouteTracker​(GLRoute data)
        Initializes new tracker
        Parameters:
        data - route data
    • Method Detail

      • updateLocation

        public GLRouteManeuver updateLocation​(double lat,
                                              double lon,
                                              float bearing)
        Finds next maneuver and update information about it
        Parameters:
        lat - Latitude of current user location
        lon - Longitude of current user location
        bearing - 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

        @NonNull
        public com.getyourmap.glmap.MapPoint getLocationOnRoute()
        Returns location of user at route
        Returns:
        location of user at route
      • didPassPoint

        public boolean didPassPoint​(com.getyourmap.glmap.MapGeoPoint point,
                                    double maxDistance)
        Checks if user pass the point
        Parameters:
        point - Point to check
        maxDistance - Max distance from route to point in meters
        Returns:
        true if user pass the point.