ol-mapbox-style
ol-mapbox-style copied to clipboard
`icon-offset` moves left instead of right
The specification https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-offset says Positive values indicate right and down However as implemented it moves left. See https://codesandbox.io/s/print-to-scale-forked-cbx1cz?file=/main.js and comment out the styleLayer.layout['icon-offset'] = [100, 100]; to see the original position of the station icon. As noted in https://github.com/openlayers/openlayers/pull/13975#issuecomment-1215593028 this code would be affected by that issue, but currently ).map((v) => -v * spriteImageData.pixelRatio) would need to ).map((v)(v, i) => (1 - 2 * i) * v * spriteImageData.pixelRatio). If making a breaking change it might be worth making a further change to define displacement positive down consistent with ol/style/Text offsetY.
Please suggest a fix for both.
I don't think we need a temporary fix which could be broken again by OL7. Decide what should be in OL7, implement it, then fix this so it behaves as specified.
If we make more breaking changes to ol/style/Image, they will be in v8. So now is the time to fix this here.