-
Notifications
You must be signed in to change notification settings - Fork 33
Description
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
- Launch your navigation UI with
GoogleNavigationView
(or the equivalent Flutter wrapper). - Register a callback in
onViewCreated
to store theGoogleNavigationViewController
. - Set the route (I used the
directions/v2:computeRoutes
API to get a route token) - 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