I would like to split the style of my labels, which consist of 2 attributes. I already managed to separate the lines, but I need to style them differently as well, as the second line should be bold.
Currently my map looks like this:
And I would like it to look like this:
I would prefer to do it in CSS, but I also prepared the style in SLD, so I would be happy for a solution in either of them.
My code looks like this in CSS:
* {
label: [IDENT][LOWERLIMIT];
-gt-label-auto-wrap: 1;
font-weight: normal;
font-fill: black;
}
and like this in SLD:
black
normal
Answer
Here is a solution in SLD but I think you should be able to generate the same in CSS.
The trick is to use 2 TextSymbolizers and offset them so that they don't overlap.
Arial
Normal
10
0.5
1.0
0
10
Arial Bold
Normal
bold
10
0.5
0.0
0
-10
Depending on your font and polygon sizes you can play with the AnchorPoint
s and Displacement
s to adjust the exact placement of the labels.
No comments:
Post a Comment