Merge develop
This commit is contained in:
commit
07bc5d6a6d
88 changed files with 3284 additions and 2363 deletions
|
@ -62,8 +62,13 @@ export interface LayerConfigJson {
|
|||
* NOTE: the previous format was 'overpassTags: AndOrTagConfigJson | string', which is interpreted as a shorthand for source: {osmTags: "key=value"}
|
||||
* While still supported, this is considered deprecated
|
||||
*/
|
||||
source: { osmTags: AndOrTagConfigJson | string, overpassScript?: string } |
|
||||
{ osmTags: AndOrTagConfigJson | string, geoJson: string, geoJsonZoomLevel?: number, isOsmCache?: boolean }
|
||||
source: ({ osmTags: AndOrTagConfigJson | string, overpassScript?: string } |
|
||||
{ osmTags: AndOrTagConfigJson | string, geoJson: string, geoJsonZoomLevel?: number, isOsmCache?: boolean }) & ({
|
||||
/**
|
||||
* The maximum amount of seconds that a tile is allowed to linger in the cache
|
||||
*/
|
||||
maxCacheAge?: number
|
||||
})
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -162,26 +162,6 @@ export interface LayoutConfigJson {
|
|||
*/
|
||||
tileLayerSources?: TilesourceConfigJson[]
|
||||
|
||||
/**
|
||||
* The number of seconds that a feature is allowed to stay in the cache.
|
||||
* The caching flow is as following:
|
||||
*
|
||||
* 1. The application is opened the first time
|
||||
* 2. An overpass query is run
|
||||
* 3. The result is saved to local storage
|
||||
*
|
||||
* On the next opening:
|
||||
*
|
||||
* 1. The application is opened
|
||||
* 2. Data is loaded from cache and displayed
|
||||
* 3. An overpass query is run
|
||||
* 4. All data (both from overpass ánd local storage) are saved again to local storage (except when to old)
|
||||
*
|
||||
* Default value: 60 days
|
||||
*/
|
||||
cacheTimout?: number;
|
||||
|
||||
|
||||
/**
|
||||
* The layers to display.
|
||||
*
|
||||
|
|
|
@ -40,6 +40,10 @@ export default class LayerConfig extends WithContextLoader {
|
|||
public readonly deletion: DeleteConfig | null;
|
||||
public readonly allowMove: MoveConfig | null
|
||||
public readonly allowSplit: boolean
|
||||
/**
|
||||
* In seconds
|
||||
*/
|
||||
public readonly maxAgeOfCache: number
|
||||
|
||||
presets: PresetConfig[];
|
||||
|
||||
|
@ -59,7 +63,9 @@ export default class LayerConfig extends WithContextLoader {
|
|||
// @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 +
|
||||
|
@ -102,7 +108,6 @@ export default class LayerConfig extends WithContextLoader {
|
|||
}
|
||||
|
||||
|
||||
this.id = json.id;
|
||||
this.allowSplit = json.allowSplit ?? false;
|
||||
this.name = Translations.T(json.name, context + ".name");
|
||||
this.units = (json.units ?? []).map(((unitJson, i) => Unit.fromJson(unitJson, `${context}.unit[${i}]`)))
|
||||
|
|
|
@ -48,10 +48,7 @@ export default class LayoutConfig {
|
|||
public readonly enableIframePopout: boolean;
|
||||
|
||||
public readonly customCss?: string;
|
||||
/*
|
||||
How long is the cache valid, in seconds?
|
||||
*/
|
||||
public readonly cacheTimeout?: number;
|
||||
|
||||
public readonly overpassUrl: string[];
|
||||
public readonly overpassTimeout: number;
|
||||
public readonly overpassMaxZoom: number
|
||||
|
@ -136,7 +133,6 @@ export default class LayoutConfig {
|
|||
this.enablePdfDownload = json.enablePdfDownload ?? false;
|
||||
this.enableIframePopout = json.enableIframePopout ?? true
|
||||
this.customCss = json.customCss;
|
||||
this.cacheTimeout = json.cacheTimout ?? (60 * 24 * 60 * 60)
|
||||
this.overpassUrl = Constants.defaultOverpassUrls
|
||||
if(json.overpassUrl !== undefined){
|
||||
if(typeof json.overpassUrl === "string"){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue