Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#10299 closed enhancement (fixed)

MapCSS index for last element of object

Reported by: emmexx Owned by: team
Priority: normal Milestone: 15.04
Component: Core mappaint Version: tested
Keywords: mapcss Cc: lists@…, Klumbumbus

Description

I'd like to create a style where the first node of a highway is red and the last is green.
For the 1st one I used index as in

way[highway] >[index=1] node

But I couldn't find anything about the last element. There's no "last" keyword or pseudo-class in the docs. I tried with eval(count()) but I don't know how to use it in the selector.

Is there a way to accomplish that?

Thank you

maxx

Attachments (0)

Change History (8)

comment:1 Changed 5 years ago by bastiK

Not possible at the moment. Suggested syntax: negative numbers count from last to first, so the last node would be way[highway] >[index=-1] node.

comment:2 Changed 5 years ago by Aun Johnsen <lists@…>

Cc: lists@… added

comment:3 Changed 5 years ago by Klumbumbus

Cc: Klumbumbus added

comment:4 Changed 4 years ago by simon04

Resolution: fixed
Status: newclosed

In 8206/josm:

fix #10299 - MapCSS index for last element of object

Negative index numbers count from last to first, so >[index=-1] matches the last one.

comment:5 Changed 4 years ago by simon04

Keywords: mapcss added
Milestone: 15.04

comment:6 Changed 4 years ago by Klumbumbus

Nice to see some of these old ticket fixed. Thanks!

comment:7 Changed 4 years ago by simon04

In 8236/josm:

see #10299 - Remove leftover, unwanted code line

comment:8 Changed 4 years ago by Klumbumbus

Ticket #10394 has been marked as a duplicate of this ticket.

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.