# add transfer plan
This commit is contained in:
parent
a75bcabf86
commit
97af9a4e6a
|
@ -11,6 +11,6 @@
|
|||
<!-- <script src=<%= htmlWebpackPlugin.options.path %>/tinymce4.7.5/tinymce.min.js></script> -->
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=49842c6fe4d24df80871faec2e272a00"></script>
|
||||
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=49842c6fe4d24df80871faec2e272a00&plugin=AMap.Transfer"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div id="map-container" tabindex="0"></div>
|
||||
<div id="panel"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -159,16 +160,28 @@ export default {
|
|||
this.coordinate = [113.203460828994, 22.64902452257]
|
||||
}
|
||||
const map = new AMap.Map('map-container', {
|
||||
center: this.coordinate,
|
||||
// center: this.coordinate,
|
||||
center: [116.397428, 39.90923],
|
||||
resizeEnable: true,
|
||||
zoom: 16
|
||||
})
|
||||
new AMap.Marker({
|
||||
position: this.coordinate,
|
||||
zIndex: 10,
|
||||
title: this.deviceList[0].title,
|
||||
map: map
|
||||
zoom: 13
|
||||
})
|
||||
// new AMap.Marker({
|
||||
// position: this.coordinate,
|
||||
// zIndex: 10,
|
||||
// title: this.deviceList[0].title,
|
||||
// map: map
|
||||
// })
|
||||
const transOptions = {
|
||||
map: map,
|
||||
city: '北京市',
|
||||
panel: 'panel',
|
||||
// cityd:'乌鲁木齐',
|
||||
policy: AMap.TransferPolicy.LEAST_TIME
|
||||
}
|
||||
// 构造公交换乘类
|
||||
const transfer = new AMap.Transfer(transOptions)
|
||||
// 根据起、终点坐标查询公交换乘路线
|
||||
transfer.search(new AMap.LngLat(116.291035, 39.907899), new AMap.LngLat(116.427281, 39.903719))
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -250,4 +263,14 @@ export default {
|
|||
position: relative;
|
||||
z-index: 104;
|
||||
}
|
||||
#panel {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
max-height: 80%;
|
||||
overflow-y: auto;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
width: 250px;
|
||||
border: solid 1px silver;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue