forked from MapComplete/MapComplete
Add names to feature sources, fix that old, cached geometries get changed when a newer version is loaded
This commit is contained in:
parent
6234d26bac
commit
141d4db028
14 changed files with 60 additions and 43 deletions
|
@ -3,10 +3,11 @@ import {UIEventSource} from "../UIEventSource";
|
|||
import State from "../../State";
|
||||
|
||||
export default class RegisteringFeatureSource implements FeatureSource {
|
||||
features: UIEventSource<{ feature: any; freshness: Date }[]>;
|
||||
|
||||
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.features.addCallbackAndRun(features => {
|
||||
for (const feature of features ?? []) {
|
||||
if (!State.state.allElements.has(feature.feature.properties.id)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue