{
  "id": "transit_stops",
  "name": {
    "en": "Transit Stops",
    "de": "Haltestellen",
    "da": "Transitstationer",
    "fr": "Arrêts de transport en commun",
    "ca": "Parades de transport públic"
  },
  "description": {
    "en": "Layer showing different types of transit stops.",
    "de": "Ebene mit verschiedenen Arten von Haltestellen.",
    "da": "Lag, der viser forskellige typer transitstop."
  },
  "source": {
    "osmTags": {
      "or": [
        "highway=bus_stop"
      ]
    }
  },
  "minzoom": 15,
  "title": {
    "render": {
      "en": "Transit Stop",
      "de": "Haltestelle",
      "da": "Transit Stop",
      "nl": "Bushalte"
    },
    "mappings": [
      {
        "if": "name~*",
        "then": {
          "en": "Stop {name}",
          "de": "Haltestelle {name}",
          "da": "Stop {name}",
          "nl": "Halte {name}"
        }
      }
    ]
  },
  "mapRendering": [
    {
      "location": [
        "point",
        "centroid"
      ],
      "icon": {
        "render": "./assets/layers/transit_stops/bus_stop.svg",
        "mappings": []
      },
      "label": "<div style=\"background: white; display: block\">{name}</div>"
    }
  ],
  "calculatedTags": [
    "_routes=feat.memberships()",
    "_contained_routes_properties=feat.memberships().map(p => {return {id: p.relation.id, name: p.relation.properties.name} }).filter((v,i,a)=>a.findIndex(t=>(JSON.stringify(t) === JSON.stringify(v)))===i)",
    "_contained_route_ids=JSON.parse(feat.properties._contained_routes_properties ?? '[]').map(p => p.id)",
    "_contained_routes=JSON.parse(feat.properties._contained_routes_properties ?? '[]').map(p => `<li><a href='#relation/${p.id}'>${p.name ?? 'bus route'}</a></li>`).join('')",
    "_contained_routes_count=JSON.parse(feat.properties._contained_routes_properties ?? '[]').length"
  ],
  "tagRenderings": [
    {
      "id": "stop_name",
      "render": {
        "en": "This stop is called <b>{name}</b>",
        "de": "Der Name der Haltestelle lautet <b>{name}</b>",
        "da": "Dette stop hedder <b>{name}</b>",
        "nl": "Deze halte heet <b>{name}</b>",
        "ca": "Aquesta parada es diu <b>{name}</b>",
        "fr": "Cet arrêt est nommé <b>{name}</b>"
      },
      "freeform": {
        "key": "name",
        "type": "string",
        "addExtraTags": [
          "noname="
        ],
        "placeholder": {
          "en": "Name of the stop",
          "de": "Name der Haltestelle",
          "da": "Navn på stoppestedet",
          "nl": "Naam van de halte"
        }
      },
      "mappings": [
        {
          "if": {
            "and": [
              "noname=yes",
              "name="
            ]
          },
          "then": {
            "en": "This stop has no name",
            "de": "Die Haltestelle hat keinen Namen",
            "da": "Dette stop har intet navn",
            "nl": "Deze halte heeft geen naam",
            "ca": "Aquesta parada no té nom"
          }
        }
      ],
      "question": {
        "en": "What is the name of this stop?",
        "de": "Wie lautet der Name der Haltestelle?",
        "da": "Hvad er navnet på dette stop?",
        "nl": "Wat is de naam van deze halte?",
        "ca": "Quin és el nom d'aquesta parada?"
      }
    },
    "images",
    {
      "id": "shelter",
      "mappings": [
        {
          "if": "shelter=yes",
          "then": {
            "en": "This stop has a shelter",
            "de": "Die Haltestelle hat einen Unterstand",
            "da": "Dette stop har et ly",
            "nl": "Deze halte heeft een schuilplaats",
            "ca": "Aquesta parada té una coberta",
            "fr": "Cet arrêt a un abri"
          }
        },
        {
          "if": "shelter=no",
          "then": {
            "en": "This stop does <b>not</b> have a shelter",
            "de": "Die Haltestelle hat <b>keinen</b> Unterstand",
            "da": "Dette stop har ikke et ly",
            "nl": "Deze halte heeft <b>geen</b> schuilplaats",
            "ca": "Aquesta parada <b>no</b> té una coberta",
            "fr": "Cet arrêt <b>n'a pas</b> d'abri"
          }
        },
        {
          "if": "shelter=separate",
          "then": {
            "en": "This stop has a shelter, that's separately mapped",
            "de": "Die Haltestelle hat einen Unterstand, der separat kariert ist",
            "nl": "Deze halte heeft een schuilplaats, die apart op de kaart staat"
          },
          "hideInAnswer": true
        }
      ],
      "question": {
        "en": "Does this stop have a shelter?",
        "de": "Hat die Haltestelle einen Unterstand?",
        "da": "Har dette stop et ly?",
        "nl": "Heeft deze halte een schuilplaats?",
        "ca": "Aquesta parada té una coberta?",
        "fr": "Cet arrêt a-t-il un abri ?"
      }
    },
    {
      "id": "bench",
      "mappings": [
        {
          "if": "bench=yes",
          "then": {
            "en": "This stop has a bench",
            "de": "Die Haltestelle hat eine Bank",
            "da": "Dette stop har en bænk",
            "nl": "Deze halte heeft een zitbank",
            "ca": "Aquesta parada té un banc",
            "fr": "Cet arrêt a un banc"
          }
        },
        {
          "if": "bench=no",
          "then": {
            "en": "This stop does <b>not</b> have a bench",
            "de": "Die Haltestelle hat <b>keine</b> Sitzbank",
            "da": "Dette stoppested har ingen bænk",
            "nl": "Deze halte heeft <b>geen</b> zitbank",
            "ca": "Aquesta parada <b>no</b> té un banc",
            "fr": "Cet arrêt <b>n'a pas</b> de banc"
          }
        },
        {
          "if": "bench=separate",
          "then": {
            "en": "This stop has a bench, that's separately mapped",
            "de": "Die Haltestelle hat eine Bank, die separat kartiert ist",
            "nl": "Deze halte heeft een zitbank, die los aangegeven is op de kaart"
          },
          "hideInAnswer": true
        }
      ],
      "question": {
        "en": "Does this stop have a bench?",
        "de": "Gibt es an der Haltestelle eine Sitzbank?",
        "da": "Har dette stop en bænk?",
        "nl": "Heeft deze halte een zitbank?",
        "ca": "Aquesta parada té un banc?"
      }
    },
    {
      "id": "bin",
      "mappings": [
        {
          "if": "bin=yes",
          "then": {
            "en": "This stop has a bin",
            "de": "Die Haltestelle hat einen Mülleimer",
            "da": "Dette stop har en skraldespand",
            "nl": "Deze halte heeft een vuilnisbak",
            "ca": "Aquesta parada té una paperera",
            "fr": "Cet arrêt a un poubelle"
          }
        },
        {
          "if": "bin=no",
          "then": {
            "en": "This stop does <b>not</b> have a bin",
            "de": "Die Haltestelle hat <b>keinen</b> Mülleimer",
            "da": "Dette stoppested har ikke en skraldespand",
            "nl": "Deze halte heeft <b>geen</b> vuilnisbak",
            "ca": "Aquesta parada <b>no</b> té paperera",
            "fr": "Cet arrêt <b>n'a pas</b> de poubelle"
          }
        },
        {
          "if": "bin=separate",
          "then": {
            "en": "This stop has a bin, that's separately mapped",
            "de": "Die Haltestelle hat einen Mülleimer, der separat kartiert ist",
            "nl": "Deze heeft een vuilnisbak, die los op de kaart staat"
          },
          "hideInAnswer": true
        }
      ],
      "question": {
        "en": "Does this stop have a bin?",
        "de": "Hat die Haltestelle einen Mülleimer?",
        "da": "Har dette stop en skraldespand?",
        "nl": "Heeft deze halte een vuilnisbak?",
        "ca": "Aquesta parada té una paperera?"
      }
    },
    "wheelchair-access",
    {
      "id": "tactile_paving",
      "mappings": [
        {
          "if": "tactile_paving=yes",
          "then": {
            "en": "This stop has tactile paving",
            "de": "Die Haltestelle hat ein taktiles Pflaster",
            "ca": "Aquesta parada té una superfície podotàctil",
            "nl": "Deze halte heeft een geleidelijn",
            "fr": "Cet arrêt a une surface podotactile"
          }
        },
        {
          "if": "tactile_paving=no",
          "then": {
            "en": "This stop does <b>not</b> have tactile paving",
            "de": "Die Haltestelle hat <b>kein</b> taktiles Pflaster",
            "ca": "Aquesta parada <b>no</b> té superfície podotàctil",
            "nl": "Deze halte heeft <b>geen</b> geleidelijn",
            "fr": "Cet arrêt <b>n'a pas</b> de surface podotactile"
          }
        }
      ],
      "question": {
        "en": "Does this stop have tactile paving?",
        "de": "Hat die Haltestelle hat ein taktiles Pflaster?",
        "ca": "Aquesta parada té una superfície podotàctil?",
        "nl": "Heeft deze halte een geleidelijn?",
        "fr": "Cet arrêt a-t-il une surface podotactile ?"
      }
    },
    {
      "id": "lit",
      "mappings": [
        {
          "if": "lit=yes",
          "then": {
            "en": "This stop is lit",
            "de": "Die Haltestelle ist beleuchtet",
            "nl": "Deze halte is verlicht",
            "ca": "Aquesta parada té il·luminació",
            "fr": "Cet arrêt est éclairé"
          }
        },
        {
          "if": "lit=no",
          "then": {
            "en": "This stop is <b>not</b> lit",
            "de": "Die Haltestelle hat <b>keine</b> Beleuchtung",
            "da": "Dette stop lyser ikke",
            "nl": "Deze halte is <b>niet</b> verlicht",
            "ca": "Aquesta parada <b>no</b> té il·luminació",
            "fr": "Cet arrêt <b>n'est pas</b> éclairé"
          }
        }
      ],
      "question": {
        "en": "Is this stop lit?",
        "de": "Ist die Haltestelle beleuchtet?",
        "nl": "Is deze halte verlicht?",
        "ca": "Aquesta parada té il·luminació?",
        "fr": "Cet arrêt est-il éclairé ?"
      }
    },
    {
      "id": "departures_board",
      "mappings": [
        {
          "if": "departures_board=yes",
          "then": {
            "en": "This stop has a departures board of unknown type",
            "de": "Die Haltestelle hat einen Fahrplan, der nicht näher definiert ist",
            "da": "Dette stoppested har en afgangstavle af ukendt type"
          },
          "hideInAnswer": true
        },
        {
          "if": "departures_board=realtime",
          "then": {
            "en": "This stop has a board showing realtime departure information",
            "de": "Die Haltestelle hat einen Fahrplan, der Abfahrtszeiten in Echtzeit anzeigt",
            "da": "Dette stop har en tavle med oplysninger om afgang i realtid",
            "fr": "Cet arrêt a un panneau indiquant les départs en temps réel",
            "ca": "Aquesta parada té un tauló amb els horaris en temps real"
          }
        },
        {
          "if": "passenger_information_display=yes",
          "then": {
            "en": "This stop has a board showing realtime departure information",
            "de": "Die Haltestelle hat einen Fahrplan, der Abfahrtszeiten in Echtzeit anzeigt",
            "da": "Dette stop har en tavle med oplysninger om afgang i realtid",
            "ca": "Aquesta parada té un tauló amb els horaris en temps real"
          },
          "hideInAnswer": true
        },
        {
          "if": "departures_board=timetable",
          "then": {
            "en": "This stop has a timetable showing regular departures",
            "de": "Die Haltestelle hat einen Fahrplan, der die regulären Abfahrtszeiten anzeigt",
            "da": "Dette stop har en køreplan, der viser regelmæssige afgange"
          }
        },
        {
          "if": "departures_board=interval",
          "then": {
            "en": "This stop has a timetable containing just the interval between departures",
            "de": "Die Haltestelle hat einen Fahrplan, der den Abstand zwischen Abfahrten anzeigt",
            "da": "Dette stop har en køreplan, der kun indeholder intervallet mellem afgangene"
          }
        },
        {
          "if": "departures_board=no",
          "then": {
            "en": "This stop does <b>not</b> have a departures board",
            "de": "Die Haltestelle hat <b>keinen</b> Fahrplan",
            "da": "Dette stop har ikke en afgangstavle"
          }
        }
      ]
    },
    {
      "render": {
        "en": "<h3>{_contained_routes_count} routes stop at this stop</h3> <ul>{_contained_routes}</ul>",
        "de": "<h3>{_contained_routes_count} Linien halten an der Haltestelle</h3> <ul>{_contained_routes}</ul>",
        "da": "<h3>{_contained_routes_count} ruter stopper ved dette stoppested</h3> <ul>{_contained_routes}</ul>",
        "nl": "<h3>{_contained_routes_count} lijnen stoppen bij deze halte</h3> <ul>{_contained_routes}</ul>",
        "ca": "<h3>{_contained_routes_count} rutes paren a aquesta parada</h3> <ul>{_contained_routes}</ul>"
      },
      "condition": "_contained_routes~*",
      "id": "contained_routes"
    }
  ],
  "filter": [
    {
      "id": "shelter",
      "options": [
        {
          "osmTags": {
            "or": [
              "shelter=yes",
              "shelter=separate"
            ]
          },
          "question": {
            "en": "With a shelter",
            "de": "Mit Unterstand",
            "fr": "Avec un abri",
            "ca": "Amb refugi"
          }
        }
      ]
    },
    {
      "id": "bench",
      "options": [
        {
          "osmTags": {
            "or": [
              "bench=yes",
              "bench=separate"
            ]
          },
          "question": {
            "en": "With a bench",
            "de": "Mit Sitzbank",
            "fr": "Avec un banc"
          }
        }
      ]
    },
    {
      "id": "bin",
      "options": [
        {
          "osmTags": {
            "or": [
              "bin=yes",
              "bin=separate"
            ]
          },
          "question": {
            "en": "With a bin",
            "de": "Mit Mülleimer",
            "fr": "Avec un poubelle",
            "ca": "Amb paperera"
          }
        }
      ]
    },
    "tactile_paving"
  ],
  "allowMove": false
}