OpenLayers setStyle Text visual Errors

Viewed 24

I had a strange problem with openlayers 5 when i set custom style for any features from KML.

Origin: enter image description here

Then call function with code:

function arreglaTextos2() {
Geolayers.getLayers().forEach(function(layer) { 
    if (!layer.get('title').includes("Proc.")) { 
        layer.getSource().forEachFeature(function(feature){
            if (feature.getProperties().etiqueta == 1) {
                feature.setStyle(new ol.style.Style({
                    text: new ol.style.Text({
                        textAlign: 'center',
                        textBaseline: 'middle',
                        offsetX: 25,
                        offsetY: -10,
                        scale: 1,
                        overflow: true,
                        textBaseline: 'hanging',
                        text: feature.get('name'),
                        font: '14px Calibri,sans-serif',
                        fill: new ol.style.Fill({ color: feature.getProperties().color }),
                    })
                }));
            }
        });
    }
});

}

And this is Result:

enter image description here

The text had visual errors...

Any idea? :(

0 Answers
Related