Changes between Version 126 and Version 127 of Help/Styles/MapCSSImplementation


Ignore:
Timestamp:
2016-12-09T15:47:27+01:00 (7 years ago)
Author:
Klumbumbus
Comment:

add one more example for multiple icons and texts, see ticket:14098#comment:4

Legend:

Unmodified
Added
Removed
Modified
  • Help/Styles/MapCSSImplementation

    v126 v127  
    645645The name for the layer can be any identifier.
    646646
    647  default::
    648  If you omit the layer in the selector, this is the same as using {{{::default}}}.
    649  *::
    650  In addition, you can use the * layer to override and initialize all layers.[[br]]
    651  It overrides all existing subparts, so
     647If you omit the layer in the selector, this is the same as using {{{::default}}}.
     648
     649One more example:
     650{{{
     651#!mapcss
     652node[amenity=parking] {
     653    icon-image: "presets/vehicle/parking/parking.svg";    /* displays the josm internal parking icon in the default layer */
     654    text: ref;                                            /* displays the value of the key ref as text in the default layer */
     655}
     656
     657node[amenity=parking][fee=yes]::fee {
     658    icon-image: "presets/money/exchange.svg";             /* displays the josm internal exchange icon in the fee layer */
     659    icon-offset-x: 14;                                    /* shift the icon */
     660    icon-offset-y: -12;                                   /* shift the icon */
     661    text: charge;                                         /* displays the value of the key charge as text in the fee layer */
     662    text-offset-x: 16;                                    /* shift the text */
     663    text-offset-y: 17;                                    /* shift the text */
     664}
     665}}}
     666The result looks this way:
     667
     668[[Image(multiple_icons_and_texts.png)]]
     669
     670In addition, you can use the * layer to override and initialize all layers.[[br]]
     671It overrides all existing subparts, so
     672
    652673{{{
    653674#!mapcss