-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.mss
305 lines (255 loc) · 7.15 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
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
300
301
302
303
/**********************************************************
'Geography Class'
=================
Note that this map doing some rather complex things thus
slowish rendering should not be surprising. A pre-rendered
demo is online at <http://tiles.mapbox.com/mapbox/map/geography-class>
Hover Interaction & Embedded Data
---------------------------------
When you move your cursor around the map you should see the
name and flag of the country you are hovering over appear
in the top right. You can pull any attributes from a data
layer to form tooltips like this. Here, we are pulling a
text attribute and a base64-encoded PNG image from a GeoJSON
file of country polygons. Click on the settings wrench at the
top right, then on the 'Tooltips' tab to see how this was
set up.
Layers overview
---------------
### country-interaction [countries_interaction.geojson]
This is an invisible layer used to add hover interactivity
to the map. It is derived fro the 1:50M resolution Natural
Earth dataset. GeoJSON was chosen over shapefile in this
instance to allow for the inclusion of base64-encoded PNG
data (not possible in a DBF due to the limit of
255 bytes per cell).
### paper [world_extent_merc.geojson]
The shapefile is a rectangle extending to the bounds of the
map filled with a repeating transparent pattern to give the
map a folded paper texture.
### cities [populated_places_by_pop.zip]
This is essentially Natural Earth's Populated Places
shapefile, but the elements have been reordered such by
population (descending). This is to take advantage of the
fact that Mapnik will give priority to elements stored first
in the datasource. Using various classification attributes
in the shapefile, only certain cities will be shown at
certain zoom levels.
### country-name [country-labels.zip]
Labeled points of the world's country names. Derived from
Natural Earth Data but hand-tweaked by MapBox.
### geo-lines [geographic-lines.zip]
Important lines such as the equator, Arctic and Antarctic
circles, and the international date line.
### admin-0-line-land [admin-0-line-land.zip]
These are international borders that occur over land or
lakes. International maritime borders are a separate layer.
### lakes [lakes.zip]
The world's lakes. The style is designed such that smaller
lakes only appear as you zoom in.
### rivers [rivers_lake_centerlines_scale_ranks.zip]
### country [admin_0_countries.zip]
Countries - the rainbow.mss stylesheet colors each of these
individually.
### land-glow [admin_0_countries.zip]
A copy of the country layer providing the shadow/glow around
the continents.
***********************************************************************/
@water: #ddeeff;
@land: #ffffdd;
@line: #226688;
/* Water bodies */
Map {
background-color: yellow;
}
/* Required to 'activate' the polygons for interactivity */
#country-interaction {
polygon-opacity:0;
}
#lakes[ScaleRank<3][zoom=3],
#lakes[ScaleRank<4][zoom=4],
#lakes[ScaleRank<5][zoom=5],
#lakes[ScaleRank<6][zoom>=6] {
polygon-fill:@water;
line-color:darken(@water, 20%);
line-width:0.3;
}
#lakes[ScaleRank<3][zoom=3] {
line-width:0.4;
}
#lakes[ScaleRank<4][zoom=4] {
line-width:0.5;
}
#lakes[ScaleRank<5][zoom=5] {
line-width:0.6;
}
#lakes[ScaleRank<6][zoom>=6] {
line-width:0.8;
}
#rivers[SCALERANK=1][zoom>=3],
#rivers[SCALERANK=2][zoom>=4],
#rivers[SCALERANK=3][zoom>=5],
#rivers[SCALERANK=4][zoom>=5],
#rivers[SCALERANK=5][zoom>=6],
#rivers[SCALERANK=6][zoom>=6],
#rivers[SCALERANK=7][zoom>=7],
#rivers[SCALERANK=8][zoom>=7],
#rivers[SCALERANK=9][zoom>=8] {
line-color:@line * 1.5;
line-join:round;
}
#rivers[SCALERANK=1][zoom=3],
#rivers[SCALERANK=2][zoom=4],
#rivers[SCALERANK=3][zoom=5],
#rivers[SCALERANK=4][zoom=5],
#rivers[SCALERANK=5][zoom=6],
#rivers[SCALERANK=6][zoom=6],
#rivers[SCALERANK=7][zoom=7],
#rivers[SCALERANK=8][zoom=7],
#rivers[SCALERANK=9][zoom=8] {
line-width:0.2;
line-opacity:0.4;
}
#rivers[SCALERANK=1][zoom=4],
#rivers[SCALERANK=2][zoom=5],
#rivers[SCALERANK=3][zoom=6],
#rivers[SCALERANK=4][zoom=6],
#rivers[SCALERANK=5][zoom=7],
#rivers[SCALERANK=6][zoom=7],
#rivers[SCALERANK=7][zoom=8],
#rivers[SCALERANK=8][zoom=8],
#rivers[SCALERANK=9][zoom=9] {
line-width:0.4;
line-opacity:0.6;
}
#rivers[SCALERANK=1][zoom=5],
#rivers[SCALERANK=2][zoom=6],
#rivers[SCALERANK=3][zoom=7],
#rivers[SCALERANK=4][zoom=7],
#rivers[SCALERANK=5][zoom=8],
#rivers[SCALERANK=6][zoom=8],
#rivers[SCALERANK=7][zoom=9],
#rivers[SCALERANK=8][zoom=9],
#rivers[SCALERANK=9][zoom=10] {
line-width:0.6;
line-opacity:0.8;
}
#rivers[SCALERANK=1][zoom=6],
#rivers[SCALERANK=2][zoom=7],
#rivers[SCALERANK=3][zoom=8],
#rivers[SCALERANK=4][zoom=8],
#rivers[SCALERANK=5][zoom=9],
#rivers[SCALERANK=6][zoom=9],
#rivers[SCALERANK=7][zoom=10],
#rivers[SCALERANK=8][zoom=10],
#rivers[SCALERANK=9][zoom=11] {
line-width:0.8;
line-opacity:1;
}
#glacier {
polygon-fill:#fff;
polygon-opacity:0.5;
}
/* Useful/significant lines */
#geo-lines[ScaleRank<10] {
line-color:@line;
line-dasharray:6,2;
[zoom=0] { line-width:0.2; }
[zoom=1] { line-width:0.4; }
[zoom=2] { line-width:0.6; }
[zoom=3] { line-width:0.8; }
[zoom>3] { line-width:1; }
}
.border.country[zoom>1],
.border.disputed[zoom>2] {
line-width:1;
line-color:#fff;
line-join:round;
.country[FeatureCla='Disputed (please verify)'] {
[zoom=3] { line-dasharray:4,1; }
[zoom=4] { line-dasharray:5,2; }
[zoom=5] { line-dasharray:6,2; }
[zoom=6] { line-dasharray:8,3; }
[zoom>6] { line-dasharray:10,3; }
}
.disputed[FeatureCla='Breakaway'] {
[zoom=3] { line-dasharray: 3,2; }
[zoom=4] { line-dasharray: 4,4; }
[zoom=5] { line-dasharray: 5,5; }
[zoom=6] { line-dasharray: 6,6; }
[zoom>6] { line-dasharray: 8,8; }
}
.disputed[FeatureCla='Claim boundary'] {
line-dasharray: 1,3;
[zoom>6] { line-dasharray: 2,4; }
}
.country[FeatureCla='Indefinite (please verify)'] {
line-dasharray: 6,1;
}
}
#state[ADM0_A3="USA"],
#state[ADM0_A3="CAN"],
#state[ADM0_A3="AUS"] {
[zoom>3] {
line-color:@line;
line-opacity:0.25;
line-width:1.2;
line-dasharray:6,2,2,2;
}
}
/* Transparent PNG overlay for paper texture */
/*#paper[zoom<2] {
polygon-pattern-file:url(textures/paperfolds_256.png);
}
#paper[zoom>1] {
polygon-pattern-file:url(textures/paperfolds_512.png);
}
*/
/*#pop {
marker-width:50;
marker-fill:#f45;
marker-line-color:#813;
marker-allow-overlap:true;
marker-ignore-placement:true;
marker-comp-op:dst-out;
}*/
#bath[DEPTH>0] {
polygon-fill: #4F5157;
polygon-comp-op: overlay;
}
#ocean { polygon-fill: @water; }
#tint-bands {
opacity: 0.5;
image-filters: agg-stack-blur(30,30);
/* comp-op:hard-light;*/
line-join: round;
[zoom=2] { line-width: 3; }
[zoom=3] { line-width: 5; }
[zoom=4] { line-width: 8; }
[zoom=5] { line-width: 12; }
[zoom=6] { line-width: 17; }
[zoom>6] { line-width: 23; }
}
#terrain {
raster-opacity:1;
raster-scaling: bilinear;
}
#slope {
raster-opacity:1;
raster-comp-op:multiply;
raster-scaling: bilinear;
}
#country {
polygon-fill:red;
}
/*#circle {
line-color:#594;
line-width:0.5;
polygon-opacity:1;
polygon-fill:#FF5010;
polygon-comp-op:dst-out;
}*/
#polygon {
polygon-fill:green;
polygon-comp-op:dst-out;
}