Refactoring: remove selectedLayer where unneeded

This commit is contained in:
Pieter Vander Vennet 2024-02-20 18:17:29 +01:00
parent 3e0a42ef46
commit 5d09b31c50
8 changed files with 14 additions and 77 deletions

View file

@ -25,7 +25,7 @@ export default class MetaTagging {
>()
constructor(state: {
readonly selectedElementAndLayer: Store<{ feature: Feature; layer: LayerConfig }>
readonly selectedElement: Store<Feature>
readonly layout: LayoutConfig
readonly osmObjectDownloader: OsmObjectDownloader
readonly perLayer: ReadonlyMap<string, GeoIndexedStoreForLayer>
@ -61,7 +61,8 @@ export default class MetaTagging {
})
}
state.selectedElementAndLayer.addCallbackAndRunD(({ feature, layer }) => {
state.selectedElement.addCallbackAndRunD((feature) => {
const layer = state.layout.getMatchingLayer(feature.properties)
// Force update the tags of the currently selected element
MetaTagging.addMetatags(
[feature],