|
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
- <title>驾车导航-使用默认皮肤</title>
- <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main.css?v=1.0"/>
- <style type="text/css">
- #panel {
- position: fixed;
- background-color: white;
- max-height: 90%;
- overflow-y: auto;
- top: 10px;
- right: 10px;
- width: 280px;
- }
- </style>
- <script type="text/javascript"
- src="http://webapi.amap.com/maps?v=1.3&key=b568111477df5420d6290da6ca282b1e">
- </script>
- </head>
- <body>
- <div id="mapContainer"></div>
- <div id="panel">
- </div>
- <script type="text/javascript">
- //基本地图加载
- var map = new AMap.Map("mapContainer", {
- resizeEnable: true,
- center: [116.397428, 39.90923],//地图中心点
- zoom: 13 //地图显示的缩放级别
- });
- //步行导航
- AMap.service(["AMap.Driving"], function() {
- var driving = new AMap.Driving({
- map: map,
- panel: "panel"
- }); //构造路线导航类
- // 根据起终点坐标规划步行路线
- driving.search([
- {keyword: '上海虹桥'},
- {keyword: '四季周庄'}
- ]);
- });
- </script>
- </body>
- </html>
|