| | 1 | Useful for pedestrian mapping. Visualizes the sidewalk, sidewalk:left, and sidewalk:right attribute of highways, and renders various hihgway=footway types in different patterns. Ways that do not permit pedestrian use are made translucent. |
| | 2 | |
| | 3 | [[Image(sample.png)]] |
| | 4 | |
| | 5 | This 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). |
| | 6 | |
| | 7 | {{{ |
| | 8 | #!style type="mapcss" |
| | 9 | |
| | 10 | meta { |
| | 11 | title: "Sidewalks and footways (with knobs on)"; |
| | 12 | description: "Useful for pedestrian mapping. Visualizes the sidewalk, sidewalk:left, and sidewalk:right attribute of highways, and renders various hihgway=footway types in different patterns. Ways that do not permit pedestrian use are made translucent."; |
| | 13 | link: "https://wiki.openstreetmap.org/wiki/Key:sidewalk"; |
| | 14 | author: "Jeroen Hoek"; |
| | 15 | version: "1.[[revision]]_[[date]]"; |
| | 16 | min-josm-version: "17428"; |
| | 17 | } |
| | 18 | |
| | 19 | /* |
| | 20 | This style is a fork of https://josm.openstreetmap.de/wiki/Styles/Sidewalks |
| | 21 | |
| | 22 | 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. |
| | 23 | */ |
| | 24 | |
| | 25 | meta[lang=de] { |
| | 26 | title: "Geh- und Fußwegen (mit allen Schikanen)"; |
| | 27 | } |
| | 28 | |
| | 29 | meta[lang=nl] { |
| | 30 | title: "Stoepen en voetpaden (en niet zo'n klein beetje)"; |
| | 31 | description: "Handig voor voetgangerszaken. Visualiseert de sidewalk, sidewalk:left, en sidewalk:right eigenschappen van wegen, en tekent de verschillende highway=footway soorten met verschillende patronen. Wegen waar voetganers niet mogen komen worden doorschijnend gemaakt."; |
| | 32 | } |
| | 33 | |
| | 34 | way[sidewalk]::sidewalks_right, |
| | 35 | way["sidewalk:right"]::sidewalks_right { |
| | 36 | width: 3; |
| | 37 | dashes: 5, 1; |
| | 38 | offset: min(eval(0 - 10 - (prop("width") * 0.5) - (prop("width", "default") * 0.5)), -10); |
| | 39 | } |
| | 40 | way[sidewalk]::sidewalks_left, |
| | 41 | way["sidewalk:left"]::sidewalks_left { |
| | 42 | width: 3; |
| | 43 | dashes: 5, 1; |
| | 44 | offset: max(eval(10 + (prop("width") * 0.5) + (prop("width", "default") * 0.5)), 10); |
| | 45 | } |
| | 46 | |
| | 47 | way[sidewalk=right][!"sidewalk:right"]::sidewalks_right, |
| | 48 | way[sidewalk=both][!"sidewalk:right"]::sidewalks_right { |
| | 49 | set sidewalk-yes; |
| | 50 | } |
| | 51 | way[sidewalk=left][!"sidewalk:left"]::sidewalks_left, |
| | 52 | way[sidewalk=both][!"sidewalk:left"]::sidewalks_left { |
| | 53 | set sidewalk-yes; |
| | 54 | } |
| | 55 | |
| | 56 | /* left, no, and none mean no sidewalk on the right if sidewalk:right is not set. */ |
| | 57 | way[sidewalk=~/^(left)|(no(ne)?)$/][!"sidewalk:right"]::sidewalks_right { |
| | 58 | set sidewalk-no; |
| | 59 | } |
| | 60 | /* right, no, and none mean no sidewalk on the left if sidewalk:left is not set. */ |
| | 61 | way[sidewalk=~/^(right)|(no(ne)?)$/][!"sidewalk:left"]::sidewalks_left { |
| | 62 | set sidewalk-no; |
| | 63 | } |
| | 64 | |
| | 65 | way[sidewalk=separate][!"sidewalk:right"]::sidewalks_right { |
| | 66 | set sidewalk-separate; |
| | 67 | } |
| | 68 | way[sidewalk=separate][!"sidewalk:left"]::sidewalks_left { |
| | 69 | set sidewalk-separate; |
| | 70 | } |
| | 71 | |
| | 72 | /* More specific values can override the general sidewalk=* tag. */ |
| | 73 | |
| | 74 | way["sidewalk:left"=yes]::sidewalks_left { |
| | 75 | set sidewalk-yes; |
| | 76 | } |
| | 77 | way["sidewalk:right"=yes]::sidewalks_right { |
| | 78 | set sidewalk-yes; |
| | 79 | } |
| | 80 | |
| | 81 | way["sidewalk:left"=~/^no(ne)?$/]::sidewalks_left { |
| | 82 | set sidewalk-no; |
| | 83 | } |
| | 84 | way["sidewalk:right"=~/^no(ne)?$/]::sidewalks_right { |
| | 85 | set sidewalk-no; |
| | 86 | } |
| | 87 | |
| | 88 | way["sidewalk:left"=separate]::sidewalks_left { |
| | 89 | set sidewalk-separate; |
| | 90 | } |
| | 91 | way["sidewalk:right"=separate]::sidewalks_right { |
| | 92 | set sidewalk-separate; |
| | 93 | } |
| | 94 | |
| | 95 | /* Styling. */ |
| | 96 | |
| | 97 | way.sidewalk-yes::sidewalks_left { |
| | 98 | color: #00ff00; |
| | 99 | } |
| | 100 | way.sidewalk-yes::sidewalks_right { |
| | 101 | color: #00ff00; |
| | 102 | } |
| | 103 | |
| | 104 | way.sidewalk-separate::sidewalks_left { |
| | 105 | color: #00aa00; |
| | 106 | dashes: 5, 10; |
| | 107 | opacity: 0.7; |
| | 108 | } |
| | 109 | way.sidewalk-separate::sidewalks_right { |
| | 110 | color: #00aa00; |
| | 111 | dashes: 5, 10; |
| | 112 | opacity: 0.7; |
| | 113 | } |
| | 114 | |
| | 115 | way.sidewalk-no::sidewalks_left { |
| | 116 | color: #ff0000; |
| | 117 | opacity: 0.5; |
| | 118 | } |
| | 119 | way.sidewalk-no::sidewalks_right { |
| | 120 | color: #ff0000; |
| | 121 | opacity: 0.5; |
| | 122 | } |
| | 123 | |
| | 124 | /* Styling of other related highways. */ |
| | 125 | |
| | 126 | way[highway=footway] { |
| | 127 | color: #00ff00; |
| | 128 | width: 1; |
| | 129 | } |
| | 130 | |
| | 131 | way[highway=footway][footway=sidewalk] { |
| | 132 | width: 3; |
| | 133 | } |
| | 134 | |
| | 135 | way[highway=footway][footway=crossing] { |
| | 136 | width: 3; |
| | 137 | color: #00aa80; |
| | 138 | dashes: 3, 6; |
| | 139 | } |
| | 140 | way|z19-[highway=footway][footway=crossing] { |
| | 141 | width: 1; |
| | 142 | color: #00aa80; |
| | 143 | dashes: none; |
| | 144 | } |
| | 145 | way|z19-[highway=footway][footway=crossing]::sidewalks_left { |
| | 146 | offset: 11.5; |
| | 147 | width: 2; |
| | 148 | color: #00aa80; |
| | 149 | dashes: 5; |
| | 150 | } |
| | 151 | way|z19-[highway=footway][footway=crossing]::sidewalks_right { |
| | 152 | offset: -11.5; |
| | 153 | width: 2; |
| | 154 | color: #00aa80; |
| | 155 | dashes: 5; |
| | 156 | } |
| | 157 | |
| | 158 | way[highway=footway][footway=traffic_island] { |
| | 159 | width: 3; |
| | 160 | color: #00aa80; |
| | 161 | } |
| | 162 | way|z19-[highway=footway][footway=island], |
| | 163 | way|z19-[highway=footway][footway=traffic_island] { |
| | 164 | width: 1; |
| | 165 | color: #00aa80; |
| | 166 | } |
| | 167 | way|z19-[highway=footway][footway=island]::sidewalks_left, |
| | 168 | way|z19-[highway=footway][footway=traffic_island]::sidewalks_left { |
| | 169 | offset: 10; |
| | 170 | width: 5; |
| | 171 | color: #00aa80; |
| | 172 | dashes: 5; |
| | 173 | } |
| | 174 | way|z19-[highway=footway][footway=island]::sidewalks_right, |
| | 175 | way|z19-[highway=footway][footway=traffic_island]::sidewalks_right { |
| | 176 | offset: -10; |
| | 177 | width: 5; |
| | 178 | color: #00aa80; |
| | 179 | dashes: 5; |
| | 180 | } |
| | 181 | |
| | 182 | way[highway=footway][footway=link] { |
| | 183 | width: 3; |
| | 184 | color: #69aa00; |
| | 185 | dashes: 2, 4; |
| | 186 | } |
| | 187 | |
| | 188 | way[highway=footway][footway=alley], |
| | 189 | way[highway=footway][footway=access_aisle], |
| | 190 | way[highway=footway][footway=access] { |
| | 191 | width: 2; |
| | 192 | dashes: 5, 10; |
| | 193 | } |
| | 194 | |
| | 195 | way[foot=use_sidepath], |
| | 196 | way[foot=private], |
| | 197 | way[foot=no] { |
| | 198 | width: max(prop("width"), 1); |
| | 199 | opacity: 0.3; |
| | 200 | } |
| | 201 | |
| | 202 | }}} |