map.fitbounds giving wrong results when bearing is changed.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version: 2.7.0 / all other versions
browser: Chrome/Safari
Steps to Trigger Behavior
View the jsfiddle (add your own accessToken):
https://jsfiddle.net/6fk7up9x/16
Expected Behavior
The markers should be visible at all times(when changing bearing), the map should fit the boundary box depending on the two coordinates that i provided and the provided bearing.

Actual Behavior
When changing bearing above 180 or under 100, the markers are not visible anymore.

Am i doing something wrong, or is there a bug in fitbounds?
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 linked JSFiddle and reproduce the issue in map.fitBounds by changing the map bearing across the reported ranges. Compare the expected and actual marker visibility, then trace the fitBounds behavior from that entry point. Done means both provided coordinates remain visible at every tested bearing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100