mapbox / mapbox/mapbox-gl-js

FitBounds doesnt work on a lambert conformal conic projection

Open
#12,913 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**:
2.15.0

**browser**:
Brave [Version 1.58.131 Chromium: 117.0.5938.92](https://brave.com/latest/)

### Steps to Trigger Behavior

1. Go to the provided demonstration link
2. Click anywhere on the map to zoom to features bounds (and it will work fine)
3. Now uncomment the part with projection next top the map variable
4. Save the changes and try to click on the map to zoom to a feature again (this will not work and it will zoom to the ocean)

### Link to Demonstration
https://codepen.io/gmand/pen/gOZKgxv

### Expected Behavior
In any map projections, fit to bounds should work as expected

### Actual Behavior
With lambertConformalConic projection, bounds of specified feature zooms in to the ocean

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the linked CodePen with and without the lambertConformalConic projection, then trace the fit-to-bounds path used after clicking a map feature. Compare the computed bounds and camera result for this projection; done means fitting the specified feature zooms to it rather than the ocean.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.