Add some useful filters

This commit is contained in:
Pieter Vander Vennet 2023-03-05 23:44:28 +01:00
parent 21216127c5
commit 92c5e5dea2
3 changed files with 92 additions and 2 deletions

View file

@ -10,6 +10,28 @@ export default interface FilterConfigJson {
* If there are multiple options these will be a list of radio buttons
* If there is only one option this will be a checkbox
* Filtering is done based on the given osmTags that are compared to the objects in that layer.
*
* An example which searches by name:
*
* ```
* {
* "id": "shop-name",
* "options": [
* {
* "fields": [
* {
* "name": "search",
* "type": "string"
* }
* ],
* "osmTags": "name~i~.*{search}.*",
* "question": {
* "en": "Only show shops with name {search}",
* }
* }
* ]
* }
* ```
*/
options: {
question: string | any

View file

@ -605,6 +605,63 @@
}
],
"filter": [
{
"id": "accessibility",
"options": [
{
"question": {
"en": "Publicly accessible",
"nl": "Publiek toegankelijk"
},
"osmTags": {
"or": [
"access=yes",
"access=public",
"access="
]
}
}
]
},
{
"id": "available_sports",
"options": [
{
"question": {
"en": "All sports",
"nl": "Alle sporten"
}
},
{
"osmTags": "sport=basketball",
"question": {
"nl": "Basketbalvelden",
"en": "Basketball fields"
}
},
{
"osmTags": "sport=soccer",
"question": {
"nl": "Voetbalvelden",
"en": "Soccer fields"
}
},
{
"osmTags": "sport=table_tennis",
"question": {
"nl": "Pingpong-tafel",
"en": "Ping-pong table"
}
},
{
"osmTags": "sport=tennis",
"question": {
"nl": "Tennisveld",
"en": "Tennis field"
}
}
]
},
"open_now"
]
}
}

View file

@ -262,6 +262,17 @@
"question": "Heeft een FIXME"
}
]
},{
"id": "last-edited-by",
"options": [
{
"fields": [{
"name": "username"
}],
"question": "Last change made by {username}",
"osmTags": "_last_edit:contributor~i~{username}"
}
]
}
]
},
@ -757,4 +768,4 @@
"overpassMaxZoom": 17,
"osmApiTileSize": 17,
"credits": "Pieter Vander Vennet"
}
}