wiki:Styles/Incline

Languages:

Icon Incline

Description

The mappaint style "Incline" displays up/down arrows at the first and last node of ways with incline=*.

You can adjust the colours of the arrows in the preference window of JOSM.

You 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 style setting of this style.

For ideas/questions/bugs/suggestions or similar please write a message to Klumbumbus.

Feel free to translate this wiki page into more languages. Already translated languages see top right.

Note that the up arrow is always above the node and the down arrow always below the node, independent from the cardinal direction of the way. So don't be confused (see first and fourth example from the left in the image below).

example (NOZIP)

Testcenter for quality assurance of this style.

Changelog

(Latest change first)

Version 2.1

  • made background of icon transparent

Version 2.0

  • display incline=0° and incline=0% (and variants like 0.0% or 0.00°) with yellow left right arrows instead of red/green up/down arrows
  • don't display wrong values with several units, e.g. incline=5%%
  • don't display wrong values incline=0.% and incline=0.°
  • remove duplicate code

Version 1.0

  • inital version

Code

meta {
    title: "Incline";
    version: "2.1.10_2020-09-04";
    description: "Display of up/down arrows at the first and last node of ways with incline=*.";
    icon: "incline_icon.svg";
    author: "Klumbumbus";
    link: "https://josm.openstreetmap.de/wiki/Styles/Incline";
    min-josm-version: "8236"; /*  because of negative index counting */
}

meta[lang=de] {
    title: "Steigung (incline)";
    description: "Anzeige von hoch/runter-Pfeilen am ersten und letzten Punkt von Linien mit incline=*.";
    link: "https://josm.openstreetmap.de/wiki/De:Styles/Incline";
}

/* create settings */
setting::incline_z19 {
    type: boolean;
    label: tr("Display the arrows one zoom step earlier.");
    default: false;
}

/* evaluate the incline tags */
way[highway][incline][incline =~ /^(up|([0-9]+(\.?[0-9]+)?)[%°])$/][incline !~ /^((0(\.0+)?)[%°])$/] >[index=-1] node::incline_down_layer,
way[highway][incline][incline =~ /^(down|-([0-9]+(\.?[0-9]+)?)[%°])$/][incline !~ /^((0(\.0+)?)[%°])$/] >[index=1] node::incline_down_layer {
    set incline_down;
}

way[highway][incline][incline =~ /^(up|([0-9]+(\.?[0-9]+)?)[%°])$/][incline !~ /^((0(\.0+)?)[%°])$/] >[index=1] node::incline_up_layer,
way[highway][incline][incline =~ /^(down|-([0-9]+(\.?[0-9]+)?)[%°])$/][incline !~ /^((0(\.0+)?)[%°])$/] >[index=-1] node::incline_up_layer {
    set incline_up;
}

way[highway][incline][incline =~ /^((0(\.0+)?)[%°])$/] >[index=-1] node::incline_zero_layer,
way[highway][incline][incline =~ /^((0(\.0+)?)[%°])$/] >[index=1] node::incline_zero_layer {
    set incline_zero;
}

/* display the arrow signs */
node|z19[setting("incline_z19")].incline_down::incline_down_layer,
node|z20-.incline_down::incline_down_layer {
    text: eval("↧"); /* U+21A7 (8615) DOWNWARDS ARROW FROM BAR from https://de.wikipedia.org/wiki/Unicodeblock_Pfeile */
    text-color: incline_down#00ff00;
    font-size: 20;
    text-anchor-horizontal: center;
    text-anchor-vertical: top;
}

node|z19[setting("incline_z19")].incline_up::incline_up_layer,
node|z20-.incline_up::incline_up_layer {
    text: eval("↥"); /* U+21A5 (8613) UPWARDS ARROW FROM BAR from https://de.wikipedia.org/wiki/Unicodeblock_Pfeile */
    text-color: incline_up#ff0000;
    font-size: 20;
    text-anchor-horizontal: center;
    text-anchor-vertical: above;
}

node|z19[setting("incline_z19")].incline_zero::incline_zero_layer,
node|z20-.incline_zero::incline_zero_layer {
    text: eval("← →"); /* U+2190 (8592) LEFTWARDS ARROW and U+2192 (8594) RIGHTWARDS ARROW from https://de.wikipedia.org/wiki/Unicodeblock_Pfeile */
    text-color: incline_zero#ffff00;
    font-size: 20;
    text-anchor-horizontal: center;
    text-anchor-vertical: center;
    
}

Styles_Incline-style.mapcss, Styles_Incline.zip

Last modified 4 years ago Last modified on 2020-09-04T14:47:55+02:00

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.