地图倍率
This commit is contained in:
@@ -1186,10 +1186,11 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
mapController: _mapController,
|
mapController: _mapController,
|
||||||
options: MapOptions(
|
options: MapOptions(
|
||||||
initialCenter: __isValidLatLng(_currentLatLng) ? _currentLatLng! : initCenter,
|
initialCenter: __isValidLatLng(_currentLatLng) ? _currentLatLng! : initCenter,
|
||||||
initialZoom: 22,
|
initialZoom: 18,
|
||||||
maxZoom: 22,
|
maxZoom: 18,
|
||||||
minZoom: 3,
|
minZoom: 3,
|
||||||
enableScrollWheel: true,
|
enableScrollWheel: true,
|
||||||
|
// 🔥 视觉放大:通过缩放系数实现"伪20级"显示(无空白)
|
||||||
onTap: (_, __) {}, // 空实现,禁用地图点击响应
|
onTap: (_, __) {}, // 空实现,禁用地图点击响应
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
@@ -1201,6 +1202,16 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
'https://webrd02.is.autonavi.com/appmaptile'
|
'https://webrd02.is.autonavi.com/appmaptile'
|
||||||
'?style=8&x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1'
|
'?style=8&x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1'
|
||||||
'&key=bbb1f0f20eed6bf679eddf2625630aba',
|
'&key=bbb1f0f20eed6bf679eddf2625630aba',
|
||||||
|
// 🔥 修复:适配高DPI(替代pixelRatio)
|
||||||
|
// tileSize: 512, // 高清瓦片尺寸(默认256,改为512适配scale=2)
|
||||||
|
tileProvider: NetworkTileProvider(
|
||||||
|
// 自定义瓦片请求头(可选,提升兼容性)
|
||||||
|
headers: {
|
||||||
|
'Referer': 'https://www.amap.com', // 高德要求的Referer
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
maxZoom: 18,
|
||||||
),
|
),
|
||||||
|
|
||||||
// 绘制path折线(Line模式)
|
// 绘制path折线(Line模式)
|
||||||
@@ -1993,7 +2004,18 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
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)
|
if (_isRefreshing)
|
||||||
|
|||||||
Reference in New Issue
Block a user