
map.js
Page({
/**
* 页面的初始数据
*/
data: {
myaddress: [],
},
/**
* 地图
*/
changelocation() {
wx.chooseLocation({
success: (res) => {
this.setData({
myaddress: res.address
})
},
})
},
})

map.wxml
<text>定位:{{myaddress}}</text>
<button bindtap="changelocation">地图</button>
网友评论