Is it possible to do something like this:
#ways[highway="trunk"] {
line-color:#c99;
line-width:@zoom/10;
}
Obviously that example doesn't work. Is there another way to do arithmetic expressions involving the zoom level?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityYou 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:
@z10base=10;
@z11base=11;
#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; }
}