Skip to content

Instantly share code, notes, and snippets.

@yosemitebandit
Created March 1, 2012 02:47
Show Gist options
  • Save yosemitebandit/1946859 to your computer and use it in GitHub Desktop.
Save yosemitebandit/1946859 to your computer and use it in GitHub Desktop.
sample carto file for TileMill with labels and conditional styling based on string-matching
Map { background-color: #b8dee6; }
#countries { ::polygon { polygon-fill: #fff; } }
#boladm {
::polygon {
polygon-fill: #76b8d5;
}
::line {
line-color: #3f3f3f;
line-width: 0.5;
}
}
#boladm[NAME_1 = "Cochabamba"] {
::polygon {
polygon-fill: #73FF9D;
}
::line {
line-color: #3f3f3f;
line-width: 0.5;
}
::labels {
text-name: "[NAME_3]";
text-face-name: "Arial Narrow";
text-size: 12;
text-dy: 1;
}
}
#boladm[NAME_1 = "Cochabamba"][NAME_3 = "Punata"] {
::polygon {
polygon-fill: red;
}
::line {
line-color: #3f3f3f;
line-width: 0.5;
}
}
#boladm[NAME_1 = "Cochabamba"][NAME_3 = "Tiraque"] {
::polygon {
polygon-fill: green;
}
::line {
line-color: #3f3f3f;
line-width: 0.5;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment