Fix: layers now compile again

This commit is contained in:
Pieter Vander Vennet 2023-05-30 03:22:21 +02:00
parent 8f942f0163
commit 1c99173f32
5 changed files with 17 additions and 8 deletions

View file

@ -99,8 +99,8 @@ ${Utils.special_visualizations_importRequirementDocs}
* Others (e.g.: snapOnto-layers) are not to be handled here
* @param argsRaw
*/
public static getLayerDependencies(argsRaw: string[]) {
const args: ImportFlowArguments = <any>Utils.ParseVisArgs(ImportFlowUtils.generalArguments, argsRaw)
public static getLayerDependencies(argsRaw: string[], argSpec?) {
const args: ImportFlowArguments = <any>Utils.ParseVisArgs(argSpec ?? ImportFlowUtils.generalArguments, argsRaw)
return [args.targetLayer]
}
@ -108,7 +108,7 @@ ${Utils.special_visualizations_importRequirementDocs}
name: string,
defaultValue?: string
}[], argsRaw: string[]): string[] {
const deps = ImportFlowUtils.getLayerDependencies(argsRaw)
const deps = ImportFlowUtils.getLayerDependencies(argsRaw, argSpec)
const argsParsed: PointImportFlowArguments = <any>Utils.ParseVisArgs(argSpec, argsRaw)
const snapOntoLayers = argsParsed.snap_onto_layers?.split(";")?.map(l => l.trim()) ?? []
deps.push(...snapOntoLayers)

View file

@ -232,7 +232,18 @@
"tagRenderings": [
{
"id": "Import button",
"render": "{import_way_button(osm:buildings, building=$_bag_obj:building; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date; start_date=$_bag_obj:start_date, Upload this building to OpenStreetMap)}",
"render": {
"special": {
"type": "import_way_button",
"targetLayer": "osm:buildings",
"tags": "building=$_bag_obj:building; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date; start_date=$_bag_obj:start_date",
"text": {
"*": "Upload this building to OpenStreetMap"
}
}
},
"mappings": [
{
"#": "Something went wrong calculating the tags - don't show an import button",

View file

@ -446,7 +446,6 @@
"es": "Importar"
},
"icon": "./assets/svg/addSmall.svg",
"location_picker": "photo",
"maproulette_id": "mr_taskId"
}
}

View file

@ -61,7 +61,7 @@
"tagRenderings+": [
{
"id": "import",
"render": "{import_button(street_lamps,tags,Import,./assets/svg/addSmall.svg,,,,photo,mr_taskId)}"
"render": "{import_button(street_lamps,tags,Import,./assets/svg/addSmall.svg,,,,mr_taskId)}"
}
]
}

View file

@ -128,8 +128,7 @@
"targetLayer": "address",
"tags": "urpn_count=$urpn_count;ref:GB:uprn=$ref:GB:uprn$",
"text": "Add this address",
"icon": "./assets/themes/uk_addresses/housenumber_add.svg",
"location_picker": "none"
"icon": "./assets/themes/uk_addresses/housenumber_add.svg"
}
}
}