-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.yaml
138 lines (137 loc) · 4.94 KB
/
default.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
import:
- https://tangrams.github.io/blocks/space/tile-full.yaml
- https://tangrams.github.io/blocks/geometry/normal.yaml
- https://tangrams.github.io/blocks/generative/random.yaml
sources:
mapzen:
type: TopoJSON
url: https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.topojson?api_key=mapzen-QF1osLn
square:
type: GeoJSON
url: square.json
scene:
background:
color: [0.871, 0.949, 0.965, 1.00]
layers:
earth:
data: { source: mapzen }
draw:
polygons:
order: 100
color: [0.835, 0.824, 0.824, 1.00]
water:
data: { source: mapzen }
draw:
polygons:
color: [0.871, 0.949, 0.965, 1.00]
order: 200
tiles:
data: { source: square }
draw:
lines:
color: [0.831, 0.392, 0.361, 1.00]
width: 4px
order: 10000
tile_edges: true
# text:
# text_source: |
# function() {
# var lat = 0; //tangram.lat;
# var lon = 0; //tangram.lon;
# var zoom = 0; //tangram.zoom;
#
# var xtile = parseInt(Math.floor( (lon + 180) / 360 * (1<<zoom) ));
# var ytile = parseInt(Math.floor( (1 - Math.log(Math.tan(lat.toRad()) + 1 / Math.cos(lat.toRad())) / Math.PI) / 2 * (1<<zoom) ));
# return "" + zoom + "/" + xtile + "/" + ytile;
# }
# priority: 1
# font:
# size: 10px
# fill: red
boundaries:
data: { source: mapzen}
country:
filter:
all:
- kind: country
draw:
lines:
color: [0.667, 0.659, 0.659, 1.00]
width: 1px
order: 300
states:
filter:
all:
- $zoom: { min: 5, max: 20 }
any:
- kind: region
draw:
lines:
color: [0.667, 0.659, 0.659, 1.00]
width: 1px
order: 300
places:
data: { source: mapzen}
filter: { not: { kind: [neighbourhood] } }
countries:
filter: { kind: country, population: { min: 3500000 } }
draw:
text:
text_source: function() { return feature["name:en"] || feature["name"]; }
font:
size: [[3,18px],[4,26px],[5,32px]]
fill: [0.431, 0.627, 0.643, 1.00]
order: 300
cities:
filter:
all:
- kind: locality
any:
- { $zoom: [4], population: { min: 2500000 }}
- { $zoom: [5], population: { min: 1500000 } }
- { $zoom: [8], min_zoom < 8, kind_detail: city }
- { $zoom: [9], min_zoom < 9, kind_detail: city }
- { $zoom: [10], min_zoom < 10, kind_detail: city }
draw:
text:
font:
size: 16px
fill: [0.310, 0.302, 0.302, 1.00]
# styles:
# grid:
# mix: space-tile
# shaders:
# blocks:
# global: |
# // Simple Grid
# //=============================
# float grid(in vec2 st, in float res, in float press){
# st = fract(st*res);
# return 1.0-(step(press*res,st.x) * step(press*res,st.y));
# }
# float grid(in vec2 st, in float res){
# return grid(st,res,0.005);
# }
# // GridTile
# //=============================
# vec3 TileGrid(float res){
# vec2 st = getTileCoords().xy *100.*res;
# vec3 color = vec3(0.094, 0.094, 0.102);
# float press = 0.5+(1.0-fract(u_map_position.z))*0.1;
# color += vec3(0.1,0.,0.)*grid(st,0.02,press);
# color += vec3(0.5,0.,0.)*grid(st,0.01,press);
# color += 0.1*grid(st,0.1,press);
# return color;
# }
# vec3 TileGrid(){ return mix(TileGrid(1.),TileGrid(2.),fract(u_map_position.z)); }
# tile:
# base: polygons
# mix: [grid, generative-random]
# lighting: false
# animated: true
# shaders:
# blocks:
# color: |
# vec2 st = getTileCoords();
# color.rgb = TileGrid();
# float zoom = 0.0001+fract(u_map_position.z);