Closed zdila closed 4 years ago
Logical operators (and, or, not) in mapnik expressions convert arguments to boolean, and return boolean result; unlike modern scripting languages that test argument truthiness and return one of the original arguments.
edit: We might consider changing this in future. That'd obviously break expressions where the result is actually expected to be boolean, but I'd assume such usage to be rare.
Thanks for explanation.
I am trying to implement if-then-else operator. Please see https://github.com/mapnik/mapnik-support/issues/133#issuecomment-603084744.
Hello,
I've read somewhere that mapnik now upports expressions everywhere. How does it distinguish between expression and value? For example
stroke-dasharray="'3,3'"
doesn't work.In my case I am trying yo use it like ternary operator:
<LineSymbolizer stroke-dasharray="([intermittent] or [seasonal]) and '3,3' or '1000,0'" ...
Unfortunately it doesn't work - it renders no line. I know I can do it on SQL level, but I find this approach cleaner.