41 lines
974 B
JSON
41 lines
974 B
JSON
{
|
|
"propertySpec": {
|
|
"type": "string",
|
|
"property-type": "data-driven",
|
|
"expression": {"parameters": ["zoom", "feature"]}
|
|
},
|
|
"expression": ["case", ["get", "x"], "x", ["get", "y"], "y", "otherwise"],
|
|
"inputs": [
|
|
[{}, {"properties": {"x": true, "y": true}}],
|
|
[{}, {"properties": {"x": true, "y": false}}],
|
|
[{}, {"properties": {"x": false, "y": true}}],
|
|
[{}, {"properties": {"x": false, "y": false}}],
|
|
[{}, {"properties": {"x": "false", "y": false}}]
|
|
],
|
|
"expected": {
|
|
"compiled": {
|
|
"result": "success",
|
|
"isFeatureConstant": false,
|
|
"isZoomConstant": true,
|
|
"type": "string"
|
|
},
|
|
"outputs": [
|
|
"x",
|
|
"x",
|
|
"y",
|
|
"otherwise",
|
|
{
|
|
"error": "Expected value to be of type boolean, but found string instead."
|
|
}
|
|
],
|
|
"serialized": [
|
|
"case",
|
|
["boolean", ["get", "x"]],
|
|
"x",
|
|
["boolean", ["get", "y"]],
|
|
"y",
|
|
"otherwise"
|
|
]
|
|
}
|
|
}
|