#9994 closed enhancement (worksforme)
mapcss: prop() in selector doesn't work together with child selector
Reported by: | Klumbumbus | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core mappaint | Version: | |
Keywords: | Cc: |
Description (last modified by )
Attachments (1)
Change History (6)
by , 10 years ago
Attachment: | blue nodes.png added |
---|
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Thanks for the explanation.
See the following gif, which is an example of the mappaint style ColouredStreets.
gif
As you can see the nodes on housenumber 5 and 18 are hardly to recocnize (because yellow on yellow). So I want to change the colour of these nodes. I found a solution for this with the following code
way["addr:street"] > node { crc: CRC32_checksum(parent_tag("addr:street"))/429496.7296; } way > node[prop(crc)>=1212][prop(crc)<1515], way > node[prop(crc)>=5151][prop(crc)<5454] { symbol-stroke-color: limegreen; }
So no need to make any changes to the JOSM code. Maybe a hint in mapcss documentatin would be good, that prop() on the left side of a child selector doesn't work.
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 by , 10 years ago
Resolution: | fixed → worksforme |
---|---|
Type: | defect → enhancement |
This is more or less by design, you can only access the properties of the current object (the node in this case).
Could you give a practical example where this feature would be indispensable? (I'm asking because it would be quite difficult to support this, given how the algorithm works at the moment.)
Maybe there are other ways to achieve the same?