From 3f55de3593c8fd276ca4adc923b7f6ba56ab57e8 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Mon, 9 Mar 2026 13:42:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=80=8D=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widgets/map/testmap_pages.dart | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/features/home/presentation/widgets/map/testmap_pages.dart b/lib/features/home/presentation/widgets/map/testmap_pages.dart index 71f81b12..81a63868 100644 --- a/lib/features/home/presentation/widgets/map/testmap_pages.dart +++ b/lib/features/home/presentation/widgets/map/testmap_pages.dart @@ -1186,10 +1186,11 @@ class _MapPageEnterpriseState extends State { mapController: _mapController, options: MapOptions( initialCenter: __isValidLatLng(_currentLatLng) ? _currentLatLng! : initCenter, - initialZoom: 22, - maxZoom: 22, + initialZoom: 18, + maxZoom: 18, minZoom: 3, enableScrollWheel: true, + // 🔥 视觉放大:通过缩放系数实现"伪20级"显示(无空白) onTap: (_, __) {}, // 空实现,禁用地图点击响应 ), children: [ @@ -1201,6 +1202,16 @@ class _MapPageEnterpriseState extends State { 'https://webrd02.is.autonavi.com/appmaptile' '?style=8&x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1' '&key=bbb1f0f20eed6bf679eddf2625630aba', + // 🔥 修复:适配高DPI(替代pixelRatio) + // tileSize: 512, // 高清瓦片尺寸(默认256,改为512适配scale=2) + tileProvider: NetworkTileProvider( + // 自定义瓦片请求头(可选,提升兼容性) + headers: { + 'Referer': 'https://www.amap.com', // 高德要求的Referer + }, + ), + + maxZoom: 18, ), // 绘制path折线(Line模式) @@ -1993,7 +2004,18 @@ class _MapPageEnterpriseState extends State { body: SafeArea( child: Stack( children: [ - RepaintBoundary(key: _mapRepaintKey, child: _buildMap(currentLat, currentLng, obfFlag, headingStatus, controlMode)), + // 🔥 核心:用Transform.scale实现视觉放大1.5倍 + Transform.scale( + scale: 1.5, // 放大倍数 + // 对齐方式:以地图中心为缩放原点(避免偏移) + alignment: Alignment.center, + child: RepaintBoundary( + key: _mapRepaintKey, + // 你的地图构建方法 + child: _buildMap(currentLat, currentLng, obfFlag, headingStatus, controlMode), + ), + ), + //RepaintBoundary(key: _mapRepaintKey, child: _buildMap(currentLat, currentLng, obfFlag, headingStatus, controlMode)), // 地图核心组件 if (_isRefreshing)