Use icon of waste if only one is set

This commit is contained in:
Robin van der Linde 2022-02-19 22:52:52 +01:00
parent d49fd8df1f
commit 2e51a45668

View file

@ -11,6 +11,9 @@
"source": {
"osmTags": "amenity=recycling"
},
"calculatedTags": [
"_waste_amount=Object.values(Object.keys(feat.properties).filter((key) => key.startsWith('recycling:')).reduce((cur, key) => { return Object.assign(cur, { [key]: feat.properties[key] })}, {})).reduce((n, x) => n + (x == \"yes\"), 0);"
],
"minzoom": 12,
"title": {
"render": {
@ -40,89 +43,355 @@
"point",
"centroid"
],
"icon": "circle:white;./assets/layers/recycling/recycling-14.svg",
"icon": {
"render": "circle:white;./assets/layers/recycling/recycling-14.svg",
"mappings": [
{
"if": {
"and": [
"_waste_amount=1",
"recycling:batteries=yes"
]
},
"then": "circle:white;./assets/layers/recycling/batteries.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:beverage_cartons=yes"
]
},
"then": "circle:white;./assets/layers/recycling/beverage_cartons.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:cans=yes"
]
},
"then": "circle:white;./assets/layers/recycling/cans.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:clothes=yes"
]
},
"then": "circle:white;./assets/layers/recycling/clothes.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:cooking_oil=yes"
]
},
"then": "circle:white;./assets/layers/recycling/cooking_oil.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:engine_oil=yes"
]
},
"then": "circle:white;./assets/layers/recycling/engine_oil.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:glass=yes"
]
},
"then": "circle:white;./assets/layers/recycling/glass.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:glass_bottles=yes"
]
},
"then": "circle:white;./assets/layers/recycling/glass_bottles.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
{
"or": [
"recycling:green_waste=yes",
"recycling:organic=yes"
]
}
]
},
"then": "circle:white;./assets/layers/recycling/garden_waste.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:newspaper=yes"
]
},
"then": "circle:white;./assets/layers/recycling/newspaper.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:paper=yes"
]
},
"then": "circle:white;./assets/layers/recycling/paper.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:plastic_bottles=yes"
]
},
"then": "circle:white;./assets/layers/recycling/plastic_bottles.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:plastic_packaging=yes"
]
},
"then": "circle:white;./assets/layers/recycling/plastic_packaging.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:plastic=yes"
]
},
"then": "circle:white;./assets/layers/recycling/plastic.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:scrap_metal=yes"
]
},
"then": "circle:white;./assets/layers/recycling/scrap_metal.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:shoes=yes"
]
},
"then": "circle:white;./assets/layers/recycling/shoes.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
{
"or": [
"recycling:small_appliances=yes",
"recycling:small_electric_appliances=yes"
]
}
]
},
"then": "circle:white;./assets/layers/recycling/small_electrical_appliances.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
"recycling:waste=yes"
]
},
"then": "circle:white;./assets/layers/waste_disposal/waste_disposal.svg"
}
]
},
"iconBadges": [
{
"if": "recycling:batteries=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/batteries.svg"
},
{
"if": "recycling:beverage_cartons=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/beverage_cartons.svg"
},
{
"if": "recycling:cans=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/cans.svg"
},
{
"if": "recycling:clothes=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/clothes.svg"
},
{
"if": "recycling:cooking_oil=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/cooking_oil.svg"
},
{
"if": "recycling:engine_oil=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/engine_oil.svg"
},
{
"if": "recycling:glass=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/glass.svg"
},
{
"if": "recycling:glass_bottles=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/glass_bottles.svg"
"if": {
"and": [
"_waste_amount>1",
"recycling:batteries=yes"
]
},
"then": "circle:white;./assets/layers/recycling/batteries.svg"
},
{
"if": {
"or": [
"recycling:green_waste=yes",
"recycling:organic=yes"
"and": [
"_waste_amount>1",
"recycling:beverage_cartons=yes"
]
},
"then": "circle:#FFFFFF;./assets/layers/recycling/garden_waste.svg"
},
{
"if": "recycling:newspaper=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/newspaper.svg"
},
{
"if": "recycling:paper=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/paper.svg"
},
{
"if": "recycling:plastic_bottles=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/plastic_bottles.svg"
},
{
"if": "recycling:plastic_packaging=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/plastic_packaging.svg"
},
{
"if": "recycling:plastic=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/plastic.svg"
},
{
"if": "recycling:scrap_metal=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/scrap_metal.svg"
},
{
"if": "recyling:shoes=yes",
"then": "circle:#FFFFFF;./assets/layers/recycling/shoes.svg"
"then": "circle:white;./assets/layers/recycling/beverage_cartons.svg"
},
{
"if": {
"or": [
"recycling:small_appliances=yes",
"recycling:small_electrical_appliances=yes"
"and": [
"_waste_amount>1",
"recycling:cans=yes"
]
},
"then": "circle:#FFFFFF;./assets/layers/recycling/small_electrical_appliances.svg"
"then": "circle:white;./assets/layers/recycling/cans.svg"
},
{
"if": "recycling:waste=yes",
"then": "circle:#FFFFFF;./assets/layers/waste_disposal/waste_disposal.svg"
"if": {
"and": [
"_waste_amount>1",
"recycling:clothes=yes"
]
},
"then": "circle:white;./assets/layers/recycling/clothes.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:cooking_oil=yes"
]
},
"then": "circle:white;./assets/layers/recycling/cooking_oil.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:engine_oil=yes"
]
},
"then": "circle:white;./assets/layers/recycling/engine_oil.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:glass=yes"
]
},
"then": "circle:white;./assets/layers/recycling/glass.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:glass_bottles=yes"
]
},
"then": "circle:white;./assets/layers/recycling/glass_bottles.svg"
},
{
"if": {
"and": [
"_waste_amount=1",
{
"or": [
"recycling:green_waste=yes",
"recycling:organic=yes"
]
}
]
},
"then": "circle:white;./assets/layers/recycling/garden_waste.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:newspaper=yes"
]
},
"then": "circle:white;./assets/layers/recycling/newspaper.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:paper=yes"
]
},
"then": "circle:white;./assets/layers/recycling/paper.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:plastic_bottles=yes"
]
},
"then": "circle:white;./assets/layers/recycling/plastic_bottles.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:plastic_packaging=yes"
]
},
"then": "circle:white;./assets/layers/recycling/plastic_packaging.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:plastic=yes"
]
},
"then": "circle:white;./assets/layers/recycling/plastic.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:scrap_metal=yes"
]
},
"then": "circle:white;./assets/layers/recycling/scrap_metal.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:shoes=yes"
]
},
"then": "circle:white;./assets/layers/recycling/shoes.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
{
"or": [
"recycling:small_appliances=yes",
"recycling:small_electrical_appliances=yes"
]
}
]
},
"then": "circle:white;./assets/layers/recycling/small_electrical_appliances.svg"
},
{
"if": {
"and": [
"_waste_amount>1",
"recycling:waste=yes"
]
},
"then": "circle:white;./assets/layers/waste_disposal/waste_disposal.svg"
}
]
}