fix(android): don't disable puck bearing and honor followHeading in normal follow mode - #4292
Open
krisgerhard wants to merge 1 commit into
Open
Conversation
…ormal follow mode Two fixes in RNMBXCamera's "normal" follow-mode branch, matching iOS behavior: - Stop setting location.puckBearingEnabled = false: it silently overrides an explicit LocationPuck puckBearing/puckBearingEnabled configuration, freezing a bearing image pointing north whenever followUserMode is "normal". The iOS implementation never touches the puck options here. Fixes rnmapbox#3391. - Pass the non-null followHeading value to FollowPuckViewportStateBearing.Constant: both arms of the when passed cameraState.bearing, so followHeading was ignored and entering normal mode kept the camera's current bearing.
krisgerhard
requested a deployment
to
CI with Mapbox Tokens
September 1, 2026 08:49 — with
GitHub Actions
Waiting
krisgerhard
requested a deployment
to
CI with Mapbox Tokens
September 1, 2026 08:49 — with
GitHub Actions
Waiting
krisgerhard
requested a deployment
to
CI with Mapbox Tokens
September 1, 2026 08:49 — with
GitHub Actions
Waiting
krisgerhard
marked this pull request as draft
September 1, 2026 08:50
krisgerhard
marked this pull request as ready for review
September 1, 2026 08:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes two Android-only bugs in
RNMBXCamera.kt's"normal"follow-mode branch. Both are Android/iOS behavior divergences — the iOS implementation has neither.1.
followUserMode="normal"silently disables the LocationPuck bearing (fixes #3391)The branch sets
location.puckBearingEnabled = false, overriding an explicit configuration on theLocationPuckcomponent:On Android the bearing image freezes pointing north; on iOS it rotates with the course, because the iOS
"normal"branch never touches the puck options. This PR removes the override so the puck's own props stay authoritative. The"compass"/"course"branches are left as-is since theirSyncWithLocationPuckbearing depends on the puck source they set.2.
followHeadingis ignored in normal modeBoth arms of the
when (val it = mFollowHeading)passedcameraState.bearingtoFollowPuckViewportStateBearing.Constant, so settingfollowHeading={0}(e.g. for a north-up follow camera) kept whatever bearing the camera already had. The non-null arm now passesit, matching iOS, wherefollowHeadingis applied viasetCamera.Testing
Verified on a physical Android device (OnePlus 10 Pro, Android 16) in both debug and release builds with
@rnmapbox/maps10.3.5 + Mapbox SDK 11.27.1, driving with a moving GPS course:followUserMode="normal"+followHeading={0}kept the previous map rotation, and the custombearingImagefroze pointing north."course"and"compass"modes unchanged. iOS behavior unchanged (verified on the iOS simulator).