]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/labels.mss
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / server / tm2 / mapbox-studio-light.tm2 / labels.mss
1 // Country labels //
2 #place[class='country'][zoom>=2][zoom<=10] {
3   text-name: '[name_en]';
4   text-face-name: @sans_bold;
5   text-placement: point;
6   text-size: 10;
7   text-fill: @text;
8   text-halo-fill: @land;
9   text-halo-radius: 1;
10   text-halo-rasterizer: fast;
11   text-wrap-width: 20;
12   text-wrap-before: true;
13   text-line-spacing: -3;
14   [rank=1] {
15     [zoom=3]  { text-size: 12; text-wrap-width: 60; }
16     [zoom=4]  { text-size: 14; text-wrap-width: 90; }
17     [zoom=5]  { text-size: 20; text-wrap-width: 120; }
18     [zoom>=6] { text-size: 20; text-wrap-width: 120; }
19   }
20   [rank=2] {
21     [zoom=2]  { text-name: [code]; }
22     [zoom=3]  { text-size: 11; }
23     [zoom=4]  { text-size: 13; }
24     [zoom=5]  { text-size: 17; }
25     [zoom>=6] { text-size: 20; }
26   }
27   [rank=3] {
28     [zoom=3]  { text-name: [code]; }
29     [zoom=4]  { text-size: 11; }
30     [zoom=5]  { text-size: 15; }
31     [zoom=6]  { text-size: 17; }
32     [zoom=7]  { text-size: 18; text-wrap-width: 60; }
33     [zoom>=8] { text-size: 20; text-wrap-width: 120; }
34   }
35   [rank=4] {
36     [zoom=5] { text-size: 13; }
37     [zoom=6] { text-size: 15; text-wrap-width: 60  }
38     [zoom=7] { text-size: 16; text-wrap-width: 90; }
39     [zoom=8] { text-size: 18; text-wrap-width: 120; }
40     [zoom>=9] { text-size: 20; text-wrap-width: 120; }
41   }
42   [rank=5] {
43     [zoom=5] { text-size: 11; }
44     [zoom=6] { text-size: 13; }
45     [zoom=7] { text-size: 14; text-wrap-width: 60; }
46     [zoom=8] { text-size: 16; text-wrap-width: 90; }
47     [zoom>=9] { text-size: 18; text-wrap-width: 120; }
48   }
49   [rank>=6] {
50     [zoom=7] { text-size: 12; }
51     [zoom=8] { text-size: 14; }
52     [zoom>=9] { text-size: 16; }
53   }
54 }
55
56 // State labels //
57 #place[class='state'][zoom>=4][zoom<=10] {
58   text-name: [name_en];
59   text-face-name: @sans;
60   text-placement: point;
61   text-fill: @fill2;
62   text-halo-fill: @land;
63   text-halo-radius: 1;
64   text-halo-rasterizer: fast;
65   text-size: 10;
66
67   [zoom>=5][zoom<=6] {
68     [area>10000] { text-size: 12; }
69     [area>50000] { text-size: 14; }
70     text-wrap-width: 40;
71   }
72   [zoom>=7][zoom<=8] {
73     text-size: 14;
74     [area>50000] { text-size: 16; text-character-spacing: 1; }
75     [area>100000] { text-size: 18; text-character-spacing: 3; }
76     text-wrap-width: 60;
77   }
78   [zoom>=9][zoom<=10] {
79     text-halo-radius: 2;
80     text-size: 16;
81     text-character-spacing: 2;
82     [area>50000] { text-size: 18; text-character-spacing: 2; }
83     text-wrap-width: 100;
84   }
85 }
86
87 // Display capital cities alongside stars.
88 #place::capitals[class='city'][capital=2][zoom<9] { 
89   shield-file: url("star.svg");
90   shield-name: '[name_en]';
91   shield-face-name: @sans;
92   shield-size: 12;
93   shield-fill: @text;
94   shield-halo-fill: @land;
95   shield-halo-radius: 1;
96   shield-unlock-image: true;
97   shield-wrap-width: 80;
98   shield-line-spacing: -2;
99
100   [zoom>=6] { shield-size: 16; } 
101 }
102
103 // Display low zoom cities alongside points.
104 #place[class='city'][rank<=4][zoom>=4][zoom<9] {
105   shield-name: '[name_en]';
106   shield-face-name: @sans;
107   shield-size: 12;
108   shield-fill: @text;
109   shield-halo-fill: @land;
110   shield-halo-radius: 1;
111   shield-unlock-image: true;
112   shield-file: url("dot.svg");
113   shield-wrap-width: 80;
114   shield-line-spacing: -2;
115
116   [zoom>=6] { shield-size: 14; }
117
118   // Emphasize major cities.
119   [rank<=6] { shield-size: 14; }
120   [zoom>=6][rank<=6] { shield-size: 16; } 
121 }
122
123 // Gradually replace shields with regular text labels.
124 #place[class='city'][rank<=4][zoom>=9] {
125   text-name: '[name_en]';
126   text-face-name: @sans;
127   text-size: 14;
128   text-fill: @text;
129   text-halo-fill: @land;
130   text-halo-radius: 1;
131   text-min-distance: 4;
132   text-wrap-width: 80;
133   [rank<=3] { 
134     text-fill: @text;
135     text-size: 20;
136   } 
137 }
138
139 // Mid priority place labels //
140 #place[class='town'][rank<=15][zoom>=10],
141 #place[class='village'][rank<=15][zoom>=12],
142 #place[class='hamlet'][rank<=15][zoom>=13],
143 #place[class='town'][rank<=15][zoom>=14],
144 #place[class='village'][rank<=15][zoom>=14],
145 #place[class='hamlet'][rank<=15][zoom>=14] { 
146   text-name: '[name_en]';
147   text-face-name: @sans;
148   text-size: 13;
149   text-fill: @text;
150   text-halo-fill: @land;
151   text-halo-radius: 2;
152   text-min-distance: 4;
153   text-wrap-width: 80;
154   [zoom>=12] { 
155     text-size: 16;
156     text-fill: @text;
157   }
158 }
159
160 // Low priority place labels //
161 #place[class='suburb'][rank<=15][zoom>=12],
162 #place[class='neighbourhood'][rank<=15][zoom>=13],
163 #place[class='suburb'][rank<=15][zoom>=14],
164 #place[class='neighbourhood'][rank<=15][zoom>=15] { 
165   text-name: @name;
166   text-face-name: @sans;
167   text-size: 14;
168   text-fill: @text;
169   text-halo-fill: @land;
170   text-halo-radius: 2;
171   text-min-distance: 4;
172   text-wrap-width: 60;
173 }
174
175 // Road labels
176 #road_label[len>2000][zoom>=12],
177 #road_label[len>1000][zoom>=15] { 
178   text-placement: line;
179   text-transform: uppercase;
180   text-face-name: @sans;
181   text-name: @name;
182   text-size: 9;
183   text-min-distance: 100;
184   text-halo-fill: @land;
185   text-halo-radius: 1;
186   text-fill: @text;
187   [zoom>=17] { text-size: 11;}
188 }
189
190
191 #water_label {
192   [zoom<=13],
193   [zoom>=14][area>500000],
194   [zoom>=16][area>10000],
195   [zoom>=17] {
196     text-name: @name;
197     text-face-name: @sans_bold;
198     text-fill: @text;
199     text-size: 12;
200     text-halo-fill: @water;
201     text-halo-radius: 1;
202     text-wrap-width: 60;
203     text-wrap-before: true;
204     text-avoid-edges: true;
205   }
206 }
207
208 #waterway[class='river'][name!=null][zoom>=13],
209 #waterway[class='canal'][name!=null][zoom>=14],
210 #waterway[class='stream'][name!=null][zoom>=15] { 
211   text-name: @name;
212   text-face-name: @sans_bold;
213   text-fill: @text;
214   text-min-distance: 60;
215   text-size: 10;
216   text-halo-fill: @water;
217   text-halo-radius: 1;
218   text-wrap-before: true;
219   text-avoid-edges: true;
220   text-placement: line;
221 }
222
223 // Place labels
224 #poi[class='park'][rank<=2],
225 #poi[class='airport'][rank<=2],
226 #poi[class='airfield'][rank<=2],
227 #poi[class='rail'][rank<=2],
228 #poi[class='school'][rank<=2],
229 #poi[class='hospital'][rank<=2] { 
230   text-face-name: @sans_bold;
231   text-allow-overlap: false;
232   text-name: @name;
233   text-size: 9;
234   text-line-spacing: -2;
235   text-min-distance: 50;
236   text-wrap-width: 60;
237   text-halo-fill: @land;
238   text-halo-radius: 1;
239   text-fill: @text;
240 }