diff --git a/lib/features/home/presentation/widgets/map/testmap_pages.dart b/lib/features/home/presentation/widgets/map/testmap_pages.dart index 506be9e5..e719c06b 100644 --- a/lib/features/home/presentation/widgets/map/testmap_pages.dart +++ b/lib/features/home/presentation/widgets/map/testmap_pages.dart @@ -1140,7 +1140,7 @@ class _MapPageEnterpriseState extends State { options: MapOptions( initialCenter: __isValidLatLng(_currentLatLng) ? _currentLatLng! : initCenter, initialZoom: 18, - maxZoom: 18, + maxZoom: 22, minZoom: 3, enableScrollWheel: true, // 🔥 视觉放大:通过缩放系数实现"伪20级"显示(无空白) @@ -1798,6 +1798,12 @@ class _MapPageEnterpriseState extends State { return work_area_model.Position(lat: wgs84Point.latitude, lon: wgs84Point.longitude); }).toList(); } + gcjOuterPoints = outerPositions.map((point) { + double wgs84Lat = point.lat; + double wgs84Lon = point.lon; + final gcjPoint = wgs84ToGcj02(wgs84Lat, wgs84Lon); + return LatLng(gcjPoint.latitude, gcjPoint.longitude); + }).toList(); final outerBoundary = work_area_model.OuterBoundary(position: outerPositions, sideWidth: _workDistance); @@ -1894,7 +1900,7 @@ class _MapPageEnterpriseState extends State { return LatLng(gcjPoint.latitude, gcjPoint.longitude); }).toList(); // 外边界保持原有逻辑 - gcjOuterPoints = List.from(_markedPoints); + //gcjOuterPoints = List.from(_markedPoints); }); _saveDataToLocal(); moveMapToPointsCenter(gcjPathPoints); @@ -2307,7 +2313,7 @@ LatLng convertWGS84ToGCJ02(double lat, double lon) { /// ======================================================= /// 坐标转换:WGS84 -> GCJ02(国内高德/腾讯通用) /// ======================================================= -const double _pi = 3.14159265358979324; +const double _pi = 3.1415926535897932384626; const double _a = 6378245.0; const double _ee = 0.00669342162296594323;