Package es.situm.sdk.directions
Class DirectionsRequest.Builder
java.lang.Object
es.situm.sdk.directions.DirectionsRequest.Builder
- Enclosing class:
- DirectionsRequest
DirectionsRequest builder static inner class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccessibilityMode(DirectionsRequest.AccessibilityMode accessibilityMode) Sets the accessibility mode of the route.build()Returns aDirectionsRequestbuilt from the parameters previously set.excludedTags(List<String> excludedTags) List of tags that you want your route to avoid.Add an area that will be excluded from the calculated route.Sets the starting point of the route, and the bearing of the user to generate the appropriate instructions.Sets the current user's position as the starting point of the route.includedTags(List<String> includedTags) List of tags that you want to use when calculating a route.isAccessible(boolean isAccessible) Sets if the route has to be suitable for wheel chairs (true) or not (false)minimizeFloorChanges(boolean minimizeFloorChanges) Sets if you want to calculate a route minimizing the floor changes even if the route is longer.options(DirectionsOptions options) Sets additional information on how a route should be computed.Sets the pointto, where the route should end.Sets the identifier of the POIpoiToIdentifier, where the route should end.
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
from
Sets the starting point of the route, and the bearing of the user to generate the appropriate instructions.- Parameters:
from-Pointpoint inside a building (Point.isIndoor()== true)bearingFrom-Angleuser's bearing- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
from
Sets the current user's position as the starting point of the route.- Parameters:
currentLocation- current user'sLocation, obtained withLocationManager- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
to
Sets the pointto, where the route should end.- Parameters:
to-Pointpoint inside a building (Point.isIndoor()== true)- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
to
Sets the identifier of the POIpoiToIdentifier, where the route should end.- Parameters:
poiToIdentifier-StringIdentifier of a POI inside a building (Poi.isIndoor()== true)- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
isAccessible
Sets if the route has to be suitable for wheel chairs (true) or not (false)- Parameters:
isAccessible- boolean- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
accessibilityMode
@NonNull public DirectionsRequest.Builder accessibilityMode(DirectionsRequest.AccessibilityMode accessibilityMode) Sets the accessibility mode of the route.Default value is
DirectionsRequest.DEFAULT_ACCESSIBILITY_MODE- Parameters:
accessibilityMode-DirectionsRequest.AccessibilityMode- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
minimizeFloorChanges
Sets if you want to calculate a route minimizing the floor changes even if the route is longer. By default this is set to false, and it will calculate the shortest route.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
includedTags
List of tags that you want to use when calculating a route. Only the tags added here will be used. Other tags on the graph will be excluded. The edges without a tag will always be used. If you don't include or exclude any tags the entire graph will be used to calculate the route.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
excludedTags
List of tags that you want your route to avoid. If you exclude a tag the route will never pass through an edge that has this tag. If the route can only be generated passing through an edge with this tags the route calculation will fail.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
options
Sets additional information on how a route should be computed.- Parameters:
options-DirectionsOptionsinstance- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
excluding
Add an area that will be excluded from the calculated route. The route will never contain a path that collides with the given circle. For example:DirectionsRequest request = new DirectionsRequest.Builder() .from(...) .to(...) .excluding(new Circle(center, radius)) .build();Call this method as many times as you need to exclude multiple areas.
If the given circle contains the beginning/end point of the route then an error 3061 will be generated and forwarded to your handler at
DirectionsManager.requestDirections(DirectionsRequest, Handler).- Parameters:
exclusion- TheCircleto be excluded.- Returns:
- a reference to this Builder, so that the methods can be chained together.
-
build
Returns aDirectionsRequestbuilt from the parameters previously set.- Returns:
- a
DirectionsRequestbuilt with parameters of thisDirectionsRequest.Builder
-