forked from MapComplete/MapComplete
Merge branch 'develop' into feature/studio
This commit is contained in:
commit
c229b92221
133 changed files with 1056 additions and 2081 deletions
|
@ -198,7 +198,8 @@ export default class CreateNoteImportLayer extends Conversion<LayerConfigJson, L
|
|||
},
|
||||
],
|
||||
},
|
||||
iconSize: "40,40,center",
|
||||
iconSize: "40,40",
|
||||
anchor: "center",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import { Utils } from "../../../Utils"
|
|||
import LineRenderingConfigJson from "../Json/LineRenderingConfigJson"
|
||||
import { LayerConfigJson } from "../Json/LayerConfigJson"
|
||||
import { DesugaringStep, Each, Fuse, On } from "./Conversion"
|
||||
import PointRenderingConfigJson from "../Json/PointRenderingConfigJson"
|
||||
|
||||
export class UpdateLegacyLayer extends DesugaringStep<
|
||||
LayerConfigJson | string | { builtin; override }
|
||||
|
@ -139,6 +140,35 @@ export class UpdateLegacyLayer extends DesugaringStep<
|
|||
}
|
||||
}
|
||||
|
||||
for (const rendering of config.mapRendering ?? []) {
|
||||
if (!rendering["iconSize"]) {
|
||||
continue
|
||||
}
|
||||
const pr = <PointRenderingConfigJson>rendering
|
||||
const iconSize = pr.iconSize
|
||||
if (typeof iconSize === "string")
|
||||
if (["bottom", "center", "top"].some((a) => (<string>iconSize).endsWith(a))) {
|
||||
const parts = iconSize.split(",").map((parts) => parts.toLowerCase().trim())
|
||||
pr.anchor = parts.pop()
|
||||
pr.iconSize = parts.join(",")
|
||||
}
|
||||
}
|
||||
|
||||
for (const rendering of config.mapRendering) {
|
||||
for (const key in rendering) {
|
||||
if (!rendering[key]) {
|
||||
continue
|
||||
}
|
||||
if (
|
||||
typeof rendering[key]["render"] === "string" &&
|
||||
Object.keys(rendering[key]).length === 1
|
||||
) {
|
||||
console.log("Rewrite: ", rendering[key])
|
||||
rendering[key] = rendering[key]["render"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
result: config,
|
||||
errors: [],
|
||||
|
|
|
@ -586,6 +586,7 @@ class WarnForUnsubstitutedLayersInTheme extends DesugaringStep<LayoutConfigJson>
|
|||
}
|
||||
|
||||
export class PrepareTheme extends Fuse<LayoutConfigJson> {
|
||||
private state: DesugaringContext
|
||||
constructor(
|
||||
state: DesugaringContext,
|
||||
options?: {
|
||||
|
@ -612,6 +613,7 @@ export class PrepareTheme extends Fuse<LayoutConfigJson> {
|
|||
new AddDependencyLayersToTheme(state),
|
||||
new AddImportLayers()
|
||||
)
|
||||
this.state = state
|
||||
}
|
||||
|
||||
convert(
|
||||
|
@ -619,6 +621,10 @@ export class PrepareTheme extends Fuse<LayoutConfigJson> {
|
|||
context: string
|
||||
): { result: LayoutConfigJson; errors: string[]; warnings: string[]; information: string[] } {
|
||||
const result = super.convert(json, context)
|
||||
if (this.state.publicLayers.size === 0) {
|
||||
// THis is a bootstrapping run, no need to already set this flag
|
||||
return result
|
||||
}
|
||||
|
||||
const needsNodeDatabase = result.result.layers?.some((l: LayerConfigJson) =>
|
||||
l.tagRenderings?.some((tr: TagRenderingConfigJson) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue