From 9ba03b9917d614e2438bad3147a98dad4e0033d4 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Sat, 28 Feb 2026 17:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E7=94=9F=E6=88=90=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/widgets/map/testmap_pages.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/features/home/presentation/widgets/map/testmap_pages.dart b/lib/features/home/presentation/widgets/map/testmap_pages.dart index 282905ee..13ae62d7 100644 --- a/lib/features/home/presentation/widgets/map/testmap_pages.dart +++ b/lib/features/home/presentation/widgets/map/testmap_pages.dart @@ -800,8 +800,8 @@ class _MapPageEnterpriseState extends State { polylines: [ Polyline( points: gcjPathPoints, // 转换后的GCJ02坐标 - color: Colors.blueAccent, // 折线颜色(可自定义) - strokeWidth: 3.0, // 折线宽度 + color: const Color.fromARGB(255, 223, 228, 116), // 折线颜色(可自定义) + strokeWidth: 1.0, // 折线宽度 isDotted: false, // 非虚线(Line模式) borderColor: Colors.white, // 可选:添加白色描边,提升辨识度 borderStrokeWidth: 0.5, @@ -817,7 +817,7 @@ class _MapPageEnterpriseState extends State { points: gcjOuterPoints, // 转换后的GCJ02坐标 color: Colors.green.withOpacity(0.1), // 内部填充色(透明) borderColor: Colors.green, // 边框颜色 - borderStrokeWidth: 2.0, // 边框宽度 + borderStrokeWidth: 1.0, // 边框宽度 isFilled: true, // 开启填充(即使透明,也需要开启才能显示边框) ), ], @@ -1102,7 +1102,7 @@ class _MapPageEnterpriseState extends State { debugPrint('生成的路径数据:${cubitState.generatedPath}'); // 可选:将生成的路径转换为地图可显示的坐标(WGS84 → GCJ02) - if (cubitState.generatedPath is List) { + if (cubitState.generatedPath is List) { setState(() { // 先将 List 转换为 List final pathList = cubitState.generatedPath as List; @@ -1116,7 +1116,8 @@ class _MapPageEnterpriseState extends State { return LatLng(gcjPoint.latitude, gcjPoint.longitude); }).toList(); - gcjOuterPoints = _markedPoints; + gcjOuterPoints = List.from(_markedPoints); // 生成新列表,复制所有元素 // ========== 核心修改:清空临时打点列表 ========== + _markedPoints.clear(); // 清空后,临时划线会自动消失 }); moveMapToPointsCenter(gcjPathPoints); } @@ -1130,7 +1131,10 @@ class _MapPageEnterpriseState extends State { } // 5. 关闭操作面板 - setState(() => _isPanelOpen = false); + setState(() { + _isPanelOpen = false; // 关闭操作面板 + _currentWorkMode = null; // 清空作业模式,清除弓字模式的绿色半透明区域 + }); }, onUndoTap: _undoLastPoint, onDeleteTap: _deleteAllPoints,