# 初步完成跳转标记地图

This commit is contained in:
xianfuxing 2018-09-02 14:48:53 +08:00
parent 720b6a3b63
commit ec4e49f5da
1 changed files with 13 additions and 2 deletions

View File

@ -158,6 +158,17 @@ export default {
if (this.coordinate === null) { if (this.coordinate === null) {
this.coordinate = [113.203460828994, 22.64902452257] this.coordinate = [113.203460828994, 22.64902452257]
} }
const map = new AMap.Map('map-container', {
center: this.coordinate,
resizeEnable: true,
zoom: 16
})
new AMap.Marker({
position: this.coordinate,
zIndex: 10,
title: this.deviceList[0].title,
map: map
})
}) })
} }
}, },
@ -168,10 +179,10 @@ export default {
} }
}, },
mounted() { mounted() {
const device_id = this.$store.getters.deviceID
if (this.mapClick) { if (this.mapClick) {
this.getDevicesInitMap({ device_id })
this.flag = true this.flag = true
const device_id = this.$store.getters.deviceID
this.getDevicesInitMap({ device_id })
} else { } else {
this.initMap() this.initMap()
} }