diff --git a/index.html b/index.html index 6f888bc..bdf56e4 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,6 @@
- + diff --git a/src/views/counter/map2.vue b/src/views/counter/map2.vue index 7bcb6a9..f967618 100644 --- a/src/views/counter/map2.vue +++ b/src/views/counter/map2.vue @@ -1,6 +1,7 @@ @@ -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; +}