here-api - TimeType ARRIVAL 在 Android SDK 中不起作用
问题描述
我希望我的用户能够在出发和到达时间之间切换。但是,当我在 routeOptions.setTime 中使用 TimeType.ARRIVAL 发送路由计划请求时,它会给我一个 INVALID_PARAMETERS 错误。但是与 TimeType.DEPARTURE 完全相同的请求可以正常工作。
下面是我的代码。我做错了什么还是 TimeType.ARRIVAL 已被弃用或只是不工作?
RoutePlan routePlan = new RoutePlan();
RouteOptions routeOptions = new RouteOptions();
routeOptions.setTransportMode(RouteOptions.TransportMode.PUBLIC_TRANSPORT);
routeOptions.setRouteType(RouteOptions.Type.FASTEST);
routeOptions.setRouteCount(3);
routeOptions.setLocale(Locale.getDefault());
if (toggleSwitch.getCheckedTogglePosition() == 0) {
routeOptions.setTime(selected_time, RouteOptions.TimeType.DEPARTURE);
}
else {
routeOptions.setTime(selected_time, RouteOptions.TimeType.ARRIVAL);
}
routePlan.setRouteOptions(routeOptions);
// Select Waypoints for your routes
routePlan.addWaypoint(new RouteWaypoint(start_address_coordinate));
routePlan.addWaypoint(new RouteWaypoint(end_address_coordinate));
router.calculateRoute(routePlan, new RouterListener());
解决方案
推荐阅读
- node.js - 分配给顺序数组的异步结果
- python - ModuleNotFoundError:没有名为“tkSimpleDialog”的模块 - Python Shell
- keras - 在 keras 中如何调用 add 函数 [a3,a8]
- android - 为什么 Webview 更改语言
- sql-server - 表关系 - 最佳实践
- python - 如何多次编辑附加到列表中的行?
- javascript - 由于 Promise 链接,Firebase Firestore 更新查询不会执行。我究竟做错了什么?
- linux - 面临 ORA-01033:由于数据文件问题,ORACLE 初始化或关闭正在进行中
- javascript - Meteor 应用程序部署后的代码覆盖率
- android - ContryCodePicker 在组件树中显示为问号