From ec4e49f5dad7839344a7dc6fc6999e68c8e2f756 Mon Sep 17 00:00:00 2001 From: xianfuxing Date: Sun, 2 Sep 2018 14:48:53 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=A0=87=E8=AE=B0=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/counter/map2.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/views/counter/map2.vue b/src/views/counter/map2.vue index 287958e..88efc1c 100644 --- a/src/views/counter/map2.vue +++ b/src/views/counter/map2.vue @@ -158,6 +158,17 @@ export default { if (this.coordinate === null) { 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() { - const device_id = this.$store.getters.deviceID if (this.mapClick) { - this.getDevicesInitMap({ device_id }) this.flag = true + const device_id = this.$store.getters.deviceID + this.getDevicesInitMap({ device_id }) } else { this.initMap() }