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