|
|
@ -465,11 +465,11 @@ export default { |
|
|
var geolocation = new BMap.Geolocation(); |
|
|
var geolocation = new BMap.Geolocation(); |
|
|
geolocation.getCurrentPosition(function(r) { |
|
|
geolocation.getCurrentPosition(function(r) { |
|
|
if (this.getStatus() == BMAP_STATUS_SUCCESS) { |
|
|
if (this.getStatus() == BMAP_STATUS_SUCCESS) { |
|
|
if(r.accuracy==null){ |
|
|
|
|
|
alert('您已拒绝地理位置授权'); |
|
|
|
|
|
//用户决绝地理位置授权 |
|
|
|
|
|
return; |
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
// if(r.accuracy==null){ |
|
|
|
|
|
// alert('您已拒绝地理位置授权'); |
|
|
|
|
|
// //用户决绝地理位置授权 |
|
|
|
|
|
// return; |
|
|
|
|
|
// }else{ |
|
|
const myGeo = new BMap.Geocoder() |
|
|
const myGeo = new BMap.Geocoder() |
|
|
myGeo.getLocation(new BMap.Point(r.point.lng, r.point.lat), data => { |
|
|
myGeo.getLocation(new BMap.Point(r.point.lng, r.point.lat), data => { |
|
|
if (data.addressComponents) { |
|
|
if (data.addressComponents) { |
|
|
@ -486,7 +486,7 @@ export default { |
|
|
alert("省-"+location.creditProvince+";市-"+location.creditCity+";区-"+location.creditArea+";街道-"+location.creditStreet+";lat-"+location.creditLatitude+";lng-"+location.creditLongitude); |
|
|
alert("省-"+location.creditProvince+";市-"+location.creditCity+";区-"+location.creditArea+";街道-"+location.creditStreet+";lat-"+location.creditLatitude+";lng-"+location.creditLongitude); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
|
|
|
|
|
|
// } |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|