map.fitBounds() with bearing does not fit the entire bounds
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
When `map.fitBounds(...)` is called with a bearing option passed in, it seems like the bearing is not taken into the account on calculating the appropriate zoom, resulting in part of the bounded area to not be in view.
**mapbox-gl-js version**: 1.12.0
**browser**: Chrome
### Steps to Trigger Behavior
1. Create a bounded area with a list of coordinates
2. Call `map.fitBounds(...)` with bearing option set
### Link to Demonstration
https://jsfiddle.net/_blahblahblah/k4vL6s5r/
### Expected Behavior
When clicking on the 'Fit to Line at 29º Bearing' button in the demo link, all 6 stations should be in view.
### Actual Behavior
Only 4 of the 6 stations are in view.
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 with the map.fitBounds(...) entry point and reproduce the issue using the linked JSFiddle in Chrome, with the bearing set to 29º. Trace how the bearing option affects the zoom calculation. Done means all 6 stations are visible after clicking “Fit to Line at 29º Bearing,” rather than only 4.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100