java.lang.Object | ||
↳ | com.carto.routing.RoutingService | |
↳ | com.carto.routing.ValhallaOnlineRoutingService |
An online routing service that uses MapBox Valhalla routing service.
As the class connects to an external (non-CARTO) service, this class is provided "as-is",
future changes from the service provider may not be compatible with the implementation.
Routing and route matching perform network requests and must be executed in non-UI background thread.
Be sure to read the Terms and Conditions of your Valhalla service provider to see if the
service is available for your application.
Note: this class is experimental and may change or even be removed in future SDK versions.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ValhallaOnlineRoutingService(String apiKey)
Constructs a new ValhallaOnlineRoutingService instance given database file.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RoutingResult |
calculateRoute(RoutingRequest request)
Calculates routing result (path) based on routing request.
| ||||||||||
synchronized void | delete() | ||||||||||
String |
getCustomServiceURL()
Returns the custom backend service URL.
| ||||||||||
String |
getProfile()
Returns the current routing profile.
| ||||||||||
RouteMatchingResult |
matchRoute(RouteMatchingRequest request)
Matches specified points to the points on the road network.
| ||||||||||
void |
setCustomServiceURL(String serviceURL)
Sets the custom backend service URL.
| ||||||||||
void |
setProfile(String profile)
Sets the current routing profile.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a new ValhallaOnlineRoutingService instance given database file.
apiKey | The API key (access token) to use registered with MapBox. |
---|
Calculates routing result (path) based on routing request.
request | The routing request defining via points. |
---|
IOException |
---|
Returns the custom backend service URL.
Returns the current routing profile.
Matches specified points to the points on the road network.
request | The matching request defining points. |
---|
IOException |
---|
Sets the custom backend service URL.
The custom URL should contain tag "{service}", it will be substituted by the SDK by the service type the SDK needs to perform ("route" or "trace_route").
The custom URL may also contain tag "{api_key}" which will be substituted with the set API key.
serviceURL | The custom backend service URL to use. If this is empty, then the default service is used. |
---|
Sets the current routing profile.
profile | The new routing profile. Routing profiles are dependent on specific routing service. |
---|