diff --git a/index.ts b/index.ts
index afaaf4e..b971e53 100644
--- a/index.ts
+++ b/index.ts
@@ -3,7 +3,7 @@ import {Changes} from "./Logic/Changes";
import {ElementStorage} from "./Logic/ElementStorage";
import {UIEventSource} from "./UI/UIEventSource";
import {UserBadge} from "./UI/UserBadge";
-import {Basemap} from "./Logic/Basemap";
+import {Basemap, BaseLayers} from "./Logic/Basemap";
import {PendingChanges} from "./UI/PendingChanges";
import {CenterMessageBox} from "./UI/CenterMessageBox";
import {Helpers} from "./Helpers";
@@ -12,7 +12,6 @@ import {FilteredLayer} from "./Logic/FilteredLayer";
import {LayerUpdater} from "./Logic/LayerUpdater";
import {UIElement} from "./UI/UIElement";
import {FullScreenMessageBoxHandler} from "./UI/FullScreenMessageBoxHandler";
-import {Overpass} from "./Logic/Overpass";
import {FeatureInfoBox} from "./UI/FeatureInfoBox";
import {GeoLocationHandler} from "./Logic/GeoLocationHandler";
import {StrayClickHandler} from "./Logic/StrayClickHandler";
@@ -21,15 +20,15 @@ import {VariableUiElement} from "./UI/Base/VariableUIElement";
import {SearchAndGo} from "./UI/SearchAndGo";
import {CollapseButton} from "./UI/Base/CollapseButton";
import {AllKnownLayouts} from "./Customizations/AllKnownLayouts";
-import {All} from "./Customizations/Layouts/All";
+import {CheckBox} from "./UI/Base/CheckBox";
import Translations from "./UI/i18n/Translations";
-import Translation from "./UI/i18n/Translation";
import Locale from "./UI/i18n/Locale";
import {Layout, WelcomeMessage} from "./Customizations/Layout";
import {DropDown} from "./UI/Input/DropDown";
-import {FixedInputElement} from "./UI/Input/FixedInputElement";
import {FixedUiElement} from "./UI/Base/FixedUiElement";
-import ParkingType from "./Customizations/Questions/bike/ParkingType";
+import {LayerSelection} from "./UI/LayerSelection";
+import Combine from "./UI/Base/Combine";
+import {Img} from "./UI/Img";
// --------------------- Read the URL parameters -----------------
@@ -56,7 +55,7 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
// ----------------- SELECT THE RIGHT QUESTSET -----------------
-let defaultLayout = "buurtnatuur"
+let defaultLayout = "walkbybrussels"
// Run over all questsets. If a part of the URL matches a searched-for part in the layout, it'll take that as the default
@@ -204,11 +203,38 @@ for (const layer of layoutToUse.layers) {
}
addButtons.push(addButton);
flayers.push(flayer);
+
+ console.log(flayers);
+
}
const layerUpdater = new LayerUpdater(bm, minZoom, flayers);
+// --------------- Setting up filter ui --------
+
+// buttons
+
+const closedFilterButton = ``;
+
+const openFilterButton = `
+`;
+
+// basemap dropdown
+
+let baseLayerOptions = [];
+
+for (const key in BaseLayers.baseLayers) {
+ baseLayerOptions.push({value: {name: key, layer: BaseLayers.baseLayers[key]}, shown: key});
+}
+
+if (flayers.length > 1) {
+ new CheckBox(new Combine([`
Maplayers
`, new LayerSelection(flayers), new DropDown(`Background map`, baseLayerOptions, bm.CurrentLayer), openFilterButton]), closedFilterButton).AttachTo("filter__selection");
+} else {
+ new CheckBox(new Combine([new DropDown(`Background map`, baseLayerOptions, bm.CurrentLayer), openFilterButton]), closedFilterButton).AttachTo("filter__selection");
+}
+
+
// ------------------ Setup various UI elements ------------
let languagePicker = new DropDown(" ", layoutToUse.supportedLanguages.map(lang => {
@@ -304,3 +330,6 @@ new GeoLocationHandler(bm).AttachTo("geolocate-button");
// --------------- Send a ping to start various action --------
locationControl.ping();
+
+
+
diff --git a/test.ts b/test.ts
index 51ad56b..15d721f 100644
--- a/test.ts
+++ b/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")
\ No newline at end of file
+new DropDown(`label`, baseLayerOptions, Basemap.CurrentLayer).AttachTo("maindiv");
\ No newline at end of file