Refactoring: add metatagging

This commit is contained in:
Pieter Vander Vennet 2023-04-14 17:53:08 +02:00
parent adab786375
commit 3db87232f2
11 changed files with 101 additions and 191 deletions

View file

@ -35,7 +35,7 @@ export default class FilteredLayer {
constructor(
layer: LayerConfig,
appliedFilters?: Map<string, UIEventSource<undefined | number | string>>,
appliedFilters?: ReadonlyMap<string, UIEventSource<undefined | number | string>>,
isDisplayed?: UIEventSource<boolean>
) {
this.layerDef = layer

View file

@ -76,6 +76,13 @@ export interface TagRenderingConfigJson {
* */
condition?: TagConfigJson
/**
* If set, this tag will be evaluated agains the _usersettings/application state_ table.
* Enable 'show debug info' in user settings to see available options.
* Note that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_
*/
metacondition?: TagConfigJson
/**
* Allow freeform text input from the user
*/

View file

@ -41,6 +41,7 @@ import { GeoIndexedStoreForLayer } from "../Logic/FeatureSource/Actors/GeoIndexe
import { LastClickFeatureSource } from "../Logic/FeatureSource/Sources/LastClickFeatureSource"
import SimpleFeatureSource from "../Logic/FeatureSource/Sources/SimpleFeatureSource"
import { MenuState } from "./MenuState"
import MetaTagging from "../Logic/MetaTagging"
/**
*
@ -101,7 +102,12 @@ export default class ThemeViewState implements SpecialVisualizationState {
),
osmConfiguration: <"osm" | "osm-test">this.featureSwitches.featureSwitchApiURL.data,
})
this.userRelatedState = new UserRelatedState(this.osmConnection, layout?.language, layout)
this.userRelatedState = new UserRelatedState(
this.osmConnection,
layout?.language,
layout,
this.featureSwitches
)
this.selectedElement = new UIEventSource<Feature | undefined>(undefined, "Selected element")
this.selectedLayer = new UIEventSource<LayerConfig>(undefined, "Selected layer")
this.geolocation = new GeoLocationHandler(
@ -323,10 +329,9 @@ export default class ThemeViewState implements SpecialVisualizationState {
/**
* Setup various services for which no reference are needed
* @private
*/
private initActors() {
// Various actors that we don't need to reference
new MetaTagging(this)
new TitleHandler(this.selectedElement, this.selectedLayer, this.featureProperties, this)
new ChangeToElementsActor(this.changes, this.featureProperties)
new PendingChangesUploader(this.changes, this.selectedElement)