forked from MapComplete/MapComplete
Scripts: reorder titles
This commit is contained in:
parent
6383311dc2
commit
03ae26103c
4 changed files with 30 additions and 25 deletions
|
@ -1107,7 +1107,6 @@ export class OrderTagRendering extends DesugaringStep<TagRenderingConfigJson | s
|
|||
if (typeof json !== "object") {
|
||||
return json
|
||||
}
|
||||
console.log("Ordering", json.id, OrderTagRendering.tagRenderingAttributesOrder)
|
||||
return Utils.reorder(json, OrderTagRendering.tagRenderingAttributesOrder)
|
||||
}
|
||||
|
||||
|
@ -1129,10 +1128,16 @@ export class OrderLayer extends DesugaringStep<string | LayerConfigJson> {
|
|||
if (typeof json === "string") {
|
||||
return json
|
||||
}
|
||||
const orderTag = new OrderTagRendering()
|
||||
// @ts-ignore
|
||||
json = new On<"tagRenderings", TagRenderingConfigJson[], LayerConfigJson>("tagRenderings", new Each(
|
||||
new OrderTagRendering(),
|
||||
orderTag,
|
||||
)).convert(<LayerConfigJson>json, context)
|
||||
|
||||
// @ts-ignore
|
||||
json = new On("title", orderTag).convert(json, context)
|
||||
|
||||
|
||||
return Utils.reorder(json, OrderLayer.layerAttributesOrder)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue