From c1599369b4e1fc8ad8cbb104026a2a2afba949f5 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Fri, 11 Nov 2022 23:40:16 +0100 Subject: [PATCH] Split out layers --- .../layers/ticket_machine/ticket_machine.json | 65 ++++++++ .../ticket_validator/ticket_validator.json | 73 +++++++++ assets/themes/stations/stations.json | 140 +----------------- langs/themes/en.json | 51 ------- 4 files changed, 140 insertions(+), 189 deletions(-) create mode 100644 assets/layers/ticket_machine/ticket_machine.json create mode 100644 assets/layers/ticket_validator/ticket_validator.json diff --git a/assets/layers/ticket_machine/ticket_machine.json b/assets/layers/ticket_machine/ticket_machine.json new file mode 100644 index 000000000..56a36206c --- /dev/null +++ b/assets/layers/ticket_machine/ticket_machine.json @@ -0,0 +1,65 @@ +{ + "id": "ticket_machine", + "name": { + "en": "Ticket Machines" + }, + "description": { + "en": "Find ticket machines for public transport tickets" + }, + "source": { + "osmTags": { + "and": [ + "amenity=vending_machine", + "vending=public_transport_tickets" + ] + } + }, + "minzoom": 19, + "title": { + "render": { + "en": "Ticket Machine" + } + }, + "tagRenderings": [ + "images", + "level", + { + "id": "operator", + "question": { + "en": "Who is the operator of this ticket machine?" + }, + "render": { + "en": "This ticket machine is operated by {operator}" + }, + "freeform": { + "key": "operator", + "type": "string", + "placeholder": { + "en": "Name of the operator" + } + } + }, + "payment-options" + ], + "presets": [ + { + "tags": [ + "amenity=vending_machine", + "vending=public_transport_tickets" + ], + "title": { + "en": "a ticket machine" + } + } + ], + "mapRendering": [ + { + "icon": "circle:blue;./assets/themes/stations/public_transport_tickets.svg", + "iconSize": "20,20,center", + "location": [ + "point", + "centroid" + ] + } + ] +} \ No newline at end of file diff --git a/assets/layers/ticket_validator/ticket_validator.json b/assets/layers/ticket_validator/ticket_validator.json new file mode 100644 index 000000000..4f057b072 --- /dev/null +++ b/assets/layers/ticket_validator/ticket_validator.json @@ -0,0 +1,73 @@ +{ + "id": "ticket_validator", + "name": { + "en": "Ticket Validators" + }, + "description": { + "en": "Find ticket validators to validate public transport tickets" + }, + "source": { + "osmTags": "amenity=ticket_validator" + }, + "minzoom": 19, + "title": { + "render": { + "en": "Ticket Validator" + } + }, + "tagRenderings": [ + "images", + "level", + { + "id": "validator-operator", + "question": { + "en": "Who is the operator of this ticket validator?" + }, + "render": { + "en": "This ticket validator is operated by {operator}" + }, + "freeform": { + "key": "operator", + "type": "string", + "placeholder": { + "en": "Name of the operator" + } + } + }, + { + "builtin": "payment-options", + "override": { + "mappings+": [ + { + "if": "payment:OV-Chipkaart=yes", + "ifnot": "payment:OV-Chipkaart=no", + "then": { + "en": "This ticket validator accepts OV-Chipkaart" + }, + "hideInAnswer": "_country!=nl" + } + ] + } + } + ], + "presets": [ + { + "tags": [ + "amenity=ticket_validator" + ], + "title": { + "en": "a ticket validator" + } + } + ], + "mapRendering": [ + { + "icon": "circle:green;./assets/themes/stations/public_transport_tickets.svg", + "iconSize": "20,20,center", + "location": [ + "point", + "centroid" + ] + } + ] +} \ No newline at end of file diff --git a/assets/themes/stations/stations.json b/assets/themes/stations/stations.json index 93d516fd2..0598be96c 100644 --- a/assets/themes/stations/stations.json +++ b/assets/themes/stations/stations.json @@ -144,144 +144,8 @@ } }, "railway_platforms", - { - "id": "ticket_machine", - "name": { - "en": "Ticket Machines" - }, - "description": { - "en": "Find ticket machines for public transport tickets" - }, - "source": { - "osmTags": { - "and": [ - "amenity=vending_machine", - "vending=public_transport_tickets" - ] - } - }, - "minzoom": 19, - "title": { - "render": { - "en": "Ticket Machine" - } - }, - "tagRenderings": [ - "images", - "level", - { - "id": "operator", - "question": { - "en": "Who is the operator of this ticket machine?" - }, - "render": { - "en": "This ticket machine is operated by {operator}" - }, - "freeform": { - "key": "operator", - "type": "string", - "placeholder": { - "en": "Name of the operator" - } - } - }, - "payment-options" - ], - "presets": [ - { - "tags": [ - "amenity=vending_machine", - "vending=public_transport_tickets" - ], - "title": { - "en": "a ticket machine" - } - } - ], - "mapRendering": [ - { - "icon": "circle:blue;./assets/themes/stations/public_transport_tickets.svg", - "iconSize": "20,20,center", - "location": [ - "point", - "centroid" - ] - } - ] - }, - { - "id": "ticket_validator", - "name": { - "en": "Ticket Validators" - }, - "description": { - "en": "Find ticket validators to validate public transport tickets" - }, - "source": { - "osmTags": "amenity=ticket_validator" - }, - "minzoom": 19, - "title": { - "render": { - "en": "Ticket Validator" - } - }, - "tagRenderings": [ - "images", - "level", - { - "id": "operator", - "question": { - "en": "Who is the operator of this ticket validator?" - }, - "render": { - "en": "This ticket validator is operated by {operator}" - }, - "freeform": { - "key": "operator", - "type": "string", - "placeholder": { - "en": "Name of the operator" - } - } - }, - { - "builtin": "payment-options", - "override": { - "mappings+": [ - { - "if": "payment:OV-Chipkaart=yes", - "ifnot": "payment:OV-Chipkaart=no", - "then": { - "en": "This ticket validator accepts OV-Chipkaart" - }, - "hideInAnswer": "_country!=nl" - } - ] - } - } - ], - "presets": [ - { - "tags": [ - "amenity=ticket_validator" - ], - "title": { - "en": "a ticket validator" - } - } - ], - "mapRendering": [ - { - "icon": "circle:green;./assets/themes/stations/public_transport_tickets.svg", - "iconSize": "20,20,center", - "location": [ - "point", - "centroid" - ] - } - ] - }, + "ticket_machine", + "ticket_validator", { "builtin": [ "entrance", diff --git a/langs/themes/en.json b/langs/themes/en.json index 7567790d7..98667debc 100644 --- a/langs/themes/en.json +++ b/langs/themes/en.json @@ -1091,57 +1091,6 @@ "stations": { "description": "View, edit and add details to a train station", "layers": { - "8": { - "description": "Find ticket machines for public transport tickets", - "name": "Ticket Machines", - "presets": { - "0": { - "title": "a ticket machine" - } - }, - "tagRenderings": { - "operator": { - "freeform": { - "placeholder": "Name of the operator" - }, - "question": "Who is the operator of this ticket machine?", - "render": "This ticket machine is operated by {operator}" - } - }, - "title": { - "render": "Ticket Machine" - } - }, - "9": { - "description": "Find ticket validators to validate public transport tickets", - "name": "Ticket Validators", - "presets": { - "0": { - "title": "a ticket validator" - } - }, - "tagRenderings": { - "operator": { - "freeform": { - "placeholder": "Name of the operator" - }, - "question": "Who is the operator of this ticket validator?", - "render": "This ticket validator is operated by {operator}" - }, - "payment-options": { - "override": { - "mappings+": { - "0": { - "then": "This ticket validator accepts OV-Chipkaart" - } - } - } - } - }, - "title": { - "render": "Ticket Validator" - } - }, "11": { "description": "Displays showing the trains that will leave from this station", "name": "Departures boards",