-
-
Notifications
You must be signed in to change notification settings - Fork 15
Routes
Muhammad Utsman edited this page Jul 25, 2021
·
1 revision
You able to search route between two location.
implementation 'io.github.utsmannn:geolib-routes:{last_version}'
val placesRoute = createPlacesRoute(HERE_MAPS_API)
For search a route, use searchRoute
DSL builder.
val buaran: Location = Location("").apply {
latitude = -6.2220484
longitude = 106.9217385
}
val depok: Location = Location("").apply {
latitude = -6.4090897
longitude = 106.8122967
}
val result: Result<RouteData> = placesRoute.searchRoute {
startLocation = buaran // location start
endLocation = depok // location end
transportMode = TransportMode.BIKE
}
result.doOnSuccess { routes ->
// handle success
}
result.doOnFailure {
// handler failure
}
Param | type | desc |
---|---|---|
startLocation |
Location |
start destination |
endLocation |
Location |
end destination |
transportMode |
TransportMode |
transport mode, available CAR and BIKE , default is CAR
|
Param | type | desc |
---|---|---|
encodedPolyline |
String |
encoded of geometry |
geometries |
List<LatLng> |
list LatLng of geometry |
length |
Float |
Length of polyline decoded |