mapbox / mapbox/mapbox-gl-js

[v3.0.0-beta.3] flyTo Animation Drops frames and stutters

Open
#12,919 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When triggering the flyTo animation, the map drops frames and the console fills with `'requestAnimationFrame' handler took Xms` warnings. This is happening on the basemap but also legacy styles.

I've tried simplifying the animation and removing things like pitch, explicitly enabling WebGL2, etc. Still, the issue persists to the same level.

**mapbox-gl-js version**: 3.0.0-beta.3

**browser**: Chrome, Firefox, Safari

### Steps to Trigger Behavior

1. Load the map
2. Click a button to zoom from level 5 to 16
3. Check the console to see requestAnimationFrame warnings

### Link to Demonstration

https://jsfiddle.net/garydevenay/1dgu5jh2/23/

### Expected Behavior

Smooth zoom transition without dropped frames

### Actual Behavior

Stuttery animation and lots of dropped frames.

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 animation from the linked JSFiddle by calling flyTo to zoom from level 5 to 16, then inspect the requestAnimationFrame warnings and frame rate in Chrome, Firefox, and Safari. Compare the basemap and legacy-style cases; done means the transition is smooth without dropped frames or prolonged handler warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
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.