Better handling of metatags, more robust error handling when calculating tags

This commit is contained in:
Pieter Vander Vennet 2021-05-10 23:51:03 +02:00
parent 69363fbf0f
commit 6ac8a5373c
10 changed files with 134 additions and 89 deletions

View file

@ -3,16 +3,15 @@ import {UIEventSource} from "../UIEventSource";
import State from "../../State";
export default class RegisteringFeatureSource implements FeatureSource {
public readonly features: UIEventSource<{ feature: any; freshness: Date }[]>;
public readonly name;
public readonly features: UIEventSource<{ feature: any; freshness: Date }[]>;
public readonly name;
constructor(source: FeatureSource) {
this.features = source.features;
this.name = "RegisteringSource of "+source.name;
this.name = "RegisteringSource of " + source.name;
this.features.addCallbackAndRun(features => {
for (const feature of features ?? []) {
if (!State.state.allElements.has(feature.feature.properties.id)) {
State.state.allElements.addOrGetElement(feature.feature)
}
State.state.allElements.addOrGetElement(feature.feature)
}
})
}