mapbox / mapbox/mapbox-gl-js

retain map bounds on resize

Open
#9,174 0 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Breaking out from https://github.com/mapbox/mapbox-gl-js/issues/4269 it would be nice to provide an option to try and retain view bounds on map resize. The current behaviour is to retain the center and zoom, instead this would retain the center, but change the zoom so the extent of the map stays the same.

The complication here is if the aspect ratio changes, we'd need to know the original bounds to retain.

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

Read the linked issue #4269 first, then investigate how map resize currently preserves the center and zoom. Define how an opt-in behavior should retain the map's original bounds when the aspect ratio changes, and document the expected result for those resize cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.