Interface Routing


public interface Routing
MapFactor SDK Routing module
Since:
1.0
  • Method Details

    • setRoutePoint

      void setRoutePoint(@NonNull RoutePointParams.RoutePointType type, @NonNull Coordinate coordinate, @Nullable String name, @Nullable RoutePointListener listener)
      Add new route point
      Parameters:
      type - route point type
      coordinate - route point location
      name - route point name
      listener - adding route point result listener
      Since:
      1.0
    • setRoutePoints

      void setRoutePoints(@NonNull List<RoutePointParams> routePointsParams, @Nullable RoutePointsListener listener)
      Parameters:
      routePointsParams - route points to add
      listener - adding route points result listener
      Since:
      4.5
    • deleteRoutePoint

      void deleteRoutePoint(@IntRange(from=1L) int pointId)
      Delete existing route point
      Parameters:
      pointId - route point ID - see RoutePointListener.onRoutePointAdded(int, boolean) onRoutePointAdded}
      Since:
      1.0
    • deleteAllCurrentRoutePoints

      void deleteAllCurrentRoutePoints()
      Delete all current route points
      Since:
      1.0
    • addCurrentRoutePointsListener

      void addCurrentRoutePointsListener(@NonNull CurrentRoutePointsListener listener)
      Add current route points changed listener
      Parameters:
      listener - current route points changed listener to add
      Since:
      3.8
    • removeCurrentRoutePointsListener

      void removeCurrentRoutePointsListener(@NonNull CurrentRoutePointsListener listener)
      Remove current route points changed listener
      Parameters:
      listener - current route points changed listener to remove
      Since:
      3.8
    • saveCurrentRoutePoints

      boolean saveCurrentRoutePoints(@NonNull String setName)
      Save current routing points set
      Parameters:
      setName - routing points set name
      Returns:
      success or failure
      Since:
      1.0
    • loadRoutePointsSet

      boolean loadRoutePointsSet(@NonNull String setName)
      Load saved routing points
      Parameters:
      setName - routing points set name
      Returns:
      success or failure
      Since:
      1.0
    • getAllSavedRoutePointsSets

      @NonNull List<String> getAllSavedRoutePointsSets()
      Get all saved routing points sets names
      Returns:
      list of all saved routing points sets
      Since:
      1.0
    • deleteSavedRoutePointsSet

      boolean deleteSavedRoutePointsSet(@NonNull String setName)
      Delete saved route points set
      Parameters:
      setName - route points set name to delete
      Returns:
      success/failure
      Since:
      1.0
    • calculateRoute

      void calculateRoute(boolean alternativeRoutes, boolean highlightOnMap, @NonNull RouteCalculationResultListener listener)
      Route calculation. Use setRoutePoint method to add departure/waypoint/destination before calculating route. If departure is not specified, current GPS position is used. If alternative routes are requested and more than one route is found, selectRouteAlternative or selectRouteOnMapFragment must be called to pick one of them and automatically delete others. To reject all alternatives, call allRouteAlternativesRejected.
      Parameters:
      alternativeRoutes - true to calculate up to 3 different routes, false to calculate only one route
      highlightOnMap - true/false indicating the calculated route(s) should be highlighted on map
      listener - calculation result listener
      Since:
      1.0
    • selectRouteOnMap

      void selectRouteOnMap()
      Start selection one of previously calculated alternative routes on map
      Since:
      2.7
    • selectRouteAlternative

      boolean selectRouteAlternative(@IntRange(from=1L) int selectedRouteId)
      Select one of previously calculated alternative routes using calculateRoute with parameter alternativeRoutes set to true. Other routes will be deleted. Does tot have to be called when only one route was found.
      Parameters:
      selectedRouteId - selected route ID
      Returns:
      success or failed when selectedRouteId does not exist
      Since:
      1.0
    • allRouteAlternativesRejected

      void allRouteAlternativesRejected()
      None of previously calculated alternative routes using calculateRoute with parameter alternativeRoutes was accepted, all routes will be deleted. Unlike selectRouteAlternative, call even when only one route was previously found using calculateRoute.
      Since:
      1.0
    • getRoutePoints

      @Nullable List<RoutePoint> getRoutePoints(@IntRange(from=1L) int routeId)
      Get route departure, waypoints and destination
      Parameters:
      routeId - route ID
      Returns:
      list of route departure, waypoints and destination
      Since:
      1.0
    • getCurrentRoutePoints

      @Nullable List<RoutePoint> getCurrentRoutePoints()
      Get route departure, waypoints and destination currently on map
      Returns:
      list of route departure, waypoints and destination
      Since:
      3.4
    • deleteRoute

      boolean deleteRoute(@IntRange(from=1L) int routeId)
      Delete previously calculated route using calculateRoute
      Parameters:
      routeId - route ID to delete
      Returns:
      success if route with given ID existed, false otherwise
      Since:
      1.0
    • getRouteGeometry

      void getRouteGeometry(@IntRange(from=1L) int routeId, @NonNull Routing.RouteCoordinatesListener listener)
      Get coordinates describing the route geometry
      Parameters:
      routeId - route ID to get coordinates
      listener - listener to receive route coordinates
      Since:
      1.0
    • getRouteItinerary

      void getRouteItinerary(@IntRange(from=1L) int routeId, @NonNull Routing.RouteItineraryListener listener)
      Get route itinerary text description
      Parameters:
      routeId - route ID to get itinerary
      listener - listener to receive route itinerary
      Since:
      1.0
    • getVehiclesManager

      @NonNull VehiclesManager getVehiclesManager()
      Get vehicles manager
      Returns:
      vehicles manager
      Since:
      1.0
    • getClosedRoadsManager

      @NonNull ClosedRoadsManager getClosedRoadsManager()
      Get permanently closed roads manager
      Returns:
      disabled roads manager
      Since:
      1.0