-
Notifications
You must be signed in to change notification settings - Fork 4
/
scene.yaml
222 lines (206 loc) · 7.8 KB
/
scene.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
# This style is an homage to Michal Migurski's High Road demo:
# https://github.com/migurski/HighRoad
# It uses stops to set line and outline widths at various zoom levels,
# and the sort_rank property to arrange bridges, overpasses, and tunnels
# by depth.
#
sources:
mapzen:
type: MVT
url: https://tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt
url_params:
api_key: NaqqS33fTUmyQcvbuIUCKA
tile_size: 512
max_zoom: 16
camera:
type: isometric
axis: [0, .1] # very small building extrusion
lights:
light1:
type: directional
direction: [1, 1, -.9]
diffuse: .5
ambient: .85
styles:
flatlines:
base: lines
lighting: false # ignore lights
flatpolys:
base: polygons
lighting: false # ignore lights
scene:
background:
color: [.4, .4, .4]
layers:
earth:
data: { source: mapzen, layer: earth }
draw:
flatpolys:
order: function() { return feature.sort_rank; }
color: [.4, .4, .4]
landuse:
data: { source: mapzen, layer: landuse }
parks:
filter: { kind: [park, cemetery, graveyard, forest] }
draw:
flatpolys:
order: function() { return feature.sort_rank; }
# tone down green as you zoom out
color: [[10, [0.3, 0.4, 0.3]], [14, [0.5, 0.825, 0.5]]]
playgrounds:
filter: { kind: [pitch, playground] }
draw:
flatpolys:
order: function() { return feature.sort_rank; }
color: [0.3, 0.675, 0.3]
water:
data: { source: mapzen, layer: water }
draw:
flatpolys:
order: function() { return feature.sort_rank; }
color: [0.83, 0.83, 0.83]
roads:
data: { source: mapzen, layer: roads }
filter: { not: { kind_detail: service, kind: rail } }
draw:
flatlines:
order: function() { return feature.sort_rank; }
color: [0.83, 0.83, 0.83]
width: function () { return Math.log($zoom); }
outline:
color: black
# default outlines starting at zoom 16
default-outline-width:
filter: { $zoom: { min: 16 } }
draw:
flatlines:
outline:
order: 352
width: function () { return 3/16 * Math.log($zoom); }
highway:
filter: { kind: highway }
draw:
flatlines:
# put highways on top of all other roads as default order
order: 400
color: [1.0, .8, .0]
width: [[11, 2px], [14, 3px], [16, 4px], [17, 10m]]
outline:
color: black
width: [[10, 0], [12, 1px], [16, 2px]]
link:
filter: { is_link: true } # on- and off-ramps, etc
draw:
flatlines:
color: [0.65882, 0.65882, 0.50196]
width: [[13, 0px], [14, 3px], [16, 5px], [18, 10m]]
outline:
color: [.3, .3, .3]
width: [[13, 0px], [14, 1px], [18, 1.5px]]
tunnel-link:
filter: {is_tunnel: true, $zoom: {min: 13} }
draw:
flatlines:
color: [0.8, 0.8, 0.7]
outline:
color: [.5, .5, .5]
tunnel:
filter: {is_tunnel: true, $zoom: {min: 13} }
draw:
flatlines:
color: [0.8, 0.8, 0.7]
outline:
color: [.5, .5, .5]
major_road:
filter: { kind: major_road }
# default style
draw:
flatlines:
cap: round
color: [[13, [0.8, 0.8, 0.8]], [17, [1, 1, 1]]]
width: [[13, 0px], [14, 2px], [16, 2.5px], [19, 8m]]
outline:
cap: butt
width: [[12, 0px], [13, .5px], [15, 1px]]
primary:
filter: { kind_detail: primary }
draw:
flatlines:
width: [[10, 0px], [11, 1.5px], [13, 2.5px], [16, 2.5px], [19, 8m]]
outline:
width: [[10, 0px], [11, .5px], [16, .75px]]
secondary:
filter: { kind_detail: secondary }
draw:
flatlines:
width: [[11, 0px], [13, 1.5px], [14, 2.5px], [16, 2.5px], [19, 8m]]
outline:
width: [[13, 0px], [14, 1.5px]]
tertiary:
filter: { kind_detail: tertiary }
draw:
flatlines:
width: [[11, 0px], [13, .75px], [14, 2.5px], [16, 2.5px], [19, 8m]]
outline:
width: [[12, 0px], [15, .5px], [16, 1.25px], [18, 4.5px]]
minor_road:
filter: { kind: minor_road, not: { kind_detail: service } }
draw:
flatlines:
color: [[15, [0.6, 0.6, 0.6]], [17, [0.8, 0.8, 0.8]]]
width: [[13, 0px], [14, 1.5px], [15, 10m]]
cap: round
outline:
cap: butt
width: [[13, 0px], [14, .5px], [17, 1px]]
path:
filter: { kind: path }
draw:
flatlines:
color: [0.8, 0.8, 0.8]
width: [[16, 0], [17, 3m]]
cap: round
outline:
cap: butt
width: .1
z-order:
filter: { $zoom: {min: 14} }
draw:
flatlines:
# let roads sort themselves past zoom 14
order: function() { return feature.sort_rank; }
# but give them all the same outline
outline:
order: 352 # magic number
bridges-tunnels:
filter: { any: [is_bridge: true, is_tunnel: true] }
draw:
flatlines:
outline:
# except bridges and tunnels, their outlines should also self-sort
order: function() { return feature.sort_rank; }
# buildings are the only layer that gets lighting
buildings:
data: { source: mapzen, layer: buildings }
filter: { $geometry: polygon } # filter out address points in buildings layer
draw:
polygons:
order: function() { return feature.sort_rank; }
color: [.3, .3, .3]
# under z15, only extrude buildings taller than 20m
extrude: function () { return ( $zoom >= 16) || ($zoom >= 15 && feature.height > 20) }
places:
data: { source: mapzen }
filter: { name: true, not: { kind: [county, state, island] } }
draw:
text:
font:
weight: 100
size: 18px
family: Helvetica
fill: white
stroke: { color: black, width: 3 }
# nix podunk burgs under z15
minor-places:
filter: { kind: [hamlet, village, town, neighbourhood, suburb, quarter], $zoom: { max: 15 } }
visible: false