mapbox / mapbox/mapbox-gl-js

Tiles continuously load/unload outside camera frustrum when pitched

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

Nobody has claimed this yet.

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

Description

**mapbox-gl-js version**: latest

### Question

When the camera is pitched beyond ~45 degrees and you orbit the camera, you end up with an almost-constant unloading & loading of the same tiles. It seems like the system is fairly aggressive in removing tiles that are out of view. For a top-down slippy map that makes sense, but in the case of the 3D map with rotation & pitch, it's extremely likely that nearby tiles behind the camera will be seen again. This pruning results in tiles near the camera being unloaded/reloaded a lot.

In a system where the camera is rotating frequently, for example following a moving object, this produces a lot of unnecessary / duplicative network requests and janky map behavior.

Is it possible somehow to configure the system to be keep more tiles in memory, for example to keep all tiles nearby the camera in memory even if they are out of view?

_Steps to reproduce_:
- Load a mapbox scene with 3D terrain
- Configure to allow rotation/pitch
- With the camera pitched to >45deg, rotate in increments of >=90deg.
- Observe that the area outside the camera frustrum keeps unloading.

### 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

No source file or test is named in the issue. Start by reproducing the behavior with pitched terrain and repeated camera rotation, then trace the tile visibility and unloading path. Done means establishing whether nearby out-of-view tiles can be retained without excessive memory or requests, with regression coverage for the reported camera movement.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, frontend, performance, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.