summaryrefslogtreecommitdiff
path: root/test/fixtures/style_parser/text-font.style.json
blob: 215807ca81a132e422f9a6a2454eaf41deed4b31 (plain)
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
{
  "version": 8,
  "glyphs": "https://example.com/{fontstack}/{range}",
  "sources": {
    "vector": {
      "type": "vector",
      "url": "mapbox://mapbox.mapbox-streets-v5"
    }
  },
  "layers": [
    {
      "id": "minimum",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["Helvetica"],
        "text-field": "{foo}"
      }
    },
    {
      "id": "valid expression - case",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["case", ["==", "a", ["string", ["get", "text-font"]]], ["literal", ["Arial"]], ["literal", ["Helvetica"]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "valid expression - match",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["match", ["get", "text-font"], "a", ["literal", ["Arial"]], ["literal", ["Helvetica"]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "valid expression - step",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["array", "string", ["step", ["get", "text-font"], ["literal", ["Arial"]], 0, ["literal", ["Helvetica"]]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - get",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["array", "string", ["get", "text-font"]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - case",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["case", ["==", "a", ["string", ["get", "text-font"]]], ["array", "string", ["get", "text-font-a"]], ["literal", ["Helvetica"]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - match",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["match", ["get", "text-font"], "a", ["array", "string", ["get", "text-font-a"]], ["literal", ["Helvetica"]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - at",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["array", "string", ["at", 0, ["array", ["get", "text-font"]]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - coalesce",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["array", "string", ["coalesce", ["get", "text-font"]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - step",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["step", ["zoom"], ["array", "string", ["get", "text-font-0"]], 0, ["array", "string", ["get", "text-font-1"]]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - let/var",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": ["let", "p", ["array", "string", ["get", "text-font"]], ["var", "p"]],
        "text-field": "{foo}"
      }
    },
    {
      "id": "invalid expression - identity function",
      "type": "symbol",
      "source": "vector",
      "source-layer": "layer",
      "layout": {
        "text-font": {
          "type": "identity",
          "property": "text-font"
        },
        "text-field": "{foo}"
      }
    }
  ]
}