|
1.看了wex5中接入高德地图的示例和高德js的api开发,觉得x5示例和高德地图api不太一样2.api写在html中的 ,但是写在wex5中的怎么写呢
高德是这样写的
- <!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/main1119.css"/>
- <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=您申请的key值&plugin=AMap.Driving"></script>
- <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
- </head>
- <body>
- <div id="container"></div>
- <div id="panel"></div>
- <script type="text/javascript">
- //基本地图加载
- var map = new AMap.Map("container", {
- resizeEnable: true,
- center: [116.397428, 39.90923],//地图中心点
- zoom: 13 //地图显示的缩放级别
- });
- //构造路线导航类
- var driving = new AMap.Driving({
- map: map,
- panel: "panel"
- });
- // 根据起终点经纬度规划驾车导航路线
- driving.search(new AMap.LngLat(116.379028, 39.865042), new AMap.LngLat(116.427281, 39.903719));
- </script>
- </body>
- </html>
复制代码
那在wex5中应该怎么写呢
|
|