Interface Router

  • All Implemented Interfaces:

    
    public interface Router
    
                        

    Router provides API to fetch route and cancel route-fetching request.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface Router.Callback

      Callback for Router fetching

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit getRoute(RouteOptions routeOptions, Router.Callback callback) Fetch route based on RouteOptions
      abstract Unit cancel() Interrupts a route-fetching request if one is in progress.
      abstract Unit getRouteRefresh(DirectionsRoute route, Integer legIndex, Integer geometryIndex, Boolean requestFasterRoute, RouteRefreshCallback callback) Refresh the traffic annotations for a given DirectionsRoute
      Unit onNetworkStatusChanged(Boolean isNetworkAvailable) Called when the network connection status changes.
      abstract Unit shutdown() Release used resources.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getRoute

         abstract Unit getRoute(RouteOptions routeOptions, Router.Callback callback)

        Fetch route based on RouteOptions

        Parameters:
        routeOptions - RouteOptions
        callback - Callback that gets notified with the results of the request
      • cancel

         abstract Unit cancel()

        Interrupts a route-fetching request if one is in progress.

      • getRouteRefresh

         abstract Unit getRouteRefresh(DirectionsRoute route, Integer legIndex, Integer geometryIndex, Boolean requestFasterRoute, RouteRefreshCallback callback)

        Refresh the traffic annotations for a given DirectionsRoute

        Parameters:
        route - DirectionsRoute the direction route to refresh
        legIndex - Int the index of the current leg in the route
        geometryIndex - the index of the current point in geometry
        requestFasterRoute - true to request a faster route, false otherwise
        callback - Callback that gets notified with the results of the request
      • onNetworkStatusChanged

         Unit onNetworkStatusChanged(Boolean isNetworkAvailable)

        Called when the network connection status changes. Can be used to determine which Route to use