Changes between Initial Version and Version 1 of Styles/hazmat


Ignore:
Timestamp:
2016-09-19T22:55:22+02:00 (9 years ago)
Author:
Klumbumbus
Comment:

add new style. feedback is welcome

Legend:

Unmodified
Added
Removed
Modified
  • Styles/hazmat

    v1 v1  
     1[[TranslatedPages]]
     2
     3= [[Image(DE-261.svg,36,middle,inline)]] hazmat =
     4[[PageOutline(2-9)]]
     5
     6== Description ==
     7
     8The mappaint style "hazmat" displays the value of [osmwiki:Key:hazmat hazmat =*] and hazmat:water=* coloured.
     9
     10Additional it reports unusual values of hazmat.
     11
     12You can adjust the colours in the preference window of JOSM.
     13
     14You can use the hazmat 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
     16For ideas/questions/bugs/suggestions or similar please write a message to [osmwww:user/Klumbumbus Klumbumbus].
     17
     18Feel free to translate this wiki page into more languages. Already translated languages see top right.
     19
     20[[Image(legend.png)]]
     21
     22[[Image(example.png)]]
     23
     24^(data used for image [osmwww:copyright ©OpenStreetMap contributors] ODbL)^
     25
     26== Code ==
     27{{{
     28#!style type="mapcss"
     29
     30meta
     31{
     32    title: "hazmat";
     33    version: "1.0[[revision]]_[[date]]";
     34    description: "Displays hazmat=* and hazmat:water=* coloured.";
     35    icon: "DE-261.svg";
     36    author: "Klumbumbus";
     37    link: "http://josm.openstreetmap.de/wiki/Styles/hazmat";
     38    watch-modified: true;
     39    /* min-josm-version: "????"; not sure if there is one */
     40}
     41
     42meta[lang=de]
     43{
     44    title: "Gefahrgut (hazmat)";
     45    description: "Zeigt hazmat=* und hazmat:water=* farbig an.";
     46    link: "http://josm.openstreetmap.de/wiki/De:Styles/hazmat";
     47}
     48
     49/* disable tiger layer from default internal mappaint style */
     50way["tiger:reviewed"=no]::core_tiger {
     51    opacity: 0;
     52}
     53
     54/* display hazmat on ways */
     55way["hazmat"="yes"]::hazmat,
     56way["hazmat"="no"]::hazmat,
     57way["hazmat"="designated"]::hazmat,
     58way["hazmat"="destination"]::hazmat {
     59    set correct_hazmat_value;
     60    width: 14;
     61    z-index: -1.1;
     62}
     63way["hazmat:water"="yes"]::hazmatwater,
     64way["hazmat:water"="no"]::hazmatwater,
     65way["hazmat:water"="permissive"]::hazmatwater,
     66way["hazmat:water"="destination"]::hazmatwater {
     67    set correct_hazmatwater_value;
     68    width: 14;
     69    z-index: -1;
     70}
     71way|z12-16.correct_hazmat_value::hazmat,
     72way|z12-16.correct_hazmatwater_value::hazmatwater {
     73    width: 12;
     74}
     75way|z-11.correct_hazmat_value::hazmat,
     76way|z-11.correct_hazmatwater_value::hazmatwater {
     77    width: 10;
     78}
     79    /* dashed if both keys are present */
     80way.correct_hazmatwater_value[is_prop_set(correct_hazmat_value, hazmat)]::hazmatwater {
     81    dashes: 20,20;
     82}
     83    /* the colors can be adjusted within JOSM color preferences */
     84way["hazmat"="yes"]::hazmat {
     85    color: hazmat_yes#FFEE00; /* yellow */
     86}
     87way["hazmat"="no"]::hazmat {
     88    color: hazmat_no#FF0000; /* red */
     89}
     90way["hazmat"="designated"]::hazmat {
     91    color: hazmat_designated#00FF00; /* green */
     92}
     93way["hazmat"="destination"]::hazmat {
     94    color: hazmat_destination#FF9714; /* orange */
     95}
     96way["hazmat:water"="yes"]::hazmatwater {
     97    color: hazmat_water_yes#6FEDFB; /* light blue */
     98}
     99way["hazmat:water"="no"]::hazmatwater {
     100    color: hazmat_water_no#6B4EB1; /* purple */
     101}
     102way["hazmat:water"="permissive"]::hazmatwater {
     103    color: hazmat_water_permissive#2437FF; /* blue */
     104}
     105way["hazmat:water"="destination"]::hazmatwater {
     106    color: hazmat_water_destination#000C8B; /* dark blue */
     107}
     108
     109/* display german traffic signs */
     110node["traffic_sign"^="DE:261"] {
     111    icon-image: "Zeichen_261.svg";
     112}
     113node["traffic_sign"^="DE:269"] {
     114    icon-image: "Zeichen_269.svg";
     115}
     116node["traffic_sign"^="DE:354"] {
     117    icon-image: "Zeichen_354_-_Wasserschutzgebiet,_StVO_1992.svg";
     118}
     119
     120/* report wrong value of hazmat and hazmat:water */
     121way["hazmat"]!.correct_hazmat_value::hazmat {
     122    color: yellow;
     123    dashes-background-color: red;
     124    dashes: 4,24;
     125    opacity: 1;
     126    width: 5;
     127    text: tr("unusual value for hazmat!");
     128    text-color: black;
     129    font-size: 11;
     130    text-halo-color: red;
     131    text-halo-radius: 2;
     132    casing-width: 1;
     133    casing-color: yellow;
     134}
     135way["hazmat:water"]!.correct_hazmatwater_value::hazmatwater {
     136    color: yellow;
     137    dashes-background-color: red;
     138    dashes: 4,24;
     139    opacity: 1;
     140    width: 5;
     141    text: tr("unusual value for hazmat:water!");
     142    text-color: black;
     143    font-size: 11;
     144    text-halo-color: red;
     145    text-halo-radius: 2;
     146    casing-width: 1;
     147    casing-color: yellow;
     148}
     149}}}