I'm making app that displays my markers, and because there is a lot of them I need to make clusters. Everything but text works as expected.
I've tried changing anchor and anchor[X/Y]Units but even if i change it to a fixed pixels it always renders wrong.
This is my code:
const style = new Style({
image: new CircleStyle({
radius: 12,
stroke: new Stroke({
color: '#ffffff',
width: 1,
}),
fill: new Fill({
color: '#3399CC'
}),
anchorXUnits: 'fraction',
anchorYUnits: 'fraction',
anchor: [0.5, 0.5],
}),
text: new Text({
font: '14px/24px sans-serif',
text: '2',
fill: new Fill({
color: '#ffffff'
})
})
});
var clusters = new VectorLayer({
source: clusterSource,
style: style
});
Text in clusters is not aligning properly. I attach some images to ilustrate the problem further.
(source: devhub.pl)
(source: devhub.pl)