类 WalkingOptions
java.lang.Object
ai.nextbillion.kits.directions.WalkingOptions
Class for specifying options for use with the walking profile.
-
嵌套类概要
嵌套类修饰符和类型类说明static classThis builder is used to create a new object with specifications relating to walking directions. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract DoubleA bias which determines whether the route should prefer or avoid the use of alleys.static WalkingOptions.Builderbuilder()Build a newWalkingOptionsobject with no defaults.static WalkingOptionsCreate a new instance of this class by passing in a formatted valid JSON String.abstract WalkingOptions.BuilderConvert the currentWalkingOptionsto its builder holding the currently assigned values.final StringtoJson()This takes the currently defined values found inside this instance and converts it to a json string.static com.google.gson.TypeAdapter<WalkingOptions>typeAdapter(com.google.gson.Gson gson) Gson type adapter for parsing Gson to this class.abstract DoubleWalking speed in meters per second.abstract DoubleA bias which determines whether the route should prefer or avoid the use of roads or paths that are set aside for pedestrian-only use (walkways).
-
构造器详细资料
-
WalkingOptions
public WalkingOptions()
-
-
方法详细资料
-
walkingSpeed
Walking speed in meters per second. Must be between 0.14 and 6.94 meters per second. Defaults to 1.42 meters per second- 返回:
- walkingSpeed in meters per second
-
walkwayBias
A bias which determines whether the route should prefer or avoid the use of roads or paths that are set aside for pedestrian-only use (walkways). The allowed range of values is from -1 to 1, where -1 indicates indicates preference to avoid walkways, 1 indicates preference to favor walkways, and 0 indicates no preference (the default).- 返回:
- walkwayBias bias to prefer or avoid walkways
-
alleyBias
A bias which determines whether the route should prefer or avoid the use of alleys. The allowed range of values is from -1 to 1, where -1 indicates indicates preference to avoid alleys, 1 indicates preference to favor alleys, and 0 indicates no preference (the default).- 返回:
- alleyBias bias to prefer or avoid alleys
-
fromJson
Create a new instance of this class by passing in a formatted valid JSON String.- 参数:
json- a formatted valid JSON string defining a WalkingOptions object- 返回:
- a new instance of this class defined by the values passed inside this static factory method
-
toJson
This takes the currently defined values found inside this instance and converts it to a json string.- 返回:
- a Json string which represents this WalkingOptions object
-
toBuilder
Convert the currentWalkingOptionsto its builder holding the currently assigned values. This allows you to modify a single property and then rebuild the object resulting in an updated and modifiedWalkingOptions.- 返回:
- a
WalkingOptions.Builderwith the same values set to match the ones defined in thisWalkingOptions
-
typeAdapter
Gson type adapter for parsing Gson to this class.- 参数:
gson- the builtGsonobject- 返回:
- the type adapter for this class
-
builder
Build a newWalkingOptionsobject with no defaults.- 返回:
- a
WalkingOptions.Builderobject for creating aWalkingOptionsobject
-