wiki:Styles/RecyclingMaterials

Languages:

source:trunk/resources/images/presets/service/recycling/recycling_container.svg Recycling Materials

Description

The mappaint style "Recycling Materials" displays the material tags of Tag:amenity=recycling. The materials which are tagged with "yes" are written green and the materials which are tagged with "no" are written red.

You can adjust the colours in the preference window of JOSM.

You can use this mappaint style together with the default JOSM internal mappaint style. You can adjust the appearance in the style settings of this style.

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).

The style uses the local translations of the internal recycling preset.

For ideas/questions/bugs/suggestions or similar please write a message to Klumbumbus.

Feel free to translate this wiki page into more languages. Already translated languages see top right.

Examples (NOZIP)

Example

Code

meta
{
    title: "Recycling Materials";
    version: "1.0.6_2020-10-05";
    description: "Displays recycling material on recycling nodes.";
    icon: "presets/service/recycling/recycling_container.svg";
    author: "Klumbumbus";
    link: "https://josm.openstreetmap.de/wiki/Styles/RecyclingMaterials";
    min-josm-version: "8775";
}

meta[lang=de]
{
    title: "Recyclingmaterialien";
    description: "Zeigt Recyclingmaterialien an Recyclingnodes an.";
    link: "https://josm.openstreetmap.de/wiki/De:Styles/RecyclingMaterials";
}

/* create user settings */
setting::hide_recycling {
    type: boolean;
    label: tr("Hide at low zoom");
    default: true;
}
setting::halo {
    type: boolean;
    label: tr("Use text halo");
    default: false;
}

/* prepare lists of recycling keys separated by their values yes or no */
node[/^recycling:/] {
    yeslist: list("~~~");
    nolist: list("~~~");
}

/* fill lists, use available translations of the josm internal recycling preset */
/* 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 */
/* tags are not checked for validity */
/* needs to be updated from time to time */
/* fill yes-list */
node[recycling:aerosol_cans=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Aerosol Cans"));
}
node[recycling:animal_waste=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Animal Waste"));
}
node[recycling:aluminium=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Aluminium"));
}
node[recycling:batteries=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Batteries"));
}
node[recycling:car_batteries=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Car Batteries"));
}
node[recycling:beverage_cartons=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Beverage Cartons"));
}
node[recycling:bicycles=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Bicycles"));
}
node[recycling:books=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Books"));
}
node[recycling:bottles=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Bottles"));
}
node[recycling:cans=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cans"));
}
node[recycling:cardboard=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cardboard"));
}
node[recycling:cartons=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cartons"));
}
node[recycling:cds=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cds"));
}
node[recycling:chipboard=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Chipboard"));
}
node[recycling:christmas_trees=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Christmas Trees"));
}
node[recycling:clothes=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Clothes"));
}
node[recycling:coffee_capsules=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Coffee Capsules"));
}
node[recycling:computers=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Computers"));
}
node[recycling:cooking_oil=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cooking Oil"));
}
node[recycling:cork=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Cork"));
}
node[recycling:drugs=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Drugs"));
}
node[recycling:electrical_appliances=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Electrical Appliances"));
}
node[recycling:electrical_items=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Electrical Items"));
}
node[recycling:engine_oil=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Engine Oil"));
}
node[recycling:fluorescent_tubes=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Fluorescent Tubes"));
}
node[recycling:foil=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Foil"));
}
node[recycling:gas_bottles=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Gas Bottles"));
}
node[recycling:glass=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Glass"));
}
node[recycling:glass_bottles=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Glass Bottles"));
}
node[recycling:glass_jars=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Glass Jars"));
}
node[recycling:green_waste=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Green Waste"));
}
node[recycling:garden_waste=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Garden Waste"));
}
node[recycling:hazardous_waste=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Hazardous Waste"));
}
node[recycling:hardcore=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Hardcore"));
}
node[recycling:hydrargyrum=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Hydrargyrum"));
}
node[recycling:low_energy_bulbs=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Low Energy Bulbs"));
}
node[recycling:magazines=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Magazines"));
}
node[recycling:metal=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Metal"));
}
node[recycling:mobile_phones=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Mobile Phones"));
}
node[recycling:newspaper=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Newspaper"));
}
node[recycling:organic=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Organic"));
}
node[recycling:paint=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Paint"));
}
node[recycling:paper=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Paper"));
}
node[recycling:paper_packaging=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Paper Packaging"));
}
node[recycling:PET=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("PET"));
}
node[recycling:plasterboard=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plasterboard"));
}
node[recycling:plastic=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic"));
}
node[recycling:plastic_bags=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic Bags"));
}
node[recycling:plastic_bottles=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic Bottles"));
}
node[recycling:plastic_packaging=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Plastic Packaging"));
}
node[recycling:polyester=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Polyester"));
}
node[recycling:polystyrene_foam=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Polystyrene Foam"));
}
node[recycling:printer_cartridges=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Printer Cartridges"));
}
node[recycling:printer_toner_cartridges=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Printer Toner Cartridges"));
}
node[recycling:printer_inkjet_cartridges=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Printer Inkjet Cartridges"));
}
node[recycling:rubble=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Rubble"));
}
node[recycling:scrap_metal=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Scrap Metal"));
}
node[recycling:sheet_metal=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Sheet Metal"));
}
node[recycling:shoes=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Shoes"));
}
node[recycling:small_appliances=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Small Appliances"));
}
node[recycling:small_electrical_appliances=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Small Electrical Appliances"));
}
node[recycling:styrofoam=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Styrofoam"));
}
node[recycling:tyres=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Tyres"));
}
node[recycling:tv_monitor=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Tv Monitor"));
}
node[recycling:waste=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Waste"));
}
node[recycling:waste_oil=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Waste Oil"));
}
node[recycling:white_goods=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("White Goods"));
}
node[recycling:wood=yes] {
    yeslist: list(join_list(", ",  prop(yeslist)), tr("Wood"));
}

