Add cycle_highways theme, add configurable overpass backend as feature switch (settable via theme and URL)

This commit is contained in:
Pieter Vander Vennet 2021-08-23 15:48:42 +02:00
parent f4ea36de9a
commit ef0826ebb6
21 changed files with 377 additions and 48 deletions

View file

@ -2,7 +2,7 @@ import { Utils } from "../Utils";
export default class Constants {
public static vNumber = "0.9.1";
public static vNumber = "0.9.2";
// The user journey states thresholds when a new feature gets unlocked
public static userJourney = {

View file

@ -339,4 +339,12 @@ export interface LayoutConfigJson {
enableDownload?: boolean;
enablePdfDownload?: boolean;
/**
* Set a different overpass URL. Default: https://overpass-api.de/api/interpreter
*/
overpassUrl?: string;
/**
* Set a different timeout for overpass queries - in seconds. Default: 30s
*/
overpassTimeout?: number
}

View file

@ -53,6 +53,9 @@ export default class LayoutConfig {
public readonly cacheTimeout?: number;
public readonly units: Unit[] = []
private readonly _official: boolean;
public readonly overpassUrl: string;
public readonly overpassTimeout: number;
constructor(json: LayoutConfigJson, official = true, context?: string) {
this._official = official;
@ -160,7 +163,8 @@ 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.overpassTimeout = json.overpassTimeout ?? 30
}