Disable Image Smoothing for ImageSource#364
Conversation
|
Integration tests report: appsharing.space |
| layer.on('prerender', event => { | ||
| const context = event.context; | ||
| if (context && context.canvas) { | ||
| const canvasContext = context.canvas.getContext('2d'); |
There was a problem hiding this comment.
👀 so there is no official OpenLayers API to disable image smoothing? Do we really need to get our hands dirty and manipulate the canvas context?
There was a problem hiding this comment.
Based on what I read, there was a way before with OpenLayers to set the imageSmoothing: false but I guess it's not available anymore with the current version. If someone has another way to do it, I'm open for suggestions!
There was a problem hiding this comment.
That's unfortunate :S
Let's get this PR in, we can always revisit it later if we have a better solution for this.
There was a problem hiding this comment.
Setting interpolate: false when adding Image Layers here should accomplish the same thing.
There was a problem hiding this comment.
Ah great! Thanks for looking into it
|
It's beautifully blocky 🤩 |

Description
Fixes #353.
Before

After

Checklist
Resolves #XXX.Failing lint checks can be resolved with:
pre-commit run --all-filesjlpm run lint📚 Documentation preview: https://jupytergis--364.org.readthedocs.build/en/364/
💡 JupyterLite preview: https://jupytergis--364.org.readthedocs.build/en/364/lite