Chore: fix scripts

This commit is contained in:
Pieter Vander Vennet 2024-05-02 15:43:17 +02:00
parent f76e2b4c88
commit 285ec2b256
6 changed files with 155 additions and 128 deletions
assets
layers/charging_station
themes/mapcomplete-changes
langs/layers
scripts
src/assets

View file

@ -5,12 +5,7 @@
"nl": "Oplaadpunten", "nl": "Oplaadpunten",
"de": "Ladestationen" "de": "Ladestationen"
}, },
"description": { "minzoom": 10,
"en": "A charging station",
"nl": "Oplaadpunten",
"ca": "Una estació de càrrega",
"de": "Eine Ladestation"
},
"source": { "source": {
"osmTags": { "osmTags": {
"and": [ "and": [
@ -25,7 +20,6 @@
] ]
} }
}, },
"minzoom": 10,
"title": { "title": {
"render": { "render": {
"en": "Charging station", "en": "Charging station",
@ -71,103 +65,13 @@
} }
] ]
}, },
"pointRendering": [ "description": {
{ "en": "A charging station",
"location": [ "nl": "Oplaadpunten",
"point", "ca": "Una estació de càrrega",
"centroid" "de": "Eine Ladestation"
], },
"marker": [ "#": "no-question-hint-check",
{
"icon": "pin",
"color": "#fff"
},
{
"icon": {
"render": "./assets/themes/charging_stations/plug.svg",
"mappings": [
{
"if": "bicycle=yes",
"then": "./assets/themes/charging_stations/bicycle.svg"
},
{
"if": {
"or": [
"car=yes",
"motorcar=yes"
]
},
"then": "./assets/themes/charging_stations/car.svg"
}
]
}
}
],
"iconBadges": [
{
"if": {
"or": [
"disused:amenity=charging_station",
"operational_status=broken"
]
},
"then": "close:#c22;"
},
{
"if": {
"or": [
"proposed:amenity=charging_station",
"planned:amenity=charging_station"
]
},
"then": "./assets/layers/charging_station/under_construction.svg"
},
{
"if": {
"and": [
"bicycle=yes",
{
"or": [
"motorcar=yes",
"car=yes"
]
}
]
},
"then": "circle:#fff;./assets/themes/charging_stations/car.svg"
}
],
"anchor": "bottom",
"iconSize": "50,50"
}
],
"lineRendering": [],
"presets": [
{
"tags": [
"amenity=charging_station",
"motorcar=no",
"bicycle=yes"
],
"title": {
"en": "charging station for electrical bikes",
"nl": "oplaadpunt voor elektrische fietsen",
"de": "Ladestation für Elektrofahrräder"
}
},
{
"tags": [
"amenity=charging_station",
"motorcar=yes",
"bicycle=no"
],
"title": {
"en": "charging station for cars",
"nl": "oplaadstation voor elektrische auto's",
"de": "Ladestation für Autos"
}
}
],
"tagRenderings": [ "tagRenderings": [
"images", "images",
{ {
@ -2509,6 +2413,103 @@
} }
} }
], ],
"lineRendering": [],
"pointRendering": [
{
"location": [
"point",
"centroid"
],
"marker": [
{
"icon": "pin",
"color": "#fff"
},
{
"icon": {
"render": "./assets/themes/charging_stations/plug.svg",
"mappings": [
{
"if": "bicycle=yes",
"then": "./assets/themes/charging_stations/bicycle.svg"
},
{
"if": {
"or": [
"car=yes",
"motorcar=yes"
]
},
"then": "./assets/themes/charging_stations/car.svg"
}
]
}
}
],
"iconBadges": [
{
"if": {
"or": [
"disused:amenity=charging_station",
"operational_status=broken"
]
},
"then": "close:#c22;"
},
{
"if": {
"or": [
"proposed:amenity=charging_station",
"planned:amenity=charging_station"
]
},
"then": "./assets/layers/charging_station/under_construction.svg"
},
{
"if": {
"and": [
"bicycle=yes",
{
"or": [
"motorcar=yes",
"car=yes"
]
}
]
},
"then": "circle:#fff;./assets/themes/charging_stations/car.svg"
}
],
"anchor": "bottom",
"iconSize": "50,50"
}
],
"presets": [
{
"tags": [
"amenity=charging_station",
"motorcar=no",
"bicycle=yes"
],
"title": {
"en": "charging station for electrical bikes",
"nl": "oplaadpunt voor elektrische fietsen",
"de": "Ladestation für Elektrofahrräder"
}
},
{
"tags": [
"amenity=charging_station",
"motorcar=yes",
"bicycle=no"
],
"title": {
"en": "charging station for cars",
"nl": "oplaadstation voor elektrische auto's",
"de": "Ladestation für Autos"
}
}
],
"filter": [ "filter": [
{ {
"id": "vehicle-type", "id": "vehicle-type",
@ -2714,19 +2715,6 @@
] ]
} }
], ],
"deletion": {
"softDeletionTags": {
"and": [
"amenity=",
"disused:amenity=charging_station"
]
},
"neededChangesets": 10
},
"allowMove": {
"enableRelocation": false,
"enableImproveAccuracy": true
},
"units": [ "units": [
{ {
"maxstay": { "maxstay": {
@ -2885,5 +2873,17 @@
} }
} }
], ],
"#": "no-question-hint-check" "allowMove": {
} "enableRelocation": false,
"enableImproveAccuracy": true
},
"deletion": {
"softDeletionTags": {
"and": [
"amenity=",
"disused:amenity=charging_station"
]
},
"neededChangesets": 10
}
}

