mapbox / mapbox/mapbox-gl-js

fix image source at lower zoom levels with non-mercator projections

Open
#11,238 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Image (and Canvas, Video) sources don't work with non-mercator projections at lower zoom levels. It correctly places the corners, but if the projection of the image doesn't match the projection of the map, it gets interpolated incorrectly. We need to use a mesh similar to the one we use for raster tiles.

This problem does not exist at higher zooms where the map is unskewed and conformal.

mapbox-gl-js version: main v2.6.0

browser: all

Steps to Trigger Behavior
  1. open http://localhost:9966/debug/10186.html#9.06/43.3772/-76.7646
  2. map.setProjection('albers')
  3. compare to same location without albers
Link to Demonstration

http://localhost:9966/debug/10186.html#9.06/43.3772/-76.7646

Expected Behavior

Screen Shot 2021-11-05 at 11 40 47 AM

Actual Behavior

Screen Shot 2021-11-05 at 11 40 41 AM

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 debug/10186.html reproduction and compare the image source at lower zoom with the Albers projection enabled. Read the raster tile mesh implementation and the image, Canvas, and Video source rendering paths to understand the existing interpolation. Done means these sources render without distortion for non-Mercator projections at lower zoom levels while preserving the existing higher-zoom behavior.

Written by the indexing model from the issue text.

Assessment

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