Do not show quickswitch if background map switching is disabled
This commit is contained in:
parent
e21f7f4dee
commit
2bead588fb
4 changed files with 12 additions and 5 deletions
|
@ -16,7 +16,7 @@ export default class FeatureSwitchState {
|
||||||
|
|
||||||
public readonly featureSwitchUserbadge: UIEventSource<boolean>;
|
public readonly featureSwitchUserbadge: UIEventSource<boolean>;
|
||||||
public readonly featureSwitchSearch: UIEventSource<boolean>;
|
public readonly featureSwitchSearch: UIEventSource<boolean>;
|
||||||
public readonly featureSwitchBackgroundSlection: UIEventSource<boolean>;
|
public readonly featureSwitchBackgroundSelection: UIEventSource<boolean>;
|
||||||
public readonly featureSwitchAddNew: UIEventSource<boolean>;
|
public readonly featureSwitchAddNew: UIEventSource<boolean>;
|
||||||
public readonly featureSwitchWelcomeMessage: UIEventSource<boolean>;
|
public readonly featureSwitchWelcomeMessage: UIEventSource<boolean>;
|
||||||
public readonly featureSwitchIframePopoutEnabled: UIEventSource<boolean>;
|
public readonly featureSwitchIframePopoutEnabled: UIEventSource<boolean>;
|
||||||
|
@ -72,7 +72,7 @@ export default class FeatureSwitchState {
|
||||||
(layoutToUse) => layoutToUse?.enableSearch ?? true,
|
(layoutToUse) => layoutToUse?.enableSearch ?? true,
|
||||||
"Disables/Enables the search bar"
|
"Disables/Enables the search bar"
|
||||||
);
|
);
|
||||||
this.featureSwitchBackgroundSlection = featSw(
|
this.featureSwitchBackgroundSelection = featSw(
|
||||||
"fs-background",
|
"fs-background",
|
||||||
(layoutToUse) => layoutToUse?.enableBackgroundLayerSelection ?? true,
|
(layoutToUse) => layoutToUse?.enableBackgroundLayerSelection ?? true,
|
||||||
"Disables/Enables the background layer control"
|
"Disables/Enables the background layer control"
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default class FilterView extends VariableUiElement {
|
||||||
const backgroundSelector = new Toggle(
|
const backgroundSelector = new Toggle(
|
||||||
new BackgroundSelector(),
|
new BackgroundSelector(),
|
||||||
undefined,
|
undefined,
|
||||||
State.state.featureSwitchBackgroundSlection
|
State.state.featureSwitchBackgroundSelection
|
||||||
)
|
)
|
||||||
super(
|
super(
|
||||||
filteredLayer.map((filteredLayers) => {
|
filteredLayer.map((filteredLayers) => {
|
||||||
|
|
|
@ -19,6 +19,7 @@ import BackgroundMapSwitch from "./BackgroundMapSwitch";
|
||||||
export default class LeftControls extends Combine {
|
export default class LeftControls extends Combine {
|
||||||
|
|
||||||
constructor(state: {
|
constructor(state: {
|
||||||
|
featureSwitchBackgroundSelection: UIEventSource<boolean>;
|
||||||
layoutToUse: LayoutConfig,
|
layoutToUse: LayoutConfig,
|
||||||
featurePipeline: FeaturePipeline,
|
featurePipeline: FeaturePipeline,
|
||||||
currentBounds: UIEventSource<BBox>,
|
currentBounds: UIEventSource<BBox>,
|
||||||
|
@ -74,10 +75,16 @@ export default class LeftControls extends Combine {
|
||||||
undefined,
|
undefined,
|
||||||
state.featureSwitchFilter
|
state.featureSwitchFilter
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const mapSwitch = new Toggle(
|
||||||
|
new BackgroundMapSwitch(state, state.backgroundLayer),
|
||||||
|
undefined,
|
||||||
|
state.featureSwitchBackgroundSelection
|
||||||
|
)
|
||||||
|
|
||||||
super([filterButton,
|
super([filterButton,
|
||||||
downloadButtonn,
|
downloadButtonn,
|
||||||
new BackgroundMapSwitch(state, state.backgroundLayer)
|
mapSwitch
|
||||||
])
|
])
|
||||||
|
|
||||||
this.SetClass("flex flex-col")
|
this.SetClass("flex flex-col")
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class DefaultGuiState {
|
||||||
this.welcomeMessageOpenedTab = UIEventSource.asFloat(QueryParameters.GetQueryParameter(
|
this.welcomeMessageOpenedTab = UIEventSource.asFloat(QueryParameters.GetQueryParameter(
|
||||||
"tab",
|
"tab",
|
||||||
"0",
|
"0",
|
||||||
`The tab that is shown in the welcome-message. 0 = the explanation of the theme,1 = OSM-credits, 2 = sharescreen, 3 = more themes, 4 = about mapcomplete (user must be logged in and have >${Constants.userJourney.mapCompleteHelpUnlock} changesets)`
|
`The tab that is shown in the welcome-message.`
|
||||||
));
|
));
|
||||||
this.welcomeMessageIsOpened = QueryParameters.GetBooleanQueryParameter(
|
this.welcomeMessageIsOpened = QueryParameters.GetBooleanQueryParameter(
|
||||||
"welcome-control-toggle",
|
"welcome-control-toggle",
|
||||||
|
|
Loading…
Reference in a new issue