2

For some reason, labels are always placed in the bottom right of a polygon. I want them in the center of a polygon.

I tried these:

text-horizontal-alignment: middle;
text-vertical-alignment: middle;

but it doesn't help.

I noticed a strange thing: build-in labels are centered inside a polygon, but for regular area=yes or landuse=yes they are along the line, i.e. text-placement:interior is not working consistently.

Full example:

#labels {
    text-name: "[name]";
    text-fill: #444;
    text-face-name: 'Alfios Bold';
    text-placement: interior;
    text-size: 12pt;
}

#cemetery[building='yes'] {
    polygon-fill: #0f0;
}

#cemetery[landuse='residential'] {
    polygon-fill: #0f0;
}
3
  • Maybe you have declared somewhere rule like: text-placements: "SE,16"; Commented Jul 5, 2014 at 4:38
  • No, I haven't declared text-placements.
    – Vanuan
    Commented Jul 5, 2014 at 12:49
  • The problem is that I'm using OsmPlugin, that doesn't support polygons very well :(
    – Vanuan
    Commented Jul 5, 2014 at 15:03

1 Answer 1

1

I know this is an old question, but if someone stumbles upon it currently looking for the answer try

text-placement-type: simple;

Not the answer you're looking for? Browse other questions tagged or ask your own question.