Changes between Initial Version and Version 1 of Styles/RecyclingMaterials


Ignore:
Timestamp:
2017-03-29T20:45:30+02:00 (9 years ago)
Author:
Klumbumbus
Comment:

new style \o/

Legend:

Unmodified
Added
Removed
Modified
  • Styles/RecyclingMaterials

    v1 v1  
     1[[TranslatedPages]]
     2
     3= [[Image(source:/trunk/images/presets/service/recycling/recycling_container.svg,36,middle,inline)]] Recycling Materials =
     4[[PageOutline(2-9)]]
     5
     6== Description ==
     7
     8The mappaint style "Recycling Materials" displays the material tags of [osmwiki:Tag:amenity=recycling]. The materials which are tagged with "yes" are written green and the materials which are tagged with "no" are written red.
     9
     10You can adjust the colours in the preference window of JOSM.
     11
     12You can use this mappaint style together with the default JOSM internal mappaint style. You can adjust the appearance in the [[Help/Dialog/MapPaint/StyleSettings|style settings]] of this style.
     13
     14**Note that it is NOT the goal to tag every single material which you can not recycle at a recycling container with `*=no` (only if you usually would expect to recycle a spedific material but you can't there).**
     15
     16The style uses the local translations of the internal recycling preset.
     17
     18For ideas/questions/bugs/suggestions or similar please write a message to [osmwww:user/Klumbumbus Klumbumbus].
     19
     20Feel free to translate this wiki page into more languages. Already translated languages see top right.
     21
     22[[Image(Examples.png)]]
     23
     24^Example^
     25
     26== Code ==
     27{{{
     28#!style type="mapcss"
     29
     30meta
     31{
     32    title: "Recycling Materials";
     33    version: "1.0.[[revision]]_[[date]]";
     34    description: "Displays recycling material on recycling nodes.";
     35    icon: "presets/service/recycling/recycling_container.svg";
     36    author: "Klumbumbus";
     37    link: "http://josm.openstreetmap.de/wiki/Styles/RecyclingMaterials";
     38    watch-modified: true;
     39    min-josm-version: "8775";
     40}
     41
     42meta[lang=de]
     43{
     44    title: "Recyclingmaterialien";
     45    description: "Zeigt Recyclingmaterialien an Recyclingnodes an.";
     46    link: "http://josm.openstreetmap.de/wiki/De:Styles/RecyclingMaterials";
     47}
     48
     49/* create user settings */
     50setting::hide_recycling {
     51    type: boolean;
     52    label: tr("Hide at low zoom");
     53    default: true;
     54}
     55setting::halo {
     56    type: boolean;
     57    label: tr("Use text halo");
     58    default: false;
     59}
     60
     61/* prepare lists of recycling keys seperated by their values yes or no */
     62node[/^recycling:/] {
     63    yeslist: list("~~~");
     64    nolist: list("~~~");
     65}
     66
     67/* fill lists, use available translations of the josm internal recycling preset */
     68/* tags taken from https://wiki.openstreetmap.org/wiki/Tag:amenity=recycling and tags with more than 100 uses from https://taginfo.openstreetmap.org/search?q=recycling%3A */
     69/* tags are not checked for validity */
     70/* needs to be updated from time to time */
     71/* fill yes-list */
     72node[recycling:aerosol_cans=yes] {
     73    yeslist: list(join_list(", ",  prop(yeslist)), tr("Aerosol Cans"));
     74}
     75node[recycling:animal_waste=yes] {
     76    yeslist: list(join_list(", ",  prop(yeslist)), tr("Animal Waste"));
     77}
     78node[recycling:aluminium=yes] {
     79    yeslist: list(join_list(", ",  prop(yeslist)), tr("Aluminium"));
     80}
     81node[recycling:batteries=yes] {
     82    yeslist: list(join_list(", ",  prop(yeslist)), tr("Batteries"));
     83}
     84node[recycling:car_batteries=yes] {
     85    yeslist: list(join_list(", ",  prop(yeslist)), tr("Car Batteries"));
     86}
     87node[recycling:beverage_cartons=yes] {
     88    yeslist: list(join_list(", ",  prop(yeslist)), tr("Beverage Cartons"));
     89}
     90node[recycling:bicycles=yes] {
     91    yeslist: list(join_list(", ",  prop(yeslist)), tr("Bicycles"));
     92}
     93node[recycling:books=yes] {
     94    yeslist: list(join_list(", ",  prop(yeslist)), tr("Books"));
     95}
     96node[recycling:bottles=yes] {
     97    yeslist: list(join_list(", ",  prop(yeslist)), tr("Bottles"));
     98}
     99node[recycling:cans=yes] {
     100    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cans"));
     101}
     102node[recycling:cardboard=yes] {
     103    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cardboard"));
     104}
     105node[recycling:cartons=yes] {
     106    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cartons"));
     107}
     108node[recycling:cds=yes] {
     109    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cds"));
     110}
     111node[recycling:chipboard=yes] {
     112    yeslist: list(join_list(", ",  prop(yeslist)), tr("Chipboard"));
     113}
     114node[recycling:christmas_trees=yes] {
     115    yeslist: list(join_list(", ",  prop(yeslist)), tr("Christmas Trees"));
     116}
     117node[recycling:clothes=yes] {
     118    yeslist: list(join_list(", ",  prop(yeslist)), tr("Clothes"));
     119}
     120node[recycling:coffee_capsules=yes] {
     121    yeslist: list(join_list(", ",  prop(yeslist)), tr("Coffee Capsules"));
     122}
     123node[recycling:computers=yes] {
     124    yeslist: list(join_list(", ",  prop(yeslist)), tr("Computers"));
     125}
     126node[recycling:cooking_oil=yes] {
     127    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cooking Oil"));
     128}
     129node[recycling:cork=yes] {
     130    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cork"));
     131}
     132node[recycling:drugs=yes] {
     133    yeslist: list(join_list(", ",  prop(yeslist)), tr("Drugs"));
     134}
     135node[recycling:electrical_appliances=yes] {
     136    yeslist: list(join_list(", ",  prop(yeslist)), tr("Electrical Appliances"));
     137}
     138node[recycling:electrical_items=yes] {
     139    yeslist: list(join_list(", ",  prop(yeslist)), tr("Electrical Items"));
     140}
     141node[recycling:engine_oil=yes] {
     142    yeslist: list(join_list(", ",  prop(yeslist)), tr("Engine Oil"));
     143}
     144node[recycling:fluorescent_tubes=yes] {
     145    yeslist: list(join_list(", ",  prop(yeslist)), tr("Fluorescent Tubes"));
     146}
     147node[recycling:foil=yes] {
     148    yeslist: list(join_list(", ",  prop(yeslist)), tr("Foil"));
     149}
     150node[recycling:gas_bottles=yes] {
     151    yeslist: list(join_list(", ",  prop(yeslist)), tr("Gas Bottles"));
     152}
     153node[recycling:glass=yes] {
     154    yeslist: list(join_list(", ",  prop(yeslist)), tr("Glass"));
     155}
     156node[recycling:glass_bottles=yes] {
     157    yeslist: list(join_list(", ",  prop(yeslist)), tr("Glass Bottles"));
     158}
     159node[recycling:glass_jars=yes] {
     160    yeslist: list(join_list(", ",  prop(yeslist)), tr("Glass Jars"));
     161}
     162node[recycling:green_waste=yes] {
     163    yeslist: list(join_list(", ",  prop(yeslist)), tr("Green Waste"));
     164}
     165node[recycling:garden_waste=yes] {
     166    yeslist: list(join_list(", ",  prop(yeslist)), tr("Garden Waste"));
     167}
     168node[recycling:hazardous_waste=yes] {
     169    yeslist: list(join_list(", ",  prop(yeslist)), tr("Hazardous Waste"));
     170}
     171node[recycling:hardcore=yes] {
     172    yeslist: list(join_list(", ",  prop(yeslist)), tr("Hardcore"));
     173}
     174node[recycling:hydrargyrum=yes] {
     175    yeslist: list(join_list(", ",  prop(yeslist)), tr("Hydrargyrum"));
     176}
     177node[recycling:low_energy_bulbs=yes] {
     178    yeslist: list(join_list(", ",  prop(yeslist)), tr("Low Energy Bulbs"));
     179}
     180node[recycling:magazines=yes] {
     181    yeslist: list(join_list(", ",  prop(yeslist)), tr("Magazines"));
     182}
     183node[recycling:metal=yes] {
     184    yeslist: list(join_list(", ",  prop(yeslist)), tr("Metal"));
     185}
     186node[recycling:mobile_phones=yes] {
     187    yeslist: list(join_list(", ",  prop(yeslist)), tr("Mobile Phones"));
     188}
     189node[recycling:newspaper=yes] {
     190    yeslist: list(join_list(", ",  prop(yeslist)), tr("Newspaper"));
     191}
     192node[recycling:organic=yes] {
     193    yeslist: list(join_list(", ",  prop(yeslist)), tr("Organic"));
     194}
     195node[recycling:paint=yes] {
     196    yeslist: list(join_list(", ",  prop(yeslist)), tr("Paint"));
     197}
     198node[recycling:paper=yes] {
     199    yeslist: list(join_list(", ",  prop(yeslist)), tr("Paper"));
     200}
     201node[recycling:paper_packaging=yes] {
     202    yeslist: list(join_list(", ",  prop(yeslist)), tr("Paper Packaging"));
     203}
     204node[recycling:PET=yes] {
     205    yeslist: list(join_list(", ",  prop(yeslist)), tr("PET"));
     206}
     207node[recycling:plasterboard=yes] {
     208    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plasterboard"));
     209}
     210node[recycling:plastic=yes] {
     211    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic"));
     212}
     213node[recycling:plastic_bags=yes] {
     214    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic Bags"));
     215}
     216node[recycling:plastic_bottles=yes] {
     217    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic Bottles"));
     218}
     219node[recycling:plastic_packaging=yes] {
     220    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic Packaging"));
     221}
     222node[recycling:polyester=yes] {
     223    yeslist: list(join_list(", ",  prop(yeslist)), tr("Polyester"));
     224}
     225node[recycling:polystyrene_foam=yes] {
     226    yeslist: list(join_list(", ",  prop(yeslist)), tr("Polystyrene Foam"));
     227}
     228node[recycling:printer_cartridges=yes] {
     229    yeslist: list(join_list(", ",  prop(yeslist)), tr("Printer Cartridges"));
     230}
     231node[recycling:printer_toner_cartridges=yes] {
     232    yeslist: list(join_list(", ",  prop(yeslist)), tr("Printer Toner Cartridges"));
     233}
     234node[recycling:printer_inkjet_cartridges=yes] {
     235    yeslist: list(join_list(", ",  prop(yeslist)), tr("Printer Inkjet Cartridges"));
     236}
     237node[recycling:rubble=yes] {
     238    yeslist: list(join_list(", ",  prop(yeslist)), tr("Rubble"));
     239}
     240node[recycling:scrap_metal=yes] {
     241    yeslist: list(join_list(", ",  prop(yeslist)), tr("Scrap Metal"));
     242}
     243node[recycling:sheet_metal=yes] {
     244    yeslist: list(join_list(", ",  prop(yeslist)), tr("Sheet Metal"));
     245}
     246node[recycling:shoes=yes] {
     247    yeslist: list(join_list(", ",  prop(yeslist)), tr("Shoes"));
     248}
     249node[recycling:small_appliances=yes] {
     250    yeslist: list(join_list(", ",  prop(yeslist)), tr("Small Appliances"));
     251}
     252node[recycling:small_electrical_appliances=yes] {
     253    yeslist: list(join_list(", ",  prop(yeslist)), tr("Small Electrical Appliances"));
     254}
     255node[recycling:styrofoam=yes] {
     256    yeslist: list(join_list(", ",  prop(yeslist)), tr("Styrofoam"));
     257}
     258node[recycling:tyres=yes] {
     259    yeslist: list(join_list(", ",  prop(yeslist)), tr("Tyres"));
     260}
     261node[recycling:tv_monitor=yes] {
     262    yeslist: list(join_list(", ",  prop(yeslist)), tr("Tv Monitor"));
     263}
     264node[recycling:waste=yes] {
     265    yeslist: list(join_list(", ",  prop(yeslist)), tr("Waste"));
     266}
     267node[recycling:waste_oil=yes] {
     268    yeslist: list(join_list(", ",  prop(yeslist)), tr("Waste Oil"));
     269}
     270node[recycling:white_goods=yes] {
     271    yeslist: list(join_list(", ",  prop(yeslist)), tr("White Goods"));
     272}
     273node[recycling:wood=yes] {
     274    yeslist: list(join_list(", ",  prop(yeslist)), tr("Wood"));
     275}
     276
     277/* fill no-list */
     278node[recycling:aerosol_cans=no] {
     279    nolist: list(join_list(", ",  prop(nolist)), tr("Aerosol Cans"));
     280}
     281node[recycling:animal_waste=no] {
     282    nolist: list(join_list(", ",  prop(nolist)), tr("Animal Waste"));
     283}
     284node[recycling:aluminium=no] {
     285    nolist: list(join_list(", ",  prop(nolist)), tr("Aluminium"));
     286}
     287node[recycling:batteries=no] {
     288    nolist: list(join_list(", ",  prop(nolist)), tr("Batteries"));
     289}
     290node[recycling:car_batteries=no] {
     291    nolist: list(join_list(", ",  prop(nolist)), tr("Car Batteries"));
     292}
     293node[recycling:beverage_cartons=no] {
     294    nolist: list(join_list(", ",  prop(nolist)), tr("Beverage Cartons"));
     295}
     296node[recycling:bicycles=no] {
     297    nolist: list(join_list(", ",  prop(nolist)), tr("Bicycles"));
     298}
     299node[recycling:books=no] {
     300    nolist: list(join_list(", ",  prop(nolist)), tr("Books"));
     301}
     302node[recycling:bottles=no] {
     303    nolist: list(join_list(", ",  prop(nolist)), tr("Bottles"));
     304}
     305node[recycling:cans=no] {
     306    nolist: list(join_list(", ",  prop(nolist)), tr("Cans"));
     307}
     308node[recycling:cardboard=no] {
     309    nolist: list(join_list(", ",  prop(nolist)), tr("Cardboard"));
     310}
     311node[recycling:cartons=no] {
     312    nolist: list(join_list(", ",  prop(nolist)), tr("Cartons"));
     313}
     314node[recycling:cds=no] {
     315    nolist: list(join_list(", ",  prop(nolist)), tr("Cds"));
     316}
     317node[recycling:chipboard=no] {
     318    nolist: list(join_list(", ",  prop(nolist)), tr("Chipboard"));
     319}
     320node[recycling:christmas_trees=no] {
     321    nolist: list(join_list(", ",  prop(nolist)), tr("Christmas Trees"));
     322}
     323node[recycling:clothes=no] {
     324    nolist: list(join_list(", ",  prop(nolist)), tr("Clothes"));
     325}
     326node[recycling:coffee_capsules=no] {
     327    nolist: list(join_list(", ",  prop(nolist)), tr("Coffee Capsules"));
     328}
     329node[recycling:computers=no] {
     330    nolist: list(join_list(", ",  prop(nolist)), tr("Computers"));
     331}
     332node[recycling:cooking_oil=no] {
     333    nolist: list(join_list(", ",  prop(nolist)), tr("Cooking Oil"));
     334}
     335node[recycling:cork=no] {
     336    nolist: list(join_list(", ",  prop(nolist)), tr("Cork"));
     337}
     338node[recycling:drugs=no] {
     339    nolist: list(join_list(", ",  prop(nolist)), tr("Drugs"));
     340}
     341node[recycling:electrical_appliances=no] {
     342    nolist: list(join_list(", ",  prop(nolist)), tr("Electrical Appliances"));
     343}
     344node[recycling:electrical_items=no] {
     345    nolist: list(join_list(", ",  prop(nolist)), tr("Electrical Items"));
     346}
     347node[recycling:engine_oil=no] {
     348    nolist: list(join_list(", ",  prop(nolist)), tr("Engine Oil"));
     349}
     350node[recycling:fluorescent_tubes=no] {
     351    nolist: list(join_list(", ",  prop(nolist)), tr("Fluorescent Tubes"));
     352}
     353node[recycling:foil=no] {
     354    nolist: list(join_list(", ",  prop(nolist)), tr("Foil"));
     355}
     356node[recycling:gas_bottles=no] {
     357    nolist: list(join_list(", ",  prop(nolist)), tr("Gas Bottles"));
     358}
     359node[recycling:glass=no] {
     360    nolist: list(join_list(", ",  prop(nolist)), tr("Glass"));
     361}
     362node[recycling:glass_bottles=no] {
     363    nolist: list(join_list(", ",  prop(nolist)), tr("Glass Bottles"));
     364}
     365node[recycling:glass_jars=no] {
     366    nolist: list(join_list(", ",  prop(nolist)), tr("Glass Jars"));
     367}
     368node[recycling:green_waste=no] {
     369    nolist: list(join_list(", ",  prop(nolist)), tr("Green Waste"));
     370}
     371node[recycling:garden_waste=no] {
     372    nolist: list(join_list(", ",  prop(nolist)), tr("Garden Waste"));
     373}
     374node[recycling:hazardous_waste=no] {
     375    nolist: list(join_list(", ",  prop(nolist)), tr("Hazardous Waste"));
     376}
     377node[recycling:hardcore=no] {
     378    nolist: list(join_list(", ",  prop(nolist)), tr("Hardcore"));
     379}
     380node[recycling:hydrargyrum=no] {
     381    nolist: list(join_list(", ",  prop(nolist)), tr("Hydrargyrum"));
     382}
     383node[recycling:low_energy_bulbs=no] {
     384    nolist: list(join_list(", ",  prop(nolist)), tr("Low Energy Bulbs"));
     385}
     386node[recycling:magazines=no] {
     387    nolist: list(join_list(", ",  prop(nolist)), tr("Magazines"));
     388}
     389node[recycling:metal=no] {
     390    nolist: list(join_list(", ",  prop(nolist)), tr("Metal"));
     391}
     392node[recycling:mobile_phones=no] {
     393    nolist: list(join_list(", ",  prop(nolist)), tr("Mobile Phones"));
     394}
     395node[recycling:newspaper=no] {
     396    nolist: list(join_list(", ",  prop(nolist)), tr("Newspaper"));
     397}
     398node[recycling:organic=no] {
     399    nolist: list(join_list(", ",  prop(nolist)), tr("Organic"));
     400}
     401node[recycling:paint=no] {
     402    nolist: list(join_list(", ",  prop(nolist)), tr("Paint"));
     403}
     404node[recycling:paper=no] {
     405    nolist: list(join_list(", ",  prop(nolist)), tr("Paper"));
     406}
     407node[recycling:paper_packaging=no] {
     408    nolist: list(join_list(", ",  prop(nolist)), tr("Paper Packaging"));
     409}
     410node[recycling:PET=no] {
     411    nolist: list(join_list(", ",  prop(nolist)), tr("PET"));
     412}
     413node[recycling:plasterboard=no] {
     414    nolist: list(join_list(", ",  prop(nolist)), tr("Plasterboard"));
     415}
     416node[recycling:plastic=no] {
     417    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic"));
     418}
     419node[recycling:plastic_bags=no] {
     420    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic Bags"));
     421}
     422node[recycling:plastic_bottles=no] {
     423    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic Bottles"));
     424}
     425node[recycling:plastic_packaging=no] {
     426    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic Packaging"));
     427}
     428node[recycling:polyester=no] {
     429    nolist: list(join_list(", ",  prop(nolist)), tr("Polyester"));
     430}
     431node[recycling:polystyrene_foam=no] {
     432    nolist: list(join_list(", ",  prop(nolist)), tr("Polystyrene Foam"));
     433}
     434node[recycling:printer_cartridges=no] {
     435    nolist: list(join_list(", ",  prop(nolist)), tr("Printer Cartridges"));
     436}
     437node[recycling:printer_toner_cartridges=no] {
     438    nolist: list(join_list(", ",  prop(nolist)), tr("Printer Toner Cartridges"));
     439}
     440node[recycling:printer_inkjet_cartridges=no] {
     441    nolist: list(join_list(", ",  prop(nolist)), tr("Printer Inkjet Cartridges"));
     442}
     443node[recycling:rubble=no] {
     444    nolist: list(join_list(", ",  prop(nolist)), tr("Rubble"));
     445}
     446node[recycling:scrap_metal=no] {
     447    nolist: list(join_list(", ",  prop(nolist)), tr("Scrap Metal"));
     448}
     449node[recycling:sheet_metal=no] {
     450    nolist: list(join_list(", ",  prop(nolist)), tr("Sheet Metal"));
     451}
     452node[recycling:shoes=no] {
     453    nolist: list(join_list(", ",  prop(nolist)), tr("Shoes"));
     454}
     455node[recycling:small_appliances=no] {
     456    nolist: list(join_list(", ",  prop(nolist)), tr("Small Appliances"));
     457}
     458node[recycling:small_electrical_appliances=no] {
     459    nolist: list(join_list(", ",  prop(nolist)), tr("Small Electrical Appliances"));
     460}
     461node[recycling:styrofoam=no] {
     462    nolist: list(join_list(", ",  prop(nolist)), tr("Styrofoam"));
     463}
     464node[recycling:tyres=no] {
     465    nolist: list(join_list(", ",  prop(nolist)), tr("Tyres"));
     466}
     467node[recycling:tv_monitor=no] {
     468    nolist: list(join_list(", ",  prop(nolist)), tr("Tv Monitor"));
     469}
     470node[recycling:waste=no] {
     471    nolist: list(join_list(", ",  prop(nolist)), tr("Waste"));
     472}
     473node[recycling:waste_oil=no] {
     474    nolist: list(join_list(", ",  prop(nolist)), tr("Waste Oil"));
     475}
     476node[recycling:white_goods=no] {
     477    nolist: list(join_list(", ",  prop(nolist)), tr("White Goods"));
     478}
     479node[recycling:wood=no] {
     480    nolist: list(join_list(", ",  prop(nolist)), tr("Wood"));
     481}
     482
     483/* trim ~~~ placeholder and leading comma, display lists as text in own layers  */
     484node[/^recycling:/]::yesrecycling {
     485    text: cond(join_list(", ", prop(yeslist, default))="~~~", "", replace(join_list(", ", prop(yeslist, default)), "~~~, ", ""));
     486    text-color: recycling_yes#00FF00; /* green */
     487    font-size: 12;
     488    text-offset-y: 7;
     489    text-offset-x: 8;
     490}
     491node[/^recycling:/]::norecycling {
     492    text: cond(join_list(", ", prop(nolist, default))="~~~", "", replace(join_list(", ", prop(nolist, default)), "~~~, ", ""));
     493    text-color: recycling_no#FF0000; /* red */
     494    font-size: 12;
     495    text-offset-y: -14;
     496    text-offset-x: 8;
     497}
     498
     499/* hide on low zoom */
     500node|z-17[setting("hide_recycling")]::yesrecycling {
     501    text: "";
     502}
     503node|z-17[setting("hide_recycling")]::norecycling {
     504    text: "";
     505}
     506
     507/* text halo */
     508node[setting("halo")][/^recycling:/]::yesrecycling {
     509    text-halo-radius: 2;
     510    text-halo-color: recycling_yes_halo#FFFFFF; /* white */
     511}
     512node[setting("halo")][/^recycling:/]::norecycling {
     513    text-halo-radius: 2;
     514    text-halo-color: recycling_no_halo#FFFFFF;
     515}
     516}}}