preserve _tags in cam cache, make line purple and thicker

This commit is contained in:
stopflock
2025-08-28 12:35:40 -05:00
parent 7ff945e262
commit 45bf73aeee
2 changed files with 19 additions and 3 deletions
+17 -1
View File
@@ -13,7 +13,23 @@ class CameraCache {
/// Add or update a batch of camera nodes in the cache.
void addOrUpdate(List<OsmCameraNode> nodes) {
for (var node in nodes) {
_nodes[node.id] = node;
final existing = _nodes[node.id];
if (existing != null) {
// Preserve any tags starting with underscore when updating existing nodes
final mergedTags = Map<String, String>.from(node.tags);
for (final entry in existing.tags.entries) {
if (entry.key.startsWith('_')) {
mergedTags[entry.key] = entry.value;
}
}
_nodes[node.id] = OsmCameraNode(
id: node.id,
coord: node.coord,
tags: mergedTags,
);
} else {
_nodes[node.id] = node;
}
}
}
+2 -2
View File
@@ -417,8 +417,8 @@ class MapViewState extends State<MapView> {
if (originalCoord != null) {
lines.add(Polyline(
points: [originalCoord, camera.coord],
color: Colors.orange.withOpacity(0.7),
strokeWidth: 2.0,
color: kCameraRingColorPending,
strokeWidth: 3.0,
));
}
}