Changes between Version 8 and Version 9 of Styles/SidewalksAndFootways


Ignore:
Timestamp:
2021-02-14T11:56:49+01:00 (5 years ago)
Author:
JeroenHoek
Comment:

Introduce settings and walking route highlighting.

Legend:

Unmodified
Added
Removed
Modified
  • Styles/SidewalksAndFootways

    v8 v9  
    1 Useful for highlighting pedestrian affairs when mapping. Visualizes the sidewalk, sidewalk:left, and sidewalk:right tags of highways, and renders various highway=footway types in different patterns. Ways that do not permit pedestrian use are made translucent, making it easy to see that a tag like foot=no or foot=use_sidepath is applied.
     1Useful for highlighting pedestrian affairs when mapping. Visualizes the `sidewalk`, `sidewalk:left`, and `sidewalk:right` tags of highways, and renders various `highway=footway` types specified via `footway=*` in different patterns. Ways that do not permit pedestrian use are (optionally) made translucent, making it easy to see that a tag like `foot=no` or `foot=use_sidepath` is applied.
    22
    33[[Image(sample.png)]]
     4
     5== Settings
     6
     7Some features of this Map Paint Style can be configured, such as the highlighting of ways that are part of hiking/walking routes. [wikitr:/Help/Dialog/MapPaint/StyleSettings You can toggle these settings in JOSM.]
     8
     9[[Image(walking-routes-highlighting.png)]]
    410
    511This style probably misses lots of useful functionality. Please let [https://www.openstreetmap.org/user/JeroenHoek me] know if you want to modify this style (if I don't reply within a reasonable span of time, go ahead and edit this style yourself).
     
    2127    This style is a fork of https://josm.openstreetmap.de/wiki/Styles/Sidewalks
    2228   
    23     Because this style introduces few more features than the above I have forked it for now. If the author of the original is willing the two may be combined in the future.
     29    Because this style introduces more features than the above I have forked it for now. If the author of the original is willing the two may be combined in the future.
    2430*/
    2531
     
    3137meta[lang=nl] {
    3238    title: "Stoepen en voetpaden (met alles dr'op en dr'an)";
    33     description: "Handig voor voetgangerszaken. Visualiseert de sidewalk, sidewalk:left, en sidewalk:right tags, en tekent de verschillende highway=footway soorten met verschillende patronen. Wegen waar voetgangers niet mogen komen worden doorschijnend gemaakt.";
    34 }
     39    description: "Handig voor voetgangerszaken. Visualiseert de sidewalk, sidewalk:left, en sidewalk:right tags, en tekent de verschillende highway=footway soorten met verschillende patronen. Wegen waar voetganers niet mogen komen worden doorschijnend gemaakt.";
     40}
     41
     42/*
     43    Settings.
     44*/
     45
     46setting::highlight_routes {
     47  type: boolean;
     48  label: tr("Highlight ways part of trails and other hiking routes");
     49  default: true;
     50}
     51
     52setting::highlight_rwn_nodes {
     53  type: boolean;
     54  label: tr("Show the node names of recreational walking node networks");
     55  default: true;
     56}
     57
     58setting::no_foot_translucent {
     59  type: boolean;
     60  label: tr("Make ways without pedestrian access translucent");
     61  default: true;
     62}
     63
     64
     65/*
     66    The sidewalk=*, sidewalk:left=*, and sidewalk:right=* tags.
     67*/
    3568
    3669way[sidewalk]::sidewalks_right,
     
    135168}
    136169
     170way[highway=pedestrian] {
     171    width: 5;
     172}
     173
    137174way[highway=footway][footway=crossing] {
    138175    width: 3;
     
    193230    width: 2;
    194231    dashes: 5, 10;
     232}
     233
     234/*
     235    Highlight walking routes.
     236*/
     237
     238relation[type=route][route=foot] > way[setting("highlight_routes")]::walking_route_bg,
     239relation[type=route][route=hiking] > way[setting("highlight_routes")]::walking_route_bg {
     240    width: 20;
     241    opacity: 0.3;
     242    color: #b4ffad;
     243    object-z-index: -1.0;
     244}
     245
     246relation[type=route][route=foot]["network:type"=node_network] > way[setting("highlight_routes")]::walking_route_bg,
     247relation[type=route][route=hiking]["network:type"=node_network] > way[setting("highlight_routes")]::walking_route_bg {
     248    width: 20;
     249    opacity: 0.3;
     250    color: #adb8ff;
     251    object-z-index: -1.0;
     252}
     253
     254/* For rwn node networks show the node number. */
     255relation[type=network]["network:type"=node_network] > node[rwn_ref][setting("highlight_rwn_nodes")]::walking_route_fg {
     256    symbol-shape: circle;
     257    symbol-fill-color: #ffffff;
     258    symbol-size: 40;
     259    symbol-stroke-width: 2;
     260    symbol-stroke-color: #555555;
     261    text: "rwn_ref";
     262    /* Scale the text based on the length of the node reference. These tend to be short (between 1 and 4 characters), but longer ones should render nicely too. */
     263    font-size: eval(18 - max(min(length(tag("rwn_ref")), 6), 2) * 1.3);
     264    text-anchor-horizontal: center;
     265    text-anchor-vertical: center;
     266    text-color: #000000;
     267    /* The halo is for longer node references: they will overlap with the circle but remain legible. */
     268    text-halo-color: #ffffff;
     269    text-halo-radius: 2;
     270    major-z-index: 5.0;
    195271}
    196272
     
    207283}
    208284
    209 way[access=no]!.foot-has-access,
    210 way[access=private]!.foot-has-access,
    211 way[foot=use_sidepath],
    212 way[foot=private],
    213 way[foot=no] {
     285way[access=no][setting("no_foot_translucent")]!.foot-has-access,
     286way[access=private][setting("no_foot_translucent")]!.foot-has-access,
     287way[foot=use_sidepath][setting("no_foot_translucent")],
     288way[foot=private][setting("no_foot_translucent")],
     289way[foot=no][setting("no_foot_translucent")] {
    214290    width: max(prop("width"), 1);
    215291    opacity: 0.3;
    216292}
    217293
    218 way[access=no]!.foot-has-access::core_access,
    219 way[access=private]!.foot-has-access::core_access,
    220 way[foot=use_sidepath]::core_access,
    221 way[foot=private]::core_access,
    222 way[foot=no]::core_access {
     294way[access=no][setting("no_foot_translucent")]!.foot-has-access::core_access,
     295way[access=private][setting("no_foot_translucent")]!.foot-has-access::core_access,
     296way[foot=use_sidepath][setting("no_foot_translucent")]::core_access,
     297way[foot=private][setting("no_foot_translucent")]::core_access,
     298way[foot=no][setting("no_foot_translucent")]::core_access {
    223299    /* ::core_access is the layer used for access restrictions in JOSM default. */
    224300    opacity: 0.3;