-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Is there an existing issue for this?
- I have searched the existing issues
Description of the bug
When already simulating locations along existing route, if you want to teleport by using simulateLocation to a different latlng, you are then teleported back to the old simulated route and continue from there rather than the new location point.
What we were expecting was that when you are already simulating locations along existing route and then teleport to a different location, simulation for the route would recalculate and continue from the new location.
See video
React Native version
0.81.4
React version
19.1.0
Package version
0.9.3
Native SDK versions
- I haven't changed the version of the native SDKs
React Native Doctor Output
Common
✓ Node.js - Required to execute JavaScript code
✓ npm - Required to install NPM dependencies
✓ Watchman - Used for watching changes in the filesystem when in development mode
● Metro - Metro Bundler is not running
Android
✓ Adb - Required to verify if the android device is attached correctly
✓ JDK - Required to compile Java code
✓ Android Studio - Required for building and installing your app on Android
✖ ANDROID_HOME - Environment variable that points to your Android SDK installation
✓ Gradlew - Build tool required for Android builds
✖ Android SDK - Required for building and installing your app on Android
- Versions found: N/A
- Version supported: 36.0.0
iOS
✓ Xcode - Required for building and installing your app on iOS
✓ Ruby - Required for installing iOS dependencies
✓ CocoaPods - Required for installing iOS dependencies
✓ .xcode.env - File to customize Xcode environment
Errors: 2
Warnings: 1
Steps to reproduce
-
Call navigationController.simulator.simulateLocationsAlongExistingRoute(speedMultiplier)
-
call navigationController.simulator.simulateLocation(latlng) for a different location
Result: doesn't honor new simulateLocation() -
Call navigationController.simulator.simulateLocationsAlongExistingRoute(speedMultiplier)
-
stop simulating locations along existing route
-
navigationController.simulator.simulateLocation(latlng) for different location
-
navigationController.simulator.simulateLocationsAlongExistingRoute()
Result: teleports to new location, then teleports back to old place on route and continues simulating from old location instead of new location.
Expected vs Actual Behavior
Expected:
SimulateLocation would override current placement on simulateLocationsAlongExistingRoute() and recalculate route to continue simulating. Should be able to teleport and continue simulating route
Code Sample
// Stop current simulation
navigationController.simulator.stopLocationSimulation();
await new Promise((resolve) => setTimeout(resolve, 500));
// Teleport to new GPS location
navigationController.simulator.simulateLocation({
lat: position.coords.latitude,
lng: position.coords.longitude,
});
await new Promise((resolve) => setTimeout(resolve, 2000));
navigationController.simulator.simulateLocationsAlongExistingRoute({
speedMultiplier: 1,
});
Additional Context
No response