forked from MapComplete/MapComplete
Add robustness when run via console, formatting
This commit is contained in:
parent
83af5adaea
commit
89d4a6bcce
11 changed files with 118 additions and 67 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue