Mapbox Navigation SDK,将 waypoints 添加到 NavigationRoute.builder() 时出现问题

Mapbox Navigation SDK, problem adding waypoints to a NavigationRoute.builder()

目前我正在尝试在mapbox提供的android导航SDK中创建导航路线。当向查询添加多个航路点时,问题就开始了。 (下面的查询returns一个响应并在地图上绘制路线)

NavigationRoute.builder()
            .accessToken(Mapbox.getAccessToken())
            .origin(start)
            .destination(end)
            .alternatives(false)
            .build()
            .getRoute(new Callback<DirectionsResponse>() {
                @Override
                public void onResponse(@NonNull Call<DirectionsResponse> call, @NonNull Response<DirectionsResponse> response) {

                    if (response.isSuccessful()) {

                        try {
                            assert response.body() != null;
                            routeodfgoh = response.body().routes().get(0);

                            if (navigationMapRoute != null) {
                                navigationMapRoute.removeRoute();
                            } else {
                                navigationMapRoute = new NavigationMapRoute(null, mapView, map);
                            }

                            //how to draw the map think map matching is work
                            navigationMapRoute.addRoute(routeodfgoh);

                        } catch (Exception ex) {
                            Toast.makeText(MainActivity.this, ex.toString(), Toast.LENGTH_LONG);
                        }

                    }
                }

                @Override
                public void onFailure(Call<DirectionsResponse> call, Throwable t) {

                }
            });

但是,应用程序要求某些查询添加多个航路点。经过大量搜索后,我发现这个 mapbox-navigation-android add waypoints 导致下面的代码。但是,查询从未 returns 响应。

 NavigationRoute.Builder builder = NavigationRoute.builder()
            .accessToken(Mapbox.getAccessToken())
            .origin(start)
            .destination(end);

    for (Point waypoint : coords) {
        builder.addWaypoint(waypoint);
    }

    builder.build()
            .getRoute(new Callback<DirectionsResponse>() {
        @Override
        public void onResponse(@NonNull Call<DirectionsResponse> call, @NonNull Response<DirectionsResponse> response) {

           if (response.isSuccessful()) {

                try {
                    assert response.body() != null;
                    routeodfgoh = response.body().routes().get(0);

                    if (navigationMapRoute != null) {
                        navigationMapRoute.removeRoute();
                    } else {
                        navigationMapRoute = new NavigationMapRoute(null, mapView, map);
                    }

                    //how to draw the map think map matching is work
                    navigationMapRoute.addRoute(routeodfgoh);

                } catch (Exception ex) {
                    Toast.makeText(MainActivity.this, ex.toString(), Toast.LENGTH_LONG);
                }

            }
        }

        @Override
        public void onFailure(Call<DirectionsResponse> call, Throwable t) {

        }
    });

任何关于为什么我没有收到回复的想法都很好。

默认配置文件是 PROFILE_DRIVING_TRAFFIC,它有 3 个坐标的限制。如果您将其更新为 PROFILE_DRIVING,使用 .profile(DirectionsCriteria.PROFILE_DRIVING),应该可以解决坐标限制问题。