更新插件
This commit is contained in:
@@ -49,17 +49,16 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- 2. 加载地图和插件 -->
|
<!-- 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,AMap.ToolBar,AMap.Geolocation,AMap.Scale"></script>
|
||||||
<script src="https://webapi.amap.com/maps?v=2.0&key=2cc1d822e313307fe311c3127a1deeb5&plugin=AMap.MoveAnimation,AMap.Driving,AMap.TruckDriving,AMap.AutoComplete"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="search-box">
|
<div id="search-box">
|
||||||
<div class="input-row">
|
<div class="input-row">
|
||||||
<input id="startInput" placeholder="起点: 默认使用当前位置" />
|
<input id="startInput" placeholder="起点: 默认使用当前位置"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-row">
|
<div class="input-row">
|
||||||
<input id="endInput" placeholder="终点: 请输入目的地" />
|
<input id="endInput" placeholder="终点: 请输入目的地"/>
|
||||||
<button onclick="startRouteSearch()">路径规划</button>
|
<button onclick="startRouteSearch()">路径规划</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,6 +80,25 @@
|
|||||||
viewMode: '3D'
|
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({
|
driving = new AMap.Driving({
|
||||||
map: map,
|
map: map,
|
||||||
|
|||||||
Reference in New Issue
Block a user