forked from MapComplete/MapComplete
Better handling of metatags, more robust error handling when calculating tags
This commit is contained in:
parent
69363fbf0f
commit
6ac8a5373c
10 changed files with 134 additions and 89 deletions
|
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue