mapbox / mapbox/mapbox-gl-js

Preloading maptiles for camera animation stopped working

Open
#13,386 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs information :pray:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: 3.9.3, also confirmed in 3.6

**browser**: Chrome & Firefox confirmed

### Steps to Trigger Behavior

1. Add a mapboxgljs map
2. Preload maptiles and await idle before running flyTo.
Code example:
```js
map.flyTo({center: [-119.5375, 37.7425], preloadOnly: true});
await map.once('idle');
map.flyTo({center: [-119.5375, 37.7425]});
```

### Expected Behavior
Maptiles should be preloaded before animation starts for a smooth animation.

### Actual Behavior
Animation runs instantly, tiles are not preloaded. Resulting in a laggy animation.
The lag is more visible on a less performant device, such as a mobile phone.

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 with the provided mapbox-gl-js reproduction using flyTo({preloadOnly: true}) and the idle event, then compare it with the following animated flyTo call in Chrome and Firefox. Confirm that tiles are loaded before animation begins and that the animation is no longer instantaneous.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, 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.