/* fill no-list */
node[recycling:aerosol_cans=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Aerosol Cans"));
}
node[recycling:animal_waste=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Animal Waste"));
}
node[recycling:aluminium=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Aluminium"));
}
node[recycling:batteries=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Batteries"));
}
node[recycling:car_batteries=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Car Batteries"));
}
node[recycling:beverage_cartons=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Beverage Cartons"));
}
node[recycling:bicycles=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Bicycles"));
}
node[recycling:books=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Books"));
}
node[recycling:bottles=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Bottles"));
}
node[recycling:cans=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Cans"));
}
node[recycling:cardboard=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Cardboard"));
}
node[recycling:cartons=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Cartons"));
}
node[recycling:cds=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Cds"));
}
node[recycling:chipboard=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Chipboard"));
}
node[recycling:christmas_trees=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Christmas Trees"));
}
node[recycling:clothes=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Clothes"));
}
node[recycling:coffee_capsules=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Coffee Capsules"));
}
node[recycling:computers=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Computers"));
}
node[recycling:cooking_oil=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Cooking Oil"));
}
node[recycling:cork=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Cork"));
}
node[recycling:drugs=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Drugs"));
}
node[recycling:electrical_appliances=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Electrical Appliances"));
}
node[recycling:electrical_items=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Electrical Items"));
}
node[recycling:engine_oil=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Engine Oil"));
}
node[recycling:fluorescent_tubes=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Fluorescent Tubes"));
}
node[recycling:foil=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Foil"));
}
node[recycling:gas_bottles=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Gas Bottles"));
}
node[recycling:glass=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Glass"));
}
node[recycling:glass_bottles=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Glass Bottles"));
}
node[recycling:glass_jars=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Glass Jars"));
}
node[recycling:green_waste=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Green Waste"));
}
node[recycling:garden_waste=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Garden Waste"));
}
node[recycling:hazardous_waste=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Hazardous Waste"));
}
node[recycling:hardcore=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Hardcore"));
}
node[recycling:hydrargyrum=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Hydrargyrum"));
}
node[recycling:low_energy_bulbs=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Low Energy Bulbs"));
}
node[recycling:magazines=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Magazines"));
}
node[recycling:metal=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Metal"));
}
node[recycling:mobile_phones=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Mobile Phones"));
}
node[recycling:newspaper=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Newspaper"));
}
node[recycling:organic=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Organic"));
}
node[recycling:paint=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Paint"));
}
node[recycling:paper=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Paper"));
}
node[recycling:paper_packaging=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Paper Packaging"));
}
node[recycling:PET=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("PET"));
}
node[recycling:plasterboard=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Plasterboard"));
}
node[recycling:plastic=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic"));
}
node[recycling:plastic_bags=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic Bags"));
}
node[recycling:plastic_bottles=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic Bottles"));
}
node[recycling:plastic_packaging=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Plastic Packaging"));
}
node[recycling:polyester=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Polyester"));
}
node[recycling:polystyrene_foam=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Polystyrene Foam"));
}
node[recycling:printer_cartridges=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Printer Cartridges"));
}
node[recycling:printer_toner_cartridges=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Printer Toner Cartridges"));
}
node[recycling:printer_inkjet_cartridges=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Printer Inkjet Cartridges"));
}
node[recycling:rubble=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Rubble"));
}
node[recycling:scrap_metal=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Scrap Metal"));
}
node[recycling:sheet_metal=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Sheet Metal"));
}
node[recycling:shoes=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Shoes"));
}
node[recycling:small_appliances=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Small Appliances"));
}
node[recycling:small_electrical_appliances=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Small Electrical Appliances"));
}
node[recycling:styrofoam=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Styrofoam"));
}
node[recycling:tyres=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Tyres"));
}
node[recycling:tv_monitor=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Tv Monitor"));
}
node[recycling:waste=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Waste"));
}
node[recycling:waste_oil=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Waste Oil"));
}
node[recycling:white_goods=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("White Goods"));
}
node[recycling:wood=no] {
    nolist: list(join_list(", ",  prop(nolist)), tr("Wood"));
}

/* trim ~~~ placeholder and leading comma, display lists as text in own layers  */
node[/^recycling:/]::yesrecycling {
    text: cond(join_list(", ", prop(yeslist, default))="~~~", "", replace(join_list(", ", prop(yeslist, default)), "~~~, ", ""));
    text-color: recycling_yes#00FF00; /* green */
    font-size: 12;
    text-offset-y: 7;
    text-offset-x: 7;
}
node[/^recycling:/]::norecycling {
    text: cond(join_list(", ", prop(nolist, default))="~~~", "", replace(join_list(", ", prop(nolist, default)), "~~~, ", ""));
    text-color: recycling_no#FF0000; /* red */
    font-size: 12;
    text-offset-y: -16;
    text-offset-x: 7;
}

/* hide on low zoom */
node|z-17[setting("hide_recycling")]::yesrecycling {
    text: "";
}
node|z-17[setting("hide_recycling")]::norecycling {
    text: "";
}

/* text halo */
node[setting("halo")][/^recycling:/]::yesrecycling {
    text-halo-radius: 2;
    text-halo-color: recycling_yes_halo#FFFFFF; /* white */
}
node[setting("halo")][/^recycling:/]::norecycling {
    text-halo-radius: 2;
    text-halo-color: recycling_no_halo#FFFFFF;
    text-offset-y: -18;
}

Styles_RecyclingMaterials-style.mapcss, Styles_RecyclingMaterials.zip

Last modified 4 years ago Last modified on 2020-10-05T18:15:20+02:00

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.