| | 1 | |
| | 2 | |
| | 3 | {{{ |
| | 4 | #!style type="mapcss" |
| | 5 | |
| | 6 | meta |
| | 7 | { |
| | 8 | title: "Public Transport v2"; |
| | 9 | description: "Highlight important information regarding public transport according to public transport version 2."; |
| | 10 | version: "1.[[revision]]_[[date]]"; |
| | 11 | author: "Ialokim"; |
| | 12 | link: "https://josm.openstreetmap.de/wiki/Styles/PublicTransportV2"; |
| | 13 | watch-modified: true; |
| | 14 | } |
| | 15 | |
| | 16 | meta[lang=de] |
| | 17 | { |
| | 18 | title: "Öffentlicher Verkehr v2"; |
| | 19 | description: "Hebt wichtige Informationen des öffentlichen Verkehrs nach Public Transport Version 2 hervor."; |
| | 20 | } |
| | 21 | |
| | 22 | meta[lang=es] |
| | 23 | { |
| | 24 | title: "Transporte Público v2"; |
| | 25 | description: "Resalta informaciones importantes del transporte público acorde a Public Tranport Version 2."; |
| | 26 | } |
| | 27 | |
| | 28 | |
| | 29 | /*** Initial text properties ***/ |
| | 30 | way|z16-[public_transport=platform], |
| | 31 | node|z16-[public_transport=platform], |
| | 32 | node|z16-[public_transport=stop_position] { |
| | 33 | text-color: white; |
| | 34 | text-opacity: 1.0; |
| | 35 | font-size: 12; |
| | 36 | text-halo-radius: 3; |
| | 37 | text-halo-color: #000000; |
| | 38 | text-halo-opacity: 0.8; |
| | 39 | font-weight: bold; |
| | 40 | } |
| | 41 | |
| | 42 | |
| | 43 | /*** public_transport=platform ***/ |
| | 44 | /* unclosed way design > tagging error! */ |
| | 45 | way|z16-[public_transport=platform]!:closed{ |
| | 46 | width: 10; |
| | 47 | dashes: none; |
| | 48 | color: #ffffff; |
| | 49 | opacity: 1.0; |
| | 50 | text-position: line |
| | 51 | } |
| | 52 | |
| | 53 | /* area design */ |
| | 54 | area|z16-[public_transport=platform]{ |
| | 55 | width: 3; |
| | 56 | color: #ffffff; |
| | 57 | fill-color: #ffffff; |
| | 58 | fill-opacity: 0.3; |
| | 59 | text-position: center; |
| | 60 | font-weight: bold; |
| | 61 | } |
| | 62 | |
| | 63 | /* node design */ |
| | 64 | node|z16-[public_transport=platform] { |
| | 65 | icon-image: "warning-small.png"; |
| | 66 | text-anchor-horizontal: right; |
| | 67 | text-anchor-vertical: center; |
| | 68 | text-offset-x: 5; |
| | 69 | text: ""; |
| | 70 | object-z-index: 1.0; |
| | 71 | } |
| | 72 | |
| | 73 | /* node halo design */ |
| | 74 | node|z16-[public_transport=platform]::halo { |
| | 75 | icon-image: none; |
| | 76 | symbol-shape: square; |
| | 77 | symbol-fill-color: white; |
| | 78 | symbol-size: 18; |
| | 79 | } |
| | 80 | node|z19-[public_transport=platform]::halo { |
| | 81 | object-z-index:-1.0; |
| | 82 | } |
| | 83 | |
| | 84 | |
| | 85 | |
| | 86 | /*** public_transport=stop_position ***/ |
| | 87 | /* node design */ |
| | 88 | node|z16-[public_transport=stop_position] { |
| | 89 | icon-image: "warning-small.png"; |
| | 90 | text-anchor-horizontal: center; |
| | 91 | text-anchor-vertical: center; |
| | 92 | text: ""; |
| | 93 | object-z-index: 1.0; |
| | 94 | } |
| | 95 | node|z19-[public_transport=stop_position] { |
| | 96 | text-anchor-horizontal: right; |
| | 97 | text-offset-x: 5; |
| | 98 | } |
| | 99 | |
| | 100 | /* node halo design */ |
| | 101 | node|z16-[public_transport=stop_position]::halo { |
| | 102 | icon-image: none; |
| | 103 | symbol-shape: square; |
| | 104 | symbol-fill-color: white; |
| | 105 | symbol-size: 18; |
| | 106 | } |
| | 107 | node|z19-[public_transport=stop_position]::halo { |
| | 108 | object-z-index:-1.0; |
| | 109 | } |
| | 110 | |
| | 111 | |
| | 112 | |
| | 113 | |
| | 114 | /*** public_transport=stop_area ***/ |
| | 115 | /* unclosed way design > tagging error! */ |
| | 116 | relation|z16-[public_transport=stop_area] > way!:closed { |
| | 117 | dashes: 10,10; |
| | 118 | dashes-background-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); |
| | 119 | } |
| | 120 | relation|z16-[public_transport=stop_area] > way!:closed:selected { |
| | 121 | dashes-background-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); |
| | 122 | } |
| | 123 | |
| | 124 | /* area design */ |
| | 125 | relation|z16-[public_transport=stop_area] > area { |
| | 126 | color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); |
| | 127 | } |
| | 128 | relation|z16-[public_transport=stop_area] > area:selected { |
| | 129 | color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); |
| | 130 | } |
| | 131 | |
| | 132 | /* node design */ |
| | 133 | relation[public_transport=stop_area] >[index!=1] node|z16-18 { |
| | 134 | text: ""; |
| | 135 | } |
| | 136 | relation[public_transport=stop_area] >[index=1] node|z16-18 { |
| | 137 | text: parent_tag(name); |
| | 138 | } |
| | 139 | relation[public_transport=stop_area] > node|z19-20[public_transport=stop_position] { |
| | 140 | text: ""; |
| | 141 | } |
| | 142 | relation[public_transport=stop_area] > node|z19-[public_transport=platform], |
| | 143 | relation[public_transport=stop_area] > node|z21-[public_transport=stop_position], |
| | 144 | relation[public_transport=stop_area] > area|z16- { |
| | 145 | text: cond(tag(name)==parent_tag(name),tag(name),concat(tag(name), " | ", parent_tag(name))); |
| | 146 | } |
| | 147 | relation[public_transport=stop_area] >[index=1] node|z16-18, |
| | 148 | relation[public_transport=stop_area] > node|z19-[public_transport=platform], |
| | 149 | relation[public_transport=stop_area] > node|z21-[public_transport=stop_position], |
| | 150 | relation[public_transport=stop_area] > area|z16- { |
| | 151 | text-halo-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); |
| | 152 | } |
| | 153 | relation[public_transport=stop_area] >[index=1] node|z16-18, |
| | 154 | relation[public_transport=stop_area] > node|z19-[public_transport=platform]:selected, |
| | 155 | relation[public_transport=stop_area] > node|z21-[public_transport=stop_position]:selected, |
| | 156 | relation[public_transport=stop_area] > area|z16-:selected { |
| | 157 | text-halo-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); |
| | 158 | } |
| | 159 | |
| | 160 | /* node halo design */ |
| | 161 | relation[public_transport=stop_area] > node|z16-::halo { |
| | 162 | symbol-fill-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); |
| | 163 | } |
| | 164 | relation[public_transport=stop_area] > node|z16-:selected::halo { |
| | 165 | symbol-fill-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); |
| | 166 | } |
| | 167 | |
| | 168 | /* node design for transport vehicles (only if has relation) */ |
| | 169 | relation[public_transport=stop_area] > node|z16-[public_transport=stop_position][bus=yes] { |
| | 170 | icon-image: "presets/transport/bus.svg"; |
| | 171 | } |
| | 172 | relation[public_transport=stop_area] > node|z16-[public_transport=stop_position][tram=yes] { |
| | 173 | icon-image: "presets/transport/tram.svg"; |
| | 174 | } |
| | 175 | relation[public_transport=stop_area] > node|z16-[public_transport=stop_position][light_rail=yes] { |
| | 176 | icon-image: "presets/transport/railway/light_rail.svg"; |
| | 177 | } |
| | 178 | relation[public_transport=stop_area] > node|z16-[public_transport=stop_position][subway=yes] { |
| | 179 | icon-image: "presets/transport/railway/subway.svg"; |
| | 180 | } |
| | 181 | relation[public_transport=stop_area] > node|z16-[public_transport=stop_position][train=yes] { |
| | 182 | icon-image: "presets/transport/train.svg"; |
| | 183 | } |
| | 184 | relation[public_transport=stop_area] > node|z16-[public_transport=platform] { |
| | 185 | icon-image: "presets/transport/platform.svg"; |
| | 186 | } |
| | 187 | |
| | 188 | |
| | 189 | /*** Route relations ***/ |
| | 190 | relation[type=route][route=bus] > way::halo, |
| | 191 | relation[type=route][route=tram] > way::halo, |
| | 192 | relation[type=route][route=light_rail] > way::halo, |
| | 193 | relation[type=route][route=subway] > way::halo, |
| | 194 | relation[type=route][route=train] > way::halo { |
| | 195 | object-z-index: -1.0; |
| | 196 | color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); |
| | 197 | width: 16; |
| | 198 | opacity: 0.5; |
| | 199 | linecap: round; |
| | 200 | linejoin: round; |
| | 201 | text-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); |
| | 202 | font-size: 18; |
| | 203 | text: parent_tag(ref); |
| | 204 | text-position: line; |
| | 205 | text-offset-y: 20; |
| | 206 | } |
| | 207 | relation[type=route] > way:selected::halo, |
| | 208 | relation[type=route][route=tram] > way:selected::halo, |
| | 209 | relation[type=route][route=light_rail] > way:selected::halo, |
| | 210 | relation[type=route][route=subway] > way:selected::halo, |
| | 211 | relation[type=route][route=train] > way:selected::halo { |
| | 212 | color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); |
| | 213 | text-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); |
| | 214 | } |
| | 215 | |
| | 216 | }}} |