Changes between Version 199 and Version 268 of Help/Styles/MapCSSImplementation


Ignore:
Timestamp:
(multiple changes)
Author:
(multiple changes)
Comment:
(multiple changes)

Legend:

Unmodified
Added
Removed
Modified
  • Help/Styles/MapCSSImplementation

    v199 v268  
    88* [wikitr:/Help/Action/Search Search dialog]
    99
     10Consider installing the [https://marketplace.visualstudio.com/items?itemName=whammo.mapcss-syntax MapCSS Syntax Highlighter] in VS Code to add visual highlighting for MapCSS paint and validator syntax.
    1011
    1112== General Structure ==
     
    2021    set: class;
    2122    set: .class;
     23    /* note that validator rules do not use the colon after set */
    2224}
    2325}}}
     
    6668
    6769=== Type selector ===
    68 
    6970{{{#!th valign=top
    7071'''Selector'''
     
    227228Selectors can include a set of conditions. If any of these conditions evaluates to false, the selector doesn't match and the style rule isn't applied.
    228229
    229 An '''attribute condition''' specifies a condition on a tag of an OSM object. 
     230An '''attribute condition''' specifies a condition on a tag of an OSM object.
    230231
    231232[=#condition_selector_operators]
    232 {{{#!th valign=top 
     233{{{#!th valign=top
    233234'''Operator'''
    234235}}}
     
    240241}}}
    241242|-------------------------------------------------------------------------------
    242 {{{#!td align=center  valign=top
     243{{{#!td align=center valign=top
    243244`=`
    244245}}}
    245 {{{#!td align=left  valign=top   
     246{{{#!td align=left valign=top
    246247Exact match of the value.
    247248}}}
    248 {{{#!td align=left  valign=top   
    249 {{{
    250 #!mapcss
    251 way[highway=residential]                    /* is case sensitive, i.e. does NOT match e.g. highway=Residential or Highway=residential */
    252 node[name="My name"]                        /* use quotes if key or value includes spaces */
    253 node["name:ru"="Калининград"]               /* use quotes if key or value includes special characters like colons or unicode characters */
    254 }}}
    255 }}}
    256 |-------------------------------------------------------------------------------
    257 {{{#!td align=center  valign=top
     249{{{#!td align=left valign=top
     250{{{
     251#!mapcss
     252way[highway=residential]                    /* is case sensitive, i.e. does NOT match e.g. highway=Residential or Highway=residential   */
     253node[name="My name"]                        /* use quotes if key or value includes spaces                                               */
     254node["name:pl"="Królewiec"]                 /* use quotes if key or value includes special characters like colons or unicode characters */
     255}}}
     256}}}
     257|-------------------------------------------------------------------------------
     258{{{#!td align=center valign=top
    258259`!=`
    259260}}}
    260 {{{#!td align=left  valign=top   
    261 Value not equal 
    262 }}}
    263 {{{#!td align=left  valign=top   
     261{{{#!td align=left valign=top
     262Value not equal
     263}}}
     264{{{#!td align=left valign=top
    264265{{{
    265266#!mapcss
    266267way[highway!=residential]
    267268node[name!="My name"]
    268 node["name:ru"!="Калининград"]
    269 }}}
    270 }}}
    271 |-------------------------------------------------------------------------------
    272 {{{#!td align=center  valign=top
     269node["name:pl"!="Królewiec"]
     270}}}
     271}}}
     272|-------------------------------------------------------------------------------
     273{{{#!td align=center valign=top
    273274`<`, `>`, `<=`, `>=`
    274275}}}
    275 {{{#!td align=left  valign=top   
    276 Comparision for numeric values.
    277 
    278 }}}
    279 {{{#!td align=left  valign=top   
     276{{{#!td align=left valign=top
     277Comparison for numeric values.
     278
     279}}}
     280{{{#!td align=left valign=top
    280281{{{
    281282#!mapcss
    282283node[population >= 50000]                   /* population greater than or equal to 50000 */
    283 node[ele = 3000]                            /* elevation with exactly 3000 meters */
    284 }}}
    285 }}}
    286 |-------------------------------------------------------------------------------
    287 {{{#!td align=center  valign=top
     284node[ele = 3000]                            /* elevation with exactly 3000 meters        */
     285}}}
     286}}}
     287|-------------------------------------------------------------------------------
     288{{{#!td align=center valign=top
    288289`^=`
    289290}}}
    290 {{{#!td align=left  valign=top   
     291{{{#!td align=left valign=top
    291292Prefix match
    292293}}}
    293 {{{#!td align=left  valign=top   
     294{{{#!td align=left valign=top
    294295{{{
    295296#!mapcss
     
    298299}}}
    299300|-------------------------------------------------------------------------------
    300 {{{#!td align=center  valign=top
     301{{{#!td align=center valign=top
    301302`$=`
    302303}}}
    303 {{{#!td align=left  valign=top   
     304{{{#!td align=left valign=top
    304305Postfix match
    305306}}}
    306 {{{#!td align=left  valign=top   
     307{{{#!td align=left valign=top
    307308{{{
    308309#!mapcss
     
    311312}}}
    312313|-----------------------------------------------
    313 {{{#!td align=center  valign=top
     314{{{#!td align=center valign=top
    314315`*=`
    315316}}}
    316 {{{#!td align=left  valign=top   
     317{{{#!td align=left valign=top
    317318Substring match
    318319}}}
    319 {{{#!td align=left  valign=top   
     320{{{#!td align=left valign=top
    320321{{{
    321322#!mapcss
     
    324325}}}
    325326|-------------------------------------------------------------------------------
    326 {{{#!td align=center  valign=top
     327{{{#!td align=center valign=top
    327328`~=`
    328329}}}
    329 {{{#!td align=left  valign=top   
     330{{{#!td align=left valign=top
    330331List membership
    331332}}}
    332 {{{#!td align=left  valign=top   
    333 {{{
    334 #!mapcss
    335 *[vending~=stamps]                          /* the tag value for the tag 'vending' consists of a list of ;-separated values    */
    336                                             /* and one of these values is 'stamps'                                             */
    337 }}}
    338 }}}
    339 |-------------------------------------------------------------------------------
    340 {{{#!td align=center  valign=top
     333{{{#!td align=left valign=top
     334{{{
     335#!mapcss
     336*[vending~=stamps]                          /* the tag value for the tag 'vending' consists of a list of ;-separated values */
     337                                            /* and one of these values is 'stamps'                                          */
     338}}}
     339}}}
     340|-------------------------------------------------------------------------------
     341{{{#!td align=center valign=top
    341342`=~`
    342343}}}
    343 {{{#!td align=left  valign=top   
    344 [https://download.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#sum Regular expression] match
    345 
    346 }}}
    347 {{{#!td align=left  valign=top   
     344{{{#!td align=left valign=top
     345[https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html#sum Regular expression] match
     346
     347}}}
     348{{{#!td align=left valign=top
    348349{{{
    349350#!mapcss
    350351*[name=~/^My_pattern.*/]                    /* the value of the tag 'name' matches with the regular expression '^My_pattern.*' */
    351                                             /* Note, that reqular expressions have to be enclosed in /.../                     */                 
    352 }}}
    353 Case-insensitive matching can be enabled via the embedded flag expression `(?i)` (see [https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#CASE_INSENSITIVE Pattern.CASE_INSENSITIVE]).
    354 {{{
    355 #!mapcss
    356 *[name =~ /^(?i)(parking)$/]                 /* matches parking, Parking, PARKING, PaRkInG,... */ 
    357 *[name =~ /^(?U)(\p{Lower})+$/]              /* name consists of only lower case unicode characters */                 
    358 }}}
    359 }}}
    360 |-------------------------------------------------------------------------------
    361 {{{#!td align=center  valign=top
     352                                            /* Note, that reqular expressions have to be enclosed in /.../                     */
     353}}}
     354Case-insensitive matching can be enabled via the embedded flag expression `(?i)` (see [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html#CASE_INSENSITIVE Pattern.CASE_INSENSITIVE]).
     355{{{
     356#!mapcss
     357*[name =~ /^(?i)(parking)$/]                 /* matches parking, Parking, PARKING, PaRkInG,...      */
     358*[name =~ /^(?U)(\p{Lower})+$/]              /* name consists of only lower case unicode characters */
     359}}}
     360}}}
     361|-------------------------------------------------------------------------------
     362{{{#!td align=center valign=top
    362363`!~` (since r6455)
    363364}}}
    364 {{{#!td align=left  valign=top   
    365 negated [https://download.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#sum Regular expression] match
    366 
    367 }}}
    368 {{{#!td align=left  valign=top   
     365{{{#!td align=left valign=top
     366negated [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html#sum Regular expression] match
     367
     368}}}
     369{{{#!td align=left valign=top
    369370{{{
    370371#!mapcss
     
    373374}}}
    374375|-------------------------------------------------------------------------------
    375 {{{#!td align=center  valign=top
     376{{{#!td align=center valign=top
    376377`∈` ([https://www.fileformat.info/info/unicode/char/2208/index.htm U+2208], since r6609)
    377378}}}
    378 {{{#!td align=left  valign=top   
     379{{{#!td align=left valign=top
    379380element of
    380381
    381382Matches when an object matches the right selector(s) contains at least one element which match the left selector(s).
    382 
    383 }}}
    384 {{{#!td align=left  valign=top   
     383}}}
     384{{{#!td align=left valign=top
    385385{{{
    386386#!mapcss
     
    389389}
    390390}}}
    391 Finds areas with `amenity=parking` that contain at least one node or area with `amenity=parking`.
    392 Since r15064 this rule produces one warning for each element on the left when there are multiple matches.
    393 }}}
    394 |-------------------------------------------------------------------------------
    395 {{{#!td align=center  valign=top
     391Finds areas with `amenity=parking` that contain at least one node or area with `amenity=parking`. Since r15064 this rule produces one warning for each element on the left when there are multiple matches.
     392}}}
     393|-------------------------------------------------------------------------------
     394{{{#!td align=center valign=top
    396395`⊆` ([https://www.fileformat.info/info/unicode/char/2286/index.htm U+2286], since r15102)
    397396}}}
    398 {{{#!td align=left  valign=top   
     397{{{#!td align=left valign=top
    399398Subset of or Equal To
    400399
    401400Synonym for `∈`.
    402401}}}
    403 {{{#!td align=left  valign=top   
     402{{{#!td align=left valign=top
    404403{{{
    405404#!mapcss
     
    411410}}}
    412411|-------------------------------------------------------------------------------
    413 {{{#!td align=center  valign=top
     412{{{#!td align=center valign=top
    414413`⊇` ([https://www.fileformat.info/info/unicode/char/2287/index.htm U+2287], since r15102)
    415414}}}
    416 {{{#!td align=left  valign=top   
     415{{{#!td align=left valign=top
    417416Superset of or Equal To
    418417
    419418Matches when an object matches the right selector(s) and is contained in one or more elements which match the left selectors.
    420 
    421 }}}
    422 {{{#!td align=left  valign=top   
    423 {{{
    424 #!mapcss
    425 area[amenity=parking] ⊇ *[amenity=parking]
     419}}}
     420{{{#!td align=left valign=top
     421{{{
     422#!mapcss
     423area[amenity=parking] ⊇ *[amenity=parking]
    426424}}}
    427425finds nodes or areas with `amenity=parking` inside areas with `amenity=parking`. Slower than `⊆` and thus not useful in validator rules, but can be useful in the search dialog.
    428 
    429 }}}
    430 |-------------------------------------------------------------------------------
    431 {{{#!td align=center  valign=top
     426}}}
     427|-------------------------------------------------------------------------------
     428{{{#!td align=center valign=top
    432429`⊈` ([https://www.fileformat.info/info/unicode/char/2288/index.htm U+2288], since r15102)
    433430}}}
    434 {{{#!td align=left  valign=top   
     431{{{#!td align=left valign=top
    435432Neither a Subset of nor Equal To
    436433
    437434Matches when an object matches the right selector(s) and does not contain any element which matches the left selectors.
    438 
    439 }}}
    440 {{{#!td align=left  valign=top   
     435}}}
     436{{{#!td align=left valign=top
    441437{{{
    442438#!mapcss
    443439*[highway=street_lamp] ⊈ area:closed2[amenity=parking][lit=yes]
    444440}}}
    445 finds areas amenity=parking that have lit=yes but don't contain a lamp.
    446 Always add `:closed2` to avoid false positives as unclosed areas never contain something.
    447 }}}
    448 |-------------------------------------------------------------------------------
    449 {{{#!td align=center  valign=top
     441finds areas amenity=parking that have lit=yes but don't contain a lamp. Always add `:closed2` to avoid false positives as unclosed areas never contain something.
     442}}}
     443|-------------------------------------------------------------------------------
     444{{{#!td align=center valign=top
    450445`⊉` ([https://www.fileformat.info/info/unicode/char/2289/index.htm U+2289], since r15102)
    451446}}}
    452 {{{#!td align=left  valign=top   
     447{{{#!td align=left valign=top
    453448Neither a Superset of nor Equal To
    454449
    455450Matches when an object matches the right selector(s) and is not contained in any area which matches the left selectors.
    456 
    457 }}}
    458 {{{#!td align=left  valign=top   
     451}}}
     452{{{#!td align=left valign=top
    459453{{{
    460454#!mapcss
    461455area[landuse=residential] ⊉ *[building]
    462456}}}
    463 finds buildings which are not inside any landuse=residential area. Note that this operator is likely to produce false positives
    464 when you have `landuse=residential`areas which don't match `:closed2`.
    465 }}}
    466 |-------------------------------------------------------------------------------
    467 {{{#!td align=center  valign=top
     457finds buildings which are not inside any landuse=residential area. Note that this operator is likely to produce false positives when you have `landuse=residential`areas which don't match `:closed2`.
     458}}}
     459|-------------------------------------------------------------------------------
     460{{{#!td align=center valign=top
    468461`⧉` ([https://www.fileformat.info/info/unicode/char/29c9/index.htm U+29C9], since r6613)
    469462}}}
    470 {{{#!td align=left  valign=top   
     463{{{#!td align=left valign=top
    471464crossing
    472 
    473 }}}
    474 {{{#!td align=left  valign=top   
     465}}}
     466{{{#!td align=left valign=top
    475467{{{
    476468#!mapcss
     
    516508|-------------------------------------------------------------------------------
    517509{{{#!td align=left  valign=top
    518 Presence of tag by [https://download.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#sum Regular expression] match (since r6547)
     510Presence of tag by [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html#sum Regular expression] match (since r6547)
    519511}}}
    520512{{{#!td align=left  valign=top   
     
    551543{{{
    552544#!mapcss
    553 way[oneway?]                  /* matches any way with a truth value in the tag 'oneway'  */
     545way[oneway?]                   /* matches any way with a truth value in the tag 'oneway' */
    554546}}}
    555547}}}
     
    561553{{{
    562554#!mapcss
    563 way[oneway?!]                  /* matches any way with a false value in the tag 'oneway'  */
     555way[oneway?!]                  /* matches any way with a false value in the tag 'oneway' */
    564556}}}
    565557}}}
     
    640632=== Zoom selector ===
    641633You can decorate a type selector with a '''zoom selector'''. The zoom selector restricts the range of zoom levels at which the respective MapCSS rule is applied.
    642 
    643 {{{#!th align=center valign=top
    644 '''Example'''
    645 }}}
    646 {{{#!th align=center valign=top
    647 '''Description'''
    648 }}}
    649 |-------------------------------------------------------------------------------
    650 || `way|z12 {...} ` || At zoom level 12 ||
    651 || `way|z13-15 {...} ` || From 13 to 15 ||
    652 || `way|z16- {...} ` || 16 and above ||
    653 || `way|z-12 {...} ` || 12 and below ||
    654 || `way {...} ` || any zoom level ||
     634||= '''Example 1''' =||= '''Example 2''' =||= '''Example 3''' =||= '''Description''' =||
     635|| `way|z12 {...}` || `node|z12 {...}` || `node|z12[...] {...}` || At zoom level 12 ||
     636|| `way|z13-15 {...}` || `node|z13-15 {...}` || `way|z13-15[...] {...}` ||From 13 to 15 ||
     637|| `way|z16- {...}` || `node|z16- {...}` || `node|z16-[...] {...}` || 16 and above ||
     638|| `way|z-12 {...}` || `node|z-12 {...}` || `node|z-12[...] {...}` || 12 and below ||
     639|| `way {...}` || `node{...}` || `way[...] {...}` || any zoom level ||
    655640
    656641The precise definition of scale ranges for each zoom level may change in the future. By rule of thumb you can expect to be approximately at zoom level ''n'' when imagery displays slippymap tiles of level ''n''.
     
    659644See [/doc/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.PseudoClasses.html Javadoc] for the up-to-date list of pseudo classes supported by JOSM's MapCSS implementation.
    660645
    661 ||= Class =||= Description =||
     646||= '''Class''' =||= '''Description''' =||
    662647|| `:closed` || true for ways where the first node is the same as the last and for any (completely downloaded) multipolygon relation ||
    663648|| `:closed2` || same as above, but this one ignores if a multipolygon is downloaded completely (since r9099) ||
     
    667652|| `:unconnected` || true for nodes that are not used by any way (since r6687) ||
    668653|| `:tagged` || What JOSM considers tagged, i.e. an object that with a tag key other than the following: `source*`, `source_ref`, `note`, `comment`, `converted_by`, `created_by`, `watch*`, `fixme`, `FIXME`, `description`, `attribution` (version r4008; in this list, `*` is a glob)
     654|| `:area-style` || true if the object has an area style ||
    669655|| `:righthandtraffic` || true if there is right-hand traffic at the current location (since r7193); see [wikitr:/left-right-hand-traffic left-right-hand-traffic] for screenshot of areas ||
    670656|| `:clockwise` || Whether the way is closed and oriented clockwise, or non-closed and the 1st, 2nd and last node are in clockwise order. ||
     
    674660|| `:in-downloaded-area` || true if an object is within source area and false if in the hatched area (since r8495). ||
    675661|| `:selected` || true if an object is selected in the editor (since r9341). ||
     662|| `:highlighted` || true if the object is highlighted ||
    676663|| `:modified` || changed and new objects (since r7193). ||
    677664You can also negate pseudo classes. E.g. `!:new` for all old objects.
     
    739726way::A { a; }
    740727way::B { b; }
    741 way::* { c; }
     728way::* { c; }  /* overrides all existing subparts */
    742729}}}
    743730is equivalent to
     
    746733way::A { a; }
    747734way::B { b; }
    748 way::A { c; }
    749 way::B { c; }
     735way::A { c; } /* overrides a with c all existing subparts */
     736way::B { c; } /* overrides b with c all existing subparts */
    750737}}}
    751738And it initializes new subparts. In other words:
     
    814801}}}
    815802You can also negate classes. E.g. `way!.path` for all ways, which are not part of the class ''.path''.
     803
     804=== Classes and Layer together ===
     805If you want to use layer and classes together, please note that you have to identify the class via is_prop_set.
     806
     807{{{#!mapcss
     808node[railway=signal] { set sgnl; }
     809
     810/* it doesn't work */
     811node.sgnl::layer_signal_icon  { z-index: 1000; ... icon: icon/signal-icon.svg; ... }
     812node.sgnl::layer_signal_text  { z-index: 1010; ... text: concat("Name of signal: ", tag("ref")); ..... )
     813
     814/* use instead: is_prop_set("...", "default") */
     815node[is_prop_set("sgnl", "default")]::layer_signal_icon  { z-index: 1000; ... icon: icon/signal-icon.svg; ... }
     816node[is_prop_set("sgnl", "default")]::layer_signal_text  { z-index: 1010; ... text: concat("Name of signal: ", tag("ref")); ..... )
     817}}}
    816818
    817819=== @supports Conditional Processing  ===
     
    10201022}}}
    10211023
    1022 Settings groups are displayed as sub-menus from the style settings menu. If at least two settings belong to a group, a special "Toggle all settings" menu item allows to quickly switch on/off all settings from this group at once. Usage example: [wiki:/Styles/MapWithAI MapWithAI].
     1024Settings groups are displayed as sub-menus from the style settings menu. If at least two settings belong to a group, a special "Toggle all settings" menu item allows to quickly switch on/off all settings from this group at once. Usage example: [wikitr:/Styles/MapWithAI MapWithAI].
    10231025
    10241026
     
    10431045|| `icon-offset-x` || Shift the icon in horizontal direction (positive values to the right) (since r8085) || ''Number'' ||  0  ||
    10441046|| `icon-offset-y` || Shift the icon in vertical direction (positive values downwards) (since r8085) || ''Number'' ||  0  ||
    1045 || `icon-rotation` || Rotate the icon clockwise or anti clockwise (negative value)(since r8260) || `[rad]`, `[rad]rad`, `[deg]°`, `[deg]deg`, `[grad]grad`, `[turn]turn` ([https://developer.mozilla.org/en/docs/Web/CSS/angle definition]) or a cardinal direction (e.g. `northeast` or `sw`); See also the functions `degree_to_radians`, `cardinal_to_radians`. ||  -  ||
     1047|| `icon-rotation` || Rotate the icon clockwise or anti clockwise (negative value)(since r8260) || `[rad]`, `[rad]rad`, `[deg]°`, `[deg]deg`, `[grad]grad`, `[turn]turn` ([https://developer.mozilla.org/en/docs/Web/CSS/angle definition]) \\ or a cardinal direction (e.g. `northeast` or `sw`); \\ or `way` to rotate the icon in the direction of the parent way. \\ See also the functions `degree_to_radians`, `cardinal_to_radians`. \\Since version 18678 function parent_way_angle() is an alternativ to way: e.g. {{{ way > node[...]::layer_x { ... icon-rotation: parent_way_angle(); ... } }}} ||  -  ||
    10461048|| `icon-position` || Define the position of the icon for areas. Same as `text-position` (since r11730). || `center`, `inside`, `line` ||  `center`  ||
    10471049|| `symbol-shape` || Display a symbol at the position of the node || `square`, `circle`, `triangle`, `pentagon`, `hexagon`, `heptagon`, `octagon`, `nonagon`, `decagon` ||  -  ||
     
    10521054|| `symbol-fill-color` || fill color for the shape || ''Color'' || `blue`, unless either `symbol-stroke-width` or `symbol-stroke-color` is set ||
    10531055|| `symbol-fill-opacity` || fill opacity || ''Opacity'' ||  1.0  ||
    1054 || `text-...`, `font-...` ||||||  general text & font properties  ||
    1055 || `text-anchor-horizontal` || horizontal text label placement || `left`, `center`, `right` ||  `right`  ||
    1056 || `text-anchor-vertical` || vertical text label placement || `above`, `top`, `center`, `bottom`, `below` ||  `bottom`  ||
    1057 || `text-rotation` || Rotate the text clockwise or anti clockwise (negative value) (since r16253) || `[rad]`, `[rad]rad`, `[deg]°`, `[deg]deg`, `[grad]grad`, `[turn]turn` ([https://developer.mozilla.org/en/docs/Web/CSS/angle definition]) or a cardinal direction (e.g. `northeast` or `sw`); See also the functions `degree_to_radians`, `cardinal_to_radians`. (Note that the direction means where the upper edge of the text faces. That means with the default direction of north the text flows to east (with a left to right language). So if you want to flow it to e.g. south you need to set east.) ||  -  ||
     1056|| `text-...`, `font-...` ||||||  see general '''Text & Font properties''' ||
    10581057
    10591058Do not rely on the default values for `symbol-...` properties (except for `opacity`). They are intended for "quick & dirty" style sheets and should be set to an explicit value.
    10601059
    1061 === Line styles ===
     1060=== Line styles ===#LineStyles
    10621061||=  '''Key''' =||= '''Description''' =||= '''Value Format''' =||= '''Default Value''' =||
    10631062|| `width` || Line width || ''Width'' ||  -  ||
    1064 || `color` || Line color || ''Color'' ||  value of `fill-color` or (if unset) JOSM's default untagged color (`#808080`) ||
     1063|| `color` || Line color || ''Color'' ||  value of `fill-color` or\\(if unset) JOSM's default \\untagged color (`#808080`) ||
    10651064|| `opacity` || How transparent the line is. || ''Opacity'' ||  1.0  ||
    10661065|| `dashes` || An array of alternating on/off lengths || list of numbers, e.g. \\> 15, 5 \\ \\may be written as expression: \\ > `list(3, 4, 5, 6)` \\ \\or the keyword `none` \\to turn dashes off ||  -  ||
     
    10701069|| `linecap` || Shape at the end of the line (see [https://www.w3.org/TR/SVG/painting.html#StrokeLinecapProperty here]) || `none`, `round`, `square` ||  `none`  ||
    10711070|| `linejoin` || Shape at the line corners || `round`, `miter`, `bevel` ||  `round`  ||
    1072 || `miterlimit` || Applies for `linejoin: miter`. Sets the maximum overshoot when line segments meet at a very small angle || ''Number'' (>= 1.0) ||  10.0  ||
    1073 || `offset` || Move line to the left or right (when looking in way direction). This could be used to draw multiple lanes for one way or mark left and right side of a way differently. || ''Number'' (positive value moves line to the left, negative to the right) ||  0  ||
     1071|| `miterlimit` || Applies for `linejoin: miter`. \\Sets the maximum overshoot when line segments meet at a very small angle || ''Number'' (>= 1.0) ||  10.0  ||
     1072|| `offset` || Move line to the left or right (when looking in way direction). \\This could be used to draw multiple lanes for one way or mark left and right side of a way differently. || ''Number'' (positive value moves line to the left,\\negative to the right) ||  0  ||
    10741073|| `text-position` || set to `line`, if text should be drawn along the line || `line`, `center` ||  -  ||
    1075 || `text-...`, `font-...` ||||||  general text & font properties  ||
     1074|| `text-...`,\\`font-...` |||||| see general '''Text & Font properties  ||
    10761075|| `repeat-image` || repeated image along a line ''(since r5801)'' || ''Image'' ||  -  ||
    10771076|| `repeat-image-width` || Width of the image (optional, see `icon-width`) ''(since r5811)'' || ''Number'' ||  -  ||
    10781077|| `repeat-image-height` || Height of the image (optional) ''(since r5811)'' || ''Number'' ||  -  ||
    1079 || `repeat-image-align` || Alignment of the image. Top-, bottom edge or the (horizontal) center line of the image will be along the line ''(since r5801)'' || `top`, `center`, `bottom` ||  `center`  ||
     1078|| `repeat-image-align` || Alignment of the image.\\Top-, bottom edge or the (horizontal) center line of the image will be along the line ''(since r5801)'' || `top`, `center`, `bottom` ||  `center`  ||
    10801079|| `repeat-image-offset` || Offset from the line ''(since r5801)'' || ''Number'' ||  0  ||
    10811080|| `repeat-image-spacing` || Spacing between repeated images ''(since r5801)'' || ''Number'' ||  0  ||
     
    10851084All these properties (except for `text-...` and `font-...`) exist also with the `casing-` prefix. The casing is a second independent line element, that is drawn below the normal line and can be used to draw a thin frame around the line in another color.
    10861085||=  '''Key''' =||= '''Description''' =||= '''Value Format''' =||= '''Default Value''' =||
    1087 || `casing-width` || Width of the border on both sides of the main line. In JOSM < 5214: Total width of the casing || ''Width'' (revers to `width` if relative width is specified) ||  -  ||
    1088 || `casing-color` || Casing color || ''Color'' ||  value of `fill-color` or (if unset) JOSM's default untagged color (`#808080`) ||
     1086|| `casing-width` || Width of the border on both sides of the main line. \\In JOSM < 5214: Total width of the casing || ''Width'' (revers to `width` if relative width is specified) ||  -  ||
     1087|| `casing-color` || Casing color || ''Color'' ||  value of `fill-color` or (if unset) \\JOSM's default untagged color (`#808080`) ||
    10891088|| `casing-opacity` || How transparent the casing is. || ''Opacity'' ||  1.0  ||
    10901089|| `casing-`... || ... || ... ||  ...  ||
    10911090Similar to `casing-`, there is also the `left-casing-` and `right-casing-` prefix. It draws additional lines to the left and to the right of the main line.
    10921091
    1093 === Area styles ===
    1094 ||=  '''Key''' =||= '''Description''' =||= '''Value Format''' =||= '''Default Value''' =||
     1092=== Area styles ===#AreaStyles
     1093||= '''Key''' =||= '''Description''' =||= '''Value Format''' =||= '''Default Value''' =||
    10951094|| `fill-color` || Color in which to fill the area. Until 11700, the alpha component was set to 50 to create a transparency effect. || ''Color'' ||  -  ||
    10961095|| `fill-image` || Image pattern || ''Image'' ||  -  ||
    10971096|| `fill-extent` || Set this property, to draw only the outline of the area. The number specifies, how far to fill from the border of the area towards the center. (If unset, the area will be filled completely) ''(since r9008)'' || ''Number'' ||  -  ||
    10981097|| `fill-extent-threshold` || Set this property, to draw full area when the given percentage of coverage is reached. Can be greater than 100% as the covered area is estimated as **perimeter * extent**. || ''Number'' ||  -  ||
    1099 || `fill-opacity` || How transparent the fill is; applies to both color and image || ''Opacity'' || 0.2 ''(since r11700, 1.0 before that)'' (can be changed with the `mappaint.fillalpha` and `mappaint.fill-image-alpha` preferences)  ||
     1098|| `fill-opacity` || How transparent the fill is; applies to both color and image || ''Opacity'' || 0.2 ''(since r11700, 1.0 before that)'' \\(can be changed with the `mappaint.fillalpha` and \\`mappaint.fill-image-alpha` preferences)  ||
    11001099|| `text-position` || set to `center`, if text should be drawn in the center of the area. Set to `inside` to place the text completely inside the area. ''(since r11722)'' || `line`, `center`, `inside` ||  -  ||
    1101 || `text-...`, `font-...` ||||||  general text & font properties  ||
     1100|| `text-...`, `font-...` ||||||  see general text & font properties  ||
    11021101Required properties to create an Area style: `fill-color` or `fill-image`
    11031102
     
    11201119}}}
    11211120{{{#!td align=left  valign=top
    1122 How to find the label text. No label is displayed, unless this instruction is present.
     1121How to find the label text.\\No label is displayed, unless this instruction is present.
    11231122}}}
    11241123{{{#!td align=left  valign=top
    11251124`auto`
    1126    Derive the text automatically. The default name tags are: "`name:`"+''<LANG>'', "`name`", "`int_name`", "`ref`", "`operator`", "`brand`" and "`addr:housenumber`".
    1127 
    1128    Configure a list of tag names in the preference "`mappaint.nameOrder`" in order to change this list. (After changing the list, a restart of JOSM is required.)
     1125  Derive the text automatically. The default name tags are: "`name:`"+''<LANG>'', \\"`name`", "`int_name`", "`ref`", "`operator`", "`brand`" and "`addr:housenumber`".
     1126
     1127  Configure a list of tag names in the preference "`mappaint.nameOrder`" in order \\ to change this list. (After changing the list, a restart of JOSM is required.)
    11291128
    11301129''String''
    1131    Denotes the key of the tag whose value is used as text.
     1130  Denotes the key of the tag whose value is used as text.
    11321131
    11331132''Expressions''
    11341133  You can enter an expression to compute the text to be displayed. Examples:
    11351134  * `eval("this is a static text")` - renderes a static text
    1136   * `eval(concat(tag("first"), "-", tag("second")))` - displays the concatenated tags "first" and "second"
     1135  * `eval(concat(tag("first"), "-", tag("second")))` - displays \\ the concatenated tags "first" and "second"
    11371136
    11381137`""`
     
    11431142}}}
    11441143|-------------------------------------------------------------------------------
    1145 || `text-color` || the text color || ''Color'' ||  `white` for lines and nodes, `#c0c0c0` for areas (JOSM "`text`" and "`areatext`" color preferences) ||
     1144|| `text-color` || the text color || ''Color'' ||  `white` for lines and nodes,\\`#c0c0c0` for areas \\(JOSM "`text`" and "`areatext`"\\color preferences) ||
    11461145|| `text-opacity` || how transparent the text is || ''Opacity'' ||  1.0  ||
    1147 || `text-offset-x` || shift the text horizontally, (not supported for text along line) || ''Number'' ||  0  ||
    1148 || `text-offset-y` (can also be written as `text-offset`)  || shift the text vertically, positive values shift the text in upwards direction  || ''Number'' ||  0  ||
    1149 || `text-halo-radius` || size of text background border (to make text visible on background with a similar color) || ''Number'' ||  -  ||
     1146|| `text-offset-x` || shift the text horizontally, \\(not supported for text along line) || ''Number'' ||  0  ||
     1147|| `text-offset-y`\\(can also be written as\\`text-offset`)  || shift the text vertically, positive values shift the text in upwards direction  || ''Number'' ||  0  ||
     1148|| `text-halo-radius` || size of text background border \\(to make text visible on background \\with a similar color) || ''Number'' ||  -  ||
    11501149|| `text-halo-color` || color of the text halo || ''Color'' ||  complement of the text color  ||
    11511150|| `text-halo-opacity` || transparency for the text halo || ''Opacity'' ||  1.0  ||
    1152 || `font-family` || font family || ''String'' ||  "Droid Sans" \\(JOSM preference "mappaint.font")  ||
    1153 || `font-size` || font size || ''Number'' ||  8 \\(JOSM preference "mappaint.fontsize")  ||
     1151|| `text-anchor-horizontal` || horizontal text label placement || `left`, `center`, `right` ||  `right`  ||
     1152|| `text-anchor-vertical` || vertical text label placement || `above`, `top`, `center`, `bottom`, `below` ||  `bottom`  ||
     1153|| `text-rotation` || Rotate the text clockwise or anti clockwise (negative value)\\(since r16253) || `[rad]`, `[rad]rad`, `[deg]°`, `[deg]deg`, `[grad]grad`, `[turn]turn` \\([https://developer.mozilla.org/en/docs/Web/CSS/angle definition]) or a cardinal direction (e.g. `northeast` or `sw`); \\ or `way` to rotate the text in the direction of the parent way. \\See also the functions `degree_to_radians`, `cardinal_to_radians`. \\Since version 18678 function parent_way_angle() is an alternativ to way: e.g. {{{ way > node[...]::layer_x { ... text-rotation: parent_way_angle(); ... } }}} \\(Note that the direction means where the upper edge of the text faces.\\That means with the default direction of north the text flows to east\\(with a left to right language). \\So if you want to flow it to e.g. south you need to set east.) ||  -  ||
     1154|| `text-position` |||||| see [#AreaStyles Area styles] and [#LineStyles Line styles] ||
     1155|| `font-family` || font family || ''String'' ||  "Droid Sans" \\(JOSM preference "`mappaint.font`")  ||
     1156|| `font-size` || font size || ''Number'' ||  8 \\(JOSM preference "`mappaint.fontsize`")  ||
    11541157|| `font-weight` || bold or not || `bold`, `normal` ||  `normal`  ||
    11551158|| `font-style` || italic or not || `italic`, `normal` ||  `normal`  ||
     
    11591162* In [wikitr:/Rules Validator rules] they must be prefixed by a `-`, e.g.: `-osmoseItemClassLevel: "1210/1/1";`
    11601163
    1161 === Property values explanations ===
     1164=== Property values explanations === #Propertyvaluesexplanations
    11621165'' '''Width''' ''
    11631166 - 14.0 (any positive number)
     
    11751178 * '''`rgba(/*r*/, /*g*/, /*b*/, /*alpha*/)`''' - rgb value with alpha
    11761179 * '''`hsb_color(/*hue*/, /*saturation*/, /*brightness*/)`''' - color from HSB color space
     1180 * if the color is prefixed with a name and #, e.g. `color: highway_track#6e541c;` it will appear in the [wikitr:/Help/Preferences/ColorPreference Color Preference] and end users can adjust the color there themself
    11771181
    11781182'' '''Opacity''' ''
     
    11971201  comparison operators
    11981202 asin, atan, atan2, ceil, cos, cosh, exp, floor, log, max, min, mod (since r17759), random, round, signum, sin, sinh, sqrt, tan, tanh::
    1199   the usual meaning, [https://download.oracle.com/javase/8/docs/api/java/lang/Math.html details]
     1203  the usual meaning, [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html details]
    12001204 cond(b, fst, snd)::
    12011205 b ? fst : snd::
     
    12421246  assemble the strings to one
    12431247 join(''sep'', ''str1'', ''str2'', ...)::
    1244   join strings, whith ''sep'' as separator [''since r6737'']
     1248  join strings, with ''sep'' as separator [''since r6737'']
    12451249 join_list(''sep'', ''list_name'')::
    12461250   joins the elements of the list ''list_name'' to one string separated by the separator ''sep'' [''since r8775'']
     
    12701274  return the substring of ''str'', starting at index ''idx'' (0-indexed) [''since r6534'']
    12711275 substring(str, start, end)::
    1272   return the substring of ''str'', starting at index ''start'' (inclusive) up to ''end'' (exclusive) (0-indexed) [''since r6534'']
     1276  return the substring of ''str'', starting at index ''start'' (inclusive) up to ''end'' (exclusive) (0-indexed) [''since r6534''], a negative end index counts from the string end [''since r19259'']
    12731277 replace(string, old, new)::
    12741278   Replaces any occurrence of the substring ''old'' within the string ''string'' with the text ''new''
     
    12951299 CRC32_checksum(''str'')::
    12961300  calculate the CRC32 checksum of a string (result is an integer from 0 to 2^32^-1) [''since r6908'']
     1301 siunit_length(''str'')::
     1302   convert length units to meter (fault tolerant, ignoring white space) [''since r19089'']
    12971303 is_right_hand_traffic()::
    12981304  Check if there is left-hand or right-hand traffic at the current location. [''since r7193'']
     
    13251331 sort(''str1'', ''str2'', ''str3'', ''...'')::
    13261332  sorts an array of strings [''since r15279'']
    1327  sort_list()::
     1333 sort_list(''list_name'')::
    13281334  sorts a list of strings [''since r15279'']
    13291335 tag_regex(''regex'')::
    1330   returns a list of values that match the regex [''since r15317'']
     1336  returns a list containing the values of keys that match the regex [''since r15317'']
    13311337 to_boolean(''str'')::
    13321338  returns the string argument as a boolean [''since r16110'']
     
    13451351 uniq(''str1'', ''str2'', ''str3'', ''...'')::
    13461352  returns a list of strings that only have unique values from an array of strings [''since r15323'']
    1347  uniq_list()::
    1348   returns a list of strings that only have unique values from a list of strings [''since r15353'']
     1353 uniq_list(''list_name'')::
     1354  returns a list of strings that only have unique values from a list of strings [''since r15323'']
     1355 parent_way_angle()::
     1356  returns the angle of the parent way as a double in rad [''since r18664''] (see: text-rotation or icon-rotation)
     1357 convert_primitive_to_string(''PrimitiveId'')::
     1358  returns the primitive id as a string [''since r18829'']
     1359 convert_primitives_to_string(''PrimitiveId'', ''PrimitiveId'', ''...'')::
     1360  returns a list of primitive ids converted to strings [''since r18829'']
     1361 parent_osm_primitives(''optional key'', ''optional value'')::
     1362  returns a list of primitive ids which match the key and value (if present) [''since r18829'']
    13491363
    13501364=== Examples ===
     
    14061420}}}
    14071421
     1422* casing on inside of area
     1423{{{
     1424#!mapcss
     1425area[building]:clockwise {
     1426    right-casing-width: 10;
     1427}
     1428area[building]:anticlockwise {
     1429    left-casing-width: 10;
     1430}
     1431/* or */
     1432area[building][is_clockwise()] {
     1433    right-casing-width: 10;
     1434}
     1435area[building][is_anticlockwise()] {
     1436    left-casing-width: 10;
     1437}
     1438}}}
     1439
     1440* case insensitive selector. This matches: `Name=Main Street`, but also `naMe=MAIN STREET`
     1441{{{
     1442#!mapcss
     1443way[/(?i)^name$/ =~ /(?i)^Main Street$/] {
     1444}
     1445}}}
     1446
    14081447
    14091448== Compatibility notes ==