Browse Source

测试百度地图

develop
nesxy 6 years ago
parent
commit
7dadeed153
1 changed files with 4 additions and 3 deletions
  1. 7
      src/view/home.vue

7
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 = {

Loading…
Cancel
Save