mapbox / mapbox/mapbox-gl-js

Image overlay extent accuracy

Open
#11,909 4 comments 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

mapbox-gl-js 2.8.2

browser: chrome/firefox

### Steps to Trigger Behavior

Add an image layer
Draw the image extent as a geojson polygon
The extents do not match

### Link to Demonstration
https://jsbin.com/juturac/edit?html,output

Enable cross origin requests as it links to an external image
### Expected Behavior
I would expect the polygon and the image extent to match

### Actual Behavior
There is a minor offset
![mapbox](https://user-images.githubusercontent.com/1011958/169297279-a02e9e4d-40b0-4732-b31b-b1ac22a4bfb9.png)

### QGIS Behavior
This is the same raster data loaded in QGIS
![qgis](https://user-images.githubusercontent.com/1011958/169297302-d5527f4e-5298-4055-bb63-50877d07c24b.png)

Here the extent is the same as the rendered geojson polygon. So it looks like there is some offset when rendering images.

I have submitted this issue before #9396 and it was marked as a duplicate of #9158.
#9158 is fixed now but this issue still occurs.

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 by reproducing the mismatch in the linked JSBin with Chrome or Firefox: add the image layer and compare its rendered extent with the GeoJSON polygon. Use the supplied screenshots and QGIS comparison as the reference. Done means the image and polygon extents align, and the behavior remains correct after the fix for #9158.

Written by the indexing model from the issue text.

Assessment

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