Package com.mapfactor.sdk.routing
Interface Routing
public interface Routing
MapFactor SDK Routing module
- Since:
- 1.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Route calculation failure codes.static interface
Listener receiving route coordinatesstatic interface
Listener receiving route itinerary -
Method Summary
Modifier and TypeMethodDescriptionvoid
None of previously calculated alternative routes usingcalculateRoute
with parameter alternativeRoutes was accepted, all routes will be deleted.void
calculateRoute
(boolean alternativeRoutes, boolean highlightOnMap, RouteCalculationResultListener listener) Route calculation.void
Delete all current route pointsboolean
deleteRoute
(int routeId) Delete previously calculated route usingcalculateRoute
void
deleteRoutePoint
(int pointId) Delete existing route pointboolean
deleteSavedRoutePointsSet
(String setName) Delete saved route points setGet all saved routing points sets namesGet permanently closed roads managerGet route departure, waypoints and destination currently on mapvoid
getRouteGeometry
(int routeId, Routing.RouteCoordinatesListener listener) Get coordinates describing the route geometryvoid
getRouteItinerary
(int routeId, Routing.RouteItineraryListener listener) Get route itinerary text descriptiongetRoutePoints
(int routeId) Get route departure, waypoints and destinationGet vehicles managerboolean
loadRoutePointsSet
(String setName) Load saved routing pointsboolean
saveCurrentRoutePoints
(String setName) Save current routing points setboolean
selectRouteAlternative
(int selectedRouteId) Select one of previously calculated alternative routes usingcalculateRoute
with parameter alternativeRoutes set to true.void
Start selection one of previously calculated alternative routes on mapvoid
setRoutePoint
(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. UsesetRoutePoint
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
orselectRouteOnMapFragment
must 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 usingcalculateRoute
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 usingcalculateRoute
with 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
-