Use unrecognised properties of RouteOptions for requests via MapboxDirections

Open
#1,431 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, kotlin
Domain
api

Research direction

The issue points to RouteOptions.toUrl() and the MapboxDirections.builder().routeOptions(...) request path; read those entry points first. Verify how unrecognised properties are handled and ensure requests built through MapboxDirections include them, matching the direct RouteOptions URL behavior.

Written by the indexing model from the issue text.

Description

jira-sync-complete

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

Dominant language
Java
Stars
438
Forks
117
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/mapbox-java

All issues in mapbox/mapbox-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.