Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created July 4, 2013 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wboykinm/5929060 to your computer and use it in GitHub Desktop.
Save wboykinm/5929060 to your computer and use it in GitHub Desktop.
tm2 blueprint
// Languages: name (local), name_en, name_fr, name_es, name_de
@name: '[name_en]';
// Common Colors //
@water: #0058bc;
@park: #cec;
Map {
background-color:#666FD8;
buffer-size:512;
}
// Political boundaries //
#admin {
line-join: round;
line-color: #bbe;
[maritime=1] { line-color: lighten(@water, 3%); }
// Countries
[admin_level=2] {
line-width: 1.4;
[zoom>=6] { line-width: 2; }
[zoom>=8] { line-width: 4; }
[disputed=1] { line-dasharray: 4,4; }
}
// States / Provices / Subregions
[admin_level>=3] {
line-width: 0.4;
line-dasharray: 10,3,3,3;
[zoom>=6] { line-width: 1; }
[zoom>=8] { line-width: 2; }
[zoom>=12] { line-width: 3; }
}
}
// Places //
#country_label[zoom>=3][zoom<7] {
text-name: @name;
text-face-name: 'Lato Regular';
text-wrap-width: 100;
text-wrap-before: true;
text-fill: #fff;
text-size: 13;
[zoom>=3][scalerank=1],
[zoom>=4][scalerank=2],
[zoom>=5][scalerank=3],
[zoom>=6][scalerank>3] {
text-size: 18;
}
[zoom>=4][scalerank=1],
[zoom>=5][scalerank=2],
[zoom>=6][scalerank=3],
[zoom>=7][scalerank>3] {
text-size: 20;
}
}
#country_label_line {
line-color: #324;
line-opacity: 0.05;
}
#place_label {
[zoom>5] {
[type='city'][zoom<=15] {
text-name: @name;
text-face-name: 'Lato Regular';
text-fill: #fff;
text-wrap-width: 100;
text-wrap-before: true;
text-size:12;
text-transform:uppercase;
text-character-spacing:2;
text-halo-fill:rgba(0,88,188,0.8);
text-halo-radius:2;
[zoom>=10] { text-size: 18; }
[zoom>=12] { text-size: 24; }
}
[type='town'][zoom<=17] {
text-name: @name;
text-face-name: 'Lato Regular';
text-fill: #fff;
text-size: 14;
text-wrap-width: 100;
text-wrap-before: true;
text-halo-fill:rgba(0,88,188,0.8);
text-halo-radius:2;
[zoom>=10] { text-size: 16; }
[zoom>=12] { text-size: 20; }
}
[type='village'] {
text-name: @name;
text-face-name: 'Lato Light';
text-fill: #fff;
text-size: 12;
text-wrap-width: 100;
text-wrap-before: true;
text-halo-fill:rgba(0,88,188,0.8);
text-halo-radius:2;
[zoom>=12] { text-size: 14; }
[zoom>=14] { text-size: 18; }
}
[type='hamlet'],
[type='suburb'] {
text-name: @name;
text-face-name: 'Lato Light';
text-fill: #fff;
text-size: 12;
text-wrap-width: 100;
text-wrap-before: true;
text-halo-fill:rgba(0,88,188,0.8);
text-halo-radius:2;
[zoom>=14] { text-size: 14; }
[zoom>=16] { text-size: 16; }
}
}
}
// Water Features //
#water {
[zoom<=8] {
polygon-fill:#0058bc;
}
[zoom>8] {
line-color:#fff;
polygon-fill: #0058bc;
polygon-gamma:0.6;
line-width:1.5;
line-smooth:0.2;
line-opacity:0.7;
line-clip:true;
::contour1 {
line-offset:2;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour2 {
line-offset:4;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour3 {
line-offset:8;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour4 {
line-offset:16;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour5 {
line-offset:32;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour6 {
line-offset:64;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour7 {
line-offset:120;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour8 {
line-offset:160;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour9 {
line-offset:200;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour10 {
line-offset:260;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour11 {
line-offset:340;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
::contour12 {
line-offset:440;
line-width:0.5;
line-color:#fff;
line-smooth:3;
line-opacity:0.2;
}
}
}
#water_label {
[zoom<=13], // automatic area filtering @ low zooms
[zoom>=14][area>500000],
[zoom>=16][area>10000],
[zoom>=17] {
text-name: @name;
text-face-name: 'Lato Italic';
text-fill: lighten(@water, 30%);
text-size: 13;
text-halo-fill:darken(@water,10%);
text-halo-radius:1.2;
text-wrap-width: 100;
text-wrap-before: true;
}
}
#waterway {
[type='river'],
[type='canal'] {
line-color: @water;
line-width: 0.5;
[zoom>=12] { line-width: 1; }
[zoom>=14] { line-width: 2; }
[zoom>=16] { line-width: 3; }
}
[type='stream'] {
line-color: @water;
line-width: 0.5;
[zoom>=14] { line-width: 1; }
[zoom>=16] { line-width: 2; }
[zoom>=18] { line-width: 3; }
}
}
// Landuse areas //
#landuse {
[class='park'] {
polygon-fill: @park;
polygon-opacity:0.3;
}
}
#area_label {
[class='park'] {
[zoom<=13], // automatic area filtering @ low zooms
[zoom>=14][area>500000],
[zoom>=16][area>10000],
[zoom>=17] {
text-name: @name;
text-face-name: 'Lato Italic';
text-fill: lighten(@park, 50%);
text-size: 13;
text-wrap-width: 100;
text-wrap-before: true;
}
}
}
// Buildings //
#building {
line-color:#aec9d9;
line-smooth:0.1;
line-width:0;
polygon-opacity:0.7;
polygon-fill:#fe8315;
polygon-comp-op:invert;
}
// Roads & Railways //
#tunnel { opacity: 0.5; }
#road,
#tunnel,
#bridge {
['mapnik::geometry_type'=2] {
::halo {
line-color:#003FA3;
line-join:round;
[class='motorway'],
[class='main'] {
[zoom>=10] { line-width: 3; }
[zoom>=12] { line-width: 5; }
[zoom>=14] { line-width: 7; }
[zoom>=16] { line-width: 10; }
}
[class='street'],
[class='street_limited'] {
[zoom>=14] { line-width: 4; }
[zoom>=16] { line-width: 5; }
}
}
::main {
line-color: #cde;
line-width: 0.5;
[class='motorway'],
[class='main'] {
[zoom>=10] { line-width: 1; }
[zoom>=12] { line-width: 2; }
[zoom>=14] { line-width: 3; }
[zoom>=16] { line-width: 5; }
}
[class='street'],
[class='street_limited'] {
[zoom>=14] { line-width: 1; }
[zoom>=16] { line-width: 2; }
}
[class='street_limited'] { line-dasharray: 4,1; }
}
}
}
#road_label [class='motorway'],
[class='main'],[class='street']{
[zoom>12] {
text-name:@name;
text-face-name:'Lato Light';
text-size:12;
text-fill:#fff;
text-character-spacing:2;
text-dy:12;
text-min-distance: 20000;
text-placement:line;
text-halo-fill:rgba(0,88,188,0.8);
text-halo-radius:1.4;
text-spacing:20000;
text-clip:false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment