Skip to content

[Bug]: Off-route recalculation is very slow (up to ~30s) with NavigationTravelMode.taxi #742

Description

@orestislef

Is there an existing issue for this?

  • I have searched the existing issues

Package version

google_navigation_flutter 0.9.4

Flutter / Dart version

Flutter 3.44.4 (stable), Dart SDK >=3.3.4 <4.0.0

Platform

Android (physical devices in a live taxi fleet)

Description

We run a taxi-driver app on top of this SDK. Navigation is started with
GoogleMapsNavigator.setDestinations(...) using travelMode: NavigationTravelMode.taxi,
then startGuidance().

Drivers are reporting that when they leave the suggested route, for example they take a
different street to avoid traffic, or a passenger asks for another way, the SDK is very
slow to recalculate a new route. They report waiting up to roughly 30 seconds before
guidance snaps to a new route. Until that happens the on-screen guidance keeps pointing
back at the old route, which is confusing while actively driving.

For a taxi app this is a serious problem. Drivers go off-route constantly and every
second of stale guidance is real money (wrong turns, longer trips, unhappy passengers).
We need near-instant rerouting, the way the consumer Google Maps app reroutes almost
immediately after a missed turn.

We tested this side by side on Android: our app (built on google_navigation_flutter)
against the consumer Google Maps app, on the same device under the same conditions.
Google Maps reroutes almost instantly after going off-route, while our app built on this
SDK takes far longer (up to ~30s) to recalculate.

We would really appreciate you looking into this. Specifically:

  1. Is the off-route detection / reroute latency configurable in any way (a threshold,
    debounce, or minimum off-route distance)? We do not see an option for it.
  2. Does NavigationTravelMode.taxi get routed differently from driving on the
    backend in a way that increases recalculation time? Would switching to driving
    reroute faster?
  3. Is there anything on our side we can call to force or speed up a recalculation when
    we detect the driver is off-route?

Our routing setup

final routeStatus = await GoogleMapsNavigator.setDestinations(
  Destinations(
    routingOptions: RoutingOptions(
      travelMode: NavigationTravelMode.taxi,
      routingStrategy: navigationRoutingStrategy, // defaultBest or shorter
      avoidTolls: avoidTolls,
    ),
    waypoints: widget.waypoints,
    displayOptions: NavigationDisplayOptions(
      showDestinationMarkers: true,
      showStopSigns: true,
      showTrafficLights: true,
    ),
  ),
);
await GoogleMapsNavigator.startGuidance();

Steps to reproduce

  1. Start guidance to a destination with travelMode: NavigationTravelMode.taxi.
  2. While guidance is active, deliberately drive off the suggested route (turn onto a
    different road).
  3. Observe how long it takes for the SDK to abandon the old route and present a new
    recalculated route.

Expected behavior

Reroute should happen within a couple of seconds of going off-route, similar to the
consumer Google Maps app on the same Android device.

Actual behavior

Recalculation can take up to ~30 seconds; guidance stays on the stale route in the
meantime. The consumer Google Maps app, tested side by side on the same Android device,
reroutes almost immediately.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions