forked from MapComplete/MapComplete
Add cache timeout option on layerSource
This commit is contained in:
parent
1bc7978f7c
commit
c99e15eed9
7 changed files with 67 additions and 51 deletions
|
@ -52,6 +52,10 @@ export default class LayerConfig {
|
|||
public readonly deletion: DeleteConfig | null;
|
||||
public readonly allowMove: MoveConfig | null
|
||||
public readonly allowSplit: boolean
|
||||
/**
|
||||
* In seconds
|
||||
*/
|
||||
public readonly maxAgeOfCache: number
|
||||
|
||||
presets: PresetConfig[];
|
||||
|
||||
|
@ -87,7 +91,9 @@ export default class LayerConfig {
|
|||
// @ts-ignore
|
||||
legacy = TagUtils.Tag(json["overpassTags"], context + ".overpasstags");
|
||||
}
|
||||
|
||||
if (json.source !== undefined) {
|
||||
this.maxAgeOfCache = json.source.maxCacheAge ?? 24 * 60 * 60 * 30
|
||||
if (legacy !== undefined) {
|
||||
throw (
|
||||
context +
|
||||
|
@ -126,7 +132,7 @@ export default class LayerConfig {
|
|||
osmTags: legacy,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.calculatedTags = undefined;
|
||||
if (json.calculatedTags !== undefined) {
|
||||
if (!official) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue