mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.26k stars 2.23k forks source link

Raster layer paint raster resampling set to nearest does not work as expected #13196

Open InzeNL opened 5 months ago

InzeNL commented 5 months ago

mapbox-gl-js version: v3.4.0

browser: Chrome 125

Steps to Trigger Behavior

  1. Upload a raster file (file used in example can be found here)
  2. Add the raster source with this file to mapbox
  3. Add the raster layer with "paint"."raster-resampling" set to "nearest"
  4. Zoom in

Link to Demonstration

https://jsbin.com/bekoxekoqi/edit?html,js,output

Expected Behavior

Mapbox should display something like this (taken from QGIS) image

Actual Behavior

It still seems to do some type of linear scaling image

stepankuzmin commented 1 month ago

Hi @InzeNL,

It might be related to https://github.com/mapbox/mapbox-gl-js/issues/7331. Could you please try the latest GL JS version and see if you can reproduce this issue? Please also check that the tiff file you provided can be loaded in the jsbin example.