Labeling Polygons
Hi, I would like to label Polygons of a shape. The names for the
polygons are in my table-column N5.
so I took the code from the geography-class example and tried to
use that but it doesn't work:
======================================================================================
/
@futura_med: "Futura Medium","Function Pro Medium","Ubuntu Regular","Trebuchet MS Regular","DejaVu Sans Book"; @futura_italic: "Futura Medium Italic","Function Pro Medium Italic","Ubuntu Italic","Trebuchet MS Italic","DejaVu Sans Oblique"; @futura_bold: "Futura Bold","Function Pro Bold","Ubuntu Bold","Trebuchet MS Bold","DejaVu Sans Bold";
/ ---- Bundeslaender Schrift ---- /
Bundeslaender[zoom>1][TYPE='Sovereign country'],
Bundeslaender[zoom>1][TYPE='Country']{
text-face-name: @futura_med; text-fill:@line * 0.6; text-size:9; text-transform:uppercase; text-halo-fill:rgba(255,255,255,0.5); text-halo-radius:1; text-line-spacing:1; text-wrap-width:20; text-name:"''"; / hackish? /
[zoom=3] {
text-size:10;
} [zoom=4] {
text-size:11;
} [zoom=5] {
text-size:12;
text-character-spacing:1;
text-line-spacing:1;
} [zoom>5] {
text-size:14;
text-character-spacing:2;
text-line-spacing:2;
}
[zoom>=2][zoom<4] { text-name: "[N4]"; } [zoom>=4] { text-name: "[N5]"; }
}
Bundeslaender[zoom>4][TYPE='Dependency']{
text-face-name: @futura_italic; text-fill:@line * 0.6; text-size:9; text-halo-fill:rgba(255,255,255,0.5); text-halo-radius:1; text-line-spacing:1; text-wrap-width:20; text-name:"[N5]"; [zoom=6] { text-size:10; } [zoom>6] { text-size:11; } }
============================================================================================
What I didn't get is where I should link to the N5 column. The code I put into the style.mss
could anybody here help me with this problem?
best regards desputin
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Will White on 12 Oct, 2011 11:47 PM
Hi there,
What is the ID/class of your layer? Your selectors may be invalid. If the layer ID is
Bundeslaender, your selector should be#Bundeslaender.If that doesn't help, try a test using the following style.
Thanks,
Will
3 Posted by christ.stark on 15 Oct, 2011 04:47 PM
Hi,
hm, I imported the layer a second time and displayed the text-layer from the other shape. I think there must be something corrupted in the shape file "Bundeslaender".
Thanks
desputin
Support Staff 4 Posted by Will White on 19 Oct, 2011 01:23 AM
I'm not sure I follow your latest update. Is the project working now?
5 Posted by christ.stark on 19 Oct, 2011 07:54 AM
The shape file I use for polygon-coloring I had modified before (added new columns in the dbf file). So I imported the original - unmodified shape - file too and use that for labeling... A workaround.
Will White closed this discussion on 23 Oct, 2011 07:59 PM.