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
				
			
		|  | @ -60,8 +60,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 | ||||
|     }) | ||||
|      | ||||
|     /** | ||||
|      * | ||||
|  |  | |||
|  | @ -174,26 +174,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. | ||||
|      * | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue