Changes between Initial Version and Version 1 of Styles/Incline


Ignore:
Timestamp:
2016-06-27T19:38:40+02:00 (10 years ago)
Author:
Klumbumbus
Comment:

add new style. feedback is welcome

Legend:

Unmodified
Added
Removed
Modified
  • Styles/Incline

    v1 v1  
     1[[TranslatedPages]]
     2
     3= [[Image(incline_icon.svg,36,middle,inline)]] Incline =
     4[[PageOutline(2-9)]]
     5
     6== Description ==
     7
     8The mappaint style "Incline" displays up/down arrows at the first and last node of ways with [osmwiki:Key:incline incline=*].
     9
     10You can adjust the colours of the arrows in the preference window of JOSM.
     11
     12You can use the Incline mappaint style together with the default JOSM internal mappaint style. You can display the arrows one zoom step earlier by changing the [[Help/Dialog/MapPaint/StyleSettings|style setting]] of this style.
     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
     18Note that the up arrow is always above the node and the down arrow always below the node, independent from the direction of the way. So don't be confused (see last example in the image below).
     19
     20[[Image(example.png)]]
     21
     22[attachment:Testcenter.osm Testcenter] for quality assurance of this style.
     23
     24== Changelog ==
     25^(Latest change first)^
     26==== Version 1.0.x ====
     27* inital version
     28
     29== Code ==
     30{{{
     31#!style type="mapcss"
     32
     33meta {
     34    title: "Incline";
     35    version: "1.0.[[revision]]_[[date]]";
     36    description: "Display of up/down arrows at the first and last node of ways with incline=*.";
     37    icon: "incline.svg";
     38    author: "Klumbumbus";
     39    link: "http://josm.openstreetmap.de/wiki/Styles/Incline";
     40    min-josm-version: "8236"; /*  because of negative index counting */
     41}
     42
     43meta[lang=de] {
     44    title: "Steigung (incline)";
     45    description: "Anzeige von hoch/runter-Pfeilen am ersten und letzten Punkt von Linien mit incline=*.";
     46    link: "http://josm.openstreetmap.de/wiki/De:Styles/Incline";
     47}
     48
     49/* create settings */
     50setting::incline_z19 {
     51    type: boolean;
     52    label: tr("Display the arrows one zoom step earlier.");
     53    default: false;
     54}
     55
     56/* evaluate the incline tags */
     57way[highway][incline][incline =~ /^(up|([0-9]+\.?[0-9]*)[%°]+)$/] >[index=-1] node::incline_down_layer,
     58way[highway][incline][incline =~ /^(down|-([0-9]+\.?[0-9]*)[%°]+)$/] >[index=1] node::incline_down_layer {
     59    set incline_down;
     60}
     61
     62way[highway][incline][incline =~ /^(up|([0-9]+\.?[0-9]*)[%°]+)$/] >[index=1] node::incline_up_layer,
     63way[highway][incline][incline =~ /^(down|-([0-9]+\.?[0-9]*)[%°]+)$/] >[index=-1] node::incline_up_layer {
     64    set incline_up;
     65}
     66
     67/* display the arrow signs */
     68node|z19[setting("incline_z19")].incline_down::incline_down_layer,
     69node|z19[setting("incline_z19")].incline_down::incline_down_layer,
     70node|z20-.incline_down::incline_down_layer,
     71node|z20-.incline_down::incline_down_layer {
     72    text: eval("↧"); /* U+21A7 (8615) DOWNWARDS ARROW FROM BAR from https://de.wikipedia.org/wiki/Unicodeblock_Pfeile */
     73    text-color: incline_down#00ff00;
     74    font-size: 20;
     75    text-anchor-horizontal: center;
     76    text-anchor-vertical: top;
     77}
     78
     79node|z19[setting("incline_z19")].incline_up::incline_up_layer,
     80node|z19[setting("incline_z19")].incline_up::incline_up_layer,
     81node|z20-.incline_up::incline_up_layer,
     82node|z20-.incline_up::incline_up_layer {
     83    text: eval("↥"); /* U+21A5 (8613) UPWARDS ARROW FROM BAR from https://de.wikipedia.org/wiki/Unicodeblock_Pfeile */
     84    text-color: incline_up#ff0000;
     85    font-size: 20;
     86    text-anchor-horizontal: center;
     87    text-anchor-vertical: above;
     88}
     89}}}