Class NavigationProgress

java.lang.Object
es.situm.sdk.model.navigation.NavigationProgress
All Implemented Interfaces:
android.os.Parcelable, MapperInterface

public class NavigationProgress extends Object implements android.os.Parcelable, MapperInterface
Provide information of the progress of a user while following a route.
  • Field Details

  • Method Details

    • getRouteStep

      @NonNull public RouteStep getRouteStep()
      Returns the route step/edge/fragment closest to the user, where the getClosestLocationInRoute() is.
      Returns:
      RouteStep. Default is RouteStep.EMPTY.
    • getClosestPointInRoute

      @NonNull public Point getClosestPointInRoute()
      Returns the route point closest to the user location provided to NavigationManager.updateWithLocation(Location). For route navigation, we assume this as the user location.
    • getClosestLocationInRoute

      public Location getClosestLocationInRoute()
      Returns the closest location in the route from the user location provided to NavigationManager.updateWithLocation(Location). For route navigation, we assume this as the user location.
      Returns:
      Location
    • getDistanceToClosestPointInRoute

      @FloatRange(from=0.0) public double getDistanceToClosestPointInRoute()
      Returns the distance between the real user location (provided to NavigationManager.updateWithLocation(Location)) and the closest route location (getClosestLocationInRoute()).
      Returns:
      double. Default is 0.
    • getDistanceToGoal

      @FloatRange(from=0.0) public double getDistanceToGoal()
      Returns the distance from getClosestLocationInRoute() to route's goal point.
      Returns:
      double. Default is 0.
    • getCurrentIndication

      @NonNull public Indication getCurrentIndication()
      Returns the current indication
    • getNextIndication

      @NonNull public Indication getNextIndication()
      Returns the next indication. If this is the last indication it will return Indication.EMPTY
    • getDistanceToEndStep

      @FloatRange(from=0.0) public double getDistanceToEndStep()
      Returns the distance to the end this step
    • getTimeToGoal

      @FloatRange(from=0.0) public double getTimeToGoal()
      Returns the estimated time to go from getClosestLocationInRoute() to the goal/end of route, considering a speed of 1 meter/second
      Returns:
      double. Default is 0.
    • getTimeToEndStep

      @FloatRange(from=0.0) public double getTimeToEndStep()
      Returns the estimated time to go from getClosestLocationInRoute() to the end of getRouteStep(), considering a speed of 1 meter/second
      Returns:
      double. Default is 0.
    • getPoints

      @NonNull public List<Point> getPoints()
      Returns remaining list of ordered points of the route. If you want the points to display them in a map use getSegments()
      Returns:
      non-empty list of points
    • getSegments

      @NonNull public List<RouteSegment> getSegments()
      Return list of ordered points split by floor, each list contains points from one floor, but can have multiple lists of the same floor. Use this method to display segments in a map, each list should be a polyline.

      For example, if there is no path to go to the other side of the same floor and you need to go up one floor and then go down again to the original floor, this method will return one segment on the current floor, one segment on the upper floor and one more segment in the current floor.

      Drawing example: if you want to draw all the points of a floor, you should draw a polyline for each list that contains the floor you want to show.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toMap

      public Map<String,Object> toMap()
      Description copied from interface: MapperInterface
      Method to transform object into Map<String, Object>
      Specified by:
      toMap in interface MapperInterface
      Returns:
      Map<String, Object> with the information of the object mapped
    • fromMap

      public static NavigationProgress fromMap(Map<String,Object> map) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable