-
Notifications
You must be signed in to change notification settings - Fork 2
/
morphology.yaml
executable file
·516 lines (460 loc) · 15.9 KB
/
morphology.yaml
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# Author: Geraldine Sarmiento
import:
# Styles
- styles/common.yaml
- styles/lines.yaml
- styles/polygons.yaml
global:
# colors
black_color: [0.000,0.000,0.000]
dark_color: [0.000,0.000,0.000]
mid_color: [0.800,0.800,0.800]
white_color: [1.00,1.00,1.00]
brown_color: [0.760,0.659,0.608]
beige_color: [1.000,0.903,0.800]
text_font_family: 'Cairo'
text_size: [[1,10px],[20,15px]]
text_case: lowercase
single_width: 1px
# Sign up for a Mapzen API key to enjoy higher rate limits
# https://mapzen.com/documentation/overview/#developer-accounts-and-api-keys
sdk_api_key: '3eqm2_bfTNGZ85ar20fVyA' # set this value to your Mapzen API key
# default order for basemap features
feature_order: function() { return feature.sort_rank || 0;; }
feature_order_down_1: function() { return feature.sort_rank - 1; }
sources:
mapzen:
type: MVT
url: https://tile.nextzen.org/tilezen/vector/v1/256/all/{z}/{x}/{y}.mvt
url_params:
api_key: global.sdk_api_key
rasters: [normals-elevation]
max_zoom: 16
normals-elevation:
type: Raster
url: https://tile.nextzen.org/tilezen/terrain/v1/256/normal/{z}/{x}/{y}.png
url_params:
api_key: global.sdk_api_key
max_zoom: 15
fonts:
Cairo:
- weight: normal # Regular
# url: https://fonts.gstatic.com/s/cairo/v1/ZA_4ooaF_Dfdn26t_IoQOaCWcynf_cDxXwCLxiixG1c.woff
url: fonts/ZA_4ooaF_Dfdn26t_IoQOaCWcynf_cDxXwCLxiixG1c.woff
cameras:
cam:
type: perspective
scene:
background:
color: global.white_color
layers:
earth:
data: { source: mapzen }
draw:
polygons:
style: grid
order: global.feature_order
earth-labels:
filter:
kind: true
draw:
text:
visible: false
water:
data: { source: mapzen, layer: water }
draw:
polygons:
style: grid
order: global.feature_order
color: global.white_color
river:
#river center lines, not boundaries for polygons
filter: { kind: [river,canal,stream,dam,ditch,drain], not: { is_tunnel: true } }
draw:
lines:
order: global.feature_order_down_1
color: global.white_color
width: [[11, 2px], [18, 10px]]
cap: round
intermittent:
filter:
any:
- intermittent: [true]
- kind: drain
draw:
lines:
color: global.white_color
canals:
filter: { kind: canal }
draw:
lines:
order: global.feature_order
water-boundary-ocean:
filter: { boundary: true, kind: ocean }
draw:
lines:
visible: true
order: global.feature_order
join: round
color: global.beige_color
width: [[1, 0px], [3, 1px]]
water-boundaries-not-ocean:
filter:
all:
- boundary: true
- not: { kind: ocean }
- $zoom: { min: 8 }
any:
# limit show smaller landuse areas to higher zooms
- { $zoom: [1], area: { min: 10000000000 } }
- { $zoom: [2], area: { min: 7000000000 } }
# some weird natural earth scale set transition
- { $zoom: [3], area: { min: 5000000000 } }
- { $zoom: [4], area: { min: 300000000 } }
- { $zoom: [5], area: { min: 50000000 } }
- { $zoom: [6], area: { min: 50000000 } }
- { $zoom: [7], area: { min: 50000000 } }
- { $zoom: [8], area: { min: 50000000 } }
- { $zoom: [9], area: { min: 15000000 } }
- { $zoom: [10], area: { min: 4000000 } }
- { $zoom: [11], area: { min: 1000000 } }
- { $zoom: [12], area: { min: 250000 } }
- { $zoom: [13], area: { min: 150000 } }
- { $zoom: [14], area: { min: 40000 } }
- { $zoom: { min: 15 } }
draw:
lines:
visible: true
order: global.feature_order
join: round
color: global.beige_color
width: [[1, 0px], [3, 1px]]
riverbank:
filter: { kind: riverbank }
draw:
lines:
visible: true
color: global.beige_color
width: [[1, 0px], [3, 1px]]
water-labels:
filter:
all:
- kind: true
- name: true
draw:
text:
visible: false
roads:
data: { source: mapzen, layer: roads }
draw:
lines:
order: global.feature_order
color: global.brown_color
width: global.single_width
outline:
order: 352
natural_earth_highways:
filter: { $zoom: { max: 8 } }
draw:
lines:
width: global.single_width
highway:
filter: { kind: highway }
link:
filter: { is_link: true } # on- and off-ramps, etc
draw:
lines:
color: global.black_color
width: global.single_width
major_road:
filter: { kind: major_road }
link:
filter: { is_link: true } # on- and off-ramps, etc
draw:
lines:
color: global.black_color
width: global.single_width
tertiary:
filter: { kind_detail: [tertiary, tertiary_link] }
link:
filter: { is_link: true } # on- and off-ramps, etc
draw:
lines:
color: global.black_color
width: global.single_width
railway:
filter: { kind: rail, not: { kind_detail: [subway,light_rail,tram] } }
draw:
lines:
color: global.black_color
width: global.single_width
order: global.feature_order
z18:
filter:
$zoom: { min: 18 }
draw:
lines:
style: dash-railway
service:
filter: { service: true }
draw:
lines:
color: global.black_color
width: global.single_width
airport-lines:
filter: { kind: aeroway, kind_detail: [runway,taxiway] }
draw:
lines:
color: global.black_color
cap: butt
width: [[10, 1px], [13, 3px], [15, 18px], [17, 60m]]
not-round:
filter: { $zoom: { min: 17 } }
draw:
lines:
cap: butt
taxiway:
filter: { kind_detail: taxiway }
draw:
lines:
color: global.black_color
width: [[11, 1px], [16, 2px], [18, 4m]]
winter_sport_pistes:
filter: { kind: piste }
draw:
lines:
order: 388 # We override the server value here because Eraser Map is also a special Ski Map
cap: round
join: round
color: global.black_color
width: [[13, 1px], [16, 1px], [16, 2px], [18, 1m]]
aerialway:
filter: { kind: aerialway }
draw:
lines:
color: global.black_color
width: [[12, 1px], [14, 2px], [14, 6px]]
gondola_cable_car:
filter: { kind_detail: [gondola, cable_car] }
draw:
lines:
color: global.black_color
width: [[12, 1px], [14, 2px], [14, 6px]]
chair_lift:
filter: { kind_detail: chair_lift }
draw:
lines:
color: global.black_color
racetracks:
filter: { kind_detail: raceway }
draw:
lines:
cap: round
join: round
color: global.black_color
width: global.single_width
piers:
filter: { kind: path, kind_detail: pier }
draw:
lines:
color: global.black_color
width: global.single_width
ferry:
filter: { kind: ferry }
draw:
lines:
visible: false
transit:
data: { source: mapzen, layer: transit }
draw:
lines:
color: global.black_color
order: 350
subway:
filter:
kind: subway
draw:
lines:
width: 1px
other:
filter:
kind: [lightrail, tram]
draw:
lines:
width: 1px
buildings:
data: { source: mapzen, layer: buildings }
draw:
lines:
visible: false
order: global.feature_order
all-buildings:
filter:
any:
# - not: { location: underground }
- function() { return feature.min_zoom <= ($zoom-3) }
- area: true
draw:
lines:
color: global.black_color
width: [[13, 0.35px], [17, 0.35px], [17, 1px]]
visible: true
polygons:
color: global.white_color
order: global.feature_order
building-labels:
filter:
name: true
draw:
text:
visible: false
platforms:
data: { source: mapzen, layer: transit }
filter: { kind: platform }
polygon_geom:
filter: { $geometry: polygon }
draw:
lines:
color: global.black_color
width: 1px
order: global.feature_order
landuse:
data: { source: mapzen }
draw:
polygons:
order: global.feature_order
visible: false
lines:
order: global.feature_order
landuse-labels:
filter:
all:
- label_placement: true
- name: true
- kind: true
draw:
text:
visible: false
bridges:
filter:
kind: bridge
draw:
polygons:
visible: true
style: dash-terrain
color: global.black_color
green:
filter:
any:
- kind: [garden, park, national_park, battlefield, protected_area, nature_reserve, forest, natural_forest, natural_wood, natural_park, meadow, wood]
- operator: [ "United States National Park Service", "United States Forest Service" ]
- protect_class: ['2','3','5','6']
draw:
polygons:
visible: true
style: dash-terrain
color: global.black_color
parking:
filter:
kind: parking
draw:
polygons:
visible: true
style: parking
color: global.brown_color
runway:
filter:
kind: runway
draw:
polygons:
visible: true
color: global.black_color
ski:
filter:
kind: winter_sports
draw:
polygons:
style: dash-terrain
color: global.black_color
order: 18
visible: true
styles:
dash-terrain:
base: polygons
mix: [functions-zoom, elevation-dash]
shaders:
defines:
ZOOM_START: 14.
ZOOM_END: 18.
ZOOM_IN: .0
ZOOM_OUT: 1.
DASH_COLOR: vec3(1.000,1.000,1.000)
DASH_BACKGROUND_COLOR: vec3(0.200,0.200,0.200)
DASH_SCALE: 12.
DASH_TYPE: fill
DASH_TILE_STYLE: tile
DASH_DIR: vec3(-0.600,-0.420,0.560)
NORMAL_TEXTURE_INDEX: 0
DASH_MIN_SIZE: .9
DASH_MAX_SIZE: 1.
DASH_SIZE: shade
parking:
base: polygons
mix: [functions-zoom, polygons-diagonal-dash]
shaders:
defines:
ZOOM_START: 12.
ZOOM_END: 18.
ZOOM_IN: .0
ZOOM_OUT: 1.
DASH_SCALE: 15.
DASH_SIZE: 0.7
DASH_COLOR: vec3(1.00,1.00,1.00)
DASH_TILE_STYLE: tile
DASH_TYPE: fill
dash-railway:
base: lines
dash: [1, 0.15]
dash_background_color: global.white_color
tools-tilecoords:
shaders:
blocks:
global: |
// Varying to be added to both vertex and fragment shaders
varying vec2 v_pos;
#ifdef TANGRAM_FRAGMENT_SHADER
vec2 TileCoords() {
return fract(v_pos);
}
#endif
position: |
v_pos = modelPosition().xy;
tools-grid:
mix: tools-tilecoords
shaders:
blocks:
global: |
#ifdef TANGRAM_FRAGMENT_SHADER
bool grid(vec2 st, float res, float press) {
vec2 grid = fract(st * res);
return (grid.x < res * press) || (grid.y < res * press);
}
float TileGrid(float res) {
vec2 st = TileCoords() * 100. * res;
float pct = 0.0;
float press = 0.4 + (1.0 - fract(u_map_position.z)) * 0.1;
if (grid(st, 0.1, press)) { pct += 0.15; }
return pct;
}
float TileGrid() {
return mix(TileGrid(1.), TileGrid(2.), fract(u_map_position.z));
}
#endif
grid:
base: polygons
mix: [tools-grid]
shaders:
blocks:
filter: |
color.rgb = vec3(1.00,1.00,1.00);
color.rgb = mix(color.rgb, vec3(0.757,0.659,0.608), TileGrid());