builds, needs work

This commit is contained in:
stopflock
2025-08-28 10:22:57 -05:00
parent 2db4f597dc
commit aee0dcf8b8
10 changed files with 362 additions and 12 deletions
+16
View File
@@ -225,6 +225,7 @@ class MapViewState extends State<MapView> {
Widget build(BuildContext context) {
final appState = context.watch<AppState>();
final session = appState.session;
final editSession = appState.editSession;
// Check if enabled profiles changed and refresh cameras if needed
final currentEnabledProfiles = appState.enabledProfiles;
@@ -272,6 +273,17 @@ class MapViewState extends State<MapView> {
);
} catch (_) {/* controller not ready yet */}
}
// For edit sessions, center the map on the camera being edited initially
if (editSession != null && _controller.camera.center != editSession.target) {
WidgetsBinding.instance.addPostFrameCallback(
(_) {
try {
_controller.move(editSession.target, _controller.camera.zoom);
} catch (_) {/* controller not ready yet */}
},
);
}
final zoom = _safeZoom();
// Fetch cached cameras for current map bounds (using Consumer so overlays redraw instantly)
@@ -323,6 +335,9 @@ class MapViewState extends State<MapView> {
if (session != null) {
appState.updateSession(target: pos.center);
}
if (editSession != null) {
appState.updateEditSession(target: pos.center);
}
// Show waiting indicator when map moves (user is expecting new content)
NetworkStatus.instance.setWaiting();
@@ -365,6 +380,7 @@ class MapViewState extends State<MapView> {
mapController: _controller,
uploadMode: appState.uploadMode,
session: session,
editSession: editSession,
attribution: appState.selectedTileType?.attribution,
),