| java.lang.Object | |
| ↳ | com.steerpath.sdk.directions.DirectionsApi |
The Directions API is the main entry point to the directions subsystem of the Steerpath platform.
The typical use is to obtain a reference to it using the getInstance() static method.
For directions there are two separate but related steps: Calculating a route and estimating
the time of travel when taking that route.
Routes are calculated based on a network of possible paths that can be taken. In this
network, different route types are marked, such as elevators, escalators and even buses and trains.
Each different type is assigned two different costs, a cost to enter it and a cost along it.
While cost is an abstract concept, for simplicity, cost in routing can be thought of as time spent,
so the cost to enter is the time spent waiting and the cost along is the time it will take to
walk a given length of on the path: e.g. the time spent waiting for an elevator and the time
spent moving whilst on an elevator. However these costs are not the same as the estimated travel
time shown to users. The reason why they differ is that in some cases a route segment may need
to be made more or less attractive without affecting the shown estimated time. For example
walking past a some waste disposal area may be a fast route, but one that should generally not be used
unless the user is very near by.
The current default costs are as follows:
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
addRouteTile(File file)
Adds synchronously single route tile.
| ||||||||||
| void |
cancelTask(DirectionsRequestImpl request)
Unfortunate internal method made public.
| ||||||||||
| void |
clearRouteTileCache()
A utility function to clear downloaded cached data.
| ||||||||||
| static DirectionsApi |
getInstance()
Obtain a reference to the directions api implementation.
| ||||||||||
| DirectionsRequest |
startCalculatingDirections(Context context, DirectionsRequest directionsRequest, DirectionsListener directionsListener)
Start calculating a solution to a DirectionsRequest.
| ||||||||||
| void | updateRouteDatabase(Context context) | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Adds synchronously single route tile. Don't call this from the main thread.
Unfortunate internal method made public. Do not call.
A utility function to clear downloaded cached data. Subsequent call to startCalculatingDirections() will download fresh directions data from the server.
Obtain a reference to the directions api implementation.
Start calculating a solution to a DirectionsRequest.
| context | the context in which this directions calculation should be performed. |
|---|---|
| directionsRequest | the request for directions to be fulfilled by this calculation |
| directionsListener | the listener implementation which will get the result |