map.fitBounds() moves to wrong area with Albers (and other) projections
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**: Fails with v2.12.x, v2.11.x, v2.13.0-beta.1
**browser**: Tested with Chrome and Firefox
### Steps to Trigger Behavior
1. Run the demo
2. Add your Mapbox token at line 14.
3. Click the link to "Fit Bounds"
4. See the map move to an extreme corner of the map
### Link to Demonstration
https://jsbin.com/cidiyum/edit?html,output
NOTE: You'll need to add a Mapbox token at line 14.
### Expected Behavior
Should zoom to an area around Corvallis, Oregon.
### Actual Behavior
Zooms to an extreme Northerly corner of the map.
### Additional Notes
Works as expected in versions v2.9.x and 2.10.x. Other specified projections zoom in to different areas (tested with `lambertConformalConic`, `equirectangular`, and `naturalEarth`).
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 running the linked JSBin reproduction with a Mapbox token and compare the affected projection behavior across the listed versions. Investigate the map.fitBounds() path used by Albers and the other named projections; done means fitting bounds centers and zooms near Corvallis, Oregon rather than an extreme map corner.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- data-visualization, frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100