forked from MapComplete/MapComplete
Fix personal theme, add possibility to sync layer selection
This commit is contained in:
parent
4f45fed45a
commit
419f2b1351
10 changed files with 68 additions and 36 deletions
|
@ -399,4 +399,13 @@ export interface LayerConfigJson {
|
|||
*/
|
||||
units?: UnitConfigJson[]
|
||||
|
||||
/**
|
||||
* If set, synchronizes wether or not this layer is selected.
|
||||
*
|
||||
* no: Do not sync at all, always revert to default
|
||||
* local: keep selection on local storage
|
||||
* theme-only: sync via OSM, but this layer will only be toggled in this theme
|
||||
* global: all layers with this ID will be synced accross all themes
|
||||
*/
|
||||
syncSelection?: "no" | "local" | "theme-only" | "global"
|
||||
}
|
|
@ -61,6 +61,8 @@ export default class LayerConfig extends WithContextLoader {
|
|||
public readonly filterIsSameAs: string;
|
||||
public readonly forceLoad: boolean;
|
||||
|
||||
public readonly syncSelection: "no" | "local" | "theme-only" | "global"
|
||||
|
||||
constructor(
|
||||
json: LayerConfigJson,
|
||||
context?: string,
|
||||
|
@ -90,7 +92,7 @@ export default class LayerConfig extends WithContextLoader {
|
|||
}
|
||||
|
||||
this.maxAgeOfCache = json.source.maxCacheAge ?? 24 * 60 * 60 * 30
|
||||
|
||||
this.syncSelection = json.syncSelection;
|
||||
const osmTags = TagUtils.Tag(
|
||||
json.source.osmTags,
|
||||
context + "source.osmTags"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue