Skip to main content

Routes

You able to search route between two location.

Download#

implementation 'com.utsman.geolib:routes:{last_version}'

Create PlaceRoute#

val placesRoute = createPlacesRoute(HERE_MAPS_API)

Search route between locations#

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
}

Builder#

Paramtypedesc
startLocationLocationstart destination
endLocationLocationend destination
transportModeTransportModetransport mode, available CAR and BIKE, default is CAR

Route Data#

Paramtypedesc
encodedPolylineStringencoded of geometry
geometriesList<LatLng>list LatLng of geometry
lengthFloatLength of polyline decoded