maplibre / maplibre/maplibre-react-native
useCurrentPosition heading is not in sync with NativeUserLocation heading
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 661
- Forks
- 124
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 30
Description
Describe and reproduce the Bug
We're using the NativeUserLocation component as it performs better than the UserLocation component. When my Android phone is lying still, the arrow points in the right direction with NativeUserLocation, while it is jumping around with UserLocation.
In combination with NativeUserLocation we're also using the useCurrentPosition hook to retrieve the current user heading. The problem is that the heading returned is the same "jumping around" heading as we see with the UserLocation component. Would it be possible to get the heading from the NativeUserLocation component instead?
@maplibre/maplibre-react-native Version
11.0.0-beta.5
Which platforms does this occur on?
Android Device
Which frameworks does this occur on?
Expo
Which architectures does this occur on?
New Architecture
Environment
expo-env-info 2.0.8 environment info:
System:
OS: macOS 26.2
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.21.1 - ~/.nvm/versions/node/v22.21.1/bin/node
Yarn: 1.22.22 - ~/.yarn/bin/yarn
npm: 10.9.4 - ~/.nvm/versions/node/v22.21.1/bin/npm
Watchman: 2025.04.14.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 25.2, iOS 26.2, macOS 26.2, tvOS 26.2, visionOS 26.2, watchOS 26.2
Android SDK:
API Levels: 28, 34, 35, 36
Build Tools: 34.0.0, 35.0.0, 35.0.1, 36.0.0
System Images: android-36 | Google Play ARM 64 v8a
IDEs:
Android Studio: 2025.2 AI-252.28238.7.2523.14688667
Xcode: 26.2/17C52 - /usr/bin/xcodebuild
npmPackages:
expo: 54.0.31 => 54.0.31
expo-router: 6.0.21 => 6.0.21
expo-updates: 29.0.16 => 29.0.16
metro: ^0.83.1 => 0.83.3
react: 19.1.0 => 19.1.0
react-dom: 19.1.0 => 19.1.0
react-native: 0.81.5 => 0.81.5
react-native-web: ^0.21.0 => 0.21.2
npmGlobalPackages:
eas-cli: 16.28.0
Expo Workflow: bare
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Android implementations behind the NativeUserLocation component and the useCurrentPosition hook, then compare how each obtains heading data. Reproduce the stationary-phone behavior on an Android device. Done means the hook reports heading consistently with NativeUserLocation without regressing the existing location behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100