Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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 Klumbumbus)

The following mapcss code is not working:

*
{
	help: tag("addr:housenumber");
}

way[prop(help)>3] > node
{
	symbol-shape: circle;
	symbol-size: 20;
}

The result should look like:

Tested with JOSM stable 7000 and latest 7080.

Attachments (1)

blue nodes.png (3.0 KB) - added by Klumbumbus 3 years ago.

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by Klumbumbus

Attachment: blue nodes.png added

comment:1 Changed 3 years ago by Klumbumbus

Description: modified (diff)

comment:2 Changed 3 years ago by bastiK

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?

comment:3 Changed 3 years ago by Klumbumbus

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 recognize (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.

Last edited 3 years ago by Klumbumbus (previous) (diff)

comment:4 Changed 3 years ago by Klumbumbus

Resolution: fixed
Status: newclosed

comment:5 Changed 3 years ago by Don-vip

Resolution: fixedworksforme
Type: defectenhancement

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.