mapbox/mapbox-java

Use unrecognised properties of RouteOptions for requests via MapboxDirections

VysotskiVadim opened this issue · 0 comments

Unrecognised properties of RouteOptions are used only in RouteOptions.toUrl(). Unrecognised properties are ignored if you do request via MapboxDirections:

val client = MapboxDirections.builder().accessToken(getMapboxAccessTokenFromResources()).routeOptions(routeOptions).build()

        client.enqueueCall(object : Callback<DirectionsResponse> {
            override fun onResponse(
                call: Call<DirectionsResponse>,
                response: Response<DirectionsResponse>
            ) {
                Log.d(TAG, "onResponse: what")
                if (response.isSuccessful) {
                    Log.d(TAG, "onResponse: hello")
                    val body = response.body()!!
                    mapboxNavigation.setRoutes(body.routes())
                    Log.d(TAG, "onResponse: ${body.routes()}")
                }
            }

            override fun onFailure(call: Call<DirectionsResponse>, t: Throwable) {}
        })

Add support of unrecognised properties from RouteOptions to MapboxDirections