More refactoring to fix the tests

This commit is contained in:
Pieter Vander Vennet 2021-10-15 14:52:11 +02:00
parent 71285d34cd
commit b8abbc9505
16 changed files with 507 additions and 418 deletions

View file

@ -18,6 +18,7 @@ import {Unit} from "../../Models/Unit";
import {FixedInputElement} from "./FixedInputElement";
import WikidataSearchBox from "../Wikipedia/WikidataSearchBox";
import Wikidata from "../../Logic/Web/Wikidata";
import AvailableBaseLayers from "../../Logic/Actors/AvailableBaseLayers";
interface TextFieldDef {
name: string,
@ -35,8 +36,6 @@ interface TextFieldDef {
export default class ValidatedTextField {
public static bestLayerAt: (location: UIEventSource<Loc>, preferences: UIEventSource<string[]>) => any
public static tpList: TextFieldDef[] = [
ValidatedTextField.tp(
"string",
@ -93,7 +92,7 @@ export default class ValidatedTextField {
})
if (args[1]) {
// We have a prefered map!
options.mapBackgroundLayer = ValidatedTextField.bestLayerAt(
options.mapBackgroundLayer = AvailableBaseLayers.SelectBestLayerAccordingTo(
location, new UIEventSource<string[]>(args[1].split(","))
)
}
@ -137,7 +136,7 @@ export default class ValidatedTextField {
})
if (args[1]) {
// We have a prefered map!
options.mapBackgroundLayer = ValidatedTextField.bestLayerAt(
options.mapBackgroundLayer = AvailableBaseLayers.SelectBestLayerAccordingTo(
location, new UIEventSource<string[]>(args[1].split(","))
)
}