forked from MapComplete/MapComplete
A new element now shows up directly on the map
This commit is contained in:
parent
bee2878b76
commit
32bc1433b4
5 changed files with 24 additions and 15 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -90,9 +90,6 @@ export class Changes implements FeatureSource{
|
|||
}
|
||||
}
|
||||
|
||||
this.features.data.push({feature:geojson, freshness: new Date()});
|
||||
this.features.ping();
|
||||
|
||||
// The basictags are COPIED, the id is included in the properties
|
||||
// The tags are not yet written into the OsmObject, but this is applied onto a
|
||||
const changes = [];
|
||||
|
@ -104,6 +101,10 @@ export class Changes implements FeatureSource{
|
|||
changes.push({elementId: id, key: kv.key, value: kv.value})
|
||||
}
|
||||
State.state.allElements.addOrGetElement(geojson).ping();
|
||||
|
||||
this.features.data.push({feature:geojson, freshness: new Date()});
|
||||
this.features.ping();
|
||||
|
||||
this.uploadAll([osmNode], changes);
|
||||
return geojson;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue