-
Notifications
You must be signed in to change notification settings - Fork 3
/
style.mss
249 lines (229 loc) · 6.76 KB
/
style.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
// ---------------------------------------------------------------------
// Common Colors
// You don't need to set up @variables for every color, but it's a good
// idea for colors you might be using in multiple places or as a base
// color for a variety of tints.
// Eg. @water is used in the #water and #waterway layers directly, but
// also in the #water_label and #waterway_label layers inside a color
// manipulation function to get a darker shade of the same hue.
@land: #f8f4f0;
@water: #a0c8f0;
@water_dark: #185869; // for the inline/shadow
@crop: #eeeed4;
@grass: #e7ebd1;
@scrub: #e0e8cd;
@wood: #d4e2c6;
@snow: #f4f8ff;
@rock: #ddd;
@sand: mix(#ffd,@land,33%);
// These colors need to take `comp-op:multiply` into account:
@cemetery: #edf4ed;
@pitch: fadeout(#fff,50%);
@park: #edf9e4;
@piste: mix(blue,@land,5);
@school: #fbf6ff;
@hospital: #fff0f0;
@builtup: #f6faff;
Map {
background-color:@land;
}
// ---------------------------------------------------------------------
// Political boundaries
#admin,#boundaries-claimed["@relations"=~'.*"claimed_by":[ ]*"IN".*'] {
opacity: 0.5;
line-join: round;
line-color: #446;
[maritime=1] {
// downplay boundaries that are over water
line-color: @water;
}
// Countries
[admin_level=2],#boundaries-claimed {
line-width: 0.8;
line-cap: round;
[zoom>=4] { line-width: 1.2; }
[zoom>=6] { line-width: 2; }
[zoom>=8] { line-width: 4; }
[disputed=1] { line-dasharray: 4,4; line-opacity:0.5}
}
// States / Provices / Subregions
[admin_level>=3] {
line-width: 0.3;
line-dasharray: 10,3,3,3;
[zoom>=6] { line-width: 1; }
[zoom>=8] { line-width: 1.5; }
[zoom>=12] { line-width: 2; }
}
}
#boundaries-disputed["disputed_by"=~'.*IN.*'] {
opacity: 1;
line-join: round;
line-color: @land;
[maritime=1] {
// downplay boundaries that are over water
line-color: @water;
}
// Countries
[admin_level=2] {
line-width: 1;
line-cap: round;
[zoom>=4] { line-width: 1.5; }
[zoom>=6] { line-width: 3; }
[zoom>=8] { line-width: 5; }
}
}
// ---------------------------------------------------------------------
// Water Features
#water {
polygon-fill: @water - #111;
// Map tiles are 256 pixels by 256 pixels wide, so the height
// and width of tiling pattern images must be factors of 256.
polygon-pattern-file: url(pattern/wave.png);
[zoom<=5] {
// Below zoom level 5 we use Natural Earth data for water,
// which has more obvious seams that need to be hidden.
polygon-gamma: 0.4;
}
::blur {
// This attachment creates a shadow effect by creating a
// light overlay that is offset slightly south. It also
// create a slight highlight of the land along the
// southern edge of any water body.
polygon-fill: #f0f0ff;
comp-op: soft-light;
image-filters: agg-stack-blur(1,1);
polygon-geometry-transform: translate(0,1);
polygon-clip: false;
}
}
#waterway {
line-color: @water * 0.9;
line-cap: round;
line-width: 0.5;
[class='river'] {
[zoom>=12] { line-width: 1; }
[zoom>=14] { line-width: 2; }
[zoom>=16] { line-width: 3; }
}
[class='stream'],
[class='stream_intermittent'],
[class='canal'] {
[zoom>=14] { line-width: 1; }
[zoom>=16] { line-width: 2; }
[zoom>=18] { line-width: 3; }
}
[class='stream_intermittent'] { line-dasharray: 6,2,2,2; }
}
// Landcover
#landcover {
polygon-opacity: 0.5;
[class='wood'] { polygon-fill: @wood; }
[class='scrub'] { polygon-fill: @scrub; }
[class='grass'] { polygon-fill: @grass; }
[class='crop'] { polygon-fill: @crop; }
[class='snow'] { polygon-fill: @snow; }
// fade out stronger classes at high zooms,
// let more detailed OSM data take over a bit:
[class='wood'][zoom>=14],
[class='scrub'][zoom>=15],
[class='grass'][zoom>=16] {
[zoom>=15] { polygon-opacity: 0.5; }
[zoom>=16] { polygon-opacity: 0.4; }
[zoom>=17] { polygon-opacity: 0.2; }
}
}
// ---------------------------------------------------------------------
// Landuse areas
#landuse {
// Land-use and land-cover are not well-separated concepts in
// OpenStreetMap, so this layer includes both. The 'class' field
// is a highly opinionated simplification of the myriad LULC
// tag combinations into a limited set of general classes.
[class='park'] { polygon-fill: #d8e8c8; polygon-opacity: 0.5;}
[class='cemetery'] { polygon-fill: mix(#d8e8c8, #ddd, 25%); }
[class='hospital'] { polygon-fill: #fde; }
[class='school'] { polygon-fill: #f0e8f8; }
::overlay {
// Landuse classes look better as a transparent overlay.
opacity: 0.05;
[class='wood'] { polygon-fill: #6a4; polygon-gamma: 0.5; }
}
}
// Hillshading //
#hillshade {
::0[zoom<=13],
::1[zoom=14],
::2[zoom>=15][zoom<=16],
::3[zoom>=17][zoom<=18],
::4[zoom>=19] {
comp-op: hard-light;
polygon-clip: false;
image-filters-inflate: true;
[class='shadow'] {
polygon-fill: #000;
polygon-opacity: 0.1;
[zoom>=15][zoom<=16] { polygon-opacity: 0.075; }
[zoom>=17][zoom<=18] { polygon-opacity: 0.05; }
[zoom>=18] { polygon-opacity: 0.025; }
}
[class='highlight'] {
polygon-fill: #fff;
polygon-opacity: 0.2;
[zoom>=15][zoom<=16] { polygon-opacity: 0.3; }
[zoom>=17][zoom<=18] { polygon-opacity: 0.2; }
[zoom>=18] { polygon-opacity: 0.1; }
}
}
::1 { image-filters: agg-stack-blur(2,2); }
::2 { image-filters: agg-stack-blur(4,4); }
::3 { image-filters: agg-stack-blur(20,20); }
::4 { image-filters: agg-stack-blur(20,20); }
}
// ---------------------------------------------------------------------
// Buildings
#building [zoom<=17]{
// At zoom level 13, only large buildings are included in the
// vector tiles. At zoom level 14+, all buildings are included.
polygon-fill: #aaa;
opacity: 0.25;
}
// Seperate attachments are used to draw buildings with depth
// to make them more prominent at high zoom levels
#building [zoom>=16]{
::wall { polygon-fill:#ccc; }
::roof {
polygon-fill: #eee;
polygon-geometry-transform:translate(-1,-1);
polygon-clip:false;
line-width: 0.25;
line-color: mix(@land, #000, 85);
line-geometry-transform:translate(-1,-1);
line-clip:false;
[zoom>=17] {
line-width:0.5;
}
[zoom>=18] {
polygon-geometry-transform:translate(-1,-2);
line-geometry-transform:translate(-1,-2);
line-width:0.75;
}
}
}
// ---------------------------------------------------------------------
// Aeroways
#aeroway [zoom>=12] {
['mapnik::geometry_type'=2] {
line-color: @land * 0.96;
[type='runway'] { line-width: 5; }
[type='taxiway'] {
line-width: 1;
[zoom>=15] { line-width: 2; }
}
}
['mapnik::geometry_type'=3] {
polygon-fill: @land * 0.96;
[type='apron'] {
polygon-fill: @land * 0.98;
}
}
}