Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How can I more efficiently write this piece of code which aims to style two features in my streets layer (major roads and major road ramps) the exact same way.

#tor_centreline [FCODE=201200] {
      line-width: 0.5;
      line-color: lightgray;
   }

#tor_centreline [FCODE=201201] {
      line-width: 0.5;
      line-color: lightgray;
   }

When I input the code as...

#tor_centreline [FCODE=201200],[FCODE=201201] {

... I break my map because I believe the second [FCODE=""] is not linked to the #tor_centreline... such that it searches all of my layers for [FCODE=""] and when it finds a layer with no "FCODE" attribute field I receive an error.

share|improve this question

2 Answers 2

#tor_centreline {
    [FCODE=201200] {line-width: 0.5; line-color: lightgray;}
    [FCODE=201201] {line-width: 0.5; line-color: lightgray;}
}

see: http://support.mapbox.com/kb/tilemill/styling-point-data-using-tilemill

share|improve this answer

(Cross-posting from GitHub for the benefit of StackExchangers..)

Both filters must be connected to a layer selector. There are two options that require only specifying the style once:

#tor_centreline [FCODE=201200],
#tor_centreline [FCODE=201201] {
  line-width: 0.5;
  line-color: lightgray;
}

or

#tor_centreline {
  [FCODE=201200],
  [FCODE=201201] {
    line-width: 0.5;
    line-color: lightgray;
  }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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