更新插件

This commit is contained in:
2025-11-27 09:30:52 +08:00
parent b854d295f9
commit aa30d13b91

View File

@@ -49,8 +49,7 @@
</script>
<!-- 2. 加载地图和插件 -->
<!-- 注意如果你要货车规划需要在plugin里加上 AMap.TruckDriving -->
<script src="https://webapi.amap.com/maps?v=2.0&key=2cc1d822e313307fe311c3127a1deeb5&plugin=AMap.MoveAnimation,AMap.Driving,AMap.TruckDriving,AMap.AutoComplete"></script>
<script src="https://webapi.amap.com/maps?v=2.0&key=2cc1d822e313307fe311c3127a1deeb5&plugin=AMap.MoveAnimation,AMap.Driving,AMap.TruckDriving,AMap.AutoComplete,AMap.ToolBar,AMap.Geolocation,AMap.Scale"></script>
</head>
<body>
@@ -81,6 +80,25 @@
viewMode: '3D'
});
// --- 新增:添加地图控件 ---
map.addControl(new AMap.Scale()); // 比例尺
map.addControl(new AMap.ToolBar({
position: {
bottom: '80px',
right: '10px'
}
})); // 缩放
map.addControl(new AMap.Geolocation({ // 定位
enableHighAccuracy: true,
timeout: 10000,
zoomToAccuracy: true,
position: {
bottom: '20px',
right: '10px'
}
}));
// --- 初始化轿车规划 ---
driving = new AMap.Driving({
map: map,