Skip to content

[Bug]: Simulate Location used with SimulateLocationsAlongExistingRoute does not continue route at new simulated location point #501

@calebjsmith7

Description

@calebjsmith7

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

  1. Call navigationController.simulator.simulateLocationsAlongExistingRoute(speedMultiplier)

  2. call navigationController.simulator.simulateLocation(latlng) for a different location
    Result: doesn't honor new simulateLocation()

  3. Call navigationController.simulator.simulateLocationsAlongExistingRoute(speedMultiplier)

  4. stop simulating locations along existing route

  5. navigationController.simulator.simulateLocation(latlng) for different location

  6. 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

Metadata

Metadata

Assignees

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions