mapbox-navigation-android添加航点 [英] mapbox-navigation-android add waypoints

查看:289
本文介绍了mapbox-navigation-android添加航点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索添加航路点.

在此示例中,下一个航点是在旅程结束时添加的.我想在同一旅程中添加所有要点.你有个主意吗?

In this example, the next waypoint is add at the end of the journey. I would like to add all points in the same journey. Have you an idea ?

推荐答案

使用NavigationRoute发出新的路线请求时,可以添加航点.

You can add waypoints when making a new route request with NavigationRoute.

在我们的文档中 https://www.mapbox.com/android-docs /navigation/overview/,在4. Requesting a route部分下查看,您会找到一个有关如何执行此操作的示例.

In our docs https://www.mapbox.com/android-docs/navigation/overview/, look under section 4. Requesting a route and you'll find an example of how to do this.

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

for (Position waypoint : waypoints) {
  builder.addWaypoint(waypoint);
}

builder.build();

这篇关于mapbox-navigation-android添加航点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