We have a custom OSM-like tile source which we serve as both a WMTS and WMS service using Mapproxy and showcase in an Openlayers viewer.
We add a layer switcher control to flick between the 2 layers and they display fine except for a small 1-pixel offset. After playing around to try and make up for the offset using the "precompose" event and setting the "event.frameState.pixelRatio" of the WMS layer, I see that the offset is different at certain zoom levels.
For example, at zooms 3 and 6 we have to apply a (0,-1) offset and for zooms 7, 10, 11 etc. we have to apply a (0,1) offset to the WMS layer to match the WMTS layer.
I'm guess some rounding error is involved which is unavoidable with WMS calls? Or can this 1-pixel offset issue be resolved?
In QGIS, when I bring in both layers, they appear toalign perfectly.