googlemaps / googlemaps/flutter-navigation-sdk

[Bug]: Map Padding Behavior

Open
#478 11 comments 0 reactions 1 assignee Claimed by @jokerttu View on GitHub
priority: p2
Dominant language
Dart
Stars
75
Forks
54
Avg merge
4d 2h
Merged PRs (30d)
5

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Description of the bug

Currently, when I call setPadding on the map controller, the map view itself correctly adjusts. However, the turn-by-turn navigation UI elements (such as the remaining time, destination panel, or navigation instructions) are not affected by the padding.

This causes those elements to overlap with other parts of the UI, especially when I want to add custom widgets on top of the map.

👉 My question: How can I adjust the padding so that navigation UI elements (time, destination, instructions, etc.) also respect the defined padding?

Image

### Flutter version

3.32.5

### Package version

0.6.4

### Native SDK versions

- [x] 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.5, on macOS 15.3.2 24D81 darwin-arm64, locale en-TR)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] VS Code (version 1.104.0)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!

### Steps to reproduce

Just run the provided code.

### Expected vs Actual Behavior

After calling setPadding, the map camera and navigation UI elements should adjust to avoid overlapping with other UI or custom widgets, but currently, while the map camera respects the padding, the navigation UI elements remain fixed to the screen edge and overlap with overlays and the map's inset region.

### Code Sample

```dart
Future onViewCreated(GoogleNavigationViewController controller) async {
navigationViewController = controller;
await controller.setMyLocationEnabled(true);
if (userLocation.value == null) {
final loc = await controller.getMyLocation();
if (loc != null) userLocation.value = loc;
}
await navigationViewController?.setSpeedLimitIconEnabled(true);
await navigationViewController?.setReportIncidentButtonEnabled(false);
await navigationViewController?.setSpeedometerEnabled(true);
await navigationViewController?.setPadding(EdgeInsets.only(top: 100, bottom: 150));
if (Platform.isAndroid) {
await navigationViewController?.settings.setZoomControlsEnabled(true);
}
}

Future startNavigation() async {
if (!validRoute.value) return;
await navigationViewController?.setNavigationUIEnabled(true);
await GoogleMapsNavigator.startGuidance();
await navigationViewController?.setPadding(EdgeInsets.only(top: 100, bottom: 150));
await navigationViewController?.followMyLocation(CameraPerspective.tilted);
guidanceRunning.value = true;
}
```

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.