微信小程序 打开地图功能
微信小程序 •
•
186次阅读
// 新版打开导航
openMap:function(e){
var that = this
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success (res) {
const name = that.data.address_name
const address = that.data.address_details
const latitude = Number(that.data.latitude)
const longitude = Number(that.data.longitude)
console.log(name)
console.log(address)
console.log(latitude)
console.log(longitude)
wx.openLocation({
name:that.data.address_name,
address:that.data.address_details,
latitude,
longitude,
scale: 16
})
},
fail (res){
console.error("res="+res);
}
})
},
好的习惯,排名第一的是:自律;排名第二的是:终身学习;排名第三的是:保持运动。拥有这三种习惯,美好人生垂手可得。