diff --git a/src/VectorEncoder.ts b/src/VectorEncoder.ts index 57df0a5..eefed95 100644 --- a/src/VectorEncoder.ts +++ b/src/VectorEncoder.ts @@ -523,7 +523,8 @@ export default class VectorEncoder { label: textStyle.getText(), fontFamily: textStyle.getFont() ? textStyle.getFont() : 'sans-serif', labelXOffset: textStyle.getOffsetX(), - labelYOffset: textStyle.getOffsetY(), + // OL and MFP behaves differently on the Y offset + labelYOffset: -textStyle.getOffsetY(), labelAlign: 'cm', } as MFPSymbolizerText; const fillStyle = textStyle.getFill(); diff --git a/test.js b/test.js index 78fa666..c13cbd4 100644 --- a/test.js +++ b/test.js @@ -79,7 +79,7 @@ const styleFn = (feature) => { text: new Text({ text: feature.get('name'), font: '12px sans-serif', - offsetY: 12, + offsetY: -12, }), image: new Circle({ fill,