mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-06 07:57:06 +02:00
mildly silly way of fixing constraint inheritance for cached nodes following an edit
This commit is contained in:
1 parent
c317178117
commit
6c9abba15b
3 files changed
+75
-2
No files matched your search
@@ -30,7 +30,9 @@ class NodeCache {
|
||||
id: node.id,
|
||||
coord: node.coord,
|
||||
tags: mergedTags,
|
||||
isConstrained: node.isConstrained, // Preserve constraint information
|
||||
// Once a node is known to be constrained, keep it that way - see
|
||||
// NodeSpatialCache.addOrUpdateNodes for the full explanation.
|
||||
isConstrained: existing.isConstrained || node.isConstrained,
|
||||
);
|
||||
} else {
|
||||
_nodes[node.id] = node;
|
||||
|
||||
@@ -58,7 +58,13 @@ class NodeSpatialCache {
|
||||
id: node.id,
|
||||
coord: node.coord,
|
||||
tags: mergedTags,
|
||||
isConstrained: node.isConstrained,
|
||||
// Once a node is known to be constrained (part of a way/relation),
|
||||
// keep treating it as constrained. Callers that build a fresh
|
||||
// OsmNode for cache updates (e.g. after an edit upload succeeds)
|
||||
// don't have way/relation data and default to false, so blindly
|
||||
// taking the incoming value would "unconstrain" the node until
|
||||
// the next Overpass fetch.
|
||||
isConstrained: existing.isConstrained || node.isConstrained,
|
||||
);
|
||||
} else {
|
||||
_nodes[node.id] = node;
|
||||
|
||||
Reference in new issue
Block a user