forked from MapComplete/MapComplete
start of layer dropdown
This commit is contained in:
parent
db9ac0eaf0
commit
3dec5bcd06
2 changed files with 25 additions and 31 deletions
40
test.ts
40
test.ts
|
@ -1,32 +1,14 @@
|
|||
import {DropDown} from "./UI/Input/DropDown";
|
||||
import Locale from "./UI/i18n/Locale";
|
||||
import Combine from "./UI/Base/Combine";
|
||||
import Translations from "./UI/i18n/Translations";
|
||||
import {TagRenderingOptions} from "./Customizations/TagRendering";
|
||||
import {UIEventSource} from "./UI/UIEventSource";
|
||||
import {Tag} from "./Logic/TagsFilter";
|
||||
import {Changes} from "./Logic/Changes";
|
||||
import {OsmConnection} from "./Logic/OsmConnection";
|
||||
import Translation from "./UI/i18n/Translation";
|
||||
import { DropDown } from "./UI/Input/DropDown";
|
||||
import { BaseLayers, Basemap } from "./Logic/Basemap";
|
||||
|
||||
console.log("Hello world")
|
||||
Locale.language.setData("en");
|
||||
let languagePicker = new DropDown("", ["en", "nl"].map(lang => {
|
||||
return {value: lang, shown: lang}
|
||||
}
|
||||
), Locale.language).AttachTo("maindiv");
|
||||
let baseLayerOptions = [];
|
||||
|
||||
Object.entries(BaseLayers.baseLayers).forEach(([key, value], i) => {
|
||||
// console.log(key, value, i);
|
||||
baseLayerOptions.push({value: i, shown: key});
|
||||
});
|
||||
|
||||
console.log(Basemap);
|
||||
|
||||
|
||||
let tags = new UIEventSource({
|
||||
x:"y"
|
||||
})
|
||||
|
||||
new TagRenderingOptions({
|
||||
mappings: [{k: new Tag("x","y"), txt: new Translation({en: "ENG", nl: "NED"})}]
|
||||
}).construct({
|
||||
tags: tags,
|
||||
changes: new Changes(
|
||||
"cs",
|
||||
new OsmConnection(true)
|
||||
)
|
||||
}).AttachTo("extradiv")
|
||||
new DropDown(`label`, baseLayerOptions, Basemap.CurrentLayer).AttachTo("maindiv");
|
Loading…
Add table
Add a link
Reference in a new issue