修改地图缩放
This commit is contained in:
@@ -1166,14 +1166,21 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
mapController: _mapController,
|
mapController: _mapController,
|
||||||
options: MapOptions(
|
options: MapOptions(
|
||||||
initialCenter: _currentLatLng ?? const LatLng(39.9042, 116.4074),
|
initialCenter: _currentLatLng ?? const LatLng(39.9042, 116.4074),
|
||||||
initialZoom: 20,
|
initialZoom: 18,
|
||||||
maxZoom: 22,
|
// 1. 调整最大缩放级别(匹配高德实际支持的上限)
|
||||||
|
maxZoom: 18,
|
||||||
|
// 2. 增加最小缩放级别(可选,提升体验)
|
||||||
|
minZoom: 3,
|
||||||
|
// 3. 启用连续缩放(支持滚轮精细缩放)
|
||||||
|
enableScrollWheel: true,
|
||||||
// 禁止地图点击事件(避免和中心标冲突)
|
// 禁止地图点击事件(避免和中心标冲突)
|
||||||
onTap: (_, __) {}, // 空实现,禁用地图点击响应
|
onTap: (_, __) {}, // 空实现,禁用地图点击响应
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
/// 高德瓦片(GCJ-02)
|
/// 高德瓦片(GCJ-02)
|
||||||
TileLayer(
|
TileLayer(
|
||||||
|
//https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1'
|
||||||
|
// '&key=bbb1f0f20eed6bf679eddf2625630aba
|
||||||
urlTemplate:
|
urlTemplate:
|
||||||
'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'
|
||||||
|
|||||||
Reference in New Issue
Block a user