Modify

Opened 6 years ago

Closed 6 years ago

#9485 closed enhancement (fixed)

MapCSS: implement "set"

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 14.01
Component: Core mappaint Version:
Keywords: mapcss grammar set Cc:

Description

From our very own implementation:

  • set is not supported, instead of
    way[highway=footway] { set path; color: #FF6644; width: 2; }
    way[highway=path]    { set path; color: brown; width: 2; }
    way.path { text:auto; text-color: green; text-position: line; text-offset: 5; }
    
    you can write
    way[highway=footway] { path-set : true; color: #FF6644; width: 2; }
    way[highway=path]    { path-set : true; color: brown; width: 2; }
    way[eval(prop(path-set))] { text:auto; text-color: green; text-position: line; text-offset: 5; }
    

I'd like to use this syntax in MapCSS-Tagchecker, we should support it.

Attachments (0)

Change History (6)

comment:1 Changed 6 years ago by simon04

What should be the effect of a set statement?

comment:2 Changed 6 years ago by Don-vip

As I understand the specification, it should allow us to define classes we can then use as selectors.

Examples I have in mind for #9379 and #9380:

way[highway=~/(motorway|trunk|primary|secondary|tertiary)(_link)?/] {
  set major_road;
}
way[highway=~/unclassified|residential|living_street|service/] {
  set minor_road;
}
way.major_road[motor_vehicle=yes] {
  throwWarning("unnecessary ...");
}
way.major_road[foot=yes] {
  throwWarning("replace by sidewalk...");
}

comment:3 Changed 6 years ago by simon04

Okay, thanks. I got the idea now.

I found an implementation in dart-mapcss: https://github.com/Gubaer/dart-mapcss/blob/master/grammar/MapCSS.g#L413-L416 Here, only identifiers are allowed (no evaluation of complex expression is performed).

comment:4 Changed 6 years ago by simon04

In 6560/josm:

see #9485 - MapCSS: add support for set class_name instruction and .class_name condition (which is specified in the MapCSS specification)

comment:5 Changed 6 years ago by simon04

In 6561/josm:

see #9485 - MapCSS: add support for set .class_name instruction (with optional . before class), define Range.ZERO_TO_INFINITY

comment:6 Changed 6 years ago by simon04

Resolution: fixed
Status: newclosed

In 6601/josm:

see #9414 fix #9485 - MapCSSTagChecker: add support for set class_name instruction and .class_name condition

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.