A new element now shows up directly on the map

This commit is contained in:
Pieter Vander Vennet 2021-01-04 22:14:56 +01:00
parent bee2878b76
commit 32bc1433b4
5 changed files with 24 additions and 15 deletions

View file

@ -36,8 +36,11 @@ export default class FeatureDuplicatorPerLayer implements FeatureSource {
return;
}
let foundALayer = false;
for (const layer of layers) {
if (layer.layerDef.overpassTags.matchesProperties(f.feature.properties)) {
foundALayer = true;
if (layer.layerDef.passAllFeatures) {
// We copy the feature; the "properties" field is kept identical though!
@ -58,6 +61,9 @@ export default class FeatureDuplicatorPerLayer implements FeatureSource {
}
}
}
if(!foundALayer){
console.error("LAYER DEDUP PANIC: no suitable layer found for ", f, JSON.stringify(f), "within layers", layers)
}
}
return newFeatures;