Add robustness when run via console, formatting

This commit is contained in:
Pieter Vander Vennet 2021-10-20 00:09:40 +02:00
parent 83af5adaea
commit 89d4a6bcce
11 changed files with 118 additions and 67 deletions

View file

@ -2,6 +2,7 @@ import {UIEventSource} from "../UIEventSource";
import BaseLayer from "../../Models/BaseLayer";
import AvailableBaseLayers from "./AvailableBaseLayers";
import Loc from "../../Models/Loc";
import {Utils} from "../../Utils";
/**
* Sets the current background layer to a layer that is actually available
@ -12,6 +13,11 @@ export default class BackgroundLayerResetter {
location: UIEventSource<Loc>,
availableLayers: UIEventSource<BaseLayer[]>,
defaultLayerId: string = undefined) {
if(Utils.runningFromConsole){
return
}
defaultLayerId = defaultLayerId ?? AvailableBaseLayers.osmCarto.id;
// Change the baselayer back to OSM if we go out of the current range of the layer