原創聲明:本文為作者原創,未經允許不得轉載,經授權轉載需注明作者和出處
大牛們好,小白想做一個可以在管理后臺設置地圖導航的位置(可以設多個,就像多用戶商城中名店鋪的導航的功能。),但wx.openLocation中的latitude、longitude值如何獲取data中的值?請大牛們多多指教,感謝!
data: {
latitude: ‘23.265319’,
longitude: ‘113.786774’
}
openMap: function () {
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的經緯度
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
wx.openLocation({
latitude://這里應該怎么填寫?,
longitude: //這里應該怎么填寫?,
scale: 28
})
}
})
}