From 45bf73aeee2c6b1d6d0148b7a1c44d9c61a51cf0 Mon Sep 17 00:00:00 2001 From: stopflock Date: Thu, 28 Aug 2025 12:35:40 -0500 Subject: [PATCH] preserve _tags in cam cache, make line purple and thicker --- lib/services/camera_cache.dart | 18 +++++++++++++++++- lib/widgets/map_view.dart | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/services/camera_cache.dart b/lib/services/camera_cache.dart index 777b6de..0de43a5 100644 --- a/lib/services/camera_cache.dart +++ b/lib/services/camera_cache.dart @@ -13,7 +13,23 @@ class CameraCache { /// Add or update a batch of camera nodes in the cache. void addOrUpdate(List 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.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; + } } } diff --git a/lib/widgets/map_view.dart b/lib/widgets/map_view.dart index 84286be..89f7d30 100644 --- a/lib/widgets/map_view.dart +++ b/lib/widgets/map_view.dart @@ -417,8 +417,8 @@ class MapViewState extends State { if (originalCoord != null) { lines.add(Polyline( points: [originalCoord, camera.coord], - color: Colors.orange.withOpacity(0.7), - strokeWidth: 2.0, + color: kCameraRingColorPending, + strokeWidth: 3.0, )); } }