mapbox / mapbox/mapbox-gl-js

Log warning if a sprite or image can't be rendered due to max texture size or memory limitation

Open
#11,505 0 comments 0 reactions 0 assignees View on GitHub
auto-triaged feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

## Motivation

A customer had a very large sprite sheet that wasn't displayed on mobile. Since no warning was logged, they had no way to know that they were running into this issue. Logging a warning would be preferable to silently failing in this case.

## Design Alternatives

The max texture size and memory are device features that are out of our control. In the case of sprites, we likely need to keep the sprite together as a single texture to avoid overcomplicating the code, which limits our alternatives.

For images, a couple of alternatives are discussed in https://github.com/mapbox/mapbox-gl-js/issues/9312, namely downsizing images and tiling them.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the sprite and image rendering paths and the checks for maximum texture size or memory limits. Determine where rendering fails silently and how warnings are logged in the project. Done means affected sprites or images produce a useful warning when they cannot be rendered, without warning for successful rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.