mapbox / mapbox/mapbox-gl-js

Alternate Projections camera constraint may lead to extraneous empty space around the map

Open
#12,391 6 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.9.0

### Question

**How I can fit a custom map into a div?**

**There is any setting to activate to fit the map?**

I had been trying to use the maps that I created using the studio, but since I started to use these maps, I saw an issue, the map never fit. At the beginning, I thought that probably the error came from the sass file or any class that I was using until today. I made a test using the default map, and works fine, but at the moment when I change the default by custom the issue appears.

Then, I went to the Mapbox Studio, and I could e the issue, that came from the studio itself.

![mapbox-studio](https://i.imgur.com/sQWXxxX.png)

### Links to related documentation

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

The report names mapbox-gl-js 2.9.0, a custom map from Mapbox Studio, and a map inside a div, but no repository file, test, or reproducible code. Start by reproducing the custom-style map in a sized div and compare it with the default map. Done means identifying whether the camera constraint causes the extraneous space and documenting or fixing the behavior.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.