Package com.mapfactor.sdk.routing
Interface Routing
public interface Routing
MapFactor SDK Routing module
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumRoute calculation failure codes.static interfaceListener receiving route coordinatesstatic interfaceListener receiving route itinerary -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd current route points changed listenervoidNone of previously calculated alternative routes usingcalculateRoutewith parameter alternativeRoutes was accepted, all routes will be deleted.voidcalculateRoute(boolean alternativeRoutes, boolean highlightOnMap, RouteCalculationResultListener listener) Route calculation.voidDelete all current route pointsbooleandeleteRoute(int routeId) Delete previously calculated route usingcalculateRoutevoiddeleteRoutePoint(int pointId) Delete existing route pointbooleandeleteSavedRoutePointsSet(String setName) Delete saved route points setGet all saved routing points sets namesGet permanently closed roads managerGet route departure, waypoints and destination currently on mapvoidgetRouteGeometry(int routeId, Routing.RouteCoordinatesListener listener) Get coordinates describing the route geometryvoidgetRouteItinerary(int routeId, Routing.RouteItineraryListener listener) Get route itinerary text descriptiongetRoutePoints(int routeId) Get route departure, waypoints and destinationGet vehicles managerbooleanloadRoutePointsSet(String setName) Load saved routing pointsvoidRemove current route points changed listenerbooleansaveCurrentRoutePoints(String setName) Save current routing points setbooleanselectRouteAlternative(int selectedRouteId) Select one of previously calculated alternative routes usingcalculateRoutewith parameter alternativeRoutes set to true.voidStart selection one of previously calculated alternative routes on mapvoidsetRoutePoint(RoutePointParams.RoutePointType type, Coordinate coordinate, String name, RoutePointListener listener) Add new route pointvoidsetRoutePoints(List<RoutePointParams> routePointsParams, RoutePointsListener listener) Add multiple new route points.
-
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 typecoordinate- route point locationname- route point namelistener- adding route point result listener- Since:
- 1.0
-
setRoutePoints
void setRoutePoints(@NonNull List<RoutePointParams> routePointsParams, @Nullable RoutePointsListener listener) Add multiple new route points. SeeRoutePointParams.create(RoutePointParams.RoutePointType, Coordinate, String)- Parameters:
routePointsParams- route points to addlistener- 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 - seeRoutePointListener.onRoutePointAdded(int, boolean)onRoutePointAdded}- Since:
- 1.0
-
deleteAllCurrentRoutePoints
void deleteAllCurrentRoutePoints()Delete all current route points- Since:
- 1.0
-
addCurrentRoutePointsListener
Add current route points changed listener- Parameters:
listener- current route points changed listener to add- Since:
- 3.8
-
removeCurrentRoutePointsListener
Remove current route points changed listener- Parameters:
listener- current route points changed listener to remove- Since:
- 3.8
-
saveCurrentRoutePoints
Save current routing points set- Parameters:
setName- routing points set name- Returns:
- success or failure
- Since:
- 1.0
-
loadRoutePointsSet
Load saved routing points- Parameters:
setName- routing points set name- Returns:
- success or failure
- Since:
- 1.0
-
getAllSavedRoutePointsSets
Get all saved routing points sets names- Returns:
- list of all saved routing points sets
- Since:
- 1.0
-
deleteSavedRoutePointsSet
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. UsesetRoutePointmethod 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,selectRouteAlternativeorselectRouteOnMapFragmentmust be called to pick one of them and automatically delete others. To reject all alternatives, callallRouteAlternativesRejected.- Parameters:
alternativeRoutes- true to calculate up to 3 different routes, false to calculate only one routehighlightOnMap- true/false indicating the calculated route(s) should be highlighted on maplistener- 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 usingcalculateRoutewith 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 usingcalculateRoutewith parameter alternativeRoutes was accepted, all routes will be deleted. UnlikeselectRouteAlternative, call even when only one route was previously found using calculateRoute.- Since:
- 1.0
-
getRoutePoints
Get route departure, waypoints and destination- Parameters:
routeId- route ID- Returns:
- list of route departure, waypoints and destination
- Since:
- 1.0
-
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 usingcalculateRoute- 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 coordinateslistener- 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 itinerarylistener- listener to receive route itinerary- Since:
- 1.0
-
getVehiclesManager
Get vehicles manager- Returns:
- vehicles manager
- Since:
- 1.0
-
getClosedRoadsManager
Get permanently closed roads manager- Returns:
- disabled roads manager
- Since:
- 1.0
-