View file

@ -3,14 +3,17 @@
"title": { "title": {
"en": "Changes made with MapComplete" "en": "Changes made with MapComplete"
}, },
"description": {
"en": "This maps shows all the changes made with MapComplete"
},
"shortDescription": { "shortDescription": {
"en": "Shows changes made by MapComplete" "en": "Shows changes made by MapComplete"
}, },
"description": {
"en": "This maps shows all the changes made with MapComplete"
},
"icon": "./assets/svg/logo.svg", "icon": "./assets/svg/logo.svg",
"hideFromOverview": true, "hideFromOverview": true,
"startLat": 0,
"startLon": 0,
"startZoom": 1,
"layers": [ "layers": [
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",

View file

@ -1495,6 +1495,11 @@
}, },
"question": "What is the relative location of this bicycle parking?" "question": "What is the relative location of this bicycle parking?"
}, },
"charge": {
"question": "How much does it cost to park your bike here?",
"questionHint": "This is the amount which is charged for a single bike",
"render": "Parking your bike costs {charge}"
},
"fee": { "fee": {
"mappings": { "mappings": {
"0": { "0": {
@ -10665,6 +10670,10 @@
"4": { "4": {
"human": "{quantity} months", "human": "{quantity} months",
"humanSingular": "one month" "humanSingular": "one month"
},
"5": {
"human": "{quantity} years",
"humanSingular": "one year"
} }
} }
} }

View file

@ -1211,6 +1211,11 @@
}, },
"question": "Wat is de relatieve locatie van deze parking??" "question": "Wat is de relatieve locatie van deze parking??"
}, },
"charge": {
"question": "Hoeveel kost het om een fiets te stallen?",
"questionHint": "Dit is de kostprijs voor een enkele fiets",
"render": "Je fiets hier parkeren kost {charge}"
},
"fee": { "fee": {
"mappings": { "mappings": {
"0": { "0": {
@ -8724,6 +8729,10 @@
"4": { "4": {
"human": "{quantity} maanden", "human": "{quantity} maanden",
"humanSingular": "één maand" "humanSingular": "één maand"
},
"5": {
"human": "{quantity} jaar",
"humanSingular": "één jaar"
} }
} }
} }

View file

@ -224,10 +224,12 @@ export default class ScriptUtils {
}) })
const timeoutPromise = new Promise<any>((resolve, reject) => { const timeoutPromise = new Promise<any>((resolve, reject) => {
setTimeout( setTimeout(
() => () => {
timeoutSecs === undefined if(timeoutSecs === undefined){
? reject(new Error("Timout reached")) return // No resolve
: resolve("timeout"), }
resolve("timeout")
},
(timeoutSecs ?? 10) * 1000 (timeoutSecs ?? 10) * 1000
) )
}) })

File diff suppressed because one or more lines are too long