Skip to content

Commit 4679f5a

Browse files
woodroofgithub-actions[bot]
authored andcommitted
Supporting mixed order of slot layers
GitOrigin-RevId: 4d8c3c59de80b324e718b4bae55ec67719347c0c
1 parent 155b6da commit 4679f5a

File tree

11 files changed

+366
-1
lines changed

11 files changed

+366
-1
lines changed

test/ignores/all.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ const skip = [
285285
// Ignore procedural buiding clip layer render tests for now.
286286
"render-tests/building/clip-layer/default",
287287
"render-tests/building/clip-layer/lower-order-clipping-skipped",
288-
"render-tests/building/clip-layer/with-FE-and-landmarks"
288+
"render-tests/building/clip-layer/with-FE-and-landmarks",
289+
290+
// Not implemented, https://mapbox.atlassian.net/browse/GLJS-1591
291+
"render-tests/slots/inner-slot-before-outer",
292+
"render-tests/slots/mixed-slot-order-with-imports",
289293
];
290294

291295
export default {todo, skip};
272 Bytes
Loading
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"comment": "Even though inner slot is positioned before the outer one, we should process it correctly",
3+
"version": 8,
4+
"metadata": {
5+
"test": {
6+
"width": 24,
7+
"height": 24
8+
}
9+
},
10+
"sources": {
11+
"red": {
12+
"type": "geojson",
13+
"data": {
14+
"type": "Feature",
15+
"geometry": {
16+
"type": "Point",
17+
"coordinates": [0, 0]
18+
}
19+
}
20+
},
21+
"green": {
22+
"type": "geojson",
23+
"data": {
24+
"type": "Feature",
25+
"geometry": {
26+
"type": "Point",
27+
"coordinates": [0, 0]
28+
}
29+
}
30+
}
31+
},
32+
"layers": [
33+
{
34+
"id": "background",
35+
"type": "background",
36+
"paint": {
37+
"background-color": "white"
38+
}
39+
},
40+
{
41+
"id": "inner",
42+
"slot": "outer",
43+
"type": "slot"
44+
},
45+
{
46+
"id": "red",
47+
"source": "red",
48+
"type": "circle",
49+
"paint": {
50+
"circle-color": "#ff0000",
51+
"circle-radius": 10
52+
}
53+
},
54+
{
55+
"id": "outer",
56+
"type": "slot"
57+
},
58+
{
59+
"id": "green",
60+
"source": "green",
61+
"type": "circle",
62+
"slot": "inner",
63+
"paint": {
64+
"circle-color": "#008000"
65+
}
66+
}
67+
]
68+
}
272 Bytes
Loading
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"comment": "Slot is missing: we should print a warning, but still be able to process data",
3+
"version": 8,
4+
"metadata": {
5+
"test": {
6+
"width": 24,
7+
"height": 24
8+
}
9+
},
10+
"sources": {
11+
"red": {
12+
"type": "geojson",
13+
"data": {
14+
"type": "Feature",
15+
"geometry": {
16+
"type": "Point",
17+
"coordinates": [0, 0]
18+
}
19+
}
20+
},
21+
"green": {
22+
"type": "geojson",
23+
"data": {
24+
"type": "Feature",
25+
"geometry": {
26+
"type": "Point",
27+
"coordinates": [0, 0]
28+
}
29+
}
30+
}
31+
},
32+
"layers": [
33+
{
34+
"id": "background",
35+
"type": "background",
36+
"paint": {
37+
"background-color": "white"
38+
}
39+
},
40+
{
41+
"id": "red",
42+
"source": "red",
43+
"type": "circle",
44+
"paint": {
45+
"circle-color": "#ff0000",
46+
"circle-radius": 10
47+
}
48+
},
49+
{
50+
"id": "green",
51+
"source": "green",
52+
"type": "circle",
53+
"slot": "inner",
54+
"paint": {
55+
"circle-color": "#008000"
56+
}
57+
},
58+
{
59+
"id": "inner",
60+
"slot": "outer",
61+
"type": "slot"
62+
}
63+
]
64+
}
272 Bytes
Loading
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"comment": "Even though the green layer is before the red one, it has no slots, so it should be displayed last",
3+
"version": 8,
4+
"metadata": {
5+
"test": {
6+
"width": 24,
7+
"height": 24,
8+
"operations": [
9+
[
10+
"addLayer",
11+
{
12+
"id": "red",
13+
"source": "red",
14+
"type": "circle",
15+
"slot": "slot",
16+
"paint": {
17+
"circle-color": "#ff0000",
18+
"circle-radius": 10
19+
}
20+
}
21+
],
22+
[
23+
"addLayer",
24+
{
25+
"id": "green",
26+
"source": "green",
27+
"type": "circle",
28+
"paint": {
29+
"circle-color": "#008000"
30+
}
31+
}
32+
],
33+
[
34+
"moveLayer",
35+
"green",
36+
"red"
37+
]
38+
]
39+
}
40+
},
41+
"sources": {
42+
"red": {
43+
"type": "geojson",
44+
"data": {
45+
"type": "Feature",
46+
"geometry": {
47+
"type": "Point",
48+
"coordinates": [0, 0]
49+
}
50+
}
51+
},
52+
"green": {
53+
"type": "geojson",
54+
"data": {
55+
"type": "Feature",
56+
"geometry": {
57+
"type": "Point",
58+
"coordinates": [0, 0]
59+
}
60+
}
61+
}
62+
},
63+
"layers": [
64+
{
65+
"id": "background",
66+
"type": "background",
67+
"paint": {
68+
"background-color": "white"
69+
}
70+
},
71+
{
72+
"id": "slot",
73+
"type": "slot"
74+
}
75+
]
76+
}
272 Bytes
Loading
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"comment": "We should generate warning but display layers as if slot was not set",
3+
"version": 8,
4+
"metadata": {
5+
"test": {
6+
"width": 24,
7+
"height": 24
8+
}
9+
},
10+
"sources": {
11+
"red": {
12+
"type": "geojson",
13+
"data": {
14+
"type": "Feature",
15+
"geometry": {
16+
"type": "Point",
17+
"coordinates": [0, 0]
18+
}
19+
}
20+
},
21+
"green": {
22+
"type": "geojson",
23+
"data": {
24+
"type": "Feature",
25+
"geometry": {
26+
"type": "Point",
27+
"coordinates": [0, 0]
28+
}
29+
}
30+
}
31+
},
32+
"layers": [
33+
{
34+
"id": "background",
35+
"type": "background",
36+
"paint": {
37+
"background-color": "white"
38+
}
39+
},
40+
{
41+
"id": "red",
42+
"source": "red",
43+
"slot": "slot",
44+
"type": "circle",
45+
"paint": {
46+
"circle-color": "#ff0000",
47+
"circle-radius": 10
48+
}
49+
},
50+
{
51+
"id": "green",
52+
"source": "green",
53+
"type": "circle",
54+
"slot": "slot",
55+
"paint": {
56+
"circle-color": "#008000"
57+
}
58+
}
59+
]
60+
}
272 Bytes
Loading

0 commit comments

Comments
 (0)