From 7dadeed1531a7bfbac7750d337daa61a6636d396 Mon Sep 17 00:00:00 2001 From: nesxy Date: Wed, 14 Aug 2019 03:12:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=99=BE=E5=BA=A6=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/home.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/view/home.vue b/src/view/home.vue index b96309a..4d03244 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -462,7 +462,8 @@ export default { }, getCity(){ let _this = this - var geolocation = new BMap.Geolocation(); + alert(this.Bmap) + var geolocation = this.Bmap.Geolocation(); geolocation.getCurrentPosition(function(r) { if (this.getStatus() == BMAP_STATUS_SUCCESS) { if(r.accuracy==null){ @@ -470,8 +471,8 @@ export default { //用户决绝地理位置授权 return; }else{ - const myGeo = new BMap.Geocoder() - myGeo.getLocation(new BMap.Point(r.point.lng, r.point.lat), data => { + const myGeo = this.Bmap.Geocoder() + myGeo.getLocation(this.Bmap.Point(r.point.lng, r.point.lat), data => { if (data.addressComponents) { const result = data.addressComponents const location = {