-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylus-osm.yaml
1680 lines (1586 loc) · 67.2 KB
/
stylus-osm.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
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# adaption of tangram default scene.yaml to Stylus Labs vector tile schema
# - OpenMapTiles schema omits some important information, unnecessarily groups OSM tags, uses too many layers
# resulting in larger tiles due to duplicated data, etc.; Shortbread schema has even more layers
# - don't seem to be many services using mapzen schema (except HERE)
# - mapzen walkabout style is nice, but way too big - nearly 10K lines
# - no one uses mapbox schema except mapbox?
# - trying to create scene file that works for multiple schema isn't practical (either w/ globals or stacking yaml files)
global:
#camera_settings: { type: isometric, axis: [-.2, .2] }
camera_settings: { type: perspective }
# globals required for hillshading
earth_style: polygons
earth_color: '#E0E0E0' #[.97, .955, .94] #'#f0ebeb'
earth_order: 599 # should be above all other polygons
#elevation_sources: []
marker_font: Open Sans
# Open Sans looks very good, especially the italic style
primary_font: Open Sans
# HSL: 0 (== 360) is red, 120 is green, 240 is blue
color:
#background: [.97, .955, .94] #'#f0ebeb'
#earth: white
default_label: black
default_halo: white
landuse: honeydew
parks: hsl(135, 33%, 81%) #'#bddec5'
forest: hsl(135, 33%, 75%) # darker
scrub: hsl(135, 33%, 87%) # lighter
farmland: hsl(105, 33%, 81%) # decr hue -> more yellow
grass: hsl(120, 33%, 75%)
wetland: hsl(150, 33%, 81%) # incr hue -> more blue
park_detail: hsl(134.5, 21%, 72%)
golf: hsl(124, 83%, 88%) #'#C8FACC'
industry: '#C0CDCD'
retail: '#FEF0D0'
civic: '#D9CFC3'
water: '#9dc3de'
water_name: "#51909c"
water_halo: "#e2eef0"
beach: '#FEEFC3' #[1.000,0.953,0.900]
ice: white
rock: '#F5F0E5'
road: '#fff'
casing_16: '#999'
casing_18: '#aaa'
tunnel: '#E3E3E3'
tunnel_casing: '#A0A0A0'
oneway_arrow: '#888'
motorway: '#FDE293'
motorway_tunnel: '#CDB775'
motorway_link: '#FDE293' #'#aaa'
motorway_muted: '#eee'
path: '#fff'
unpaved_trail: '#B06000'
bike_lane: '#008800'
bike_path: '#004C00'
bike_unpaved: '#306000'
transit: '#EB322F'
rail: '#96ABB2' #[0.588,0.671,0.698]
rail_tunnel: '#A9C3CB'
pier: '#F2EFE9' #[0.993,0.993,0.993]
breakwater: '#AAAAAA'
ferry: '#8db3ce'
runway_13: '#C7CADC' #'#FFE4B5'
taxiway: '#BCBCCC'
airport: '#E8EAEF' #'#ddd'
airport_name: '#487585'
shield: '#FFFFFF'
motorway_shield: '#FFDC36'
road_name: '#666'
road_halo: white
ferry_name: '#8db3ce'
ferry_halo: white
border: '#888' #wheat
border_country: '#666' #[0.824, 0.651, 0.329, 1.00]
city_point: white
city_point_halo: black
place_name: rgba(0, 0, 0, 0.8)
place_halo: white
hood_name: rgba(136, 45, 23, 0.9)
hood_halo: white
bldg: [.83, .83, .83]
bldg_3d: [.83, .83, .83, 0.5]
bldg_3d_line: [.75, .75, .73, 0.5]
park_name: darkgreen
park_halo: white
housenumber: [0.30,0.30,0.30] #"#d2b17d"
housenumber_halo: [0.913,0.925,0.933] #rgba(38,38,38,0.15)
aerialway: '#555'
aerialway_name: black
aerialway_halo: white
piste_name: black
piste_halo: white
piste:
novice: '#2FB439' #[0.367,0.750,0.622]
easy: '#2F76B4' #[0.367,0.750,0.622]
intermediate: '#F54141' #[0.420,0.678,0.863]
advanced: '#2E2E2E' #[0.450,0.450,0.450]
expert: '#2E2E2E' #[0.450,0.450,0.450]
freeride: '#FFA500'
mtb:
"0": '#2FB439'
"1": '#2F76B4'
"2": '#F54141'
"3": '#2E2E2E'
"4": '#2E2E2E'
"5": '#FFA500'
#urban_7: lightgrey
#urban_9: [.88, .88, .88]
#motorway_5: '#F89595'
#motorway_7: '#D16768'
#runway_16: '#fff'
#runway_casing: orange
# z-order for polygons (<100) and lines (higher z-order draws over lower); order > 1000 is reserved by mapsapp
# ... now offset by 500 because we need depth range for raster tile proxy levels
order:
landuse: 510
parks: 512
park_detail: 514
golf: 516
airport: 518
landcover: 520
waterway: 622
water: 624
pier: 626
bldg: 630
transportation_casing: 638
transportation: 640
rail_sleepers: 640
rail: 645
taxiway: 650
path: 650
runway: 655
minor_road: 660
piste: 665
major_road: 670
motorway: 680
bridge: 700
bicycle: 720
transit: 750
aerialway: 760
border: 790
bldg_3d_line: 799
bldg_3d: 800
piste_color_fn: function() { return global.color.piste[feature.difficulty] || 'white'; }
piste_symbols: { easy: '●', intermediate: '■', advanced: '◆', expert: '◆◆' }
piste_name_fn: |
function() {
const sym = global.piste_symbols[feature.difficulty] || '';
return feature.name ? (sym + ' ' + feature.name) : sym;
}
mtb_color_fn: function() { return global.color.mtb[feature.mtb_scale] || global.color.bike_unpaved; }
transit_color_fn: |
function() {
const c = feature.color;
return (!c || c == "white" || c == "#ffffff" || c == "#FFFFFF") ? global.color.transit : c;
}
show_name_en: true
names_one_line: ['name_en', 'name']
names_one_line_fn: |
function() { return global.show_name_en && feature.name_en ? feature.name_en : feature.name; }
names_two_lines: |
function() { return global.show_name_en && feature.name_en && feature.name ? feature.name_en + "\n" + feature.name : feature.name; }
shuffle_seed: 58987
# priorities for colliding objects (points and text; lower value wins) - float in tangram (docs incorrectly say integer)
# - priorities are now multiplied by 65536, so we just need priority*65536 to be an integer
priority:
boundary: 0
continent: 6
district_CN: 9.5
neighborhood: 15
park: 20
golf: 21
cemetery: 22
forest: 23
peak: 30
# road labels
oneway_arrow: 23
motorway_ref: 24
highway_ref: 25
road_primary: 30
road_secondary: 40
motorway_name: 45 # shield generally more important than name for motorway
road_tertiary: 50
road_minor: 60
# transit line labels
transit_ref: 19
transit_ref_tram: 24
transit_ref_bus: 29
# transit stops
bus_stop: 20 # bus stops only shown when show_transit = true
station_transit: 5 # transit station priority when show_transit = true
station_default: 29 # transit station priority when show_transit = false
station_tram: 6 # only shown when show_transit = true
# we want to show every traffic light if showing any
traffic_light: 4
# housenumbers only shown at high zoom and unlikely to collide
housenumber: 350
# POIs - use osm_id to provide well-defined ordering so POIs don't get replaced by nearby ones when zooming in
# - looks like it's faster to let Tangram convert string to number instead of using Number() in JS fn
poi_default: function() { return 101 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_viewpoint: function() { return 31 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_toilet: function() { return 32 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_university: function() { return 33 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_grocery: function() { return 34 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_culture: function() { return 41 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_restaurant: function() { return 43 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_cafe: function() { return 44 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_convenience: function() { return 51 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_school: function() { return 52 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_religion: function() { return 101 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
poi_parking: function() { return 102 + ((global.shuffle_seed ^ Number(feature.osm_id)) & 65535)/65536; }
# cities, states, countries
place: { country: 7, state: 8, province: 8, city: 9, town: 10, village: 11, suburb: 12, hamlet: 13 }
place_fn: |
function() {
return (global.priority.place[feature.place] || 14) + Math.round(Math.sqrt(feature.population || 1))/65536;
//return (global.priority.place[feature.place] || 14) + 100.0/(100 + (feature.population || 1));
}
# bounds for country-specific filters
japan_bounds: # covers main islands, does not include Okinawa, etc
- { $latitude: {min: 31, max: 41.8}, $longitude: {min: 129.6, max: 142.3} }
- { $latitude: {min: 41.1, max: 45.8}, $longitude: {min: 139.2, max: 146.3} }
# if we want to easily add on top of various raster sources, have MapsSources set global._vector_order to
# layer number for vector source
show_polygons: true # function() { return !(global._vector_order > 0); }
show_bike: false
show_transit: false
show_trails: false
show_parking: false
show_motorways: true
application:
gui_variables:
show_polygons: { label: Polygons }
show_bike: { label: Bike }
show_trails: { label: Hike }
show_transit: { label: Transit }
show_parking: { label: Parking }
show_motorways: { label: Motorways }
# specify fields indexed for search and filter to select indexed features
search_data:
- layer: poi
fields: [name, name_en, amenity, leisure, shop, sport, tourism, cuisine]
filter:
- name: true
not:
- highway: [bus_stop]
- amenity: [drinking_water, toilets]
- layer: place
fields: [name, name_en]
filter: { name: true }
sources:
osm:
type: MVT
cache: stylus-osm
attribution: |
© OpenStreetMap contributors
max_zoom: 14
rasters: global.elevation_sources
fonts:
Open Sans:
- weight: 400
url: ../shared/fonts/OpenSans-Regular.ttf
- weight: 400
style: italic
url: ../shared/fonts/OpenSans-Italic.ttf
- weight: 600
url: ../shared/fonts/OpenSans-SemiBold.ttf
scene:
background:
color: global.earth_color #global.color.background
cameras:
camera1: global.camera_settings
#lights:
# light1: { type: directional, origin: world, direction: [1, 1, -1], diffuse: 0.5, ambient: 0.7 }
# #light2: { type: directional, origin: world, direction: [1, 1, -1], diffuse: [.3, .3, .3, 1.], ambient: [0.7, 0.7, 0.7, 1.] }
#textures:
styles:
# blend_order -1000 to draw buildings just above other geometry; blend_order -110 to -100 reserved by app
heightglow:
base: polygons
mix: global.terrain_3d_mixin
blend: translucent
blend_order: -1000
lighting: vertex
shaders:
blocks:
color: "color.rgb += vec3(worldPosition().z / 800.);"
heightglowline:
base: lines
blend_order: -999
mix: heightglow
unlit-lines:
base: lines
mix: global.terrain_3d_mixin
lighting: false
# water polygons can be assumed to be flat (not quite true for rivers), so only need to set elevation at edges
water-polygons:
base: polygons
mix: global.terrain_3d_mixin
#lighting: false
# dash only supported for styles, not draw block because each dash pattern requires separate shader
dashed-border:
mix: unlit-lines
dash: [2.0, 0.5]
dashed-path:
mix: unlit-lines
dash: [3.0, 0.5]
dashed-track:
mix: unlit-lines
dash: [2.5, 1.0]
dashed-steps:
mix: unlit-lines
dash: [0.5, 0.5]
dashed-bike:
mix: unlit-lines
dash: [1.0, 1.0]
dashed-rail:
mix: unlit-lines
dash: [0.15, 7.0]
aerialway:
mix: unlit-lines
# both approaches have issue w/ circles being stretched due to change of line width w/ zoom
#blend: nonopaque
#texcoords: true
#shaders:
# defines: { dotSize: 0.2 }
# blocks:
# color: |
# vec2 st = vec2(v_texcoord.x, 4.0*fract(v_texcoord.y / 4.0)) - 0.5;
# color.a = 1. - step(dotSize, dot(st,st)*2.);
texture: |
data:image/svg+xml;utf8,<svg width="10pt" height="40pt" viewBox="-5 -20 10 40">
<g fill="#fff"> <circle cx="0" cy="0" r="4"/> </g>
</svg>
piste-direction:
mix: unlit-lines
texture: |
data:image/svg+xml;utf8,<svg width="10pt" height="80pt" viewBox="-5 -40 10 80">
<g fill="#fff"> <path d="M-5 -40 L-5 0 L0 -4 L5 0 L5 -40Z M-5 40 L-5 6 L0 2 L5 6 L5 40Z"/> </g>
</svg>
transit-lines:
base: lines
blend: overlay
blend_order: -2
draw: # default draw parameters
color: gray #function() { return feature.colour || 'gray'; }
alpha: 0.25
width: 6px
outline:
color: [.8, .8, .8]
alpha: 0.25
width: 1px
interactive: true
layers:
landcover:
data: { source: osm, layer: landuse }
enabled: global.show_polygons
#filter: [ { $zoom: { min: 16 } }, { area: { min: 500px2 } } ]
draw:
polygons:
visible: false
style: global.earth_style
order: global.order.landcover
color: global.color.landuse
forest:
filter: [ { class: forest }, { landuse: forest }, { natural: wood } ]
draw: { polygons: { visible: true, color: global.color.forest } }
scrub:
filter: { natural: [scrub, fell, heath] }
draw: { polygons: { visible: true, color: global.color.scrub } }
grass:
filter:
- class: grass
- landuse: [grass, allotments, meadow]
- natural: [grassland, grass]
draw: { polygons: { visible: true, color: global.color.grass } }
wetland:
filter: [ { class: wetland }, { natural: wetland } ]
draw: { polygons: { visible: true, color: global.color.wetland } }
beach:
filter: [ { class: sand }, { natural: [beach, sand] } ]
draw: { polygons: { visible: true, color: global.color.beach } }
ice:
filter: [ { class: ice }, { natural: glacier } ]
draw: { polygons: { visible: true, color: global.color.ice } }
rock:
filter: [ { class: rock }, { natural: [bare_rock, scree] } ]
draw: { polygons: { visible: true, color: global.color.rock } }
farmland:
filter:
- class: farmland
- landuse: [farmland, farmyard, farm, orchard, vineyard, plant_nursery, greenhouse_horticulture]
draw: { polygons: { visible: true, color: global.color.farmland } }
# golf course can be inside park, so make sure it is drawn on top
golf:
filter: [ { class: golf_course }, { leisure: [golf_course, pitch] } ]
draw: { polygons: { visible: true, order: global.order.golf, color: global.color.golf } }
park:
filter:
- class: park
- landuse: [recreation_ground, village_green]
- leisure: [park, garden]
draw: { polygons: { visible: true, order: global.order.parks, color: global.color.parks } }
landuse:
data: { source: osm, layer: landuse }
enabled: global.show_polygons
#filter: [ { $zoom: { min: 16 } }, { area: { min: 500px2 } } ]
draw:
polygons:
visible: false
style: global.earth_style
order: global.order.landuse
color: global.color.landuse
green:
filter: { class: [zoo, playground, pitch, cemetery] }
draw: { polygons: { visible: true, order: global.order.park_detail, color: global.color.park_detail } }
retail:
filter: { landuse: [retail] } #industrial, commercial
draw: { polygons: { visible: true, color: global.color.retail } }
civic:
filter: { amenity: [university, college] } # class: school
draw: { polygons: { visible: true, color: global.color.civic } }
#urban:
# filter: { kind: urban_area }
# draw: { polygons: { color: [[7, global.color.urban_7], [9, global.color.urban_9]] } }
park:
data: { source: osm, layer: landuse }
enabled: global.show_polygons
filter:
class: [national_park, protected_area, nature_reserve]
#any: [ { $zoom: { min: 16 } }, { area: { min: 500px2 } } ]
draw:
polygons:
style: global.earth_style
order: global.order.parks
color: global.color.parks
pier:
data: { source: osm, layer: landuse }
enabled: global.show_polygons
filter: { man_made: [pier, breakwater, groyne] }
pier_areas:
filter: { $geometry: polygon } #$zoom: { min: 13 }
pier: { filter: { man_made: pier }, draw: { polygons: { color: global.color.pier } } }
draw:
polygons:
order: global.order.pier
color: global.color.breakwater
pier_lines:
filter: { $geometry: line }
pier: { filter: { man_made: pier }, draw: { lines: { color: global.color.pier } } }
draw:
lines:
order: global.order.pier
color: global.color.breakwater
width: [[13, 0px], [14, 0.5px],[15, 1.5px], [16, 2.5px],[17, 3px],[18, 3m]]
water:
data: { source: osm, layer: water }
enabled: global.show_polygons
filter: { $geometry: polygon }
draw:
polygons:
style: water-polygons
order: global.order.water
color: global.color.water
#ocean:
# filter: { class: ocean}
#inter:
# filter: { class: [lake, river] }
water_name:
data: { source: osm, layer: water }
filter:
name: true
#water: true
$geometry: [polygon, point]
any: [ { $zoom: { min: 17 } }, { area: { min: 500px2 } } ]
draw:
text:
#interactive: true
text_source: global.names_two_lines
transition: { show: { time: 0s }, hide: { time: 1s } }
font:
family: global.primary_font
fill: global.color.water_name
stroke: { color: global.color.water_halo, width: 2 }
style: italic
size: [[16, 12px], [17, 14px]]
oceans:
filter: { class: ocean, $zoom: { min: 1, max: 8 } }
draw: { text: { font: { size: 14px } } }
#seas:
# filter: { class: [lake, sea], $zoom: { min: 7 } }
# draw: { text: { font: { size: [[9, 9px], [17, 10px], [18, 12px]] } } }
waterway:
data: { source: osm, layer: water }
enabled: global.show_polygons
filter: { $geometry: line }
draw:
lines:
style: unlit-lines
order: global.order.waterway
color: global.color.water
width: [[10,0px],[11,1px],[15,2px]]
river:
filter: { waterway: river }
draw: { lines: { width: [[7,0.5px],[8,1px],[12,2px],[15,4px]] } }
intermittent:
filter: { intermittent: true }
draw: { lines: { style: dashed-bike } }
stream:
filter: { waterway: stream }
draw: { lines: { width: [[15,0px],[16,1.5px],[19,2px]] } }
waterway_name:
data: { source: osm, layer: water }
filter:
name: true
#waterway: true
$geometry: line
any: [ { $zoom: { min: 17 } }, { waterway: river } ]
draw:
text:
text_source: global.names_one_line
#buffer: 3px
font:
family: global.primary_font
fill: global.color.water_name
stroke: { color: global.color.water_halo, width: 2 }
style: italic
size: [[11, 0px], [12, 10px], [14, 11px], [16, 12px], [17, 14px]]
transportation:
data: { source: osm, layer: transportation }
filter: { not: { class: [transit, route, aeroway] } }
draw:
lines:
style: unlit-lines
color: global.color.road
width: 0
order: global.order.transportation
outline:
visible: global.show_polygons
color: [[16, global.color.casing_16], [18, global.color.casing_18]]
width: 0 #[[15, 0], [16, 2]]
order: global.order.transportation_casing # put all outlines below all roads
rounded:
filter: { $zoom: { min: 18 } }
draw: { lines: { cap: round } }
bridge:
filter: { brunnel: bridge }
priority: 1
draw: { lines: { order: global.order.bridge } }
tunnel:
filter: { brunnel: tunnel, $zoom: { min: 12 } }
priority: 1
draw: { lines: { color: global.color.tunnel, outline: { color: global.color.tunnel_casing } } }
motorway:
filter: { highway: [motorway, motorway_link] }
draw:
lines:
order: global.order.motorway
color: 'function() { return global.show_motorways ? global.color.motorway : global.color.motorway_muted; }'
#[[5, global.color.motorway_5], [7, global.color.motorway_7]]
width: [[4, 0], [5, 1px], [8, 1.5px], [14, 2px], [15, 12]]
outline:
width: [[14, 0], [15, 2]]
tunnel:
filter: { brunnel: tunnel, $zoom: { min: 12 } }
priority: 1
draw: { lines: { color: global.color.motorway_tunnel } }
link:
filter: { highway: motorway_link }
draw:
lines:
#color: global.color.motorway_link
width: [[13, 0], [14, 12]]
trunk:
filter: { highway: [trunk, trunk_link], $zoom: { min: 8 } }
draw:
lines:
order: global.order.major_road
width: [[8, 1px], [13, 2px], [14, 2px], [16, 12]]
outline:
width: [[16, 0], [17, 1]]
major_road:
filter: { highway: [primary, primary_link, secondary, secondary_link] }
draw:
lines:
order: global.order.major_road
width: [[10, 0], [13, 2px], [14, 2px], [16, 12]]
outline:
width: [[16, 0], [17, 1]]
withref:
filter: { ref: true }
draw: { lines: { width: [[8, 0], [9, 1px], [13, 2px], [14, 2px], [16, 12]] } }
minor_road:
filter: { highway: [tertiary, tertiary_link, unclassified, residential, road, living_street, service] }
draw:
lines:
order: global.order.minor_road
width: [[13, 0px], [14, 1px], [15, 8]]
outline:
width: [[17, 0], [18, 1]]
service:
filter: { highway: service }
draw: { lines: { width: [[15, 0px], [16, 4px], [17, 8]] } }
parking:
filter: { service: parking_aisle }
draw: { lines: { width: [[15, 0px], [16, 2px], [17, 4]] } }
paths:
filter: { highway: [footway, path, steps, pedestrian] }
draw:
lines:
order: global.order.path
style: dashed-path
color: global.color.path
width: [[14, 0px], [15, 1px], [18, 3px]]
steps:
filter: { highway: steps }
draw: { lines: { style: dashed-steps, width: [[14, 0px], [15, 3px], [18, 6px]] } }
unpaved:
enabled: global.show_trails
filter:
- highway: false # for old schema
- highway: path
- { highway: footway, surface: unpaved }
draw: { lines: { color: global.color.unpaved_trail, width: [[10, 1px], [18, 3px]] } }
poor:
filter: { trail_visibility: [ bad, very_bad, horrible, no, none, poor ] }
draw: { lines: { style: dashed-bike } }
tracks:
filter: { highway: [cycleway, byway, bridleway, track] }
draw:
lines:
order: global.order.path
style: dashed-track
color: global.color.path
width: [[13, 0px], [14, 1px], [15, 2px], [18, 4px]]
# unpaved road: dashed w/ outline? track: same as unpaved road if motor_vehicle: yes, otherwise like path
rail:
filter:
class: rail
railway: [rail, light_rail, subway, narrow_gauge, tram, funicular]
$zoom: { min: 10 }
draw:
lines:
order: global.order.rail
color: global.color.rail
width: [[12, 1px], [14, 1px], [16, 2px]]
sleepers:
# since dash pattern resets for every line segment it looks very irregular when zoomed out
filter: { $zoom: { min: 14 } }
draw:
dashed-rail:
order: global.order.rail_sleepers
color: global.color.rail
width: [[12, 4px], [14, 4px], [16, 6px]]
tunnel:
filter: { brunnel: tunnel }
draw: { lines: { color: global.color.rail_tunnel } }
ferry:
filter: { class: ferry }
draw:
lines:
style: dashed-path
color: global.color.ferry
width: [[14, 1px], [18, 2px]]
aerialway:
filter: { class: aerialway, $zoom: { min: 10 } }
draw:
lines:
order: global.order.aerialway # aerialway would more often be over bridge vs under
color: global.color.aerialway
width: [[14, 0.5px], [15, 1.0px], [16, 2m]]
points:
visible: false
style: aerialway
order: global.order.aerialway
color: global.color.aerialway
width: [[14, 50], [16, 25], [18, 10], [20, 4]]
#width: [[14, 6px], [15, 8px], [16, 10px]]
#width: [[14, 50m], [15, 30m], [16, 20m]]
# maybe use dashed line instead?
#points:
# visible: false
# color: global.color.aerialway
# size: [[14, 1.25px], [15, 3px], [16, 3px]]
# collide: false
# placement: spaced
# placement_spacing: 10px
# placement_min_length_ratio: 0
show_points:
filter: { $zoom: { min: 13 }, aerialway: [gondola, cable_car, mixed_lift, chair_lift] }
draw: { points: { visible: true } }
gondola:
filter: { aerialway: [gondola, cable_car, mixed_lift] }
draw:
lines: { width: [[10,0.5px], [11,1px], [12, 1.5px], [13, 1.5px], [14, 2px], [15, 2.5px]] }
#points: { size: [[12, 4px], [13, 4px], [14, 5px], [15, 7px], [16, 7px]] }
chair_lift:
filter: { aerialway: chair_lift }
draw:
lines: { width: [[10,0.5px], [11,1px], [12, 1.5px], [13, 1.5px], [14, 2px], [15, 2.5px]] }
#points: { size: [[12, 4px], [13, 4px], [14, 5px], [15, 7px], [16, 7px]] }
aerialway_label:
filter: { $zoom: { min: 14 } }
draw:
text:
text_source: name
font:
family: global.primary_font
fill: global.color.aerialway_name
stroke: { color: global.color.aerialway_halo, width: 3 }
size: 12px
piste:
enabled: global.show_trails
filter: { class: piste, $zoom: { min: 10 } }
piste_areas:
filter: { $geometry: polygon, $zoom: { min: 13 } }
enabled: global.show_polygons
draw:
polygons:
#visible: global.show_trails
style: global.earth_style
order: global.order.landuse
color: global.piste_color_fn
piste_lines:
filter: { $geometry: line }
draw:
lines:
#visible: global.show_trails
order: global.order.piste
color: global.piste_color_fn
width: [[10,0.5px],[11,1px],[12,1.25px],[13,2px],[18,3m]]
outline:
style: unlit-lines
color: global.color.piste_halo
width: [[13, 0px], [14, 2px]]
default:
filter: { $zoom: { min: 12 } }
draw: { lines: { visible: true } }
direction:
filter: { $zoom: { min: 16 } }
draw: { lines: { style: piste-direction } }
piste_names:
#enabled: global.show_trails
filter: { $geometry: line, $zoom: { min: 13 } }
draw:
text:
text_source: global.piste_name_fn
font:
family: global.primary_font
fill: global.piste_color_fn
stroke: { color: global.color.piste_halo, width: 3 }
size: 12px
road-icons:
arrows:
# oneway arrows and shields are distinct groups!
#exclusive: true
filter: { oneway: 1, $zoom: { min: 17 } }
draw:
points:
#collide: false
priority: global.priority.oneway_arrow
style: poi-points
texture: pois
sprite: arrow
color: global.color.oneway_arrow
flat: true
size: [[17, 18px], [18, 20px], [20, 32px]]
placement: spaced
placement_min_length_ratio: 0.5
placement_spacing: [[17, 70px], [20, 175px]]
angle: auto
shields:
enabled: global.show_motorways
data: { source: osm, layer: transportation }
filter:
#function() { const s = feature.maxspeed.split(" "); return parseInt(s[0]) >= (s[1] == "mph" ? 50 : 80); }
ref: true
aeroway: false
route: false
#not: { class: [transit, route, aeroway] }
any:
- { highway: motorway, $zoom: { min: 6 } }
- { highway: [trunk, primary], $zoom: { min: 9 } }
- { highway: [secondary, tertiary], $zoom: { min: 13 } }
- $zoom: { min: 14 }
motorway:
filter: { highway: motorway }
draw: { points: { priority: global.priority.motorway_ref, color: global.color.motorway_shield } }
draw:
points:
visible: function() { return feature.ref.split(";")[0].length <= 8; }
style: poi-points
texture: pois
sprite: shield #function() { return feature.network; }
color: global.color.shield
#sprite_default: shield
priority: global.priority.highway_ref
# faster roads get higher priority
#priority: function() { return global.priority.motorway_ref - parseInt(feature.maxspeed)/200; }
size: |
function() {
const str = feature.ref.split(";")[0];
var w = 0;
// exact values will depend on font
for (var ii = 0; ii < str.length; ii++) { w += (str[ii] == " ") ? 3.5 : 7.5; }
return [w, 14];
}
# midpoint generates too many labels (overwhelming label collider)
placement: spaced
placement_spacing: 30px
placement_min_length_ratio: 0
repeat_distance: 150px
repeat_group: shields
text:
anchor: center
text_source: function() { return feature.ref.split(";")[0]; }
font:
family: global.primary_font
size: 10px
fill: black
transportation_name:
data: { source: osm, layer: transportation }
filter:
name: true
not: { class: [rail, aeroway, route, piste, aerialway] }
aeroway: false
draw:
text:
#interactive: true
text_source: |
function() {
const name = global.names_one_line_fn();
return name.replace(" Avenue", " Ave.").replace(" Street", " St.").replace(" Boulevard", " Blvd.").replace(" Drive", " Dr.").replace(" Lane", " Ln.").replace(" Road", " Rd.");
}
transition: { show: { time: 0s }, hide: { time: 1s } }
font:
family: global.primary_font
fill: global.color.road_name
stroke: { color: global.color.road_halo, width: 2 }
# 0px to hide by default
size: 0px
motorway:
exclusive: true
filter: { highway: motorway, $zoom: { min: 13 } }
draw:
text:
visible: global.show_motorways
repeat_distance: 200px
repeat_group: road_labels
priority: global.priority.motorway_name
font:
# shield is generally more important than name for motorway
size: 12px
stroke: { width: 4 }
primary:
exclusive: true
filter:
any:
- {highway: trunk, $zoom: { min: 13 }}
- {highway: primary, $zoom: { min: 14 }}
draw:
text:
repeat_distance: 100px
repeat_group: roads
priority: global.priority.road_primary
font:
size: 14px
stroke: { width: 4 }
secondary:
exclusive: true
filter: { highway: secondary, $zoom: { min: 14 } }
draw:
text:
repeat_distance: 100px
repeat_group: roads
priority: global.priority.road_secondary
font:
size: 14px
stroke: { width: 4 }
tertiary:
exclusive: true
filter: { highway: tertiary, $zoom: { min: 15 } }
draw:
text:
priority: global.priority.road_tertiary
font:
size: 12px
stroke: { width: 4 }
minor:
exclusive: true
filter: { highway: [unclassified, residential, road, living_street, service], $zoom: { min: 16 } }
draw:
text:
priority: global.priority.road_minor
font:
size: 10px
stroke: { width: 4 }
paths:
exclusive: true
filter: { highway: [footway, path, steps, pedestrian], $zoom: { min: 15 } }
draw:
text:
priority: global.priority.road_minor
font:
size: 10px
stroke: { width: 4 }
tracks:
exclusive: true
filter: { highway: [cycleway, byway, bridleway, track], $zoom: { min: 15 } }
draw:
text:
priority: global.priority.road_minor
font:
size: 10px
stroke: { width: 4 }
ferry:
exclusive: true
filter: { class: ferry }
draw:
text:
text_wrap: 20
font:
size: 10px
fill: global.color.ferry_name
stroke: { color: global.color.ferry_halo, width: 4px }
style: italic
airports:
data: { source: osm, layer: transportation }
enabled: global.show_polygons
filter: { aeroway: true }
footprint:
filter: { aeroway: aerodrome }
draw:
polygons:
style: global.earth_style
order: global.order.airport
color: global.color.airport