Labeling Polygons

christ.stark's Avatar

christ.stark

09 Oct, 2011 09:29 AM

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

  1. Support Staff 2 Posted by Will White on 12 Oct, 2011 11:47 PM

    Will White's Avatar

    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.

    #Bundeslaender {
      text-face-name: "DejaVu Sans Bold";
      text-name: "[N5]";
    }
    

    Thanks,
    Will

  2. 3 Posted by christ.stark on 15 Oct, 2011 04:47 PM

    christ.stark's Avatar

    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

  3. Support Staff 4 Posted by Will White on 19 Oct, 2011 01:23 AM

    Will White's Avatar

    I'm not sure I follow your latest update. Is the project working now?

  4. 5 Posted by christ.stark on 19 Oct, 2011 07:54 AM

    christ.stark's Avatar

    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.

  5. Will White closed this discussion on 23 Oct, 2011 07:59 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

25 May, 2013 01:00 AM
25 May, 2013 12:58 AM
25 May, 2013 12:20 AM