Fix: remove unneeded URL parameter

This commit is contained in:
Pieter Vander Vennet 2023-07-16 02:08:43 +02:00
parent 7b6b375ff9
commit 365d573b7c
4 changed files with 52 additions and 46 deletions

View file

@ -72,6 +72,10 @@ export default class FilteredLayer {
return JSON.stringify(values)
}
public static queryParameterKey(layer: LayerConfig) {
return "layer-" + layer.id
}
/**
* Creates a FilteredLayer which is tied into the QueryParameters and/or user preferences
*/
@ -100,7 +104,7 @@ export default class FilteredLayer {
)
} else {
isDisplayed = QueryParameters.GetBooleanQueryParameter(
"layer-" + layer.id,
FilteredLayer.queryParameterKey(layer),
layer.shownByDefault,
"Whether or not layer " + layer.id + " is shown"
)

View file

@ -2,11 +2,7 @@ import LayoutConfig from "./ThemeConfig/LayoutConfig"
import {SpecialVisualizationState} from "../UI/SpecialVisualization"
import {Changes} from "../Logic/Osm/Changes"
import {ImmutableStore, Store, UIEventSource} from "../Logic/UIEventSource"
import {
FeatureSource,
IndexedFeatureSource,
WritableFeatureSource,
} from "../Logic/FeatureSource/FeatureSource"
import {FeatureSource, IndexedFeatureSource, WritableFeatureSource,} from "../Logic/FeatureSource/FeatureSource"
import {OsmConnection} from "../Logic/Osm/OsmConnection"
import {ExportableMap, MapProperties} from "./MapProperties"
import LayerState from "../Logic/State/LayerState"
@ -50,9 +46,8 @@ import BackgroundLayerResetter from "../Logic/Actors/BackgroundLayerResetter"
import SaveFeatureSourceToLocalStorage from "../Logic/FeatureSource/Actors/SaveFeatureSourceToLocalStorage"
import BBoxFeatureSource from "../Logic/FeatureSource/Sources/TouchesBboxFeatureSource"
import ThemeViewStateHashActor from "../Logic/Web/ThemeViewStateHashActor"
import NoElementsInViewDetector, {
FeatureViewState,
} from "../Logic/Actors/NoElementsInViewDetector"
import NoElementsInViewDetector, {FeatureViewState,} from "../Logic/Actors/NoElementsInViewDetector"
import FilteredLayer from "./FilteredLayer";
/**
*
@ -526,9 +521,14 @@ export default class ThemeViewState implements SpecialVisualizationState {
})
}
this.layerState.filteredLayers
const rangeFLayer: FilteredLayer = this.layerState.filteredLayers
.get("range")
?.isDisplayed?.syncWith(this.featureSwitches.featureSwitchIsTesting, true)
const rangeIsDisplayed = rangeFLayer?.isDisplayed
if (!QueryParameters.wasInitialized(FilteredLayer.queryParameterKey(rangeFLayer.layerDef))) {
rangeIsDisplayed?.syncWith(this.featureSwitches.featureSwitchIsTesting, true)
}
this.layerState.filteredLayers.forEach((flayer) => {
const id = flayer.layerDef.id

View file

@ -458,6 +458,7 @@ export default class ShowDataLayer {
features: FeatureSource,
doShowLayer?: Store<boolean>
): ShowDataLayer {
return new ShowDataLayer(map, {
layer: ShowDataLayer.rangeLayer,
features,

View file

@ -4,6 +4,7 @@
"title": null,
"source": "special",
"name": null,
"shownByDefault": false,
"mapRendering": [
{
"width": 3,