Changes between Initial Version and Version 1 of Styles/Bench


Ignore:
Timestamp:
2017-08-06T19:41:07+02:00 (7 years ago)
Author:
Klumbumbus
Comment:

new style, have fun :)

Legend:

Unmodified
Added
Removed
Modified
  • Styles/Bench

    v1 v1  
     1[[TranslatedPages]]
     2
     3= [[Image(backrest_yes.svg,36,middle,inline)]] Recycling Materials =
     4[[PageOutline(2-9)]]
     5
     6== Description ==
     7
     8The mappaint style "Bench" displays the following [osmwiki:Tag:amenity=bench bench] tags: seats, material, colour, backrest.
     9
     10You can use this mappaint style together with the default JOSM internal mappaint style. You can adjust the appearance in the [[Help/Dialog/MapPaint/StyleSettings|style settings]] of this style.
     11
     12For the materials the style uses the local translations of the internal bench preset.
     13
     14For ideas/questions/bugs/suggestions or similar please write a message to [osmwww:user/Klumbumbus Klumbumbus].
     15
     16Feel free to translate this wiki page into more languages. Already translated languages see top right.
     17
     18[[Image(Examples.png)]]
     19
     20^Example^
     21
     22== Code ==
     23{{{
     24#!style type="mapcss"
     25
     26meta {
     27    title: "Bench";
     28    version: "1.0.[[revision]]_[[date]]";
     29    description: "Displays details of bench tags.";
     30    icon: "backrest_yes.svg";
     31    author: "Klumbumbus";
     32    link: "http://josm.openstreetmap.de/wiki/Styles/Bench";
     33    min-josm-version: "7450"; /* because of user settings */
     34}
     35
     36meta[lang=de] {
     37    title: "Bank";
     38    description: "Zeigt Details von Sitzbanktags an.";
     39    link: "http://josm.openstreetmap.de/wiki/De:Styles/Bench";
     40}
     41
     42/* user settings, fits to zoom behavior of default style if set to true */
     43setting::hide_bench {
     44    type: boolean;
     45    label: tr("Hide at low zoom");
     46    default: true;
     47}
     48
     49/* seats and material as text (uses user language if translated via the internal bench preset) */
     50node[amenity=bench]::benchlayer {
     51    text-anchor-horizontal: center;
     52    text-anchor-vertical: below;
     53    font-size: 9;
     54}
     55node|z22-::benchlayer {
     56    font-size: 11;
     57}
     58node[amenity=bench][seats][!material]::benchlayer {
     59    text: seats;
     60}
     61node[amenity=bench][!seats][material]::benchlayer {
     62    text: tr(tag(material));
     63}
     64node[amenity=bench][seats][material]::benchlayer {
     65    text: eval(concat(tag(seats), " | " ,tr(tag(material))));
     66}
     67
     68/* backrest as icon */
     69node[amenity=bench][backrest!=yes][backrest!=no] {
     70    icon-image: backrest_unknown.svg;
     71}
     72node[amenity=bench][backrest=yes] {
     73    icon-image: backrest_yes.svg;
     74}
     75node[amenity=bench][backrest=no] {
     76    icon-image: backrest_no.svg;
     77}
     78
     79/* colour as coloured filled circle */
     80node[amenity=bench][colour]::benchlayer {
     81    symbol-shape: circle;
     82    symbol-stroke-opacity: 0;
     83    symbol-fill-color: eval(tag(colour));
     84    symbol-size: 22;
     85    z-index: -1;
     86}
     87
     88/* Hide on low zoom */
     89node|z-17[setting("hide_bench")]::benchlayer {
     90    text: "";
     91}
     92node|z-16[setting("hide_bench")]::benchlayer {
     93    symbol-fill-opacity: 0;
     94}
     95node|z-16[setting("hide_bench")] {
     96    icon-image: none;
     97}
     98
     99}}}