mapbox / mapbox/mapbox-gl-js

`resize()` breaks `.flyTo()` (or any movement probably breaks `resize`)

Open
#13,018 1 comment 2 reactions 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**: 3.0.1

**browser**: Chrome 200

### Steps to Trigger Behavior

1. Start a `flyTo` that changes the center of the map
2. Do anything that causes the size of the map to change during the `flyTo` (e.g. rotating a phone/tablet, or just directly causing the map to resize through code)
3. Observe that the final destination does not match the `flyTo` destination

### Link to Demonstration

https://codepen.io/DavidMulder/pen/WNmNXmP

### Expected Behavior

The expected behavior is that 'no matter what' the final state of a `flyTo` should always match the specified state.

### Actual Behavior

A resize is supposed to keep the center of the screen the same, but during a flyTo (I pressume any type of movement) this functionality seems to get disabled.

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

Reproduce the issue with the linked CodePen, starting from the map's resize() and flyTo() behavior described in the report. Trace how resizing affects an in-progress movement, then verify that the final map state still matches the requested flyTo destination after a resize.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.