From bd43e2537f51f360b96ddb237619e4b783893d20 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 7 Aug 2020 00:45:33 +0200 Subject: [PATCH] Various small fixes --- Customizations/Layers/NatureReserves.ts | 1 - Customizations/Layout.ts | 10 ++++++---- Customizations/Layouts/Groen.ts | 2 ++ InitUiElements.ts | 23 +++++++++++++++-------- Logic/FilteredLayer.ts | 3 +-- Logic/Osm/Changes.ts | 2 +- State.ts | 7 +++++-- UI/SimpleAddUI.ts | 2 ++ 8 files changed, 32 insertions(+), 18 deletions(-) diff --git a/Customizations/Layers/NatureReserves.ts b/Customizations/Layers/NatureReserves.ts index 4bcceea..1f3c11e 100644 --- a/Customizations/Layers/NatureReserves.ts +++ b/Customizations/Layers/NatureReserves.ts @@ -114,7 +114,6 @@ export class NatureReserves extends LayerDefinition { let colormapping = { 0: "#00bb00", - 1: "#00ff00", 10: "#dddd00", 20: "#ff0000" }; diff --git a/Customizations/Layout.ts b/Customizations/Layout.ts index 7081688..ebe966b 100644 --- a/Customizations/Layout.ts +++ b/Customizations/Layout.ts @@ -25,19 +25,21 @@ export class Layout { public startLat: number; public locationContains: string[]; - + public enableAdd: boolean = true; public enableUserBadge: boolean = true; public enableSearch: boolean = true; public enableLayers: boolean = true; - - public hideFromOverview : boolean = false; + public enableMoreQuests: boolean = true; + public enableShareScreen: boolean = true; + + public hideFromOverview: boolean = false; /** * The BBOX of the currently visible map are widened by this factor, in order to make some panning possible. * This number influences this */ - public widenFactor : number = 0.07; + public widenFactor: number = 0.07; /** * diff --git a/Customizations/Layouts/Groen.ts b/Customizations/Layouts/Groen.ts index 3ca7fe0..986cfcc 100644 --- a/Customizations/Layouts/Groen.ts +++ b/Customizations/Layouts/Groen.ts @@ -56,5 +56,7 @@ export class Groen extends Layout { this.locationContains = ["buurtnatuur.be"] this.socialImage = "assets/BuurtnatuurFront.jpg" this.description = "Met deze tool kan je natuur in je buurt in kaart brengen en meer informatie geven over je favoriete plekje" + this.enableMoreQuests = false; + this.enableShareScreen = false } } \ No newline at end of file diff --git a/InitUiElements.ts b/InitUiElements.ts index e4072e9..9232afe 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -53,13 +53,22 @@ export class InitUiElements { welcome = new CustomLayersPanel(); } - - const fullOptions = new TabbedComponent([ + const tabs = [ {header: ``, content: welcome}, {header: ``, content: Translations.t.general.openStreetMapIntro}, - {header: ``, content: new ShareScreen()}, - {header: ``, content: new MoreScreen()}, - ]) + + ] + + if (State.state.featureSwitchShareScreen.data) { + tabs.push({header: ``, content: new ShareScreen()}); + } + + if (State.state.featureSwitchMoreQuests.data) { + tabs.push({header: ``, content: new MoreScreen()}); + } + + + const fullOptions = new TabbedComponent(tabs); return fullOptions; @@ -129,9 +138,7 @@ export class InitUiElements { static InitBaseMap(){ State.state.bm = new Basemap("leafletDiv", State.state.locationControl, new VariableUiElement( State.state.locationControl.map((location) => { - const mapComplete = "Mapcomple " + - " " + - "Report bug"; + const mapComplete = `Mapcomple ${State.vNumber} Report bug`; let editHere = ""; if (location !== undefined) { editHere = " | " + diff --git a/Logic/FilteredLayer.ts b/Logic/FilteredLayer.ts index e753269..919580d 100644 --- a/Logic/FilteredLayer.ts +++ b/Logic/FilteredLayer.ts @@ -236,9 +236,8 @@ export class FilteredLayer { const style = self._style(feature.properties); if (State.state.selectedElement.data?.feature === feature) { if (style.weight !== undefined) { - style.weight = style.weight * 2; + style.weight = style.weight * 1.8; }else{ - style.weight = 20; } } return style; diff --git a/Logic/Osm/Changes.ts b/Logic/Osm/Changes.ts index 35cde82..c967e20 100644 --- a/Logic/Osm/Changes.ts +++ b/Logic/Osm/Changes.ts @@ -241,7 +241,7 @@ export class Changes { } - let changes = ""; + let changes = ``; if (creations.length > 0) { changes += diff --git a/State.ts b/State.ts index 8a8a104..539305c 100644 --- a/State.ts +++ b/State.ts @@ -24,7 +24,7 @@ export class State { // The singleton of the global state public static state: State; - public static vNumber = "0.0.1"; + public static vNumber = "0.0.2"; public static runningFromConsole: boolean = false; @@ -91,6 +91,8 @@ export class State { public readonly featureSwitchAddNew: UIEventSource; public readonly featureSwitchWelcomeMessage: UIEventSource; public readonly featureSwitchIframe: UIEventSource; + public readonly featureSwitchMoreQuests: UIEventSource; + public readonly featureSwitchShareScreen: UIEventSource; /** @@ -148,7 +150,8 @@ export class State { this.featureSwitchAddNew = featSw("fs-add-new", (layoutToUse) => layoutToUse?.enableAdd); this.featureSwitchWelcomeMessage = featSw("fs-welcome-message", () => true); this.featureSwitchIframe = featSw("fs-iframe", () => false); - + this.featureSwitchMoreQuests = featSw("fs-more-quests", () => layoutToUse?.enableMoreQuests); + this.featureSwitchShareScreen = featSw("fs-share-screen", () => layoutToUse?.enableShareScreen); this.osmConnection = new OsmConnection( QueryParameters.GetQueryParameter("test", "false").data === "true", diff --git a/UI/SimpleAddUI.ts b/UI/SimpleAddUI.ts index 4c36531..036f004 100644 --- a/UI/SimpleAddUI.ts +++ b/UI/SimpleAddUI.ts @@ -68,7 +68,9 @@ export class SimpleAddUI extends UIElement { () => { self.confirmButton = new SubtleButton(preset.icon, new Combine([ + "", Translations.t.general.add.confirmButton.Subs({category: preset.title}), + "
", preset.description !== undefined ? preset.description : ""])); self.confirmButton.onClick(self.CreatePoint(preset.tags, layer)); self._confirmPreset.setData({