forked from MapComplete/MapComplete
Refactoring of metatagging and extrafunctions to splice out the relation memberships, add calculatedTags and metatags into cache
This commit is contained in:
parent
362abbf079
commit
0dec1d0f75
10 changed files with 98 additions and 54 deletions
|
@ -11,6 +11,10 @@ import LayerConfig from "../../Customizations/JSON/LayerConfig";
|
|||
export default class FeatureDuplicatorPerLayer implements FeatureSource {
|
||||
public readonly features: UIEventSource<{ feature: any; freshness: Date }[]>;
|
||||
|
||||
|
||||
public static GetMatchingLayerId(){
|
||||
|
||||
}
|
||||
|
||||
constructor(layers: UIEventSource<{ layerDef: LayerConfig }[]>, upstream: FeatureSource) {
|
||||
this.features = upstream.features.map(features => {
|
||||
|
|
|
@ -35,7 +35,7 @@ export default class FeaturePipeline implements FeatureSource {
|
|||
|
||||
const geojsonSources: FeatureSource [] = GeoJsonSource
|
||||
.ConstructMultiSource(flayers.data, locationControl)
|
||||
.map(geojsonSource => new RegisteringFeatureSource(new FeatureDuplicatorPerLayer(flayers, geojsonSource)));
|
||||
.map(geojsonSource => new RegisteringFeatureSource(new FeatureDuplicatorPerLayer(flayers, geojsonSource)));
|
||||
|
||||
const amendedLocalStorageSource =
|
||||
new RememberingSource(new RegisteringFeatureSource(new FeatureDuplicatorPerLayer(flayers, new LocalStorageSource(layout))
|
||||
|
|
|
@ -3,6 +3,7 @@ import {UIEventSource} from "../UIEventSource";
|
|||
import State from "../../State";
|
||||
import Hash from "../Web/Hash";
|
||||
import MetaTagging from "../MetaTagging";
|
||||
import ExtractRelations from "../Osm/ExtractRelations";
|
||||
|
||||
export default class MetaTaggingFeatureSource implements FeatureSource {
|
||||
features: UIEventSource<{ feature: any; freshness: Date }[]> = new UIEventSource<{feature: any; freshness: Date}[]>(undefined);
|
||||
|
@ -21,7 +22,7 @@ export default class MetaTaggingFeatureSource implements FeatureSource {
|
|||
}
|
||||
})
|
||||
|
||||
MetaTagging.addMetatags(featuresFreshness, State.state.layoutToUse.data.layers);
|
||||
MetaTagging.addMetatags(featuresFreshness, State.state.knownRelations.data, State.state.layoutToUse.data.layers);
|
||||
self.features.setData(featuresFreshness);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue