Add mssing assets

This commit is contained in:
Pieter Vander Vennet 2021-09-29 16:55:05 +02:00
parent c2d477c97a
commit 09897b47e0
11 changed files with 104 additions and 89 deletions

View file

@ -1,6 +0,0 @@
export default interface Bounds {
north: number,
east: number,
south: number,
west: number
}

View file

@ -4,6 +4,16 @@ export default class Constants {
public static vNumber = "0.10.0-alpha-4";
public static ImgurApiKey = '7070e7167f0a25a'
public static defaultOverpassUrls = [
// The official instance, 10000 queries per day per project allowed
"https://overpass-api.de/api/interpreter",
// 'Fair usage'
"https://overpass.kumi.systems/api/interpreter",
// "https://overpass.nchc.org.tw/api/interpreter",
"https://overpass.openstreetmap.ru/cgi/interpreter",
// The french api, only 1000 per day per project allowed, so we put it as last resort
"https://overpass.openstreetmap.fr/api/interpreter"
]
// The user journey states thresholds when a new feature gets unlocked
public static userJourney = {

View file

@ -263,9 +263,9 @@ export interface LayoutConfigJson {
enablePdfDownload?: boolean;
/**
* Set a different overpass URL. Default: https://overpass-api.de/api/interpreter
* Set one or more overpass URLs to use for this theme..
*/
overpassUrl?: string;
overpassUrl?: string | string[];
/**
* Set a different timeout for overpass queries - in seconds. Default: 30s
*/

View file

@ -6,6 +6,7 @@ import AllKnownLayers from "../../Customizations/AllKnownLayers";
import {Utils} from "../../Utils";
import LayerConfig from "./LayerConfig";
import {LayerConfigJson} from "./Json/LayerConfigJson";
import Constants from "../Constants";
export default class LayoutConfig {
public readonly id: string;
@ -50,7 +51,7 @@ export default class LayoutConfig {
How long is the cache valid, in seconds?
*/
public readonly cacheTimeout?: number;
public readonly overpassUrl: string;
public readonly overpassUrl: string[];
public readonly overpassTimeout: number;
public readonly official: boolean;
@ -157,7 +158,14 @@ export default class LayoutConfig {
this.enablePdfDownload = json.enablePdfDownload ?? false;
this.customCss = json.customCss;
this.cacheTimeout = json.cacheTimout ?? (60 * 24 * 60 * 60)
this.overpassUrl = json.overpassUrl ?? "https://overpass-api.de/api/interpreter"
this.overpassUrl = Constants.defaultOverpassUrls
if(json.overpassUrl !== undefined){
if(typeof json.overpassUrl === "string"){
this.overpassUrl = [json.overpassUrl]
}else{
this.overpassUrl = json.overpassUrl
}
}
this.overpassTimeout = json.overpassTimeout ?? 30
}