Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to do something like this:

#ways[highway="trunk"] {

Obviously that example doesn't work. Is there another way to do arithmetic expressions involving the zoom level?

share|improve this question
up vote 5 down vote accepted

You can't use zoom as a variable at the moment as you mentioned. I've read this is planned (and I'm excited to see it implemented too).

Here's one work-around, etc:

  #ways[highway="trunk"] {
  line-color: #c99; 
  [zoom=10] { line-width: 1; }
  [zoom=11] { line-width: 1.1; }
  [zoom=12] { line-width: 1.2; }

If you have multiple highway types, you could also do:


  #ways[highway=trunk"] {
  line-color: #c99; 
  [zoom=10] { line-width: @z10base; }
  [zoom=11] { line-width: @z11base; }

 #ways[highway="primary"] {
  line-color: #000000; 
  [zoom=10] { line-width: @z10base + 4; }
  [zoom=11] { line-width: @z11base + 8; }
share|improve this answer

Your Answer


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.