forked from gravitystorm/openstreetmap-carto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.mss
299 lines (287 loc) · 7.72 KB
/
admin.mss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
@admin-boundaries: #ac46ac;
@admin-simplify: 4;
@admin-simplify-algorithm: visvalingam-whyatt;
/* For performance reasons, the admin border layers are split into three groups
for low, middle and high zoom levels.
For each zoomlevel, all borders come from a single attachment, to handle
overlapping borders correctly.
*/
#admin-low-zoom[zoom < 11],
#admin-mid-zoom[zoom >= 11][zoom < 13],
#admin-high-zoom[zoom >= 13] {
[admin_level = '2'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 1.2;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 1.2;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
[zoom >= 5] {
background/line-width: 1.5;
line-width: 1.5;
}
[zoom >= 6] {
background/line-width: 1.8;
line-width: 1.8;
}
[zoom >= 7] {
background/line-width: 2;
line-width: 2;
}
[zoom >= 10] {
background/line-width: 6;
line-width: 6;
}
}
[admin_level = '3'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 0.6;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 0.6;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
[zoom >= 7] {
background/line-width: 1.2;
line-width: 1.2;
}
[zoom >= 10] {
background/line-width: 4;
line-width: 4;
line-dasharray: 4,2;
line-clip: false;
}
}
[admin_level = '4'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 0.4;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-color: @admin-boundaries;
line-join: bevel;
line-width: 0.4;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-clip: false;
}
[zoom >= 5] {
background/line-width: 0.5;
line-width: 0.5;
}
[zoom >= 6] {
background/line-width: 0.6;
line-width: 0.6;
}
[zoom >= 7] {
background/line-width: 1;
line-dasharray: 4,3;
line-width: 1;
}
[zoom >= 9] {
background/line-width: 1.8;
line-width: 1.8;
}
[zoom >= 10] {
background/line-width: 2.5;
line-width: 2.5;
}
[zoom >= 12] {
background/line-width: 3;
line-width: 3;
}
}
/*
The following code prevents admin boundaries from being rendered on top of
each other. Comp-op works on the entire attachment, not on the individual
border. Therefore, this code generates an attachment containing a set of
@admin-boundaries/white dashed lines (of which only the top one is visible),
and with `comp-op: darken` the white part is ignored, while the
@admin-boundaries colored part is rendered (as long as the background is not
darker than @admin-boundaries).
The SQL has `ORDER BY admin_level`, so the boundary with the lowest
admin_level is rendered on top, and therefore the only visible boundary.
*/
opacity: 0.4;
comp-op: darken;
}
#admin-mid-zoom[zoom >= 11][zoom < 13],
#admin-high-zoom[zoom >= 13] {
[admin_level = '5'][zoom >= 11] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 2;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 6,3,2,3,2,3;
line-clip: false;
}
[admin_level = '6'][zoom >= 11] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 2;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 6,3,2,3;
line-clip: false;
}
[admin_level = '7'],
[admin_level = '8'] {
[zoom >= 12] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 1.5;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 1.5;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 5,2;
line-clip: false;
}
}
opacity: 0.5;
comp-op: darken;
}
#admin-high-zoom[zoom >= 13] {
[admin_level = '9'],
[admin_level = '10'] {
[zoom >= 13] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 2;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 2,3;
line-clip: false;
}
}
opacity: 0.5;
comp-op: darken;
}
#admin-text[zoom >= 16] {
text-name: "[name]";
text-face-name: @book-fonts;
text-fill: @admin-boundaries;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-clip: true;
text-vertical-alignment: middle;
text-dy: -10;
}
#nature-reserve-text[zoom >= 13][way_pixels > 192000] {
text-name: "[name]";
text-face-name: @book-fonts;
text-fill: green;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-clip: true;
text-vertical-alignment: middle;
text-dy: -10;
}
#nature-reserve-boundaries {
[way_pixels > 3000][zoom >= 8] {
[zoom < 10] {
::fill {
opacity: 0.05;
polygon-fill: green;
}
}
a/line-width: 1;
a/line-offset: -0.5;
a/line-color: green;
a/line-opacity: 0.15;
a/line-join: round;
a/line-cap: round;
b/line-width: 2;
b/line-offset: -1;
b/line-color: green;
b/line-opacity: 0.15;
b/line-join: round;
b/line-cap: round;
[zoom >= 10] {
a/line-width: 2;
a/line-offset: -1;
b/line-width: 4;
b/line-offset: -2;
}
[zoom >= 14] {
b/line-width: 6;
b/line-offset: -3;
}
}
}
#reservation-text[zoom >= 13][way_pixels > 192000] {
text-name: "[name]";
text-face-name: @book-fonts;
text-fill: brown;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-clip: true;
text-vertical-alignment: middle;
text-dy: -10;
}
#reservation-boundaries {
[way_pixels > 3000][zoom >= 8] {
[zoom < 10] {
::fill {
opacity: 0.05;
polygon-fill: brown;
}
}
a/line-width: 1;
a/line-offset: -0.5;
a/line-color: brown;
a/line-opacity: 0.15;
a/line-join: round;
a/line-cap: round;
b/line-width: 2;
b/line-offset: -1;
b/line-color: brown;
b/line-opacity: 0.15;
b/line-join: round;
b/line-cap: round;
[zoom >= 10] {
a/line-width: 2;
a/line-offset: -1;
b/line-width: 4;
b/line-offset: -2;
}
[zoom >= 14] {
b/line-width: 6;
b/line-offset: -3;
}
}
}