小编Mot*_*o28的帖子

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

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

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> …
Run Code Online (Sandbox Code Playgroud)

android mapbox mapbox-android

1
推荐指数
1
解决办法
708
查看次数

标签 统计

android ×1

mapbox ×1

mapbox-android ×1