Mutation
创建匹配路线
使用 createMatchedRoute mutation 根据一系列 GPS 点创建路线。当您已经有一条基于自身业务规则的路线,并希望在其基础上添加充电停靠点和计算能耗时,这最为有用。
Mutation
创建匹配路线需要提供 vehicle 以及至少两个按时间顺序排列的 points。还可以选择性地添加 via 点、departure_time、weather、driving_preferences、operators 或 alternative_station_radius 来优化计算。设置 plan_charging_stops,以便在车辆电量状态在路线沿途任何位置达到阈值时查找并规划充电停靠点。该 mutation 返回匹配路线 id,可用于获取路线详情或订阅更新。
参数
字段
操作可能会失败。请考虑以下错误场景以正确处理。有关错误的更多信息 这里。
invalid_coordinates- Coordinates provided for $LOCATION are not valid.
matched_route_minimum_point_count- input.points[] must contain at least 2 points.
matched_route_via_index_above_allowed- The via index $INDEX is above the allowed range. The maximum allowed index is NaN.
matched_route_via_index_first_or_last_point_not_allowed- The first and last points in the route cannot be defined as via points.
negative_value_not_allowed- Negative value for $LOCATION is not allowed.
此内容是否有帮助?