Refactoring: move 'snapToLayer' from 'preciseInput' into the preset, remove 'preferredBackground'. The addNewPointFlow _always_ shows the precise input flow with the basic map; so the preferredBackground became irrelevant

This commit is contained in:
Pieter Vander Vennet 2023-06-20 01:52:15 +02:00
parent ecf5c3cbe5
commit a6f7b1300a
127 changed files with 209 additions and 345 deletions

View file

@ -34,6 +34,25 @@ export class UpdateLegacyLayer extends DesugaringStep<
delete config["overpassTags"]
}
for (const preset of config.presets ?? []) {
const preciseInput = preset["preciseInput"]
if (typeof preciseInput === "boolean") {
delete preset["preciseInput"]
} else if (preciseInput !== undefined) {
delete preciseInput["preferredBackground"]
console.log("Precise input:", preciseInput)
preset.snapToLayer = preciseInput.snapToLayer
delete preciseInput.snapToLayer
if (preciseInput.maxSnapDistance) {
preset.maxSnapDistance = preciseInput.maxSnapDistance
delete preciseInput.maxSnapDistance
}
if (Object.keys(preciseInput).length == 0) {
delete preset["preciseInput"]
}
}
}
if (config.tagRenderings !== undefined) {
let i = 0
for (const tagRendering of config.tagRenderings) {