# up async plugin
This commit is contained in:
parent
b21d0af572
commit
dd4da1e6f4
|
@ -169,12 +169,6 @@ export default {
|
|||
resizeEnable: true,
|
||||
zoom: 13
|
||||
})
|
||||
// new AMap.Marker({
|
||||
// position: this.coordinate,
|
||||
// zIndex: 10,
|
||||
// title: this.deviceList[0].title,
|
||||
// map: map
|
||||
// })
|
||||
const drivingOptions = {
|
||||
map: map,
|
||||
// city: '中山市',
|
||||
|
@ -182,16 +176,21 @@ export default {
|
|||
// cityd:'乌鲁木齐',
|
||||
// policy: AMap.DrivingPolicy.LEAST_TIME
|
||||
}
|
||||
const driving = new AMap.Driving(drivingOptions)
|
||||
const button = document.getElementById('bt')
|
||||
driving.search(new AMap.LngLat(113.344095, 22.673091), new AMap.LngLat(113.203460828994, 22.64902452257), (status, result) => {
|
||||
button.onclick = () => {
|
||||
driving.searchOnAMAP({
|
||||
origin: result.origin,
|
||||
destination: result.destination
|
||||
})
|
||||
}
|
||||
AMap.plugin(['AMap.ToolBar', 'AMap.Scale', 'AMap.Driving'], () => {
|
||||
map.addControl(new AMap.ToolBar())
|
||||
map.addControl(new AMap.Scale())
|
||||
const driving = new AMap.Driving(drivingOptions)
|
||||
driving.search(new AMap.LngLat(113.344095, 22.673091), new AMap.LngLat(113.203460828994, 22.64902452257), (status, result) => {
|
||||
button.onclick = () => {
|
||||
driving.searchOnAMAP({
|
||||
origin: result.origin,
|
||||
destination: result.destination
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
// const driving = new AMap.Driving(drivingOptions)
|
||||
this.flag = true
|
||||
// if (AMap.UA.mobile) {
|
||||
// document.getElementById('panel').style.display = 'none'
|
||||
|
|
Loading…
Reference in New Issue