diff --git a/lib/features/home/presentation/widgets/map/testmap_pages.dart b/lib/features/home/presentation/widgets/map/testmap_pages.dart index a3741544..ad367073 100644 --- a/lib/features/home/presentation/widgets/map/testmap_pages.dart +++ b/lib/features/home/presentation/widgets/map/testmap_pages.dart @@ -764,47 +764,54 @@ class _MapPageEnterpriseState extends State { try { // 2. 重置所有页面状态(恢复初始值) setState(() { - _traceManager.setMode(TPMode.LOCATION); - // 清空打点和轨迹数据 + _traceManager.setMode(TPMode.LOCATION); + + // 2. 清空打点和轨迹数据 _markedPoints.clear(); gcjPathPoints.clear(); _robotModeObsWgsPoints.clear(); gcjOuterPoints.clear(); _robotModeWgsPoints.clear(); + + // 3. 重置作业区域状态 _isWorkAreaCompleted = false; _saveBoxOpen = false; _showControlModeWarn = false; _showHeadingWarn = false; - // 重置面板状态 + // 4. 重置面板状态 _isPanelOpen = false; _directionBoxOpen = false; _isListBoxOpen = false; _isWorkPanelOpen = false; + + // 5. 重置障碍物数据 _obstacleHoles.clear(); _currentObstaclePoints.clear(); _isObstacleEditing = false; - // 重置选中状态 + // 6. 重置选中状态 _selectedPlot = null; - _selectedPlotPath = null; - // 重置作业模式 + // 7. 重置作业模式 _currentRobotMode = RobotMode.robot; _currentAreaMode = AreaMode.work; _currentWorkMode = WorkMode.bow; - // 重置参数 + // 8. 重置作业参数 _workDistance = 0.0; _angle = 0.0; - // 🔥 修复2:优先恢复地图中心,而非定位坐标 + + // 9. 重置地图与定位状态(关键修复) _currentLatLng = null; _currentWgsLatLng = null; _mapCenter = _getDefaultValidCenter(); // 仅用兜底坐标初始化地图中心 + // 10. 重置作业状态 isDjMapShow = false; _workStatus = WorkStatus.idle; + isStartWork = false; }); _clearLocalData(); @@ -1649,6 +1656,7 @@ class _MapPageEnterpriseState extends State { _workStatus = WorkStatus.idle; _showHeadingWarn = false; _showControlModeWarn = false; + isStartWork = false; }); }, icon: const Icon(Icons.close, color: Colors.grey, size: 20),