How to use property within expression?

Clash Royale CLAN TAG#URR8PPP
How to use property within expression?
I have a property in my GeoJSON file that is called "bla".
"text-field": [
'case',
['!=', ['get', 'bla'], null],
"bla%",
['==', ['get', 'bla'], null],
" ",
" ",
],
I would like to display that property within a case expression, which is not working.
If I simply pass:
"text-field": "bla%"
it is working just fine.
How do I use properties within that case expression?
Thanks
1 Answer
1
Use concat instead placeholder:
"text-field": [
"case", ['!=', ['get', 'bla'], null],
["concat", ['get', 'bla'], '%'],
['==', ['get', 'bla'], null],
" ",
" "
]
[ https://jsfiddle.net/sxma7u68/ ]
Found the error, bla has to be a string, integer is not working. Thanks again for your help!
– Niklas Karoly
Aug 10 at 17:42
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thanks! In your example it is working but somehow for me it returns nothing, not even the % sign. Any idea why this could happen?
– Niklas Karoly
Aug 10 at 14:51