googleDirectionLibrary / com.akexorcist.googledirection.request / DirectionRequest

DirectionRequest

open class DirectionRequest

The class for assign the addition parameter for the request and request execution.

Since
1.0.0

Constructors

<init>

DirectionRequest(apiKey: String, origin: LatLng, destination: LatLng, waypointList: MutableList<LatLng>)

Functions

alternativeRoute

open fun alternativeRoute(alternative: Boolean): DirectionRequest

Specifies whether require the alternative route result of the request.

avoid

open fun avoid(avoid: String): DirectionRequest

Assign the route restriction to avoid of the request.

departureTime

open fun departureTime(time: String): DirectionRequest

Assign the departure time of the request.

execute

open fun execute(callback: DirectionCallback): DirectionTask

Require the optimized waypoint by reorder the waypoint in result.

language

open fun language(language: String): DirectionRequest

Assign the language of the request.

optimizeWaypoints

open fun optimizeWaypoints(optimize: Boolean): DirectionRequest

Specifies whether require the optimized waypoint by reorder the waypoint in result.

trafficMode

open fun trafficMode(trafficModel: String): DirectionRequest

Specifies the assumptions to use when calculating time in traffic.

transitMode

open fun transitMode(transitMode: String): DirectionRequest

Assign the transit mode of the request.

transitRoutingPreference

open fun transitRoutingPreference(transitRoutingPreference: String): DirectionRequest

Specifies preferences for transit routes. Using this parameter, you can bias the options returned, rather than accepting the default best route chosen by the API.

transportMode

open fun transportMode(transportMode: String): DirectionRequest

Assign the transport mode of the request.

unit

open fun unit(unit: String): DirectionRequest

Assign the unit of the request.

Extension Functions

execute

fun DirectionRequest.execute(onDirectionSuccess: (Direction?) -> Unit = null, onDirectionFailure: (Throwable) -> Unit = null): DirectionTask

Kotlin extension method for direction request execution.