Skip to content

Instantly share code, notes, and snippets.

@pedromcunha
Created July 21, 2014 20:03
Show Gist options
  • Save pedromcunha/f1fcd6387502aef07459 to your computer and use it in GitHub Desktop.
Save pedromcunha/f1fcd6387502aef07459 to your computer and use it in GitHub Desktop.
Layer CSS trick
<script type="cartocss/html" id="pm25_na">
/*Country Styles*/
#pm25_na{
polygon-fill: #FFFFB2;
polygon-opacity: 0.8;
line-color: #FFF;
line-width: 1;
line-opacity: 1;
}
#pm25_na [ {0} <= 154] {
polygon-fill: #000000;
}
#pm25_na [ {0} <= 140] {
polygon-fill: #1A0800;
}
#pm25_na [ {0} <= 125] {
polygon-fill: #241105;
}
#pm25_na [ {0} <= 110] {
polygon-fill: #301703;
}
#pm25_na [ {0} <= 90] {
polygon-fill: #3F1C05;
}
#pm25_na [ {0} <= 69] {
polygon-fill: #4D1E04;
}
#pm25_na [ {0} <= 55] {
polygon-fill: #631E04;
}
#pm25_na [ {0} <= 49.92] {
polygon-fill: #791406;
}
#pm25_na [ {0} <= 32.54] {
polygon-fill: #970707;
}
#pm25_na [ {0} <= 25.17] {
polygon-fill: #c30000;
}
#pm25_na [ {0} <= 15.17] {
polygon-fill: #f50000;
}
#pm25_na [ {0} <= 10.85] {
polygon-fill: #FF3200;
}
#pm25_na [ {0} <= 9.15] {
polygon-fill: #FF5a00;
}
#pm25_na [ {0} <= 8.15] {
polygon-fill: #FF8200;
}
#pm25_na [ {0} <= 6.06] {
polygon-fill: #FFaa00;
}
#pm25_na [ {0} <= 4.62] {
polygon-fill: #ffd72d;
}
#pm25_na [ {0} <= 2.98] {
polygon-fill: #fff74b;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment