I'm working with the Mapbox Navigation SDK version 2 for an Android application and facing a challenge with route simulation. My goal is to simulate a car's movement from point A to point B, and upon reaching point B, the car should automatically return to point A and repeat the journey. I also aim to control the simulation playback by adjusting the car's speed.
To achieve this, I'm utilizing several observers provided by the SDK, including RouteObserver, LocationObserver, and RouteProgressObserver. The core of my issue lies in integrating custom simulation data with the RouteProgressObserver to accurately update the UI (e.g., drawing the vanishing route line, displaying travel time, and arrival time).
The simulation setup involves using the Mapbox Replay engine, which simulates location updates. However, there seems to be a discrepancy between the simulation data (generated by the Replay engine and sent by the location engine) and the internal data used by Mapbox, which is different and used by the RouteProgressObserver. As a result, the data used for UI updates (such as the vanishing route line and time estimations) does not match the actual position of my simulated car, leading to inconsistencies in the displayed information.
My question is: How can I ensure that the RouteProgressObserver uses my custom simulation data instead of the internal Mapbox data? This would allow for consistent and accurate UI updates that reflect the simulated car's position and progress accurately.
Any guidance on how to correctly pass simulation data to the RouteProgressObserver or adjust the SDK's behavior to use the custom data for route progress updates would be greatly appreciated.
I already tried several approaches from MapBox's examples and documentation (e.g. https://docs.mapbox.com/android/navigation/v2/guides/developer-tools/route-replay/) but only found out that they contain this issue as well. Also, My target device has no google services thus no way to get location from there if that matters. This issue was reproduced on both Android and Automotive emulators and real devices. Libs I use: com.mapbox.maps:android:10.16.3 com.mapbox.navigation:android:2.19.0-beta.2