[Bug] `bearing` not supported for controlled components
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.5k
- Forks
- 1.4k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 3
Description
Description
According to docs,
When Map is used as a controlled component, event.viewState.bearing reflects the zoom that the camera "proposes" to change to, as a result of either user interaction or methods such as flyTo. The camera does not actually change until the application updates the bearing prop.
In reality, event.viewState.bearing reports the current bearing.
Expected Behavior
event.viewState.bearing from onRotate should return "proposed" bearing
Steps to Reproduce
https://codesandbox.io/s/exciting-currying-fv7z84?file=/src/App.js
Attempt to rotate, see console
Environment
See codesandbox
Logs
No response
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 reproducing the rotation behavior in the linked CodeSandbox, then trace the controlled Map handling for the onRotate callback and event.viewState.bearing. Done means the callback reports the proposed bearing described in the documentation rather than the current bearing, with the behavior verified during rotation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100