forked from MapComplete/MapComplete
Add precise input method, enabled for public bookcases
This commit is contained in:
parent
42d0071b26
commit
315e2f7fd1
10 changed files with 318 additions and 64 deletions
|
@ -54,6 +54,7 @@ export default class LayerConfig {
|
|||
title: Translation,
|
||||
tags: Tag[],
|
||||
description?: Translation,
|
||||
preciseInput?: {preferredBackground?: string}
|
||||
}[];
|
||||
|
||||
tagRenderings: TagRenderingConfig [];
|
||||
|
@ -130,12 +131,19 @@ export default class LayerConfig {
|
|||
this.minzoom = json.minzoom ?? 0;
|
||||
this.maxzoom = json.maxzoom ?? 1000;
|
||||
this.wayHandling = json.wayHandling ?? 0;
|
||||
this.presets = (json.presets ?? []).map((pr, i) =>
|
||||
({
|
||||
this.presets = (json.presets ?? []).map((pr, i) => {
|
||||
if(pr.preciseInput === true){
|
||||
pr.preciseInput = {
|
||||
preferredBackground: undefined
|
||||
}
|
||||
}
|
||||
return ({
|
||||
title: Translations.T(pr.title, `${context}.presets[${i}].title`),
|
||||
tags: pr.tags.map(t => FromJSON.SimpleTag(t)),
|
||||
description: Translations.T(pr.description, `${context}.presets[${i}].description`)
|
||||
}))
|
||||
description: Translations.T(pr.description, `${context}.presets[${i}].description`),
|
||||
preciseInput: pr.preciseInput
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
/** Given a key, gets the corresponding property from the json (or the default if not found
|
||||
|
|
|
@ -217,6 +217,16 @@ export interface LayerConfigJson {
|
|||
* (The first sentence is until the first '.'-character in the description)
|
||||
*/
|
||||
description?: string | any,
|
||||
|
||||
/**
|
||||
* If set, the user will prompted to confirm the location before actually adding the data.
|
||||
* THis will be with a 'drag crosshair'-method.
|
||||
*
|
||||
* If 'preferredBackgroundCategory' is set, the element will attempt to pick a background layer of that category.
|
||||
*/
|
||||
preciseInput?: true | {
|
||||
preferredBackground: "osmbasedmap" | "photo" | "historicphoto" | "map"
|
||||
}
|
||||
}[],
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue