Opened 11 years ago
Closed 11 years ago
#10063 closed enhancement (fixed)
MapCSS: min() and max()
Reported by: | plepe | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.05 |
Component: | Core mappaint | Version: | |
Keywords: | Cc: |
Description
The eval-functions min() and max() are supported all right in MapCSS. As JOSM also supports lists, it would be nice if I could pass a list to both of this functions and return the smallest (or highest) number.
Attachments (0)
Change History (5)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
r7165 allows to specify for instance:
* { min_value: min(tag(x), tag(y), tag(z)); max_value: max(tag(x), tag(y), tag(z)); }
At the moment, this evaluates to NaN
/null
if one argument is not defined.
Did you have a different use-case in mind?
comment:3 by , 11 years ago
Yes, I have different use-case in mind. See this example "Highest Peaks" on https://github.com/plepe/pgmapcss/tree/master/examples (which doesn't work for JOSM right now for several reasons - it's quite pgmapcss specific).
I collect the elevation (Tag "ele") of all peaks near the current (child) peak in a list and then I take the maximum element of this list to see if the current peak is higher than all nearby peaks.
In pgmapcss I implemented min(...) to either take several parameters and then return the smallest parameter OR take a single parameter which is interpreted as list (and then the smallest list member).
comment:4 by , 11 years ago
Milestone: | → 14.05 |
---|
In 7165/josm: