修复绘制点偏移
This commit is contained in:
@@ -1140,7 +1140,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
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<MapPageEnterprise> {
|
||||
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<MapPageEnterprise> {
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user