From 3d403786282ddb5a47e70dbf9c3e5aebefded125 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 10 Jun 2021 16:55:08 +0200 Subject: [PATCH] Fix bug: fallthrough layers let their features pass again, fixes #349 --- Logic/FeatureSource/FeatureSourceMerger.ts | 4 ++-- Logic/FeatureSource/RememberingSource.ts | 4 ++-- Models/Constants.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Logic/FeatureSource/FeatureSourceMerger.ts b/Logic/FeatureSource/FeatureSourceMerger.ts index 9ceef4429..e9901d1f5 100644 --- a/Logic/FeatureSource/FeatureSourceMerger.ts +++ b/Logic/FeatureSource/FeatureSourceMerger.ts @@ -27,7 +27,7 @@ export default class FeatureSourceMerger implements FeatureSource { // We seed the dictionary with the previously loaded features const oldValues = this.features.data ?? []; for (const oldValue of oldValues) { - all.set(oldValue.feature.id, oldValue) + all.set(oldValue.feature.id + oldValue.feature._matching_layer_id, oldValue) } for (const source of this._sources) { @@ -35,7 +35,7 @@ export default class FeatureSourceMerger implements FeatureSource { continue; } for (const f of source.features.data) { - const id = f.feature.properties.id; + const id = f.feature.properties.id + f.feature._matching_layer_id; if (!all.has(id)) { // This is a new feature somethingChanged = true; diff --git a/Logic/FeatureSource/RememberingSource.ts b/Logic/FeatureSource/RememberingSource.ts index b77e613ac..c840aecba 100644 --- a/Logic/FeatureSource/RememberingSource.ts +++ b/Logic/FeatureSource/RememberingSource.ts @@ -20,9 +20,9 @@ export default class RememberingSource implements FeatureSource { } // Then new ids - const ids = new Set(features.map(f => f.feature.properties.id + f.feature.geometry.type)); + const ids = new Set(features.map(f => f.feature.properties.id + f.feature.geometry.type + f.feature._matching_layer_id)); // the old data - const oldData = oldFeatures.filter(old => !ids.has(old.feature.properties.id + old.feature.geometry.type)) + const oldData = oldFeatures.filter(old => !ids.has(old.feature.properties.id + old.feature.geometry.type + old.feature._matching_layer_id)) return [...features, ...oldData]; }) } diff --git a/Models/Constants.ts b/Models/Constants.ts index 61bb8d3fc..a350603c7 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.7.5a"; + public static vNumber = "0.7.5b"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = {