Skip to content

Commit 971f9a1

Browse files
JIghtusegithub-actions[bot]
authored andcommitted
[MAPSNAT-2941] Extend text-field tests to cover more image-related cases (internal-5181)
GitOrigin-RevId: a385b785ef05b5707ecace5accdb40f10b19ac12
1 parent 8ed9534 commit 971f9a1

File tree

6 files changed

+122
-16
lines changed

6 files changed

+122
-16
lines changed
3.61 KB
Loading
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"pixelRatio": 2,
6+
"height": 32,
7+
"width": 128
8+
}
9+
},
10+
"center": [ 0, 0 ],
11+
"zoom": 0,
12+
"camera": {"camera-projection": "orthographic"},
13+
"sources": {
14+
"point": {
15+
"type": "geojson",
16+
"data": {
17+
"type": "FeatureCollection",
18+
"features": [
19+
{
20+
"type": "Feature",
21+
"geometry": {
22+
"type": "Point",
23+
"coordinates": [ 0, 27 ]
24+
}
25+
}
26+
]
27+
}
28+
}
29+
},
30+
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
31+
"sprite": "local://sprites/standard",
32+
"layers": [
33+
{
34+
"id": "images",
35+
"type": "symbol",
36+
"source": "point",
37+
"layout": {
38+
"text-offset": [0, 2],
39+
"text-size": 20,
40+
"text-field": ["format", ["image", "london-overground"],
41+
" ",
42+
["image", "london-underground"],
43+
" ",
44+
["image", "gb-national-rail.london-dlr"],
45+
["image", "de-s-bahn.de-u-bahn"]
46+
],
47+
"text-font": [
48+
"Open Sans Semibold",
49+
"Arial Unicode MS Bold"
50+
]
51+
}
52+
}
53+
]
54+
}
6.02 KB
Loading
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"pixelRatio": 2,
6+
"height": 64,
7+
"width": 128
8+
}
9+
},
10+
"center": [ 0, 0 ],
11+
"zoom": 0,
12+
"camera": {"camera-projection": "orthographic"},
13+
"sources": {
14+
"point": {
15+
"type": "geojson",
16+
"data": {
17+
"type": "FeatureCollection",
18+
"features": [
19+
{
20+
"type": "Feature",
21+
"geometry": {
22+
"type": "Point",
23+
"coordinates": [ 0, 15 ]
24+
}
25+
}
26+
]
27+
}
28+
}
29+
},
30+
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
31+
"sprite": "local://sprites/standard",
32+
"layers": [
33+
{
34+
"id": "text",
35+
"type": "symbol",
36+
"source": "point",
37+
"layout": {
38+
"icon-image": ["image", "london-overground"],
39+
"icon-offset": [0, -20],
40+
"text-field": ["format", "London", ["image", "london-underground"]],
41+
"text-font": [
42+
"Open Sans Semibold",
43+
"Arial Unicode MS Bold"
44+
]
45+
}
46+
},
47+
{
48+
"id": "images",
49+
"type": "symbol",
50+
"source": "point",
51+
"layout": {
52+
"text-offset": [0, 2],
53+
"text-size": 20,
54+
"text-field": ["format", ["image", "london-overground"],
55+
["image", "london-underground"],
56+
["image", "gb-national-rail.london-dlr"],
57+
["image", "de-s-bahn.de-u-bahn"]
58+
],
59+
"text-font": [
60+
"Open Sans Semibold",
61+
"Arial Unicode MS Bold"
62+
]
63+
}
64+
}
65+
]
66+
}
-5.09 KB
Loading

test/integration/render-tests/text-field/formatted-images/style.json

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"metadata": {
44
"test": {
55
"pixelRatio": 2,
6-
"height": 128,
6+
"height": 32,
77
"width": 128
88
}
99
},
@@ -20,7 +20,7 @@
2020
"type": "Feature",
2121
"geometry": {
2222
"type": "Point",
23-
"coordinates": [ 0, 20 ]
23+
"coordinates": [ 0, 27 ]
2424
}
2525
}
2626
]
@@ -30,20 +30,6 @@
3030
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
3131
"sprite": "local://sprites/standard",
3232
"layers": [
33-
{
34-
"id": "text",
35-
"type": "symbol",
36-
"source": "point",
37-
"layout": {
38-
"icon-image": ["image", "london-overground"],
39-
"icon-offset": [0, -20],
40-
"text-field": ["format", "London", ["image", "london-underground"]],
41-
"text-font": [
42-
"Open Sans Semibold",
43-
"Arial Unicode MS Bold"
44-
]
45-
}
46-
},
4733
{
4834
"id": "images",
4935
"type": "symbol",

0 commit comments

Comments
 (0)