|
|
@ -462,11 +462,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
getCity(){ |
|
|
getCity(){ |
|
|
let _this = this |
|
|
let _this = this |
|
|
// if (!this.BMap) return false |
|
|
|
|
|
// let BMap = this.BMap |
|
|
|
|
|
alert(Bmap); |
|
|
|
|
|
alert(new Bmap) |
|
|
|
|
|
var geolocation = new Bmap.Geolocation(); |
|
|
|
|
|
|
|
|
alert(BMap); |
|
|
|
|
|
alert(new BMap) |
|
|
|
|
|
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){ |
|
|
if(r.accuracy==null){ |
|
|
@ -474,8 +472,8 @@ export default { |
|
|
//用户决绝地理位置授权 |
|
|
//用户决绝地理位置授权 |
|
|
return; |
|
|
return; |
|
|
}else{ |
|
|
}else{ |
|
|
const myGeo = new Bmap.Geocoder() |
|
|
|
|
|
myGeo.getLocation(new Bmap.Point(r.point.lng, r.point.lat), data => { |
|
|
|
|
|
|
|
|
const myGeo = new BMap.Geocoder() |
|
|
|
|
|
myGeo.getLocation(new BMap.Point(r.point.lng, r.point.lat), data => { |
|
|
if (data.addressComponents) { |
|
|
if (data.addressComponents) { |
|
|
const result = data.addressComponents |
|
|
const result = data.addressComponents |
|
|
const location = { |
|
|
const location = { |
|
|
|