Package com.mapfactor.sdk.routing
Interface Routing
public interface Routing
MapFactor SDK Routing module
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classRoute calculation failure codes.static interfaceListener receiving route coordinatesstatic interfaceListener receiving route itinerary -
Method Summary
Modifier and TypeMethodDescriptionvoidNone 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 managervoidgetRouteGeometry(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 pointsbooleansaveCurrentRoutePoints(String setName)Save current routing points setbooleanselectRouteAlternative(int selectedRouteId)Select one of previously calculated alternative routes usingcalculateRoutewith parameter alternativeRoutes set to true.voidsetRoutePoint(RoutePoint.RoutePointType type, Coordinate coordinate, String name, RoutePointListener listener)Add new route point
-
Method Details
-
setRoutePoint
void setRoutePoint(@NonNull RoutePoint.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
-
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
-
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:
- array 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,selectRouteAlternativemust 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
-
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
-
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
-