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