| | 1 | [[TranslatedPages]] |
| | 2 | |
| | 3 | = Priority Road = |
| | 4 | [[PageOutline(2-9)]] |
| | 5 | |
| | 6 | == Description == |
| | 7 | |
| | 8 | The mappaint style "Priority Road" displays the value of [osmwiki:Key:priority_road priority_road=*] coloured. |
| | 9 | |
| | 10 | Additional it reports wrong values of priority_road. |
| | 11 | |
| | 12 | You can adjust the colours in the preference window of JOSM. |
| | 13 | |
| | 14 | You can use the Priority Road mappaint style together with the default JOSM internal mappaint style. You can disable the names of highways in the [[Help/Dialog/MapPaint/StyleSettings|style settings]] of the internal style if they bother you. |
| | 15 | |
| | 16 | For ideas/questions/bugs/suggestions or similar please write a message to [osmwww:user/Klumbumbus Klumbumbus]. |
| | 17 | |
| | 18 | Feel free to translate this wiki page into more languages. Already translated languages see top right. |
| | 19 | |
| | 20 | Todo: |
| | 21 | * enhance this docu |
| | 22 | * add example images |
| | 23 | * add icon |
| | 24 | * display error if used on node |
| | 25 | * display `end` with higher priority than `designated`, so it is visible on low zoom |
| | 26 | |
| | 27 | |
| | 28 | == Code == |
| | 29 | {{{ |
| | 30 | #!style type="mapcss" |
| | 31 | |
| | 32 | meta { |
| | 33 | title: "Priority Road"; |
| | 34 | version: "1.0[[revision]]_[[date]]"; |
| | 35 | description: "Displays priority_road=* coloured."; |
| | 36 | /*icon: "...";*/ |
| | 37 | author: "Klumbumbus"; |
| | 38 | link: "http://josm.openstreetmap.de/wiki/Styles/PriorityRoad"; |
| | 39 | watch-modified: true; |
| | 40 | /* min-josm-version: "????"; not sure if there is one */ |
| | 41 | } |
| | 42 | |
| | 43 | meta[lang=de] { |
| | 44 | title: "Vorfahrtsstraße"; |
| | 45 | description: "Zeigt priority_road=* farbig an."; |
| | 46 | link: "http://josm.openstreetmap.de/wiki/Styles/PriorityRoad"; |
| | 47 | } |
| | 48 | |
| | 49 | /* disable tiger layer from default internal mappaint style */ |
| | 50 | way["tiger:reviewed"=no]::core_tiger { |
| | 51 | opacity: 0; |
| | 52 | } |
| | 53 | |
| | 54 | /* display priority_road on ways */ |
| | 55 | /* designated */ |
| | 56 | way["priority_road"="designated"]::priority_road_layer { |
| | 57 | left-casing-color: priority_road_designated#00FF00; |
| | 58 | right-casing-color: priority_road_designated#00FF00; |
| | 59 | set correct_priority_road_value; |
| | 60 | left-casing-width: 10; |
| | 61 | right-casing-width: 10; |
| | 62 | } |
| | 63 | way["priority_road:forward"="designated"]:righthandtraffic::priority_road_layer { |
| | 64 | right-casing-color: priority_road_designated#00FF00; |
| | 65 | set correct_fw_priority_road_value; |
| | 66 | right-casing-width: 10; |
| | 67 | } |
| | 68 | way["priority_road:backward"="designated"]:righthandtraffic::priority_road_layer { |
| | 69 | left-casing-color: priority_road_designated#00FF00; |
| | 70 | set correct_bw_priority_road_value; |
| | 71 | left-casing-width: 10; |
| | 72 | } |
| | 73 | way["priority_road:forward"="designated"]!:righthandtraffic::priority_road_layer { |
| | 74 | left-casing-color: priority_road_designated#00FF00; |
| | 75 | set correct_fw_priority_road_value; |
| | 76 | left-casing-width: 10; |
| | 77 | } |
| | 78 | way["priority_road:backward"="designated"]!:righthandtraffic::priority_road_layer { |
| | 79 | right-casing-color: priority_road_designated#00FF00; |
| | 80 | set correct_bw_priority_road_value; |
| | 81 | right-casing-width: 10; |
| | 82 | } |
| | 83 | |
| | 84 | /* yes_unposted */ |
| | 85 | way["priority_road"="yes_unposted"]::priority_road_layer { |
| | 86 | left-casing-color: priority_road_yes_unposted#FFEE00; |
| | 87 | right-casing-color: priority_road_yes_unposted#FFEE00; |
| | 88 | set correct_priority_road_value; |
| | 89 | left-casing-width: 10; |
| | 90 | right-casing-width: 10; |
| | 91 | } |
| | 92 | way["priority_road:forward"="yes_unposted"]:righthandtraffic::priority_road_layer { |
| | 93 | right-casing-color: priority_road_yes_unposted#FFEE00; |
| | 94 | set correct_fw_priority_road_value; |
| | 95 | right-casing-width: 10; |
| | 96 | } |
| | 97 | way["priority_road:backward"="yes_unposted"]:righthandtraffic::priority_road_layer { |
| | 98 | left-casing-color: priority_road_yes_unposted#FFEE00; |
| | 99 | set correct_bw_priority_road_value; |
| | 100 | left-casing-width: 10; |
| | 101 | } |
| | 102 | way["priority_road:forward"="yes_unposted"]!:righthandtraffic::priority_road_layer { |
| | 103 | left-casing-color: priority_road_yes_unposted#FFEE00; |
| | 104 | set correct_fw_priority_road_value; |
| | 105 | left-casing-width: 10; |
| | 106 | } |
| | 107 | way["priority_road:backward"="yes_unposted"]!:righthandtraffic::priority_road_layer { |
| | 108 | right-casing-color: priority_road_yes_unposted#FFEE00; |
| | 109 | set correct_bw_priority_road_value; |
| | 110 | right-casing-width: 10; |
| | 111 | } |
| | 112 | /* end */ |
| | 113 | way["priority_road"="end"]::priority_road_layer { |
| | 114 | left-casing-color: priority_road_end#FF0000; |
| | 115 | right-casing-color: priority_road_end#FF0000; |
| | 116 | set correct_priority_road_value; |
| | 117 | left-casing-width: 10; |
| | 118 | right-casing-width: 10; |
| | 119 | } |
| | 120 | way["priority_road:forward"="end"]:righthandtraffic::priority_road_layer { |
| | 121 | right-casing-color: priority_road_end#FF0000; |
| | 122 | set correct_fw_priority_road_value; |
| | 123 | right-casing-width: 10; |
| | 124 | } |
| | 125 | way["priority_road:backward"="end"]:righthandtraffic::priority_road_layer { |
| | 126 | left-casing-color: priority_road_end#FF0000; |
| | 127 | set correct_bw_priority_road_value; |
| | 128 | left-casing-width: 10; |
| | 129 | } |
| | 130 | way["priority_road:forward"="end"]!:righthandtraffic::priority_road_layer { |
| | 131 | left-casing-color: priority_road_end#FF0000; |
| | 132 | set correct_fw_priority_road_value; |
| | 133 | left-casing-width: 10; |
| | 134 | } |
| | 135 | way["priority_road:backward"="end"]!:righthandtraffic::priority_road_layer { |
| | 136 | right-casing-color: priority_road_end#FF0000; |
| | 137 | set correct_bw_priority_road_value; |
| | 138 | right-casing-width: 10; |
| | 139 | } |
| | 140 | |
| | 141 | /* zoom dependency */ |
| | 142 | way|z17.correct_priority_road_value::priority_road_layer, |
| | 143 | way|z17.correct_fw_priority_road_value::priority_road_layer, |
| | 144 | way|z17.correct_bw_priority_road_value::priority_road_layer { |
| | 145 | left-casing-width: 8; |
| | 146 | right-casing-width: 8; |
| | 147 | } |
| | 148 | way|z-16.correct_priority_road_value::priority_road_layer, |
| | 149 | way|z-16.correct_fw_priority_road_value::priority_road_layer, |
| | 150 | way|z-16.correct_bw_priority_road_value::priority_road_layer { |
| | 151 | left-casing-width: 6; |
| | 152 | right-casing-width: 6; |
| | 153 | } |
| | 154 | |
| | 155 | /* report wrong value of priority_road */ |
| | 156 | way["priority_road"]!.correct_priority_road_value::priority_road_layer { |
| | 157 | color: yellow; |
| | 158 | dashes-background-color: red; |
| | 159 | dashes: 4,24; |
| | 160 | opacity: 1; |
| | 161 | width: 5; |
| | 162 | text: tr("no correct value for priority_road!"); |
| | 163 | text-color: black; |
| | 164 | font-size: 11; |
| | 165 | text-halo-color: red; |
| | 166 | text-halo-radius: 2; |
| | 167 | casing-width: 1; |
| | 168 | casing-color: yellow; |
| | 169 | } |
| | 170 | way["priority_road:forward"]!.correct_fw_priority_road_value::priority_road_layer { |
| | 171 | color: yellow; |
| | 172 | dashes-background-color: red; |
| | 173 | dashes: 4,24; |
| | 174 | opacity: 1; |
| | 175 | width: 5; |
| | 176 | text: tr("no correct value for priority_road:forward!"); |
| | 177 | text-color: black; |
| | 178 | font-size: 11; |
| | 179 | text-halo-color: red; |
| | 180 | text-halo-radius: 2; |
| | 181 | casing-width: 1; |
| | 182 | casing-color: yellow; |
| | 183 | } |
| | 184 | way["priority_road:backward"]!.correct_bw_priority_road_value::priority_road_layer { |
| | 185 | color: yellow; |
| | 186 | dashes-background-color: red; |
| | 187 | dashes: 4,24; |
| | 188 | opacity: 1; |
| | 189 | width: 5; |
| | 190 | text: tr("no correct value for priority_road:backward!"); |
| | 191 | text-color: black; |
| | 192 | font-size: 11; |
| | 193 | text-halo-color: red; |
| | 194 | text-halo-radius: 2; |
| | 195 | casing-width: 1; |
| | 196 | casing-color: yellow; |
| | 197 | } |
| | 198 | |
| | 199 | way["priority_road:backward"][oneway?], /* in default layer to not hide the oneway arrows */ |
| | 200 | way["priority_road:forward"][oneway=-1] |
| | 201 | { |
| | 202 | color: yellow; |
| | 203 | dashes-background-color: red; |
| | 204 | dashes: 4,24; |
| | 205 | opacity: 1; |
| | 206 | width: 5; |
| | 207 | text: tr("priority_road opposed to oneway direction!"); |
| | 208 | text-color: black; |
| | 209 | font-size: 11; |
| | 210 | text-halo-color: red; |
| | 211 | text-halo-radius: 2; |
| | 212 | casing-width: 1; |
| | 213 | casing-color: yellow; |
| | 214 | } |
| | 215 | }}} |