Subscription
导航更新
通过 startNavigation 变更获得导航会话的 id 后,订阅该会话,即可在驾驶员沿路线行进时实时接收状态和更新详情。
订阅
订阅导航会话的更新需要其 id。id 可通过 startNavigation 变更获取。使用 last_change.type 可查看会话更新的原因,例如 route_updated 或 next_station_availability_updated。每当需要重新渲染路线时(例如调用 recalculateNavigation 变更之后),meta.updated_at 都会发生变化。
参数
id· ID· required字段
id· IDvehicle_status· NavigationVehicleStatusNavigationVehicleStatus enum values
drivingVehicle is driving.
chargingVehicle is charging.
parkedVehicle is parked.
status· NavigationStatusNavigationStatus enum values
activeNavigation session is live and currently tracking.
finishedNavigation session is completed (either manually or automatically 48 hours after the last update).
meta· NavigationMetalast_change· NavigationChangecurrent_leg· Int操作可能会失败。请考虑以下错误场景以正确处理。有关错误的更多信息 here.
navigation_invalid_route_status- Cannot start a navigation session for a route with status '$ROUTESTATUS'.
navigation_not_found- No navigation session was found with the provided ID.
operation_not_allowed- You are not allowed to execute this operation. Enable it for the current application in the dashboard or reach out to customer support.
rate_limit_exceeded- Rate limit exceeded.
route_polyline_invalid_decimals- Value for decimals number is not valid. Allowed values are 5 or 6.
此内容是否有帮助?