Fix import flow, add typing

This commit is contained in:
Pieter Vander Vennet 2022-07-08 03:14:55 +02:00
parent 97334fc369
commit 4246221e8e
29 changed files with 396 additions and 309 deletions

View file

@ -1,136 +1,138 @@
{
"id": "doctors",
"name": {
"en": "doctors"
"id": "doctors",
"name": {
"en": "doctors"
},
"source": {
"osmTags": {
"or": [
"amenity=doctors",
"amenity=dentist",
"healthcare=physiotherapist"
]
}
},
"title": {
"render": {
"en": "Doctors Office {name}"
},
"source": {
"osmTags": {
"or": [
"amenity=doctors",
"amenity=dentist",
"healthcare=physiotherapist"
]
}
},
"title": {
"render": {
"en": "Doctors Office {name}"
},
"mappings": [
{
"if": "amenity=doctors",
"then": "Doctors Office {name}"
},
{
"if": "amenity=dentist",
"then": "Dentists office {name}"
},
{
"if": "healthcare=physiotherapist",
"then": "Physiotherapists office {name}"
}
]
},
"minzoom": 13,
"tagRenderings": [
"images",
"opening_hours",
"phone",
"email",
"website",
{
"condition": "amenity=doctors",
"id": "specialty",
"render": {
"en": "This doctor is specialized in {healthcare:speciality}"
},
"question": {
"en": "What is this doctor specialized in?"
},
"freeform": {
"key": "healthcare:speciality"
},
"mappings": [
{
"if": "healthcare:speciality=general",
"then": {
"en": "This is a general practitioner"
}
},
{
"if": "healthcare:speciality=gynaecology",
"then": {
"en": "This is a gynaecologist"
}
},
{
"if": "healthcare:speciality=psychiatry",
"then": {
"en": "This is a psychiatrist"
}
},
{
"if": "healthcare:speciality=paediatrics",
"then": {
"en": "This is a paediatrician"
}
}
]
}
],
"presets": [
{
"title": {
"en": "a doctors office"
},
"tags": [
"amenity=doctors"
]
},
{
"title": {
"en": "a dentists office"
},
"tags": [
"amenity=dentist"
]
},
{
"title": {
"en": "a physiotherapists office"
},
"tags": [
"healthcare=physiotherapist"
]
}
],
"filter": [
{
"id": "opened-now",
"options": [
{
"question": {
"en": "Opened now"
},
"osmTags": "_isOpen=yes"
}
]
}
],
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/layers/doctors/doctors.svg",
"mappings": [{
"if": "amenity=dentist",
"then": "circle:white;./assets/layers/doctors/dentist.svg"
}]
},
"iconSize": "40,40,center",
"location": [
"point",
"centroid"
]
}
"mappings": [
{
"if": "amenity=doctors",
"then": "Doctors Office {name}"
},
{
"if": "amenity=dentist",
"then": "Dentists office {name}"
},
{
"if": "healthcare=physiotherapist",
"then": "Physiotherapists office {name}"
}
]
},
"minzoom": 13,
"tagRenderings": [
"images",
"opening_hours",
"phone",
"email",
"website",
{
"condition": "amenity=doctors",
"id": "specialty",
"render": {
"en": "This doctor is specialized in {healthcare:speciality}"
},
"question": {
"en": "What is this doctor specialized in?"
},
"freeform": {
"key": "healthcare:speciality"
},
"mappings": [
{
"if": "healthcare:speciality=general",
"then": {
"en": "This is a general practitioner"
}
},
{
"if": "healthcare:speciality=gynaecology",
"then": {
"en": "This is a gynaecologist"
}
},
{
"if": "healthcare:speciality=psychiatry",
"then": {
"en": "This is a psychiatrist"
}
},
{
"if": "healthcare:speciality=paediatrics",
"then": {
"en": "This is a paediatrician"
}
}
]
}
],
"presets": [
{
"title": {
"en": "a doctors office"
},
"tags": [
"amenity=doctors"
]
},
{
"title": {
"en": "a dentists office"
},
"tags": [
"amenity=dentist"
]
},
{
"title": {
"en": "a physiotherapists office"
},
"tags": [
"healthcare=physiotherapist"
]
}
],
"filter": [
{
"id": "opened-now",
"options": [
{
"question": {
"en": "Opened now"
},
"osmTags": "_isOpen=yes"
}
]
}
],
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/layers/doctors/doctors.svg",
"mappings": [
{
"if": "amenity=dentist",
"then": "circle:white;./assets/layers/doctors/dentist.svg"
}
]
},
"iconSize": "40,40,center",
"location": [
"point",
"centroid"
]
}
]
}

View file

@ -41,5 +41,4 @@
]
}
]
}
}

View file

@ -3,9 +3,7 @@
"description": "Layer containing various presets and questions generated by ID. These are meant to be reused in other layers by importing the tagRenderings with `id_preset.<tagrendering>",
"#dont-translate": "*",
"source": {
"osmTags": {
"and": []
}
"osmTags": "id~*"
},
"mapRendering": null,
"tagRenderings": [

View file

@ -1,68 +1,64 @@
{
"id": "pharmacy",
"name": {
"en": "pharmacy"
},
"title": {
"render": {
"en": "{name}"
}
},
"source": {
"osmTags": {
"and": [
"amenity=pharmacy"
]
}
},
"minzoom":13,
"tagRenderings": [
"images",
"opening_hours",
"phone",
"email",
"website",
"id": "pharmacy",
"name": {
"en": "pharmacy"
},
"title": {
"render": {
"en": "{name}"
}
},
"source": {
"osmTags": {
"and": [
"amenity=pharmacy"
]
}
},
"minzoom": 13,
"tagRenderings": [
"images",
"opening_hours",
"phone",
"email",
"website",
{
"id": "wheelchair",
"question": {
"en": "Is this pharmacy easy to access on a wheelchair?"
},
"mappings": [
{
"id": "wheelchair",
"render": {
"en": "Easily accessible for wheelchair users: {wheelchair}"
},
"question": {
"en": "Is this pharmacy easy to access on a wheelchair?"
},
"mappings": [
{
"if": "wheelchair=yes",
"then": {
"en": "This pharmacy is easy to access on a wheelchair"
}
},
{
"if": "wheelchair=no",
"then": {
"en": "This pharmacy is hard to access on a wheelchair"
}
},
{
"if": "wheelchair=limited",
"then": {
"en": "This pharmacy has limited access for wheelchair users"
}
}
]
}
],
"mapRendering": [
"if": "wheelchair=yes",
"then": {
"en": "This pharmacy is easy to access on a wheelchair"
}
},
{
"icon": {
"render": "./assets/layers/pharmacy/pharmacy.svg"
},
"iconSize": "40,40,bottom",
"location": [
"point",
"centroid"
]
"if": "wheelchair=no",
"then": {
"en": "This pharmacy is hard to access on a wheelchair"
}
},
{
"if": "wheelchair=limited",
"then": {
"en": "This pharmacy has limited access for wheelchair users"
}
}
]
]
}
],
"mapRendering": [
{
"icon": {
"render": "./assets/layers/pharmacy/pharmacy.svg"
},
"iconSize": "40,40,bottom",
"location": [
"point",
"centroid"
]
}
]
}