-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add style-spec option to specify interpolation mode for raster-style sources #4450
Comments
Something for the GL Style Spec raster layer. CartoCSS exposed this as the raster-scaling property. Could be useful for maps like weather radars, mobile cell coverage too: |
@andrewharvey yes! that's exactly what I meant. |
Updated the title to reflect a style-spec feature request (as @andrewharvey noted). cc @mapbox/gl |
the texture is created in the source and not in the layer, so the source cannot know the layer paint properties when it creates the texture. |
Exactly what I am looking for. I am unable to use mapbox/GL for a lot of annotation jobs that require pixel-level accuracy. Can we expect this anytime soon? |
To implement this, set the texture scale mode to |
@kkaefer Can you help with where can I change the texture scale mode to gl.nearest? I don't mind hard-coding this in my js file for now. |
@rohitrameshrao I believe it's the gl.LINEAR at mapbox-gl-js/src/source/image_source.js Line 201 in 3c07b72
|
Thanks @andrewharvey! I tried changing it and building it. The map is still not pixelated! :/ |
@rohitrameshrao that place in the code sets it for Image sources, if you're using a raster tile source then you'll also need to set it around mapbox-gl-js/src/source/raster_tile_source.js Line 106 in 3c07b72
UPDATE: ^ isn't right, I'm working on a PR which should solve this. |
@rohitrameshrao take a look at #6411 for the delta to get it working, at the moment I can only work out how to hardcode an Image source as either linear or nearest filtering, so if you need an urgent solution you could just use the current PR which has it hardcoded... |
@rohitrameshrao from my testing #6411 is working well, would appreciate if you could test it out too. |
@andrewharvey Sure! Will test this in the next couple of days and let you know. Thanks! |
Awesome thanks! |
mapbox-gl-js version: v0.34.0
Steps to Trigger Behavior
Expected Behavior
have an option to use
gl.NEAREST
so that my image is pixelated rather than blurry.Actual Behavior
My nice pixelated image is now a blurry and ugly because
ImageSource._prepareImage
usesgl.LINEAR
:(https://github.com/mapbox/mapbox-gl-js/blob/master/src/source/image_source.js#L157-L158
The text was updated successfully, but these errors were encountered: