Changes between Version 4 and Version 5 of Styles/PublicTransportV2


Ignore:
Timestamp:
2017-11-06T18:56:46+01:00 (8 years ago)
Author:
Ialokim <ialokim@…>
Comment:

version 1.5

Legend:

Unmodified
Added
Removed
Modified
  • Styles/PublicTransportV2

    v4 v5  
    1212== Known limitations / bugs ==
    1313
    14 * Because it is currently impossible to get the parent's `osm id` within MapCSS, the style is using the parent's name for coloring its members. So, all `public_transport=stop_area` relations with the same name will have the same coloring. Zooming out should help to see if you are dealing with one stop area (the name will only be shown once) or more (the name will be shown more times).
    15 
     14* Because it is currently impossible to get the parent's `osm id` within MapCSS (see [https://josm.openstreetmap.de/ticket/15525]), the style is using the parent's name for coloring its members. So, all `public_transport=stop_area` relations with the same name will have the same coloring. Zooming out should help to see if you are dealing with one stop area (the name will only be shown once) or more (the name will be shown more times).
     15
     16== Changes ==
     17
     18=== version 1.5 ===
     19* bugfix: selected ways should be shown with red color
     20* bugfix: routes are now colored following their `colour` tag
     21* added: properly show `stop_area` names if first child is area
     22* added: routes are only colored for zoom level >= 13
    1623
    1724== Code ==
     
    2330    title: "Public Transport v2";
    2431    description: "Highlight important information regarding public transport according to public transport version 2.";
    25     version: "1.[[revision]]_[[date]]";
     32    version: "1.5.[[revision]]_[[date]]";
    2633    author: "Ialokim";
    2734    link: "https://josm.openstreetmap.de/wiki/Styles/PublicTransportV2";
     
    153160        text: parent_tag(name);
    154161}
     162relation[public_transport=stop_area] >[index=1] area|z15-18 {
     163        text: parent_tag(name);
     164        text-position: center;
     165        text-color: white;
     166        text-opacity: 1.0;
     167        font-size: 12;
     168        text-halo-radius: 3;
     169        text-halo-color: #000000;
     170        text-halo-opacity: 0.8;
     171        font-weight: bold;
     172}
    155173relation[public_transport=stop_area] > node|z19-20[public_transport=stop_position] {
    156174        text: "";
    157175}
    158176relation[public_transport=stop_area] > node|z19-[public_transport=platform],
    159 relation[public_transport=stop_area] > node|z21-[public_transport=stop_position],
    160 relation[public_transport=stop_area] > area|z16- {
    161         text: cond(tag(name)==parent_tag(name),tag(name),concat(tag(name), " | ", parent_tag(name)));
     177relation[public_transport=stop_area] > node|z21-[public_transport=stop_position] {
     178        text: cond(tag(name)==parent_tag(name),tag(name),concat(tag(name), " / ", parent_tag(name)));
    162179}
    163180relation[public_transport=stop_area] >[index=1] node|z16-18,
     
    208225
    209226/*** Route relations ***/
    210 relation[type=route][route=bus] > way::halo,
    211 relation[type=route][route=tram] > way::halo,
    212 relation[type=route][route=light_rail] > way::halo,
    213 relation[type=route][route=subway] > way::halo,
    214 relation[type=route][route=train] > way::halo {
     227relation[type=route][route=bus] > way|z13-::halo,
     228relation[type=route][route=tram] > way|z13-::halo,
     229relation[type=route][route=light_rail] > way|z13-::halo,
     230relation[type=route][route=subway] > way|z13-::halo,
     231relation[type=route][route=train] > way|z13-::halo {
    215232        object-z-index: -1.0;
    216         color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7);
     233        color: parent_tag(colour);
    217234        width: 16;
    218235        opacity: 0.5;
    219236        linecap: round;
    220237        linejoin: round;
    221         text-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7);
     238        text-color: parent_tag(colour);
    222239        font-size: 18;
    223240        text: parent_tag(ref);
     
    225242        text-offset-y: 20;
    226243}
    227 relation[type=route] > way:selected::halo,
    228 relation[type=route][route=tram] > way:selected::halo,
    229 relation[type=route][route=light_rail] > way:selected::halo,
    230 relation[type=route][route=subway] > way:selected::halo,
    231 relation[type=route][route=train] > way:selected::halo {
    232         color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5);
    233         text-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5);
     244relation[type=route] > way:selected,
     245relation[type=route][route=tram] > way:selected,
     246relation[type=route][route=light_rail] > way:selected,
     247relation[type=route][route=subway] > way:selected,
     248relation[type=route][route=train] > way:selected {
     249        color: red;
    234250}
    235251