Files
MapLibreParticleLab/metrics/integration/expression-tests/case/basic/test.json
2023-03-25 14:46:49 +01:00

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"
]
}
}