Skip to content

[Bug]: GoogleNavigationViewController.showRouteOverview animation cuts polyline and mispositions camera #414

@IvelinKrastev

Description

@IvelinKrastev

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

When calling GoogleNavigationViewController.showRouteOverview(), the route is not visualized entirely on the screen.

Flutter version

3.32.7

Package version

0.6.2

Native SDK versions

  • I haven't changed the version of the native SDKs

Flutter Doctor Output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.7, on macOS 15.5 24F74 darwin-arm64, locale en-BG)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] VS Code (version 1.99.3)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Steps to reproduce

  1. Launch your navigation UI with GoogleNavigationView (or the equivalent Flutter wrapper).
  2. Register a callback in onViewCreated to store the GoogleNavigationViewController.
  3. Set the route (I used the directions/v2:computeRoutes API to get a route token)
  4. Call controller.showRouteOverview() t preview the entire route.

Expected vs Actual Behavior

Expected Behavior: The camera smoothly pans and zooms to encapsulate the entire route up to destination.

Actual Behavior: The showRouteOverview only frames a short segment, clipping the polyline's tail end.

Code Sample

SearchOverlay(
  controller: _searchOverlayController,
  onPlaceSelected: (prediction) async {
    try {
      final details = await _placesService.getPlaceDetails(
        prediction.placeId,
      );
      if (details.lat != null && details.lng != null) {
        final destinationLocation = LatLng(
          latitude: details.lat!,
          longitude: details.lng!,
        );
        _navigationViewController?.clearMarkers();
        _navigationViewController?.addMarkers([
          MarkerOptions(
            position: destinationLocation,
            infoWindow: InfoWindow(
              title: prediction.description,
            ),
          ),
        ]);
        await _fetchRoutes(destinationLocation);

        _navigationViewController?.showRouteOverview();
        if (context.mounted) {
          ref
              .read(appStateNotifierProvider.notifier)
              .setState(AppState.previewDirections);
        }
      } else {
        debugPrint('No lat/lng found for selected place');
      }
    } catch (e) {
      debugPrint(
        'Error fetching place details: [${e.toString()}]',
      );
    }
  },
)

Additional Context

No response

Metadata

Metadata

Assignees

Labels

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