[Bug]: CarPlay map view never sets GMSMapViewOptions.screen, so the navigation header and footer are sized for the phone
Maintainer thường phản hồi trong vòng 5 ngày
@jokerttu đang làm issue này rồi.
Từ ngày 28/8/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
Description of the bug
On a physical CarPlay head unit, a map view rooted in the CPWindow by BaseCarSceneDelegate renders its navigation UI at phone size. The guidance header's lane-guidance dropdown overlaps the ETA footer, and the type is far too large for the display. The map tiles and labels render correctly — only the navigation overlay is mis-sized.
GMSMapViewOptions has a screen property, added by the Navigation SDK's own category:
The screen the view will be used on.
Defaults to the main screen. Should be set to the CarPlay screen if this map view is to be used with CarPlay.
—
GMSMapViewOptions+Navigation.h, GoogleNavigation 10.13.0
NavViewController.loadView never sets it:
GMSMapViewOptions *options = [[GMSMapViewOptions alloc] init];
if (_mapId && ![_mapId isEqualToString:@""]) {
options.mapID = [GMSMapID mapIDWithIdentifier:_mapId];
}
if (_initialCameraPosition) {
options.camera = _initialCameraPosition;
}
_mapView = [[GMSMapView alloc] initWithOptions:options]; // options.screen unset
grep -rn -i "uiscreen\|options.screen" ios example/ios/SampleApp at main returns nothing — not in the library, not in the CarPlay sample app. So every map view the library creates, including the one BaseCarSceneDelegate roots in the CPWindow, believes it is on UIScreen.mainScreen.
That the SDK does adapt to CarPlay is documented in GMSUISettings+Navigation.h: the trip progress bar "will not be shown for CarPlay displays" and "will only be shown when the GMSMapView is at least 552pt tall". It branches on the display and on height, and options.screen appears to be the public input for that — which the bridge never provides.
This is only visible if the app enables the navigation header/footer on the car screen. BaseCarSceneDelegate.onSessionAttached disables both by default and the sample does not override them, which is likely why it has gone unnoticed. Turning them on is the natural thing to do for an app that wants Google's turn-by-turn chrome on the console rather than building its own from didChangeNavInfo (per the guidance in #508).
Applications cannot work around this themselves: screen is an init-time option, there is no setter on GMSMapView, and NavViewController constructs the map view internally. It needs a fix in the library.
Suggested fix
Let the screen be supplied before the view loads, and have BaseCarSceneDelegate pass the car window's screen:
// NavViewController.h
- (void)setScreen:(nullable UIScreen *)screen;
// NavViewController.mm
- (void)setScreen:(nullable UIScreen *)screen {
if (_mapView != nil) {
RCTLogWarn(@"Cannot change screen after view is loaded");
return;
}
_screen = screen;
}
// ... in loadView, before initWithOptions:
if (_screen != nil) {
options.screen = _screen;
}
// BaseCarSceneDelegate.mm, in
// templateApplicationScene:didConnectInterfaceController:toWindow:
// — must precede the rootViewController assignment, which loads the view
self.navViewController = [[NavViewController alloc] init];
[self.navViewController setMapViewType:NAVIGATION];
[self.navViewController setScreen:window.screen];
self.navViewController.stateDelegate = self;
The phone NavigationView is unaffected — it never calls the setter and keeps the main-screen default.
I am running exactly this as a yarn patch. It compiles clean for x86_64 and arm64. I have not yet been able to confirm on a head unit whether it resolves the sizing, since I am waiting on a build — I will report back here either way. Happy to open a PR if the shape looks right to you.
React Native version
0.86.2
React version
19.2.3
Package version
0.16.3
Native SDK versions
- I haven't changed the version of the native SDKs
(GoogleNavigation 10.13.0 / GoogleMaps 10.13.0, pinned via a config plugin for react-native-maps coexistence.)
Steps to reproduce
- Set up a CarPlay scene with
BaseCarSceneDelegateas documented inCARPLAY.md. - Override
onSessionAttachedto enable the navigation header and footer:- (void)onSessionAttached { [self.navViewController setHeaderEnabled:YES]; [self.navViewController setFooterEnabled:YES]; } - Start a guidance session on the phone and connect to a CarPlay head unit.
- The header and footer render at phone scale; on a short display the header's lane-guidance dropdown overlaps the ETA footer.
Note this needs real CarPlay hardware — the CarPlay simulator currently crashes on iOS runtimes above 26.3 (#607).
- Ngôn ngữ chính
- TypeScript
- Star
- 226
- Fork
- 39
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googlemaps/react-native-navigation-sdk
-
[Support Request]: Status of Expo config plugin release (prebuild fails on 0.19.0)Có thể đã có người làm @jokerttu đã nhận 1 ngày trước. Đang mở
googlemaps/react-native-navigation-sdk#711 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug]: In-navigation notification can't be stoppedCó thể đã có người làm @jokerttu đã nhận 8 ngày trước. Đang mởtriage me type: bug
googlemaps/react-native-navigation-sdk#696 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug]: [iOS] Navigation SDK init/quota retry loop pins the main thread; React Native's Settings module and addMarker's temporary GMSMarker add to the costCó thể đã có người làm @illuminati1911 đã nhận 14 ngày trước. Đang mởtriage me type: bug
googlemaps/react-native-navigation-sdk#687 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug]: iOS crash in GMSObjectDataCache Core Data save (fatal optimistic locking failure)Có thể làm lại được @illuminati1911 đã nhận 60 ngày trước và không có pull request nào đang mở. Đang mởnative sdk issue
googlemaps/react-native-navigation-sdk#647 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug]: CarPlay Simulator crashes on iOS versions > 26.3Có thể làm lại được @jokerttu đã nhận 155 ngày trước và không có pull request nào đang mở. Đang mởpriority: p2 type: bug
googlemaps/react-native-navigation-sdk#607 · 1 bình luận · 2 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của googlemaps/react-native-navigation-sdk
Issue tương tự
-
pending close triaging
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 74/100
anomalyco/opencode#63090 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Cosmetic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
linagora/twake-mail-admin#609 ·
Maintainer thường phản hồi trong vòng 1 ngày