1. 程式人生 > >小程式切換地圖位置

小程式切換地圖位置

moveToLocation: function () {

var that = this;

wx.chooseLocation({

success: function (res) {

let mobileLocation = {

longitude: res.longitude,

latitude: res.latitude,

address: res.address,

};

that.setData({

mobileLocation: mobileLocation,

});

},

fail: function (err) { console.log(err) }

});

}