mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Image overlay extent accuracy

Open dirkvdb opened this issue 2 years ago • 4 comments

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

QGIS Behavior

This is the same raster data loaded in QGIS qgis

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.

dirkvdb avatar May 19 '22 13:05 dirkvdb

@dirkvdb The image you link isn't worknig for me, but I can recreate this by replacing it with https://placekitten.com/g/100/100.

SnailBones avatar May 19 '22 16:05 SnailBones

Yes you need to enable cross origin requests since the image is hosted elsewhere, but indeed any image will reproduce it

dirkvdb avatar May 20 '22 14:05 dirkvdb

Confirmed, still experiencing this with ImageSource Raster layers using the https://github.com/rnmapbox/maps library. Easy to demonstrate by drawing an outline at the same coordinates as the image layer — they do not line up.

insanj avatar Sep 29 '22 15:09 insanj

@SnailBones Just wanting to follow up here. We're seeing this issue and it is mission-critical for us in our use of Mapbox. Happy to have @insanj or myself follow up with any other information anyone needs for this

aowen14 avatar Sep 30 '22 01:09 aowen14