Skip to content

Commit 6292b1b

Browse files
woodroofgithub-actions[bot]
authored andcommitted
Zoom-dependent text color render test
GitOrigin-RevId: 6a1f34ac2904fa70504b3af44adba994033dcdf0
1 parent 6130929 commit 6292b1b

2 files changed

Lines changed: 126 additions & 0 deletions

File tree

3.3 KB
Loading
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"comment": [
3+
"Currently we have different behaviour for zoom-based paint properties:",
4+
"* For feature dependent we calculate two values for overscaled tile zoom and overscaled tile zoom + 1,",
5+
" and interpolate between them. That means we ignore intermediate values and do not calculate interpolate",
6+
" function correctly.",
7+
"* For feature independent we recalculate values and pass them as uniforms on every frame.",
8+
"This test checks that we don't change that behaviour without explicit decision."
9+
],
10+
"version": 8,
11+
"metadata": {
12+
"test": {
13+
"height": 100,
14+
"width": 100
15+
}
16+
},
17+
"zoom": 1.25,
18+
"sources": {
19+
"test_source1": {
20+
"type": "geojson",
21+
"data": {
22+
"type": "Feature",
23+
"geometry": {
24+
"type": "Point",
25+
"coordinates": [0, -8]
26+
},
27+
"properties": {
28+
"first": "white",
29+
"second": "black"
30+
}
31+
}
32+
},
33+
"test_source2": {
34+
"type": "geojson",
35+
"data": {
36+
"type": "Point",
37+
"coordinates": [0, 0]
38+
}
39+
},
40+
"test_source3": {
41+
"type": "geojson",
42+
"data": {
43+
"type": "Point",
44+
"coordinates": [0, 8]
45+
}
46+
}
47+
},
48+
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
49+
"layers": [
50+
{
51+
"id": "back",
52+
"type": "background",
53+
"paint": {
54+
"background-color": "white"
55+
}
56+
},
57+
{
58+
"id": "test_layer1",
59+
"type": "symbol",
60+
"source": "test_source1",
61+
"layout": {
62+
"text-font": [
63+
"Open Sans Semibold",
64+
"Arial Unicode MS Bold"
65+
],
66+
"text-field": "Light grey"
67+
},
68+
"paint": {
69+
"text-color": ["interpolate",
70+
["linear"],
71+
["zoom"],
72+
1,
73+
["get", "first"],
74+
1.3,
75+
"blue",
76+
1.5,
77+
["get", "second"]
78+
]
79+
}
80+
},
81+
{
82+
"id": "test_layer2",
83+
"type": "symbol",
84+
"source": "test_source2",
85+
"layout": {
86+
"text-font": [
87+
"Open Sans Semibold",
88+
"Arial Unicode MS Bold"
89+
],
90+
"text-field": "Grey"
91+
},
92+
"paint": {
93+
"text-color": ["interpolate",
94+
["linear"],
95+
["zoom"],
96+
1,
97+
"white",
98+
1.5,
99+
"black"
100+
]
101+
}
102+
},
103+
{
104+
"id": "test_layer3",
105+
"type": "symbol",
106+
"source": "test_source3",
107+
"layout": {
108+
"text-font": [
109+
"Open Sans Semibold",
110+
"Arial Unicode MS Bold"
111+
],
112+
"text-field": "Dark grey"
113+
},
114+
"paint": {
115+
"text-color": ["interpolate",
116+
["exponential", 0.01],
117+
["zoom"],
118+
1,
119+
"white",
120+
1.5,
121+
"black"
122+
]
123+
}
124+
}
125+
]
126+
}

0 commit comments

Comments
 (0)