mapbox / mapbox/mapbox-gl-js

Downsize images to prevent reaching max hardware texture size on mobile

Open
#9,312 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple: needs discussion :speech_balloon:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

When I run my react application on Safari or Chrome mobile this message is showed on the console:

`WebGL: INVALID_VALUE: texImage2D: width or height out of range`

**mapbox-gl-js version**:
```"mapbox-gl": "^1.7.0",```

**browser**:
Safari and Chrome Mobile

**Device**:
Ios 13.2.2

### Steps to Trigger Behavior
add a overlay source:
```
map.addSource("overlay", {
type: "image",
url: "https://images.unsplash.com/photo-1573592919522-cb19b002d543",
coordinates: [[], [], []]
});
```

### Link to Demonstration
https://codepen.io/ronaiza_cardoso/pen/YzXGKoq?editors=0010

### Expected Behavior
Load overlay image on mobile devices

### Actual Behavior
Black image loaded with the fallow msg error on console.log
`WebGL: INVALID_VALUE: texImage2D: width or height out of range`

![image](https://user-images.githubusercontent.com/7999914/74830986-39a44000-530c-11ea-8f02-0959ca980a29.png)

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 linked CodePen reproduction and the map.addSource image-overlay path in mapbox-gl-js, then inspect how mobile texture limits are handled. Verify on Safari and Chrome Mobile with the supplied Unsplash image; done means the overlay loads without the INVALID_VALUE texImage2D error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.