Assigning colors to shape-polygons

christ.stark's Avatar

christ.stark

06 Oct, 2011 04:02 PM

Hi,

I tried to assign colors to polygons but didn't succeed. It shoudn't be too complicated I think.

What I did was to put this code into a newly created rainbow.mss

@blau1: #BDBEC6; /* 
@blau2: #9DA0AD;
@blau3: #7D82A3;
@blau4: #535C96;
@blau5: #3F3B82;
@blau6: #100D52;
@keinefarbe: #a3cec5;

/* Coastlines */
#country::land-glow-inner[zoom>=0] { 
  line-color:@line;
  line-opacity:0.8;
  line-join:round;
  [zoom=0] { line-width:1.2; }
  [zoom=1] { line-width:1.6; }
  [zoom=2] { line-width:2; }
  [zoom>2] { line-width:2.4; }
}

#country::land-glow-outer[zoom>1] { 
  line-color:@line;
  line-width:5;
  line-opacity:0.1;
  line-join:round;
}

/* 2010 Leistung Gesamt */
#Bundeslaender::fill[zoom>=0] {
  [N4='753'] { polygon-fill:@blau4; }
  [N4='754'] { polygon-fill:@blau1; }
  [N4='755'] { polygon-fill:@blau6; }
  [N4='756'] { polygon-fill:@blau5; }
  [N4='757'] { polygon-fill:@blau4; }
  [N4='758'] { polygon-fill:@blau1; }
  [N4='759'] { polygon-fill:@blau1; }
  [N4='760']{ polygon-fill:@blau1; }
  [N4='761'] { polygon-fill:@blau1; }
  [N4='762'] { polygon-fill:@blau1; }
  [N4='763'] { polygon-fill:@blau1; }
  [N4='764']{ polygon-fill:@blau3; }
  [N4='765']{ polygon-fill:@blau1; }
  [N4='766'] { polygon-fill:@blau2; }
  [N4='767']{ polygon-fill:@blau1; }

 
}

The name of the layer is Bundeslaender and the column to distinguish the polygons of the layer from another is called N4. It should work but it stays all gray. Can anyone here help me with that?

best regards
desputin

  1. 2 Posted by christ.stark on 06 Oct, 2011 04:03 PM

    christ.stark's Avatar

    sorry had problems with the code-formatting in the post

  2. Support Staff 3 Posted by AJ on 06 Oct, 2011 04:23 PM

    AJ's Avatar

    (Fixed the code formatting for you)

    On the first line your are commenting out all but one of your color definitions.. is the /* there a typo?

  3. 4 Posted by christ.stark on 07 Oct, 2011 08:46 AM

    christ.stark's Avatar

    / that was a comment where I forgot to paste the / as well. So it should work.

    It worked now. I simply copied the code from rainbow.mss to style.mss and now it works! Thank you though!

  4. Support Staff 5 Posted by Tom MacWright on 12 Oct, 2011 09:32 PM

    Tom MacWright's Avatar

    Great! Glad that worked for you.

  5. Tom MacWright closed this discussion on 12 Oct, 2011 09:32 PM.

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

Recent Discussions

24 May, 2013 11:21 AM
24 May, 2013 10:19 AM
24 May, 2013 10:00 AM
24 May, 2013 09:02 AM
24 May, 2013 08:20 AM

 

24 May, 2013 08:13 AM
23 May, 2013 11:59 PM