Unbreak unofficial themes: laxer widenfactor handling

This commit is contained in:
pietervdvn 2021-10-08 12:09:53 +02:00
parent 0d85b5bacf
commit e3e919b16f
2 changed files with 11 additions and 2 deletions

View file

@ -2,7 +2,7 @@ import {Utils} from "../Utils";
export default class Constants {
public static vNumber = "0.10.2";
public static vNumber = "0.10.3";
public static ImgurApiKey = '7070e7167f0a25a'
public static readonly mapillary_client_token_v3 = 'TXhLaWthQ1d4RUg0czVxaTVoRjFJZzowNDczNjUzNmIyNTQyYzI2'
public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85"

View file

@ -88,7 +88,16 @@ export default class LayoutConfig {
this.startLat = json.startLat;
this.startLon = json.startLon;
if(json.widenFactor < 1){
throw "Widenfactor too small"
if(official){
throw "Widenfactor too small"
}else{
// Unofficial themes get away with this
console.warn("Detected a very small widenfactor, bumping this above 1.")
json.widenFactor = json.widenFactor + 1
}
}
if(json.widenFactor > 20){
throw "Widenfactor is very big, use a value between 1 and 5 (current value is "+json.widenFactor+") at "+context
}
this.widenFactor = json.widenFactor ?? 1.5;
this.roamingRenderings = (json.roamingRenderings ?? []).map((tr, i) => {