From a8a5ce8ded81b9727436bcdea981c4e559ec2490 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 3 Feb 2023 03:54:59 +0100 Subject: [PATCH] Move 'icons.json' into a regular library-layer --- .../bicycle_library/bicycle_library.json | 4 +- assets/layers/bike_shop/bike_shop.json | 4 +- assets/layers/cafe_pub/cafe_pub.json | 4 +- .../layers/climbing_club/climbing_club.json | 4 +- assets/layers/climbing_gym/climbing_gym.json | 4 +- .../layers/fitness_centre/fitness_centre.json | 4 +- .../fitness_station/fitness_station.json | 4 +- assets/layers/food/food.json | 4 +- assets/layers/icons/icons.json | 131 ++++++++++++++++++ .../layers/parcel_lockers/parcel_lockers.json | 4 +- assets/layers/pharmacy/pharmacy.json | 4 +- assets/layers/playground/playground.json | 4 +- assets/layers/postoffices/postoffices.json | 4 +- assets/layers/shops/shops.json | 4 +- assets/layers/sport_pitch/sport_pitch.json | 4 +- .../layers/sports_centre/sports_centre.json | 4 +- assets/layers/toilet/toilet.json | 4 +- .../toilet_at_amenity/toilet_at_amenity.json | 4 +- assets/layers/veterinary/veterinary.json | 4 +- assets/tagRenderings/icons.json | 103 -------------- 20 files changed, 167 insertions(+), 139 deletions(-) create mode 100644 assets/layers/icons/icons.json delete mode 100644 assets/tagRenderings/icons.json diff --git a/assets/layers/bicycle_library/bicycle_library.json b/assets/layers/bicycle_library/bicycle_library.json index 633de011a..05a67322c 100644 --- a/assets/layers/bicycle_library/bicycle_library.json +++ b/assets/layers/bicycle_library/bicycle_library.json @@ -320,7 +320,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" }, { "if": "service:bicycle:pump=yes", @@ -345,4 +345,4 @@ } ], "deletion": true -} \ No newline at end of file +} diff --git a/assets/layers/bike_shop/bike_shop.json b/assets/layers/bike_shop/bike_shop.json index fc61c5654..70e63386d 100644 --- a/assets/layers/bike_shop/bike_shop.json +++ b/assets/layers/bike_shop/bike_shop.json @@ -781,7 +781,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" }, { "if": "service:bicycle:pump=yes", @@ -815,4 +815,4 @@ } } ] -} \ No newline at end of file +} diff --git a/assets/layers/cafe_pub/cafe_pub.json b/assets/layers/cafe_pub/cafe_pub.json index 94998e1c9..b27ef9da3 100644 --- a/assets/layers/cafe_pub/cafe_pub.json +++ b/assets/layers/cafe_pub/cafe_pub.json @@ -334,7 +334,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ], "label": { @@ -360,4 +360,4 @@ "da": "Et lag med caféer og pubber, hvor man kan samles omkring en drink. Laget stiller nogle relevante spørgsmål", "fr": "Une couche montrants les cafés et pubs où l’on peut prendre un verre. Cette couche pose des questions y afférentes." } -} \ No newline at end of file +} diff --git a/assets/layers/climbing_club/climbing_club.json b/assets/layers/climbing_club/climbing_club.json index 47cf7002b..a40d48e71 100644 --- a/assets/layers/climbing_club/climbing_club.json +++ b/assets/layers/climbing_club/climbing_club.json @@ -166,7 +166,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ], "iconSize": { @@ -186,4 +186,4 @@ } } ] -} \ No newline at end of file +} diff --git a/assets/layers/climbing_gym/climbing_gym.json b/assets/layers/climbing_gym/climbing_gym.json index f06128d5c..da849d6dc 100644 --- a/assets/layers/climbing_gym/climbing_gym.json +++ b/assets/layers/climbing_gym/climbing_gym.json @@ -213,7 +213,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ], "iconSize": { @@ -246,4 +246,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/assets/layers/fitness_centre/fitness_centre.json b/assets/layers/fitness_centre/fitness_centre.json index 15e5f4591..e712a0c97 100644 --- a/assets/layers/fitness_centre/fitness_centre.json +++ b/assets/layers/fitness_centre/fitness_centre.json @@ -94,7 +94,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ] } @@ -102,4 +102,4 @@ "filter": [ "open_now" ] -} \ No newline at end of file +} diff --git a/assets/layers/fitness_station/fitness_station.json b/assets/layers/fitness_station/fitness_station.json index a798ea668..34ab22e12 100644 --- a/assets/layers/fitness_station/fitness_station.json +++ b/assets/layers/fitness_station/fitness_station.json @@ -402,7 +402,7 @@ "opening_hours~*" ] }, - "then": "isOpen" + "then": "icons.isOpen" } ] } @@ -410,4 +410,4 @@ "filter": [ "open_now" ] -} \ No newline at end of file +} diff --git a/assets/layers/food/food.json b/assets/layers/food/food.json index 5a83a2471..b7a035f80 100644 --- a/assets/layers/food/food.json +++ b/assets/layers/food/food.json @@ -1045,7 +1045,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" }, { "if": { @@ -1091,4 +1091,4 @@ "es": "Una capa que muestra restaurantes y facilidades de comida rápida", "fr": "Un claque montrant les restaurants et les endroits de nourriture rapide (avec un rendu spécial pour les friteries)" } -} \ No newline at end of file +} diff --git a/assets/layers/icons/icons.json b/assets/layers/icons/icons.json new file mode 100644 index 000000000..bf23f8d8e --- /dev/null +++ b/assets/layers/icons/icons.json @@ -0,0 +1,131 @@ +{ + "id": "icons", + "description": { + "en": "A layer acting as library for icon-tagrenderings, especially to show as badge next to a POI" + }, + "source": { + "osmTags": "id~*" + }, + "title": null, + "tagRenderings": [ + { + "id": "wikipedialink", + "labels": [ + "defaults" + ], + "render": "Wikipedia", + "condition": { + "or": [ + "wikipedia~*", + "wikidata~*" + ] + }, + "mappings": [ + { + "#": "ignore-image-in-then", + "if": "wikipedia=", + "then": "WD" + } + ] + }, + { + "id": "isOpen", + "labels": [ + "defaults" + ], + "#": "Shows a coloured clock if opening hours are parsed. Uses the metatagging, suitable to use as a (badged) overlay", + "mappings": [ + { + "if": "_isOpen=yes", + "then": "clock:#0f0;ring:#0f0" + }, + { + "if": "_isOpen=no", + "then": "circle:#f00;clock:#fff" + }, + { + "#": "Still loading the country", + "if": { + "and": [ + "_isOpen=", + "opening_hours~*" + ] + }, + "then": "clock:#ff0;ring:#ff0" + }, + { + "#": "Still loading the country", + "if": { + "and": [ + "_isOpen=parse_error", + "opening_hours~*" + ] + }, + "then": "circle:#f0f;clock:#fff" + } + ] + }, + { + "id": "phonelink", + "labels": [ + "defaults" + ], + "render": "phone", + "condition": "phone~*" + }, + { + "id": "emaillink", + "labels": [ + "defaults" + ], + "render": "email", + "condition": "email~*" + }, + { + "id": "smokingicon", + "labels": [ + "defaults" + ], + "mappings": [ + { + "#": "ignore-image-in-then", + "if": "smoking=no", + "then": "no-smoking" + }, + { + "#": "ignore-image-in-then", + "if": "smoking=yes", + "then": "smoking-allowed" + } + ] + }, + + { + "id": "sharelink", + "labels": [ + "defaults" + ], + "render": "{share_link()}" + }, + { + "id": "osmlink", + "labels": [ + "defaults" + ], + "render": "on osm", + "mappings": [ + { + "if": "id~.*/-.*", + "then": "" + }, + { + "#": "ignore-image-in-then", + "if": "_backend~*", + "then": "" + } + ], + "condition": "id~(node|way|relation)/[0-9]*" + } + ], + "mapRendering": null +} diff --git a/assets/layers/parcel_lockers/parcel_lockers.json b/assets/layers/parcel_lockers/parcel_lockers.json index 1b9530f84..01c78409b 100644 --- a/assets/layers/parcel_lockers/parcel_lockers.json +++ b/assets/layers/parcel_lockers/parcel_lockers.json @@ -259,7 +259,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ], "iconSize": "40,40,center", @@ -269,4 +269,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/assets/layers/pharmacy/pharmacy.json b/assets/layers/pharmacy/pharmacy.json index 87fa982e2..057226bac 100644 --- a/assets/layers/pharmacy/pharmacy.json +++ b/assets/layers/pharmacy/pharmacy.json @@ -119,7 +119,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ], "label": { @@ -173,4 +173,4 @@ } } ] -} \ No newline at end of file +} diff --git a/assets/layers/playground/playground.json b/assets/layers/playground/playground.json index 71198948f..ddf3ea8a1 100644 --- a/assets/layers/playground/playground.json +++ b/assets/layers/playground/playground.json @@ -578,7 +578,7 @@ "opening_hours~*" ] }, - "then": "isOpen" + "then": "icons.isOpen" } ], "iconSize": { @@ -616,4 +616,4 @@ } } ] -} \ No newline at end of file +} diff --git a/assets/layers/postoffices/postoffices.json b/assets/layers/postoffices/postoffices.json index d9b508b84..317e93ca6 100644 --- a/assets/layers/postoffices/postoffices.json +++ b/assets/layers/postoffices/postoffices.json @@ -433,7 +433,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" }, { "if": "shop~*", @@ -451,4 +451,4 @@ "width": "1" } ] -} \ No newline at end of file +} diff --git a/assets/layers/shops/shops.json b/assets/layers/shops/shops.json index 03406dba6..c872ce8b4 100644 --- a/assets/layers/shops/shops.json +++ b/assets/layers/shops/shops.json @@ -326,7 +326,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" }, { "if": { @@ -411,4 +411,4 @@ "accepts_cards", "has_organic" ] -} \ No newline at end of file +} diff --git a/assets/layers/sport_pitch/sport_pitch.json b/assets/layers/sport_pitch/sport_pitch.json index 5e686c05d..2cff74eab 100644 --- a/assets/layers/sport_pitch/sport_pitch.json +++ b/assets/layers/sport_pitch/sport_pitch.json @@ -553,7 +553,7 @@ "opening_hours~*" ] }, - "then": "isOpen" + "then": "icons.isOpen" }, { "if": { @@ -602,4 +602,4 @@ "filter": [ "open_now" ] -} \ No newline at end of file +} diff --git a/assets/layers/sports_centre/sports_centre.json b/assets/layers/sports_centre/sports_centre.json index cba852843..3e34be973 100644 --- a/assets/layers/sports_centre/sports_centre.json +++ b/assets/layers/sports_centre/sports_centre.json @@ -49,7 +49,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ], "location": [ @@ -68,4 +68,4 @@ "filter": [ "open_now" ] -} \ No newline at end of file +} diff --git a/assets/layers/toilet/toilet.json b/assets/layers/toilet/toilet.json index f7ae5a35f..1165390e0 100644 --- a/assets/layers/toilet/toilet.json +++ b/assets/layers/toilet/toilet.json @@ -700,7 +700,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ], "location": [ @@ -755,4 +755,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/assets/layers/toilet_at_amenity/toilet_at_amenity.json b/assets/layers/toilet_at_amenity/toilet_at_amenity.json index 50ec080ff..1484496fe 100644 --- a/assets/layers/toilet_at_amenity/toilet_at_amenity.json +++ b/assets/layers/toilet_at_amenity/toilet_at_amenity.json @@ -372,7 +372,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" }, { "if": "shop~*", @@ -466,4 +466,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/assets/layers/veterinary/veterinary.json b/assets/layers/veterinary/veterinary.json index 91ce944ec..cadeaf334 100644 --- a/assets/layers/veterinary/veterinary.json +++ b/assets/layers/veterinary/veterinary.json @@ -79,7 +79,7 @@ "iconBadges": [ { "if": "opening_hours~*", - "then": "isOpen" + "then": "icons.isOpen" } ] }, @@ -116,4 +116,4 @@ "id": "vetName" } ] -} \ No newline at end of file +} diff --git a/assets/tagRenderings/icons.json b/assets/tagRenderings/icons.json deleted file mode 100644 index 6a0d786d7..000000000 --- a/assets/tagRenderings/icons.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "id": "shared_icons", - "defaults": { - "builtin": [ - "phonelink", - "emaillink", - "wikipedialink", - "smokingicon", - "osmlink", - "sharelink" - ], - "override": {} - }, - "wikipedialink": { - "render": "Wikipedia", - "condition": { - "or": [ - "wikipedia~*", - "wikidata~*" - ] - }, - "mappings": [ - { - "#": "ignore-image-in-then", - "if": "wikipedia=", - "then": "WD" - } - ] - }, - "isOpen": { - "#": "Shows a coloured clock if opening hours are parsed. Uses the metatagging, suitable to use as a (badged) overlay", - "mappings": [ - { - "if": "_isOpen=yes", - "then": "clock:#0f0;ring:#0f0" - }, - { - "if": "_isOpen=no", - "then": "circle:#f00;clock:#fff" - }, - { - "#": "Still loading the country", - "if": { - "and": [ - "_isOpen=", - "opening_hours~*" - ] - }, - "then": "clock:#ff0;ring:#ff0" - }, - { - "#": "Still loading the country", - "if": { - "and": [ - "_isOpen=parse_error", - "opening_hours~*" - ] - }, - "then": "circle:#f0f;clock:#fff" - } - ] - }, - "phonelink": { - "render": "phone", - "condition": "phone~*" - }, - "emaillink": { - "render": "email", - "condition": "email~*" - }, - "smokingicon": { - "mappings": [ - { - "#": "ignore-image-in-then", - "if": "smoking=no", - "then": "no-smoking" - }, - { - "#": "ignore-image-in-then", - "if": "smoking=yes", - "then": "smoking-allowed" - } - ] - }, - "osmlink": { - "render": "on osm", - "mappings": [ - { - "if": "id~.*/-.*", - "then": "" - }, - { - "#": "ignore-image-in-then", - "if": "_backend~*", - "then": "" - } - ], - "condition": "id~(node|way|relation)/[0-9]*" - }, - "sharelink": { - "render": "{share_link()}" - } -} \ No newline at end of file